796 lines
2.3 MiB
796 lines
2.3 MiB
|
||
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c6dc9b5f-fc41-5881-81d2-72e214398494")}catch(e){}}();
|
||
(()=>{var B9={71534:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=x(79695),C=x(44629),I=x(23741);function m(se){var oe=Object.create(null);return se&&Object.keys(se).forEach(function(ye){if(ye!=="default"){var Ee=Object.getOwnPropertyDescriptor(se,ye);Object.defineProperty(oe,ye,Ee.get?Ee:{enumerable:!0,get:function(){return se[ye]}})}}),oe.default=se,Object.freeze(oe)}var b=m(T);const g="Expected Private",w="Expected Point",_="Expected Tweak",A="Expected Hash",S="Expected Signature",k="Expected Extra Data (32 bytes)",B="Expected Scalar",O="Bad Recovery Id";b.utils.hmacSha256Sync=(se,...oe)=>C.hmac(I.sha256,se,b.utils.concatBytes(...oe)),b.utils.sha256Sync=(...se)=>I.sha256(b.utils.concatBytes(...se));const L=b.utils._normalizePrivateKey,D=32,W=32,H=new Uint8Array([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65]),G=32,Z=new Uint8Array(32),Q=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,69,81,35,25,80,183,95,196,64,45,161,114,47,201,186,238]);function ie(se){return se instanceof Uint8Array}function le(se,oe){for(let ye=0;ye<32;++ye)if(se[ye]!==oe[ye])return se[ye]<oe[ye]?-1:1;return 0}function be(se){return le(se,Z)===0}function we(se){return!(!(se instanceof Uint8Array)||se.length!==W||le(se,H)>=0)}function Ae(se){return se instanceof Uint8Array&&se.length===64&&le(se.subarray(0,32),H)<0&&le(se.subarray(32,64),H)<0}function re(se){return ie(se)&&se.length===64&&le(se.subarray(0,32),Q)<0}function N(se){return!(be(se.subarray(0,32))||be(se.subarray(32,64)))}function z(se){return se instanceof Uint8Array&&se.length===D}function V(se){return se===void 0||se instanceof Uint8Array&&se.length===G}function U(se){if(typeof se!="string")throw new TypeError("hexToNumber: expected string, got "+typeof se);return BigInt(`0x${se}`)}function j(se){return U(b.utils.bytesToHex(se))}function $(se){let oe;if(typeof se=="bigint")oe=se;else if(typeof se=="number"&&Number.isSafeInteger(se)&&se>=0)oe=BigInt(se);else if(typeof se=="string"){if(se.length!==64)throw new Error("Expected 32 bytes of private scalar");oe=U(se)}else if(se instanceof Uint8Array){if(se.length!==32)throw new Error("Expected 32 bytes of private scalar");oe=j(se)}else throw new TypeError("Expected valid private scalar");if(oe<0)throw new Error("Expected private scalar >= 0");return oe}const ee=(se,oe)=>{const ye=L(se),Ee=$(oe),me=b.utils._bigintTo32Bytes(b.utils.mod(ye+Ee,b.CURVE.n));return b.utils.isValidPrivateKey(me)?me:null},J=(se,oe)=>{const ye=L(se),Ee=$(oe),me=b.utils._bigintTo32Bytes(b.utils.mod(ye-Ee,b.CURVE.n));return b.utils.isValidPrivateKey(me)?me:null},F=se=>{const oe=L(se),ye=b.utils._bigintTo32Bytes(b.CURVE.n-oe);return b.utils.isValidPrivateKey(ye)?ye:null},X=(se,oe,ye)=>{const Ee=b.Point.fromHex(se),me=$(oe),Te=b.Point.BASE.multiplyAndAddUnsafe(Ee,me,BigInt(1));if(!Te)throw new Error("Tweaked point at infinity");return Te.toRawBytes(ye)},de=(se,oe,ye)=>{const Ee=b.Point.fromHex(se),me=typeof oe=="string"?oe:b.utils.bytesToHex(oe),Te=BigInt(`0x${me}`);return Ee.multiply(Te).toRawBytes(ye)};function Y(se,oe){return se===void 0?oe!==void 0?ke(oe):!0:!!se}function ce(se){try{return se()}catch{return null}}function he(se,oe){if(se.length===32!==oe)return!1;try{return!!b.Point.fromHex(se)}catch{return!1}}function Ie(se){return he(se,!1)}function ke(se){return he(se,!1)&&se.length===33}function ut(se){return b.utils.isValidPrivateKey(se)}function Re(se){return he(se,!0)}function ze(se,oe){if(!Re(se))throw new Error(w);if(!we(oe))throw new Error(_);return ce(()=>{const ye=X(se,oe,!0);return{parity:ye[0]%2===1?1:0,xOnlyPubkey:ye.slice(1)}})}function _t(se){if(!Ie(se))throw new Error(w);return se.slice(1,33)}function Ct(se,oe){if(!ut(se))throw new Error(g);return ce(()=>b.getPublicKey(se,Y(oe)))}function $t(se){if(!ut(se))throw new Error(g);return _t(Ct(se))}function ft(se,oe){if(!Ie(se))throw new Error(w);return b.Point.fromHex(se).toRawBytes(Y(oe,se))}function Xe(se,oe,ye){if(!Ie(se))throw new Error(w);if(!we(oe))throw new Error(_);return ce(()=>de(se,oe,Y(ye,se)))}function ct(se,oe,ye){if(!Ie(se)||!Ie(oe))throw new Error(w);return ce(()=>{const Ee=b.Point.fromHex(se),me=b.Point.fromHex(oe);return Ee.equals(me.negate())?null:Ee.add(me).toRawBytes(Y(ye,se))})}function wt(se,oe,ye){if(!Ie(se))throw new Error(w);if(!we(oe))throw new Error(_);return ce(()=>X(se,oe,Y(ye,se)))}function Rt(se,oe){if(ut(se)===!1)throw new Error(g);if(we(oe)===!1)throw new Error(_);return ce(()=>ee(se,oe))}function Ge(se,oe){if(ut(se)===!1)throw new Error(g);if(we(oe)===!1)throw new Error(_);return ce(()=>J(se,oe))}function zt(se){if(ut(se)===!1)throw new Error(g);return F(se)}function Ft(se,oe,ye){if(!ut(oe))throw new Error(g);if(!z(se))throw new Error(B);if(!V(ye))throw new Error(k);return b.signSync(se,oe,{der:!1,extraEntropy:ye})}function tt(se,oe,ye){if(!ut(oe))throw new Error(g);if(!z(se))throw new Error(B);if(!V(ye))throw new Error(k);const[Ee,me]=b.signSync(se,oe,{der:!1,extraEntropy:ye,recovered:!0});return{signature:Ee,recoveryId:me}}function qe(se,oe,ye=v.alloc(32,0)){if(!ut(oe))throw new Error(g);if(!z(se))throw new Error(B);if(!V(ye))throw new Error(k);return b.schnorr.signSync(se,oe,ye)}function dt(se,oe,ye,Ee){if(!z(se))throw new Error(A);if(!Ae(oe)||!N(oe))throw new Error(S);if(ye&2&&!re(oe))throw new Error(O);if(!Re(oe.subarray(0,32)))throw new Error(S);return b.recoverPublicKey(se,oe,ye,Y(Ee))}function De(se,oe,ye,Ee){if(!Ie(oe))throw new Error(w);if(!Ae(ye))throw new Error(S);if(!z(se))throw new Error(B);return b.verify(ye,se,oe,{strict:Ee})}function He(se,oe,ye){if(!Re(oe))throw new Error(w);if(!Ae(ye))throw new Error(S);if(!z(se))throw new Error(B);return b.schnorr.verifySync(ye,se,oe)}p.isPoint=Ie,p.isPointCompressed=ke,p.isPrivate=ut,p.isXOnlyPoint=Re,p.pointAdd=ct,p.pointAddScalar=wt,p.pointCompress=ft,p.pointFromScalar=Ct,p.pointMultiply=Xe,p.privateAdd=Rt,p.privateNegate=zt,p.privateSub=Ge,p.recover=dt,p.sign=Ft,p.signRecoverable=tt,p.signSchnorr=qe,p.verify=De,p.verifySchnorr=He,p.xOnlyPointAddTweak=ze,p.xOnlyPointFromPoint=_t,p.xOnlyPointFromScalar=$t},3961:function(fe,p,x){"use strict";x.d(p,{R6:()=>H,gq:()=>W,v9:()=>S,zH:()=>B});var v=x(90032),T=x.n(v);const C=1,I=2,m=4,b=8,g=16,w={blue:{id:"blue",productName:"Ledger\xA0Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:480*1024,blockSize:4*1024,getBlockSize:G=>4*1024},nanoS:{id:"nanoS",productName:"Ledger\xA0Nano\xA0S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:320*1024,blockSize:4*1024,getBlockSize:G=>T().lt(T().coerce(G),"2.0.0")?4*1024:2*1024},nanoX:{id:"nanoX",productName:"Ledger\xA0Nano\xA0X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,blockSize:4*1024,getBlockSize:G=>4*1024,bluetoothSpec:[{serviceUuid:"d973f2e0-b19e-11e2-9e96-0800200c9a66",notifyUuid:"d973f2e1-b19e-11e2-9e96-0800200c9a66",writeUuid:"d973f2e2-b19e-11e2-9e96-0800200c9a66"},{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572"}]}},_=null,A=Object.values(w),S=11415,k=G=>{const Z=w[G];if(!Z)throw new Error("device '"+G+"' does not exist");return Z},B=G=>{const Z=A.find(le=>le.legacyUsbProductId===G);if(Z)return Z;const Q=G>>8;return A.find(le=>le.productIdMM===Q)},O=G=>{const Z=_[G];return A.find(ie=>ie.id===Z)},L=[],D={};for(let G in w){const Z=w[G],{bluetoothSpec:Q}=Z;if(Q)for(let ie=0;ie<Q.length;ie++){const le=Q[ie];L.push(le.serviceUuid),D[le.serviceUuid]=D[le.serviceUuid.replace(/-/g,"")]={deviceModel:Z,...le}}}const W=()=>L,H=G=>D[G.toLowerCase()]},71419:function(fe,p,x){"use strict";var v,T=x(36533).Buffer;v={value:!0},p.receiveAPDU=void 0;var C=x(98011),I=x(99097),m=x(53573);const b=5,g=w=>I.Observable.create(_=>{let A=0,S=0,k=T.alloc(0);const B=w.subscribe({complete:()=>{_.error(new C.DisconnectedDevice),B.unsubscribe()},error:O=>{(0,m.log)("ble-error","in receiveAPDU "+String(O)),_.error(O),B.unsubscribe()},next:O=>{const L=O.readUInt8(0),D=O.readUInt16BE(1);let W=O.slice(3);if(L!==b){_.error(new C.TransportError("Invalid tag "+L.toString(16),"InvalidTag"));return}if(A!==D){_.error(new C.TransportError("BLE: Invalid sequence number. discontinued chunk. Received "+D+" but expected "+A,"InvalidSequence"));return}if(D===0&&(S=W.readUInt16BE(0),W=W.slice(2)),A++,k=T.concat([k,W]),k.length>S){_.error(new C.TransportError("BLE: received too much data. discontinued chunk. Received "+k.length+" but expected "+S,"BLETooMuchData"));return}k.length===S&&(_.next(k),_.complete(),B.unsubscribe())}});return()=>{B.unsubscribe()}});p.receiveAPDU=g},79278:function(fe,p,x){"use strict";var v,T=x(36533).Buffer;v={value:!0},p.sendAPDU=void 0;var C=x(99097),I=x(53573);const m=5;function b(w,_){const A=[];for(let S=0,k=_(0);S<w.length;S+=k,k=_(S))A.push(w.slice(S,S+k));return A}const g=(w,_,A)=>{const S=b(_,k=>A-(k===0?5:3)).map((k,B)=>{const O=T.alloc(B===0?5:3);return O.writeUInt8(m,0),O.writeUInt16BE(B,1),B===0&&O.writeUInt16BE(_.length,3),T.concat([O,k])});return C.Observable.create(k=>{let B=!1;async function O(){for(const D of S){if(B)return;await w(D)}}return O().then(()=>{B=!0,k.complete()},D=>{B=!0,(0,I.log)("ble-error","sendAPDU failure "+String(D)),k.error(D)}),()=>{B||((0,I.log)("ble-verbose","sendAPDU interruption"),B=!0)}})};p.sendAPDU=g},98580:function(fe,p,x){"use strict";var v,T=x(36533).Buffer;v={value:!0},p.default=void 0;var C=x(98011);const I=5;function m(_){const A=T.alloc(2);return A.writeUInt16BE(_,0),A}const b={data:T.alloc(0),dataLength:0,sequence:0};var w=(_,A)=>({makeBlocks(S){let k=T.concat([m(S.length),S]);const B=A-5,O=Math.ceil(k.length/B);k=T.concat([k,T.alloc(O*B-k.length+1).fill(0)]);const L=[];for(let D=0;D<O;D++){const W=T.alloc(5);W.writeUInt16BE(_,0),W.writeUInt8(I,2),W.writeUInt16BE(D,3);const H=k.slice(D*B,(D+1)*B);L.push(T.concat([W,H]))}return L},reduceResponse(S,k){let{data:B,dataLength:O,sequence:L}=S||b;if(k.readUInt16BE(0)!==_)throw new C.TransportError("Invalid channel","InvalidChannel");if(k.readUInt8(2)!==I)throw new C.TransportError("Invalid tag","InvalidTag");if(k.readUInt16BE(3)!==L)throw new C.TransportError("Invalid sequence","InvalidSequence");S||(O=k.readUInt16BE(5)),L++;const D=k.slice(S?5:7);return B=T.concat([B,D]),B.length>O&&(B=B.slice(0,O)),{data:B,dataLength:O,sequence:L}},getReducedResult(S){if(S&&S.dataLength===S.data.length)return S.data}});p.default=w},98011:function(fe,p,x){"use strict";x.r(p),x.d(p,{AccountNameRequiredError:()=>w,AccountNotSupported:()=>_,AmountRequired:()=>A,BluetoothRequired:()=>S,BtcUnmatchedApp:()=>k,CantOpenDevice:()=>B,CantScanQRCode:()=>Pe,CashAddrNotSupported:()=>O,CurrencyNotSupported:()=>L,DBNotReset:()=>Hn,DBWrongPassword:()=>ir,DeviceAppVerifyNotSupported:()=>D,DeviceGenuineSocketEarlyClose:()=>W,DeviceHalted:()=>ie,DeviceInOSUExpected:()=>Q,DeviceNameInvalid:()=>le,DeviceNotGenuineError:()=>H,DeviceOnDashboardExpected:()=>G,DeviceOnDashboardUnexpected:()=>Z,DeviceShouldStayInApp:()=>Dt,DeviceSocketFail:()=>be,DeviceSocketNoBulkStatus:()=>we,DisconnectedDevice:()=>Ae,DisconnectedDeviceDuringOperation:()=>re,ETHAddressNonEIP:()=>fn,EnpointConfigError:()=>N,EthAppPleaseEnableContractData:()=>z,FeeEstimationFailed:()=>V,FeeNotLoaded:()=>Ue,FeeRequired:()=>Le,FeeTooHigh:()=>_e,FirmwareNotRecognized:()=>U,FirmwareOrAppUpdateRequired:()=>Vn,GasLessThanEstimate:()=>qe,GenuineCheckFailed:()=>Yt,HardResetFail:()=>j,InvalidAddress:()=>ee,InvalidAddressBecauseDestinationIsAlsoSource:()=>J,InvalidXRPTag:()=>$,LatestMCUInstalledError:()=>F,LedgerAPI4xx:()=>Jt,LedgerAPI5xx:()=>en,LedgerAPIError:()=>de,LedgerAPIErrorWithMessage:()=>Y,LedgerAPINotAvailable:()=>ce,MCUNotGenuineToDashboard:()=>Ee,ManagerAppAlreadyInstalledError:()=>he,ManagerAppDepInstallRequired:()=>ke,ManagerAppDepUninstallRequired:()=>ut,ManagerAppRelyOnBTCError:()=>Ie,ManagerDeviceLockedError:()=>Re,ManagerFirmwareNotEnoughSpaceError:()=>ze,ManagerNotEnoughSpaceError:()=>_t,ManagerUninstallBTCDep:()=>Ct,NetworkDown:()=>$t,NoAccessToCamera:()=>zt,NoAddressesFound:()=>ft,NoDBPathGiven:()=>kn,NotEnoughBalance:()=>Xe,NotEnoughBalanceBecauseDestinationNotCreated:()=>Ge,NotEnoughBalanceInParentAccount:()=>wt,NotEnoughBalanceToDelegate:()=>ct,NotEnoughGas:()=>Ft,NotEnoughSpendableBalance:()=>Rt,NotSupportedLegacyAddress:()=>tt,PairingFailed:()=>Ot,PasswordIncorrectError:()=>De,PasswordsDontMatchError:()=>dt,RecipientRequired:()=>me,RecommendSubAccountsToEmpty:()=>He,RecommendUndelegation:()=>se,StatusCodes:()=>gr,SyncError:()=>Ze,TimeoutTagged:()=>oe,TransportError:()=>tr,TransportInterfaceNotAvailable:()=>Er,TransportOpenUserCancelled:()=>Un,TransportRaceCondition:()=>ht,TransportStatusError:()=>pr,TransportWebUSBGestureRequired:()=>st,UnavailableTezosOriginatedAccountReceive:()=>Te,UnavailableTezosOriginatedAccountSend:()=>Oe,UnexpectedBootloader:()=>ye,UnknownMCU:()=>X,UpdateFetchFileFail:()=>Qe,UpdateIncorrectHash:()=>Vt,UpdateIncorrectSig:()=>vt,UpdateYourApp:()=>Zt,UserRefusedAddress:()=>ln,UserRefusedAllowManager:()=>or,UserRefusedDeviceNameChange:()=>dn,UserRefusedFirmwareUpdate:()=>yn,UserRefusedOnDevice:()=>An,WebsocketConnectionError:()=>Lt,WebsocketConnectionFailed:()=>Gt,WrongAppForCurrency:()=>un,WrongDeviceForAccount:()=>xn,addCustomErrorDeserializer:()=>C,createCustomErrorClass:()=>I,deserializeError:()=>m,getAltStatusMessage:()=>br,serializeError:()=>b});var v={},T={},C=function(_n,Qn){T[_n]=Qn},I=function(_n){var Qn=function(Mn,Ln){Object.assign(this,Ln),this.name=_n,this.message=Mn||_n,this.stack=new Error().stack};return Qn.prototype=new Error,v[_n]=Qn,Qn},m=function(_n){if(typeof _n=="object"&&_n){try{var Qn=JSON.parse(_n.message);Qn.message&&Qn.name&&(_n=Qn)}catch{}var Zn=void 0;if(typeof _n.name=="string"){var Mn=_n.name,Ln=T[Mn];if(Ln)Zn=Ln(_n);else{var Rn=Mn==="Error"?Error:v[Mn];Rn||(console.warn("deserializing an unknown class '"+Mn+"'"),Rn=I(Mn)),Zn=Object.create(Rn.prototype);try{for(var In in _n)_n.hasOwnProperty(In)&&(Zn[In]=_n[In])}catch{}}}else Zn=new Error(_n.message);return!Zn.stack&&Error.captureStackTrace&&Error.captureStackTrace(Zn,m),Zn}return new Error(String(_n))},b=function(_n){return _n&&(typeof _n=="object"?g(_n,[]):typeof _n=="function"?"[Function: "+(_n.name||"anonymous")+"]":_n)};function g(_n,Qn){var Zn={};Qn.push(_n);for(var Mn=0,Ln=Object.keys(_n);Mn<Ln.length;Mn++){var Rn=Ln[Mn],In=_n[Rn];if(typeof In!="function"){if(!In||typeof In!="object"){Zn[Rn]=In;continue}if(Qn.indexOf(_n[Rn])===-1){Zn[Rn]=g(_n[Rn],Qn.slice(0));continue}Zn[Rn]="[Circular]"}}return typeof _n.name=="string"&&(Zn.name=_n.name),typeof _n.message=="string"&&(Zn.message=_n.message),typeof _n.stack=="string"&&(Zn.stack=_n.stack),Zn}var w=I("AccountNameRequired"),_=I("AccountNotSupported"),A=I("AmountRequired"),S=I("BluetoothRequired"),k=I("BtcUnmatchedApp"),B=I("CantOpenDevice"),O=I("CashAddrNotSupported"),L=I("CurrencyNotSupported"),D=I("DeviceAppVerifyNotSupported"),W=I("DeviceGenuineSocketEarlyClose"),H=I("DeviceNotGenuine"),G=I("DeviceOnDashboardExpected"),Z=I("DeviceOnDashboardUnexpected"),Q=I("DeviceInOSUExpected"),ie=I("DeviceHalted"),le=I("DeviceNameInvalid"),be=I("DeviceSocketFail"),we=I("DeviceSocketNoBulkStatus"),Ae=I("DisconnectedDevice"),re=I("DisconnectedDeviceDuringOperation"),N=I("EnpointConfig"),z=I("EthAppPleaseEnableContractData"),V=I("FeeEstimationFailed"),U=I("FirmwareNotRecognized"),j=I("HardResetFail"),$=I("InvalidXRPTag"),ee=I("InvalidAddress"),J=I("InvalidAddressBecauseDestinationIsAlsoSource"),F=I("LatestMCUInstalledError"),X=I("UnknownMCU"),de=I("LedgerAPIError"),Y=I("LedgerAPIErrorWithMessage"),ce=I("LedgerAPINotAvailable"),he=I("ManagerAppAlreadyInstalled"),Ie=I("ManagerAppRelyOnBTC"),ke=I("ManagerAppDepInstallRequired"),ut=I("ManagerAppDepUninstallRequired"),Re=I("ManagerDeviceLocked"),ze=I("ManagerFirmwareNotEnoughSpace"),_t=I("ManagerNotEnoughSpace"),Ct=I("ManagerUninstallBTCDep"),$t=I("NetworkDown"),ft=I("NoAddressesFound"),Xe=I("NotEnoughBalance"),ct=I("NotEnoughBalanceToDelegate"),wt=I("NotEnoughBalanceInParentAccount"),Rt=I("NotEnoughSpendableBalance"),Ge=I("NotEnoughBalanceBecauseDestinationNotCreated"),zt=I("NoAccessToCamera"),Ft=I("NotEnoughGas"),tt=I("NotSupportedLegacyAddress"),qe=I("GasLessThanEstimate"),dt=I("PasswordsDontMatch"),De=I("PasswordIncorrect"),He=I("RecommendSubAccountsToEmpty"),se=I("RecommendUndelegation"),oe=I("TimeoutTagged"),ye=I("UnexpectedBootloader"),Ee=I("MCUNotGenuineToDashboard"),me=I("RecipientRequired"),Te=I("UnavailableTezosOriginatedAccountReceive"),Oe=I("UnavailableTezosOriginatedAccountSend"),Qe=I("UpdateFetchFileFail"),Vt=I("UpdateIncorrectHash"),vt=I("UpdateIncorrectSig"),Zt=I("UpdateYourApp"),dn=I("UserRefusedDeviceNameChange"),ln=I("UserRefusedAddress"),yn=I("UserRefusedFirmwareUpdate"),or=I("UserRefusedAllowManager"),An=I("UserRefusedOnDevice"),Un=I("TransportOpenUserCancelled"),Er=I("TransportInterfaceNotAvailable"),ht=I("TransportRaceCondition"),st=I("TransportWebUSBGestureRequired"),Dt=I("DeviceShouldStayInApp"),Lt=I("WebsocketConnectionError"),Gt=I("WebsocketConnectionFailed"),xn=I("WrongDeviceForAccount"),un=I("WrongAppForCurrency"),fn=I("ETHAddressNonEIP"),Pe=I("CantScanQRCode"),Ue=I("FeeNotLoaded"),Le=I("FeeRequired"),_e=I("FeeTooHigh"),Ze=I("SyncError"),Ot=I("PairingFailed"),Yt=I("GenuineCheckFailed"),Jt=I("LedgerAPI4xx"),en=I("LedgerAPI5xx"),Vn=I("FirmwareOrAppUpdateRequired"),kn=I("NoDBPathGiven"),ir=I("DBWrongPassword"),Hn=I("DBNotReset");function tr(_n,Qn){this.name="TransportError",this.message=_n,this.stack=new Error().stack,this.id=Qn}tr.prototype=new Error,C("TransportError",function(_n){return new tr(_n.message,_n.id)});var gr={PIN_REMAINING_ATTEMPTS:25536,INCORRECT_LENGTH:26368,MISSING_CRITICAL_PARAMETER:26624,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,SECURITY_STATUS_NOT_SATISFIED:27010,CONDITIONS_OF_USE_NOT_SATISFIED:27013,INCORRECT_DATA:27264,NOT_ENOUGH_MEMORY_SPACE:27268,REFERENCED_DATA_NOT_FOUND:27272,FILE_ALREADY_EXISTS:27273,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,CLA_NOT_SUPPORTED:28160,TECHNICAL_PROBLEM:28416,OK:36864,MEMORY_PROBLEM:37440,NO_EF_SELECTED:37888,INVALID_OFFSET:37890,FILE_NOT_FOUND:37892,INCONSISTENT_FILE:37896,ALGORITHM_NOT_SUPPORTED:38020,INVALID_KCV:38021,CODE_NOT_INITIALIZED:38914,ACCESS_CONDITION_NOT_FULFILLED:38916,CONTRADICTION_SECRET_CODE_STATUS:38920,CONTRADICTION_INVALIDATION:38928,CODE_BLOCKED:38976,MAX_VALUE_REACHED:38992,GP_AUTH_FAILED:25344,LICENSING:28482,HALTED:28586};function br(_n){switch(_n){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received"}if(28416<=_n&&_n<=28671)return"Internal error, please report"}function pr(_n){this.name="TransportStatusError";var Qn=Object.keys(gr).find(function(Ln){return gr[Ln]===_n})||"UNKNOWN_ERROR",Zn=br(_n)||Qn,Mn=_n.toString(16);this.message="Ledger device: "+Zn+" (0x"+Mn+")",this.stack=new Error().stack,this.statusCode=_n,this.statusText=Qn}pr.prototype=new Error,C("TransportStatusError",function(_n){return new pr(_n.statusCode)})},94966:function(fe,p,x){"use strict";x.d(p,{A:()=>Rt});var v=x(43812),T=x(98011),C=x(3961),I=x(79278),m=x(71419),b=x(53573),g=x(84253),w=x(56927),_=x(92943),A=x(24699),S=x(65927),k=x(90443),B=x(62180),O=x(564);function L(Ge,zt,Ft){return function(qe){return qe.lift(new D(Ge,zt,Ft))}}var D=function(){function Ge(zt,Ft,tt){this.nextOrObserver=zt,this.error=Ft,this.complete=tt}return Ge.prototype.call=function(zt,Ft){return Ft.subscribe(new W(zt,this.nextOrObserver,this.error,this.complete))},Ge}(),W=function(Ge){S.C6(zt,Ge);function zt(Ft,tt,qe,dt){var De=Ge.call(this,Ft)||this;return De._tapNext=B.l,De._tapError=B.l,De._tapComplete=B.l,De._tapError=qe||B.l,De._tapComplete=dt||B.l,(0,O.T)(tt)?(De._context=De,De._tapNext=tt):tt&&(De._context=tt,De._tapNext=tt.next||B.l,De._tapError=tt.error||B.l,De._tapComplete=tt.complete||B.l),De}return zt.prototype._next=function(Ft){try{this._tapNext.call(this._context,Ft)}catch(tt){this.destination.error(tt);return}this.destination.next(Ft)},zt.prototype._error=function(Ft){try{this._tapError.call(this._context,Ft)}catch(tt){this.destination.error(tt);return}this.destination.error(Ft)},zt.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(Ft){this.destination.error(Ft);return}return this.destination.complete()},zt}(k.v),H=x(42532);function G(Ge,zt){return function(tt){var qe;if(typeof Ge=="function"?qe=Ge:qe=function(){return Ge},typeof zt=="function")return tt.lift(new Z(qe,zt));var dt=Object.create(tt,H.f);return dt.source=tt,dt.subjectFactory=qe,dt}}var Z=function(){function Ge(zt,Ft){this.subjectFactory=zt,this.selector=Ft}return Ge.prototype.call=function(zt,Ft){var tt=this.selector,qe=this.subjectFactory(),dt=tt(qe).subscribe(zt);return dt.add(Ft.subscribe(qe)),dt},Ge}(),Q=x(24887),ie=x(2721);function le(){return new ie.B7}function be(){return function(Ge){return(0,Q.B)()(G(le)(Ge))}}var we=x(9801),Ae=x(29513),re=x(44931),N=x(90246);function z(Ge){return function(zt){return Ge===0?(0,N.I)():zt.lift(new V(Ge))}}var V=function(){function Ge(zt){if(this.total=zt,this.total<0)throw new re.k}return Ge.prototype.call=function(zt,Ft){return Ft.subscribe(new U(zt,this.total))},Ge}(),U=function(Ge){S.C6(zt,Ge);function zt(Ft,tt){var qe=Ge.call(this,Ft)||this;return qe.total=tt,qe.count=0,qe}return zt.prototype._next=function(Ft){var tt=this.total,qe=++this.count;qe<=tt&&(this.destination.next(Ft),qe===tt&&(this.destination.complete(),this.unsubscribe()))},zt}(k.v);function j(Ge){return Ge===void 0&&(Ge=null),function(zt){return zt.lift(new $(Ge))}}var $=function(){function Ge(zt){this.defaultValue=zt}return Ge.prototype.call=function(zt,Ft){return Ft.subscribe(new ee(zt,this.defaultValue))},Ge}(),ee=function(Ge){S.C6(zt,Ge);function zt(Ft,tt){var qe=Ge.call(this,Ft)||this;return qe.defaultValue=tt,qe.isEmpty=!0,qe}return zt.prototype._next=function(Ft){this.isEmpty=!1,this.destination.next(Ft)},zt.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},zt}(k.v);function J(Ge){return Ge===void 0&&(Ge=de),function(zt){return zt.lift(new F(Ge))}}var F=function(){function Ge(zt){this.errorFactory=zt}return Ge.prototype.call=function(zt,Ft){return Ft.subscribe(new X(zt,this.errorFactory))},Ge}(),X=function(Ge){S.C6(zt,Ge);function zt(Ft,tt){var qe=Ge.call(this,Ft)||this;return qe.errorFactory=tt,qe.hasValue=!1,qe}return zt.prototype._next=function(Ft){this.hasValue=!0,this.destination.next(Ft)},zt.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var Ft=void 0;try{Ft=this.errorFactory()}catch(tt){Ft=tt}this.destination.error(Ft)},zt}(k.v);function de(){return new we.G}var Y=x(12486);function ce(Ge,zt){var Ft=arguments.length>=2;return function(tt){return tt.pipe(Ge?(0,Ae.p)(function(qe,dt){return Ge(qe,dt,tt)}):Y.D,z(1),Ft?j(zt):J(function(){return new we.G}))}}var he=x(42933);function Ie(){return function(zt){return zt.lift(new ke)}}var ke=function(){function Ge(){}return Ge.prototype.call=function(zt,Ft){return Ft.subscribe(new ut(zt))},Ge}(),ut=function(Ge){S.C6(zt,Ge);function zt(){return Ge!==null&&Ge.apply(this,arguments)||this}return zt.prototype._next=function(Ft){},zt}(k.v),Re=x(36533).Buffer;const ze=Ge=>g.c.create(zt=>{(0,b.log)("ble-verbose","start monitor "+Ge.uuid);function Ft(tt){const qe=tt.target;qe.value&&zt.next(Re.from(qe.value.buffer))}return Ge.startNotifications().then(()=>{Ge.addEventListener("characteristicvaluechanged",Ft)}),()=>{(0,b.log)("ble-verbose","end monitor "+Ge.uuid),Ge.stopNotifications()}});var _t=x(36533).Buffer;const Ct=()=>{const{bluetooth:Ge}=navigator;if(typeof Ge>"u")throw new Error("web bluetooth not supported");return Ge},$t=()=>g.c.create(Ge=>{const zt=Ct(),Ft=qe=>{Ge.next(qe.value)};zt.addEventListener("availabilitychanged",Ft);let tt=!1;return zt.getAvailability().then(qe=>{tt||Ge.next(qe)}),()=>{tt=!0,zt.removeEventListener("availabilitychanged",Ft)}}),ft={},Xe=()=>({filters:(0,C.gq)().map(Ge=>({services:[Ge]}))}),ct=async Ge=>{if(!Ge.gatt)throw new Error("bluetooth gatt not found");const[zt]=await Ge.gatt.getPrimaryServices();if(!zt)throw new Error("bluetooth service not found");const Ft=(0,C.R6)(zt.uuid);if(!Ft)throw new Error("bluetooth service infos not found");return[zt,Ft]};async function wt(Ge,zt){let Ft;if(typeof Ge=="string"){if(ft[Ge])return(0,b.log)("ble-verbose","Transport in cache, using that."),ft[Ge];Ft=await Ct().requestDevice(Xe())}else Ft=Ge;Ft.gatt.connected||((0,b.log)("ble-verbose","not connected. connecting..."),await Ft.gatt.connect());const[tt,qe]=await ct(Ft),{deviceModel:dt,writeUuid:De,notifyUuid:He}=qe,[se,oe]=await Promise.all([tt.getCharacteristic(De),tt.getCharacteristic(He)]),ye=ze(oe).pipe(L(Qe=>{(0,b.log)("ble-frame","<= "+Qe.toString("hex"))}),be()),Ee=ye.subscribe(),me=new Rt(Ft,se,ye,dt);if(!Ft.gatt.connected)throw new T.DisconnectedDevice;ft[me.id]=me;const Te=Qe=>{console.log("onDisconnect!",Qe),delete ft[me.id],me.notYetDisconnected=!1,Ee.unsubscribe(),Ft.removeEventListener("gattserverdisconnected",Te),(0,b.log)("ble-verbose",`BleTransport(${me.id}) disconnected`),me.emit("disconnect",Qe)};Ft.addEventListener("gattserverdisconnected",Te);let Oe=Date.now();try{await me.inferMTU()}finally{Date.now()-Oe<1e3&&(zt=!1),zt&&(await Ft.gatt.disconnect(),await new Promise(Vt=>setTimeout(Vt,4e3)))}return zt?wt(Ft,!1):me}class Rt extends v.Ay{static listen(zt){(0,b.log)("ble-verbose","listen...");let Ft;Ct().requestDevice(Xe()).then(async dt=>{Ft||(zt.next({type:"add",descriptor:dt}),zt.complete())},dt=>{zt.error(new T.TransportOpenUserCancelled(dt.message))});function qe(){Ft=!0}return{unsubscribe:qe}}static async open(zt){return wt(zt,!0)}constructor(zt,Ft,tt,qe){super(),this.id=void 0,this.device=void 0,this.mtuSize=20,this.writeCharacteristic=void 0,this.notifyObservable=void 0,this.notYetDisconnected=!0,this.deviceModel=void 0,this.exchange=dt=>this.exchangeAtomicImpl(async()=>{try{const De=dt.toString("hex");(0,b.log)("apdu",`=> ${De}`);const He=await(0,w.h)(this.notifyObservable.pipe(m.receiveAPDU),(0,I.sendAPDU)(this.write,dt,this.mtuSize)).toPromise(),se=He.toString("hex");return(0,b.log)("apdu",`<= ${se}`),He}catch(De){throw(0,b.log)("ble-error","exchange got "+String(De)),this.notYetDisconnected&&this.device.gatt.disconnect(),De}}),this.write=async dt=>{(0,b.log)("ble-frame","=> "+dt.toString("hex")),await this.writeCharacteristic.writeValue(dt)},this.id=zt.id,this.device=zt,this.writeCharacteristic=Ft,this.notifyObservable=tt,this.deviceModel=qe,(0,b.log)("ble-verbose",`BleTransport(${String(this.id)}) new instance`)}async inferMTU(){let zt=23;if(await this.exchangeAtomicImpl(async()=>{try{zt=await(0,w.h)(this.notifyObservable.pipe(ce(Ft=>Ft.readUInt8(0)===8),(0,he.T)(Ft=>Ft.readUInt8(5))),(0,_.v)(()=>(0,A.H)(this.write(_t.from([8,0,0,0,0])))).pipe(Ie())).toPromise()+3}catch(Ft){throw(0,b.log)("ble-error","inferMTU got "+String(Ft)),this.device.gatt.disconnect(),Ft}}),zt>23){const Ft=zt-3;(0,b.log)("ble-verbose",`BleTransport(${String(this.id)}) mtu set to ${String(Ft)}`),this.mtuSize=Ft}return this.mtuSize}setScrambleKey(){}async close(){this.exchangeBusyPromise&&await this.exchangeBusyPromise}}Rt.isSupported=()=>Promise.resolve().then(Ct).then(()=>!0,()=>!1),Rt.observeAvailability=Ge=>$t.subscribe(Ge),Rt.list=()=>Promise.resolve([]),Rt.disconnect=async Ge=>{(0,b.log)("ble-verbose",`user disconnect(${Ge})`);const zt=ft[Ge];zt&&zt.device.gatt.disconnect()}},83318:function(fe,p,x){"use strict";x.d(p,{A:()=>B});var v=x(43812),T=x(98580),C=x(3961),I=x(53573),m=x(98011),b=x(36533).Buffer;const g=[{vendorId:C.v9}],w=()=>Promise.resolve(!!(x.g.navigator&&x.g.navigator.hid)),_=()=>{const{hid:O}=navigator;if(!O)throw new m.TransportError("navigator.hid is not supported","HIDNotSupported");return O};async function A(){const O=await _().requestDevice({filters:g});return Array.isArray(O)?O:[O]}async function S(){return(await _().getDevices()).filter(L=>L.vendorId===C.v9)}async function k(){const O=await S();return O.length>0?O[0]:(await A())[0]}class B extends v.Ay{constructor(L){super(),this.device=void 0,this.deviceModel=void 0,this.channel=Math.floor(Math.random()*65535),this.packetSize=64,this.inputs=[],this.inputCallback=void 0,this.read=()=>this.inputs.length?Promise.resolve(this.inputs.shift()):new Promise(D=>{this.inputCallback=D}),this.onInputReport=D=>{const W=b.from(D.data.buffer);this.inputCallback?(this.inputCallback(W),this.inputCallback=null):this.inputs.push(W)},this._disconnectEmitted=!1,this._emitDisconnect=D=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",D))},this.exchange=D=>this.exchangeAtomicImpl(async()=>{const{channel:W,packetSize:H}=this;(0,I.log)("apdu","=> "+D.toString("hex"));const G=(0,T.default)(W,H),Z=G.makeBlocks(D);for(let le=0;le<Z.length;le++)await this.device.sendReport(0,Z[le]);let Q,ie;for(;!(Q=G.getReducedResult(ie));){const le=await this.read();ie=G.reduceResponse(ie,le)}return(0,I.log)("apdu","<= "+Q.toString("hex")),Q}).catch(W=>{throw W&&W.message&&W.message.includes("write")?(this._emitDisconnect(W),new m.DisconnectedDeviceDuringOperation(W.message)):W}),this.device=L,this.deviceModel=(0,C.zH)(L.productId),L.addEventListener("inputreport",this.onInputReport)}static async request(){const[L]=await A();return B.open(L)}static async openConnected(){const L=await S();return L.length===0?null:B.open(L[0])}static async open(L){await L.open();const D=new B(L),W=H=>{L===H.device&&(_().removeEventListener("disconnect",W),D._emitDisconnect(new m.DisconnectedDevice))};return _().addEventListener("disconnect",W),D}async close(){await this.exchangeBusyPromise,this.device.removeEventListener("inputreport",this.onInputReport),await this.device.close()}setScrambleKey(){}}B.isSupported=w,B.list=S,B.listen=O=>{let L=!1;k().then(W=>{if(!W)O.error(new m.TransportOpenUserCancelled("Access denied to use Ledger device"));else if(!L){const H=(0,C.zH)(W.productId);O.next({type:"add",descriptor:W,deviceModel:H}),O.complete()}},W=>{O.error(new m.TransportOpenUserCancelled(W.message))});function D(){L=!0}return{unsubscribe:D}}},86265:function(fe,p,x){"use strict";x.d(p,{A:()=>O});var v=x(43812),T=x(98580),C=x(3961),I=x(53573),m=x(98011);const b=[{vendorId:C.v9}];async function g(){return await navigator.usb.requestDevice({filters:b})}async function w(){return(await navigator.usb.getDevices()).filter(W=>W.vendorId===C.v9)}async function _(){const D=await w();return D.length>0?D[0]:g()}const A=()=>Promise.resolve(!!navigator&&!!navigator.usb&&typeof navigator.usb.getDevices=="function");var S=x(36533).Buffer;const k=1,B=3;class O extends v.Ay{constructor(W,H){super(),this.device=void 0,this.deviceModel=void 0,this.channel=Math.floor(Math.random()*65535),this.packetSize=64,this.interfaceNumber=void 0,this._disconnectEmitted=!1,this._emitDisconnect=G=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",G))},this.exchange=G=>this.exchangeAtomicImpl(async()=>{const{channel:Z,packetSize:Q}=this;(0,I.log)("apdu","=> "+G.toString("hex"));const ie=(0,T.default)(Z,Q),le=ie.makeBlocks(G);for(let Ae=0;Ae<le.length;Ae++)await this.device.transferOut(B,le[Ae]);let be,we;for(;!(be=ie.getReducedResult(we));){const Ae=await this.device.transferIn(B,Q),re=S.from(Ae.data.buffer);we=ie.reduceResponse(we,re)}return(0,I.log)("apdu","<= "+be.toString("hex")),be}).catch(Z=>{throw Z&&Z.message&&Z.message.includes("disconnected")?(this._emitDisconnect(Z),new m.DisconnectedDeviceDuringOperation(Z.message)):Z}),this.device=W,this.interfaceNumber=H,this.deviceModel=(0,C.zH)(W.productId)}static async request(){const W=await g();return O.open(W)}static async openConnected(){const W=await w();return W.length===0?null:O.open(W[0])}static async open(W){await W.open(),W.configuration===null&&await W.selectConfiguration(k),await L(W);const H=W.configurations[0].interfaces.find(({alternates:ie})=>ie.some(le=>le.interfaceClass===255));if(!H)throw new m.TransportInterfaceNotAvailable("No WebUSB interface found for your Ledger device. Please upgrade firmware or contact techsupport.");const G=H.interfaceNumber;try{await W.claimInterface(G)}catch(ie){throw await W.close(),new m.TransportInterfaceNotAvailable(ie.message)}const Z=new O(W,G),Q=ie=>{W===ie.device&&(navigator.usb.removeEventListener("disconnect",Q),Z._emitDisconnect(new m.DisconnectedDevice))};return navigator.usb.addEventListener("disconnect",Q),Z}async close(){await this.exchangeBusyPromise,await this.device.releaseInterface(this.interfaceNumber),await L(this.device),await this.device.close()}setScrambleKey(){}}O.isSupported=A,O.list=w,O.listen=D=>{let W=!1;_().then(G=>{if(!W){const Z=(0,C.zH)(G.productId);D.next({type:"add",descriptor:G,deviceModel:Z}),D.complete()}},G=>{window.DOMException&&G instanceof window.DOMException&&G.code===18?D.error(new m.TransportWebUSBGestureRequired(G.message)):D.error(new m.TransportOpenUserCancelled(G.message))});function H(){W=!0}return{unsubscribe:H}};async function L(D){try{await D.reset()}catch(W){console.warn(W)}}},43812:function(fe,p,x){"use strict";x.d(p,{Ay:()=>m});var v=x(80381),T=x.n(v),C=x(98011),I=x(36533).Buffer;class m{constructor(){this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new(T()),this.send=async(g,w,_,A,S=I.alloc(0),k=[C.StatusCodes.OK])=>{if(S.length>=256)throw new C.TransportError("data.length exceed 256 bytes limit. Got: "+S.length,"DataLengthTooBig");const B=await this.exchange(I.concat([I.from([g,w,_,A]),I.from([S.length]),S])),O=B.readUInt16BE(B.length-2);if(!k.some(L=>L===O))throw new C.TransportStatusError(O);return B},this.exchangeBusyPromise=void 0,this.exchangeAtomicImpl=async g=>{if(this.exchangeBusyPromise)throw new C.TransportRaceCondition("An action was already pending on the Ledger device. Please deny or reconnect.");let w;const _=new Promise(k=>{w=k});this.exchangeBusyPromise=_;let A=!1;const S=setTimeout(()=>{A=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{const k=await g();return A&&this.emit("responsive"),k}finally{clearTimeout(S),w&&w(),this.exchangeBusyPromise=null}},this._appAPIlock=null}exchange(g){throw new Error("exchange not implemented")}setScrambleKey(g){}close(){return Promise.resolve()}on(g,w){this._events.on(g,w)}off(g,w){this._events.removeListener(g,w)}emit(g,...w){this._events.emit(g,...w)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(g){this.exchangeTimeout=g}setExchangeUnresponsiveTimeout(g){this.unresponsiveTimeout=g}static create(g=3e3,w){return new Promise((_,A)=>{let S=!1;const k=this.listen({next:O=>{S=!0,k&&k.unsubscribe(),B&&clearTimeout(B),this.open(O.descriptor,g).then(_,A)},error:O=>{B&&clearTimeout(B),A(O)},complete:()=>{B&&clearTimeout(B),S||A(new C.TransportError(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),B=w?setTimeout(()=>{k.unsubscribe(),A(new C.TransportError(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},w):null})}decorateAppAPIMethods(g,w,_){for(let A of w)g[A]=this.decorateAppAPIMethod(A,g[A],g,_)}decorateAppAPIMethod(g,w,_,A){return async(...S)=>{const{_appAPIlock:k}=this;if(k)return Promise.reject(new C.TransportError("Ledger Device is busy (lock "+k+")","TransportLocked"));try{return this._appAPIlock=g,this.setScrambleKey(A),await w.apply(_,S)}finally{this._appAPIlock=null}}}}m.isSupported=void 0,m.list=void 0,m.listen=void 0,m.open=void 0,m.ErrorMessage_ListenTimeout="No Ledger device found (timeout)",m.ErrorMessage_NoDeviceFound="No Ledger device found"},53573:function(fe,p,x){"use strict";x.r(p),x.d(p,{listen:()=>I,log:()=>C});let v=0;const T=[],C=(b,g,w)=>{const _={type:b,id:String(++v),date:new Date};g&&(_.message=g),w&&(_.data=w),m(_)},I=b=>(T.push(b),()=>{const g=T.indexOf(b);g!==-1&&(T[g]=T[T.length-1],T.pop())});function m(b){for(let g=0;g<T.length;g++)try{T[g](b)}catch(w){console.error(w)}}window.__ledgerLogsListen=I},73261:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__createBinding||(Object.create?function(O,L,D,W){W===void 0&&(W=D),Object.defineProperty(O,W,{enumerable:!0,get:function(){return L[D]}})}:function(O,L,D,W){W===void 0&&(W=D),O[W]=L[D]}),C=this&&this.__setModuleDefault||(Object.create?function(O,L){Object.defineProperty(O,"default",{enumerable:!0,value:L})}:function(O,L){O.default=L}),I=this&&this.__importStar||function(O){if(O&&O.__esModule)return O;var L={};if(O!=null)for(var D in O)D!=="default"&&Object.prototype.hasOwnProperty.call(O,D)&&T(L,O,D);return C(L,O),L};Object.defineProperty(p,"__esModule",{value:!0}),p.getEncryptionPublicKey=p.decryptSafely=p.decrypt=p.encryptSafely=p.encrypt=void 0;const m=I(x(18861)),b=I(x(95858)),g=x(69367);function w({publicKey:O,data:L,version:D}){if(g.isNullish(O))throw new Error("Missing publicKey parameter");if(g.isNullish(L))throw new Error("Missing data parameter");if(g.isNullish(D))throw new Error("Missing version parameter");switch(D){case"x25519-xsalsa20-poly1305":{if(typeof L!="string")throw new Error("Message data must be given as a string");const W=m.box.keyPair();let H;try{H=b.decodeBase64(O)}catch{throw new Error("Bad public key")}const G=b.decodeUTF8(L),Z=m.randomBytes(m.box.nonceLength),Q=m.box(G,Z,H,W.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:b.encodeBase64(Z),ephemPublicKey:b.encodeBase64(W.publicKey),ciphertext:b.encodeBase64(Q)}}default:throw new Error("Encryption type/version not supported")}}p.encrypt=w;function _({publicKey:O,data:L,version:D}){if(g.isNullish(O))throw new Error("Missing publicKey parameter");if(g.isNullish(L))throw new Error("Missing data parameter");if(g.isNullish(D))throw new Error("Missing version parameter");const W=2**11,H=16;if(typeof L=="object"&&"toJSON"in L)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const G={data:L,padding:""},Q=v.byteLength(JSON.stringify(G),"utf-8")%W;let ie=0;Q>0&&(ie=W-Q-H),G.padding="0".repeat(ie);const le=JSON.stringify(G);return w({publicKey:O,data:le,version:D})}p.encryptSafely=_;function A({encryptedData:O,privateKey:L}){if(g.isNullish(O))throw new Error("Missing encryptedData parameter");if(g.isNullish(L))throw new Error("Missing privateKey parameter");switch(O.version){case"x25519-xsalsa20-poly1305":{const D=B(L),W=m.box.keyPair.fromSecretKey(D).secretKey,H=b.decodeBase64(O.nonce),G=b.decodeBase64(O.ciphertext),Z=b.decodeBase64(O.ephemPublicKey),Q=m.box.open(G,H,Z,W);let ie;try{ie=b.encodeUTF8(Q)}catch{throw new Error("Decryption failed.")}if(ie)return ie;throw new Error("Decryption failed.")}default:throw new Error("Encryption type/version not supported.")}}p.decrypt=A;function S({encryptedData:O,privateKey:L}){if(g.isNullish(O))throw new Error("Missing encryptedData parameter");if(g.isNullish(L))throw new Error("Missing privateKey parameter");return JSON.parse(A({encryptedData:O,privateKey:L})).data}p.decryptSafely=S;function k(O){const L=B(O),D=m.box.keyPair.fromSecretKey(L).publicKey;return b.encodeBase64(D)}p.getEncryptionPublicKey=k;function B(O){const L=v.from(O,"hex").toString("base64");return b.decodeBase64(L)}},10326:function(fe,p,x){"use strict";var v=this&&this.__createBinding||(Object.create?function(I,m,b,g){g===void 0&&(g=b),Object.defineProperty(I,g,{enumerable:!0,get:function(){return m[b]}})}:function(I,m,b,g){g===void 0&&(g=b),I[g]=m[b]}),T=this&&this.__exportStar||function(I,m){for(var b in I)b!=="default"&&!Object.prototype.hasOwnProperty.call(m,b)&&v(m,I,b)};Object.defineProperty(p,"__esModule",{value:!0}),p.normalize=p.concatSig=void 0,T(x(67160),p),T(x(92117),p),T(x(73261),p);var C=x(69367);Object.defineProperty(p,"concatSig",{enumerable:!0,get:function(){return C.concatSig}}),Object.defineProperty(p,"normalize",{enumerable:!0,get:function(){return C.normalize}})},67160:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.extractPublicKey=p.recoverPersonalSignature=p.personalSign=void 0;const v=x(30162),T=x(69367);function C({privateKey:g,data:w}){if(T.isNullish(w))throw new Error("Missing data parameter");if(T.isNullish(g))throw new Error("Missing privateKey parameter");const _=T.legacyToBuffer(w),A=v.hashPersonalMessage(_),S=v.ecsign(A,g);return T.concatSig(v.toBuffer(S.v),S.r,S.s)}p.personalSign=C;function I({data:g,signature:w}){if(T.isNullish(g))throw new Error("Missing data parameter");if(T.isNullish(w))throw new Error("Missing signature parameter");const _=b(g,w),A=v.publicToAddress(_);return v.bufferToHex(A)}p.recoverPersonalSignature=I;function m({data:g,signature:w}){if(T.isNullish(g))throw new Error("Missing data parameter");if(T.isNullish(w))throw new Error("Missing signature parameter");return`0x${b(g,w).toString("hex")}`}p.extractPublicKey=m;function b(g,w){const _=v.hashPersonalMessage(T.legacyToBuffer(g));return T.recoverPublicKey(_,w)}},92117:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.recoverTypedSignature=p.signTypedData=p.typedSignatureHash=p.TypedDataUtils=p.TYPED_MESSAGE_SCHEMA=p.SignTypedDataVersion=void 0;const T=x(30162),C=x(60344),I=x(69367);var m;(function(G){G.V1="V1",G.V3="V3",G.V4="V4"})(m=p.SignTypedDataVersion||(p.SignTypedDataVersion={})),p.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]};function b(G,Z){if(Object.keys(m).includes(G)){if(Z&&!Z.includes(G))throw new Error(`SignTypedDataVersion not allowed: '${G}'. Allowed versions are: ${Z.join(", ")}`)}else throw new Error(`Invalid version: '${G}'`)}function g(G,Z,Q,ie,le){if(b(le,[m.V3,m.V4]),G[Q]!==void 0)return["bytes32",le===m.V4&&ie==null?"0x0000000000000000000000000000000000000000000000000000000000000000":T.keccak(w(Q,ie,G,le))];if(ie===void 0)throw new Error(`missing value for field ${Z} of type ${Q}`);if(Q==="bytes")return["bytes32",T.keccak(ie)];if(Q==="string")return typeof ie=="string"&&(ie=v.from(ie,"utf8")),["bytes32",T.keccak(ie)];if(Q.lastIndexOf("]")===Q.length-1){if(le===m.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const be=Q.slice(0,Q.lastIndexOf("[")),we=ie.map(Ae=>g(G,Z,be,Ae,le));return["bytes32",T.keccak(C.rawEncode(we.map(([Ae])=>Ae),we.map(([,Ae])=>Ae)))]}return[Q,ie]}function w(G,Z,Q,ie){b(ie,[m.V3,m.V4]);const le=["bytes32"],be=[k(G,Q)];for(const we of Q[G]){if(ie===m.V3&&Z[we.name]===void 0)continue;const[Ae,re]=g(Q,we.name,we.type,Z[we.name],ie);le.push(Ae),be.push(re)}return C.rawEncode(le,be)}function _(G,Z){let Q="";const ie=A(G,Z);ie.delete(G);const le=[G,...Array.from(ie).sort()];for(const be of le){if(!Z[be])throw new Error(`No type definition specified: ${be}`);Q+=`${be}(${Z[be].map(({name:Ae,type:re})=>`${re} ${Ae}`).join(",")})`}return Q}function A(G,Z,Q=new Set){if([G]=G.match(/^\w*/u),Q.has(G)||Z[G]===void 0)return Q;Q.add(G);for(const ie of Z[G])A(ie.type,Z,Q);return Q}function S(G,Z,Q,ie){return b(ie,[m.V3,m.V4]),T.keccak(w(G,Z,Q,ie))}function k(G,Z){return T.keccak(_(G,Z))}function B(G){const Z={};for(const Q in p.TYPED_MESSAGE_SCHEMA.properties)G[Q]&&(Z[Q]=G[Q]);return"types"in Z&&(Z.types=Object.assign({EIP712Domain:[]},Z.types)),Z}function O(G,Z){b(Z,[m.V3,m.V4]);const Q=B(G),ie=[v.from("1901","hex")];return ie.push(S("EIP712Domain",Q.domain,Q.types,Z)),Q.primaryType!=="EIP712Domain"&&ie.push(S(Q.primaryType,Q.message,Q.types,Z)),T.keccak(v.concat(ie))}p.TypedDataUtils={encodeData:w,encodeType:_,findTypeDependencies:A,hashStruct:S,hashType:k,sanitizeData:B,eip712Hash:O};function L(G){const Z=D(G);return T.bufferToHex(Z)}p.typedSignatureHash=L;function D(G){const Z=new Error("Expect argument to be non-empty array");if(typeof G!="object"||!("length"in G)||!G.length)throw Z;const Q=G.map(function(be){return be.type!=="bytes"?be.value:I.legacyToBuffer(be.value)}),ie=G.map(function(be){return be.type}),le=G.map(function(be){if(!be.name)throw Z;return`${be.type} ${be.name}`});return C.soliditySHA3(["bytes32","bytes32"],[C.soliditySHA3(new Array(G.length).fill("string"),le),C.soliditySHA3(ie,Q)])}function W({privateKey:G,data:Z,version:Q}){if(b(Q),I.isNullish(Z))throw new Error("Missing data parameter");if(I.isNullish(G))throw new Error("Missing private key parameter");const ie=Q===m.V1?D(Z):p.TypedDataUtils.eip712Hash(Z,Q),le=T.ecsign(ie,G);return I.concatSig(T.toBuffer(le.v),le.r,le.s)}p.signTypedData=W;function H({data:G,signature:Z,version:Q}){if(b(Q),I.isNullish(G))throw new Error("Missing data parameter");if(I.isNullish(Z))throw new Error("Missing signature parameter");const ie=Q===m.V1?D(G):p.TypedDataUtils.eip712Hash(G,Q),le=I.recoverPublicKey(ie,Z),be=T.publicToAddress(le);return T.bufferToHex(be)}p.recoverTypedSignature=H},69367:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.normalize=p.recoverPublicKey=p.concatSig=p.legacyToBuffer=p.isNullish=p.padWithZeroes=void 0;const T=x(30162),C=x(90271);function I(A,S){if(A!==""&&!/^[a-f0-9]+$/iu.test(A))throw new Error(`Expected an unprefixed hex string. Received: ${A}`);if(S<0)throw new Error(`Expected a non-negative integer target length. Received: ${S}`);return String.prototype.padStart.call(A,S,"0")}p.padWithZeroes=I;function m(A){return A==null}p.isNullish=m;function b(A){return typeof A=="string"&&!C.isHexString(A)?v.from(A):T.toBuffer(A)}p.legacyToBuffer=b;function g(A,S,k){const B=T.fromSigned(S),O=T.fromSigned(k),L=T.bufferToInt(A),D=I(T.toUnsigned(B).toString("hex"),64),W=I(T.toUnsigned(O).toString("hex"),64),H=C.stripHexPrefix(C.intToHex(L));return T.addHexPrefix(D.concat(W,H))}p.concatSig=g;function w(A,S){const k=T.fromRpcSig(S);return T.ecrecover(A,k.v,k.r,k.s)}p.recoverPublicKey=w;function _(A){if(A){if(typeof A=="number"){const S=T.toBuffer(A);A=T.bufferToHex(S)}if(typeof A!="string"){let S="eth-sig-util.normalize() requires hex string or integer input.";throw S+=` received ${typeof A}: ${A}`,new Error(S)}return T.addHexPrefix(A.toLowerCase())}}p.normalize=_},68443:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.isBytes=T,p.number=x,p.bool=v,p.bytes=C,p.hash=I,p.exists=m,p.output=b;function x(w){if(!Number.isSafeInteger(w)||w<0)throw new Error(`positive integer expected, not ${w}`)}function v(w){if(typeof w!="boolean")throw new Error(`boolean expected, not ${w}`)}function T(w){return w instanceof Uint8Array||w!=null&&typeof w=="object"&&w.constructor.name==="Uint8Array"}function C(w,..._){if(!T(w))throw new Error("Uint8Array expected");if(_.length>0&&!_.includes(w.length))throw new Error(`Uint8Array expected of length ${_}, not of length=${w.length}`)}function I(w){if(typeof w!="function"||typeof w.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");x(w.outputLen),x(w.blockLen)}function m(w,_=!0){if(w.destroyed)throw new Error("Hash instance has been destroyed");if(_&&w.finished)throw new Error("Hash#digest() has already been called")}function b(w,_){C(w);const A=_.outputLen;if(w.length<A)throw new Error(`digestInto() expects output buffer of length at least ${A}`)}const g={number:x,bool:v,bytes:C,hash:I,exists:m,output:b};p.default=g},15204:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.HashMD=p.Maj=p.Chi=void 0;const v=x(68443),T=x(86361);function C(g,w,_,A){if(typeof g.setBigUint64=="function")return g.setBigUint64(w,_,A);const S=BigInt(32),k=BigInt(4294967295),B=Number(_>>S&k),O=Number(_&k),L=A?4:0,D=A?0:4;g.setUint32(w+L,B,A),g.setUint32(w+D,O,A)}const I=(g,w,_)=>g&w^~g&_;p.Chi=I;const m=(g,w,_)=>g&w^g&_^w&_;p.Maj=m;class b extends T.Hash{constructor(w,_,A,S){super(),this.blockLen=w,this.outputLen=_,this.padOffset=A,this.isLE=S,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(w),this.view=(0,T.createView)(this.buffer)}update(w){(0,v.exists)(this);const{view:_,buffer:A,blockLen:S}=this;w=(0,T.toBytes)(w);const k=w.length;for(let B=0;B<k;){const O=Math.min(S-this.pos,k-B);if(O===S){const L=(0,T.createView)(w);for(;S<=k-B;B+=S)this.process(L,B);continue}A.set(w.subarray(B,B+O),this.pos),this.pos+=O,B+=O,this.pos===S&&(this.process(_,0),this.pos=0)}return this.length+=w.length,this.roundClean(),this}digestInto(w){(0,v.exists)(this),(0,v.output)(w,this),this.finished=!0;const{buffer:_,view:A,blockLen:S,isLE:k}=this;let{pos:B}=this;_[B++]=128,this.buffer.subarray(B).fill(0),this.padOffset>S-B&&(this.process(A,0),B=0);for(let H=B;H<S;H++)_[H]=0;C(A,S-8,BigInt(this.length*8),k),this.process(A,0);const O=(0,T.createView)(w),L=this.outputLen;if(L%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const D=L/4,W=this.get();if(D>W.length)throw new Error("_sha2: outputLen bigger than state");for(let H=0;H<D;H++)O.setUint32(4*H,W[H],k)}digest(){const{buffer:w,outputLen:_}=this;this.digestInto(w);const A=w.slice(0,_);return this.destroy(),A}_cloneInto(w){w||(w=new this.constructor),w.set(...this.get());const{blockLen:_,buffer:A,length:S,finished:k,destroyed:B,pos:O}=this;return w.length=S,w.pos=O,w.finished=k,w.destroyed=B,S%_&&w.buffer.set(A),w}}p.HashMD=b},90623:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.crypto=void 0,p.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0},44629:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.hmac=p.HMAC=void 0;const v=x(68443),T=x(86361);class C extends T.Hash{constructor(b,g){super(),this.finished=!1,this.destroyed=!1,(0,v.hash)(b);const w=(0,T.toBytes)(g);if(this.iHash=b.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const _=this.blockLen,A=new Uint8Array(_);A.set(w.length>_?b.create().update(w).digest():w);for(let S=0;S<A.length;S++)A[S]^=54;this.iHash.update(A),this.oHash=b.create();for(let S=0;S<A.length;S++)A[S]^=106;this.oHash.update(A),A.fill(0)}update(b){return(0,v.exists)(this),this.iHash.update(b),this}digestInto(b){(0,v.exists)(this),(0,v.bytes)(b,this.outputLen),this.finished=!0,this.iHash.digestInto(b),this.oHash.update(b),this.oHash.digestInto(b),this.destroy()}digest(){const b=new Uint8Array(this.oHash.outputLen);return this.digestInto(b),b}_cloneInto(b){b||(b=Object.create(Object.getPrototypeOf(this),{}));const{oHash:g,iHash:w,finished:_,destroyed:A,blockLen:S,outputLen:k}=this;return b=b,b.finished=_,b.destroyed=A,b.blockLen=S,b.outputLen=k,b.oHash=g._cloneInto(b.oHash),b.iHash=w._cloneInto(b.iHash),b}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}p.HMAC=C;const I=(m,b,g)=>new C(m,b).update(g).digest();p.hmac=I,p.hmac.create=(m,b)=>new C(m,b)},84556:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.ripemd160=p.RIPEMD160=void 0;const v=x(15204),T=x(86361),C=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),I=new Uint8Array(new Array(16).fill(0).map((D,W)=>W)),m=I.map(D=>(9*D+5)%16);let b=[I],g=[m];for(let D=0;D<4;D++)for(let W of[b,g])W.push(W[D].map(H=>C[H]));const w=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(D=>new Uint8Array(D)),_=b.map((D,W)=>D.map(H=>w[W][H])),A=g.map((D,W)=>D.map(H=>w[W][H])),S=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),k=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function B(D,W,H,G){return D===0?W^H^G:D===1?W&H|~W&G:D===2?(W|~H)^G:D===3?W&G|H&~G:W^(H|~G)}const O=new Uint32Array(16);class L extends v.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:W,h1:H,h2:G,h3:Z,h4:Q}=this;return[W,H,G,Z,Q]}set(W,H,G,Z,Q){this.h0=W|0,this.h1=H|0,this.h2=G|0,this.h3=Z|0,this.h4=Q|0}process(W,H){for(let z=0;z<16;z++,H+=4)O[z]=W.getUint32(H,!0);let G=this.h0|0,Z=G,Q=this.h1|0,ie=Q,le=this.h2|0,be=le,we=this.h3|0,Ae=we,re=this.h4|0,N=re;for(let z=0;z<5;z++){const V=4-z,U=S[z],j=k[z],$=b[z],ee=g[z],J=_[z],F=A[z];for(let X=0;X<16;X++){const de=(0,T.rotl)(G+B(z,Q,le,we)+O[$[X]]+U,J[X])+re|0;G=re,re=we,we=(0,T.rotl)(le,10)|0,le=Q,Q=de}for(let X=0;X<16;X++){const de=(0,T.rotl)(Z+B(V,ie,be,Ae)+O[ee[X]]+j,F[X])+N|0;Z=N,N=Ae,Ae=(0,T.rotl)(be,10)|0,be=ie,ie=de}}this.set(this.h1+le+Ae|0,this.h2+we+N|0,this.h3+re+Z|0,this.h4+G+ie|0,this.h0+Q+be|0)}roundClean(){O.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}p.RIPEMD160=L,p.ripemd160=(0,T.wrapConstructor)(()=>new L)},85035:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.sha1=p.SHA1=void 0;const v=x(15204),T=x(86361),C=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),I=new Uint32Array(80);class m extends v.HashMD{constructor(){super(64,20,8,!1),this.A=C[0]|0,this.B=C[1]|0,this.C=C[2]|0,this.D=C[3]|0,this.E=C[4]|0}get(){const{A:g,B:w,C:_,D:A,E:S}=this;return[g,w,_,A,S]}set(g,w,_,A,S){this.A=g|0,this.B=w|0,this.C=_|0,this.D=A|0,this.E=S|0}process(g,w){for(let O=0;O<16;O++,w+=4)I[O]=g.getUint32(w,!1);for(let O=16;O<80;O++)I[O]=(0,T.rotl)(I[O-3]^I[O-8]^I[O-14]^I[O-16],1);let{A:_,B:A,C:S,D:k,E:B}=this;for(let O=0;O<80;O++){let L,D;O<20?(L=(0,v.Chi)(A,S,k),D=1518500249):O<40?(L=A^S^k,D=1859775393):O<60?(L=(0,v.Maj)(A,S,k),D=2400959708):(L=A^S^k,D=3395469782);const W=(0,T.rotl)(_,5)+L+B+D+I[O]|0;B=k,k=S,S=(0,T.rotl)(A,30),A=_,_=W}_=_+this.A|0,A=A+this.B|0,S=S+this.C|0,k=k+this.D|0,B=B+this.E|0,this.set(_,A,S,k,B)}roundClean(){I.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}}p.SHA1=m,p.sha1=(0,T.wrapConstructor)(()=>new m)},23741:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.sha224=p.sha256=p.SHA256=void 0;const v=x(15204),T=x(86361),C=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),I=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),m=new Uint32Array(64);class b extends v.HashMD{constructor(){super(64,32,8,!1),this.A=I[0]|0,this.B=I[1]|0,this.C=I[2]|0,this.D=I[3]|0,this.E=I[4]|0,this.F=I[5]|0,this.G=I[6]|0,this.H=I[7]|0}get(){const{A:_,B:A,C:S,D:k,E:B,F:O,G:L,H:D}=this;return[_,A,S,k,B,O,L,D]}set(_,A,S,k,B,O,L,D){this.A=_|0,this.B=A|0,this.C=S|0,this.D=k|0,this.E=B|0,this.F=O|0,this.G=L|0,this.H=D|0}process(_,A){for(let G=0;G<16;G++,A+=4)m[G]=_.getUint32(A,!1);for(let G=16;G<64;G++){const Z=m[G-15],Q=m[G-2],ie=(0,T.rotr)(Z,7)^(0,T.rotr)(Z,18)^Z>>>3,le=(0,T.rotr)(Q,17)^(0,T.rotr)(Q,19)^Q>>>10;m[G]=le+m[G-7]+ie+m[G-16]|0}let{A:S,B:k,C:B,D:O,E:L,F:D,G:W,H}=this;for(let G=0;G<64;G++){const Z=(0,T.rotr)(L,6)^(0,T.rotr)(L,11)^(0,T.rotr)(L,25),Q=H+Z+(0,v.Chi)(L,D,W)+C[G]+m[G]|0,le=((0,T.rotr)(S,2)^(0,T.rotr)(S,13)^(0,T.rotr)(S,22))+(0,v.Maj)(S,k,B)|0;H=W,W=D,D=L,L=O+Q|0,O=B,B=k,k=S,S=Q+le|0}S=S+this.A|0,k=k+this.B|0,B=B+this.C|0,O=O+this.D|0,L=L+this.E|0,D=D+this.F|0,W=W+this.G|0,H=H+this.H|0,this.set(S,k,B,O,L,D,W,H)}roundClean(){m.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}p.SHA256=b;class g extends b{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}p.sha256=(0,T.wrapConstructor)(()=>new b),p.sha224=(0,T.wrapConstructor)(()=>new g)},86361:function(fe,p,x){"use strict";/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(p,"__esModule",{value:!0}),p.Hash=p.nextTick=p.byteSwapIfBE=p.byteSwap=p.isLE=p.rotl=p.rotr=p.createView=p.u32=p.u8=void 0,p.isBytes=C,p.byteSwap32=A,p.bytesToHex=k,p.hexToBytes=L,p.asyncLoop=W,p.utf8ToBytes=H,p.toBytes=G,p.concatBytes=Z,p.checkOpts=le,p.wrapConstructor=be,p.wrapConstructorWithOpts=we,p.wrapXOFConstructorWithOpts=Ae,p.randomBytes=re;const v=x(90623),T=x(68443);function C(N){return N instanceof Uint8Array||N!=null&&typeof N=="object"&&N.constructor.name==="Uint8Array"}const I=N=>new Uint8Array(N.buffer,N.byteOffset,N.byteLength);p.u8=I;const m=N=>new Uint32Array(N.buffer,N.byteOffset,Math.floor(N.byteLength/4));p.u32=m;const b=N=>new DataView(N.buffer,N.byteOffset,N.byteLength);p.createView=b;const g=(N,z)=>N<<32-z|N>>>z;p.rotr=g;const w=(N,z)=>N<<z|N>>>32-z>>>0;p.rotl=w,p.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const _=N=>N<<24&4278190080|N<<8&16711680|N>>>8&65280|N>>>24&255;p.byteSwap=_,p.byteSwapIfBE=p.isLE?N=>N:N=>(0,p.byteSwap)(N);function A(N){for(let z=0;z<N.length;z++)N[z]=(0,p.byteSwap)(N[z])}const S=Array.from({length:256},(N,z)=>z.toString(16).padStart(2,"0"));function k(N){(0,T.bytes)(N);let z="";for(let V=0;V<N.length;V++)z+=S[N[V]];return z}const B={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function O(N){if(N>=B._0&&N<=B._9)return N-B._0;if(N>=B._A&&N<=B._F)return N-(B._A-10);if(N>=B._a&&N<=B._f)return N-(B._a-10)}function L(N){if(typeof N!="string")throw new Error("hex string expected, got "+typeof N);const z=N.length,V=z/2;if(z%2)throw new Error("padded hex string expected, got unpadded hex of length "+z);const U=new Uint8Array(V);for(let j=0,$=0;j<V;j++,$+=2){const ee=O(N.charCodeAt($)),J=O(N.charCodeAt($+1));if(ee===void 0||J===void 0){const F=N[$]+N[$+1];throw new Error('hex string expected, got non-hex character "'+F+'" at index '+$)}U[j]=ee*16+J}return U}const D=async()=>{};p.nextTick=D;async function W(N,z,V){let U=Date.now();for(let j=0;j<N;j++){V(j);const $=Date.now()-U;$>=0&&$<z||(await(0,p.nextTick)(),U+=$)}}function H(N){if(typeof N!="string")throw new Error(`utf8ToBytes expected string, got ${typeof N}`);return new Uint8Array(new TextEncoder().encode(N))}function G(N){return typeof N=="string"&&(N=H(N)),(0,T.bytes)(N),N}function Z(...N){let z=0;for(let U=0;U<N.length;U++){const j=N[U];(0,T.bytes)(j),z+=j.length}const V=new Uint8Array(z);for(let U=0,j=0;U<N.length;U++){const $=N[U];V.set($,j),j+=$.length}return V}class Q{clone(){return this._cloneInto()}}p.Hash=Q;const ie={}.toString;function le(N,z){if(z!==void 0&&ie.call(z)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(N,z)}function be(N){const z=U=>N().update(G(U)).digest(),V=N();return z.outputLen=V.outputLen,z.blockLen=V.blockLen,z.create=()=>N(),z}function we(N){const z=(U,j)=>N(j).update(G(U)).digest(),V=N({});return z.outputLen=V.outputLen,z.blockLen=V.blockLen,z.create=U=>N(U),z}function Ae(N){const z=(U,j)=>N(j).update(G(U)).digest(),V=N({});return z.outputLen=V.outputLen,z.blockLen=V.blockLen,z.create=U=>N(U),z}function re(N=32){if(v.crypto&&typeof v.crypto.getRandomValues=="function")return v.crypto.getRandomValues(new Uint8Array(N));if(v.crypto&&typeof v.crypto.randomBytes=="function")return v.crypto.randomBytes(N);throw new Error("crypto.getRandomValues must be defined")}},79695:function(fe,p,x){"use strict";/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */Object.defineProperty(p,"__esModule",{value:!0}),p.utils=p.schnorr=p.verify=p.signSync=p.sign=p.getSharedSecret=p.recoverPublicKey=p.getPublicKey=p.Signature=p.Point=p.CURVE=void 0;const v=x(91603),T=BigInt(0),C=BigInt(1),I=BigInt(2),m=BigInt(3),b=BigInt(8),g=Object.freeze({a:T,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:C,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});p.CURVE=g;const w=(ht,st)=>(ht+st/I)/st,_={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(ht){const{n:st}=g,Dt=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),Lt=-C*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),Gt=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),xn=Dt,un=BigInt("0x100000000000000000000000000000000"),fn=w(xn*ht,st),Pe=w(-Lt*ht,st);let Ue=Y(ht-fn*Dt-Pe*Gt,st),Le=Y(-fn*Lt-Pe*xn,st);const _e=Ue>un,Ze=Le>un;if(_e&&(Ue=st-Ue),Ze&&(Le=st-Le),Ue>un||Le>un)throw new Error("splitScalarEndo: Endomorphism failed, k="+ht);return{k1neg:_e,k1:Ue,k2neg:Ze,k2:Le}}},A=32,S=32,k=32,B=A+1,O=2*A+1;function L(ht){const{a:st,b:Dt}=g,Lt=Y(ht*ht),Gt=Y(Lt*ht);return Y(Gt+st*ht+Dt)}const D=g.a===T;class W extends Error{constructor(st){super(st)}}function H(ht){if(!(ht instanceof G))throw new TypeError("JacobianPoint expected")}class G{constructor(st,Dt,Lt){this.x=st,this.y=Dt,this.z=Lt}static fromAffine(st){if(!(st instanceof ie))throw new TypeError("JacobianPoint#fromAffine: expected Point");return st.equals(ie.ZERO)?G.ZERO:new G(st.x,st.y,C)}static toAffineBatch(st){const Dt=ke(st.map(Lt=>Lt.z));return st.map((Lt,Gt)=>Lt.toAffine(Dt[Gt]))}static normalizeZ(st){return G.toAffineBatch(st).map(G.fromAffine)}equals(st){H(st);const{x:Dt,y:Lt,z:Gt}=this,{x:xn,y:un,z:fn}=st,Pe=Y(Gt*Gt),Ue=Y(fn*fn),Le=Y(Dt*Ue),_e=Y(xn*Pe),Ze=Y(Y(Lt*fn)*Ue),Ot=Y(Y(un*Gt)*Pe);return Le===_e&&Ze===Ot}negate(){return new G(this.x,Y(-this.y),this.z)}double(){const{x:st,y:Dt,z:Lt}=this,Gt=Y(st*st),xn=Y(Dt*Dt),un=Y(xn*xn),fn=st+xn,Pe=Y(I*(Y(fn*fn)-Gt-un)),Ue=Y(m*Gt),Le=Y(Ue*Ue),_e=Y(Le-I*Pe),Ze=Y(Ue*(Pe-_e)-b*un),Ot=Y(I*Dt*Lt);return new G(_e,Ze,Ot)}add(st){H(st);const{x:Dt,y:Lt,z:Gt}=this,{x:xn,y:un,z:fn}=st;if(xn===T||un===T)return this;if(Dt===T||Lt===T)return st;const Pe=Y(Gt*Gt),Ue=Y(fn*fn),Le=Y(Dt*Ue),_e=Y(xn*Pe),Ze=Y(Y(Lt*fn)*Ue),Ot=Y(Y(un*Gt)*Pe),Yt=Y(_e-Le),Jt=Y(Ot-Ze);if(Yt===T)return Jt===T?this.double():G.ZERO;const en=Y(Yt*Yt),Vn=Y(Yt*en),kn=Y(Le*en),ir=Y(Jt*Jt-Vn-I*kn),Hn=Y(Jt*(kn-ir)-Ze*Vn),tr=Y(Gt*fn*Yt);return new G(ir,Hn,tr)}subtract(st){return this.add(st.negate())}multiplyUnsafe(st){const Dt=G.ZERO;if(typeof st=="bigint"&&st===T)return Dt;let Lt=de(st);if(Lt===C)return this;if(!D){let _e=Dt,Ze=this;for(;Lt>T;)Lt&C&&(_e=_e.add(Ze)),Ze=Ze.double(),Lt>>=C;return _e}let{k1neg:Gt,k1:xn,k2neg:un,k2:fn}=_.splitScalar(Lt),Pe=Dt,Ue=Dt,Le=this;for(;xn>T||fn>T;)xn&C&&(Pe=Pe.add(Le)),fn&C&&(Ue=Ue.add(Le)),Le=Le.double(),xn>>=C,fn>>=C;return Gt&&(Pe=Pe.negate()),un&&(Ue=Ue.negate()),Ue=new G(Y(Ue.x*_.beta),Ue.y,Ue.z),Pe.add(Ue)}precomputeWindow(st){const Dt=D?128/st+1:256/st+1,Lt=[];let Gt=this,xn=Gt;for(let un=0;un<Dt;un++){xn=Gt,Lt.push(xn);for(let fn=1;fn<2**(st-1);fn++)xn=xn.add(Gt),Lt.push(xn);Gt=xn.double()}return Lt}wNAF(st,Dt){!Dt&&this.equals(G.BASE)&&(Dt=ie.BASE);const Lt=Dt&&Dt._WINDOW_SIZE||1;if(256%Lt)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let Gt=Dt&&Q.get(Dt);Gt||(Gt=this.precomputeWindow(Lt),Dt&&Lt!==1&&(Gt=G.normalizeZ(Gt),Q.set(Dt,Gt)));let xn=G.ZERO,un=G.BASE;const fn=1+(D?128/Lt:256/Lt),Pe=2**(Lt-1),Ue=BigInt(2**Lt-1),Le=2**Lt,_e=BigInt(Lt);for(let Ze=0;Ze<fn;Ze++){const Ot=Ze*Pe;let Yt=Number(st&Ue);st>>=_e,Yt>Pe&&(Yt-=Le,st+=C);const Jt=Ot,en=Ot+Math.abs(Yt)-1,Vn=Ze%2!==0,kn=Yt<0;Yt===0?un=un.add(Z(Vn,Gt[Jt])):xn=xn.add(Z(kn,Gt[en]))}return{p:xn,f:un}}multiply(st,Dt){let Lt=de(st),Gt,xn;if(D){const{k1neg:un,k1:fn,k2neg:Pe,k2:Ue}=_.splitScalar(Lt);let{p:Le,f:_e}=this.wNAF(fn,Dt),{p:Ze,f:Ot}=this.wNAF(Ue,Dt);Le=Z(un,Le),Ze=Z(Pe,Ze),Ze=new G(Y(Ze.x*_.beta),Ze.y,Ze.z),Gt=Le.add(Ze),xn=_e.add(Ot)}else{const{p:un,f:fn}=this.wNAF(Lt,Dt);Gt=un,xn=fn}return G.normalizeZ([Gt,xn])[0]}toAffine(st){const{x:Dt,y:Lt,z:Gt}=this,xn=this.equals(G.ZERO);st==null&&(st=xn?b:Ie(Gt));const un=st,fn=Y(un*un),Pe=Y(fn*un),Ue=Y(Dt*fn),Le=Y(Lt*Pe),_e=Y(Gt*un);if(xn)return ie.ZERO;if(_e!==C)throw new Error("invZ was invalid");return new ie(Ue,Le)}}G.BASE=new G(g.Gx,g.Gy,C),G.ZERO=new G(T,C,T);function Z(ht,st){const Dt=st.negate();return ht?Dt:st}const Q=new WeakMap;class ie{constructor(st,Dt){this.x=st,this.y=Dt}_setWindowSize(st){this._WINDOW_SIZE=st,Q.delete(this)}hasEvenY(){return this.y%I===T}static fromCompressedHex(st){const Dt=st.length===32,Lt=F(Dt?st:st.subarray(1));if(!ft(Lt))throw new Error("Point is not on curve");const Gt=L(Lt);let xn=he(Gt);const un=(xn&C)===C;Dt?un&&(xn=Y(-xn)):(st[0]&1)===1!==un&&(xn=Y(-xn));const fn=new ie(Lt,xn);return fn.assertValidity(),fn}static fromUncompressedHex(st){const Dt=F(st.subarray(1,A+1)),Lt=F(st.subarray(A+1,A*2+1)),Gt=new ie(Dt,Lt);return Gt.assertValidity(),Gt}static fromHex(st){const Dt=X(st),Lt=Dt.length,Gt=Dt[0];if(Lt===A)return this.fromCompressedHex(Dt);if(Lt===B&&(Gt===2||Gt===3))return this.fromCompressedHex(Dt);if(Lt===O&&Gt===4)return this.fromUncompressedHex(Dt);throw new Error(`Point.fromHex: received invalid point. Expected 32-${B} compressed bytes or ${O} uncompressed bytes, not ${Lt}`)}static fromPrivateKey(st){return ie.BASE.multiply(ct(st))}static fromSignature(st,Dt,Lt){const{r:Gt,s:xn}=Rt(Dt);if(![0,1,2,3].includes(Lt))throw new Error("Cannot recover: invalid recovery bit");const un=Re(X(st)),{n:fn}=g,Pe=Lt===2||Lt===3?Gt+fn:Gt,Ue=Ie(Pe,fn),Le=Y(-un*Ue,fn),_e=Y(xn*Ue,fn),Ze=Lt&1?"03":"02",Ot=ie.fromHex(Ze+U(Pe)),Yt=ie.BASE.multiplyAndAddUnsafe(Ot,Le,_e);if(!Yt)throw new Error("Cannot recover signature: point at infinify");return Yt.assertValidity(),Yt}toRawBytes(st=!1){return J(this.toHex(st))}toHex(st=!1){const Dt=U(this.x);return st?`${this.hasEvenY()?"02":"03"}${Dt}`:`04${Dt}${U(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const st="Point is not on elliptic curve",{x:Dt,y:Lt}=this;if(!ft(Dt)||!ft(Lt))throw new Error(st);const Gt=Y(Lt*Lt),xn=L(Dt);if(Y(Gt-xn)!==T)throw new Error(st)}equals(st){return this.x===st.x&&this.y===st.y}negate(){return new ie(this.x,Y(-this.y))}double(){return G.fromAffine(this).double().toAffine()}add(st){return G.fromAffine(this).add(G.fromAffine(st)).toAffine()}subtract(st){return this.add(st.negate())}multiply(st){return G.fromAffine(this).multiply(st,this).toAffine()}multiplyAndAddUnsafe(st,Dt,Lt){const Gt=G.fromAffine(this),xn=Dt===T||Dt===C||this!==ie.BASE?Gt.multiplyUnsafe(Dt):Gt.multiply(Dt),un=G.fromAffine(st).multiplyUnsafe(Lt),fn=xn.add(un);return fn.equals(G.ZERO)?void 0:fn.toAffine()}}p.Point=ie,ie.BASE=new ie(g.Gx,g.Gy),ie.ZERO=new ie(T,T);function le(ht){return Number.parseInt(ht[0],16)>=8?"00"+ht:ht}function be(ht){if(ht.length<2||ht[0]!==2)throw new Error(`Invalid signature integer tag: ${z(ht)}`);const st=ht[1],Dt=ht.subarray(2,st+2);if(!st||Dt.length!==st)throw new Error("Invalid signature integer: wrong length");if(Dt[0]===0&&Dt[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:F(Dt),left:ht.subarray(st+2)}}function we(ht){if(ht.length<2||ht[0]!=48)throw new Error(`Invalid signature tag: ${z(ht)}`);if(ht[1]!==ht.length-2)throw new Error("Invalid signature: incorrect length");const{data:st,left:Dt}=be(ht.subarray(2)),{data:Lt,left:Gt}=be(Dt);if(Gt.length)throw new Error(`Invalid signature: left bytes after parsing: ${z(Gt)}`);return{r:st,s:Lt}}class Ae{constructor(st,Dt){this.r=st,this.s=Dt,this.assertValidity()}static fromCompact(st){const Dt=st instanceof Uint8Array,Lt="Signature.fromCompact";if(typeof st!="string"&&!Dt)throw new TypeError(`${Lt}: Expected string or Uint8Array`);const Gt=Dt?z(st):st;if(Gt.length!==128)throw new Error(`${Lt}: Expected 64-byte hex`);return new Ae(ee(Gt.slice(0,64)),ee(Gt.slice(64,128)))}static fromDER(st){const Dt=st instanceof Uint8Array;if(typeof st!="string"&&!Dt)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:Lt,s:Gt}=we(Dt?st:J(st));return new Ae(Lt,Gt)}static fromHex(st){return this.fromDER(st)}assertValidity(){const{r:st,s:Dt}=this;if(!$t(st))throw new Error("Invalid Signature: r must be 0 < r < n");if(!$t(Dt))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const st=g.n>>C;return this.s>st}normalizeS(){return this.hasHighS()?new Ae(this.r,Y(-this.s,g.n)):this}toDERRawBytes(){return J(this.toDERHex())}toDERHex(){const st=le($(this.s)),Dt=le($(this.r)),Lt=st.length/2,Gt=Dt.length/2,xn=$(Lt),un=$(Gt);return`30${$(Gt+Lt+4)}02${un}${Dt}02${xn}${st}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return J(this.toCompactHex())}toCompactHex(){return U(this.r)+U(this.s)}}p.Signature=Ae;function re(...ht){if(!ht.every(Lt=>Lt instanceof Uint8Array))throw new Error("Uint8Array list expected");if(ht.length===1)return ht[0];const st=ht.reduce((Lt,Gt)=>Lt+Gt.length,0),Dt=new Uint8Array(st);for(let Lt=0,Gt=0;Lt<ht.length;Lt++){const xn=ht[Lt];Dt.set(xn,Gt),Gt+=xn.length}return Dt}const N=Array.from({length:256},(ht,st)=>st.toString(16).padStart(2,"0"));function z(ht){if(!(ht instanceof Uint8Array))throw new Error("Expected Uint8Array");let st="";for(let Dt=0;Dt<ht.length;Dt++)st+=N[ht[Dt]];return st}const V=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function U(ht){if(typeof ht!="bigint")throw new Error("Expected bigint");if(!(T<=ht&&ht<V))throw new Error("Expected number 0 <= n < 2^256");return ht.toString(16).padStart(64,"0")}function j(ht){const st=J(U(ht));if(st.length!==32)throw new Error("Error: expected 32 bytes");return st}function $(ht){const st=ht.toString(16);return st.length&1?`0${st}`:st}function ee(ht){if(typeof ht!="string")throw new TypeError("hexToNumber: expected string, got "+typeof ht);return BigInt(`0x${ht}`)}function J(ht){if(typeof ht!="string")throw new TypeError("hexToBytes: expected string, got "+typeof ht);if(ht.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+ht.length);const st=new Uint8Array(ht.length/2);for(let Dt=0;Dt<st.length;Dt++){const Lt=Dt*2,Gt=ht.slice(Lt,Lt+2),xn=Number.parseInt(Gt,16);if(Number.isNaN(xn)||xn<0)throw new Error("Invalid byte sequence");st[Dt]=xn}return st}function F(ht){return ee(z(ht))}function X(ht){return ht instanceof Uint8Array?Uint8Array.from(ht):J(ht)}function de(ht){if(typeof ht=="number"&&Number.isSafeInteger(ht)&&ht>0)return BigInt(ht);if(typeof ht=="bigint"&&$t(ht))return ht;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Y(ht,st=g.P){const Dt=ht%st;return Dt>=T?Dt:st+Dt}function ce(ht,st){const{P:Dt}=g;let Lt=ht;for(;st-- >T;)Lt*=Lt,Lt%=Dt;return Lt}function he(ht){const{P:st}=g,Dt=BigInt(6),Lt=BigInt(11),Gt=BigInt(22),xn=BigInt(23),un=BigInt(44),fn=BigInt(88),Pe=ht*ht*ht%st,Ue=Pe*Pe*ht%st,Le=ce(Ue,m)*Ue%st,_e=ce(Le,m)*Ue%st,Ze=ce(_e,I)*Pe%st,Ot=ce(Ze,Lt)*Ze%st,Yt=ce(Ot,Gt)*Ot%st,Jt=ce(Yt,un)*Yt%st,en=ce(Jt,fn)*Jt%st,Vn=ce(en,un)*Yt%st,kn=ce(Vn,m)*Ue%st,ir=ce(kn,xn)*Ot%st,Hn=ce(ir,Dt)*Pe%st,tr=ce(Hn,I);if(tr*tr%st!==ht)throw new Error("Cannot find square root");return tr}function Ie(ht,st=g.P){if(ht===T||st<=T)throw new Error(`invert: expected positive integers, got n=${ht} mod=${st}`);let Dt=Y(ht,st),Lt=st,Gt=T,xn=C,un=C,fn=T;for(;Dt!==T;){const Ue=Lt/Dt,Le=Lt%Dt,_e=Gt-un*Ue,Ze=xn-fn*Ue;Lt=Dt,Dt=Le,Gt=un,xn=fn,un=_e,fn=Ze}if(Lt!==C)throw new Error("invert: does not exist");return Y(Gt,st)}function ke(ht,st=g.P){const Dt=new Array(ht.length),Lt=ht.reduce((xn,un,fn)=>un===T?xn:(Dt[fn]=xn,Y(xn*un,st)),C),Gt=Ie(Lt,st);return ht.reduceRight((xn,un,fn)=>un===T?xn:(Dt[fn]=Y(xn*Dt[fn],st),Y(xn*un,st)),Gt),Dt}function ut(ht){const st=ht.length*8-S*8,Dt=F(ht);return st>0?Dt>>BigInt(st):Dt}function Re(ht,st=!1){const Dt=ut(ht);if(st)return Dt;const{n:Lt}=g;return Dt>=Lt?Dt-Lt:Dt}let ze,_t;class Ct{constructor(st,Dt){if(this.hashLen=st,this.qByteLen=Dt,typeof st!="number"||st<2)throw new Error("hashLen must be a number");if(typeof Dt!="number"||Dt<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(st).fill(1),this.k=new Uint8Array(st).fill(0),this.counter=0}hmac(...st){return p.utils.hmacSha256(this.k,...st)}hmacSync(...st){return _t(this.k,...st)}checkSync(){if(typeof _t!="function")throw new W("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(st=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),st),this.v=await this.hmac(this.v),st.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),st),this.v=await this.hmac(this.v))}reseedSync(st=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),st),this.v=this.hmacSync(this.v),st.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),st),this.v=this.hmacSync(this.v))}async generate(){this.incr();let st=0;const Dt=[];for(;st<this.qByteLen;){this.v=await this.hmac(this.v);const Lt=this.v.slice();Dt.push(Lt),st+=this.v.length}return re(...Dt)}generateSync(){this.checkSync(),this.incr();let st=0;const Dt=[];for(;st<this.qByteLen;){this.v=this.hmacSync(this.v);const Lt=this.v.slice();Dt.push(Lt),st+=this.v.length}return re(...Dt)}}function $t(ht){return T<ht&&ht<g.n}function ft(ht){return T<ht&&ht<g.P}function Xe(ht,st,Dt,Lt=!0){const{n:Gt}=g,xn=Re(ht,!0);if(!$t(xn))return;const un=Ie(xn,Gt),fn=ie.BASE.multiply(xn),Pe=Y(fn.x,Gt);if(Pe===T)return;const Ue=Y(un*Y(st+Dt*Pe,Gt),Gt);if(Ue===T)return;let Le=new Ae(Pe,Ue),_e=(fn.x===Le.r?0:2)|Number(fn.y&C);return Lt&&Le.hasHighS()&&(Le=Le.normalizeS(),_e^=1),{sig:Le,recovery:_e}}function ct(ht){let st;if(typeof ht=="bigint")st=ht;else if(typeof ht=="number"&&Number.isSafeInteger(ht)&&ht>0)st=BigInt(ht);else if(typeof ht=="string"){if(ht.length!==2*S)throw new Error("Expected 32 bytes of private key");st=ee(ht)}else if(ht instanceof Uint8Array){if(ht.length!==S)throw new Error("Expected 32 bytes of private key");st=F(ht)}else throw new TypeError("Expected valid private key");if(!$t(st))throw new Error("Expected private key: 0 < key < n");return st}function wt(ht){return ht instanceof ie?(ht.assertValidity(),ht):ie.fromHex(ht)}function Rt(ht){if(ht instanceof Ae)return ht.assertValidity(),ht;try{return Ae.fromDER(ht)}catch{return Ae.fromCompact(ht)}}function Ge(ht,st=!1){return ie.fromPrivateKey(ht).toRawBytes(st)}p.getPublicKey=Ge;function zt(ht,st,Dt,Lt=!1){return ie.fromSignature(ht,st,Dt).toRawBytes(Lt)}p.recoverPublicKey=zt;function Ft(ht){const st=ht instanceof Uint8Array,Dt=typeof ht=="string",Lt=(st||Dt)&&ht.length;return st?Lt===B||Lt===O:Dt?Lt===B*2||Lt===O*2:ht instanceof ie}function tt(ht,st,Dt=!1){if(Ft(ht))throw new TypeError("getSharedSecret: first arg must be private key");if(!Ft(st))throw new TypeError("getSharedSecret: second arg must be public key");const Lt=wt(st);return Lt.assertValidity(),Lt.multiply(ct(ht)).toRawBytes(Dt)}p.getSharedSecret=tt;function qe(ht){const st=ht.length>A?ht.slice(0,A):ht;return F(st)}function dt(ht){const st=qe(ht),Dt=Y(st,g.n);return De(Dt<T?st:Dt)}function De(ht){return j(ht)}function He(ht,st,Dt){if(ht==null)throw new Error(`sign: expected valid message hash, not "${ht}"`);const Lt=X(ht),Gt=ct(st),xn=[De(Gt),dt(Lt)];if(Dt!=null){Dt===!0&&(Dt=p.utils.randomBytes(A));const Pe=X(Dt);if(Pe.length!==A)throw new Error(`sign: Expected ${A} bytes of extra data`);xn.push(Pe)}const un=re(...xn),fn=qe(Lt);return{seed:un,m:fn,d:Gt}}function se(ht,st){const{sig:Dt,recovery:Lt}=ht,{der:Gt,recovered:xn}=Object.assign({canonical:!0,der:!0},st),un=Gt?Dt.toDERRawBytes():Dt.toCompactRawBytes();return xn?[un,Lt]:un}async function oe(ht,st,Dt={}){const{seed:Lt,m:Gt,d:xn}=He(ht,st,Dt.extraEntropy),un=new Ct(k,S);await un.reseed(Lt);let fn;for(;!(fn=Xe(await un.generate(),Gt,xn,Dt.canonical));)await un.reseed();return se(fn,Dt)}p.sign=oe;function ye(ht,st,Dt={}){const{seed:Lt,m:Gt,d:xn}=He(ht,st,Dt.extraEntropy),un=new Ct(k,S);un.reseedSync(Lt);let fn;for(;!(fn=Xe(un.generateSync(),Gt,xn,Dt.canonical));)un.reseedSync();return se(fn,Dt)}p.signSync=ye;const Ee={strict:!0};function me(ht,st,Dt,Lt=Ee){let Gt;try{Gt=Rt(ht),st=X(st)}catch{return!1}const{r:xn,s:un}=Gt;if(Lt.strict&&Gt.hasHighS())return!1;const fn=Re(st);let Pe;try{Pe=wt(Dt)}catch{return!1}const{n:Ue}=g,Le=Ie(un,Ue),_e=Y(fn*Le,Ue),Ze=Y(xn*Le,Ue),Ot=ie.BASE.multiplyAndAddUnsafe(Pe,_e,Ze);return Ot?Y(Ot.x,Ue)===xn:!1}p.verify=me;function Te(ht){return Y(F(ht),g.n)}class Oe{constructor(st,Dt){this.r=st,this.s=Dt,this.assertValidity()}static fromHex(st){const Dt=X(st);if(Dt.length!==64)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${Dt.length}`);const Lt=F(Dt.subarray(0,32)),Gt=F(Dt.subarray(32,64));return new Oe(Lt,Gt)}assertValidity(){const{r:st,s:Dt}=this;if(!ft(st)||!$t(Dt))throw new Error("Invalid signature")}toHex(){return U(this.r)+U(this.s)}toRawBytes(){return J(this.toHex())}}function Qe(ht){return ie.fromPrivateKey(ht).toRawX()}class Vt{constructor(st,Dt,Lt=p.utils.randomBytes()){if(st==null)throw new TypeError(`sign: Expected valid message, not "${st}"`);this.m=X(st);const{x:Gt,scalar:xn}=this.getScalar(ct(Dt));if(this.px=Gt,this.d=xn,this.rand=X(Lt),this.rand.length!==32)throw new TypeError("sign: Expected 32 bytes of aux randomness")}getScalar(st){const Dt=ie.fromPrivateKey(st),Lt=Dt.hasEvenY()?st:g.n-st;return{point:Dt,scalar:Lt,x:Dt.toRawX()}}initNonce(st,Dt){return j(st^F(Dt))}finalizeNonce(st){const Dt=Y(F(st),g.n);if(Dt===T)throw new Error("sign: Creation of signature failed. k is zero");const{point:Lt,x:Gt,scalar:xn}=this.getScalar(Dt);return{R:Lt,rx:Gt,k:xn}}finalizeSig(st,Dt,Lt,Gt){return new Oe(st.x,Y(Dt+Lt*Gt,g.n)).toRawBytes()}error(){throw new Error("sign: Invalid signature produced")}async calc(){const{m:st,d:Dt,px:Lt,rand:Gt}=this,xn=p.utils.taggedHash,un=this.initNonce(Dt,await xn(Un.aux,Gt)),{R:fn,rx:Pe,k:Ue}=this.finalizeNonce(await xn(Un.nonce,un,Lt,st)),Le=Te(await xn(Un.challenge,Pe,Lt,st)),_e=this.finalizeSig(fn,Ue,Le,Dt);return await yn(_e,st,Lt)||this.error(),_e}calcSync(){const{m:st,d:Dt,px:Lt,rand:Gt}=this,xn=p.utils.taggedHashSync,un=this.initNonce(Dt,xn(Un.aux,Gt)),{R:fn,rx:Pe,k:Ue}=this.finalizeNonce(xn(Un.nonce,un,Lt,st)),Le=Te(xn(Un.challenge,Pe,Lt,st)),_e=this.finalizeSig(fn,Ue,Le,Dt);return or(_e,st,Lt)||this.error(),_e}}async function vt(ht,st,Dt){return new Vt(ht,st,Dt).calc()}function Zt(ht,st,Dt){return new Vt(ht,st,Dt).calcSync()}function dn(ht,st,Dt){const Lt=ht instanceof Oe,Gt=Lt?ht:Oe.fromHex(ht);return Lt&&Gt.assertValidity(),{...Gt,m:X(st),P:wt(Dt)}}function ln(ht,st,Dt,Lt){const Gt=ie.BASE.multiplyAndAddUnsafe(st,ct(Dt),Y(-Lt,g.n));return!(!Gt||!Gt.hasEvenY()||Gt.x!==ht)}async function yn(ht,st,Dt){try{const{r:Lt,s:Gt,m:xn,P:un}=dn(ht,st,Dt),fn=Te(await p.utils.taggedHash(Un.challenge,j(Lt),un.toRawX(),xn));return ln(Lt,un,Gt,fn)}catch{return!1}}function or(ht,st,Dt){try{const{r:Lt,s:Gt,m:xn,P:un}=dn(ht,st,Dt),fn=Te(p.utils.taggedHashSync(Un.challenge,j(Lt),un.toRawX(),xn));return ln(Lt,un,Gt,fn)}catch(Lt){if(Lt instanceof W)throw Lt;return!1}}p.schnorr={Signature:Oe,getPublicKey:Qe,sign:vt,verify:yn,signSync:Zt,verifySync:or},ie.BASE._setWindowSize(8);const An={node:v,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},Un={challenge:"BIP0340/challenge",aux:"BIP0340/aux",nonce:"BIP0340/nonce"},Er={};p.utils={bytesToHex:z,hexToBytes:J,concatBytes:re,mod:Y,invert:Ie,isValidPrivateKey(ht){try{return ct(ht),!0}catch{return!1}},_bigintTo32Bytes:j,_normalizePrivateKey:ct,hashToPrivateKey:ht=>{ht=X(ht);const st=S+8;if(ht.length<st||ht.length>1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const Dt=Y(F(ht),g.n-C)+C;return j(Dt)},randomBytes:(ht=32)=>{if(An.web)return An.web.getRandomValues(new Uint8Array(ht));if(An.node){const{randomBytes:st}=An.node;return Uint8Array.from(st(ht))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>p.utils.hashToPrivateKey(p.utils.randomBytes(S+8)),precompute(ht=8,st=ie.BASE){const Dt=st===ie.BASE?st:new ie(st.x,st.y);return Dt._setWindowSize(ht),Dt.multiply(m),Dt},sha256:async(...ht)=>{if(An.web){const st=await An.web.subtle.digest("SHA-256",re(...ht));return new Uint8Array(st)}else if(An.node){const{createHash:st}=An.node,Dt=st("sha256");return ht.forEach(Lt=>Dt.update(Lt)),Uint8Array.from(Dt.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(ht,...st)=>{if(An.web){const Dt=await An.web.subtle.importKey("raw",ht,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Lt=re(...st),Gt=await An.web.subtle.sign("HMAC",Dt,Lt);return new Uint8Array(Gt)}else if(An.node){const{createHmac:Dt}=An.node,Lt=Dt("sha256",ht);return st.forEach(Gt=>Lt.update(Gt)),Uint8Array.from(Lt.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(ht,...st)=>{let Dt=Er[ht];if(Dt===void 0){const Lt=await p.utils.sha256(Uint8Array.from(ht,Gt=>Gt.charCodeAt(0)));Dt=re(Lt,Lt),Er[ht]=Dt}return p.utils.sha256(Dt,...st)},taggedHashSync:(ht,...st)=>{if(typeof ze!="function")throw new W("sha256Sync is undefined, you need to set it");let Dt=Er[ht];if(Dt===void 0){const Lt=ze(Uint8Array.from(ht,Gt=>Gt.charCodeAt(0)));Dt=re(Lt,Lt),Er[ht]=Dt}return ze(Dt,...st)},_JacobianPoint:G},Object.defineProperties(p.utils,{sha256Sync:{configurable:!1,get(){return ze},set(ht){ze||(ze=ht)}},hmacSha256Sync:{configurable:!1,get(){return _t},set(ht){_t||(_t=ht)}}})},53857:function(fe,p,x){"use strict";var v;/**
|
||
* Support for translating between Uint8Array instances and JavaScript
|
||
* native types.
|
||
*
|
||
* {@link module:Layout~Layout|Layout} is the basis of a class
|
||
* hierarchy that associates property names with sequences of encoded
|
||
* bytes.
|
||
*
|
||
* Layouts are supported for these scalar (numeric) types:
|
||
* * {@link module:Layout~UInt|Unsigned integers in little-endian
|
||
* format} with {@link module:Layout.u8|8-bit}, {@link
|
||
* module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},
|
||
* {@link module:Layout.u32|32-bit}, {@link
|
||
* module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}
|
||
* representation ranges;
|
||
* * {@link module:Layout~UIntBE|Unsigned integers in big-endian
|
||
* format} with {@link module:Layout.u16be|16-bit}, {@link
|
||
* module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},
|
||
* {@link module:Layout.u40be|40-bit}, and {@link
|
||
* module:Layout.u48be|48-bit} representation ranges;
|
||
* * {@link module:Layout~Int|Signed integers in little-endian
|
||
* format} with {@link module:Layout.s8|8-bit}, {@link
|
||
* module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},
|
||
* {@link module:Layout.s32|32-bit}, {@link
|
||
* module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}
|
||
* representation ranges;
|
||
* * {@link module:Layout~IntBE|Signed integers in big-endian format}
|
||
* with {@link module:Layout.s16be|16-bit}, {@link
|
||
* module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},
|
||
* {@link module:Layout.s40be|40-bit}, and {@link
|
||
* module:Layout.s48be|48-bit} representation ranges;
|
||
* * 64-bit integral values that decode to an exact (if magnitude is
|
||
* less than 2^53) or nearby integral Number in {@link
|
||
* module:Layout.nu64|unsigned little-endian}, {@link
|
||
* module:Layout.nu64be|unsigned big-endian}, {@link
|
||
* module:Layout.ns64|signed little-endian}, and {@link
|
||
* module:Layout.ns64be|unsigned big-endian} encodings;
|
||
* * 32-bit floating point values with {@link
|
||
* module:Layout.f32|little-endian} and {@link
|
||
* module:Layout.f32be|big-endian} representations;
|
||
* * 64-bit floating point values with {@link
|
||
* module:Layout.f64|little-endian} and {@link
|
||
* module:Layout.f64be|big-endian} representations;
|
||
* * {@link module:Layout.const|Constants} that take no space in the
|
||
* encoded expression.
|
||
*
|
||
* and for these aggregate types:
|
||
* * {@link module:Layout.seq|Sequence}s of instances of a {@link
|
||
* module:Layout~Layout|Layout}, with JavaScript representation as
|
||
* an Array and constant or data-dependent {@link
|
||
* module:Layout~Sequence#count|length};
|
||
* * {@link module:Layout.struct|Structure}s that aggregate a
|
||
* heterogeneous sequence of {@link module:Layout~Layout|Layout}
|
||
* instances, with JavaScript representation as an Object;
|
||
* * {@link module:Layout.union|Union}s that support multiple {@link
|
||
* module:Layout~VariantLayout|variant layouts} over a fixed
|
||
* (padded) or variable (not padded) span of bytes, using an
|
||
* unsigned integer at the start of the data or a separate {@link
|
||
* module:Layout.unionLayoutDiscriminator|layout element} to
|
||
* determine which layout to use when interpreting the buffer
|
||
* contents;
|
||
* * {@link module:Layout.bits|BitStructure}s that contain a sequence
|
||
* of individual {@link
|
||
* module:Layout~BitStructure#addField|BitField}s packed into an 8,
|
||
* 16, 24, or 32-bit unsigned integer starting at the least- or
|
||
* most-significant bit;
|
||
* * {@link module:Layout.cstr|C strings} of varying length;
|
||
* * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link
|
||
* module:Layout~Blob#length|length} raw data.
|
||
*
|
||
* All {@link module:Layout~Layout|Layout} instances are immutable
|
||
* after construction, to prevent internal state from becoming
|
||
* inconsistent.
|
||
*
|
||
* @local Layout
|
||
* @local ExternalLayout
|
||
* @local GreedyCount
|
||
* @local OffsetLayout
|
||
* @local UInt
|
||
* @local UIntBE
|
||
* @local Int
|
||
* @local IntBE
|
||
* @local NearUInt64
|
||
* @local NearUInt64BE
|
||
* @local NearInt64
|
||
* @local NearInt64BE
|
||
* @local Float
|
||
* @local FloatBE
|
||
* @local Double
|
||
* @local DoubleBE
|
||
* @local Sequence
|
||
* @local Structure
|
||
* @local UnionDiscriminator
|
||
* @local UnionLayoutDiscriminator
|
||
* @local Union
|
||
* @local VariantLayout
|
||
* @local BitStructure
|
||
* @local BitField
|
||
* @local Boolean
|
||
* @local Blob
|
||
* @local CString
|
||
* @local Constant
|
||
* @local bindConstructorLayout
|
||
* @module Layout
|
||
* @license MIT
|
||
* @author Peter A. Bigot
|
||
* @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}
|
||
*/v={value:!0},v=v=v=v=v=v=v=v=p.nu64=v=v=p.u32=v=p.u16=p.u8=p.offset=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=void 0,v=v=v=p.blob=v=v=p.seq=v=p.struct=v=v=v=v=v=v=v=v=v=v=p.ns64=v=v=v=v=void 0;const T=x(36533);function C(ce){if(!(ce instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}v=C;function I(ce){return C(ce),T.Buffer.from(ce.buffer,ce.byteOffset,ce.length)}v=I;class m{constructor(he,Ie){if(!Number.isInteger(he))throw new TypeError("span must be an integer");this.span=he,this.property=Ie}makeDestinationObject(){return{}}getSpan(he,Ie){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(he){const Ie=Object.create(this.constructor.prototype);return Object.assign(Ie,this),Ie.property=he,Ie}fromArray(he){}}v=m;function b(ce,he){return he.property?ce+"["+he.property+"]":ce}v=b;function g(ce,he){if(typeof ce!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(ce,"layout_"))throw new Error("Class is already bound to a layout");if(!(he&&he instanceof m))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(he,"boundConstructor_"))throw new Error("layout is already bound to a constructor");ce.layout_=he,he.boundConstructor_=ce,he.makeDestinationObject=()=>new ce,Object.defineProperty(ce.prototype,"encode",{value(Ie,ke){return he.encode(this,Ie,ke)},writable:!0}),Object.defineProperty(ce,"decode",{value(Ie,ke){return he.decode(Ie,ke)},writable:!0})}v=g;class w extends m{isCount(){throw new Error("ExternalLayout is abstract")}}v=w;class _ extends w{constructor(he=1,Ie){if(!Number.isInteger(he)||0>=he)throw new TypeError("elementSpan must be a (positive) integer");super(-1,Ie),this.elementSpan=he}isCount(){return!0}decode(he,Ie=0){C(he);const ke=he.length-Ie;return Math.floor(ke/this.elementSpan)}encode(he,Ie,ke){return 0}}v=_;class A extends w{constructor(he,Ie=0,ke){if(!(he instanceof m))throw new TypeError("layout must be a Layout");if(!Number.isInteger(Ie))throw new TypeError("offset must be integer or undefined");super(he.span,ke||he.property),this.layout=he,this.offset=Ie}isCount(){return this.layout instanceof S||this.layout instanceof k}decode(he,Ie=0){return this.layout.decode(he,Ie+this.offset)}encode(he,Ie,ke=0){return this.layout.encode(he,Ie,ke+this.offset)}}v=A;class S extends m{constructor(he,Ie){if(super(he,Ie),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(he,Ie=0){return I(he).readUIntLE(Ie,this.span)}encode(he,Ie,ke=0){return I(Ie).writeUIntLE(he,ke,this.span),this.span}}v=S;class k extends m{constructor(he,Ie){if(super(he,Ie),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(he,Ie=0){return I(he).readUIntBE(Ie,this.span)}encode(he,Ie,ke=0){return I(Ie).writeUIntBE(he,ke,this.span),this.span}}v=k;class B extends m{constructor(he,Ie){if(super(he,Ie),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(he,Ie=0){return I(he).readIntLE(Ie,this.span)}encode(he,Ie,ke=0){return I(Ie).writeIntLE(he,ke,this.span),this.span}}v=B;class O extends m{constructor(he,Ie){if(super(he,Ie),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(he,Ie=0){return I(he).readIntBE(Ie,this.span)}encode(he,Ie,ke=0){return I(Ie).writeIntBE(he,ke,this.span),this.span}}v=O;const L=Math.pow(2,32);function D(ce){const he=Math.floor(ce/L),Ie=ce-he*L;return{hi32:he,lo32:Ie}}function W(ce,he){return ce*L+he}class H extends m{constructor(he){super(8,he)}decode(he,Ie=0){const ke=I(he),ut=ke.readUInt32LE(Ie),Re=ke.readUInt32LE(Ie+4);return W(Re,ut)}encode(he,Ie,ke=0){const ut=D(he),Re=I(Ie);return Re.writeUInt32LE(ut.lo32,ke),Re.writeUInt32LE(ut.hi32,ke+4),8}}v=H;class G extends m{constructor(he){super(8,he)}decode(he,Ie=0){const ke=I(he),ut=ke.readUInt32BE(Ie),Re=ke.readUInt32BE(Ie+4);return W(ut,Re)}encode(he,Ie,ke=0){const ut=D(he),Re=I(Ie);return Re.writeUInt32BE(ut.hi32,ke),Re.writeUInt32BE(ut.lo32,ke+4),8}}v=G;class Z extends m{constructor(he){super(8,he)}decode(he,Ie=0){const ke=I(he),ut=ke.readUInt32LE(Ie),Re=ke.readInt32LE(Ie+4);return W(Re,ut)}encode(he,Ie,ke=0){const ut=D(he),Re=I(Ie);return Re.writeUInt32LE(ut.lo32,ke),Re.writeInt32LE(ut.hi32,ke+4),8}}v=Z;class Q extends m{constructor(he){super(8,he)}decode(he,Ie=0){const ke=I(he),ut=ke.readInt32BE(Ie),Re=ke.readUInt32BE(Ie+4);return W(ut,Re)}encode(he,Ie,ke=0){const ut=D(he),Re=I(Ie);return Re.writeInt32BE(ut.hi32,ke),Re.writeUInt32BE(ut.lo32,ke+4),8}}v=Q;class ie extends m{constructor(he){super(4,he)}decode(he,Ie=0){return I(he).readFloatLE(Ie)}encode(he,Ie,ke=0){return I(Ie).writeFloatLE(he,ke),4}}v=ie;class le extends m{constructor(he){super(4,he)}decode(he,Ie=0){return I(he).readFloatBE(Ie)}encode(he,Ie,ke=0){return I(Ie).writeFloatBE(he,ke),4}}v=le;class be extends m{constructor(he){super(8,he)}decode(he,Ie=0){return I(he).readDoubleLE(Ie)}encode(he,Ie,ke=0){return I(Ie).writeDoubleLE(he,ke),8}}v=be;class we extends m{constructor(he){super(8,he)}decode(he,Ie=0){return I(he).readDoubleBE(Ie)}encode(he,Ie,ke=0){return I(Ie).writeDoubleBE(he,ke),8}}v=we;class Ae extends m{constructor(he,Ie,ke){if(!(he instanceof m))throw new TypeError("elementLayout must be a Layout");if(!(Ie instanceof w&&Ie.isCount()||Number.isInteger(Ie)&&0<=Ie))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let ut=-1;!(Ie instanceof w)&&0<he.span&&(ut=Ie*he.span),super(ut,ke),this.elementLayout=he,this.count=Ie}getSpan(he,Ie=0){if(0<=this.span)return this.span;let ke=0,ut=this.count;if(ut instanceof w&&(ut=ut.decode(he,Ie)),0<this.elementLayout.span)ke=ut*this.elementLayout.span;else{let Re=0;for(;Re<ut;)ke+=this.elementLayout.getSpan(he,Ie+ke),++Re}return ke}decode(he,Ie=0){const ke=[];let ut=0,Re=this.count;for(Re instanceof w&&(Re=Re.decode(he,Ie));ut<Re;)ke.push(this.elementLayout.decode(he,Ie)),Ie+=this.elementLayout.getSpan(he,Ie),ut+=1;return ke}encode(he,Ie,ke=0){const ut=this.elementLayout,Re=he.reduce((ze,_t)=>ze+ut.encode(_t,Ie,ke+ze),0);return this.count instanceof w&&this.count.encode(he.length,Ie,ke),Re}}v=Ae;class re extends m{constructor(he,Ie,ke){if(!(Array.isArray(he)&&he.reduce((Re,ze)=>Re&&ze instanceof m,!0)))throw new TypeError("fields must be array of Layout instances");typeof Ie=="boolean"&&ke===void 0&&(ke=Ie,Ie=void 0);for(const Re of he)if(0>Re.span&&Re.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let ut=-1;try{ut=he.reduce((Re,ze)=>Re+ze.getSpan(),0)}catch{}super(ut,Ie),this.fields=he,this.decodePrefixes=!!ke}getSpan(he,Ie=0){if(0<=this.span)return this.span;let ke=0;try{ke=this.fields.reduce((ut,Re)=>{const ze=Re.getSpan(he,Ie);return Ie+=ze,ut+ze},0)}catch{throw new RangeError("indeterminate span")}return ke}decode(he,Ie=0){C(he);const ke=this.makeDestinationObject();for(const ut of this.fields)if(ut.property!==void 0&&(ke[ut.property]=ut.decode(he,Ie)),Ie+=ut.getSpan(he,Ie),this.decodePrefixes&&he.length===Ie)break;return ke}encode(he,Ie,ke=0){const ut=ke;let Re=0,ze=0;for(const _t of this.fields){let Ct=_t.span;if(ze=0<Ct?Ct:0,_t.property!==void 0){const $t=he[_t.property];$t!==void 0&&(ze=_t.encode($t,Ie,ke),0>Ct&&(Ct=_t.getSpan(Ie,ke)))}Re=ke,ke+=Ct}return Re+ze-ut}fromArray(he){const Ie=this.makeDestinationObject();for(const ke of this.fields)ke.property!==void 0&&0<he.length&&(Ie[ke.property]=he.shift());return Ie}layoutFor(he){if(typeof he!="string")throw new TypeError("property must be string");for(const Ie of this.fields)if(Ie.property===he)return Ie}offsetOf(he){if(typeof he!="string")throw new TypeError("property must be string");let Ie=0;for(const ke of this.fields){if(ke.property===he)return Ie;0>ke.span?Ie=-1:0<=Ie&&(Ie+=ke.span)}}}v=re;class N{constructor(he){this.property=he}decode(he,Ie){throw new Error("UnionDiscriminator is abstract")}encode(he,Ie,ke){throw new Error("UnionDiscriminator is abstract")}}v=N;class z extends N{constructor(he,Ie){if(!(he instanceof w&&he.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(Ie||he.property||"variant"),this.layout=he}decode(he,Ie){return this.layout.decode(he,Ie)}encode(he,Ie,ke){return this.layout.encode(he,Ie,ke)}}v=z;class V extends m{constructor(he,Ie,ke){let ut;if(he instanceof S||he instanceof k)ut=new z(new A(he));else if(he instanceof w&&he.isCount())ut=new z(he);else if(he instanceof N)ut=he;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(Ie===void 0&&(Ie=null),!(Ie===null||Ie instanceof m))throw new TypeError("defaultLayout must be null or a Layout");if(Ie!==null){if(0>Ie.span)throw new Error("defaultLayout must have constant span");Ie.property===void 0&&(Ie=Ie.replicate("content"))}let Re=-1;Ie&&(Re=Ie.span,0<=Re&&(he instanceof S||he instanceof k)&&(Re+=ut.layout.span)),super(Re,ke),this.discriminator=ut,this.usesPrefixDiscriminator=he instanceof S||he instanceof k,this.defaultLayout=Ie,this.registry={};let ze=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(_t){return ze(_t)},this.configGetSourceVariant=function(_t){ze=_t.bind(this)}}getSpan(he,Ie=0){if(0<=this.span)return this.span;const ke=this.getVariant(he,Ie);if(!ke)throw new Error("unable to determine span for unrecognized variant");return ke.getSpan(he,Ie)}defaultGetSourceVariant(he){if(Object.prototype.hasOwnProperty.call(he,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(he,this.defaultLayout.property))return;const Ie=this.registry[he[this.discriminator.property]];if(Ie&&(!Ie.layout||Ie.property&&Object.prototype.hasOwnProperty.call(he,Ie.property)))return Ie}else for(const Ie in this.registry){const ke=this.registry[Ie];if(ke.property&&Object.prototype.hasOwnProperty.call(he,ke.property))return ke}throw new Error("unable to infer src variant")}decode(he,Ie=0){let ke;const ut=this.discriminator,Re=ut.decode(he,Ie),ze=this.registry[Re];if(ze===void 0){const _t=this.defaultLayout;let Ct=0;this.usesPrefixDiscriminator&&(Ct=ut.layout.span),ke=this.makeDestinationObject(),ke[ut.property]=Re,ke[_t.property]=_t.decode(he,Ie+Ct)}else ke=ze.decode(he,Ie);return ke}encode(he,Ie,ke=0){const ut=this.getSourceVariant(he);if(ut===void 0){const Re=this.discriminator,ze=this.defaultLayout;let _t=0;return this.usesPrefixDiscriminator&&(_t=Re.layout.span),Re.encode(he[Re.property],Ie,ke),_t+ze.encode(he[ze.property],Ie,ke+_t)}return ut.encode(he,Ie,ke)}addVariant(he,Ie,ke){const ut=new U(this,he,Ie,ke);return this.registry[he]=ut,ut}getVariant(he,Ie=0){let ke;return he instanceof Uint8Array?ke=this.discriminator.decode(he,Ie):ke=he,this.registry[ke]}}v=V;class U extends m{constructor(he,Ie,ke,ut){if(!(he instanceof V))throw new TypeError("union must be a Union");if(!Number.isInteger(Ie)||0>Ie)throw new TypeError("variant must be a (non-negative) integer");if(typeof ke=="string"&&ut===void 0&&(ut=ke,ke=null),ke){if(!(ke instanceof m))throw new TypeError("layout must be a Layout");if(he.defaultLayout!==null&&0<=ke.span&&ke.span>he.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof ut!="string")throw new TypeError("variant must have a String property")}let Re=he.span;0>he.span&&(Re=ke?ke.span:0,0<=Re&&he.usesPrefixDiscriminator&&(Re+=he.discriminator.layout.span)),super(Re,ut),this.union=he,this.variant=Ie,this.layout=ke||null}getSpan(he,Ie=0){if(0<=this.span)return this.span;let ke=0;this.union.usesPrefixDiscriminator&&(ke=this.union.discriminator.layout.span);let ut=0;return this.layout&&(ut=this.layout.getSpan(he,Ie+ke)),ke+ut}decode(he,Ie=0){const ke=this.makeDestinationObject();if(this!==this.union.getVariant(he,Ie))throw new Error("variant mismatch");let ut=0;return this.union.usesPrefixDiscriminator&&(ut=this.union.discriminator.layout.span),this.layout?ke[this.property]=this.layout.decode(he,Ie+ut):this.property?ke[this.property]=!0:this.union.usesPrefixDiscriminator&&(ke[this.union.discriminator.property]=this.variant),ke}encode(he,Ie,ke=0){let ut=0;if(this.union.usesPrefixDiscriminator&&(ut=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(he,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,Ie,ke);let Re=ut;if(this.layout&&(this.layout.encode(he[this.property],Ie,ke+ut),Re+=this.layout.getSpan(Ie,ke+ut),0<=this.union.span&&Re>this.union.span))throw new Error("encoded variant overruns containing union");return Re}fromArray(he){if(this.layout)return this.layout.fromArray(he)}}v=U;function j(ce){return 0>ce&&(ce+=4294967296),ce}class $ extends m{constructor(he,Ie,ke){if(!(he instanceof S||he instanceof k))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof Ie=="string"&&ke===void 0&&(ke=Ie,Ie=!1),4<he.span)throw new RangeError("word cannot exceed 32 bits");super(he.span,ke),this.word=he,this.msb=!!Ie,this.fields=[];let ut=0;this._packedSetValue=function(Re){return ut=j(Re),this},this._packedGetValue=function(){return ut}}decode(he,Ie=0){const ke=this.makeDestinationObject(),ut=this.word.decode(he,Ie);this._packedSetValue(ut);for(const Re of this.fields)Re.property!==void 0&&(ke[Re.property]=Re.decode(he));return ke}encode(he,Ie,ke=0){const ut=this.word.decode(Ie,ke);this._packedSetValue(ut);for(const Re of this.fields)if(Re.property!==void 0){const ze=he[Re.property];ze!==void 0&&Re.encode(ze)}return this.word.encode(this._packedGetValue(),Ie,ke)}addField(he,Ie){const ke=new ee(this,he,Ie);return this.fields.push(ke),ke}addBoolean(he){const Ie=new J(this,he);return this.fields.push(Ie),Ie}fieldFor(he){if(typeof he!="string")throw new TypeError("property must be string");for(const Ie of this.fields)if(Ie.property===he)return Ie}}v=$;class ee{constructor(he,Ie,ke){if(!(he instanceof $))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(Ie)||0>=Ie)throw new TypeError("bits must be positive integer");const ut=8*he.span,Re=he.fields.reduce((ze,_t)=>ze+_t.bits,0);if(Ie+Re>ut)throw new Error("bits too long for span remainder ("+(ut-Re)+" of "+ut+" remain)");this.container=he,this.bits=Ie,this.valueMask=(1<<Ie)-1,Ie===32&&(this.valueMask=4294967295),this.start=Re,this.container.msb&&(this.start=ut-Re-Ie),this.wordMask=j(this.valueMask<<this.start),this.property=ke}decode(he,Ie){const ke=this.container._packedGetValue();return j(ke&this.wordMask)>>>this.start}encode(he){if(typeof he!="number"||!Number.isInteger(he)||he!==j(he&this.valueMask))throw new TypeError(b("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const Ie=this.container._packedGetValue(),ke=j(he<<this.start);this.container._packedSetValue(j(Ie&~this.wordMask)|ke)}}v=ee;class J extends ee{constructor(he,Ie){super(he,1,Ie)}decode(he,Ie){return!!super.decode(he,Ie)}encode(he){typeof he=="boolean"&&(he=+he),super.encode(he)}}v=J;class F extends m{constructor(he,Ie){if(!(he instanceof w&&he.isCount()||Number.isInteger(he)&&0<=he))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let ke=-1;he instanceof w||(ke=he),super(ke,Ie),this.length=he}getSpan(he,Ie){let ke=this.span;return 0>ke&&(ke=this.length.decode(he,Ie)),ke}decode(he,Ie=0){let ke=this.span;return 0>ke&&(ke=this.length.decode(he,Ie)),I(he).slice(Ie,Ie+ke)}encode(he,Ie,ke){let ut=this.length;if(this.length instanceof w&&(ut=he.length),!(he instanceof Uint8Array&&ut===he.length))throw new TypeError(b("Blob.encode",this)+" requires (length "+ut+") Uint8Array as src");if(ke+ut>Ie.length)throw new RangeError("encoding overruns Uint8Array");const Re=I(he);return I(Ie).write(Re.toString("hex"),ke,ut,"hex"),this.length instanceof w&&this.length.encode(ut,Ie,ke),ut}}v=F;class X extends m{constructor(he){super(-1,he)}getSpan(he,Ie=0){C(he);let ke=Ie;for(;ke<he.length&&he[ke]!==0;)ke+=1;return 1+ke-Ie}decode(he,Ie=0){const ke=this.getSpan(he,Ie);return I(he).slice(Ie,Ie+ke-1).toString("utf-8")}encode(he,Ie,ke=0){typeof he!="string"&&(he=String(he));const ut=T.Buffer.from(he,"utf8"),Re=ut.length;if(ke+Re>Ie.length)throw new RangeError("encoding overruns Buffer");const ze=I(Ie);return ut.copy(ze,ke),ze[ke+Re]=0,Re+1}}v=X;class de extends m{constructor(he,Ie){if(typeof he=="string"&&Ie===void 0&&(Ie=he,he=void 0),he===void 0)he=-1;else if(!Number.isInteger(he))throw new TypeError("maxSpan must be an integer");super(-1,Ie),this.maxSpan=he}getSpan(he,Ie=0){return C(he),he.length-Ie}decode(he,Ie=0){const ke=this.getSpan(he,Ie);if(0<=this.maxSpan&&this.maxSpan<ke)throw new RangeError("text length exceeds maxSpan");return I(he).slice(Ie,Ie+ke).toString("utf-8")}encode(he,Ie,ke=0){typeof he!="string"&&(he=String(he));const ut=T.Buffer.from(he,"utf8"),Re=ut.length;if(0<=this.maxSpan&&this.maxSpan<Re)throw new RangeError("text length exceeds maxSpan");if(ke+Re>Ie.length)throw new RangeError("encoding overruns Buffer");return ut.copy(I(Ie),ke),Re}}v=de;class Y extends m{constructor(he,Ie){super(0,Ie),this.value=he}decode(he,Ie){return this.value}encode(he,Ie,ke){return 0}}v=Y,v=(ce,he)=>new _(ce,he),p.offset=(ce,he,Ie)=>new A(ce,he,Ie),p.u8=ce=>new S(1,ce),p.u16=ce=>new S(2,ce),v=ce=>new S(3,ce),p.u32=ce=>new S(4,ce),v=ce=>new S(5,ce),v=ce=>new S(6,ce),p.nu64=ce=>new H(ce),v=ce=>new k(2,ce),v=ce=>new k(3,ce),v=ce=>new k(4,ce),v=ce=>new k(5,ce),v=ce=>new k(6,ce),v=ce=>new G(ce),v=ce=>new B(1,ce),v=ce=>new B(2,ce),v=ce=>new B(3,ce),v=ce=>new B(4,ce),v=ce=>new B(5,ce),v=ce=>new B(6,ce),p.ns64=ce=>new Z(ce),v=ce=>new O(2,ce),v=ce=>new O(3,ce),v=ce=>new O(4,ce),v=ce=>new O(5,ce),v=ce=>new O(6,ce),v=ce=>new Q(ce),v=ce=>new ie(ce),v=ce=>new le(ce),v=ce=>new be(ce),v=ce=>new we(ce),p.struct=(ce,he,Ie)=>new re(ce,he,Ie),v=(ce,he,Ie)=>new $(ce,he,Ie),p.seq=(ce,he,Ie)=>new Ae(ce,he,Ie),v=(ce,he,Ie)=>new V(ce,he,Ie),v=(ce,he)=>new z(ce,he),p.blob=(ce,he)=>new F(ce,he),v=ce=>new X(ce),v=(ce,he)=>new de(ce,he),v=(ce,he)=>new Y(ce,he)},89351:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}},C;Object.defineProperty(p,"__esModule",{value:!0}),p.ADNLAddress=void 0;const I=T(x(2242)),m=x(20711),b=x(9922);class g{static parseFriendly(_){if(_.length!==55)throw Error("Invalid address");_="f"+_;let A=(0,m.base32Decode)(_);if(A[0]!==45)throw Error("Invalid address");let S=A.slice(33);if(!(0,b.crc16)(A.slice(0,33)).equals(S))throw Error("Invalid address");return new g(A.slice(1,33))}static parseRaw(_){const A=v.from(_,"base64");return new g(A)}constructor(_){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>{let A=v.concat([v.from([45]),this.address]),S=(0,b.crc16)(A);return A=v.concat([A,S]),(0,m.base32Encode)(A).slice(1)},this[C]=()=>this.toString(),_.length!==32)throw Error("Invalid address");this.address=_}equals(_){return this.address.equals(_.address)}}p.ADNLAddress=g,C=I.default},14526:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(k){return k&&k.__esModule?k:{default:k}},C;Object.defineProperty(p,"__esModule",{value:!0}),p.address=p.Address=void 0;const I=T(x(2242)),m=x(9922),b=17,g=81,w=128;function _(k){if(typeof k=="string"&&!A.isFriendly(k))throw new Error("Unknown address type");const B=v.isBuffer(k)?k:v.from(k,"base64");if(B.length!==36)throw new Error("Unknown address type: byte length is not equal to 36");const O=B.subarray(0,34),L=B.subarray(34,36),D=(0,m.crc16)(O);if(!(D[0]===L[0]&&D[1]===L[1]))throw new Error("Invalid checksum: "+k);let W=O[0],H=!1,G=!1;if(W&w&&(H=!0,W=W^w),W!==b&&W!==g)throw"Unknown address tag";G=W===b;let Z=null;O[1]===255?Z=-1:Z=O[1];const Q=O.subarray(2,34);return{isTestOnly:H,isBounceable:G,workchain:Z,hashPart:Q}}class A{static isAddress(B){return B instanceof A}static isFriendly(B){return!(B.length!==48||!/[A-Za-z0-9+/_-]+/.test(B))}static isRaw(B){if(B.indexOf(":")===-1)return!1;let[O,L]=B.split(":");return!(!Number.isInteger(parseFloat(O))||!/[a-f0-9]+/.test(L.toLowerCase())||L.length!==64)}static normalize(B){return typeof B=="string"?A.parse(B).toString():B.toString()}static parse(B){if(A.isFriendly(B))return this.parseFriendly(B).address;if(A.isRaw(B))return this.parseRaw(B);throw new Error("Unknown address type: "+B)}static parseRaw(B){let O=parseInt(B.split(":")[0]),L=v.from(B.split(":")[1],"hex");return new A(O,L)}static parseFriendly(B){if(v.isBuffer(B)){let O=_(B);return{isBounceable:O.isBounceable,isTestOnly:O.isTestOnly,address:new A(O.workchain,O.hashPart)}}else{let O=B.replace(/\-/g,"+").replace(/_/g,"/"),L=_(O);return{isBounceable:L.isBounceable,isTestOnly:L.isTestOnly,address:new A(L.workchain,L.hashPart)}}}constructor(B,O){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const L=v.alloc(36);return L.set(this.hash),L.set([this.workChain,this.workChain,this.workChain,this.workChain],32),L},this.toStringBuffer=L=>{let D=L&&L.testOnly!==void 0?L.testOnly:!1,H=(L&&L.bounceable!==void 0?L.bounceable:!0)?b:g;D&&(H|=w);const G=v.alloc(34);G[0]=H,G[1]=this.workChain,G.set(this.hash,2);const Z=v.alloc(36);return Z.set(G),Z.set((0,m.crc16)(G),34),Z},this.toString=L=>{let D=L&&L.urlSafe!==void 0?L.urlSafe:!0,W=this.toStringBuffer(L);return D?W.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):W.toString("base64")},this[C]=()=>this.toString(),O.length!==32)throw new Error("Invalid address hash length: "+O.length);this.workChain=B,this.hash=O,Object.freeze(this)}equals(B){return B.workChain!==this.workChain?!1:B.hash.equals(this.hash)}}p.Address=A,C=I.default;function S(k){return A.parse(k)}p.address=S},78483:function(fe,p,x){"use strict";var v=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}},T;Object.defineProperty(p,"__esModule",{value:!0}),p.ExternalAddress=void 0;const C=v(x(2242));class I{static isAddress(b){return b instanceof I}constructor(b,g){this[T]=()=>this.toString(),this.value=b,this.bits=g}toString(){return`External<${this.bits}:${this.value}>`}}p.ExternalAddress=I,T=C.default},95220:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.contractAddress=void 0;const v=x(3881),T=x(78668),C=x(14526);function I(m,b){let g=(0,v.beginCell)().store((0,T.storeStateInit)(b)).endCell().hash();return new C.Address(m,g)}p.contractAddress=I},96254:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.BitBuilder=void 0;const T=x(14526),C=x(78483),I=x(8496);class m{constructor(g=1023){this._buffer=v.alloc(Math.ceil(g/8)),this._length=0}get length(){return this._length}writeBit(g){let w=this._length;if(w>this._buffer.length*8)throw new Error("BitBuilder overflow");(typeof g=="boolean"&&g===!0||typeof g=="number"&&g>0)&&(this._buffer[w/8|0]|=1<<7-w%8),this._length++}writeBits(g){for(let w=0;w<g.length;w++)this.writeBit(g.at(w))}writeBuffer(g){if(this._length%8===0){if(this._length+g.length*8>this._buffer.length*8)throw new Error("BitBuilder overflow");g.copy(this._buffer,this._length/8),this._length+=g.length*8}else for(let w=0;w<g.length;w++)this.writeUint(g[w],8)}writeUint(g,w){if(w<0||!Number.isSafeInteger(w))throw Error(`invalid bit length. Got ${w}`);const _=BigInt(g);if(w===0){if(_!==0n)throw Error(`value is not zero for ${w} bits. Got ${g}`);return}const A=1n<<BigInt(w);if(_<0||_>=A)throw Error(`bitLength is too small for a value ${g}. Got ${w}`);if(this._length+w>this._buffer.length*8)throw new Error("BitBuilder overflow");const S=8-this._length%8;if(S>0){const k=Math.floor(this._length/8);if(w<S){const B=Number(_);this._buffer[k]|=B<<S-w,this._length+=w}else{const B=Number(_>>BigInt(w-S));this._buffer[k]|=B,this._length+=S}}for(w-=S;w>0;)w>=8?(this._buffer[this._length/8]=Number(_>>BigInt(w-8)&0xffn),this._length+=8,w-=8):(this._buffer[this._length/8]=Number(_<<BigInt(8-w)&0xffn),this._length+=w,w=0)}writeInt(g,w){let _=BigInt(g);if(w<0||!Number.isSafeInteger(w))throw Error(`invalid bit length. Got ${w}`);if(w===0){if(g!==0n)throw Error(`value is not zero for ${w} bits. Got ${g}`);return}if(w===1){if(g!==-1n&&g!==0n)throw Error(`value is not zero or -1 for ${w} bits. Got ${g}`);this.writeBit(g===-1n);return}let A=1n<<BigInt(w)-1n;if(_<-A||_>=A)throw Error(`value is out of range for ${w} bits. Got ${g}`);_<0?(this.writeBit(!0),_=A+_):this.writeBit(!1),this.writeUint(_,w-1)}writeVarUint(g,w){let _=BigInt(g);if(w<0||!Number.isSafeInteger(w))throw Error(`invalid bit length. Got ${w}`);if(_<0)throw Error(`value is negative. Got ${g}`);if(_===0n){this.writeUint(0,w);return}const A=Math.ceil(_.toString(2).length/8),S=A*8;this.writeUint(A,w),this.writeUint(_,S)}writeVarInt(g,w){let _=BigInt(g);if(w<0||!Number.isSafeInteger(w))throw Error(`invalid bit length. Got ${w}`);if(_===0n){this.writeUint(0,w);return}let A=_>0?_:-_;const S=1+Math.ceil(A.toString(2).length/8),k=S*8;this.writeUint(S,w),this.writeInt(_,k)}writeCoins(g){this.writeVarUint(g,4)}writeAddress(g){if(g==null){this.writeUint(0,2);return}if(T.Address.isAddress(g)){this.writeUint(2,2),this.writeUint(0,1),this.writeInt(g.workChain,8),this.writeBuffer(g.hash);return}if(C.ExternalAddress.isAddress(g)){this.writeUint(1,2),this.writeUint(g.bits,9),this.writeUint(g.value,g.bits);return}throw Error(`Invalid address. Got ${g}`)}build(){return new I.BitString(this._buffer,0,this._length)}buffer(){if(this._length%8!==0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}}p.BitBuilder=m},6302:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.BitReader=void 0;const T=x(14526),C=x(78483);class I{constructor(b,g=0){this._checkpoints=[],this._bits=b,this._offset=g}get offset(){return this._offset}get remaining(){return this._bits.length-this._offset}skip(b){if(b<0||this._offset+b>this._bits.length)throw new Error(`Index ${this._offset+b} is out of bounds`);this._offset+=b}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let b=this._bits.at(this._offset);return this._offset++,b}preloadBit(){return this._bits.at(this._offset)}loadBits(b){let g=this._bits.substring(this._offset,b);return this._offset+=b,g}preloadBits(b){return this._bits.substring(this._offset,b)}loadBuffer(b){let g=this._preloadBuffer(b,this._offset);return this._offset+=b*8,g}preloadBuffer(b){return this._preloadBuffer(b,this._offset)}loadUint(b){return this._toSafeInteger(this.loadUintBig(b),"loadUintBig")}loadUintBig(b){let g=this.preloadUintBig(b);return this._offset+=b,g}preloadUint(b){return this._toSafeInteger(this._preloadUint(b,this._offset),"preloadUintBig")}preloadUintBig(b){return this._preloadUint(b,this._offset)}loadInt(b){let g=this._preloadInt(b,this._offset);return this._offset+=b,this._toSafeInteger(g,"loadUintBig")}loadIntBig(b){let g=this._preloadInt(b,this._offset);return this._offset+=b,g}preloadInt(b){return this._toSafeInteger(this._preloadInt(b,this._offset),"preloadIntBig")}preloadIntBig(b){return this._preloadInt(b,this._offset)}loadVarUint(b){let g=Number(this.loadUint(b));return this._toSafeInteger(this.loadUintBig(g*8),"loadVarUintBig")}loadVarUintBig(b){let g=Number(this.loadUint(b));return this.loadUintBig(g*8)}preloadVarUint(b){let g=Number(this._preloadUint(b,this._offset));return this._toSafeInteger(this._preloadUint(g*8,this._offset+b),"preloadVarUintBig")}preloadVarUintBig(b){let g=Number(this._preloadUint(b,this._offset));return this._preloadUint(g*8,this._offset+b)}loadVarInt(b){let g=Number(this.loadUint(b));return this._toSafeInteger(this.loadIntBig(g*8),"loadVarIntBig")}loadVarIntBig(b){let g=Number(this.loadUint(b));return this.loadIntBig(g*8)}preloadVarInt(b){let g=Number(this._preloadUint(b,this._offset));return this._toSafeInteger(this._preloadInt(g*8,this._offset+b),"preloadVarIntBig")}preloadVarIntBig(b){let g=Number(this._preloadUint(b,this._offset));return this._preloadInt(g*8,this._offset+b)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let b=Number(this._preloadUint(2,this._offset));if(b===2)return this._loadInternalAddress();throw new Error("Invalid address: "+b)}loadMaybeAddress(){let b=Number(this._preloadUint(2,this._offset));if(b===0)return this._offset+=2,null;if(b===2)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(Number(this._preloadUint(2,this._offset))===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let b=Number(this._preloadUint(2,this._offset));if(b===0)return this._offset+=2,null;if(b===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let b=Number(this._preloadUint(2,this._offset));if(b===0)return this._offset+=2,null;if(b===2)return this._loadInternalAddress();if(b===1)return this._loadExternalAddress();throw Error(b===3?"Unsupported":"Unreachable")}loadPaddedBits(b){if(b%8!==0)throw new Error("Invalid number of bits");let g=b;for(;;)if(this._bits.at(this._offset+g-1)){g--;break}else g--;let w=this._bits.substring(this._offset,g);return this._offset+=b,w}clone(){return new I(this._bits,this._offset)}_preloadInt(b,g){if(b==0)return 0n;let w=this._bits.at(g),_=0n;for(let A=0;A<b-1;A++)this._bits.at(g+1+A)&&(_+=1n<<BigInt(b-A-1-1));return w&&(_=_-(1n<<BigInt(b-1))),_}_preloadUint(b,g){if(b==0)return 0n;let w=0n;for(let _=0;_<b;_++)this._bits.at(g+_)&&(w+=1n<<BigInt(b-_-1));return w}_preloadBuffer(b,g){let w=this._bits.subbuffer(g,b*8);if(w)return w;let _=v.alloc(b);for(let A=0;A<b;A++)_[A]=Number(this._preloadUint(8,g+A*8));return _}_loadInternalAddress(){if(Number(this._preloadUint(2,this._offset))!==2||this._preloadUint(1,this._offset+2)!==0n)throw Error("Invalid address");let g=Number(this._preloadInt(8,this._offset+3)),w=this._preloadBuffer(32,this._offset+11);return this._offset+=267,new T.Address(g,w)}_loadExternalAddress(){if(Number(this._preloadUint(2,this._offset))!==1)throw Error("Invalid address");let g=Number(this._preloadUint(9,this._offset+2)),w=this._preloadUint(g,this._offset+11);return this._offset+=11+g,new C.ExternalAddress(w,g)}_toSafeInteger(b,g){if(BigInt(Number.MAX_SAFE_INTEGER)<b||b<BigInt(Number.MIN_SAFE_INTEGER))throw new TypeError(`${b} is out of safe integer range. Use ${g} instead`);return Number(b)}}p.BitReader=I},8496:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}},C;Object.defineProperty(p,"__esModule",{value:!0}),p.BitString=void 0;const I=x(40676),m=T(x(2242));class b{static isBitString(w){return w instanceof b}constructor(w,_,A){if(this[C]=()=>this.toString(),A<0)throw new Error(`Length ${A} is out of bounds`);this._length=A,this._data=w,this._offset=_}get length(){return this._length}at(w){if(w>=this._length)throw new Error(`Index ${w} > ${this._length} is out of bounds`);if(w<0)throw new Error(`Index ${w} < 0 is out of bounds`);let _=this._offset+w>>3,A=7-(this._offset+w)%8;return(this._data[_]&1<<A)!==0}substring(w,_){if(w>this._length)throw new Error(`Offset(${w}) > ${this._length} is out of bounds`);if(w<0)throw new Error(`Offset(${w}) < 0 is out of bounds`);if(_===0)return b.EMPTY;if(w+_>this._length)throw new Error(`Offset ${w} + Length ${_} > ${this._length} is out of bounds`);return new b(this._data,this._offset+w,_)}subbuffer(w,_){if(w>this._length)throw new Error(`Offset ${w} is out of bounds`);if(w<0)throw new Error(`Offset ${w} is out of bounds`);if(w+_>this._length)throw new Error(`Offset + Lenght = ${w+_} is out of bounds`);if(_%8!==0||(this._offset+w)%8!==0)return null;let A=this._offset+w>>3,S=A+(_>>3);return this._data.subarray(A,S)}equals(w){if(this._length!==w._length)return!1;for(let _=0;_<this._length;_++)if(this.at(_)!==w.at(_))return!1;return!0}toString(){const w=(0,I.bitsToPaddedBuffer)(this);if(this._length%4===0){const _=w.subarray(0,Math.ceil(this._length/8)).toString("hex").toUpperCase();return this._length%8===0?_:_.substring(0,_.length-1)}else{const _=w.toString("hex").toUpperCase();return this._length%8<=4?_.substring(0,_.length-1)+"_":_+"_"}}}p.BitString=b,C=m.default,b.EMPTY=new b(v.alloc(0),0,0)},3881:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.Builder=p.beginCell=void 0;const v=x(96254),T=x(66608),C=x(18205);function I(){return new m}p.beginCell=I;class m{constructor(){this._bits=new v.BitBuilder,this._refs=[]}get bits(){return this._bits.length}get refs(){return this._refs.length}get availableBits(){return 1023-this.bits}get availableRefs(){return 4-this.refs}storeBit(g){return this._bits.writeBit(g),this}storeBits(g){return this._bits.writeBits(g),this}storeBuffer(g,w){if(w!=null&&g.length!==w)throw Error(`Buffer length ${g.length} is not equal to ${w}`);return this._bits.writeBuffer(g),this}storeMaybeBuffer(g,w){return g!==null?(this.storeBit(1),this.storeBuffer(g,w)):this.storeBit(0),this}storeUint(g,w){return this._bits.writeUint(g,w),this}storeMaybeUint(g,w){return g!=null?(this.storeBit(1),this.storeUint(g,w)):this.storeBit(0),this}storeInt(g,w){return this._bits.writeInt(g,w),this}storeMaybeInt(g,w){return g!=null?(this.storeBit(1),this.storeInt(g,w)):this.storeBit(0),this}storeVarUint(g,w){return this._bits.writeVarUint(g,w),this}storeMaybeVarUint(g,w){return g!=null?(this.storeBit(1),this.storeVarUint(g,w)):this.storeBit(0),this}storeVarInt(g,w){return this._bits.writeVarInt(g,w),this}storeMaybeVarInt(g,w){return g!=null?(this.storeBit(1),this.storeVarInt(g,w)):this.storeBit(0),this}storeCoins(g){return this._bits.writeCoins(g),this}storeMaybeCoins(g){return g!=null?(this.storeBit(1),this.storeCoins(g)):this.storeBit(0),this}storeAddress(g){return this._bits.writeAddress(g),this}storeRef(g){if(this._refs.length>=4)throw new Error("Too many references");if(g instanceof T.Cell)this._refs.push(g);else if(g instanceof m)this._refs.push(g.endCell());else throw new Error("Invalid argument");return this}storeMaybeRef(g){return g?(this.storeBit(1),this.storeRef(g)):this.storeBit(0),this}storeSlice(g){let w=g.clone();for(w.remainingBits>0&&this.storeBits(w.loadBits(w.remainingBits));w.remainingRefs>0;)this.storeRef(w.loadRef());return this}storeMaybeSlice(g){return g?(this.storeBit(1),this.storeSlice(g)):this.storeBit(0),this}storeBuilder(g){return this.storeSlice(g.endCell().beginParse())}storeMaybeBuilder(g){return g?(this.storeBit(1),this.storeBuilder(g)):this.storeBit(0),this}storeWritable(g){return typeof g=="object"?g.writeTo(this):g(this),this}storeMaybeWritable(g){return g?(this.storeBit(1),this.storeWritable(g)):this.storeBit(0),this}store(g){return this.storeWritable(g),this}storeStringTail(g){return(0,C.writeString)(g,this),this}storeMaybeStringTail(g){return g!=null?(this.storeBit(1),(0,C.writeString)(g,this)):this.storeBit(0),this}storeStringRefTail(g){return this.storeRef(I().storeStringTail(g)),this}storeMaybeStringRefTail(g){return g!=null?(this.storeBit(1),this.storeStringRefTail(g)):this.storeBit(0),this}storeDict(g,w,_){return g?g.store(this,w,_):this.storeBit(0),this}storeDictDirect(g,w,_){return g.storeDirect(this,w,_),this}endCell(g){return new T.Cell({bits:this._bits.build(),refs:this._refs,exotic:g?.exotic})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}}p.Builder=m},66608:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(O){return O&&O.__esModule?O:{default:O}},C;Object.defineProperty(p,"__esModule",{value:!0}),p.Cell=void 0;const I=T(x(2242)),m=x(8496),b=x(83208),g=x(50276),w=x(76821),_=x(96588),A=x(49751),S=x(6302),k=x(3881);class B{static fromBoc(L){return(0,A.deserializeBoc)(L)}static fromBase64(L){let D=B.fromBoc(v.from(L,"base64"));if(D.length!==1)throw new Error("Deserialized more than one cell");return D[0]}constructor(L){this._hashes=[],this._depths=[],this.beginParse=(ie=!1)=>{if(this.isExotic&&!ie)throw new Error("Exotic cells cannot be parsed");return new g.Slice(new S.BitReader(this.bits),this.refs)},this.hash=(ie=3)=>this._hashes[Math.min(this._hashes.length-1,ie)],this.depth=(ie=3)=>this._depths[Math.min(this._depths.length-1,ie)],this.level=()=>this.mask.level,this.equals=ie=>this.hash().equals(ie.hash()),this[C]=()=>this.toString();let D=m.BitString.EMPTY;L&&L.bits&&(D=L.bits);let W=[];L&&L.refs&&(W=[...L.refs]);let H,G,Z,Q=b.CellType.Ordinary;if(L&&L.exotic){let ie=(0,w.resolveExotic)(D,W),le=(0,_.wonderCalculator)(ie.type,D,W);Z=le.mask,G=le.depths,H=le.hashes,Q=ie.type}else{if(W.length>4)throw new Error("Invalid number of references");if(D.length>1023)throw new Error(`Bits overflow: ${D.length} > 1023`);let ie=(0,_.wonderCalculator)(b.CellType.Ordinary,D,W);Z=ie.mask,G=ie.depths,H=ie.hashes,Q=b.CellType.Ordinary}this.type=Q,this.bits=D,this.refs=W,this.mask=Z,this._depths=G,this._hashes=H,Object.freeze(this),Object.freeze(this.refs),Object.freeze(this.bits),Object.freeze(this.mask),Object.freeze(this._depths),Object.freeze(this._hashes)}get isExotic(){return this.type!==b.CellType.Ordinary}toBoc(L){let D=L&&L.idx!==null&&L.idx!==void 0?L.idx:!1,W=L&&L.crc32!==null&&L.crc32!==void 0?L.crc32:!0;return(0,A.serializeBoc)(this,{idx:D,crc32:W})}toString(L){let D=L||"",W="x";this.isExotic&&(this.type===b.CellType.MerkleProof?W="p":this.type===b.CellType.MerkleUpdate?W="u":this.type===b.CellType.PrunedBranch&&(W="p"));let H=D+(this.isExotic?W:"x")+"{"+this.bits.toString()+"}";for(let G in this.refs){const Z=this.refs[G];H+=`
|
||
`+Z.toString(D+" ")}return H}asSlice(){return this.beginParse()}asBuilder(){return(0,k.beginCell)().storeSlice(this.asSlice())}}p.Cell=B,C=I.default,B.EMPTY=new B},83208:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.CellType=void 0;var x;(function(v){v[v.Ordinary=-1]="Ordinary",v[v.PrunedBranch=1]="PrunedBranch",v[v.Library=2]="Library",v[v.MerkleProof=3]="MerkleProof",v[v.MerkleUpdate=4]="MerkleUpdate"})(x||(p.CellType=x={}))},50276:function(fe,p,x){"use strict";var v=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}},T;Object.defineProperty(p,"__esModule",{value:!0}),p.Slice=void 0;const C=v(x(2242)),I=x(10792),m=x(3881),b=x(18205);class g{constructor(_,A){this[T]=()=>this.toString(),this._reader=_.clone(),this._refs=[...A],this._refsOffset=0}get remainingBits(){return this._reader.remaining}get offsetBits(){return this._reader.offset}get remainingRefs(){return this._refs.length-this._refsOffset}get offsetRefs(){return this._refsOffset}skip(_){return this._reader.skip(_),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(_){return this._reader.loadBits(_)}preloadBits(_){return this._reader.preloadBits(_)}loadUint(_){return this._reader.loadUint(_)}loadUintBig(_){return this._reader.loadUintBig(_)}preloadUint(_){return this._reader.preloadUint(_)}preloadUintBig(_){return this._reader.preloadUintBig(_)}loadMaybeUint(_){return this.loadBit()?this.loadUint(_):null}loadMaybeUintBig(_){return this.loadBit()?this.loadUintBig(_):null}loadInt(_){return this._reader.loadInt(_)}loadIntBig(_){return this._reader.loadIntBig(_)}preloadInt(_){return this._reader.preloadInt(_)}preloadIntBig(_){return this._reader.preloadIntBig(_)}loadMaybeInt(_){return this.loadBit()?this.loadInt(_):null}loadMaybeIntBig(_){return this.loadBit()?this.loadIntBig(_):null}loadVarUint(_){return this._reader.loadVarUint(_)}loadVarUintBig(_){return this._reader.loadVarUintBig(_)}preloadVarUint(_){return this._reader.preloadVarUint(_)}preloadVarUintBig(_){return this._reader.preloadVarUintBig(_)}loadVarInt(_){return this._reader.loadVarInt(_)}loadVarIntBig(_){return this._reader.loadVarIntBig(_)}preloadVarInt(_){return this._reader.preloadVarInt(_)}preloadVarIntBig(_){return this._reader.preloadVarIntBig(_)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset++]}preloadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(_){return this._reader.loadBuffer(_)}preloadBuffer(_){return this._reader.preloadBuffer(_)}loadStringTail(){return(0,b.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,b.readString)(this):null}loadStringRefTail(){return(0,b.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){const _=this.loadMaybeRef();return _?(0,b.readString)(_.beginParse()):null}loadDict(_,A){return I.Dictionary.load(_,A,this)}loadDictDirect(_,A){return I.Dictionary.loadDirect(_,A,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,m.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,m.beginCell)().storeSlice(this)}clone(_=!1){if(_){let A=this._reader.clone();return A.reset(),new g(A,this._refs)}else{let A=new g(this._reader,this._refs);return A._refsOffset=this._refsOffset,A}}toString(){return this.asCell().toString()}}p.Slice=g,T=C.default},78549:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.LevelMask=void 0;class x{constructor(C=0){this._mask=0,this._mask=C,this._hashIndex=v(this._mask),this._hashCount=this._hashIndex+1}get value(){return this._mask}get level(){return 32-Math.clz32(this._mask)}get hashIndex(){return this._hashIndex}get hashCount(){return this._hashCount}apply(C){return new x(this._mask&(1<<C)-1)}isSignificant(C){return C===0||(this._mask>>C-1)%2!==0}}p.LevelMask=x;function v(T){return T=T-(T>>1&1431655765),T=(T&858993459)+(T>>2&858993459),(T+(T>>4)&252645135)*16843009>>24}},60446:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.getRepr=p.getBitsDescriptor=p.getRefsDescriptor=void 0;const T=x(83208),C=x(40676);function I(g,w,_){return g.length+(_!==T.CellType.Ordinary?1:0)*8+w*32}p.getRefsDescriptor=I;function m(g){let w=g.length;return Math.ceil(w/8)+Math.floor(w/8)}p.getBitsDescriptor=m;function b(g,w,_,A,S,k){const B=Math.ceil(w.length/8),O=v.alloc(2+B+34*_.length);let L=0;O[L++]=I(_,S,k),O[L++]=m(g),(0,C.bitsToPaddedBuffer)(w).copy(O,L),L+=B;for(const D of _){let W;k==T.CellType.MerkleProof||k==T.CellType.MerkleUpdate?W=D.depth(A+1):W=D.depth(A),O[L++]=Math.floor(W/256),O[L++]=W%256}for(const D of _){let W;k==T.CellType.MerkleProof||k==T.CellType.MerkleUpdate?W=D.hash(A+1):W=D.hash(A),W.copy(O,L),L+=32}return O}p.getRepr=b},80154:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.exoticLibrary=void 0;const v=x(6302);function T(C,I){const m=new v.BitReader(C);if(C.length!==264)throw new Error(`Library cell must have exactly (8 + 256) bits, got "${C.length}"`);let g=m.loadUint(8);if(g!==2)throw new Error(`Library cell must have type 2, got "${g}"`);return{}}p.exoticLibrary=T},80057:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.convertToMerkleProof=p.exoticMerkleProof=void 0;const v=x(6302),T=x(3881);function C(m,b){const g=new v.BitReader(m);if(m.length!==280)throw new Error(`Merkle Proof cell must have exactly (8 + 256 + 16) bits, got "${m.length}"`);if(b.length!==1)throw new Error(`Merkle Proof cell must have exactly 1 ref, got "${b.length}"`);let _=g.loadUint(8);if(_!==3)throw new Error(`Merkle Proof cell must have type 3, got "${_}"`);const A=g.loadBuffer(32),S=g.loadUint(16),k=b[0].hash(0),B=b[0].depth(0);if(S!==B)throw new Error(`Merkle Proof cell ref depth must be exactly "${S}", got "${B}"`);if(!A.equals(k))throw new Error(`Merkle Proof cell ref hash must be exactly "${A.toString("hex")}", got "${k.toString("hex")}"`);return{proofDepth:S,proofHash:A}}p.exoticMerkleProof=C;function I(m){return(0,T.beginCell)().storeUint(3,8).storeBuffer(m.hash(0)).storeUint(m.depth(0),16).storeRef(m).endCell({exotic:!0})}p.convertToMerkleProof=I},17930:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.exoticMerkleUpdate=void 0;const v=x(6302);function T(C,I){const m=new v.BitReader(C),b=8+2*272;if(C.length!==b)throw new Error(`Merkle Update cell must have exactly (8 + (2 * (256 + 16))) bits, got "${C.length}"`);if(I.length!==2)throw new Error(`Merkle Update cell must have exactly 2 refs, got "${I.length}"`);let g=m.loadUint(8);if(g!==4)throw new Error(`Merkle Update cell type must be exactly 4, got "${g}"`);const w=m.loadBuffer(32),_=m.loadBuffer(32),A=m.loadUint(16),S=m.loadUint(16);if(A!==I[0].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${A}", got "${I[0].depth(0)}"`);if(!w.equals(I[0].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${w.toString("hex")}", got "${I[0].hash(0).toString("hex")}"`);if(S!==I[1].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${S}", got "${I[1].depth(0)}"`);if(!_.equals(I[1].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${_.toString("hex")}", got "${I[1].hash(0).toString("hex")}"`);return{proofDepth1:A,proofDepth2:S,proofHash1:w,proofHash2:_}}p.exoticMerkleUpdate=T},82845:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.exoticPruned=void 0;const v=x(6302),T=x(78549);function C(I,m){let b=new v.BitReader(I),g=b.loadUint(8);if(g!==1)throw new Error(`Pruned branch cell must have type 1, got "${g}"`);if(m.length!==0)throw new Error(`Pruned Branch cell can't has refs, got "${m.length}"`);let w;if(I.length===280)w=new T.LevelMask(1);else{if(w=new T.LevelMask(b.loadUint(8)),w.level<1||w.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${w.level}/${w.value}"`);const k=16+w.apply(w.level-1).hashCount*272;if(I.length!==k)throw new Error(`Pruned branch cell must have exactly ${k} bits, got "${I.length}"`)}let _=[],A=[],S=[];for(let k=0;k<w.level;k++)A.push(b.loadBuffer(32));for(let k=0;k<w.level;k++)S.push(b.loadUint(16));for(let k=0;k<w.level;k++)_.push({depth:S[k],hash:A[k]});return{mask:w.value,pruned:_}}p.exoticPruned=C},76821:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.resolveExotic=void 0;const v=x(6302),T=x(83208),C=x(80154),I=x(80057),m=x(17930),b=x(82845),g=x(78549);function w(B,O){let L=(0,b.exoticPruned)(B,O),D=[],W=[],H=new g.LevelMask(L.mask);for(let G=0;G<L.pruned.length;G++)D.push(L.pruned[G].depth),W.push(L.pruned[G].hash);return{type:T.CellType.PrunedBranch,depths:D,hashes:W,mask:H}}function _(B,O){let L=(0,C.exoticLibrary)(B,O),D=[],W=[],H=new g.LevelMask;return{type:T.CellType.Library,depths:D,hashes:W,mask:H}}function A(B,O){let L=(0,I.exoticMerkleProof)(B,O),D=[],W=[],H=new g.LevelMask(O[0].level()>>1);return{type:T.CellType.MerkleProof,depths:D,hashes:W,mask:H}}function S(B,O){let L=(0,m.exoticMerkleUpdate)(B,O),D=[],W=[],H=new g.LevelMask((O[0].level()|O[1].level())>>1);return{type:T.CellType.MerkleUpdate,depths:D,hashes:W,mask:H}}function k(B,O){let D=new v.BitReader(B).preloadUint(8);if(D===1)return w(B,O);if(D===2)return _(B,O);if(D===3)return A(B,O);if(D===4)return S(B,O);throw Error("Invalid exotic cell type: "+D)}p.resolveExotic=k},49751:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.serializeBoc=p.deserializeBoc=p.parseBoc=void 0;const v=x(6302),T=x(8496),C=x(66608),I=x(92430),m=x(46689),b=x(96254),g=x(60446),w=x(40676),_=x(30867);function A(H){return S(H&7)}function S(H){let G=0;for(let Z=0;Z<3;Z++)G+=H&1,H=H>>1;return G+1}function k(H,G){const Z=H.loadUint(8),Q=Z%8,ie=!!(Z&8),le=H.loadUint(8),be=Math.ceil(le/2),we=!!(le%2),Ae=Z>>5,re=(Z&16)!=0,z=re?A(Ae)*32:0,V=re?A(Ae)*2:0;H.skip(z*8),H.skip(V*8);let U=T.BitString.EMPTY;be>0&&(we?U=H.loadPaddedBits(be*8):U=H.loadBits(be*8));let j=[];for(let $=0;$<Q;$++)j.push(H.loadUint(G*8));return{bits:U,refs:j,exotic:ie}}function B(H,G){return 2+Math.ceil(H.bits.length/8)+H.refs.length*G}function O(H){let G=new v.BitReader(new T.BitString(H,0,H.length*8)),Z=G.loadUint(32);if(Z===1761568243){let Q=G.loadUint(8),ie=G.loadUint(8),le=G.loadUint(Q*8),be=G.loadUint(Q*8),we=G.loadUint(Q*8),Ae=G.loadUint(ie*8),re=G.loadBuffer(le*ie),N=G.loadBuffer(Ae);return{size:Q,offBytes:ie,cells:le,roots:be,absent:we,totalCellSize:Ae,index:re,cellData:N,root:[0]}}else if(Z===2898503464){let Q=G.loadUint(8),ie=G.loadUint(8),le=G.loadUint(Q*8),be=G.loadUint(Q*8),we=G.loadUint(Q*8),Ae=G.loadUint(ie*8),re=G.loadBuffer(le*ie),N=G.loadBuffer(Ae),z=G.loadBuffer(4);if(!(0,_.crc32c)(H.subarray(0,H.length-4)).equals(z))throw Error("Invalid CRC32C");return{size:Q,offBytes:ie,cells:le,roots:be,absent:we,totalCellSize:Ae,index:re,cellData:N,root:[0]}}else if(Z===3052313714){let Q=G.loadUint(1),ie=G.loadUint(1),le=G.loadUint(1),be=G.loadUint(2),we=G.loadUint(3),Ae=G.loadUint(8),re=G.loadUint(we*8),N=G.loadUint(we*8),z=G.loadUint(we*8),V=G.loadUint(Ae*8),U=[];for(let ee=0;ee<N;ee++)U.push(G.loadUint(we*8));let j=null;Q&&(j=G.loadBuffer(re*Ae));let $=G.loadBuffer(V);if(ie){let ee=G.loadBuffer(4);if(!(0,_.crc32c)(H.subarray(0,H.length-4)).equals(ee))throw Error("Invalid CRC32C")}return{size:we,offBytes:Ae,cells:re,roots:N,absent:z,totalCellSize:V,index:j,cellData:$,root:U}}else throw Error("Invalid magic")}p.parseBoc=O;function L(H){let G=O(H),Z=new v.BitReader(new T.BitString(G.cellData,0,G.cellData.length*8)),Q=[];for(let le=0;le<G.cells;le++){let be=k(Z,G.size);Q.push({...be,result:null})}for(let le=Q.length-1;le>=0;le--){if(Q[le].result)throw Error("Impossible");let be=[];for(let we of Q[le].refs){if(!Q[we].result)throw Error("Invalid BOC file");be.push(Q[we].result)}Q[le].result=new C.Cell({bits:Q[le].bits,refs:be,exotic:Q[le].exotic})}let ie=[];for(let le=0;le<G.root.length;le++)ie.push(Q[G.root[le]].result);return ie}p.deserializeBoc=L;function D(H,G,Z,Q){let ie=(0,g.getRefsDescriptor)(H.refs,H.mask.value,H.type),le=(0,g.getBitsDescriptor)(H.bits);Q.writeUint(ie,8),Q.writeUint(le,8),Q.writeBuffer((0,w.bitsToPaddedBuffer)(H.bits));for(let be of G)Q.writeUint(be,Z*8)}function W(H,G){let Z=(0,I.topologicalSort)(H),Q=Z.length,ie=G.idx,le=G.crc32,be=!1,we=0,Ae=Math.max(Math.ceil((0,m.bitsForNumber)(Q,"uint")/8),1),re=0,N=[];for(let $ of Z){let ee=B($.cell,Ae);re+=ee,N.push(re)}let z=Math.max(Math.ceil((0,m.bitsForNumber)(re,"uint")/8),1),V=(6+3*Ae+z+1*Ae+(ie?Q*z:0)+re+(le?4:0))*8,U=new b.BitBuilder(V);if(U.writeUint(3052313714,32),U.writeBit(ie),U.writeBit(le),U.writeBit(be),U.writeUint(we,2),U.writeUint(Ae,3),U.writeUint(z,8),U.writeUint(Q,Ae*8),U.writeUint(1,Ae*8),U.writeUint(0,Ae*8),U.writeUint(re,z*8),U.writeUint(0,Ae*8),ie)for(let $=0;$<Q;$++)U.writeUint(N[$],z*8);for(let $=0;$<Q;$++)D(Z[$].cell,Z[$].refs,Ae,U);if(le){let $=(0,_.crc32c)(U.buffer());U.writeBuffer($)}let j=U.buffer();if(j.length!==V/8)throw Error("Internal error");return j}p.serializeBoc=W},92430:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.topologicalSort=void 0;function x(v){let T=[v],C=new Map,I=new Set,m=[];for(;T.length>0;){const A=[...T];T=[];for(let S of A){const k=S.hash().toString("hex");if(!C.has(k)){I.add(k),C.set(k,{cell:S,refs:S.refs.map(B=>B.hash().toString("hex"))});for(let B of S.refs)T.push(B)}}}let b=new Set;function g(A){if(!I.has(A))return;if(b.has(A))throw Error("Not a DAG");b.add(A);let S=C.get(A).refs;for(let k=S.length-1;k>=0;k--)g(S[k]);m.push(A),b.delete(A),I.delete(A)}for(;I.size>0;){const A=Array.from(I)[0];g(A)}let w=new Map;for(let A=0;A<m.length;A++)w.set(m[m.length-A-1],A);let _=[];for(let A=m.length-1;A>=0;A--){let S=m[A];const k=C.get(S);_.push({cell:k.cell,refs:k.refs.map(B=>w.get(B))})}return _}p.topologicalSort=x},96588:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.wonderCalculator=void 0;const v=x(8496),T=x(83208),C=x(78549),I=x(82845),m=x(80057),b=x(60446),g=x(88473),w=x(17930),_=x(80154);function A(S,k,B){let O,L=null;if(S===T.CellType.Ordinary){let le=0;for(let be of B)le=le|be.mask.value;O=new C.LevelMask(le)}else if(S===T.CellType.PrunedBranch)L=(0,I.exoticPruned)(k,B),O=new C.LevelMask(L.mask);else if(S===T.CellType.MerkleProof){let le=(0,m.exoticMerkleProof)(k,B);O=new C.LevelMask(B[0].mask.value>>1)}else if(S===T.CellType.MerkleUpdate){let le=(0,w.exoticMerkleUpdate)(k,B);O=new C.LevelMask((B[0].mask.value|B[1].mask.value)>>1)}else if(S===T.CellType.Library){let le=(0,_.exoticLibrary)(k,B);O=new C.LevelMask}else throw new Error("Unsupported exotic type");let D=[],W=[],H=S===T.CellType.PrunedBranch?1:O.hashCount,Z=O.hashCount-H;for(let le=0,be=0;le<=O.level;le++){if(!O.isSignificant(le))continue;if(be<Z){be++;continue}let we;if(be===Z){if(!(le===0||S===T.CellType.PrunedBranch))throw Error("Invalid");we=k}else{if(!(le!==0&&S!==T.CellType.PrunedBranch))throw Error("Invalid: "+le+", "+S);we=new v.BitString(W[be-Z-1],0,256)}let Ae=0;for(let V of B){let U;S==T.CellType.MerkleProof||S==T.CellType.MerkleUpdate?U=V.depth(le+1):U=V.depth(le),Ae=Math.max(Ae,U)}B.length>0&&Ae++;let re=(0,b.getRepr)(k,we,B,le,O.apply(le).value,S),N=(0,g.sha256_sync)(re),z=be-Z;D[z]=Ae,W[z]=N,be++}let Q=[],ie=[];if(L)for(let le=0;le<4;le++){const{hashIndex:be}=O.apply(le),{hashIndex:we}=O;be!==we?(Q.push(L.pruned[be].hash),ie.push(L.pruned[be].depth)):(Q.push(W[0]),ie.push(D[0]))}else for(let le=0;le<4;le++)Q.push(W[O.apply(le).hashIndex]),ie.push(D[O.apply(le).hashIndex]);return{mask:O,hashes:Q,depths:ie}}p.wonderCalculator=A},40676:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.paddedBufferToBits=p.bitsToPaddedBuffer=void 0;const v=x(96254),T=x(8496);function C(m){let b=new v.BitBuilder(Math.ceil(m.length/8)*8);b.writeBits(m);let g=Math.ceil(m.length/8)*8-m.length;for(let w=0;w<g;w++)w===0?b.writeBit(1):b.writeBit(0);return b.buffer()}p.bitsToPaddedBuffer=C;function I(m){let b=0;for(let g=m.length-1;g>=0;g--)if(m[g]!==0){const w=m[g];let _=w&-w;_&1||(_=Math.log2(_)+1),g>0&&(b=g<<3),b+=8-_;break}return new T.BitString(m,0,b)}p.paddedBufferToBits=I},18205:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.writeString=p.stringToCell=p.readString=void 0;const T=x(3881);function C(w){if(w.remainingBits%8!==0)throw new Error(`Invalid string length: ${w.remainingBits}`);if(w.remainingRefs!==0&&w.remainingRefs!==1)throw new Error(`invalid number of refs: ${w.remainingRefs}`);let _;return w.remainingBits===0?_=v.alloc(0):_=w.loadBuffer(w.remainingBits/8),w.remainingRefs===1&&(_=v.concat([_,C(w.loadRef().beginParse())])),_}function I(w){return C(w).toString()}p.readString=I;function m(w,_){if(w.length>0){let A=Math.floor(_.availableBits/8);if(w.length>A){let S=w.subarray(0,A),k=w.subarray(A);_=_.storeBuffer(S);let B=(0,T.beginCell)();m(k,B),_=_.storeRef(B.endCell())}else _=_.storeBuffer(w)}}function b(w){let _=(0,T.beginCell)();return m(v.from(w),_),_.endCell()}p.stringToCell=b;function g(w,_){m(v.from(w),_)}p.writeString=g},12131:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.ComputeError=void 0;class x extends Error{constructor(T,C,I){super(T),this.exitCode=C,this.debugLogs=I&&I.debugLogs?I.debugLogs:null,this.logs=I&&I.logs?I.logs:null,Object.setPrototypeOf(this,x.prototype)}}p.ComputeError=x},44244:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.openContract=void 0;const v=x(14526),T=x(66608);function C(I,m){let b,g=null;if(!v.Address.isAddress(I.address))throw Error("Invalid address");if(b=I.address,I.init){if(!(I.init.code instanceof T.Cell))throw Error("Invalid init.code");if(!(I.init.data instanceof T.Cell))throw Error("Invalid init.data");g=I.init}let w=m({address:b,init:g});return new Proxy(I,{get(_,A){const S=_[A];return typeof A=="string"&&(A.startsWith("get")||A.startsWith("send")||A.startsWith("is"))&&typeof S=="function"?(...k)=>S.apply(_,[w,...k]):S}})}p.openContract=C},58851:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.safeSignVerify=p.safeSign=void 0;const T=x(88473),C=8,I=64;function m(w,_){let A=v.from(_);if(A.length>I)throw Error("Seed can be longer than 64 bytes");if(A.length<C)throw Error("Seed must be at least 8 bytes");return(0,T.sha256_sync)(v.concat([v.from([255,255]),A,w.hash()]))}function b(w,_,A="ton-safe-sign-magic"){return(0,T.sign)(m(w,A),_)}p.safeSign=b;function g(w,_,A,S="ton-safe-sign-magic"){return(0,T.signVerify)(m(w,S),_,A)}p.safeSignVerify=g},10792:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.Dictionary=void 0;const T=x(14526),C=x(3881),I=x(66608),m=x(8496),b=x(75927),g=x(4292),w=x(50197),_=x(35812),A=x(51028);class S{static empty(j,$){return j&&$?new S(new Map,j,$):new S(new Map,null,null)}static load(j,$,ee){let J;if(ee instanceof I.Cell){if(ee.isExotic)return S.empty(j,$);J=ee.beginParse()}else J=ee;let F=J.loadMaybeRef();return F&&!F.isExotic?S.loadDirect(j,$,F.beginParse()):S.empty(j,$)}static loadDirect(j,$,ee){if(!ee)return S.empty(j,$);let J;ee instanceof I.Cell?J=ee.beginParse():J=ee;let F=(0,w.parseDict)(J,j.bits,$.parse),X=new Map;for(let[de,Y]of F)X.set((0,A.serializeInternalKey)(j.parse(de)),Y);return new S(X,j,$)}constructor(j,$,ee){this._key=$,this._value=ee,this._map=j}get size(){return this._map.size}get(j){return this._map.get((0,A.serializeInternalKey)(j))}has(j){return this._map.has((0,A.serializeInternalKey)(j))}set(j,$){return this._map.set((0,A.serializeInternalKey)(j),$),this}delete(j){const $=(0,A.serializeInternalKey)(j);return this._map.delete($)}clear(){this._map.clear()}*[Symbol.iterator](){for(const[j,$]of this._map)yield[(0,A.deserializeInternalKey)(j),$]}keys(){return Array.from(this._map.keys()).map(j=>(0,A.deserializeInternalKey)(j))}values(){return Array.from(this._map.values())}store(j,$,ee){if(this._map.size===0)j.storeBit(0);else{let J=this._key;$!=null&&(J=$);let F=this._value;if(ee!=null&&(F=ee),!J)throw Error("Key serializer is not defined");if(!F)throw Error("Value serializer is not defined");let X=new Map;for(const[Y,ce]of this._map)X.set(J.serialize((0,A.deserializeInternalKey)(Y)),ce);j.storeBit(1);let de=(0,C.beginCell)();(0,_.serializeDict)(X,J.bits,F.serialize,de),j.storeRef(de.endCell())}}storeDirect(j,$,ee){if(this._map.size===0)throw Error("Cannot store empty dictionary directly");let J=this._key;$!=null&&(J=$);let F=this._value;if(ee!=null&&(F=ee),!J)throw Error("Key serializer is not defined");if(!F)throw Error("Value serializer is not defined");let X=new Map;for(const[de,Y]of this._map)X.set(J.serialize((0,A.deserializeInternalKey)(de)),Y);(0,_.serializeDict)(X,J.bits,F.serialize,j)}generateMerkleProof(j){return(0,b.generateMerkleProof)(this,j,this._key)}generateMerkleProofDirect(j){return(0,b.generateMerkleProofDirect)(this,j,this._key)}generateMerkleUpdate(j,$){return(0,g.generateMerkleUpdate)(this,j,this._key,$)}}p.Dictionary=S,S.Keys={Address:()=>k(),BigInt:U=>B(U),Int:U=>O(U),BigUint:U=>L(U),Uint:U=>D(U),Buffer:U=>W(U),BitString:U=>H(U)},S.Values={BigInt:U=>Z(U),Int:U=>G(U),BigVarInt:U=>Q(U),BigUint:U=>be(U),Uint:U=>le(U),BigVarUint:U=>ie(U),Bool:()=>we(),Address:()=>Ae(),Cell:()=>re(),Buffer:U=>z(U),BitString:U=>V(U),Dictionary:(U,j)=>N(U,j)};function k(){return{bits:267,serialize:U=>{if(!T.Address.isAddress(U))throw Error("Key is not an address");return(0,C.beginCell)().storeAddress(U).endCell().beginParse().preloadUintBig(267)},parse:U=>(0,C.beginCell)().storeUint(U,267).endCell().beginParse().loadAddress()}}function B(U){return{bits:U,serialize:j=>{if(typeof j!="bigint")throw Error("Key is not a bigint");return(0,C.beginCell)().storeInt(j,U).endCell().beginParse().loadUintBig(U)},parse:j=>(0,C.beginCell)().storeUint(j,U).endCell().beginParse().loadIntBig(U)}}function O(U){return{bits:U,serialize:j=>{if(typeof j!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(j))throw Error("Key is not a safe integer: "+j);return(0,C.beginCell)().storeInt(j,U).endCell().beginParse().loadUintBig(U)},parse:j=>(0,C.beginCell)().storeUint(j,U).endCell().beginParse().loadInt(U)}}function L(U){return{bits:U,serialize:j=>{if(typeof j!="bigint")throw Error("Key is not a bigint");if(j<0)throw Error("Key is negative: "+j);return(0,C.beginCell)().storeUint(j,U).endCell().beginParse().loadUintBig(U)},parse:j=>(0,C.beginCell)().storeUint(j,U).endCell().beginParse().loadUintBig(U)}}function D(U){return{bits:U,serialize:j=>{if(typeof j!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(j))throw Error("Key is not a safe integer: "+j);if(j<0)throw Error("Key is negative: "+j);return(0,C.beginCell)().storeUint(j,U).endCell().beginParse().loadUintBig(U)},parse:j=>Number((0,C.beginCell)().storeUint(j,U).endCell().beginParse().loadUint(U))}}function W(U){return{bits:U*8,serialize:j=>{if(!v.isBuffer(j))throw Error("Key is not a buffer");return(0,C.beginCell)().storeBuffer(j).endCell().beginParse().loadUintBig(U*8)},parse:j=>(0,C.beginCell)().storeUint(j,U*8).endCell().beginParse().loadBuffer(U)}}function H(U){return{bits:U,serialize:j=>{if(!m.BitString.isBitString(j))throw Error("Key is not a BitString");return(0,C.beginCell)().storeBits(j).endCell().beginParse().loadUintBig(U)},parse:j=>(0,C.beginCell)().storeUint(j,U).endCell().beginParse().loadBits(U)}}function G(U){return{serialize:(j,$)=>{$.storeInt(j,U)},parse:j=>j.loadInt(U)}}function Z(U){return{serialize:(j,$)=>{$.storeInt(j,U)},parse:j=>j.loadIntBig(U)}}function Q(U){return{serialize:(j,$)=>{$.storeVarInt(j,U)},parse:j=>j.loadVarIntBig(U)}}function ie(U){return{serialize:(j,$)=>{$.storeVarUint(j,U)},parse:j=>j.loadVarUintBig(U)}}function le(U){return{serialize:(j,$)=>{$.storeUint(j,U)},parse:j=>j.loadUint(U)}}function be(U){return{serialize:(j,$)=>{$.storeUint(j,U)},parse:j=>j.loadUintBig(U)}}function we(){return{serialize:(U,j)=>{j.storeBit(U)},parse:U=>U.loadBit()}}function Ae(){return{serialize:(U,j)=>{j.storeAddress(U)},parse:U=>U.loadAddress()}}function re(){return{serialize:(U,j)=>{j.storeRef(U)},parse:U=>U.loadRef()}}function N(U,j){return{serialize:($,ee)=>{$.store(ee)},parse:$=>S.load(U,j,$)}}function z(U){return{serialize:(j,$)=>{if(j.length!==U)throw Error("Invalid buffer size");$.storeBuffer(j)},parse:j=>j.loadBuffer(U)}}function V(U){return{serialize:(j,$)=>{if(j.length!==U)throw Error("Invalid BitString size");$.storeBits(j)},parse:j=>j.loadBits(U)}}},75927:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.generateMerkleProof=p.generateMerkleProofDirect=void 0;const v=x(3881),T=x(41223),C=x(80057);function I(w){return(0,v.beginCell)().storeUint(1,8).storeUint(1,8).storeBuffer(w.hash(0)).storeUint(w.depth(0),16).endCell({exotic:!0})}function m(w,_,A,S){const k=_.asCell();if(S.length==0)return I(k);let B=_.loadBit()?1:0,O=0,L=w;if(B===0){O=(0,T.readUnaryLength)(_);for(let D=0;D<O;D++)L+=_.loadBit()?"1":"0"}else if((_.loadBit()?1:0)===0){O=_.loadUint(Math.ceil(Math.log2(A+1)));for(let W=0;W<O;W++)L+=_.loadBit()?"1":"0"}else{let W=_.loadBit()?"1":"0";O=_.loadUint(Math.ceil(Math.log2(A+1)));for(let H=0;H<O;H++)L+=W}if(A-O===0)return k;{let D=k.beginParse(),W=D.loadRef(),H=D.loadRef();if(!W.isExotic){const G=S.filter(Z=>L+"0"===Z.slice(0,L.length+1));W=m(L+"0",W.beginParse(),A-O-1,G)}if(!H.isExotic){const G=S.filter(Z=>L+"1"===Z.slice(0,L.length+1));H=m(L+"1",H.beginParse(),A-O-1,G)}return(0,v.beginCell)().storeSlice(D).storeRef(W).storeRef(H).endCell()}}function b(w,_,A){_.forEach(k=>{if(!w.has(k))throw new Error(`Trying to generate merkle proof for a missing key "${k}"`)});const S=(0,v.beginCell)().storeDictDirect(w).asSlice();return m("",S,A.bits,_.map(k=>A.serialize(k).toString(2).padStart(A.bits,"0")))}p.generateMerkleProofDirect=b;function g(w,_,A){return(0,C.convertToMerkleProof)(b(w,_,A))}p.generateMerkleProof=g},4292:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.generateMerkleUpdate=void 0;const v=x(3881),T=x(75927);function C(m,b){return(0,v.beginCell)().storeUint(4,8).storeBuffer(m.hash(0)).storeBuffer(b.hash(0)).storeUint(m.depth(0),16).storeUint(b.depth(0),16).storeRef(m).storeRef(b).endCell({exotic:!0})}function I(m,b,g,w){const _=(0,T.generateMerkleProof)(m,[b],g).refs[0];m.set(b,w);const A=(0,T.generateMerkleProof)(m,[b],g).refs[0];return C(_,A)}p.generateMerkleUpdate=I},50197:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.parseDict=void 0;function x(C){let I=0;for(;C.loadBit();)I++;return I}function v(C,I,m,b,g){let w=I.loadBit()?1:0,_=0,A=C;if(w===0){_=x(I);for(let S=0;S<_;S++)A+=I.loadBit()?"1":"0"}else if((I.loadBit()?1:0)===0){_=I.loadUint(Math.ceil(Math.log2(m+1)));for(let k=0;k<_;k++)A+=I.loadBit()?"1":"0"}else{let k=I.loadBit()?"1":"0";_=I.loadUint(Math.ceil(Math.log2(m+1)));for(let B=0;B<_;B++)A+=k}if(m-_===0)b.set(BigInt("0b"+A),g(I));else{let S=I.loadRef(),k=I.loadRef();S.isExotic||v(A+"0",S.beginParse(),m-_-1,b,g),k.isExotic||v(A+"1",k.beginParse(),m-_-1,b,g)}}function T(C,I,m){let b=new Map;return C&&v("",C,I,b,m),b}p.parseDict=T},35812:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.serializeDict=p.detectLabelType=p.writeLabelSame=p.writeLabelLong=p.writeLabelShort=p.buildTree=void 0;const v=x(3881),T=x(18168);function C(Q,ie){for(;Q.length<ie;)Q="0"+Q;return Q}function I(Q,ie){if(ie===0)return Q;{let le=new Map;for(let be of Q.keys()){let we=Q.get(be);le.set(be.slice(ie),we)}return le}}function m(Q,ie){if(Q.size===0)throw Error("Internal inconsistency");let le=new Map,be=new Map;for(let[we,Ae]of Q.entries())we[ie]==="0"?le.set(we,Ae):be.set(we,Ae);if(le.size===0)throw Error("Internal inconsistency. Left emtpy.");if(be.size===0)throw Error("Internal inconsistency. Right emtpy.");return{left:le,right:be}}function b(Q,ie){if(Q.size===0)throw Error("Internal inconsistency");if(Q.size===1)return{type:"leaf",value:Array.from(Q.values())[0]};let{left:le,right:be}=m(Q,ie);return{type:"fork",left:g(le,ie+1),right:g(be,ie+1)}}function g(Q,ie=0){if(Q.size===0)throw Error("Internal inconsistency");const le=(0,T.findCommonPrefix)(Array.from(Q.keys()),ie);return{label:le,node:b(Q,le.length+ie)}}function w(Q,ie){let le=new Map;for(let be of Array.from(Q.keys())){const we=C(be.toString(2),ie);le.set(we,Q.get(be))}return g(le)}p.buildTree=w;function _(Q,ie){ie.storeBit(0);for(let le=0;le<Q.length;le++)ie.storeBit(1);return ie.storeBit(0),Q.length>0&&ie.storeUint(BigInt("0b"+Q),Q.length),ie}p.writeLabelShort=_;function A(Q){return 1+Q.length+1+Q.length}function S(Q,ie,le){le.storeBit(1),le.storeBit(0);let be=Math.ceil(Math.log2(ie+1));return le.storeUint(Q.length,be),Q.length>0&&le.storeUint(BigInt("0b"+Q),Q.length),le}p.writeLabelLong=S;function k(Q,ie){return 2+Math.ceil(Math.log2(ie+1))+Q.length}function B(Q,ie,le,be){be.storeBit(1),be.storeBit(1),be.storeBit(Q);let we=Math.ceil(Math.log2(le+1));be.storeUint(ie,we)}p.writeLabelSame=B;function O(Q){return 3+Math.ceil(Math.log2(Q+1))}function L(Q){if(Q.length===0||Q.length===1)return!0;for(let ie=1;ie<Q.length;ie++)if(Q[ie]!==Q[0])return!1;return!0}function D(Q,ie){let le="short",be=A(Q),we=k(Q,ie);if(we<be&&(be=we,le="long"),L(Q)){let Ae=O(ie);Ae<be&&(be=Ae,le="same")}return le}p.detectLabelType=D;function W(Q,ie,le){let be=D(Q,ie);be==="short"?_(Q,le):be==="long"?S(Q,ie,le):be==="same"&&B(Q[0]==="1",Q.length,ie,le)}function H(Q,ie,le,be){if(Q.type==="leaf"&&le(Q.value,be),Q.type==="fork"){const we=(0,v.beginCell)(),Ae=(0,v.beginCell)();G(Q.left,ie-1,le,we),G(Q.right,ie-1,le,Ae),be.storeRef(we),be.storeRef(Ae)}}function G(Q,ie,le,be){W(Q.label,ie,be),H(Q.node,ie-Q.label.length,le,be)}function Z(Q,ie,le,be){const we=w(Q,ie);G(we,ie,le,be)}p.serializeDict=Z},18168:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.findCommonPrefix=void 0;function x(v,T=0){if(v.length===0)return"";let C=v[0].slice(T);for(let I=1;I<v.length;I++){const m=v[I];for(;m.indexOf(C,T)!==T;)if(C=C.substring(0,C.length-1),C==="")return C}return C}p.findCommonPrefix=x},51028:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.deserializeInternalKey=p.serializeInternalKey=void 0;const T=x(14526),C=x(8496),I=x(40676);function m(g){if(typeof g=="number"){if(!Number.isSafeInteger(g))throw Error("Invalid key type: not a safe integer: "+g);return"n:"+g.toString(10)}else{if(typeof g=="bigint")return"b:"+g.toString(10);if(T.Address.isAddress(g))return"a:"+g.toString();if(v.isBuffer(g))return"f:"+g.toString("hex");if(C.BitString.isBitString(g))return"B:"+g.toString();throw Error("Invalid key type")}}p.serializeInternalKey=m;function b(g){let w=g.slice(0,2),_=g.slice(2);if(w==="n:")return parseInt(_,10);if(w==="b:")return BigInt(_);if(w==="a:")return T.Address.parse(_);if(w==="f:")return v.from(_,"hex");if(w==="B:"){const A=_.slice(-1)=="_";if(A||_.length%2!=0){let k=A?_.length-1:_.length;const B=_.substr(0,k)+"0";return!A&&k&1?new C.BitString(v.from(B,"hex"),0,k<<2):(0,I.paddedBufferToBits)(v.from(B,"hex"))}else return new C.BitString(v.from(_,"hex"),0,_.length<<2)}throw Error("Invalid key type: "+w)}p.deserializeInternalKey=b},41223:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.readUnaryLength=void 0;function x(v){let T=0;for(;v.loadBit();)T++;return T}p.readUnaryLength=x},99345:function(fe,p,x){"use strict";var v=this&&this.__createBinding||(Object.create?function(U,j,$,ee){ee===void 0&&(ee=$);var J=Object.getOwnPropertyDescriptor(j,$);(!J||("get"in J?!j.__esModule:J.writable||J.configurable))&&(J={enumerable:!0,get:function(){return j[$]}}),Object.defineProperty(U,ee,J)}:function(U,j,$,ee){ee===void 0&&(ee=$),U[ee]=j[$]}),T=this&&this.__exportStar||function(U,j){for(var $ in U)$!=="default"&&!Object.prototype.hasOwnProperty.call(j,$)&&v(j,U,$)};Object.defineProperty(p,"__esModule",{value:!0}),p.safeSignVerify=p.safeSign=p.getMethodId=p.base32Encode=p.base32Decode=p.crc32c=p.crc16=p.fromNano=p.toNano=p.ComputeError=p.openContract=p.TupleBuilder=p.TupleReader=p.serializeTuple=p.parseTuple=p.generateMerkleUpdate=p.generateMerkleProofDirect=p.generateMerkleProof=p.exoticPruned=p.exoticMerkleUpdate=p.convertToMerkleProof=p.exoticMerkleProof=p.Dictionary=p.Cell=p.CellType=p.Slice=p.beginCell=p.Builder=p.BitBuilder=p.BitReader=p.BitString=p.contractAddress=p.ADNLAddress=p.ExternalAddress=p.address=p.Address=void 0;var C=x(14526);Object.defineProperty(p,"Address",{enumerable:!0,get:function(){return C.Address}}),Object.defineProperty(p,"address",{enumerable:!0,get:function(){return C.address}});var I=x(78483);Object.defineProperty(p,"ExternalAddress",{enumerable:!0,get:function(){return I.ExternalAddress}});var m=x(89351);Object.defineProperty(p,"ADNLAddress",{enumerable:!0,get:function(){return m.ADNLAddress}});var b=x(95220);Object.defineProperty(p,"contractAddress",{enumerable:!0,get:function(){return b.contractAddress}});var g=x(8496);Object.defineProperty(p,"BitString",{enumerable:!0,get:function(){return g.BitString}});var w=x(6302);Object.defineProperty(p,"BitReader",{enumerable:!0,get:function(){return w.BitReader}});var _=x(96254);Object.defineProperty(p,"BitBuilder",{enumerable:!0,get:function(){return _.BitBuilder}});var A=x(3881);Object.defineProperty(p,"Builder",{enumerable:!0,get:function(){return A.Builder}}),Object.defineProperty(p,"beginCell",{enumerable:!0,get:function(){return A.beginCell}});var S=x(50276);Object.defineProperty(p,"Slice",{enumerable:!0,get:function(){return S.Slice}});var k=x(83208);Object.defineProperty(p,"CellType",{enumerable:!0,get:function(){return k.CellType}});var B=x(66608);Object.defineProperty(p,"Cell",{enumerable:!0,get:function(){return B.Cell}});var O=x(10792);Object.defineProperty(p,"Dictionary",{enumerable:!0,get:function(){return O.Dictionary}});var L=x(80057);Object.defineProperty(p,"exoticMerkleProof",{enumerable:!0,get:function(){return L.exoticMerkleProof}}),Object.defineProperty(p,"convertToMerkleProof",{enumerable:!0,get:function(){return L.convertToMerkleProof}});var D=x(17930);Object.defineProperty(p,"exoticMerkleUpdate",{enumerable:!0,get:function(){return D.exoticMerkleUpdate}});var W=x(82845);Object.defineProperty(p,"exoticPruned",{enumerable:!0,get:function(){return W.exoticPruned}});var H=x(75927);Object.defineProperty(p,"generateMerkleProof",{enumerable:!0,get:function(){return H.generateMerkleProof}}),Object.defineProperty(p,"generateMerkleProofDirect",{enumerable:!0,get:function(){return H.generateMerkleProofDirect}});var G=x(4292);Object.defineProperty(p,"generateMerkleUpdate",{enumerable:!0,get:function(){return G.generateMerkleUpdate}});var Z=x(37030);Object.defineProperty(p,"parseTuple",{enumerable:!0,get:function(){return Z.parseTuple}}),Object.defineProperty(p,"serializeTuple",{enumerable:!0,get:function(){return Z.serializeTuple}});var Q=x(41565);Object.defineProperty(p,"TupleReader",{enumerable:!0,get:function(){return Q.TupleReader}});var ie=x(56907);Object.defineProperty(p,"TupleBuilder",{enumerable:!0,get:function(){return ie.TupleBuilder}}),T(x(39300),p);var le=x(44244);Object.defineProperty(p,"openContract",{enumerable:!0,get:function(){return le.openContract}});var be=x(12131);Object.defineProperty(p,"ComputeError",{enumerable:!0,get:function(){return be.ComputeError}});var we=x(52268);Object.defineProperty(p,"toNano",{enumerable:!0,get:function(){return we.toNano}}),Object.defineProperty(p,"fromNano",{enumerable:!0,get:function(){return we.fromNano}});var Ae=x(9922);Object.defineProperty(p,"crc16",{enumerable:!0,get:function(){return Ae.crc16}});var re=x(30867);Object.defineProperty(p,"crc32c",{enumerable:!0,get:function(){return re.crc32c}});var N=x(20711);Object.defineProperty(p,"base32Decode",{enumerable:!0,get:function(){return N.base32Decode}}),Object.defineProperty(p,"base32Encode",{enumerable:!0,get:function(){return N.base32Encode}});var z=x(42831);Object.defineProperty(p,"getMethodId",{enumerable:!0,get:function(){return z.getMethodId}});var V=x(58851);Object.defineProperty(p,"safeSign",{enumerable:!0,get:function(){return V.safeSign}}),Object.defineProperty(p,"safeSignVerify",{enumerable:!0,get:function(){return V.safeSignVerify}})},56907:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.TupleBuilder=void 0;const v=x(3881),T=x(66608),C=x(50276);class I{constructor(){this._tuple=[]}writeNumber(b){b==null?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:BigInt(b)})}writeBoolean(b){b==null?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:b?-1n:0n})}writeBuffer(b){b==null?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,v.beginCell)().storeBuffer(b).endCell()})}writeString(b){b==null?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,v.beginCell)().storeStringTail(b).endCell()})}writeCell(b){b==null?this._tuple.push({type:"null"}):b instanceof T.Cell?this._tuple.push({type:"cell",cell:b}):b instanceof C.Slice&&this._tuple.push({type:"cell",cell:b.asCell()})}writeSlice(b){b==null?this._tuple.push({type:"null"}):b instanceof T.Cell?this._tuple.push({type:"slice",cell:b}):b instanceof C.Slice&&this._tuple.push({type:"slice",cell:b.asCell()})}writeBuilder(b){b==null?this._tuple.push({type:"null"}):b instanceof T.Cell?this._tuple.push({type:"builder",cell:b}):b instanceof C.Slice&&this._tuple.push({type:"builder",cell:b.asCell()})}writeTuple(b){b==null?this._tuple.push({type:"null"}):this._tuple.push({type:"tuple",items:b})}writeAddress(b){b==null?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,v.beginCell)().storeAddress(b).endCell()})}build(){return[...this._tuple]}}p.TupleBuilder=I},41565:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.TupleReader=void 0;class x{constructor(T){this.items=[...T]}get remaining(){return this.items.length}peek(){if(this.items.length===0)throw Error("EOF");return this.items[0]}pop(){if(this.items.length===0)throw Error("EOF");let T=this.items[0];return this.items.splice(0,1),T}skip(T=1){for(let C=0;C<T;C++)this.pop();return this}readBigNumber(){let T=this.pop();if(T.type!=="int")throw Error("Not a number");return T.value}readBigNumberOpt(){let T=this.pop();if(T.type==="null")return null;if(T.type!=="int")throw Error("Not a number");return T.value}readNumber(){return Number(this.readBigNumber())}readNumberOpt(){let T=this.readBigNumberOpt();return T!==null?Number(T):null}readBoolean(){return this.readNumber()!==0}readBooleanOpt(){let T=this.readNumberOpt();return T!==null?T!==0:null}readAddress(){let T=this.readCell().beginParse().loadAddress();if(T!==null)return T;throw Error("Not an address")}readAddressOpt(){let T=this.readCellOpt();return T!==null?T.beginParse().loadMaybeAddress():null}readCell(){let T=this.pop();if(T.type!=="cell"&&T.type!=="slice"&&T.type!=="builder")throw Error("Not a cell: "+T.type);return T.cell}readCellOpt(){let T=this.pop();if(T.type==="null")return null;if(T.type!=="cell"&&T.type!=="slice"&&T.type!=="builder")throw Error("Not a cell");return T.cell}readTuple(){let T=this.pop();if(T.type!=="tuple")throw Error("Not a tuple");return new x(T.items)}readTupleOpt(){let T=this.pop();if(T.type==="null")return null;if(T.type!=="tuple")throw Error("Not a tuple");return new x(T.items)}static readLispList(T){const C=[];let I=T;for(;I!==null;){var m=I.pop();if(I.items.length===0||I.items[0].type!=="tuple"&&I.items[0].type!=="null")throw Error("Lisp list consists only from (any, tuple) elements and ends with null");I=I.readTupleOpt(),C.push(m)}return C}readLispListDirect(){return this.items.length===1&&this.items[0].type==="null"?[]:x.readLispList(this)}readLispList(){return x.readLispList(this.readTupleOpt())}readBuffer(){let T=this.readCell().beginParse();if(T.remainingRefs!==0||T.remainingBits%8!==0)throw Error("Not a buffer");return T.loadBuffer(T.remainingBits/8)}readBufferOpt(){if(this.peek().type==="null")return null;let C=this.readCell().beginParse();if(C.remainingRefs!==0||C.remainingBits%8!==0)throw Error("Not a buffer");return C.loadBuffer(C.remainingBits/8)}readString(){return this.readCell().beginParse().loadStringTail()}readStringOpt(){return this.peek().type==="null"?null:this.readCell().beginParse().loadStringTail()}}p.TupleReader=x},37030:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.parseTuple=p.serializeTuple=void 0;const v=x(3881),T=BigInt("-9223372036854775808"),C=BigInt("9223372036854775807");function I(_,A){if(_.type==="null")A.storeUint(0,8);else if(_.type==="int")_.value<=C&&_.value>=T?(A.storeUint(1,8),A.storeInt(_.value,64)):(A.storeUint(256,15),A.storeInt(_.value,257));else if(_.type==="nan")A.storeInt(767,16);else if(_.type==="cell")A.storeUint(3,8),A.storeRef(_.cell);else if(_.type==="slice")A.storeUint(4,8),A.storeUint(0,10),A.storeUint(_.cell.bits.length,10),A.storeUint(0,3),A.storeUint(_.cell.refs.length,3),A.storeRef(_.cell);else if(_.type==="builder")A.storeUint(5,8),A.storeRef(_.cell);else if(_.type==="tuple"){let S=null,k=null;for(let B=0;B<_.items.length;B++){let O=S;S=k,k=O,B>1&&(S=(0,v.beginCell)().storeRef(k).storeRef(S).endCell());let L=(0,v.beginCell)();I(_.items[B],L),k=L.endCell()}A.storeUint(7,8),A.storeUint(_.items.length,16),S&&A.storeRef(S),k&&A.storeRef(k)}else throw Error("Invalid value")}function m(_){let A=_.loadUint(8);if(A===0)return{type:"null"};if(A===1)return{type:"int",value:_.loadIntBig(64)};if(A===2)return _.loadUint(7)===0?{type:"int",value:_.loadIntBig(257)}:(_.loadBit(),{type:"nan"});if(A===3)return{type:"cell",cell:_.loadRef()};if(A===4){let S=_.loadUint(10),k=_.loadUint(10),B=_.loadUint(3),O=_.loadUint(3),L=_.loadRef().beginParse();L.skip(S);let D=L.loadBits(k-S),W=(0,v.beginCell)().storeBits(D);if(B<O){for(let H=0;H<B;H++)L.loadRef();for(let H=0;H<O-B;H++)W.storeRef(L.loadRef())}return{type:"slice",cell:W.endCell()}}else{if(A===5)return{type:"builder",cell:_.loadRef()};if(A===7){let S=_.loadUint(16),k=[];if(S>1){let B=_.loadRef().beginParse(),O=_.loadRef().beginParse();k.unshift(m(O));for(let L=0;L<S-2;L++){let D=B;B=D.loadRef().beginParse(),O=D.loadRef().beginParse(),k.unshift(m(O))}k.unshift(m(B))}else S===1&&k.push(m(_.loadRef().beginParse()));return{type:"tuple",items:k}}else throw Error("Unsupported stack item")}}function b(_,A){if(_.length>0){let S=(0,v.beginCell)();b(_.slice(0,_.length-1),S),A.storeRef(S.endCell()),I(_[_.length-1],A)}}function g(_){let A=(0,v.beginCell)();A.storeUint(_.length,24);let S=[..._];return b(S,A),A.endCell()}p.serializeTuple=g;function w(_){let A=[],S=_.beginParse(),k=S.loadUint(24);for(let B=0;B<k;B++){let O=S.loadRef();A.unshift(m(S)),S=O.beginParse()}return A}p.parseTuple=w},81568:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeAccount=p.loadAccount=void 0;const v=x(5759),T=x(31480);function C(m){return{addr:m.loadAddress(),storageStats:(0,T.loadStorageInfo)(m),storage:(0,v.loadAccountStorage)(m)}}p.loadAccount=C;function I(m){return b=>{b.storeAddress(m.addr),b.store((0,T.storeStorageInfo)(m.storageStats)),b.store((0,v.storeAccountStorage)(m.storage))}}p.storeAccount=I},47763:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeAccountState=p.loadAccountState=void 0;const v=x(78668);function T(I){return I.loadBit()?{type:"active",state:(0,v.loadStateInit)(I)}:I.loadBit()?{type:"frozen",stateHash:I.loadUintBig(256)}:{type:"uninit"}}p.loadAccountState=T;function C(I){return m=>{I.type==="active"?(m.storeBit(!0),m.store((0,v.storeStateInit)(I.state))):I.type==="frozen"?(m.storeBit(!1),m.storeBit(!0),m.storeUint(I.stateHash,256)):I.type==="uninit"&&(m.storeBit(!1),m.storeBit(!1))}}p.storeAccountState=C},70086:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeAccountStatus=p.loadAccountStatus=void 0;function x(T){const C=T.loadUint(2);if(C===0)return"uninitialized";if(C===1)return"frozen";if(C===2)return"active";if(C===3)return"non-existing";throw Error("Invalid data")}p.loadAccountStatus=x;function v(T){return C=>{if(T==="uninitialized")C.storeUint(0,2);else if(T==="frozen")C.storeUint(1,2);else if(T==="active")C.storeUint(2,2);else if(T==="non-existing")C.storeUint(3,2);else throw Error("Invalid data");return C}}p.storeAccountStatus=v},87878:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeAccountStatusChange=p.loadAccountStatusChange=void 0;function x(T){return T.loadBit()?T.loadBit()?"deleted":"frozen":"unchanged"}p.loadAccountStatusChange=x;function v(T){return C=>{if(T=="unchanged")C.storeBit(0);else if(T==="frozen")C.storeBit(1),C.storeBit(0);else if(T==="deleted")C.storeBit(1),C.storeBit(1);else throw Error("Invalid account status change")}}p.storeAccountStatusChange=v},5759:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeAccountStorage=p.loadAccountStorage=void 0;const v=x(47763),T=x(73484);function C(m){return{lastTransLt:m.loadUintBig(64),balance:(0,T.loadCurrencyCollection)(m),state:(0,v.loadAccountState)(m)}}p.loadAccountStorage=C;function I(m){return b=>{b.storeUint(m.lastTransLt,64),b.store((0,T.storeCurrencyCollection)(m.balance)),b.store((0,v.storeAccountState)(m.state))}}p.storeAccountStorage=I},18727:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeCommonMessageInfo=p.loadCommonMessageInfo=void 0;const v=x(73484);function T(I){if(!I.loadBit()){const _=I.loadBit(),A=I.loadBit(),S=I.loadBit(),k=I.loadAddress(),B=I.loadAddress(),O=(0,v.loadCurrencyCollection)(I),L=I.loadCoins(),D=I.loadCoins(),W=I.loadUintBig(64),H=I.loadUint(32);return{type:"internal",ihrDisabled:_,bounce:A,bounced:S,src:k,dest:B,value:O,ihrFee:L,forwardFee:D,createdLt:W,createdAt:H}}if(!I.loadBit()){const _=I.loadMaybeExternalAddress(),A=I.loadAddress(),S=I.loadCoins();return{type:"external-in",src:_,dest:A,importFee:S}}const m=I.loadAddress(),b=I.loadMaybeExternalAddress(),g=I.loadUintBig(64),w=I.loadUint(32);return{type:"external-out",src:m,dest:b,createdLt:g,createdAt:w}}p.loadCommonMessageInfo=T;function C(I){return m=>{if(I.type==="internal")m.storeBit(0),m.storeBit(I.ihrDisabled),m.storeBit(I.bounce),m.storeBit(I.bounced),m.storeAddress(I.src),m.storeAddress(I.dest),m.store((0,v.storeCurrencyCollection)(I.value)),m.storeCoins(I.ihrFee),m.storeCoins(I.forwardFee),m.storeUint(I.createdLt,64),m.storeUint(I.createdAt,32);else if(I.type==="external-in")m.storeBit(1),m.storeBit(0),m.storeAddress(I.src),m.storeAddress(I.dest),m.storeCoins(I.importFee);else if(I.type==="external-out")m.storeBit(1),m.storeBit(1),m.storeAddress(I.src),m.storeAddress(I.dest),m.storeUint(I.createdLt,64),m.storeUint(I.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}p.storeCommonMessageInfo=C},21972:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeCommonMessageInfoRelaxed=p.loadCommonMessageInfoRelaxed=void 0;const v=x(73484);function T(I){if(!I.loadBit()){const _=I.loadBit(),A=I.loadBit(),S=I.loadBit(),k=I.loadMaybeAddress(),B=I.loadAddress(),O=(0,v.loadCurrencyCollection)(I),L=I.loadCoins(),D=I.loadCoins(),W=I.loadUintBig(64),H=I.loadUint(32);return{type:"internal",ihrDisabled:_,bounce:A,bounced:S,src:k,dest:B,value:O,ihrFee:L,forwardFee:D,createdLt:W,createdAt:H}}if(!I.loadBit())throw Error("External In message is not possible for CommonMessageInfoRelaxed");const m=I.loadMaybeAddress(),b=I.loadMaybeExternalAddress(),g=I.loadUintBig(64),w=I.loadUint(32);return{type:"external-out",src:m,dest:b,createdLt:g,createdAt:w}}p.loadCommonMessageInfoRelaxed=T;function C(I){return m=>{if(I.type==="internal")m.storeBit(0),m.storeBit(I.ihrDisabled),m.storeBit(I.bounce),m.storeBit(I.bounced),m.storeAddress(I.src),m.storeAddress(I.dest),m.store((0,v.storeCurrencyCollection)(I.value)),m.storeCoins(I.ihrFee),m.storeCoins(I.forwardFee),m.storeUint(I.createdLt,64),m.storeUint(I.createdAt,32);else if(I.type==="external-out")m.storeBit(1),m.storeBit(1),m.storeAddress(I.src),m.storeAddress(I.dest),m.storeUint(I.createdLt,64),m.storeUint(I.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}p.storeCommonMessageInfoRelaxed=C},93689:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeComputeSkipReason=p.loadComputeSkipReason=void 0;function x(T){let C=T.loadUint(2);if(C===0)return"no-state";if(C===1)return"bad-state";if(C===2)return"no-gas";throw new Error(`Unknown ComputeSkipReason: ${C}`)}p.loadComputeSkipReason=x;function v(T){return C=>{if(T==="no-state")C.storeUint(0,2);else if(T==="bad-state")C.storeUint(1,2);else if(T==="no-gas")C.storeUint(2,2);else throw new Error(`Unknown ComputeSkipReason: ${T}`)}}p.storeComputeSkipReason=v},73484:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeCurrencyCollection=p.loadCurrencyCollection=void 0;const v=x(10792);function T(I){const m=I.loadCoins(),b=I.loadDict(v.Dictionary.Keys.Uint(32),v.Dictionary.Values.BigVarUint(5));return b.size===0?{coins:m}:{other:b,coins:m}}p.loadCurrencyCollection=T;function C(I){return m=>{m.storeCoins(I.coins),I.other?m.storeDict(I.other):m.storeBit(0)}}p.storeCurrencyCollection=C},5504:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeDepthBalanceInfo=p.loadDepthBalanceInfo=void 0;const v=x(73484);function T(I){return{splitDepth:I.loadUint(5),balance:(0,v.loadCurrencyCollection)(I)}}p.loadDepthBalanceInfo=T;function C(I){return m=>{m.storeUint(I.splitDepth,5),m.store((0,v.storeCurrencyCollection)(I.balance))}}p.storeDepthBalanceInfo=C},78238:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeHashUpdate=p.loadHashUpdate=void 0;function x(T){if(T.loadUint(8)!==114)throw Error("Invalid data");const C=T.loadBuffer(32),I=T.loadBuffer(32);return{oldHash:C,newHash:I}}p.loadHashUpdate=x;function v(T){return C=>{C.storeUint(114,8),C.storeBuffer(T.oldHash),C.storeBuffer(T.newHash)}}p.storeHashUpdate=v},27459:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeLibRef=p.loadLibRef=void 0;function x(T){return T.loadUint(1)===0?{type:"hash",libHash:T.loadBuffer(32)}:{type:"ref",library:T.loadRef()}}p.loadLibRef=x;function v(T){return C=>{T.type==="hash"?(C.storeUint(0,1),C.storeBuffer(T.libHash)):(C.storeUint(1,1),C.storeRef(T.library))}}p.storeLibRef=v},43897:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.loadMasterchainStateExtra=void 0;const v=x(10792),T=x(73484);function C(I){if(I.loadUint(16)!==52262)throw Error("Invalid data");I.loadBit()&&I.loadRef();let m=I.loadUintBig(256),b=v.Dictionary.load(v.Dictionary.Keys.Int(32),v.Dictionary.Values.Cell(),I);const g=(0,T.loadCurrencyCollection)(I);return{config:b,configAddress:m,globalBalance:g}}p.loadMasterchainStateExtra=C},85992:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.MessageValue=p.storeMessage=p.loadMessage=void 0;const v=x(3881),T=x(18727),C=x(78668);function I(b){const g=(0,T.loadCommonMessageInfo)(b);let w=null;b.loadBit()&&(b.loadBit()?w=(0,C.loadStateInit)(b.loadRef().beginParse()):w=(0,C.loadStateInit)(b));const _=b.loadBit()?b.loadRef():b.asCell();return{info:g,init:w,body:_}}p.loadMessage=I;function m(b,g){return w=>{if(w.store((0,T.storeCommonMessageInfo)(b.info)),b.init){w.storeBit(!0);let A=(0,v.beginCell)().store((0,C.storeStateInit)(b.init)),S=!1;g&&g.forceRef?S=!0:S=w.availableBits-2<A.bits+b.body.bits.length,S?(w.storeBit(!0),w.storeRef(A)):(w.storeBit(!1),w.storeBuilder(A))}else w.storeBit(!1);let _=!1;g&&g.forceRef?_=!0:_=w.availableBits-1<b.body.bits.length||w.refs+b.body.refs.length>4,_?(w.storeBit(!0),w.storeRef(b.body)):(w.storeBit(!1),w.storeBuilder(b.body.asBuilder()))}}p.storeMessage=m,p.MessageValue={serialize(b,g){g.storeRef((0,v.beginCell)().store(m(b)))},parse(b){return I(b.loadRef().beginParse())}}},37813:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeMessageRelaxed=p.loadMessageRelaxed=void 0;const v=x(3881),T=x(21972),C=x(78668);function I(b){const g=(0,T.loadCommonMessageInfoRelaxed)(b);let w=null;b.loadBit()&&(b.loadBit()?w=(0,C.loadStateInit)(b.loadRef().beginParse()):w=(0,C.loadStateInit)(b));const _=b.loadBit()?b.loadRef():b.asCell();return{info:g,init:w,body:_}}p.loadMessageRelaxed=I;function m(b,g){return w=>{if(w.store((0,T.storeCommonMessageInfoRelaxed)(b.info)),b.init){w.storeBit(!0);let A=(0,v.beginCell)().store((0,C.storeStateInit)(b.init)),S=!1;g&&g.forceRef?S=!0:w.availableBits-2>=A.bits?S=!1:S=!0,S?(w.storeBit(!0),w.storeRef(A)):(w.storeBit(!1),w.storeBuilder(A))}else w.storeBit(!1);let _=!1;g&&g.forceRef?_=!0:w.availableBits-1>=b.body.bits.length&&w.refs+b.body.refs.length<=4&&!b.body.isExotic?_=!1:_=!0,_?(w.storeBit(!0),w.storeRef(b.body)):(w.storeBit(!1),w.storeBuilder(b.body.asBuilder()))}}p.storeMessageRelaxed=m},19719:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.loadOutList=p.storeOutList=p.loadOutAction=p.storeOutAction=void 0;const v=x(37813),T=x(3881),C=x(73484),I=x(27459);function m(W){switch(W.type){case"sendMsg":return g(W);case"setCode":return _(W);case"reserve":return S(W);case"changeLibrary":return B(W);default:throw new Error(`Unknown action type ${W.type}`)}}p.storeOutAction=m;const b=247711853;function g(W){return H=>{H.storeUint(b,32).storeUint(W.mode,8).storeRef((0,T.beginCell)().store((0,v.storeMessageRelaxed)(W.outMsg)).endCell())}}const w=2907562126;function _(W){return H=>{H.storeUint(w,32).storeRef(W.newCode)}}const A=921090057;function S(W){return H=>{H.storeUint(A,32).storeUint(W.mode,8).store((0,C.storeCurrencyCollection)(W.currency))}}const k=653925844;function B(W){return H=>{H.storeUint(k,32).storeUint(W.mode,7).store((0,I.storeLibRef)(W.libRef))}}function O(W){const H=W.loadUint(32);if(H===b){const G=W.loadUint(8),Z=(0,v.loadMessageRelaxed)(W.loadRef().beginParse());return{type:"sendMsg",mode:G,outMsg:Z}}if(H===w)return{type:"setCode",newCode:W.loadRef()};if(H===A){const G=W.loadUint(8),Z=(0,C.loadCurrencyCollection)(W);return{type:"reserve",mode:G,currency:Z}}if(H===k){const G=W.loadUint(7),Z=(0,I.loadLibRef)(W);return{type:"changeLibrary",mode:G,libRef:Z}}throw new Error(`Unknown out action tag 0x${H.toString(16)}`)}p.loadOutAction=O;function L(W){const H=W.reduce((G,Z)=>(0,T.beginCell)().storeRef(G).store(m(Z)).endCell(),(0,T.beginCell)().endCell());return G=>{G.storeSlice(H.beginParse())}}p.storeOutList=L;function D(W){const H=[];for(;W.remainingRefs;){const G=W.loadRef();H.push(O(W)),W=G.beginParse()}return H.reverse()}p.loadOutList=D},58260:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.ReserveMode=void 0;var x;(function(v){v[v.THIS_AMOUNT=0]="THIS_AMOUNT",v[v.LEAVE_THIS_AMOUNT=1]="LEAVE_THIS_AMOUNT",v[v.AT_MOST_THIS_AMOUNT=2]="AT_MOST_THIS_AMOUNT",v[v.LEAVE_MAX_THIS_AMOUNT=3]="LEAVE_MAX_THIS_AMOUNT",v[v.BEFORE_BALANCE_PLUS_THIS_AMOUNT=4]="BEFORE_BALANCE_PLUS_THIS_AMOUNT",v[v.LEAVE_BBALANCE_PLUS_THIS_AMOUNT=5]="LEAVE_BBALANCE_PLUS_THIS_AMOUNT",v[v.BEFORE_BALANCE_MINUS_THIS_AMOUNT=12]="BEFORE_BALANCE_MINUS_THIS_AMOUNT",v[v.LEAVE_BEFORE_BALANCE_MINUS_THIS_AMOUNT=13]="LEAVE_BEFORE_BALANCE_MINUS_THIS_AMOUNT"})(x||(p.ReserveMode=x={}))},84922:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.SendMode=void 0;var x;(function(v){v[v.CARRY_ALL_REMAINING_BALANCE=128]="CARRY_ALL_REMAINING_BALANCE",v[v.CARRY_ALL_REMAINING_INCOMING_VALUE=64]="CARRY_ALL_REMAINING_INCOMING_VALUE",v[v.DESTROY_ACCOUNT_IF_ZERO=32]="DESTROY_ACCOUNT_IF_ZERO",v[v.PAY_GAS_SEPARATELY=1]="PAY_GAS_SEPARATELY",v[v.IGNORE_ERRORS=2]="IGNORE_ERRORS",v[v.NONE=0]="NONE"})(x||(p.SendMode=x={}))},21960:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeShardAccount=p.loadShardAccount=void 0;const v=x(3881),T=x(81568);function C(m){let b=m.loadRef(),g;if(!b.isExotic){let w=b.beginParse();w.loadBit()&&(g=(0,T.loadAccount)(w))}return{account:g,lastTransactionHash:m.loadUintBig(256),lastTransactionLt:m.loadUintBig(64)}}p.loadShardAccount=C;function I(m){return b=>{m.account?b.storeRef((0,v.beginCell)().storeBit(!0).store((0,T.storeAccount)(m.account))):b.storeRef((0,v.beginCell)().storeBit(!1)),b.storeUint(m.lastTransactionHash,256),b.storeUint(m.lastTransactionLt,64)}}p.storeShardAccount=I},32951:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeShardAccounts=p.loadShardAccounts=p.ShardAccountRefValue=void 0;const v=x(10792),T=x(5504),C=x(21960);p.ShardAccountRefValue={parse:b=>{let g=(0,T.loadDepthBalanceInfo)(b),w=(0,C.loadShardAccount)(b);return{depthBalanceInfo:g,shardAccount:w}},serialize(b,g){g.store((0,T.storeDepthBalanceInfo)(b.depthBalanceInfo)),g.store((0,C.storeShardAccount)(b.shardAccount))}};function I(b){return v.Dictionary.load(v.Dictionary.Keys.BigUint(256),p.ShardAccountRefValue,b)}p.loadShardAccounts=I;function m(b){return g=>{g.storeDict(b)}}p.storeShardAccounts=m},69569:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeShardIdent=p.loadShardIdent=void 0;function x(T){if(T.loadUint(2)!==0)throw Error("Invalid data");return{shardPrefixBits:T.loadUint(6),workchainId:T.loadInt(32),shardPrefix:T.loadUintBig(64)}}p.loadShardIdent=x;function v(T){return C=>{C.storeUint(0,2),C.storeUint(T.shardPrefixBits,6),C.storeInt(T.workchainId,32),C.storeUint(T.shardPrefix,64)}}p.storeShardIdent=v},11337:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.loadShardStateUnsplit=void 0;const v=x(43897),T=x(32951),C=x(69569);function I(m){if(m.loadUint(32)!==2418257890)throw Error("Invalid data");let b=m.loadInt(32),g=(0,C.loadShardIdent)(m),w=m.loadUint(32),_=m.loadUint(32),A=m.loadUint(32),S=m.loadUintBig(64),k=m.loadUint(32);m.loadRef();let B=m.loadBit(),O=m.loadRef(),L;O.isExotic||(L=(0,T.loadShardAccounts)(O.beginParse())),m.loadRef();let D=m.loadBit(),W=null;if(D){let H=m.loadRef();H.isExotic||(W=(0,v.loadMasterchainStateExtra)(H.beginParse()))}return{globalId:b,shardId:g,seqno:w,vertSeqNo:_,genUtime:A,genLt:S,minRefMcSeqno:k,beforeSplit:B,accounts:L,extras:W}}p.loadShardStateUnsplit=I},54066:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.SimpleLibraryValue=p.storeSimpleLibrary=p.loadSimpleLibrary=void 0;function x(T){return{public:T.loadBit(),root:T.loadRef()}}p.loadSimpleLibrary=x;function v(T){return C=>{C.storeBit(T.public),C.storeRef(T.root)}}p.storeSimpleLibrary=v,p.SimpleLibraryValue={serialize(T,C){v(T)(C)},parse(T){return x(T)}}},835:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeSplitMergeInfo=p.loadSplitMergeInfo=void 0;function x(T){let C=T.loadUint(6),I=T.loadUint(6),m=T.loadUintBig(256),b=T.loadUintBig(256);return{currentShardPrefixLength:C,accountSplitDepth:I,thisAddress:m,siblingAddress:b}}p.loadSplitMergeInfo=x;function v(T){return C=>{C.storeUint(T.currentShardPrefixLength,6),C.storeUint(T.accountSplitDepth,6),C.storeUint(T.thisAddress,256),C.storeUint(T.siblingAddress,256)}}p.storeSplitMergeInfo=v},78668:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeStateInit=p.loadStateInit=void 0;const v=x(10792),T=x(54066),C=x(85689);function I(b){let g;b.loadBit()&&(g=b.loadUint(5));let w;b.loadBit()&&(w=(0,C.loadTickTock)(b));let _=b.loadMaybeRef(),A=b.loadMaybeRef(),S=b.loadDict(v.Dictionary.Keys.BigUint(256),T.SimpleLibraryValue);return S.size===0&&(S=void 0),{splitDepth:g,special:w,code:_,data:A,libraries:S}}p.loadStateInit=I;function m(b){return g=>{b.splitDepth!==null&&b.splitDepth!==void 0?(g.storeBit(!0),g.storeUint(b.splitDepth,5)):g.storeBit(!1),b.special!==null&&b.special!==void 0?(g.storeBit(!0),g.store((0,C.storeTickTock)(b.special))):g.storeBit(!1),g.storeMaybeRef(b.code),g.storeMaybeRef(b.data),g.storeDict(b.libraries)}}p.storeStateInit=m},31480:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeStorageInfo=p.loadStorageInfo=void 0;const v=x(72511);function T(I){return{used:(0,v.loadStorageUsed)(I),lastPaid:I.loadUint(32),duePayment:I.loadMaybeCoins()}}p.loadStorageInfo=T;function C(I){return m=>{m.store((0,v.storeStorageUsed)(I.used)),m.storeUint(I.lastPaid,32),m.storeMaybeCoins(I.duePayment)}}p.storeStorageInfo=C},72511:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeStorageUsed=p.loadStorageUsed=void 0;function x(T){return{cells:T.loadVarUintBig(3),bits:T.loadVarUintBig(3),publicCells:T.loadVarUintBig(3)}}p.loadStorageUsed=x;function v(T){return C=>{C.storeVarUint(T.cells,3),C.storeVarUint(T.bits,3),C.storeVarUint(T.publicCells,3)}}p.storeStorageUsed=v},63309:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeStorageUsedShort=p.loadStorageUsedShort=void 0;function x(T){let C=T.loadVarUintBig(3),I=T.loadVarUintBig(3);return{cells:C,bits:I}}p.loadStorageUsedShort=x;function v(T){return C=>{C.storeVarUint(T.cells,3),C.storeVarUint(T.bits,3)}}p.storeStorageUsedShort=v},85689:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeTickTock=p.loadTickTock=void 0;function x(T){return{tick:T.loadBit(),tock:T.loadBit()}}p.loadTickTock=x;function v(T){return C=>{C.storeBit(T.tick),C.storeBit(T.tock)}}p.storeTickTock=v},32811:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeTransaction=p.loadTransaction=void 0;const v=x(3881),T=x(10792),C=x(70086),I=x(73484),m=x(78238),b=x(85992),g=x(10665);function w(A){let S=A.asCell();if(A.loadUint(4)!==7)throw Error("Invalid data");let k=A.loadUintBig(256),B=A.loadUintBig(64),O=A.loadUintBig(256),L=A.loadUintBig(64),D=A.loadUint(32),W=A.loadUint(15),H=(0,C.loadAccountStatus)(A),G=(0,C.loadAccountStatus)(A),Q=A.loadRef().beginParse(),ie=Q.loadBit()?(0,b.loadMessage)(Q.loadRef().beginParse()):void 0,le=Q.loadDict(T.Dictionary.Keys.Uint(15),b.MessageValue);Q.endParse();let be=(0,I.loadCurrencyCollection)(A),we=(0,m.loadHashUpdate)(A.loadRef().beginParse()),Ae=(0,g.loadTransactionDescription)(A.loadRef().beginParse());return{address:k,lt:B,prevTransactionHash:O,prevTransactionLt:L,now:D,outMessagesCount:W,oldStatus:H,endStatus:G,inMessage:ie,outMessages:le,totalFees:be,stateUpdate:we,description:Ae,raw:S,hash:()=>S.hash()}}p.loadTransaction=w;function _(A){return S=>{S.storeUint(7,4),S.storeUint(A.address,256),S.storeUint(A.lt,64),S.storeUint(A.prevTransactionHash,256),S.storeUint(A.prevTransactionLt,64),S.storeUint(A.now,32),S.storeUint(A.outMessagesCount,15),S.store((0,C.storeAccountStatus)(A.oldStatus)),S.store((0,C.storeAccountStatus)(A.endStatus));let k=(0,v.beginCell)();A.inMessage?(k.storeBit(!0),k.storeRef((0,v.beginCell)().store((0,b.storeMessage)(A.inMessage)))):k.storeBit(!1),k.storeDict(A.outMessages),S.storeRef(k),S.store((0,I.storeCurrencyCollection)(A.totalFees)),S.storeRef((0,v.beginCell)().store((0,m.storeHashUpdate)(A.stateUpdate))),S.storeRef((0,v.beginCell)().store((0,g.storeTransactionDescription)(A.description)))}}p.storeTransaction=_},98806:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeTransactionActionPhase=p.loadTransactionActionPhase=void 0;const v=x(87878),T=x(63309);function C(m){let b=m.loadBit(),g=m.loadBit(),w=m.loadBit(),_=(0,v.loadAccountStatusChange)(m),A=m.loadBit()?m.loadCoins():void 0,S=m.loadBit()?m.loadCoins():void 0,k=m.loadInt(32),B=m.loadBit()?m.loadInt(32):void 0,O=m.loadUint(16),L=m.loadUint(16),D=m.loadUint(16),W=m.loadUint(16),H=m.loadUintBig(256),G=(0,T.loadStorageUsedShort)(m);return{success:b,valid:g,noFunds:w,statusChange:_,totalFwdFees:A,totalActionFees:S,resultCode:k,resultArg:B,totalActions:O,specActions:L,skippedActions:D,messagesCreated:W,actionListHash:H,totalMessageSize:G}}p.loadTransactionActionPhase=C;function I(m){return b=>{b.storeBit(m.success),b.storeBit(m.valid),b.storeBit(m.noFunds),b.store((0,v.storeAccountStatusChange)(m.statusChange)),b.storeMaybeCoins(m.totalFwdFees),b.storeMaybeCoins(m.totalActionFees),b.storeInt(m.resultCode,32),b.storeMaybeInt(m.resultArg,32),b.storeUint(m.totalActions,16),b.storeUint(m.specActions,16),b.storeUint(m.skippedActions,16),b.storeUint(m.messagesCreated,16),b.storeUint(m.actionListHash,256),b.store((0,T.storeStorageUsedShort)(m.totalMessageSize))}}p.storeTransactionActionPhase=I},61864:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeTransactionBouncePhase=p.loadTransactionBouncePhase=void 0;const v=x(63309);function T(I){if(I.loadBit()){let m=(0,v.loadStorageUsedShort)(I),b=I.loadCoins(),g=I.loadCoins();return{type:"ok",messageSize:m,messageFees:b,forwardFees:g}}if(I.loadBit()){let m=(0,v.loadStorageUsedShort)(I),b=I.loadCoins();return{type:"no-funds",messageSize:m,requiredForwardFees:b}}return{type:"negative-funds"}}p.loadTransactionBouncePhase=T;function C(I){return m=>{if(I.type==="ok")m.storeBit(!0),m.store((0,v.storeStorageUsedShort)(I.messageSize)),m.storeCoins(I.messageFees),m.storeCoins(I.forwardFees);else if(I.type==="negative-funds")m.storeBit(!1),m.storeBit(!1);else if(I.type==="no-funds")m.storeBit(!1),m.storeBit(!0),m.store((0,v.storeStorageUsedShort)(I.messageSize)),m.storeCoins(I.requiredForwardFees);else throw new Error("Invalid TransactionBouncePhase type")}}p.storeTransactionBouncePhase=C},95039:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeTransactionComputePhase=p.loadTransactionComputePhase=void 0;const v=x(3881),T=x(93689);function C(m){if(!m.loadBit())return{type:"skipped",reason:(0,T.loadComputeSkipReason)(m)};let b=m.loadBit(),g=m.loadBit(),w=m.loadBit(),_=m.loadCoins();const A=m.loadRef().beginParse();let S=A.loadVarUintBig(3),k=A.loadVarUintBig(3),B=A.loadBit()?A.loadVarUintBig(2):void 0,O=A.loadUint(8),L=A.loadInt(32),D=A.loadBit()?A.loadInt(32):void 0,W=A.loadUint(32),H=A.loadUintBig(256),G=A.loadUintBig(256);return{type:"vm",success:b,messageStateUsed:g,accountActivated:w,gasFees:_,gasUsed:S,gasLimit:k,gasCredit:B,mode:O,exitCode:L,exitArg:D,vmSteps:W,vmInitStateHash:H,vmFinalStateHash:G}}p.loadTransactionComputePhase=C;function I(m){return b=>{if(m.type==="skipped"){b.storeBit(0),b.store((0,T.storeComputeSkipReason)(m.reason));return}b.storeBit(1),b.storeBit(m.success),b.storeBit(m.messageStateUsed),b.storeBit(m.accountActivated),b.storeCoins(m.gasFees),b.storeRef((0,v.beginCell)().storeVarUint(m.gasUsed,3).storeVarUint(m.gasLimit,3).store(g=>m.gasCredit!==void 0&&m.gasCredit!==null?g.storeBit(1).storeVarUint(m.gasCredit,2):g.storeBit(0)).storeUint(m.mode,8).storeInt(m.exitCode,32).store(g=>m.exitArg!==void 0&&m.exitArg!==null?g.storeBit(1).storeInt(m.exitArg,32):g.storeBit(0)).storeUint(m.vmSteps,32).storeUint(m.vmInitStateHash,256).storeUint(m.vmFinalStateHash,256).endCell())}}p.storeTransactionComputePhase=I},84771:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeTransactionCreditPhase=p.loadTransactionCreditPhase=void 0;const v=x(73484);function T(I){const m=I.loadBit()?I.loadCoins():void 0,b=(0,v.loadCurrencyCollection)(I);return{dueFeesColelcted:m,credit:b}}p.loadTransactionCreditPhase=T;function C(I){return m=>{I.dueFeesColelcted===null||I.dueFeesColelcted===void 0?m.storeBit(!1):(m.storeBit(!0),m.storeCoins(I.dueFeesColelcted)),m.store((0,v.storeCurrencyCollection)(I.credit))}}p.storeTransactionCreditPhase=C},10665:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeTransactionDescription=p.loadTransactionDescription=void 0;const v=x(3881),T=x(835),C=x(32811),I=x(98806),m=x(61864),b=x(95039),g=x(84771),w=x(72471);function _(S){let k=S.loadUint(4);if(k===0){const B=S.loadBit();let O;S.loadBit()&&(O=(0,w.loadTransactionStoragePhase)(S));let L;S.loadBit()&&(L=(0,g.loadTransactionCreditPhase)(S));let D=(0,b.loadTransactionComputePhase)(S),W;S.loadBit()&&(W=(0,I.loadTransactionActionPhase)(S.loadRef().beginParse()));let H=S.loadBit(),G;S.loadBit()&&(G=(0,m.loadTransactionBouncePhase)(S));const Z=S.loadBit();return{type:"generic",creditFirst:B,storagePhase:O,creditPhase:L,computePhase:D,actionPhase:W,bouncePhase:G,aborted:H,destroyed:Z}}if(k===1)return{type:"storage",storagePhase:(0,w.loadTransactionStoragePhase)(S)};if(k===2||k===3){const B=k===3;let O=(0,w.loadTransactionStoragePhase)(S),L=(0,b.loadTransactionComputePhase)(S),D;S.loadBit()&&(D=(0,I.loadTransactionActionPhase)(S.loadRef().beginParse()));const W=S.loadBit(),H=S.loadBit();return{type:"tick-tock",isTock:B,storagePhase:O,computePhase:L,actionPhase:D,aborted:W,destroyed:H}}if(k===4){let B=(0,T.loadSplitMergeInfo)(S),O;S.loadBit()&&(O=(0,w.loadTransactionStoragePhase)(S));let L=(0,b.loadTransactionComputePhase)(S),D;S.loadBit()&&(D=(0,I.loadTransactionActionPhase)(S.loadRef().beginParse()));const W=S.loadBit(),H=S.loadBit();return{type:"split-prepare",splitInfo:B,storagePhase:O,computePhase:L,actionPhase:D,aborted:W,destroyed:H}}if(k===5){let B=(0,T.loadSplitMergeInfo)(S),O=(0,C.loadTransaction)(S.loadRef().beginParse());const L=S.loadBit();return{type:"split-install",splitInfo:B,prepareTransaction:O,installed:L}}throw Error(`Unsupported transaction description type ${k}`)}p.loadTransactionDescription=_;function A(S){return k=>{if(S.type==="generic")k.storeUint(0,4),k.storeBit(S.creditFirst),S.storagePhase?(k.storeBit(!0),k.store((0,w.storeTransactionsStoragePhase)(S.storagePhase))):k.storeBit(!1),S.creditPhase?(k.storeBit(!0),k.store((0,g.storeTransactionCreditPhase)(S.creditPhase))):k.storeBit(!1),k.store((0,b.storeTransactionComputePhase)(S.computePhase)),S.actionPhase?(k.storeBit(!0),k.storeRef((0,v.beginCell)().store((0,I.storeTransactionActionPhase)(S.actionPhase)))):k.storeBit(!1),k.storeBit(S.aborted),S.bouncePhase?(k.storeBit(!0),k.store((0,m.storeTransactionBouncePhase)(S.bouncePhase))):k.storeBit(!1),k.storeBit(S.destroyed);else if(S.type==="storage")k.storeUint(1,4),k.store((0,w.storeTransactionsStoragePhase)(S.storagePhase));else if(S.type==="tick-tock")k.storeUint(S.isTock?3:2,4),k.store((0,w.storeTransactionsStoragePhase)(S.storagePhase)),k.store((0,b.storeTransactionComputePhase)(S.computePhase)),S.actionPhase?(k.storeBit(!0),k.storeRef((0,v.beginCell)().store((0,I.storeTransactionActionPhase)(S.actionPhase)))):k.storeBit(!1),k.storeBit(S.aborted),k.storeBit(S.destroyed);else if(S.type==="split-prepare")k.storeUint(4,4),k.store((0,T.storeSplitMergeInfo)(S.splitInfo)),S.storagePhase?(k.storeBit(!0),k.store((0,w.storeTransactionsStoragePhase)(S.storagePhase))):k.storeBit(!1),k.store((0,b.storeTransactionComputePhase)(S.computePhase)),S.actionPhase?(k.storeBit(!0),k.store((0,I.storeTransactionActionPhase)(S.actionPhase))):k.storeBit(!1),k.storeBit(S.aborted),k.storeBit(S.destroyed);else if(S.type==="split-install")k.storeUint(5,4),k.store((0,T.storeSplitMergeInfo)(S.splitInfo)),k.storeRef((0,v.beginCell)().store((0,C.storeTransaction)(S.prepareTransaction))),k.storeBit(S.installed);else throw Error(`Unsupported transaction description type ${S.type}`)}}p.storeTransactionDescription=A},72471:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeTransactionsStoragePhase=p.loadTransactionStoragePhase=void 0;const v=x(87878);function T(I){const m=I.loadCoins();let b;I.loadBit()&&(b=I.loadCoins());const g=(0,v.loadAccountStatusChange)(I);return{storageFeesCollected:m,storageFeesDue:b,statusChange:g}}p.loadTransactionStoragePhase=T;function C(I){return m=>{m.storeCoins(I.storageFeesCollected),I.storageFeesDue===null||I.storageFeesDue===void 0?m.storeBit(!1):(m.storeBit(!0),m.storeCoins(I.storageFeesDue)),m.store((0,v.storeAccountStatusChange)(I.statusChange))}}p.storeTransactionsStoragePhase=C},39300:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.storeSplitMergeInfo=p.loadSplitMergeInfo=p.storeLibRef=p.loadLibRef=p.storeSimpleLibrary=p.loadSimpleLibrary=p.loadShardStateUnsplit=p.storeShardIdent=p.loadShardIdent=p.storeShardAccounts=p.loadShardAccounts=p.ShardAccountRefValue=p.storeShardAccount=p.loadShardAccount=p.ReserveMode=p.SendMode=p.storeMessageRelaxed=p.loadMessageRelaxed=p.storeMessage=p.loadMessage=p.loadMasterchainStateExtra=p.storeHashUpdate=p.loadHashUpdate=p.storeDepthBalanceInfo=p.loadDepthBalanceInfo=p.storeCurrencyCollection=p.loadCurrencyCollection=p.storeComputeSkipReason=p.loadComputeSkipReason=p.storeCommonMessageInfoRelaxed=p.loadCommonMessageInfoRelaxed=p.storeCommonMessageInfo=p.loadCommonMessageInfo=p.storeOutList=p.loadOutList=p.storeOutAction=p.loadOutAction=p.storeAccountStorage=p.loadAccountStorage=p.storeAccountStatusChange=p.loadAccountStatusChange=p.storeAccountStatus=p.loadAccountStatus=p.storeAccountState=p.loadAccountState=p.storeAccount=p.loadAccount=p.comment=p.external=p.internal=void 0,p.storeTransactionsStoragePhase=p.loadTransactionStoragePhase=p.storeTransactionDescription=p.loadTransactionDescription=p.storeTransactionCreditPhase=p.loadTransactionCreditPhase=p.storeTransactionComputePhase=p.loadTransactionComputePhase=p.storeTransactionBouncePhase=p.loadTransactionBouncePhase=p.storeTransactionActionPhase=p.loadTransactionActionPhase=p.storeTransaction=p.loadTransaction=p.storeTickTock=p.loadTickTock=p.storeStorageUsedShort=p.loadStorageUsedShort=p.storeStorageUsed=p.loadStorageUsed=p.storeStorageInfo=p.loadStorageInfo=p.storeStateInit=p.loadStateInit=void 0;var v=x(81145);Object.defineProperty(p,"internal",{enumerable:!0,get:function(){return v.internal}}),Object.defineProperty(p,"external",{enumerable:!0,get:function(){return v.external}}),Object.defineProperty(p,"comment",{enumerable:!0,get:function(){return v.comment}});var T=x(81568);Object.defineProperty(p,"loadAccount",{enumerable:!0,get:function(){return T.loadAccount}}),Object.defineProperty(p,"storeAccount",{enumerable:!0,get:function(){return T.storeAccount}});var C=x(47763);Object.defineProperty(p,"loadAccountState",{enumerable:!0,get:function(){return C.loadAccountState}}),Object.defineProperty(p,"storeAccountState",{enumerable:!0,get:function(){return C.storeAccountState}});var I=x(70086);Object.defineProperty(p,"loadAccountStatus",{enumerable:!0,get:function(){return I.loadAccountStatus}}),Object.defineProperty(p,"storeAccountStatus",{enumerable:!0,get:function(){return I.storeAccountStatus}});var m=x(87878);Object.defineProperty(p,"loadAccountStatusChange",{enumerable:!0,get:function(){return m.loadAccountStatusChange}}),Object.defineProperty(p,"storeAccountStatusChange",{enumerable:!0,get:function(){return m.storeAccountStatusChange}});var b=x(5759);Object.defineProperty(p,"loadAccountStorage",{enumerable:!0,get:function(){return b.loadAccountStorage}}),Object.defineProperty(p,"storeAccountStorage",{enumerable:!0,get:function(){return b.storeAccountStorage}});var g=x(19719);Object.defineProperty(p,"loadOutAction",{enumerable:!0,get:function(){return g.loadOutAction}}),Object.defineProperty(p,"storeOutAction",{enumerable:!0,get:function(){return g.storeOutAction}}),Object.defineProperty(p,"loadOutList",{enumerable:!0,get:function(){return g.loadOutList}}),Object.defineProperty(p,"storeOutList",{enumerable:!0,get:function(){return g.storeOutList}});var w=x(18727);Object.defineProperty(p,"loadCommonMessageInfo",{enumerable:!0,get:function(){return w.loadCommonMessageInfo}}),Object.defineProperty(p,"storeCommonMessageInfo",{enumerable:!0,get:function(){return w.storeCommonMessageInfo}});var _=x(21972);Object.defineProperty(p,"loadCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return _.loadCommonMessageInfoRelaxed}}),Object.defineProperty(p,"storeCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return _.storeCommonMessageInfoRelaxed}});var A=x(93689);Object.defineProperty(p,"loadComputeSkipReason",{enumerable:!0,get:function(){return A.loadComputeSkipReason}}),Object.defineProperty(p,"storeComputeSkipReason",{enumerable:!0,get:function(){return A.storeComputeSkipReason}});var S=x(73484);Object.defineProperty(p,"loadCurrencyCollection",{enumerable:!0,get:function(){return S.loadCurrencyCollection}}),Object.defineProperty(p,"storeCurrencyCollection",{enumerable:!0,get:function(){return S.storeCurrencyCollection}});var k=x(5504);Object.defineProperty(p,"loadDepthBalanceInfo",{enumerable:!0,get:function(){return k.loadDepthBalanceInfo}}),Object.defineProperty(p,"storeDepthBalanceInfo",{enumerable:!0,get:function(){return k.storeDepthBalanceInfo}});var B=x(78238);Object.defineProperty(p,"loadHashUpdate",{enumerable:!0,get:function(){return B.loadHashUpdate}}),Object.defineProperty(p,"storeHashUpdate",{enumerable:!0,get:function(){return B.storeHashUpdate}});var O=x(43897);Object.defineProperty(p,"loadMasterchainStateExtra",{enumerable:!0,get:function(){return O.loadMasterchainStateExtra}});var L=x(85992);Object.defineProperty(p,"loadMessage",{enumerable:!0,get:function(){return L.loadMessage}}),Object.defineProperty(p,"storeMessage",{enumerable:!0,get:function(){return L.storeMessage}});var D=x(37813);Object.defineProperty(p,"loadMessageRelaxed",{enumerable:!0,get:function(){return D.loadMessageRelaxed}}),Object.defineProperty(p,"storeMessageRelaxed",{enumerable:!0,get:function(){return D.storeMessageRelaxed}});var W=x(84922);Object.defineProperty(p,"SendMode",{enumerable:!0,get:function(){return W.SendMode}});var H=x(58260);Object.defineProperty(p,"ReserveMode",{enumerable:!0,get:function(){return H.ReserveMode}});var G=x(21960);Object.defineProperty(p,"loadShardAccount",{enumerable:!0,get:function(){return G.loadShardAccount}}),Object.defineProperty(p,"storeShardAccount",{enumerable:!0,get:function(){return G.storeShardAccount}});var Z=x(32951);Object.defineProperty(p,"ShardAccountRefValue",{enumerable:!0,get:function(){return Z.ShardAccountRefValue}}),Object.defineProperty(p,"loadShardAccounts",{enumerable:!0,get:function(){return Z.loadShardAccounts}}),Object.defineProperty(p,"storeShardAccounts",{enumerable:!0,get:function(){return Z.storeShardAccounts}});var Q=x(69569);Object.defineProperty(p,"loadShardIdent",{enumerable:!0,get:function(){return Q.loadShardIdent}}),Object.defineProperty(p,"storeShardIdent",{enumerable:!0,get:function(){return Q.storeShardIdent}});var ie=x(11337);Object.defineProperty(p,"loadShardStateUnsplit",{enumerable:!0,get:function(){return ie.loadShardStateUnsplit}});var le=x(54066);Object.defineProperty(p,"loadSimpleLibrary",{enumerable:!0,get:function(){return le.loadSimpleLibrary}}),Object.defineProperty(p,"storeSimpleLibrary",{enumerable:!0,get:function(){return le.storeSimpleLibrary}});var be=x(27459);Object.defineProperty(p,"loadLibRef",{enumerable:!0,get:function(){return be.loadLibRef}}),Object.defineProperty(p,"storeLibRef",{enumerable:!0,get:function(){return be.storeLibRef}});var we=x(835);Object.defineProperty(p,"loadSplitMergeInfo",{enumerable:!0,get:function(){return we.loadSplitMergeInfo}}),Object.defineProperty(p,"storeSplitMergeInfo",{enumerable:!0,get:function(){return we.storeSplitMergeInfo}});var Ae=x(78668);Object.defineProperty(p,"loadStateInit",{enumerable:!0,get:function(){return Ae.loadStateInit}}),Object.defineProperty(p,"storeStateInit",{enumerable:!0,get:function(){return Ae.storeStateInit}});var re=x(31480);Object.defineProperty(p,"loadStorageInfo",{enumerable:!0,get:function(){return re.loadStorageInfo}}),Object.defineProperty(p,"storeStorageInfo",{enumerable:!0,get:function(){return re.storeStorageInfo}});var N=x(72511);Object.defineProperty(p,"loadStorageUsed",{enumerable:!0,get:function(){return N.loadStorageUsed}}),Object.defineProperty(p,"storeStorageUsed",{enumerable:!0,get:function(){return N.storeStorageUsed}});var z=x(63309);Object.defineProperty(p,"loadStorageUsedShort",{enumerable:!0,get:function(){return z.loadStorageUsedShort}}),Object.defineProperty(p,"storeStorageUsedShort",{enumerable:!0,get:function(){return z.storeStorageUsedShort}});var V=x(85689);Object.defineProperty(p,"loadTickTock",{enumerable:!0,get:function(){return V.loadTickTock}}),Object.defineProperty(p,"storeTickTock",{enumerable:!0,get:function(){return V.storeTickTock}});var U=x(32811);Object.defineProperty(p,"loadTransaction",{enumerable:!0,get:function(){return U.loadTransaction}}),Object.defineProperty(p,"storeTransaction",{enumerable:!0,get:function(){return U.storeTransaction}});var j=x(98806);Object.defineProperty(p,"loadTransactionActionPhase",{enumerable:!0,get:function(){return j.loadTransactionActionPhase}}),Object.defineProperty(p,"storeTransactionActionPhase",{enumerable:!0,get:function(){return j.storeTransactionActionPhase}});var $=x(61864);Object.defineProperty(p,"loadTransactionBouncePhase",{enumerable:!0,get:function(){return $.loadTransactionBouncePhase}}),Object.defineProperty(p,"storeTransactionBouncePhase",{enumerable:!0,get:function(){return $.storeTransactionBouncePhase}});var ee=x(95039);Object.defineProperty(p,"loadTransactionComputePhase",{enumerable:!0,get:function(){return ee.loadTransactionComputePhase}}),Object.defineProperty(p,"storeTransactionComputePhase",{enumerable:!0,get:function(){return ee.storeTransactionComputePhase}});var J=x(84771);Object.defineProperty(p,"loadTransactionCreditPhase",{enumerable:!0,get:function(){return J.loadTransactionCreditPhase}}),Object.defineProperty(p,"storeTransactionCreditPhase",{enumerable:!0,get:function(){return J.storeTransactionCreditPhase}});var F=x(10665);Object.defineProperty(p,"loadTransactionDescription",{enumerable:!0,get:function(){return F.loadTransactionDescription}}),Object.defineProperty(p,"storeTransactionDescription",{enumerable:!0,get:function(){return F.storeTransactionDescription}});var X=x(72471);Object.defineProperty(p,"loadTransactionStoragePhase",{enumerable:!0,get:function(){return X.loadTransactionStoragePhase}}),Object.defineProperty(p,"storeTransactionsStoragePhase",{enumerable:!0,get:function(){return X.storeTransactionsStoragePhase}})},81145:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.comment=p.external=p.internal=void 0;const v=x(14526),T=x(66608),C=x(3881),I=x(52268);function m(w){let _=!0;w.bounce!==null&&w.bounce!==void 0&&(_=w.bounce);let A;if(typeof w.to=="string")A=v.Address.parse(w.to);else if(v.Address.isAddress(w.to))A=w.to;else throw new Error(`Invalid address ${w.to}`);let S;typeof w.value=="string"?S=(0,I.toNano)(w.value):S=w.value;let k=T.Cell.EMPTY;return typeof w.body=="string"?k=(0,C.beginCell)().storeUint(0,32).storeStringTail(w.body).endCell():w.body&&(k=w.body),{info:{type:"internal",dest:A,value:{coins:S},bounce:_,ihrDisabled:!0,bounced:!1,ihrFee:0n,forwardFee:0n,createdAt:0,createdLt:0n},init:w.init??void 0,body:k}}p.internal=m;function b(w){let _;if(typeof w.to=="string")_=v.Address.parse(w.to);else if(v.Address.isAddress(w.to))_=w.to;else throw new Error(`Invalid address ${w.to}`);return{info:{type:"external-in",dest:_,importFee:0n},init:w.init??void 0,body:w.body||T.Cell.EMPTY}}p.external=b;function g(w){return(0,C.beginCell)().storeUint(0,32).storeStringTail(w).endCell()}p.comment=g},20711:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.base32Decode=p.base32Encode=void 0;const T="abcdefghijklmnopqrstuvwxyz234567";function C(b){const g=b.byteLength;let w=0,_=0,A="";for(let S=0;S<g;S++)for(_=_<<8|b[S],w+=8;w>=5;)A+=T[_>>>w-5&31],w-=5;return w>0&&(A+=T[_<<5-w&31]),A}p.base32Encode=C;function I(b,g){const w=b.indexOf(g);if(w===-1)throw new Error("Invalid character found: "+g);return w}function m(b){let g;g=b.toLowerCase();const{length:w}=g;let _=0,A=0,S=0;const k=v.alloc(w*5/8|0);for(let B=0;B<w;B++)A=A<<5|I(T,g[B]),_+=5,_>=8&&(k[S++]=A>>>_-8&255,_-=8);return k}p.base32Decode=m},46689:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.bitsForNumber=void 0;function x(v,T){let C=BigInt(v);if(T==="int")return C===0n||C===-1n?1:(C>0?C:-C).toString(2).length+1;if(T==="uint"){if(C<0)throw Error(`value is negative. Got ${v}`);return C.toString(2).length}else throw Error(`invalid mode. Got ${T}`)}p.bitsForNumber=x},52268:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.fromNano=p.toNano=void 0;function x(T){if(typeof T=="bigint")return T*1000000000n;{if(typeof T=="number"){if(!Number.isFinite(T))throw Error("Invalid number");if(Math.log10(T)<=6)T=T.toLocaleString("en",{minimumFractionDigits:9,useGrouping:!1});else if(T-Math.trunc(T)===0)T=T.toLocaleString("en",{maximumFractionDigits:0,useGrouping:!1});else throw Error("Not enough precision for a number value. Use string value instead")}let C=!1;for(;T.startsWith("-");)C=!C,T=T.slice(1);if(T===".")throw Error("Invalid number");let I=T.split(".");if(I.length>2)throw Error("Invalid number");let m=I[0],b=I[1];if(m||(m="0"),b||(b="0"),b.length>9)throw Error("Invalid number");for(;b.length<9;)b+="0";let g=BigInt(m)*1000000000n+BigInt(b);return C&&(g=-g),g}}p.toNano=x;function v(T){let C=BigInt(T),I=!1;C<0&&(I=!0,C=-C);let b=(C%1000000000n).toString();for(;b.length<9;)b="0"+b;b=b.match(/^([0-9]*[1-9]|0)(0*)/)[1];let _=`${(C/1000000000n).toString()}${b==="0"?"":`.${b}`}`;return I&&(_="-"+_),_}p.fromNano=v},9922:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.crc16=void 0;function T(C){let m=0;const b=v.alloc(C.length+2);b.set(C);for(let g of b){let w=128;for(;w>0;)m<<=1,g&w&&(m+=1),w>>=1,m>65535&&(m&=65535,m^=4129)}return v.from([Math.floor(m/256),m%256])}p.crc16=T},30867:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.crc32c=void 0;const T=2197175160;function C(I){let m=-1;for(let g=0;g<I.length;g++)m^=I[g],m=m&1?m>>>1^T:m>>>1,m=m&1?m>>>1^T:m>>>1,m=m&1?m>>>1^T:m>>>1,m=m&1?m>>>1^T:m>>>1,m=m&1?m>>>1^T:m>>>1,m=m&1?m>>>1^T:m>>>1,m=m&1?m>>>1^T:m>>>1,m=m&1?m>>>1^T:m>>>1;m=m^4294967295;let b=v.alloc(4);return b.writeInt32LE(m),b}p.crc32c=C},42831:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.getMethodId=void 0;const T=new Int16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);function C(m){m instanceof v||(m=v.from(m));let b=0;for(let g=0;g<m.length;g++){const w=m[g];b=(T[(b>>8^w)&255]^b<<8)&65535}return b}function I(m){return C(m)&65535|65536}p.getMethodId=I},12080:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.sha512=p.sha256=p.pbkdf2_sha512=p.hmac_sha512=p.getSecureRandomWords=p.getSecureRandomBytes=void 0;var v=x(94817);Object.defineProperty(p,"getSecureRandomBytes",{enumerable:!0,get:function(){return v.getSecureRandomBytes}}),Object.defineProperty(p,"getSecureRandomWords",{enumerable:!0,get:function(){return v.getSecureRandomWords}});var T=x(4777);Object.defineProperty(p,"hmac_sha512",{enumerable:!0,get:function(){return T.hmac_sha512}});var C=x(78687);Object.defineProperty(p,"pbkdf2_sha512",{enumerable:!0,get:function(){return C.pbkdf2_sha512}});var I=x(50824);Object.defineProperty(p,"sha256",{enumerable:!0,get:function(){return I.sha256}});var m=x(36125);Object.defineProperty(p,"sha512",{enumerable:!0,get:function(){return m.sha512}})},94817:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.getSecureRandomWords=p.getSecureRandomBytes=void 0;function T(I){return v.from(window.crypto.getRandomValues(new Uint8Array(I)))}p.getSecureRandomBytes=T;function C(I){return window.crypto.getRandomValues(new Uint16Array(I))}p.getSecureRandomWords=C},4777:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.hmac_sha512=void 0;async function T(C,I){let m=typeof C=="string"?v.from(C,"utf-8"):C,b=typeof I=="string"?v.from(I,"utf-8"):I;const g={name:"HMAC",hash:"SHA-512"},w=await window.crypto.subtle.importKey("raw",m,g,!1,["sign"]);return v.from(await crypto.subtle.sign(g,w,b))}p.hmac_sha512=T},78687:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.pbkdf2_sha512=void 0;async function T(C,I,m,b){const g=typeof C=="string"?v.from(C,"utf-8"):C,w=typeof I=="string"?v.from(I,"utf-8"):I,_=await window.crypto.subtle.importKey("raw",g,{name:"PBKDF2"},!1,["deriveBits"]),A=await window.crypto.subtle.deriveBits({name:"PBKDF2",hash:"SHA-512",salt:w,iterations:m},_,b*8);return v.from(A)}p.pbkdf2_sha512=T},50824:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.sha256=void 0;async function T(C){return typeof C=="string"?v.from(await crypto.subtle.digest("SHA-256",v.from(C,"utf-8"))):v.from(await crypto.subtle.digest("SHA-256",C))}p.sha256=T},36125:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.sha512=void 0;async function T(C){return typeof C=="string"?v.from(await crypto.subtle.digest("SHA-512",v.from(C,"utf-8"))):v.from(await crypto.subtle.digest("SHA-512",C))}p.sha512=T},94123:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.deriveEd25519Path=p.deriveED25519HardenedKey=p.getED25519MasterKeyFromSeed=void 0;const T=x(11258),C="ed25519 seed",I=2147483648;async function m(w){const _=await(0,T.hmac_sha512)(C,w),A=_.slice(0,32),S=_.slice(32);return{key:A,chainCode:S}}p.getED25519MasterKeyFromSeed=m;async function b(w,_){if(_>=I)throw Error("Key index must be less than offset");const A=v.alloc(4);A.writeUInt32BE(_+I,0);const S=v.concat([v.alloc(1,0),w.key,A]),k=await(0,T.hmac_sha512)(w.chainCode,S),B=k.slice(0,32),O=k.slice(32);return{key:B,chainCode:O}}p.deriveED25519HardenedKey=b;async function g(w,_){let A=await m(w),S=[..._];for(;S.length>0;){let k=S[0];S=S.slice(1),A=await b(A,k)}return A.key}p.deriveEd25519Path=g},36931:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.deriveMnemonicsPath=p.deriveMnemonicHardenedKey=p.getMnemonicsMasterKeyFromSeed=void 0;const T=x(32600),C=x(11258),I=2147483648,m="TON Mnemonics HD seed";async function b(_){const A=await(0,C.hmac_sha512)(m,_),S=A.slice(0,32),k=A.slice(32);return{key:S,chainCode:k}}p.getMnemonicsMasterKeyFromSeed=b;async function g(_,A){if(A>=I)throw Error("Key index must be less than offset");const S=v.alloc(4);S.writeUInt32BE(A+I,0);const k=v.concat([v.alloc(1,0),_.key,S]),B=await(0,C.hmac_sha512)(_.chainCode,k),O=B.slice(0,32),L=B.slice(32);return{key:O,chainCode:L}}p.deriveMnemonicHardenedKey=g;async function w(_,A,S=24,k){let B=await b(_),O=[...A];for(;O.length>0;){let L=O[0];O=O.slice(1),B=await g(B,L)}return await(0,T.mnemonicFromRandomSeed)(B.key,S,k)}p.deriveMnemonicsPath=w},30089:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.deriveSymmetricPath=p.deriveSymmetricHardenedKey=p.getSymmetricMasterKeyFromSeed=void 0;const T=x(11258),C="Symmetric key seed";async function I(g){const w=await(0,T.hmac_sha512)(C,g),_=w.slice(32),A=w.slice(0,32);return{key:_,chainCode:A}}p.getSymmetricMasterKeyFromSeed=I;async function m(g,w){const _=v.concat([v.alloc(1,0),v.from(w)]),A=await(0,T.hmac_sha512)(g.chainCode,_),S=A.slice(32),k=A.slice(0,32);return{key:S,chainCode:k}}p.deriveSymmetricHardenedKey=m;async function b(g,w){let _=await I(g),A=[...w];for(;A.length>0;){let S=A[0];A=A.slice(1),_=await m(_,S)}return _.key}p.deriveSymmetricPath=b},88473:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.getMnemonicsMasterKeyFromSeed=p.deriveMnemonicHardenedKey=p.deriveMnemonicsPath=p.deriveSymmetricPath=p.deriveSymmetricHardenedKey=p.getSymmetricMasterKeyFromSeed=p.deriveEd25519Path=p.deriveED25519HardenedKey=p.getED25519MasterKeyFromSeed=p.signVerify=p.sign=p.keyPairFromSecretKey=p.keyPairFromSeed=p.openBox=p.sealBox=p.mnemonicWordList=p.mnemonicToHDSeed=p.mnemonicToSeed=p.mnemonicToWalletKey=p.mnemonicToPrivateKey=p.mnemonicValidate=p.mnemonicNew=p.newSecurePassphrase=p.newSecureWords=p.getSecureRandomNumber=p.getSecureRandomWords=p.getSecureRandomBytes=p.hmac_sha512=p.pbkdf2_sha512=p.sha512_sync=p.sha512=p.sha256_sync=p.sha256=void 0;var v=x(80825);Object.defineProperty(p,"sha256",{enumerable:!0,get:function(){return v.sha256}}),Object.defineProperty(p,"sha256_sync",{enumerable:!0,get:function(){return v.sha256_sync}});var T=x(22332);Object.defineProperty(p,"sha512",{enumerable:!0,get:function(){return T.sha512}}),Object.defineProperty(p,"sha512_sync",{enumerable:!0,get:function(){return T.sha512_sync}});var C=x(17572);Object.defineProperty(p,"pbkdf2_sha512",{enumerable:!0,get:function(){return C.pbkdf2_sha512}});var I=x(11258);Object.defineProperty(p,"hmac_sha512",{enumerable:!0,get:function(){return I.hmac_sha512}});var m=x(66542);Object.defineProperty(p,"getSecureRandomBytes",{enumerable:!0,get:function(){return m.getSecureRandomBytes}}),Object.defineProperty(p,"getSecureRandomWords",{enumerable:!0,get:function(){return m.getSecureRandomWords}}),Object.defineProperty(p,"getSecureRandomNumber",{enumerable:!0,get:function(){return m.getSecureRandomNumber}});var b=x(71242);Object.defineProperty(p,"newSecureWords",{enumerable:!0,get:function(){return b.newSecureWords}});var g=x(52187);Object.defineProperty(p,"newSecurePassphrase",{enumerable:!0,get:function(){return g.newSecurePassphrase}});var w=x(32600);Object.defineProperty(p,"mnemonicNew",{enumerable:!0,get:function(){return w.mnemonicNew}}),Object.defineProperty(p,"mnemonicValidate",{enumerable:!0,get:function(){return w.mnemonicValidate}}),Object.defineProperty(p,"mnemonicToPrivateKey",{enumerable:!0,get:function(){return w.mnemonicToPrivateKey}}),Object.defineProperty(p,"mnemonicToWalletKey",{enumerable:!0,get:function(){return w.mnemonicToWalletKey}}),Object.defineProperty(p,"mnemonicToSeed",{enumerable:!0,get:function(){return w.mnemonicToSeed}}),Object.defineProperty(p,"mnemonicToHDSeed",{enumerable:!0,get:function(){return w.mnemonicToHDSeed}});var _=x(95648);Object.defineProperty(p,"mnemonicWordList",{enumerable:!0,get:function(){return _.wordlist}});var A=x(83704);Object.defineProperty(p,"sealBox",{enumerable:!0,get:function(){return A.sealBox}}),Object.defineProperty(p,"openBox",{enumerable:!0,get:function(){return A.openBox}});var S=x(83704);Object.defineProperty(p,"keyPairFromSeed",{enumerable:!0,get:function(){return S.keyPairFromSeed}}),Object.defineProperty(p,"keyPairFromSecretKey",{enumerable:!0,get:function(){return S.keyPairFromSecretKey}}),Object.defineProperty(p,"sign",{enumerable:!0,get:function(){return S.sign}}),Object.defineProperty(p,"signVerify",{enumerable:!0,get:function(){return S.signVerify}});var k=x(94123);Object.defineProperty(p,"getED25519MasterKeyFromSeed",{enumerable:!0,get:function(){return k.getED25519MasterKeyFromSeed}}),Object.defineProperty(p,"deriveED25519HardenedKey",{enumerable:!0,get:function(){return k.deriveED25519HardenedKey}}),Object.defineProperty(p,"deriveEd25519Path",{enumerable:!0,get:function(){return k.deriveEd25519Path}});var B=x(30089);Object.defineProperty(p,"getSymmetricMasterKeyFromSeed",{enumerable:!0,get:function(){return B.getSymmetricMasterKeyFromSeed}}),Object.defineProperty(p,"deriveSymmetricHardenedKey",{enumerable:!0,get:function(){return B.deriveSymmetricHardenedKey}}),Object.defineProperty(p,"deriveSymmetricPath",{enumerable:!0,get:function(){return B.deriveSymmetricPath}});var O=x(36931);Object.defineProperty(p,"deriveMnemonicsPath",{enumerable:!0,get:function(){return O.deriveMnemonicsPath}}),Object.defineProperty(p,"deriveMnemonicHardenedKey",{enumerable:!0,get:function(){return O.deriveMnemonicHardenedKey}}),Object.defineProperty(p,"getMnemonicsMasterKeyFromSeed",{enumerable:!0,get:function(){return O.getMnemonicsMasterKeyFromSeed}})},32600:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(we){return we&&we.__esModule?we:{default:we}};Object.defineProperty(p,"__esModule",{value:!0}),p.mnemonicFromRandomSeed=p.mnemonicIndexesToBytes=p.bytesToMnemonics=p.bytesToMnemonicIndexes=p.mnemonicNew=p.mnemonicValidate=p.mnemonicToHDSeed=p.mnemonicToWalletKey=p.mnemonicToPrivateKey=p.mnemonicToSeed=p.mnemonicToEntropy=void 0;const C=T(x(18861)),I=x(66542),m=x(11258),b=x(17572),g=x(17926),w=x(95648),_=1e5;async function A(we){const Ae=await O(we);return await B(Ae)&&!await k(Ae)}function S(we){return we.map(Ae=>Ae.toLowerCase().trim())}async function k(we){return(await(0,b.pbkdf2_sha512)(we,"TON seed version",Math.max(1,Math.floor(_/256)),64))[0]==0}async function B(we){return(await(0,b.pbkdf2_sha512)(we,"TON fast seed version",1,64))[0]==1}async function O(we,Ae){return await(0,m.hmac_sha512)(we.join(" "),Ae&&Ae.length>0?Ae:"")}p.mnemonicToEntropy=O;async function L(we,Ae,re){const N=await O(we,re);return await(0,b.pbkdf2_sha512)(N,Ae,_,64)}p.mnemonicToSeed=L;async function D(we,Ae){we=S(we);const re=await L(we,"TON default seed",Ae);let N=C.default.sign.keyPair.fromSeed(re.slice(0,32));return{publicKey:v.from(N.publicKey),secretKey:v.from(N.secretKey)}}p.mnemonicToPrivateKey=D;async function W(we,Ae){let N=(await D(we,Ae)).secretKey.slice(0,32);const z=C.default.sign.keyPair.fromSeed(N);return{publicKey:v.from(z.publicKey),secretKey:v.from(z.secretKey)}}p.mnemonicToWalletKey=W;async function H(we,Ae){return we=S(we),await L(we,"TON HD Keys seed",Ae)}p.mnemonicToHDSeed=H;async function G(we,Ae){we=S(we);for(let re of we)if(w.wordlist.indexOf(re)<0)return!1;return Ae&&Ae.length>0&&!await A(we)?!1:await k(await O(we,Ae))}p.mnemonicValidate=G;async function Z(we=24,Ae){let re=[];for(;;){re=[];for(let N=0;N<we;N++){let z=await(0,I.getSecureRandomNumber)(0,w.wordlist.length);re.push(w.wordlist[z])}if(!(Ae&&Ae.length>0&&!await A(re))&&await k(await O(re,Ae)))break}return re}p.mnemonicNew=Z;function Q(we,Ae){let re=(0,g.bytesToBits)(we),N=[];for(let z=0;z<Ae;z++){let V=re.slice(z*11,z*11+11);N.push(parseInt(V,2))}return N}p.bytesToMnemonicIndexes=Q;function ie(we,Ae){let re=Q(we,Ae),N=[];for(let z of re)N.push(w.wordlist[z]);return N}p.bytesToMnemonics=ie;function le(we){let Ae="";for(let re of we){if(!Number.isSafeInteger(re)||re<0||re>=2028)throw Error("Invalid input");Ae+=(0,g.lpad)(re.toString(2),"0",11)}for(;Ae.length%8!==0;)Ae=Ae+"0";return(0,g.bitsToBytes)(Ae)}p.mnemonicIndexesToBytes=le;async function be(we,Ae=24,re){const N=Math.ceil(Ae*11/8);let z=we;for(;;){let V=await(0,b.pbkdf2_sha512)(z,"TON mnemonic seed",Math.max(1,Math.floor(_/256)),N),U=ie(V,Ae);if(await G(U,re))return U;z=V}}p.mnemonicFromRandomSeed=be},95648:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.wordlist=void 0;const x=["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"];p.wordlist=x},52187:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.newSecurePassphrase=void 0;const v=x(88473);async function T(C=6){return(await(0,v.newSecureWords)(C)).join("-")}p.newSecurePassphrase=T},71242:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.newSecureWords=void 0;const v=x(66542),T=x(44398);async function C(I=6){let m=[];for(let b=0;b<I;b++)m.push(T.wordlist[await(0,v.getSecureRandomNumber)(0,T.wordlist.length)]);return m}p.newSecureWords=C},44398:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.wordlist=void 0,p.wordlist=["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","amigo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","coastline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dish","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","euphemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","giddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungrily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasses","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastrami","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","recycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","tingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unusable","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]},66542:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.getSecureRandomNumber=p.getSecureRandomWords=p.getSecureRandomBytes=void 0;const v=x(12080);async function T(m){return(0,v.getSecureRandomBytes)(m)}p.getSecureRandomBytes=T;async function C(m){return C(m)}p.getSecureRandomWords=C;async function I(m,b){let g=b-m;var w=Math.ceil(Math.log2(g));if(w>53)throw new Error("Range is too large");for(var _=Math.ceil(w/8),A=Math.pow(2,w)-1;;){let k=await T(w),B=(_-1)*8,O=0;for(var S=0;S<_;S++)O+=k[S]*Math.pow(2,B),B-=8;if(O=O&A,!(O>=g))return m+O}}p.getSecureRandomNumber=I},11258:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(p,"__esModule",{value:!0}),p.hmac_sha512=p.hmac_sha512_fallback=void 0;const C=T(x(77308)),I=x(12080);async function m(g,w){let _=typeof g=="string"?v.from(g,"utf-8"):g,A=typeof w=="string"?v.from(w,"utf-8"):w;const S=new C.default("SHA-512","HEX",{hmacKey:{value:_.toString("hex"),format:"HEX"}});S.update(A.toString("hex"));const k=S.getHash("HEX");return v.from(k,"hex")}p.hmac_sha512_fallback=m;function b(g,w){return(0,I.hmac_sha512)(g,w)}p.hmac_sha512=b},83704:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(p,"__esModule",{value:!0}),p.openBox=p.sealBox=p.signVerify=p.sign=p.keyPairFromSeed=p.keyPairFromSecretKey=void 0;const C=T(x(18861));function I(A){let S=C.default.sign.keyPair.fromSecretKey(new Uint8Array(A));return{publicKey:v.from(S.publicKey),secretKey:v.from(S.secretKey)}}p.keyPairFromSecretKey=I;function m(A){let S=C.default.sign.keyPair.fromSeed(new Uint8Array(A));return{publicKey:v.from(S.publicKey),secretKey:v.from(S.secretKey)}}p.keyPairFromSeed=m;function b(A,S){return v.from(C.default.sign.detached(new Uint8Array(A),new Uint8Array(S)))}p.sign=b;function g(A,S,k){return C.default.sign.detached.verify(new Uint8Array(A),new Uint8Array(S),new Uint8Array(k))}p.signVerify=g;function w(A,S,k){return v.from(C.default.secretbox(A,S,k))}p.sealBox=w;function _(A,S,k){let B=C.default.secretbox.open(A,S,k);return B?v.from(B):null}p.openBox=_},17572:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.pbkdf2_sha512=void 0;const v=x(12080);function T(C,I,m,b){return(0,v.pbkdf2_sha512)(C,I,m,b)}p.pbkdf2_sha512=T},80825:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(p,"__esModule",{value:!0}),p.sha256=p.sha256_fallback=p.sha256_sync=void 0;const C=T(x(77308)),I=x(12080);function m(w){let _;typeof w=="string"?_=v.from(w,"utf-8").toString("hex"):_=w.toString("hex");let A=new C.default("SHA-256","HEX");A.update(_);let S=A.getHash("HEX");return v.from(S,"hex")}p.sha256_sync=m;async function b(w){return m(w)}p.sha256_fallback=b;function g(w){return(0,I.sha256)(w)}p.sha256=g},22332:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(p,"__esModule",{value:!0}),p.sha512=p.sha512_fallback=p.sha512_sync=void 0;const C=T(x(77308)),I=x(12080);function m(w){let _;typeof w=="string"?_=v.from(w,"utf-8").toString("hex"):_=w.toString("hex");let A=new C.default("SHA-512","HEX");A.update(_);let S=A.getHash("HEX");return v.from(S,"hex")}p.sha512_sync=m;async function b(w){return m(w)}p.sha512_fallback=b;async function g(w){return(0,I.sha512)(w)}p.sha512=g},17926:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.bitsToBytes=p.bytesToBits=p.lpad=void 0;function T(m,b,g){for(;m.length<g;)m=b+m;return m}p.lpad=T;function C(m){let b="";for(let g=0;g<m.length;g++){let w=m.at(g);b+=T(w.toString(2),"0",8)}return b}p.bytesToBits=C;function I(m){if(m.length%8!==0)throw Error("Uneven bits");let b=[];for(;m.length>0;)b.push(parseInt(m.slice(0,8),2)),m=m.slice(8);return v.from(b)}p.bitsToBytes=I},37251:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.TonClient=void 0;const T=x(50146),C=x(99345);class I{constructor(A){this.parameters={endpoint:A.endpoint},this.api=new T.HttpApi(this.parameters.endpoint,{timeout:A.timeout,apiKey:A.apiKey,adapter:A.httpAdapter})}async getBalance(A){return(await this.getContractState(A)).balance}async runMethod(A,S,k=[]){let B=await this.api.callGetMethod(A,S,k);if(B.exit_code!==0)throw Error("Unable to execute get method. Got exit_code: "+B.exit_code);return{gas_used:B.gas_used,stack:g(B.stack)}}async callGetMethod(A,S,k=[]){return this.runMethod(A,S,k)}async runMethodWithError(A,S,k=[]){let B=await this.api.callGetMethod(A,S,k);return{gas_used:B.gas_used,stack:g(B.stack),exit_code:B.exit_code}}async callGetMethodWithError(A,S,k=[]){return this.runMethodWithError(A,S,k)}async getTransactions(A,S){let k=await this.api.getTransactions(A,S),B=[];for(let O of k)B.push((0,C.loadTransaction)(C.Cell.fromBoc(v.from(O.data,"base64"))[0].beginParse()));return B}async getTransaction(A,S,k){let B=await this.api.getTransaction(A,S,k);return B?(0,C.loadTransaction)(C.Cell.fromBoc(v.from(B.data,"base64"))[0].beginParse()):null}async tryLocateResultTx(A,S,k){let B=await this.api.tryLocateResultTx(A,S,k);return(0,C.loadTransaction)(C.Cell.fromBase64(B.data).beginParse())}async tryLocateSourceTx(A,S,k){let B=await this.api.tryLocateSourceTx(A,S,k);return(0,C.loadTransaction)(C.Cell.fromBase64(B.data).beginParse())}async getMasterchainInfo(){let A=await this.api.getMasterchainInfo();return{workchain:A.init.workchain,shard:A.last.shard,initSeqno:A.init.seqno,latestSeqno:A.last.seqno}}async getWorkchainShards(A){return(await this.api.getShards(A)).map(k=>({workchain:k.workchain,shard:k.shard,seqno:k.seqno}))}async getShardTransactions(A,S,k){let B=await this.api.getBlockTransactions(A,S,k);if(B.incomplete)throw Error("Unsupported");return B.transactions.map(O=>({account:C.Address.parseRaw(O.account),lt:O.lt,hash:O.hash}))}async sendMessage(A){const S=(0,C.beginCell)().store((0,C.storeMessage)(A)).endCell().toBoc();await this.api.sendBoc(S)}async sendFile(A){await this.api.sendBoc(A)}async estimateExternalMessageFee(A,S){return await this.api.estimateFee(A,{body:S.body,initCode:S.initCode,initData:S.initData,ignoreSignature:S.ignoreSignature})}async sendExternalMessage(A,S){if(await this.isContractDeployed(A.address)||!A.init){const k=(0,C.external)({to:A.address,body:S});await this.sendMessage(k)}else{const k=(0,C.external)({to:A.address,init:A.init,body:S});await this.sendMessage(k)}}async isContractDeployed(A){return(await this.getContractState(A)).state==="active"}async getContractState(A){let S=await this.api.getAddressInformation(A),k=BigInt(S.balance),B=S.state;return{balance:k,state:B,code:S.code!==""?v.from(S.code,"base64"):null,data:S.data!==""?v.from(S.data,"base64"):null,lastTransaction:S.last_transaction_id.lt!=="0"?{lt:S.last_transaction_id.lt,hash:S.last_transaction_id.hash}:null,blockId:{workchain:S.block_id.workchain,shard:S.block_id.shard,seqno:S.block_id.seqno},timestampt:S.sync_utime}}open(A){return(0,C.openContract)(A,S=>w(this,S.address,S.init))}provider(A,S){return w(this,A,S??null)}}p.TonClient=I;function m(_){const A=_["@type"];switch(A){case"tvm.list":case"tvm.tuple":return _.elements.map(m);case"tvm.cell":return C.Cell.fromBoc(v.from(_.bytes,"base64"))[0];case"tvm.slice":return C.Cell.fromBoc(v.from(_.bytes,"base64"))[0];case"tvm.stackEntryCell":return m(_.cell);case"tvm.stackEntrySlice":return m(_.slice);case"tvm.stackEntryTuple":return m(_.tuple);case"tvm.stackEntryList":return m(_.list);case"tvm.stackEntryNumber":return m(_.number);case"tvm.numberDecimal":return BigInt(_.number);default:throw Error("Unsupported item type: "+A)}}function b(_){if(_[0]==="num"){let A=_[1];return A.startsWith("-")?{type:"int",value:-BigInt(A.slice(1))}:{type:"int",value:BigInt(A)}}else{if(_[0]==="null")return{type:"null"};if(_[0]==="cell")return{type:"cell",cell:C.Cell.fromBoc(v.from(_[1].bytes,"base64"))[0]};if(_[0]==="slice")return{type:"slice",cell:C.Cell.fromBoc(v.from(_[1].bytes,"base64"))[0]};if(_[0]==="builder")return{type:"builder",cell:C.Cell.fromBoc(v.from(_[1].bytes,"base64"))[0]};if(_[0]==="tuple"||_[0]==="list")return _[1].elements.length===0?{type:"null"}:{type:"tuple",items:_[1].elements.map(m)};throw Error("Unsupported stack item type: "+_[0])}}function g(_){let A=[];for(let S of _)A.push(b(S));return new C.TupleReader(A)}function w(_,A,S){return{async getState(){let k=await _.getContractState(A),B=k.balance,O=k.lastTransaction?{lt:BigInt(k.lastTransaction.lt),hash:v.from(k.lastTransaction.hash,"base64")}:null,L;if(k.state==="active")L={type:"active",code:k.code?k.code:null,data:k.data?k.data:null};else if(k.state==="uninitialized")L={type:"uninit"};else if(k.state==="frozen")L={type:"frozen",stateHash:v.alloc(0)};else throw Error("Unsupported state");return{balance:B,last:O,state:L}},async get(k,B){return{stack:(await _.callGetMethod(A,k,B)).stack}},async external(k){let B=null;S&&!await _.isContractDeployed(A)&&(B=S);const O=(0,C.external)({to:A,init:B,body:k});let L=(0,C.beginCell)().store((0,C.storeMessage)(O)).endCell().toBoc();await _.sendFile(L)},async internal(k,B){let O=null;S&&!await _.isContractDeployed(A)&&(O=S);let L=!0;B.bounce!==null&&B.bounce!==void 0&&(L=B.bounce);let D;typeof B.value=="string"?D=(0,C.toNano)(B.value):D=B.value;let W=null;typeof B.body=="string"?W=(0,C.comment)(B.body):B.body&&(W=B.body),await k.send({to:A,value:D,bounce:L,sendMode:B.sendMode,init:O,body:W})},open(k){return(0,C.openContract)(k,B=>w(_,B.address,B.init??null))},getTransactions(k,B,O,L){return _.getTransactions(k,{limit:L??100,lt:B.toString(),hash:O.toString("base64"),inclusive:!0})}}}},53255:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__classPrivateFieldSet||function(de,Y,ce,he,Ie){if(he==="m")throw new TypeError("Private method is not writable");if(he==="a"&&!Ie)throw new TypeError("Private accessor was defined without a setter");if(typeof Y=="function"?de!==Y||!Ie:!Y.has(de))throw new TypeError("Cannot write private member to an object whose class did not declare it");return he==="a"?Ie.call(de,ce):Ie?Ie.value=ce:Y.set(de,ce),ce},C=this&&this.__classPrivateFieldGet||function(de,Y,ce,he){if(ce==="a"&&!he)throw new TypeError("Private accessor was defined without a getter");if(typeof Y=="function"?de!==Y||!he:!Y.has(de))throw new TypeError("Cannot read private member from an object whose class did not declare it");return ce==="m"?he:ce==="a"?he.call(de):he?he.value:Y.get(de)},I=this&&this.__importDefault||function(de){return de&&de.__esModule?de:{default:de}},m,b,g,w;Object.defineProperty(p,"__esModule",{value:!0}),p.TonClient4=void 0;const _=I(x(23966)),A=x(99345),S=x(44516),k=x(78211);class B{constructor(Y){m.set(this,void 0),b.set(this,void 0),g.set(this,void 0),w.set(this,void 0),T(this,w,_.default.create(),"f"),T(this,m,Y.endpoint,"f"),T(this,b,Y.timeout||5e3,"f"),T(this,g,Y.httpAdapter,"f"),Y.requestInterceptor&&C(this,w,"f").interceptors.request.use(Y.requestInterceptor)}async getLastBlock(){let Y=await C(this,w,"f").get(C(this,m,"f")+"/block/latest",{adapter:C(this,g,"f"),timeout:C(this,b,"f")}),ce=L.safeParse(Y.data);if(!ce.success)throw Error("Mailformed response: "+ce.error.format()._errors.join(", "));return ce.data}async getBlock(Y){let ce=await C(this,w,"f").get(C(this,m,"f")+"/block/"+Y,{adapter:C(this,g,"f"),timeout:C(this,b,"f")}),he=D.safeParse(ce.data);if(!he.success)throw Error("Mailformed response");if(!he.data.exist)throw Error("Block is out of scope");return he.data.block}async getBlockByUtime(Y){let ce=await C(this,w,"f").get(C(this,m,"f")+"/block/utime/"+Y,{adapter:C(this,g,"f"),timeout:C(this,b,"f")}),he=D.safeParse(ce.data);if(!he.success)throw Error("Mailformed response");if(!he.data.exist)throw Error("Block is out of scope");return he.data.block}async getAccount(Y,ce){let he=await C(this,w,"f").get(C(this,m,"f")+"/block/"+Y+"/"+ce.toString({urlSafe:!0}),{adapter:C(this,g,"f"),timeout:C(this,b,"f")}),Ie=H.safeParse(he.data);if(!Ie.success)throw Error("Mailformed response");return Ie.data}async getAccountLite(Y,ce){let he=await C(this,w,"f").get(C(this,m,"f")+"/block/"+Y+"/"+ce.toString({urlSafe:!0})+"/lite",{adapter:C(this,g,"f"),timeout:C(this,b,"f")}),Ie=G.safeParse(he.data);if(!Ie.success)throw Error("Mailformed response");return Ie.data}async isContractDeployed(Y,ce){return(await this.getAccountLite(Y,ce)).account.state.type==="active"}async isAccountChanged(Y,ce,he){let Ie=await C(this,w,"f").get(C(this,m,"f")+"/block/"+Y+"/"+ce.toString({urlSafe:!0})+"/changed/"+he.toString(10),{adapter:C(this,g,"f"),timeout:C(this,b,"f")}),ke=Z.safeParse(Ie.data);if(!ke.success)throw Error("Mailformed response");return ke.data}async getAccountTransactions(Y,ce,he){let Ie=await C(this,w,"f").get(C(this,m,"f")+"/account/"+Y.toString({urlSafe:!0})+"/tx/"+ce.toString(10)+"/"+(0,S.toUrlSafe)(he.toString("base64")),{adapter:C(this,g,"f"),timeout:C(this,b,"f")}),ke=we.safeParse(Ie.data);if(!ke.success)throw Error("Mailformed response");let ut=ke.data,Re=[],ze=A.Cell.fromBoc(v.from(ut.boc,"base64"));for(let _t=0;_t<ut.blocks.length;_t++)Re.push({block:ut.blocks[_t],tx:(0,A.loadTransaction)(ze[_t].beginParse())});return Re}async getAccountTransactionsParsed(Y,ce,he,Ie=20){let ke=await C(this,w,"f").get(C(this,m,"f")+"/account/"+Y.toString({urlSafe:!0})+"/tx/parsed/"+ce.toString(10)+"/"+(0,S.toUrlSafe)(he.toString("base64")),{adapter:C(this,g,"f"),timeout:C(this,b,"f"),params:{count:Ie}}),ut=X.safeParse(ke.data);if(!ut.success)throw Error("Mailformed response");return ut.data}async getConfig(Y,ce){let he="";ce&&ce.length>0&&(he="/"+[...ce].sort().join(","));let Ie=await C(this,w,"f").get(C(this,m,"f")+"/block/"+Y+"/config"+he,{adapter:C(this,g,"f"),timeout:C(this,b,"f")}),ke=ie.safeParse(Ie.data);if(!ke.success)throw Error("Mailformed response");return ke.data}async runMethod(Y,ce,he,Ie){let ke=Ie&&Ie.length>0?"/"+(0,S.toUrlSafe)((0,A.serializeTuple)(Ie).toBoc({idx:!1,crc32:!1}).toString("base64")):"",ut=C(this,m,"f")+"/block/"+Y+"/"+ce.toString({urlSafe:!0})+"/run/"+encodeURIComponent(he)+ke,Re=await C(this,w,"f").get(ut,{adapter:C(this,g,"f"),timeout:C(this,b,"f")}),ze=Q.safeParse(Re.data);if(!ze.success)throw Error("Mailformed response");let _t=ze.data.resultRaw?(0,A.parseTuple)(A.Cell.fromBoc(v.from(ze.data.resultRaw,"base64"))[0]):[];return{exitCode:ze.data.exitCode,result:_t,resultRaw:ze.data.resultRaw,block:ze.data.block,shardBlock:ze.data.shardBlock,reader:new A.TupleReader(_t)}}async sendMessage(Y){let ce=await C(this,w,"f").post(C(this,m,"f")+"/send",{boc:Y.toString("base64")},{adapter:C(this,g,"f"),timeout:C(this,b,"f")});if(!le.safeParse(ce.data).success)throw Error("Mailformed response");return{status:ce.data.status}}open(Y){return(0,A.openContract)(Y,ce=>O(this,null,ce.address,ce.init))}openAt(Y,ce){return(0,A.openContract)(ce,he=>O(this,Y,he.address,he.init))}provider(Y,ce){return O(this,null,Y,ce??null)}providerAt(Y,ce,he){return O(this,Y,ce,he??null)}}p.TonClient4=B,m=new WeakMap,b=new WeakMap,g=new WeakMap,w=new WeakMap;function O(de,Y,ce,he){return{async getState(){let Ie=Y;Ie===null&&(Ie=(await de.getLastBlock()).last.seqno);let ke=await de.getAccount(Ie,ce),ut=ke.account.last?{lt:BigInt(ke.account.last.lt),hash:v.from(ke.account.last.hash,"base64")}:null,Re;if(ke.account.state.type==="active")Re={type:"active",code:ke.account.state.code?v.from(ke.account.state.code,"base64"):null,data:ke.account.state.data?v.from(ke.account.state.data,"base64"):null};else if(ke.account.state.type==="uninit")Re={type:"uninit"};else if(ke.account.state.type==="frozen")Re={type:"frozen",stateHash:v.from(ke.account.state.stateHash,"base64")};else throw Error("Unsupported state");return{balance:BigInt(ke.account.balance.coins),last:ut,state:Re}},async get(Ie,ke){let ut=Y;ut===null&&(ut=(await de.getLastBlock()).last.seqno);let Re=await de.runMethod(ut,ce,Ie,ke);if(Re.exitCode!==0&&Re.exitCode!==1)throw Error("Exit code: "+Re.exitCode);return{stack:new A.TupleReader(Re.result)}},async external(Ie){let ke=await de.getLastBlock(),ut=null;he&&(await de.getAccountLite(ke.last.seqno,ce)).account.state.type!=="active"&&(ut=he);const Re=(0,A.external)({to:ce,init:ut,body:Ie});let ze=(0,A.beginCell)().store((0,A.storeMessage)(Re)).endCell().toBoc();await de.sendMessage(ze)},async internal(Ie,ke){let ut=await de.getLastBlock(),Re=null;he&&(await de.getAccountLite(ut.last.seqno,ce)).account.state.type!=="active"&&(Re=he);let ze=!0;ke.bounce!==null&&ke.bounce!==void 0&&(ze=ke.bounce);let _t;typeof ke.value=="string"?_t=(0,A.toNano)(ke.value):_t=ke.value;let Ct=null;typeof ke.body=="string"?Ct=(0,A.comment)(ke.body):ke.body&&(Ct=ke.body),await Ie.send({to:ce,value:_t,bounce:ze,sendMode:ke.sendMode,init:Re,body:Ct})},open(Ie){return(0,A.openContract)(Ie,ke=>O(de,Y,ke.address,ke.init??null))},async getTransactions(Ie,ke,ut,Re){const ze=typeof Re=="number";if(ze&&Re<=0)return[];let _t=[];do{const Ct=await de.getAccountTransactions(Ie,ke,ut),$t=Ct[0].tx,[ft,Xe]=[$t.lt,$t.hash()];if(_t.length>0&&ft===ke&&Xe.equals(ut)&&Ct.shift(),Ct.length===0)break;const wt=Ct[Ct.length-1].tx,[Rt,Ge]=[wt.lt,wt.hash()];if(Rt===ke&&Ge.equals(ut))break;_t.push(...Ct.map(zt=>zt.tx)),ke=Rt,ut=Ge}while(ze&&_t.length<Re);return ze&&(_t=_t.slice(0,Re)),_t}}}const L=k.z.object({last:k.z.object({seqno:k.z.number(),shard:k.z.string(),workchain:k.z.number(),fileHash:k.z.string(),rootHash:k.z.string()}),init:k.z.object({fileHash:k.z.string(),rootHash:k.z.string()}),stateRootHash:k.z.string(),now:k.z.number()}),D=k.z.union([k.z.object({exist:k.z.literal(!1)}),k.z.object({exist:k.z.literal(!0),block:k.z.object({shards:k.z.array(k.z.object({workchain:k.z.number(),seqno:k.z.number(),shard:k.z.string(),rootHash:k.z.string(),fileHash:k.z.string(),transactions:k.z.array(k.z.object({account:k.z.string(),hash:k.z.string(),lt:k.z.string()}))}))})})]),W=k.z.object({lastPaid:k.z.number(),duePayment:k.z.union([k.z.null(),k.z.string()]),used:k.z.object({bits:k.z.number(),cells:k.z.number(),publicCells:k.z.number()})}),H=k.z.object({account:k.z.object({state:k.z.union([k.z.object({type:k.z.literal("uninit")}),k.z.object({type:k.z.literal("active"),code:k.z.union([k.z.string(),k.z.null()]),data:k.z.union([k.z.string(),k.z.null()])}),k.z.object({type:k.z.literal("frozen"),stateHash:k.z.string()})]),balance:k.z.object({coins:k.z.string()}),last:k.z.union([k.z.null(),k.z.object({lt:k.z.string(),hash:k.z.string()})]),storageStat:k.z.union([k.z.null(),W])}),block:k.z.object({workchain:k.z.number(),seqno:k.z.number(),shard:k.z.string(),rootHash:k.z.string(),fileHash:k.z.string()})}),G=k.z.object({account:k.z.object({state:k.z.union([k.z.object({type:k.z.literal("uninit")}),k.z.object({type:k.z.literal("active"),codeHash:k.z.string(),dataHash:k.z.string()}),k.z.object({type:k.z.literal("frozen"),stateHash:k.z.string()})]),balance:k.z.object({coins:k.z.string()}),last:k.z.union([k.z.null(),k.z.object({lt:k.z.string(),hash:k.z.string()})]),storageStat:k.z.union([k.z.null(),W])})}),Z=k.z.object({changed:k.z.boolean(),block:k.z.object({workchain:k.z.number(),seqno:k.z.number(),shard:k.z.string(),rootHash:k.z.string(),fileHash:k.z.string()})}),Q=k.z.object({exitCode:k.z.number(),resultRaw:k.z.union([k.z.string(),k.z.null()]),block:k.z.object({workchain:k.z.number(),seqno:k.z.number(),shard:k.z.string(),rootHash:k.z.string(),fileHash:k.z.string()}),shardBlock:k.z.object({workchain:k.z.number(),seqno:k.z.number(),shard:k.z.string(),rootHash:k.z.string(),fileHash:k.z.string()})}),ie=k.z.object({config:k.z.object({cell:k.z.string(),address:k.z.string(),globalBalance:k.z.object({coins:k.z.string()})})}),le=k.z.object({status:k.z.number()}),be=k.z.array(k.z.object({workchain:k.z.number(),seqno:k.z.number(),shard:k.z.string(),rootHash:k.z.string(),fileHash:k.z.string()})),we=k.z.object({blocks:be,boc:k.z.string()}),Ae=k.z.object({bits:k.z.number(),data:k.z.string()}),re=k.z.union([k.z.object({type:k.z.literal("internal"),value:k.z.string(),dest:k.z.string(),src:k.z.string(),bounced:k.z.boolean(),bounce:k.z.boolean(),ihrDisabled:k.z.boolean(),createdAt:k.z.number(),createdLt:k.z.string(),fwdFee:k.z.string(),ihrFee:k.z.string()}),k.z.object({type:k.z.literal("external-in"),dest:k.z.string(),src:k.z.union([Ae,k.z.null()]),importFee:k.z.string()}),k.z.object({type:k.z.literal("external-out"),dest:k.z.union([Ae,k.z.null()])})]),N=k.z.object({splitDepth:k.z.union([k.z.number(),k.z.null()]),code:k.z.union([k.z.string(),k.z.null()]),data:k.z.union([k.z.string(),k.z.null()]),special:k.z.union([k.z.object({tick:k.z.boolean(),tock:k.z.boolean()}),k.z.null()])}),z=k.z.object({body:k.z.string(),info:re,init:k.z.union([N,k.z.null()])}),V=k.z.union([k.z.literal("uninitialized"),k.z.literal("frozen"),k.z.literal("active"),k.z.literal("non-existing")]),U=k.z.union([k.z.object({type:k.z.literal("comment"),comment:k.z.string()}),k.z.object({type:k.z.literal("payload"),cell:k.z.string()})]),j=k.z.union([k.z.object({kind:k.z.literal("ton"),amount:k.z.string()}),k.z.object({kind:k.z.literal("token"),amount:k.z.string()})]),$=k.z.union([k.z.literal("jetton::excesses"),k.z.literal("jetton::transfer"),k.z.literal("jetton::transfer_notification"),k.z.literal("deposit"),k.z.literal("deposit::ok"),k.z.literal("withdraw"),k.z.literal("withdraw::all"),k.z.literal("withdraw::delayed"),k.z.literal("withdraw::ok"),k.z.literal("airdrop")]),ee=k.z.object({type:$,options:k.z.optional(k.z.record(k.z.string()))}),J=k.z.object({address:k.z.string(),comment:k.z.optional(k.z.string()),items:k.z.array(j),op:k.z.optional(ee)}),F=k.z.object({address:k.z.string(),lt:k.z.string(),hash:k.z.string(),prevTransaction:k.z.object({lt:k.z.string(),hash:k.z.string()}),time:k.z.number(),outMessagesCount:k.z.number(),oldStatus:V,newStatus:V,fees:k.z.string(),update:k.z.object({oldHash:k.z.string(),newHash:k.z.string()}),inMessage:k.z.union([z,k.z.null()]),outMessages:k.z.array(z),parsed:k.z.object({seqno:k.z.union([k.z.number(),k.z.null()]),body:k.z.union([U,k.z.null()]),status:k.z.union([k.z.literal("success"),k.z.literal("failed"),k.z.literal("pending")]),dest:k.z.union([k.z.string(),k.z.null()]),kind:k.z.union([k.z.literal("out"),k.z.literal("in")]),amount:k.z.string(),resolvedAddress:k.z.string(),bounced:k.z.boolean(),mentioned:k.z.array(k.z.string())}),operation:J}),X=k.z.object({blocks:be,transactions:k.z.array(F)})},50146:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(be){return be&&be.__esModule?be:{default:be}};Object.defineProperty(p,"__esModule",{value:!0}),p.HttpApi=void 0;const C=x(36797),I=T(x(20136)),m=T(x(23966)),b=x(78211),g=x(74553).rE,w=b.z.object({"@type":b.z.literal("ton.blockIdExt"),workchain:b.z.number(),shard:b.z.string(),seqno:b.z.number(),root_hash:b.z.string(),file_hash:b.z.string()}),_=b.z.object({balance:b.z.union([b.z.number(),b.z.string()]),state:b.z.union([b.z.literal("active"),b.z.literal("uninitialized"),b.z.literal("frozen")]),data:b.z.string(),code:b.z.string(),last_transaction_id:b.z.object({"@type":b.z.literal("internal.transactionId"),lt:b.z.string(),hash:b.z.string()}),block_id:w,sync_utime:b.z.number()}),A=b.z.object({"@type":b.z.literal("ok")}),S=b.z.object({"@type":b.z.literal("query.fees"),source_fees:b.z.object({"@type":b.z.literal("fees"),in_fwd_fee:b.z.number(),storage_fee:b.z.number(),gas_fee:b.z.number(),fwd_fee:b.z.number()})}),k=b.z.object({gas_used:b.z.number(),exit_code:b.z.number(),stack:b.z.array(b.z.unknown())}),B=b.z.union([b.z.object({"@type":b.z.literal("msg.dataRaw"),body:b.z.string()}),b.z.object({"@type":b.z.literal("msg.dataText"),text:b.z.string()}),b.z.object({"@type":b.z.literal("msg.dataDecryptedText"),text:b.z.string()}),b.z.object({"@type":b.z.literal("msg.dataEncryptedText"),text:b.z.string()})]),O=b.z.object({source:b.z.string(),destination:b.z.string(),value:b.z.string(),fwd_fee:b.z.string(),ihr_fee:b.z.string(),created_lt:b.z.string(),body_hash:b.z.string(),msg_data:B,message:b.z.string().optional()}),L=b.z.object({data:b.z.string(),utime:b.z.number(),transaction_id:b.z.object({lt:b.z.string(),hash:b.z.string()}),fee:b.z.string(),storage_fee:b.z.string(),other_fee:b.z.string(),in_msg:b.z.union([b.z.undefined(),O]),out_msgs:b.z.array(O)}),D=b.z.array(L),W=b.z.object({state_root_hash:b.z.string(),last:w,init:w}),H=b.z.object({shards:b.z.array(w)}),G=b.z.object({"@type":b.z.literal("blocks.shortTxId"),mode:b.z.number(),account:b.z.string(),lt:b.z.string(),hash:b.z.string()}),Z=b.z.object({id:w,req_count:b.z.number(),incomplete:b.z.boolean(),transactions:b.z.array(G)});class Q{constructor(we,Ae,re,N){this.namespace=we,this.cache=Ae,this.codec=re,this.keyEncoder=N}async get(we){let Ae=await this.cache.get(this.namespace,this.keyEncoder(we));if(Ae){let re=this.codec.safeParse(JSON.parse(Ae));if(re.success)return re.data}return null}async set(we,Ae){Ae!==null?await this.cache.set(this.namespace,this.keyEncoder(we),JSON.stringify(Ae)):await this.cache.set(this.namespace,this.keyEncoder(we),null)}}class ie{constructor(we,Ae){this.endpoint=we,this.cache=new C.InMemoryCache,this.parameters={timeout:Ae?.timeout||3e4,apiKey:Ae?.apiKey,adapter:Ae?.adapter},this.shardCache=new Q("ton-shard",this.cache,b.z.array(w),re=>re+""),this.shardLoader=new I.default(async re=>await Promise.all(re.map(async N=>{const z=await this.shardCache.get(N);if(z)return z;let V=(await this.doCall("shards",{seqno:N},H)).shards;return await this.shardCache.set(N,V),V}))),this.shardTransactionsCache=new Q("ton-shard-tx",this.cache,Z,re=>re.workchain+":"+re.shard+":"+re.seqno),this.shardTransactionsLoader=new I.default(async re=>await Promise.all(re.map(async N=>{const z=await this.shardTransactionsCache.get(N);if(z)return z;let V=await this.doCall("getBlockTransactions",{workchain:N.workchain,seqno:N.seqno,shard:N.shard},Z);return await this.shardTransactionsCache.set(N,V),V})),{cacheKeyFn:re=>re.workchain+":"+re.shard+":"+re.seqno})}getAddressInformation(we){return this.doCall("getAddressInformation",{address:we.toString()},_)}async getTransactions(we,Ae){const re=Ae.inclusive;delete Ae.inclusive;let N;Ae.hash&&(N=v.from(Ae.hash,"base64").toString("hex"));let z=Ae.limit;Ae.hash&&Ae.lt&&re!==!0&&z++;let V=await this.doCall("getTransactions",{address:we.toString(),...Ae,limit:z,hash:N},D);return V.length>z&&(V=V.slice(0,z)),Ae.hash&&Ae.lt&&re!==!0&&V.shift(),V}async getMasterchainInfo(){return await this.doCall("getMasterchainInfo",{},W)}async getShards(we){return await this.shardLoader.load(we)}async getBlockTransactions(we,Ae,re){return await this.shardTransactionsLoader.load({workchain:we,seqno:Ae,shard:re})}async getTransaction(we,Ae,re){let N=v.from(re,"base64").toString("hex"),V=(await this.doCall("getTransactions",{address:we.toString(),lt:Ae,hash:N,limit:1},D)).find(U=>U.transaction_id.lt===Ae&&U.transaction_id.hash===re);return V||null}async callGetMethod(we,Ae,re){return await this.doCall("runGetMethod",{address:we.toString(),method:Ae,stack:le(re)},k)}async sendBoc(we){await this.doCall("sendBoc",{boc:we.toString("base64")},A)}async estimateFee(we,Ae){return await this.doCall("estimateFee",{address:we.toString(),body:Ae.body.toBoc().toString("base64"),init_data:Ae.initData?Ae.initData.toBoc().toString("base64"):"",init_code:Ae.initCode?Ae.initCode.toBoc().toString("base64"):"",ignore_chksig:Ae.ignoreSignature},S)}async tryLocateResultTx(we,Ae,re){return await this.doCall("tryLocateResultTx",{source:we.toString(),destination:Ae.toString(),created_lt:re},L)}async tryLocateSourceTx(we,Ae,re){return await this.doCall("tryLocateSourceTx",{source:we.toString(),destination:Ae.toString(),created_lt:re},L)}async doCall(we,Ae,re){let N={"Content-Type":"application/json","X-Ton-Client-Version":g};this.parameters.apiKey&&(N["X-API-Key"]=this.parameters.apiKey);let z=await m.default.post(this.endpoint,JSON.stringify({id:"1",jsonrpc:"2.0",method:we,params:Ae}),{headers:N,timeout:this.parameters.timeout,adapter:this.parameters.adapter});if(z.status!==200||!z.data.ok)throw Error("Received error: "+JSON.stringify(z.data));let V=re.safeParse(z.data.result);if(V.success)return V.data;throw Error("Malformed response: "+V.error.format()._errors.join(", "))}}p.HttpApi=ie;function le(be){let we=[];for(let Ae of be)if(Ae.type==="int")we.push(["num",Ae.value.toString()]);else if(Ae.type==="cell")we.push(["tvm.Cell",Ae.cell.toBoc().toString("base64")]);else if(Ae.type==="slice")we.push(["tvm.Slice",Ae.cell.toBoc().toString("base64")]);else if(Ae.type==="builder")we.push(["tvm.Builder",Ae.cell.toBoc().toString("base64")]);else throw Error("Unsupported stack item type: "+Ae.type);return we}},36797:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.InMemoryCache=void 0;class x{constructor(){this.cache=new Map,this.set=async(T,C,I)=>{I!==null?this.cache.set(T+"$$"+C,I):this.cache.delete(T+"$$"+C)},this.get=async(T,C)=>{let I=this.cache.get(T+"$$"+C);return I!==void 0?I:null}}}p.InMemoryCache=x},19707:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.parseFullConfig=p.loadConfigParamsAsSlice=p.loadConfigParamById=p.parseVotingSetup=p.parseProposalSetup=p.configParse29=p.configParse28=p.configParseMsgPrices=p.configParseGasLimitsPrices=p.configParseBridge=p.configParseValidatorSet=p.configParse12=p.configParseWorkchainDescriptor=p.configParse40=p.configParse8=p.configParse18=p.configParse17=p.configParse16=p.configParse15=p.configParse13=p.configParse5=p.configParseMasterAddressRequired=p.parseBridge=p.parseValidatorSet=p.configParseMasterAddress=void 0;const v=x(99345);function T($){return $?new v.Address(-1,$.loadBuffer(32)):null}p.configParseMasterAddress=T;function C($){if($.loadUint(32)!==2390828938)throw Error("Invalid config");return $.loadBuffer(32)}const I={serialize($,ee){throw Error("not implemented")},parse($){const ee=$.loadUint(8);if(ee===83)return{publicKey:C($),weight:$.loadUintBig(64),adnlAddress:null};if(ee===115)return{publicKey:C($),weight:$.loadUintBig(64),adnlAddress:$.loadBuffer(32)};throw Error("Invalid config")}};function m($){const ee=$.loadUint(8);if(ee===17){const J=$.loadUint(32),F=$.loadUint(32),X=$.loadUint(16),de=$.loadUint(16),Y=$.loadDictDirect(v.Dictionary.Keys.Uint(16),I);return{timeSince:J,timeUntil:F,total:X,main:de,totalWeight:null,list:Y}}else if(ee===18){const J=$.loadUint(32),F=$.loadUint(32),X=$.loadUint(16),de=$.loadUint(16),Y=$.loadUintBig(64),ce=$.loadDict(v.Dictionary.Keys.Uint(16),I);return{timeSince:J,timeUntil:F,total:X,main:de,totalWeight:Y,list:ce}}}p.parseValidatorSet=m;function b($){const ee=new v.Address(-1,$.loadBuffer(32)),J=new v.Address(-1,$.loadBuffer(32)),F=$.loadDict(v.Dictionary.Keys.Buffer(32),v.Dictionary.Values.Buffer(32)),X=new Map;for(const[Y,ce]of F)X.set(new v.Address(-1,Y).toString(),ce);const de=$.loadBuffer(32);return{bridgeAddress:ee,oracleMultisigAddress:J,oracles:X,externalChainAddress:de}}p.parseBridge=b;function g($){if(!$)throw Error("Invalid config");return T($)}p.configParseMasterAddressRequired=g;function w($){if(!$)throw Error("Invalid config");if($.loadUint(8)===1){const J=$.loadBit()?new v.Address(-1,$.loadBuffer(32)):null,F=$.loadUint(32),X=$.loadUint(32);return{blackholeAddr:J,feeBurnNominator:F,feeBurnDenominator:X}}throw new Error("Invalid config")}p.configParse5=w;function _($){if(!$)throw Error("Invalid config");if($.loadUint(8)===26){const J=$.loadCoins(),F=$.loadCoins(),X=$.loadCoins();return{deposit:J,bitPrice:F,cellPrice:X}}throw new Error("Invalid config")}p.configParse13=_;function A($){if(!$)throw Error("Invalid config");const ee=$.loadUint(32),J=$.loadUint(32),F=$.loadUint(32),X=$.loadUint(32);return{validatorsElectedFor:ee,electorsStartBefore:J,electorsEndBefore:F,stakeHeldFor:X}}p.configParse15=A;function S($){if(!$)throw Error("Invalid config");const ee=$.loadUint(16),J=$.loadUint(16),F=$.loadUint(16);return{maxValidators:ee,maxMainValidators:J,minValidators:F}}p.configParse16=S;function k($){if(!$)throw Error("Invalid config");const ee=$.loadCoins(),J=$.loadCoins(),F=$.loadCoins(),X=$.loadUint(32);return{minStake:ee,maxStake:J,minTotalStake:F,maxStakeFactor:X}}p.configParse17=k;const B={serialize($,ee){throw Error("not implemented")},parse($){if($.loadUint(8)!==204)throw Error("Invalid config");const J=$.loadUint(32),F=$.loadUintBig(64),X=$.loadUintBig(64),de=$.loadUintBig(64),Y=$.loadUintBig(64);return{utime_since:J,bit_price_ps:F,cell_price_ps:X,mc_bit_price_ps:de,mc_cell_price_ps:Y}}};function O($){if(!$)throw Error("Invalid config");return $.loadDictDirect(v.Dictionary.Keys.Buffer(4),B).values()}p.configParse18=O;function L($){if(!$)return{version:0,capabilities:0n};const ee=$.loadUint(32),J=$.loadUintBig(64);return{version:ee,capabilities:J}}p.configParse8=L;function D($){if(!$)return null;if($.loadUint(8)!==1)throw Error("Invalid config");const J=$.loadCoins(),F=$.loadCoins(),X=$.loadUint(16),de=$.loadUint(16),Y=$.loadUint(16),ce=$.loadUint(16),he=$.loadUint(16),Ie=$.loadUint(16),ke=$.loadUint(16),ut=$.loadUint(16),Re=$.loadUint(16);return{defaultFlatFine:J,defaultProportionaFine:F,severityFlatMult:X,severityProportionalMult:de,unfunishableInterval:Y,longInterval:ce,longFlatMult:he,longProportionalMult:Ie,mediumInterval:ke,mediumFlatMult:ut,mediumProportionalMult:Re}}p.configParse40=D;function W($){if($.loadUint(8)!==166)throw Error("Invalid config");const ee=$.loadUint(32),J=$.loadUint(8),F=$.loadUint(8),X=$.loadUint(8),de=$.loadBit(),Y=$.loadBit(),ce=$.loadBit(),he=$.loadUint(13),Ie=$.loadBuffer(32),ke=$.loadBuffer(32),ut=$.loadUint(32);if($.loadBit())throw Error("Invalid config");const Re=$.loadUint(32),ze=$.loadUintBig(64);return{enabledSince:ee,actialMinSplit:J,min_split:F,max_split:X,basic:de,active:Y,accept_msgs:ce,flags:he,zerostateRootHash:Ie,zerostateFileHash:ke,version:ut,format:{vmVersion:Re,vmMode:ze}}}p.configParseWorkchainDescriptor=W;const H={serialize($,ee){throw Error("not implemented")},parse($){if($.loadUint(8)!==166)throw Error("Invalid config");const ee=$.loadUint(32),J=$.loadUint(8),F=$.loadUint(8),X=$.loadUint(8),de=$.loadBit(),Y=$.loadBit(),ce=$.loadBit(),he=$.loadUint(13),Ie=$.loadBuffer(32),ke=$.loadBuffer(32),ut=$.loadUint(32);if($.loadBit())throw Error("Invalid config");const Re=$.loadUint(32),ze=$.loadUintBig(64);return{enabledSince:ee,actialMinSplit:J,min_split:F,max_split:X,basic:de,active:Y,accept_msgs:ce,flags:he,zerostateRootHash:Ie,zerostateFileHash:ke,version:ut,format:{vmVersion:Re,vmMode:ze}}}};function G($){if(!$)throw Error("Invalid config");const ee=$.loadDict(v.Dictionary.Keys.Uint(32),H);if(ee)return ee;throw Error("No workchains exist")}p.configParse12=G;function Z($){return $?m($):null}p.configParseValidatorSet=Z;function Q($){return $?b($):null}p.configParseBridge=Q;function ie($){const ee=$.loadUint(8);if(ee===222){const J=$.loadUintBig(64),F=$.loadUintBig(64),X=$.loadUintBig(64),de=$.loadUintBig(64),Y=$.loadUintBig(64),ce=$.loadUintBig(64),he=$.loadUintBig(64);return{gasPrice:J,gasLimit:F,specialGasLimit:X,gasCredit:de,blockGasLimit:Y,freezeDueLimit:ce,deleteDueLimit:he}}else if(ee===221){const J=$.loadUintBig(64),F=$.loadUintBig(64),X=$.loadUintBig(64),de=$.loadUintBig(64),Y=$.loadUintBig(64),ce=$.loadUintBig(64);return{gasPrice:J,gasLimit:F,gasCredit:X,blockGasLimit:de,freezeDueLimit:Y,deleteDueLimit:ce}}else throw Error("Invalid config")}function le($){if(!$)throw Error("Invalid config");if($.loadUint(8)===209){const J=$.loadUintBig(64),F=$.loadUintBig(64),X=ie($);return{flatLimit:J,flatGasPrice:F,other:X}}else throw Error("Invalid config")}p.configParseGasLimitsPrices=le;function be($){if(!$)throw new Error("Invalid config");if($.loadUint(8)!==234)throw new Error("Invalid msg prices param");return{lumpPrice:$.loadUintBig(64),bitPrice:$.loadUintBig(64),cellPrice:$.loadUintBig(64),ihrPriceFactor:$.loadUint(32),firstFrac:$.loadUint(16),nextFrac:$.loadUint(16)}}p.configParseMsgPrices=be;function we($){if(!$)throw new Error("Invalid config");const ee=$.loadUint(8);if(ee===193){const J=$.loadUint(32),F=$.loadUint(32),X=$.loadUint(32),de=$.loadUint(32);return{masterCatchainLifetime:J,shardCatchainLifetime:F,shardValidatorsLifetime:X,shardValidatorsCount:de}}if(ee===194){const J=$.loadUint(7),F=$.loadBit(),X=$.loadUint(32),de=$.loadUint(32),Y=$.loadUint(32),ce=$.loadUint(32);return{flags:J,suffleMasterValidators:F,masterCatchainLifetime:X,shardCatchainLifetime:de,shardValidatorsLifetime:Y,shardValidatorsCount:ce}}throw new Error("Invalid config")}p.configParse28=we;function Ae($){if(!$)throw new Error("Invalid config");const ee=$.loadUint(8);if(ee===214){const J=$.loadUint(32),F=$.loadUint(32),X=$.loadUint(32),de=$.loadUint(32),Y=$.loadUint(32),ce=$.loadUint(32),he=$.loadUint(32),Ie=$.loadUint(32);return{roundCandidates:J,nextCandidateDelay:F,consensusTimeout:X,fastAttempts:de,attemptDuration:Y,catchainMaxDeps:ce,maxBlockBytes:he,maxColaltedBytes:Ie}}else if(ee===215){const J=$.loadUint(7),F=$.loadBit(),X=$.loadUint(8),de=$.loadUint(32),Y=$.loadUint(32),ce=$.loadUint(32),he=$.loadUint(32),Ie=$.loadUint(32),ke=$.loadUint(32),ut=$.loadUint(32);return{flags:J,newCatchainIds:F,roundCandidates:X,nextCandidateDelay:de,consensusTimeout:Y,fastAttempts:ce,attemptDuration:he,catchainMaxDeps:Ie,maxBlockBytes:ke,maxColaltedBytes:ut}}else if(ee===216){const J=$.loadUint(7),F=$.loadBit(),X=$.loadUint(8),de=$.loadUint(32),Y=$.loadUint(32),ce=$.loadUint(32),he=$.loadUint(32),Ie=$.loadUint(32),ke=$.loadUint(32),ut=$.loadUint(32),Re=$.loadUint(16);return{flags:J,newCatchainIds:F,roundCandidates:X,nextCandidateDelay:de,consensusTimeout:Y,fastAttempts:ce,attemptDuration:he,catchainMaxDeps:Ie,maxBlockBytes:ke,maxColaltedBytes:ut,protoVersion:Re}}else if(ee===217){const J=$.loadUint(7),F=$.loadBit(),X=$.loadUint(8),de=$.loadUint(32),Y=$.loadUint(32),ce=$.loadUint(32),he=$.loadUint(32),Ie=$.loadUint(32),ke=$.loadUint(32),ut=$.loadUint(32),Re=$.loadUint(16),ze=$.loadUint(32);return{flags:J,newCatchainIds:F,roundCandidates:X,nextCandidateDelay:de,consensusTimeout:Y,fastAttempts:ce,attemptDuration:he,catchainMaxDeps:Ie,maxBlockBytes:ke,maxColaltedBytes:ut,protoVersion:Re,catchainMaxBlocksCoeff:ze}}throw new Error("Invalid config")}p.configParse29=Ae;function re($){if($.loadUint(8)!==54)throw new Error("Invalid config");const J=$.loadUint(8),F=$.loadUint(8),X=$.loadUint(8),de=$.loadUint(8),Y=$.loadUint(32),ce=$.loadUint(32),he=$.loadUint(32),Ie=$.loadUint(32);return{minTotalRounds:J,maxTotalRounds:F,minWins:X,maxLoses:de,minStoreSec:Y,maxStoreSec:ce,bitPrice:he,cellPrice:Ie}}p.parseProposalSetup=re;function N($){if(!$)throw new Error("Invalid config");if($.loadUint(8)!==145)throw new Error("Invalid config");const J=re($.loadRef().beginParse()),F=re($.loadRef().beginParse());return{normalParams:J,criticalParams:F}}p.parseVotingSetup=N;function z($){return v.Cell.fromBase64($).beginParse().loadDictDirect(v.Dictionary.Keys.Int(32),v.Dictionary.Values.Cell())}function V($,ee){return z($).get(ee)}p.loadConfigParamById=V;function U($){const ee=z($),J=new Map;for(const[F,X]of ee)J.set(F,X.beginParse());return J}p.loadConfigParamsAsSlice=U;function j($){return{configAddress:g($.get(0)),electorAddress:g($.get(1)),minterAddress:T($.get(2)),feeCollectorAddress:T($.get(3)),dnsRootAddress:T($.get(4)),burningConfig:w($.get(5)),globalVersion:L($.get(8)),workchains:G($.get(12)),voting:N($.get(11)),validators:{...A($.get(15)),...S($.get(16)),...k($.get(17))},storagePrices:O($.get(18)),gasPrices:{masterchain:le($.get(20)),workchain:le($.get(21))},msgPrices:{masterchain:be($.get(24)),workchain:be($.get(25))},validatorSets:{prevValidators:Z($.get(32)),prevTempValidators:Z($.get(33)),currentValidators:Z($.get(34)),currentTempValidators:Z($.get(35)),nextValidators:Z($.get(36)),nextTempValidators:Z($.get(37))},validatorsPunish:D($.get(40)),bridges:{ethereum:Q($.get(71)),binance:Q($.get(72)),polygon:Q($.get(73))},catchain:we($.get(28)),consensus:Ae($.get(29))}}p.parseFullConfig=j},1312:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.ElectorContract=void 0;const T=x(99345),C={serialize(b,g){throw Error("not implemented")},parse(b){const g=new T.Address(-1,b.loadBuffer(32)),w=b.loadUintBig(64),_=b.loadCoins();return{address:g,weight:w,stake:_}}},I={serialize(b,g){throw Error("not implemented")},parse(b){const g=b.loadCoins();b.skip(64);const w=new T.Address(-1,b.loadBuffer(32)),_=b.loadBuffer(32);return{stake:g,address:w,adnl:_}}};class m{static create(){return new m}constructor(){this.address=T.Address.parseRaw("-1:3333333333333333333333333333333333333333333333333333333333333333")}async getReturnedStake(g,w){if(w.workChain!==-1)throw Error("Only masterchain addresses could have stake");return(await g.get("compute_returned_stake",[{type:"int",value:BigInt("0x"+w.hash.toString("hex"))}])).stack.readBigNumber()}async getPastElectionsList(g){const w=await g.get("past_elections_list",[]),_=new T.TupleReader(w.stack.readLispList()),A=[];for(;_.remaining>0;){const S=_.readTuple(),k=S.readNumber(),B=S.readNumber();S.pop();const O=S.readNumber();A.push({id:k,unfreezeAt:B,stakeHeld:O})}return A}async getPastElections(g){const w=await g.get("past_elections",[]),_=new T.TupleReader(w.stack.readLispList()),A=[];for(;_.remaining>0;){const S=_.readTuple(),k=S.readNumber(),B=S.readNumber(),O=S.readNumber();S.pop();const L=S.readCell(),D=S.readBigNumber(),W=S.readBigNumber();let H=new Map;const G=L.beginParse().loadDictDirect(T.Dictionary.Keys.Buffer(32),C);for(const[Z,Q]of G)H.set(BigInt("0x"+Z.toString("hex")).toString(10),{address:Q.address,weight:Q.weight,stake:Q.stake});A.push({id:k,unfreezeAt:B,stakeHeld:O,totalStake:D,bonuses:W,frozen:H})}return A}async getElectionEntities(g){const w=await g.getState();if(w.state.type!=="active")throw Error("Unexpected error");const A=T.Cell.fromBoc(w.state.data)[0].beginParse();if(!A.loadBit())return null;const S=A.loadRef().beginParse(),k=S.loadUint(32),B=S.loadUint(32),O=S.loadCoins(),L=S.loadCoins(),D=S.loadDict(T.Dictionary.Keys.Buffer(32),I);let W=[];if(D)for(const[H,G]of D)W.push({pubkey:H,stake:G.stake,address:G.address,adnl:G.adnl});return{minStake:O,allStakes:L,endElectionsTime:B,startWorkTime:k,entities:W}}async getActiveElectionId(g){const _=(await g.get("active_election_id",[])).stack.readNumber();return _>0?_:null}async getComplaints(g,w){const _=new T.TupleBuilder;_.writeNumber(w);const A=await g.get("list_complaints",_.build());if(A.stack.peek().type==="null")return[];const S=new T.TupleReader(A.stack.readLispList()),k=[];for(;S.remaining>0;){const B=S.readTuple(),O=B.readBigNumber(),L=B.readTuple(),D=L.readTuple(),W=v.from(D.readBigNumber().toString(16),"hex"),H=D.readCell(),G=D.readNumber(),Z=D.readNumber(),Q=new T.Address(-1,v.from(D.readBigNumber().toString(16),"hex")),ie=D.readBigNumber(),le=D.readBigNumber(),be=D.readBigNumber(),we=[],Ae=new T.TupleReader(L.readLispList());for(;Ae.remaining>0;)we.push(Ae.readNumber());const re=L.readBigNumber(),N=L.readBigNumber();k.push({id:O,publicKey:W,createdAt:G,severity:Z,paid:ie,suggestedFine:le,suggestedFinePart:be,rewardAddress:Q,votes:we,remainingWeight:N,vsetId:re})}return k}}p.ElectorContract=m},67641:function(fe,p,x){"use strict";var v=this&&this.__createBinding||(Object.create?function(be,we,Ae,re){re===void 0&&(re=Ae);var N=Object.getOwnPropertyDescriptor(we,Ae);(!N||("get"in N?!we.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return we[Ae]}}),Object.defineProperty(be,re,N)}:function(be,we,Ae,re){re===void 0&&(re=Ae),be[re]=we[Ae]}),T=this&&this.__exportStar||function(be,we){for(var Ae in be)Ae!=="default"&&!Object.prototype.hasOwnProperty.call(we,Ae)&&v(we,be,Ae)};Object.defineProperty(p,"__esModule",{value:!0}),p.computeStorageFees=p.computeMessageForwardFees=p.computeGasPrices=p.computeFwdFees=p.computeExternalMessageFees=p.loadConfigParamsAsSlice=p.loadConfigParamById=p.parseFullConfig=p.parseVotingSetup=p.parseValidatorSet=p.parseProposalSetup=p.parseBridge=p.configParseWorkchainDescriptor=p.configParseValidatorSet=p.configParseMsgPrices=p.configParseMasterAddressRequired=p.configParseMasterAddress=p.configParseGasLimitsPrices=p.configParseBridge=p.configParse40=p.configParse29=p.configParse28=p.configParse18=p.configParse17=p.configParse16=p.configParse15=p.configParse13=p.configParse12=p.configParse8=p.configParse5=p.ElectorContract=p.MultisigWallet=p.MultisigOrderBuilder=p.MultisigOrder=p.JettonWallet=p.JettonMaster=p.WalletContractV5R1=p.WalletContractV5Beta=p.WalletContractV4=p.WalletContractV3R2=p.WalletContractV3R1=p.WalletContractV2R2=p.WalletContractV2R1=p.WalletContractV1R3=p.WalletContractV1R2=p.WalletContractV1R1=p.TonClient4=p.TonClient=p.HttpApi=void 0,T(x(99345),p);var C=x(50146);Object.defineProperty(p,"HttpApi",{enumerable:!0,get:function(){return C.HttpApi}});var I=x(37251);Object.defineProperty(p,"TonClient",{enumerable:!0,get:function(){return I.TonClient}});var m=x(53255);Object.defineProperty(p,"TonClient4",{enumerable:!0,get:function(){return m.TonClient4}});var b=x(36241);Object.defineProperty(p,"WalletContractV1R1",{enumerable:!0,get:function(){return b.WalletContractV1R1}});var g=x(21912);Object.defineProperty(p,"WalletContractV1R2",{enumerable:!0,get:function(){return g.WalletContractV1R2}});var w=x(65839);Object.defineProperty(p,"WalletContractV1R3",{enumerable:!0,get:function(){return w.WalletContractV1R3}});var _=x(6740);Object.defineProperty(p,"WalletContractV2R1",{enumerable:!0,get:function(){return _.WalletContractV2R1}});var A=x(34941);Object.defineProperty(p,"WalletContractV2R2",{enumerable:!0,get:function(){return A.WalletContractV2R2}});var S=x(24751);Object.defineProperty(p,"WalletContractV3R1",{enumerable:!0,get:function(){return S.WalletContractV3R1}});var k=x(34210);Object.defineProperty(p,"WalletContractV3R2",{enumerable:!0,get:function(){return k.WalletContractV3R2}});var B=x(55403);Object.defineProperty(p,"WalletContractV4",{enumerable:!0,get:function(){return B.WalletContractV4}});var O=x(57054);Object.defineProperty(p,"WalletContractV5Beta",{enumerable:!0,get:function(){return O.WalletContractV5Beta}});var L=x(26253);Object.defineProperty(p,"WalletContractV5R1",{enumerable:!0,get:function(){return L.WalletContractV5R1}});var D=x(58406);Object.defineProperty(p,"JettonMaster",{enumerable:!0,get:function(){return D.JettonMaster}});var W=x(97997);Object.defineProperty(p,"JettonWallet",{enumerable:!0,get:function(){return W.JettonWallet}});var H=x(69138);Object.defineProperty(p,"MultisigOrder",{enumerable:!0,get:function(){return H.MultisigOrder}});var G=x(3643);Object.defineProperty(p,"MultisigOrderBuilder",{enumerable:!0,get:function(){return G.MultisigOrderBuilder}});var Z=x(33869);Object.defineProperty(p,"MultisigWallet",{enumerable:!0,get:function(){return Z.MultisigWallet}});var Q=x(1312);Object.defineProperty(p,"ElectorContract",{enumerable:!0,get:function(){return Q.ElectorContract}});var ie=x(19707);Object.defineProperty(p,"configParse5",{enumerable:!0,get:function(){return ie.configParse5}}),Object.defineProperty(p,"configParse8",{enumerable:!0,get:function(){return ie.configParse8}}),Object.defineProperty(p,"configParse12",{enumerable:!0,get:function(){return ie.configParse12}}),Object.defineProperty(p,"configParse13",{enumerable:!0,get:function(){return ie.configParse13}}),Object.defineProperty(p,"configParse15",{enumerable:!0,get:function(){return ie.configParse15}}),Object.defineProperty(p,"configParse16",{enumerable:!0,get:function(){return ie.configParse16}}),Object.defineProperty(p,"configParse17",{enumerable:!0,get:function(){return ie.configParse17}}),Object.defineProperty(p,"configParse18",{enumerable:!0,get:function(){return ie.configParse18}}),Object.defineProperty(p,"configParse28",{enumerable:!0,get:function(){return ie.configParse28}}),Object.defineProperty(p,"configParse29",{enumerable:!0,get:function(){return ie.configParse29}}),Object.defineProperty(p,"configParse40",{enumerable:!0,get:function(){return ie.configParse40}}),Object.defineProperty(p,"configParseBridge",{enumerable:!0,get:function(){return ie.configParseBridge}}),Object.defineProperty(p,"configParseGasLimitsPrices",{enumerable:!0,get:function(){return ie.configParseGasLimitsPrices}}),Object.defineProperty(p,"configParseMasterAddress",{enumerable:!0,get:function(){return ie.configParseMasterAddress}}),Object.defineProperty(p,"configParseMasterAddressRequired",{enumerable:!0,get:function(){return ie.configParseMasterAddressRequired}}),Object.defineProperty(p,"configParseMsgPrices",{enumerable:!0,get:function(){return ie.configParseMsgPrices}}),Object.defineProperty(p,"configParseValidatorSet",{enumerable:!0,get:function(){return ie.configParseValidatorSet}}),Object.defineProperty(p,"configParseWorkchainDescriptor",{enumerable:!0,get:function(){return ie.configParseWorkchainDescriptor}}),Object.defineProperty(p,"parseBridge",{enumerable:!0,get:function(){return ie.parseBridge}}),Object.defineProperty(p,"parseProposalSetup",{enumerable:!0,get:function(){return ie.parseProposalSetup}}),Object.defineProperty(p,"parseValidatorSet",{enumerable:!0,get:function(){return ie.parseValidatorSet}}),Object.defineProperty(p,"parseVotingSetup",{enumerable:!0,get:function(){return ie.parseVotingSetup}}),Object.defineProperty(p,"parseFullConfig",{enumerable:!0,get:function(){return ie.parseFullConfig}}),Object.defineProperty(p,"loadConfigParamById",{enumerable:!0,get:function(){return ie.loadConfigParamById}}),Object.defineProperty(p,"loadConfigParamsAsSlice",{enumerable:!0,get:function(){return ie.loadConfigParamsAsSlice}});var le=x(63522);Object.defineProperty(p,"computeExternalMessageFees",{enumerable:!0,get:function(){return le.computeExternalMessageFees}}),Object.defineProperty(p,"computeFwdFees",{enumerable:!0,get:function(){return le.computeFwdFees}}),Object.defineProperty(p,"computeGasPrices",{enumerable:!0,get:function(){return le.computeGasPrices}}),Object.defineProperty(p,"computeMessageForwardFees",{enumerable:!0,get:function(){return le.computeMessageForwardFees}}),Object.defineProperty(p,"computeStorageFees",{enumerable:!0,get:function(){return le.computeStorageFees}})},58406:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.JettonMaster=void 0;const v=x(99345);class T{static create(I){return new T(I)}constructor(I){this.address=I}async getWalletAddress(I,m){return(await I.get("get_wallet_address",[{type:"slice",cell:(0,v.beginCell)().storeAddress(m).endCell()}])).stack.readAddress()}async getJettonData(I){let m=await I.get("get_jetton_data",[]),b=m.stack.readBigNumber(),g=m.stack.readBoolean(),w=m.stack.readAddress(),_=m.stack.readCell(),A=m.stack.readCell();return{totalSupply:b,mintable:g,adminAddress:w,content:_,walletCode:A}}}p.JettonMaster=T},97997:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.JettonWallet=void 0;class x{static create(T){return new x(T)}constructor(T){this.address=T}async getBalance(T){return(await T.getState()).state.type!=="active"?0n:(await T.get("get_wallet_data",[])).stack.readBigNumber()}}p.JettonWallet=x},69138:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.MultisigOrder=void 0;const v=x(88473),T=x(99345);class C{constructor(m){this.signatures={},this.payload=m}static fromCell(m){let b=m.beginParse(),g=b.loadMaybeRef()?.beginParse();const w=b.asCell();let _=new C(w);if(g){for(;g.remainingBits>0;){const A=g.loadBuffer(64),S=g.loadUint(8);_.signatures[S]=A,g.remainingRefs>0?g=g.loadRef().asSlice():g.skip(1)}g.endParse()}return _}static fromPayload(m){return new C(m)}addSignature(m,b,g){const w=this.payload.hash();if(!(0,v.signVerify)(w,b,g.owners.get(m).slice(0,-1)))throw Error("invalid signature");this.signatures[m]=b}sign(m,b){const g=this.payload.hash();return this.signatures[m]=(0,v.sign)(g,b),g}unionSignatures(m){this.signatures=Object.assign({},this.signatures,m.signatures)}clearSignatures(){this.signatures={}}toCell(m){let b=(0,T.beginCell)().storeBit(0);for(const g in this.signatures){const w=this.signatures[g];b=(0,T.beginCell)().storeBit(1).storeRef((0,T.beginCell)().storeBuffer(w).storeUint(parseInt(g),8).storeBuilder(b).endCell())}return(0,T.beginCell)().storeUint(m,8).storeBuilder(b).storeBuilder(this.payload.asBuilder()).endCell()}}p.MultisigOrder=C},3643:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.MultisigOrderBuilder=void 0;const v=x(99345),T=x(69138);class C{constructor(m,b){this.messages=(0,v.beginCell)(),this.queryId=0n,this.walletId=m,this.queryOffset=b||7200}addMessage(m,b){if(this.messages.refs>=4)throw Error("only 4 refs are allowed");this.updateQueryId(),this.messages.storeUint(b,8),this.messages.storeRef((0,v.beginCell)().store((0,v.storeMessageRelaxed)(m)).endCell())}clearMessages(){this.messages=(0,v.beginCell)()}build(){return T.MultisigOrder.fromPayload((0,v.beginCell)().storeUint(this.walletId,32).storeUint(this.queryId,64).storeBuilder(this.messages).endCell())}updateQueryId(){const m=BigInt(Math.floor(Date.now()/1e3+this.queryOffset));this.queryId=m<<32n}}p.MultisigOrderBuilder=C},33869:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.MultisigWallet=void 0;const T=x(88473),C=x(99345),I=C.Cell.fromBase64("te6ccgECKwEABBgAART/APSkE/S88sgLAQIBIAIDAgFIBAUE2vIgxwCOgzDbPOCDCNcYIPkBAdMH2zwiwAAToVNxePQOb6Hyn9s8VBq6+RDyoAb0BCD5AQHTH1EYuvKq0z9wUwHwCgHCCAGDCryx8mhTFYBA9A5voSCYDqQgwgryZw7f+COqH1NAufJhVCOjU04gIyEiAgLMBgcCASAMDQIBIAgJAgFmCgsAA9GEAiPymAvHoHN9CYbZ5S7Z4BPHohwhJQAtAKkItdJEqCTItdKlwLUAdAT8ArobBKAATwhbpEx4CBukTDgAdAg10rDAJrUAvALyFjPFszJ4HHXI8gBzxb0AMmACASAODwIBIBQVARW77ZbVA0cFUg2zyCoCAUgQEQIBIBITAXOxHXQgwjXGCD5AQHTB4IB1MTtQ9hTIHj0Dm+h8p/XC/9eMfkQ8qCuAfQEIW6TW3Ey4PkBWNs8AaQBgJwA9rtqA6ADoAPoCAXoCEfyAgPyA3XlP+AXkegAA54tkwAAXrhlXP8EA1WZ2oexAAgEgFhcCASAYGQFRtyVbZ4YmRmpGEAgegc30McJNhFpAADMaYeYuAFrgJhwLb+4cC3d0bhAjAYm1WZtnhqvgb+2xxsoicAgej430pBHEoFpAADHDhBACGuQkuuBk9kUWE5kAOeLKhACQCB6IYFImHFImHFImXEA2YlzNijAjAgEgGhsAF7UGtc4QQDVZnah7EAIBIBwdAgOZOB4fARGsGm2eL4G2CUAjABWt+UEAzJV2oewYQAENqTbPBVfBYCMAFa3f3CCAarM7UPYgAiDbPALyZfgAUENxQxPbPO1UIyoACtP/0wcwBKDbPC+uUyCw8mISsQKkJbNTHLmwJYEA4aojoCi8sPJpggGGoPgBBZcCERACPj4wjo0REB/bPEDXePRDEL0F4lQWW1Rz51YQU9zbPFRxClR6vCQlKCYAIO1E0NMf0wfTB9M/9AT0BNEAXgGOGjDSAAHyo9MH0wdQA9cBIPkBBfkBFbrypFAD4GwhIddKqgIi10m68qtwVCATAAwByMv/ywcE1ts87VT4D3AlblOJvrGYEG4QLVDHXwePGzBUJANQTds8UFWgRlAQSRA6SwlTuds8UFQWf+L4AAeDJaGOLCaAQPSWb6UglDBTA7neII4WODk5CNIAAZfTBzAW8AcFkTDifwgHBZJsMeKz5jAGKicoKQBgcI4pA9CDCNcY0wf0BDBTFnj0Dm+h8qXXC/9URUT5EPKmrlIgsVIDvRShI27mbCIyAH5SML6OIF8D+ACTItdKmALTB9QC+wAC6DJwyMoAQBSAQPRDAvAHjhdxyMsAFMsHEssHWM8BWM8WQBOAQPRDAeIBII6KEEUQNEMA2zztVJJfBuIqABzIyx/LB8sHyz/0APQAyQ==");class m{constructor(g,w,_,A,S){this.provider=null,this.owners=C.Dictionary.empty(),this.workchain=w,this.walletId=_,this.k=A;for(let k=0;k<g.length;k+=1)this.owners.set(k,v.concat([g[k],v.alloc(1)]));this.init={code:I,data:(0,C.beginCell)().storeUint(this.walletId,32).storeUint(this.owners.size,8).storeUint(this.k,8).storeUint(0,64).storeDict(this.owners,C.Dictionary.Keys.Uint(8),C.Dictionary.Values.Buffer(33)).storeBit(0).endCell()},this.address=S?.address||(0,C.contractAddress)(w,this.init),S?.provider?this.provider=S.provider:S?.client&&(this.provider=S.client.provider(this.address,{code:this.init.code,data:this.init.data}))}static async fromAddress(g,w){let _;if(w.provider)_=w.provider;else{if(!w.client)throw Error("Either provider or client must be specified");_=w.client.provider(g,{code:null,data:null})}const A=(await _.getState()).state;if(A.type!=="active")throw Error("Contract must be active");const S=C.Cell.fromBoc(A.data)[0].beginParse(),k=S.loadUint(32);S.skip(8);const B=S.loadUint(8);S.skip(64);const O=S.loadDict(C.Dictionary.Keys.Uint(8),C.Dictionary.Values.Buffer(33));let L=[];for(const[D,W]of O){const H=W.subarray(0,32);L.push(H)}return new m(L,g.workChain,k,B,{address:g,provider:_,client:w.client})}async deployExternal(g){if(!g&&!this.provider)throw Error("you must specify provider if there is no such property in MultisigWallet instance");g||(g=this.provider),await g.external(C.Cell.EMPTY)}async deployInternal(g,w=1000000000n){await g.send({sendMode:C.SendMode.PAY_GAS_SEPARATELY+C.SendMode.IGNORE_ERRORS,to:this.address,value:w,init:this.init,body:C.Cell.EMPTY,bounce:!0})}async sendOrder(g,w,_){if(!_&&!this.provider)throw Error("you must specify provider if there is no such property in MultisigWallet instance");_||(_=this.provider);let A=(0,T.keyPairFromSecretKey)(w).publicKey,S=this.getOwnerIdByPubkey(A),k=g.toCell(S),B=(0,T.sign)(k.hash(),w);k=(0,C.beginCell)().storeBuffer(B).storeSlice(k.asSlice()).endCell(),await _.external(k)}async sendOrderWithoutSecretKey(g,w,_,A){if(!A&&!this.provider)throw Error("you must specify provider if there is no such property in MultisigWallet instance");A||(A=this.provider);let S=g.toCell(_);S=(0,C.beginCell)().storeBuffer(w).storeSlice(S.asSlice()).endCell(),await A.external(S)}getOwnerIdByPubkey(g){for(const[w,_]of this.owners)if(_.subarray(0,32).equals(g))return w;throw Error("public key is not an owner")}}p.MultisigWallet=m},63522:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.computeMessageForwardFees=p.computeExternalMessageFees=p.computeGasPrices=p.computeFwdFees=p.computeStorageFees=void 0;const v=x(99345);function T(_){const{lastPaid:A,now:S,storagePrices:k,storageStat:B,special:O,masterchain:L}=_;if(S<=A||k.length===0||S<k[0].utime_since||O)return BigInt(0);let D=Math.max(A,k[0].utime_since),W=BigInt(0);for(let H=0;H<k.length&&D<S;H++){let G=H<k.length-1?Math.min(S,k[H+1].utime_since):S,Z=BigInt(0);if(D<G){let Q=G-D;Z+=BigInt(B.cells)*(L?k[H].mc_cell_price_ps:k[H].cell_price_ps),Z+=BigInt(B.bits)*(L?k[H].mc_bit_price_ps:k[H].bit_price_ps),Z=Z*BigInt(Q)}D=G,W+=Z}return w(W)}p.computeStorageFees=T;function C(_,A,S){return _.lumpPrice+w(_.bitPrice*S+_.cellPrice*A)}p.computeFwdFees=C;function I(_,A){return _<=A.flatLimit?A.flatPrice:A.flatPrice+(A.price*(_-A.flatLimit)>>16n)}p.computeGasPrices=I;function m(_,A){let S=g(A);return S.bits-=A.bits.length,S.cells-=1,C(_,BigInt(S.cells),BigInt(S.bits))}p.computeExternalMessageFees=m;function b(_,A){let S=(0,v.loadMessageRelaxed)(A.beginParse()),k={bits:0,cells:0};if(S.init){const W=new v.Cell().asBuilder();(0,v.storeStateInit)(S.init)(W);const H=W.endCell();let G=g(H);G.bits-=H.bits.length,G.cells-=1,k.bits+=G.bits,k.cells+=G.cells}let B=g(S.body);B.bits-=S.body.bits.length,B.cells-=1,k.bits+=B.bits,k.cells+=B.cells;let O=C(_,BigInt(k.cells),BigInt(k.bits)),L=O*BigInt(_.firstFrac)>>16n,D=O-L;return{fees:L,remaining:D}}p.computeMessageForwardFees=b;function g(_){let A=_.bits.length,S=1;for(let k of _.refs){let B=g(k);S+=B.cells,A+=B.bits}return{bits:A,cells:S}}function w(_){let A=_%65536n,S=_>>16n;return A!==0n&&(S+=1n),S}},44516:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.toUrlSafe=void 0;function x(v){for(;v.indexOf("/")>=0;)v=v.replace("/","_");for(;v.indexOf("+")>=0;)v=v.replace("+","-");for(;v.indexOf("=")>=0;)v=v.replace("=","");return v}p.toUrlSafe=x},36241:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.WalletContractV1R1=void 0;const T=x(99345),C=x(89368);class I{static create(b){return new I(b.workchain,b.publicKey)}constructor(b,g){this.workchain=b,this.publicKey=g;let w=T.Cell.fromBoc(v.from("te6cckEBAQEARAAAhP8AIN2k8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVEH98Ik=","base64"))[0],_=(0,T.beginCell)().storeUint(0,32).storeBuffer(g).endCell();this.init={code:w,data:_},this.address=(0,T.contractAddress)(b,{code:w,data:_})}async getBalance(b){return(await b.getState()).balance}async getSeqno(b){let g=await b.getState();return g.state.type==="active"?T.Cell.fromBoc(g.state.data)[0].beginParse().loadUint(32):0}async send(b,g){await b.external(g)}async sendTransfer(b,g){let w=this.createTransfer(g);await this.send(b,w)}createTransfer(b){let g=T.SendMode.PAY_GAS_SEPARATELY;return b.sendMode!==null&&b.sendMode!==void 0&&(g=b.sendMode),(0,C.createWalletTransferV1)({seqno:b.seqno,sendMode:g,secretKey:b.secretKey,message:b.message})}sender(b,g){return{send:async w=>{let _=await this.getSeqno(b),A=this.createTransfer({seqno:_,secretKey:g,sendMode:w.sendMode,message:(0,T.internal)({to:w.to,value:w.value,init:w.init,body:w.body,bounce:w.bounce})});await this.send(b,A)}}}}p.WalletContractV1R1=I},21912:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.WalletContractV1R2=void 0;const T=x(99345),C=x(89368);class I{static create(b){return new I(b.workchain,b.publicKey)}constructor(b,g){this.workchain=b,this.publicKey=g;let w=T.Cell.fromBoc(v.from("te6cckEBAQEAUwAAov8AIN0gggFMl7qXMO1E0NcLH+Ck8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVNDieG8=","base64"))[0],_=(0,T.beginCell)().storeUint(0,32).storeBuffer(g).endCell();this.init={code:w,data:_},this.address=(0,T.contractAddress)(b,{code:w,data:_})}async getBalance(b){return(await b.getState()).balance}async getSeqno(b){return(await b.getState()).state.type==="active"?(await b.get("seqno",[])).stack.readNumber():0}async send(b,g){await b.external(g)}async sendTransfer(b,g){let w=this.createTransfer(g);await this.send(b,w)}createTransfer(b){let g=T.SendMode.PAY_GAS_SEPARATELY;return b.sendMode!==null&&b.sendMode!==void 0&&(g=b.sendMode),(0,C.createWalletTransferV1)({seqno:b.seqno,sendMode:g,secretKey:b.secretKey,message:b.message})}sender(b,g){return{send:async w=>{let _=await this.getSeqno(b),A=this.createTransfer({seqno:_,secretKey:g,sendMode:w.sendMode,message:(0,T.internal)({to:w.to,value:w.value,init:w.init,body:w.body,bounce:w.bounce})});await this.send(b,A)}}}}p.WalletContractV1R2=I},65839:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.WalletContractV1R3=void 0;const T=x(99345),C=x(89368);class I{static create(b){return new I(b.workchain,b.publicKey)}constructor(b,g){this.workchain=b,this.publicKey=g;let w=T.Cell.fromBoc(v.from("te6cckEBAQEAXwAAuv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVLW4bkI=","base64"))[0],_=(0,T.beginCell)().storeUint(0,32).storeBuffer(g).endCell();this.init={code:w,data:_},this.address=(0,T.contractAddress)(b,{code:w,data:_})}async getBalance(b){return(await b.getState()).balance}async getSeqno(b){return(await b.getState()).state.type==="active"?(await b.get("seqno",[])).stack.readNumber():0}async send(b,g){await b.external(g)}async sendTransfer(b,g){let w=this.createTransfer(g);await this.send(b,w)}createTransfer(b){let g=T.SendMode.PAY_GAS_SEPARATELY;return b.sendMode!==null&&b.sendMode!==void 0&&(g=b.sendMode),(0,C.createWalletTransferV1)({seqno:b.seqno,sendMode:g,secretKey:b.secretKey,message:b.message})}sender(b,g){return{send:async w=>{let _=await this.getSeqno(b),A=this.createTransfer({seqno:_,secretKey:g,sendMode:w.sendMode,message:(0,T.internal)({to:w.to,value:w.value,init:w.init,body:w.body,bounce:w.bounce})});await this.send(b,A)}}}}p.WalletContractV1R3=I},6740:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.WalletContractV2R1=void 0;const T=x(99345),C=x(89368);class I{static create(b){return new I(b.workchain,b.publicKey)}constructor(b,g){this.workchain=b,this.publicKey=g;let w=T.Cell.fromBoc(v.from("te6cckEBAQEAVwAAqv8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VShNwu2","base64"))[0],_=(0,T.beginCell)().storeUint(0,32).storeBuffer(g).endCell();this.init={code:w,data:_},this.address=(0,T.contractAddress)(b,{code:w,data:_})}async getBalance(b){return(await b.getState()).balance}async getSeqno(b){return(await b.getState()).state.type==="active"?(await b.get("seqno",[])).stack.readNumber():0}async send(b,g){await b.external(g)}async sendTransfer(b,g){let w=this.createTransfer(g);await this.send(b,w)}createTransfer(b){let g=T.SendMode.PAY_GAS_SEPARATELY;return b.sendMode!==null&&b.sendMode!==void 0&&(g=b.sendMode),(0,C.createWalletTransferV2)({seqno:b.seqno,sendMode:g,secretKey:b.secretKey,messages:b.messages,timeout:b.timeout})}sender(b,g){return{send:async w=>{let _=await this.getSeqno(b),A=this.createTransfer({seqno:_,secretKey:g,sendMode:w.sendMode,messages:[(0,T.internal)({to:w.to,value:w.value,init:w.init,body:w.body,bounce:w.bounce})]});await this.send(b,A)}}}}p.WalletContractV2R1=I},34941:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.WalletContractV2R2=void 0;const T=x(99345),C=x(89368);class I{static create(b){return new I(b.workchain,b.publicKey)}constructor(b,g){this.workchain=b,this.publicKey=g;let w=T.Cell.fromBoc(v.from("te6cckEBAQEAYwAAwv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VQETNeh","base64"))[0],_=(0,T.beginCell)().storeUint(0,32).storeBuffer(g).endCell();this.init={code:w,data:_},this.address=(0,T.contractAddress)(b,{code:w,data:_})}async getBalance(b){return(await b.getState()).balance}async getSeqno(b){return(await b.getState()).state.type==="active"?(await b.get("seqno",[])).stack.readNumber():0}async send(b,g){await b.external(g)}async sendTransfer(b,g){let w=this.createTransfer(g);await this.send(b,w)}createTransfer(b){let g=T.SendMode.PAY_GAS_SEPARATELY;return b.sendMode!==null&&b.sendMode!==void 0&&(g=b.sendMode),(0,C.createWalletTransferV2)({seqno:b.seqno,sendMode:g,secretKey:b.secretKey,messages:b.messages,timeout:b.timeout})}sender(b,g){return{send:async w=>{let _=await this.getSeqno(b),A=this.createTransfer({seqno:_,secretKey:g,sendMode:w.sendMode,messages:[(0,T.internal)({to:w.to,value:w.value,init:w.init,body:w.body,bounce:w.bounce})]});await this.send(b,A)}}}}p.WalletContractV2R2=I},24751:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.WalletContractV3R1=void 0;const T=x(99345),C=x(89368);class I{static create(b){return new I(b.workchain,b.publicKey,b.walletId)}constructor(b,g,w){this.workchain=b,this.publicKey=g,w!=null?this.walletId=w:this.walletId=698983191+b;let _=T.Cell.fromBoc(v.from("te6cckEBAQEAYgAAwP8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVD++buA=","base64"))[0],A=(0,T.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(g).endCell();this.init={code:_,data:A},this.address=(0,T.contractAddress)(b,{code:_,data:A})}async getBalance(b){return(await b.getState()).balance}async getSeqno(b){return(await b.getState()).state.type==="active"?(await b.get("seqno",[])).stack.readNumber():0}async send(b,g){await b.external(g)}async sendTransfer(b,g){let w=this.createTransfer(g);await this.send(b,w)}createTransfer(b){return(0,C.createWalletTransferV3)({...b,sendMode:b.sendMode??T.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(b,g){return{send:async w=>{let _=await this.getSeqno(b),A=this.createTransfer({seqno:_,secretKey:g,sendMode:w.sendMode,messages:[(0,T.internal)({to:w.to,value:w.value,init:w.init,body:w.body,bounce:w.bounce})]});await this.send(b,A)}}}}p.WalletContractV3R1=I},34210:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.WalletContractV3R2=void 0;const T=x(99345),C=x(89368);class I{static create(b){return new I(b.workchain,b.publicKey,b.walletId)}constructor(b,g,w){this.workchain=b,this.publicKey=g,w!=null?this.walletId=w:this.walletId=698983191+b;let _=T.Cell.fromBoc(v.from("te6cckEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVBC9ba0=","base64"))[0],A=(0,T.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(g).endCell();this.init={code:_,data:A},this.address=(0,T.contractAddress)(b,{code:_,data:A})}async getBalance(b){return(await b.getState()).balance}async getSeqno(b){return(await b.getState()).state.type==="active"?(await b.get("seqno",[])).stack.readNumber():0}async send(b,g){await b.external(g)}async sendTransfer(b,g){let w=this.createTransfer(g);await this.send(b,w)}createTransfer(b){return(0,C.createWalletTransferV3)({...b,sendMode:b.sendMode??T.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(b,g){return{send:async w=>{let _=await this.getSeqno(b),A=this.createTransfer({seqno:_,secretKey:g,sendMode:w.sendMode,messages:[(0,T.internal)({to:w.to,value:w.value,init:w.init,body:w.body,bounce:w.bounce})]});await this.send(b,A)}}}}p.WalletContractV3R2=I},55403:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.WalletContractV4=void 0;const T=x(99345),C=x(89368);class I{static create(b){return new I(b.workchain,b.publicKey,b.walletId)}constructor(b,g,w){this.workchain=b,this.publicKey=g,w!=null?this.walletId=w:this.walletId=698983191+b;let _=T.Cell.fromBoc(v.from("te6ccgECFAEAAtQAART/APSkE/S88sgLAQIBIAIDAgFIBAUE+PKDCNcYINMf0x/THwL4I7vyZO1E0NMf0x/T//QE0VFDuvKhUVG68qIF+QFUEGT5EPKj+AAkpMjLH1JAyx9SMMv/UhD0AMntVPgPAdMHIcAAn2xRkyDXSpbTB9QC+wDoMOAhwAHjACHAAuMAAcADkTDjDQOkyMsfEssfy/8QERITAubQAdDTAyFxsJJfBOAi10nBIJJfBOAC0x8hghBwbHVnvSKCEGRzdHK9sJJfBeAD+kAwIPpEAcjKB8v/ydDtRNCBAUDXIfQEMFyBAQj0Cm+hMbOSXwfgBdM/yCWCEHBsdWe6kjgw4w0DghBkc3RyupJfBuMNBgcCASAICQB4AfoA9AQw+CdvIjBQCqEhvvLgUIIQcGx1Z4MesXCAGFAEywUmzxZY+gIZ9ADLaRfLH1Jgyz8gyYBA+wAGAIpQBIEBCPRZMO1E0IEBQNcgyAHPFvQAye1UAXKwjiOCEGRzdHKDHrFwgBhQBcsFUAPPFiP6AhPLassfyz/JgED7AJJfA+ICASAKCwBZvSQrb2omhAgKBrkPoCGEcNQICEekk30pkQzmkD6f+YN4EoAbeBAUiYcVnzGEAgFYDA0AEbjJftRNDXCx+AA9sp37UTQgQFA1yH0BDACyMoHy//J0AGBAQj0Cm+hMYAIBIA4PABmtznaiaEAga5Drhf/AABmvHfaiaEAQa5DrhY/AAG7SB/oA1NQi+QAFyMoHFcv/ydB3dIAYyMsFywIizxZQBfoCFMtrEszMyXP7AMhAFIEBCPRR8qcCAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAAr0AMntVA==","base64"))[0],A=(0,T.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(this.publicKey).storeBit(0).endCell();this.init={code:_,data:A},this.address=(0,T.contractAddress)(b,{code:_,data:A})}async getBalance(b){return(await b.getState()).balance}async getSeqno(b){return(await b.getState()).state.type==="active"?(await b.get("seqno",[])).stack.readNumber():0}async send(b,g){await b.external(g)}async sendTransfer(b,g){let w=this.createTransfer(g);await this.send(b,w)}createTransfer(b){return(0,C.createWalletTransferV4)({...b,sendMode:b.sendMode??T.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(b,g){return{send:async w=>{let _=await this.getSeqno(b),A=this.createTransfer({seqno:_,secretKey:g,sendMode:w.sendMode,messages:[(0,T.internal)({to:w.to,value:w.value,init:w.init,body:w.body,bounce:w.bounce})]});await this.send(b,A)}}}}p.WalletContractV4=I},57054:function(fe,p,x){"use strict";var v=this&&this.__createBinding||(Object.create?function(C,I,m,b){b===void 0&&(b=m);var g=Object.getOwnPropertyDescriptor(I,m);(!g||("get"in g?!I.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return I[m]}}),Object.defineProperty(C,b,g)}:function(C,I,m,b){b===void 0&&(b=m),C[b]=I[m]}),T=this&&this.__exportStar||function(C,I){for(var m in C)m!=="default"&&!Object.prototype.hasOwnProperty.call(I,m)&&v(I,C,m)};Object.defineProperty(p,"__esModule",{value:!0}),T(x(19992),p),T(x(67075),p),T(x(53506),p)},26253:function(fe,p,x){"use strict";var v=this&&this.__createBinding||(Object.create?function(C,I,m,b){b===void 0&&(b=m);var g=Object.getOwnPropertyDescriptor(I,m);(!g||("get"in g?!I.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return I[m]}}),Object.defineProperty(C,b,g)}:function(C,I,m,b){b===void 0&&(b=m),C[b]=I[m]}),T=this&&this.__exportStar||function(C,I){for(var m in C)m!=="default"&&!Object.prototype.hasOwnProperty.call(I,m)&&v(I,C,m)};Object.defineProperty(p,"__esModule",{value:!0}),T(x(87858),p),T(x(66637),p),T(x(40732),p)},89368:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.createWalletTransferV5R1=p.createWalletTransferV5Beta=p.createWalletTransferV4=p.createWalletTransferV3=p.createWalletTransferV2=p.createWalletTransferV1=void 0;const v=x(99345),T=x(88473),C=x(19992),I=x(67075),m=x(31542),b=x(87858),g=x(66637);function w(D,W){return(0,v.beginCell)().storeBuffer(D).storeBuilder(W).endCell()}function _(D,W){return(0,v.beginCell)().storeBuilder(W).storeBuffer(D).endCell()}function A(D){let W=(0,v.beginCell)().storeUint(D.seqno,32);D.message&&(W.storeUint(D.sendMode,8),W.storeRef((0,v.beginCell)().store((0,v.storeMessageRelaxed)(D.message))));let H=(0,T.sign)(W.endCell().hash(),D.secretKey);return(0,v.beginCell)().storeBuffer(H).storeBuilder(W).endCell()}p.createWalletTransferV1=A;function S(D){if(D.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let W=(0,v.beginCell)().storeUint(D.seqno,32);if(D.seqno===0)for(let Z=0;Z<32;Z++)W.storeBit(1);else W.storeUint(D.timeout||Math.floor(Date.now()/1e3)+60,32);for(let Z of D.messages)W.storeUint(D.sendMode,8),W.storeRef((0,v.beginCell)().store((0,v.storeMessageRelaxed)(Z)));let H=(0,T.sign)(W.endCell().hash(),D.secretKey);return(0,v.beginCell)().storeBuffer(H).storeBuilder(W).endCell()}p.createWalletTransferV2=S;function k(D){if(D.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let W=(0,v.beginCell)().storeUint(D.walletId,32);if(D.seqno===0)for(let H=0;H<32;H++)W.storeBit(1);else W.storeUint(D.timeout||Math.floor(Date.now()/1e3)+60,32);W.storeUint(D.seqno,32);for(let H of D.messages)W.storeUint(D.sendMode,8),W.storeRef((0,v.beginCell)().store((0,v.storeMessageRelaxed)(H)));return(0,m.signPayload)(D,W,w)}p.createWalletTransferV3=k;function B(D){if(D.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let W=(0,v.beginCell)().storeUint(D.walletId,32);if(D.seqno===0)for(let H=0;H<32;H++)W.storeBit(1);else W.storeUint(D.timeout||Math.floor(Date.now()/1e3)+60,32);W.storeUint(D.seqno,32),W.storeUint(0,8);for(let H of D.messages)W.storeUint(D.sendMode,8),W.storeRef((0,v.beginCell)().store((0,v.storeMessageRelaxed)(H)));return(0,m.signPayload)(D,W,w)}p.createWalletTransferV4=B;function O(D){if(D.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");if(D.authType==="extension")return(0,v.beginCell)().storeUint(C.WalletContractV5Beta.OpCodes.auth_extension,32).store((0,I.storeOutListExtendedV5Beta)(D.actions)).endCell();const W=(0,v.beginCell)().storeUint(D.authType==="internal"?C.WalletContractV5Beta.OpCodes.auth_signed_internal:C.WalletContractV5Beta.OpCodes.auth_signed_external,32).store(D.walletId);if(D.seqno===0)for(let H=0;H<32;H++)W.storeBit(1);else W.storeUint(D.timeout||Math.floor(Date.now()/1e3)+60,32);return W.storeUint(D.seqno,32).store((0,I.storeOutListExtendedV5Beta)(D.actions)),(0,m.signPayload)(D,W,_)}p.createWalletTransferV5Beta=O;function L(D){if(D.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");if(D={...D},D.authType==="extension")return(0,v.beginCell)().storeUint(b.WalletContractV5R1.OpCodes.auth_extension,32).storeUint(D.queryId??0,64).store((0,g.storeOutListExtendedV5R1)(D.actions)).endCell();D.actions=(0,g.patchV5R1ActionsSendMode)(D.actions,D.authType);const W=(0,v.beginCell)().storeUint(D.authType==="internal"?b.WalletContractV5R1.OpCodes.auth_signed_internal:b.WalletContractV5R1.OpCodes.auth_signed_external,32).store(D.walletId);if(D.seqno===0)for(let H=0;H<32;H++)W.storeBit(1);else W.storeUint(D.timeout||Math.floor(Date.now()/1e3)+60,32);return W.storeUint(D.seqno,32).store((0,g.storeOutListExtendedV5R1)(D.actions)),(0,m.signPayload)(D,W,_)}p.createWalletTransferV5R1=L},31542:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.signPayload=void 0;const v=x(88473);function T(C,I,m){return"secretKey"in C?m((0,v.sign)(I.endCell().hash(),C.secretKey),I):C.signer(I.endCell()).then(b=>m(b,I))}p.signPayload=T},19992:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.WalletContractV5Beta=void 0;const T=x(99345),C=x(89368),I=x(53506);class m{static create(g){const w={networkGlobalId:g.walletId?.networkGlobalId??-239,workchain:g?.walletId?.workchain??0,subwalletNumber:g?.walletId?.subwalletNumber??0,walletVersion:g?.walletId?.walletVersion??"v5"};return new m(w,g.publicKey)}constructor(g,w){this.walletId=g,this.publicKey=w,this.walletId=g;let _=T.Cell.fromBoc(v.from("te6cckEBAQEAIwAIQgLkzzsvTG1qYeoPK1RH0mZ4WyavNjfbLe7mvNGqgm80Eg3NjhE=","base64"))[0],A=(0,T.beginCell)().storeInt(0,33).store((0,I.storeWalletIdV5Beta)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:_,data:A},this.address=(0,T.contractAddress)(this.walletId.workchain,{code:_,data:A})}async getBalance(g){return(await g.getState()).balance}async getSeqno(g){return(await g.getState()).state.type==="active"?(await g.get("seqno",[])).stack.readNumber():0}async getExtensions(g){return(await g.getState()).state.type==="active"?(await g.get("get_extensions",[])).stack.readCellOpt():null}async getExtensionsArray(g){const w=await this.getExtensions(g);if(!w)return[];const _=T.Dictionary.loadDirect(T.Dictionary.Keys.BigUint(256),T.Dictionary.Values.BigInt(8),w);return _.keys().map(A=>{const S=_.get(A),k=A^S+1n;return T.Address.parseRaw(`${S}:${k.toString(16).padStart(64,"0")}`)})}async getIsSecretKeyAuthEnabled(g){return(await g.get("get_is_signature_auth_allowed",[])).stack.readNumber()!==0}async send(g,w){await g.external(w)}async sendTransfer(g,w){const _=await this.createTransfer(w);await this.send(g,_)}async sendAddExtension(g,w){const _=await this.createAddExtension(w);await this.send(g,_)}async sendRemoveExtension(g,w){const _=await this.createRemoveExtension(w);await this.send(g,_)}async sendActionsBatch(g,w){const _=await this.createRequest(w);await this.send(g,_)}createActions(g){return g.messages.map(_=>({type:"sendMsg",mode:g.sendMode,outMsg:_}))}createTransfer(g){return this.createRequest({...g,actions:this.createActions({messages:g.messages,sendMode:g.sendMode})})}createAddExtension(g){return this.createRequest({...g,actions:[{type:"addExtension",address:g.extensionAddress}]})}createRemoveExtension(g){return this.createRequest({...g,actions:[{type:"removeExtension",address:g.extensionAddress}]})}createRequest(g){return g.authType==="extension"?(0,C.createWalletTransferV5Beta)(g):(0,C.createWalletTransferV5Beta)({...g,walletId:(0,I.storeWalletIdV5Beta)(this.walletId)})}sender(g,w){return{send:async _=>{let A=await this.getSeqno(g),S=this.createTransfer({seqno:A,secretKey:w,sendMode:_.sendMode??T.SendMode.PAY_GAS_SEPARATELY+T.SendMode.IGNORE_ERRORS,messages:[(0,T.internal)({to:_.to,value:_.value,init:_.init,body:_.body,bounce:_.bounce})]});await this.send(g,S)}}}}p.WalletContractV5Beta=m,m.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396}},67075:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.loadOutListExtendedV5Beta=p.storeOutListExtendedV5Beta=p.loadOutActionV5BetaExtended=p.storeOutActionExtendedV5Beta=void 0;const v=x(99345),T=x(72567),C=550222170;function I(B){return O=>{O.storeUint(C,32).storeUint(B.isEnabled?1:0,1)}}const m=474012575;function b(B){return O=>{O.storeUint(m,32).storeAddress(B.address)}}const g=1588524196;function w(B){return O=>{O.storeUint(g,32).storeAddress(B.address)}}function _(B){switch(B.type){case"setIsPublicKeyEnabled":return I(B);case"addExtension":return b(B);case"removeExtension":return w(B);default:throw new Error("Unknown action type"+B?.type)}}p.storeOutActionExtendedV5Beta=_;function A(B){const O=B.loadUint(32);switch(O){case C:return{type:"setIsPublicKeyEnabled",isEnabled:!!B.loadUint(1)};case m:return{type:"addExtension",address:B.loadAddress()};case g:return{type:"removeExtension",address:B.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${O.toString(16)}`)}}p.loadOutActionV5BetaExtended=A;function S(B){const[O,...L]=B;if(!O||!(0,T.isOutActionExtended)(O)){if(B.some(T.isOutActionExtended))throw new Error("Can't serialize actions list: all extended actions must be placed before out actions");return D=>{D.storeUint(0,1).storeRef((0,v.beginCell)().store((0,v.storeOutList)(B)).endCell())}}return D=>{D.storeUint(1,1).store(_(O)).storeRef((0,v.beginCell)().store(S(L)).endCell())}}p.storeOutListExtendedV5Beta=S;function k(B){const O=[];for(;B.loadUint(1);){const D=A(B);O.push(D),B=B.loadRef().beginParse()}const L=(0,v.loadOutList)(B.loadRef().beginParse());if(L.some(D=>D.type==="setCode"))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5");return O.concat(L)}p.loadOutListExtendedV5Beta=k},53506:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.storeWalletIdV5Beta=p.loadWalletIdV5Beta=void 0;const T=x(99345),C={v5:0};function I(b){const g=new T.BitReader(new T.BitString(typeof b=="bigint"?v.from(b.toString(16),"hex"):b instanceof T.Slice?b.loadBuffer(10):b,0,80)),w=g.loadInt(32),_=g.loadInt(8),A=g.loadUint(8),S=g.loadUint(32),k=Object.entries(C).find(([B,O])=>O===A)?.[0];if(k===void 0)throw new Error(`Can't deserialize walletId: unknown wallet version ${A}`);return{networkGlobalId:w,workchain:_,walletVersion:k,subwalletNumber:S}}p.loadWalletIdV5Beta=I;function m(b){return g=>{g.storeInt(b.networkGlobalId,32),g.storeInt(b.workchain,8),g.storeUint(C[b.walletVersion],8),g.storeUint(b.subwalletNumber,32)}}p.storeWalletIdV5Beta=m},72567:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.isOutActionBasic=p.isOutActionExtended=void 0;function x(T){return T.type==="setIsPublicKeyEnabled"||T.type==="addExtension"||T.type==="removeExtension"}p.isOutActionExtended=x;function v(T){return!x(T)}p.isOutActionBasic=v},87858:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.WalletContractV5R1=void 0;const T=x(99345),C=x(89368),I=x(40732);class m{static create(g){let w=0;return"workchain"in g&&g.workchain!=null&&(w=g.workchain),g.walletId?.context&&(0,I.isWalletIdV5R1ClientContext)(g.walletId.context)&&g.walletId.context.workchain!=null&&(w=g.walletId.context.workchain),new m(w,g.publicKey,{networkGlobalId:g.walletId?.networkGlobalId??-239,context:g.walletId?.context??{workchain:0,walletVersion:"v5r1",subwalletNumber:0}})}constructor(g,w,_){this.publicKey=w,this.walletId=_,this.walletId=_;let A=T.Cell.fromBoc(v.from("b5ee9c7241021401000281000114ff00f4a413f4bcf2c80b01020120020d020148030402dcd020d749c120915b8f6320d70b1f2082106578746ebd21821073696e74bdb0925f03e082106578746eba8eb48020d72101d074d721fa4030fa44f828fa443058bd915be0ed44d0810141d721f4058307f40e6fa1319130e18040d721707fdb3ce03120d749810280b99130e070e2100f020120050c020120060902016e07080019adce76a2684020eb90eb85ffc00019af1df6a2684010eb90eb858fc00201480a0b0017b325fb51341c75c875c2c7e00011b262fb513435c280200019be5f0f6a2684080a0eb90fa02c0102f20e011e20d70b1f82107369676ebaf2e08a7f0f01e68ef0eda2edfb218308d722028308d723208020d721d31fd31fd31fed44d0d200d31f20d31fd3ffd70a000af90140ccf9109a28945f0adb31e1f2c087df02b35007b0f2d0845125baf2e0855036baf2e086f823bbf2d0882292f800de01a47fc8ca00cb1f01cf16c9ed542092f80fde70db3cd81003f6eda2edfb02f404216e926c218e4c0221d73930709421c700b38e2d01d72820761e436c20d749c008f2e09320d74ac002f2e09320d71d06c712c2005230b0f2d089d74cd7393001a4e86c128407bbf2e093d74ac000f2e093ed55e2d20001c000915be0ebd72c08142091709601d72c081c12e25210b1e30f20d74a111213009601fa4001fa44f828fa443058baf2e091ed44d0810141d718f405049d7fc8ca0040048307f453f2e08b8e14038307f45bf2e08c22d70a00216e01b3b0f2d090e2c85003cf1612f400c9ed54007230d72c08248e2d21f2e092d200ed44d0d2005113baf2d08f54503091319c01810140d721d70a00f2e08ee2c8ca0058cf16c9ed5493f2c08de20010935bdb31e1d74cd0b4d6c35e","hex"))[0],S=(0,T.beginCell)().storeUint(1,1).storeUint(0,32).store((0,I.storeWalletIdV5R1)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:A,data:S},this.address=(0,T.contractAddress)(g,{code:A,data:S})}async getBalance(g){return(await g.getState()).balance}async getSeqno(g){return(await g.getState()).state.type==="active"?(await g.get("seqno",[])).stack.readNumber():0}async getExtensions(g){return(await g.getState()).state.type==="active"?(await g.get("get_extensions",[])).stack.readCellOpt():null}async getExtensionsArray(g){const w=await this.getExtensions(g);return w?T.Dictionary.loadDirect(T.Dictionary.Keys.BigUint(256),T.Dictionary.Values.BigInt(1),w).keys().map(A=>{const S=this.address.workChain;return T.Address.parseRaw(`${S}:${A.toString(16).padStart(64,"0")}`)}):[]}async getIsSecretKeyAuthEnabled(g){return(await g.get("is_signature_allowed",[])).stack.readBoolean()}async send(g,w){await g.external(w)}async sendTransfer(g,w){const _=await this.createTransfer(w);await this.send(g,_)}async sendAddExtension(g,w){const _=await this.createAddExtension(w);await this.send(g,_)}async sendRemoveExtension(g,w){const _=await this.createRemoveExtension(w);await this.send(g,_)}createActions(g){return g.messages.map(_=>({type:"sendMsg",mode:g.sendMode,outMsg:_}))}createTransfer(g){return this.createRequest({actions:this.createActions({messages:g.messages,sendMode:g.sendMode}),...g})}createAddExtension(g){return this.createRequest({actions:[{type:"addExtension",address:g.extensionAddress}],...g})}createRemoveExtension(g){return this.createRequest({actions:[{type:"removeExtension",address:g.extensionAddress}],...g})}createRequest(g){return g.authType==="extension"?(0,C.createWalletTransferV5R1)(g):(0,C.createWalletTransferV5R1)({...g,walletId:(0,I.storeWalletIdV5R1)(this.walletId)})}sender(g,w){return{send:async _=>{let A=await this.getSeqno(g),S=this.createTransfer({seqno:A,secretKey:w,sendMode:_.sendMode??T.SendMode.PAY_GAS_SEPARATELY+T.SendMode.IGNORE_ERRORS,messages:[(0,T.internal)({to:_.to,value:_.value,init:_.init,body:_.body,bounce:_.bounce})]});await this.send(g,S)}}}}p.WalletContractV5R1=m,m.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396}},66637:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.patchV5R1ActionsSendMode=p.toSafeV5R1SendMode=p.loadOutListExtendedV5R1=p.storeOutListExtendedV5R1=p.loadOutActionExtendedV5R1=p.storeOutActionExtendedV5R1=void 0;const v=x(99345),T=x(72567),C=4;function I(D){return W=>{W.storeUint(C,8).storeUint(D.isEnabled?1:0,1)}}const m=2;function b(D){return W=>{W.storeUint(m,8).storeAddress(D.address)}}const g=3;function w(D){return W=>{W.storeUint(g,8).storeAddress(D.address)}}function _(D){switch(D.type){case"setIsPublicKeyEnabled":return I(D);case"addExtension":return b(D);case"removeExtension":return w(D);default:throw new Error("Unknown action type"+D?.type)}}p.storeOutActionExtendedV5R1=_;function A(D){const W=D.loadUint(8);switch(W){case C:return{type:"setIsPublicKeyEnabled",isEnabled:!!D.loadUint(1)};case m:return{type:"addExtension",address:D.loadAddress()};case g:return{type:"removeExtension",address:D.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${W.toString(16)}`)}}p.loadOutActionExtendedV5R1=A;function S(D){const W=D.filter(T.isOutActionExtended),H=D.filter(T.isOutActionBasic);return G=>{const Z=H.length?(0,v.beginCell)().store((0,v.storeOutList)(H.slice().reverse())):null;if(G.storeMaybeRef(Z),W.length===0)G.storeUint(0,1);else{const[Q,...ie]=W;G.storeUint(1,1).store(_(Q)),ie.length>0&&G.storeRef(k(ie))}}}p.storeOutListExtendedV5R1=S;function k(D){const[W,...H]=D;let G=(0,v.beginCell)().store(_(W));return H.length>0&&(G=G.storeRef(k(H))),G.endCell()}function B(D){const W=[],H=D.loadMaybeRef();if(H){const G=(0,v.loadOutList)(H.beginParse());if(G.some(Z=>Z.type!=="sendMsg"))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5r1");W.push(...G)}if(D.loadBoolean()){const G=A(D);W.push(G)}for(;D.remainingRefs>0;){D=D.loadRef().beginParse();const G=A(D);W.push(G)}return W}p.loadOutListExtendedV5R1=B;function O(D,W){return W==="internal"||W==="extension"?D:D|v.SendMode.IGNORE_ERRORS}p.toSafeV5R1SendMode=O;function L(D,W){return D.map(H=>H.type==="sendMsg"?{...H,mode:O(H.mode,W)}:H)}p.patchV5R1ActionsSendMode=L},40732:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.storeWalletIdV5R1=p.loadWalletIdV5R1=p.isWalletIdV5R1ClientContext=void 0;const T=x(99345);function C(g){return typeof g!="number"}p.isWalletIdV5R1ClientContext=C;const I={v5r1:0};function m(g,w){const _=new T.BitReader(new T.BitString(typeof g=="bigint"?v.from(g.toString(16),"hex"):g instanceof T.Slice?g.loadBuffer(4):g,0,32)).loadInt(32),A=BigInt(_)^BigInt(w),S=(0,T.beginCell)().storeInt(A,32).endCell().beginParse();if(S.loadUint(1)){const B=S.loadInt(8),O=S.loadUint(8),L=S.loadUint(15),D=Object.entries(I).find(([W,H])=>H===O)?.[0];if(D===void 0)throw new Error(`Can't deserialize walletId: unknown wallet version ${O}`);return{networkGlobalId:w,context:{walletVersion:D,workchain:B,subwalletNumber:L}}}else{const B=S.loadUint(31);return{networkGlobalId:w,context:B}}}p.loadWalletIdV5R1=m;function b(g){return w=>{let _;return C(g.context)?_=(0,T.beginCell)().storeUint(1,1).storeInt(g.context.workchain,8).storeUint(I[g.context.walletVersion],8).storeUint(g.context.subwalletNumber,15).endCell().beginParse().loadInt(32):_=(0,T.beginCell)().storeUint(0,1).storeUint(g.context,31).endCell().beginParse().loadInt(32),w.storeInt(BigInt(g.networkGlobalId)^BigInt(_),32)}}p.storeWalletIdV5R1=b},46732:function(fe,p,x){"use strict";var v=x(85409);function T(ct){"@babel/helpers - typeof";return T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(wt){return typeof wt}:function(wt){return wt&&typeof Symbol=="function"&&wt.constructor===Symbol&&wt!==Symbol.prototype?"symbol":typeof wt},T(ct)}function C(ct,wt){for(var Rt=0;Rt<wt.length;Rt++){var Ge=wt[Rt];Ge.enumerable=Ge.enumerable||!1,Ge.configurable=!0,"value"in Ge&&(Ge.writable=!0),Object.defineProperty(ct,m(Ge.key),Ge)}}function I(ct,wt,Rt){return wt&&C(ct.prototype,wt),Rt&&C(ct,Rt),Object.defineProperty(ct,"prototype",{writable:!1}),ct}function m(ct){var wt=b(ct,"string");return T(wt)==="symbol"?wt:String(wt)}function b(ct,wt){if(T(ct)!=="object"||ct===null)return ct;var Rt=ct[Symbol.toPrimitive];if(Rt!==void 0){var Ge=Rt.call(ct,wt||"default");if(T(Ge)!=="object")return Ge;throw new TypeError("@@toPrimitive must return a primitive value.")}return(wt==="string"?String:Number)(ct)}function g(ct,wt){if(!(ct instanceof wt))throw new TypeError("Cannot call a class as a function")}var w=x(35349),_=w.codes,A=_.ERR_AMBIGUOUS_ARGUMENT,S=_.ERR_INVALID_ARG_TYPE,k=_.ERR_INVALID_ARG_VALUE,B=_.ERR_INVALID_RETURN_VALUE,O=_.ERR_MISSING_ARGS,L=x(96342),D=x(1344),W=D.inspect,H=x(1344).types,G=H.isPromise,Z=H.isRegExp,Q=x(43921)(),ie=x(12197)(),le=x(11187)("RegExp.prototype.test"),be=new Map,we,Ae,re,N,z;function V(){var ct=x(31235);we=ct.isDeepEqual,Ae=ct.isDeepStrictEqual}var U=/[\x00-\x08\x0b\x0c\x0e-\x1f]/g,j=null,$=function(wt){return j[wt.charCodeAt(0)]},ee=!1,J=fe.exports=ce,F={};function X(ct){throw ct.message instanceof Error?ct.message:new L(ct)}function de(ct,wt,Rt,Ge,zt){var Ft=arguments.length,tt;if(Ft===0)tt="Failed";else if(Ft===1)Rt=ct,ct=void 0;else{if(ee===!1){ee=!0;var qe=v.emitWarning?v.emitWarning:console.warn.bind(console);qe("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}Ft===2&&(Ge="!=")}if(Rt instanceof Error)throw Rt;var dt={actual:ct,expected:wt,operator:Ge===void 0?"fail":Ge,stackStartFn:zt||de};Rt!==void 0&&(dt.message=Rt);var De=new L(dt);throw tt&&(De.message=tt,De.generatedMessage=!0),De}J.fail=de,J.AssertionError=L;function Y(ct,wt,Rt,Ge){if(!Rt){var zt=!1;if(wt===0)zt=!0,Ge="No value argument passed to `assert.ok()`";else if(Ge instanceof Error)throw Ge;var Ft=new L({actual:Rt,expected:!0,message:Ge,operator:"==",stackStartFn:ct});throw Ft.generatedMessage=zt,Ft}}function ce(){for(var ct=arguments.length,wt=new Array(ct),Rt=0;Rt<ct;Rt++)wt[Rt]=arguments[Rt];Y.apply(void 0,[ce,wt.length].concat(wt))}J.ok=ce,J.equal=function ct(wt,Rt,Ge){if(arguments.length<2)throw new O("actual","expected");wt!=Rt&&X({actual:wt,expected:Rt,message:Ge,operator:"==",stackStartFn:ct})},J.notEqual=function ct(wt,Rt,Ge){if(arguments.length<2)throw new O("actual","expected");wt==Rt&&X({actual:wt,expected:Rt,message:Ge,operator:"!=",stackStartFn:ct})},J.deepEqual=function ct(wt,Rt,Ge){if(arguments.length<2)throw new O("actual","expected");we===void 0&&V(),we(wt,Rt)||X({actual:wt,expected:Rt,message:Ge,operator:"deepEqual",stackStartFn:ct})},J.notDeepEqual=function ct(wt,Rt,Ge){if(arguments.length<2)throw new O("actual","expected");we===void 0&&V(),we(wt,Rt)&&X({actual:wt,expected:Rt,message:Ge,operator:"notDeepEqual",stackStartFn:ct})},J.deepStrictEqual=function ct(wt,Rt,Ge){if(arguments.length<2)throw new O("actual","expected");we===void 0&&V(),Ae(wt,Rt)||X({actual:wt,expected:Rt,message:Ge,operator:"deepStrictEqual",stackStartFn:ct})},J.notDeepStrictEqual=he;function he(ct,wt,Rt){if(arguments.length<2)throw new O("actual","expected");we===void 0&&V(),Ae(ct,wt)&&X({actual:ct,expected:wt,message:Rt,operator:"notDeepStrictEqual",stackStartFn:he})}J.strictEqual=function ct(wt,Rt,Ge){if(arguments.length<2)throw new O("actual","expected");ie(wt,Rt)||X({actual:wt,expected:Rt,message:Ge,operator:"strictEqual",stackStartFn:ct})},J.notStrictEqual=function ct(wt,Rt,Ge){if(arguments.length<2)throw new O("actual","expected");ie(wt,Rt)&&X({actual:wt,expected:Rt,message:Ge,operator:"notStrictEqual",stackStartFn:ct})};var Ie=I(function ct(wt,Rt,Ge){var zt=this;g(this,ct),Rt.forEach(function(Ft){Ft in wt&&(Ge!==void 0&&typeof Ge[Ft]=="string"&&Z(wt[Ft])&&le(wt[Ft],Ge[Ft])?zt[Ft]=Ge[Ft]:zt[Ft]=wt[Ft])})});function ke(ct,wt,Rt,Ge,zt,Ft){if(!(Rt in ct)||!Ae(ct[Rt],wt[Rt])){if(!Ge){var tt=new Ie(ct,zt),qe=new Ie(wt,zt,ct),dt=new L({actual:tt,expected:qe,operator:"deepStrictEqual",stackStartFn:Ft});throw dt.actual=ct,dt.expected=wt,dt.operator=Ft.name,dt}X({actual:ct,expected:wt,message:Ge,operator:Ft.name,stackStartFn:Ft})}}function ut(ct,wt,Rt,Ge){if(typeof wt!="function"){if(Z(wt))return le(wt,ct);if(arguments.length===2)throw new S("expected",["Function","RegExp"],wt);if(T(ct)!=="object"||ct===null){var zt=new L({actual:ct,expected:wt,message:Rt,operator:"deepStrictEqual",stackStartFn:Ge});throw zt.operator=Ge.name,zt}var Ft=Object.keys(wt);if(wt instanceof Error)Ft.push("name","message");else if(Ft.length===0)throw new k("error",wt,"may not be an empty object");return we===void 0&&V(),Ft.forEach(function(tt){typeof ct[tt]=="string"&&Z(wt[tt])&&le(wt[tt],ct[tt])||ke(ct,wt,tt,Rt,Ft,Ge)}),!0}return wt.prototype!==void 0&&ct instanceof wt?!0:Error.isPrototypeOf(wt)?!1:wt.call({},ct)===!0}function Re(ct){if(typeof ct!="function")throw new S("fn","Function",ct);try{ct()}catch(wt){return wt}return F}function ze(ct){return G(ct)||ct!==null&&T(ct)==="object"&&typeof ct.then=="function"&&typeof ct.catch=="function"}function _t(ct){return Promise.resolve().then(function(){var wt;if(typeof ct=="function"){if(wt=ct(),!ze(wt))throw new B("instance of Promise","promiseFn",wt)}else if(ze(ct))wt=ct;else throw new S("promiseFn",["Function","Promise"],ct);return Promise.resolve().then(function(){return wt}).then(function(){return F}).catch(function(Rt){return Rt})})}function Ct(ct,wt,Rt,Ge){if(typeof Rt=="string"){if(arguments.length===4)throw new S("error",["Object","Error","Function","RegExp"],Rt);if(T(wt)==="object"&&wt!==null){if(wt.message===Rt)throw new A("error/message",'The error message "'.concat(wt.message,'" is identical to the message.'))}else if(wt===Rt)throw new A("error/message",'The error "'.concat(wt,'" is identical to the message.'));Ge=Rt,Rt=void 0}else if(Rt!=null&&T(Rt)!=="object"&&typeof Rt!="function")throw new S("error",["Object","Error","Function","RegExp"],Rt);if(wt===F){var zt="";Rt&&Rt.name&&(zt+=" (".concat(Rt.name,")")),zt+=Ge?": ".concat(Ge):".";var Ft=ct.name==="rejects"?"rejection":"exception";X({actual:void 0,expected:Rt,operator:ct.name,message:"Missing expected ".concat(Ft).concat(zt),stackStartFn:ct})}if(Rt&&!ut(wt,Rt,Ge,ct))throw wt}function $t(ct,wt,Rt,Ge){if(wt!==F){if(typeof Rt=="string"&&(Ge=Rt,Rt=void 0),!Rt||ut(wt,Rt)){var zt=Ge?": ".concat(Ge):".",Ft=ct.name==="doesNotReject"?"rejection":"exception";X({actual:wt,expected:Rt,operator:ct.name,message:"Got unwanted ".concat(Ft).concat(zt,`
|
||
`)+'Actual message: "'.concat(wt&&wt.message,'"'),stackStartFn:ct})}throw wt}}J.throws=function ct(wt){for(var Rt=arguments.length,Ge=new Array(Rt>1?Rt-1:0),zt=1;zt<Rt;zt++)Ge[zt-1]=arguments[zt];Ct.apply(void 0,[ct,Re(wt)].concat(Ge))},J.rejects=function ct(wt){for(var Rt=arguments.length,Ge=new Array(Rt>1?Rt-1:0),zt=1;zt<Rt;zt++)Ge[zt-1]=arguments[zt];return _t(wt).then(function(Ft){return Ct.apply(void 0,[ct,Ft].concat(Ge))})},J.doesNotThrow=function ct(wt){for(var Rt=arguments.length,Ge=new Array(Rt>1?Rt-1:0),zt=1;zt<Rt;zt++)Ge[zt-1]=arguments[zt];$t.apply(void 0,[ct,Re(wt)].concat(Ge))},J.doesNotReject=function ct(wt){for(var Rt=arguments.length,Ge=new Array(Rt>1?Rt-1:0),zt=1;zt<Rt;zt++)Ge[zt-1]=arguments[zt];return _t(wt).then(function(Ft){return $t.apply(void 0,[ct,Ft].concat(Ge))})},J.ifError=function ct(wt){if(wt!=null){var Rt="ifError got unwanted exception: ";T(wt)==="object"&&typeof wt.message=="string"?wt.message.length===0&&wt.constructor?Rt+=wt.constructor.name:Rt+=wt.message:Rt+=W(wt);var Ge=new L({actual:wt,expected:null,operator:"ifError",message:Rt,stackStartFn:ct}),zt=wt.stack;if(typeof zt=="string"){var Ft=zt.split(`
|
||
`);Ft.shift();for(var tt=Ge.stack.split(`
|
||
`),qe=0;qe<Ft.length;qe++){var dt=tt.indexOf(Ft[qe]);if(dt!==-1){tt=tt.slice(0,dt);break}}Ge.stack="".concat(tt.join(`
|
||
`),`
|
||
`).concat(Ft.join(`
|
||
`))}throw Ge}};function ft(ct,wt,Rt,Ge,zt){if(!Z(wt))throw new S("regexp","RegExp",wt);var Ft=zt==="match";if(typeof ct!="string"||le(wt,ct)!==Ft){if(Rt instanceof Error)throw Rt;var tt=!Rt;Rt=Rt||(typeof ct!="string"?'The "string" argument must be of type string. Received type '+"".concat(T(ct)," (").concat(W(ct),")"):(Ft?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(W(wt),`. Input:
|
||
|
||
`).concat(W(ct),`
|
||
`));var qe=new L({actual:ct,expected:wt,message:Rt,operator:zt,stackStartFn:Ge});throw qe.generatedMessage=tt,qe}}J.match=function ct(wt,Rt,Ge){ft(wt,Rt,Ge,ct,"match")},J.doesNotMatch=function ct(wt,Rt,Ge){ft(wt,Rt,Ge,ct,"doesNotMatch")};function Xe(){for(var ct=arguments.length,wt=new Array(ct),Rt=0;Rt<ct;Rt++)wt[Rt]=arguments[Rt];Y.apply(void 0,[Xe,wt.length].concat(wt))}J.strict=Q(Xe,J,{equal:J.strictEqual,deepEqual:J.deepStrictEqual,notEqual:J.notStrictEqual,notDeepEqual:J.notDeepStrictEqual}),J.strict.strict=J.strict},96342:function(fe,p,x){"use strict";var v=x(85409);function T(X,de){var Y=Object.keys(X);if(Object.getOwnPropertySymbols){var ce=Object.getOwnPropertySymbols(X);de&&(ce=ce.filter(function(he){return Object.getOwnPropertyDescriptor(X,he).enumerable})),Y.push.apply(Y,ce)}return Y}function C(X){for(var de=1;de<arguments.length;de++){var Y=arguments[de]!=null?arguments[de]:{};de%2?T(Object(Y),!0).forEach(function(ce){I(X,ce,Y[ce])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(Y)):T(Object(Y)).forEach(function(ce){Object.defineProperty(X,ce,Object.getOwnPropertyDescriptor(Y,ce))})}return X}function I(X,de,Y){return de=w(de),de in X?Object.defineProperty(X,de,{value:Y,enumerable:!0,configurable:!0,writable:!0}):X[de]=Y,X}function m(X,de){if(!(X instanceof de))throw new TypeError("Cannot call a class as a function")}function b(X,de){for(var Y=0;Y<de.length;Y++){var ce=de[Y];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(X,w(ce.key),ce)}}function g(X,de,Y){return de&&b(X.prototype,de),Y&&b(X,Y),Object.defineProperty(X,"prototype",{writable:!1}),X}function w(X){var de=_(X,"string");return Z(de)==="symbol"?de:String(de)}function _(X,de){if(Z(X)!=="object"||X===null)return X;var Y=X[Symbol.toPrimitive];if(Y!==void 0){var ce=Y.call(X,de||"default");if(Z(ce)!=="object")return ce;throw new TypeError("@@toPrimitive must return a primitive value.")}return(de==="string"?String:Number)(X)}function A(X,de){if(typeof de!="function"&&de!==null)throw new TypeError("Super expression must either be null or a function");X.prototype=Object.create(de&&de.prototype,{constructor:{value:X,writable:!0,configurable:!0}}),Object.defineProperty(X,"prototype",{writable:!1}),de&&H(X,de)}function S(X){var de=D();return function(){var ce=G(X),he;if(de){var Ie=G(this).constructor;he=Reflect.construct(ce,arguments,Ie)}else he=ce.apply(this,arguments);return k(this,he)}}function k(X,de){if(de&&(Z(de)==="object"||typeof de=="function"))return de;if(de!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return B(X)}function B(X){if(X===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return X}function O(X){var de=typeof Map=="function"?new Map:void 0;return O=function(ce){if(ce===null||!W(ce))return ce;if(typeof ce!="function")throw new TypeError("Super expression must either be null or a function");if(typeof de<"u"){if(de.has(ce))return de.get(ce);de.set(ce,he)}function he(){return L(ce,arguments,G(this).constructor)}return he.prototype=Object.create(ce.prototype,{constructor:{value:he,enumerable:!1,writable:!0,configurable:!0}}),H(he,ce)},O(X)}function L(X,de,Y){return D()?L=Reflect.construct.bind():L=function(he,Ie,ke){var ut=[null];ut.push.apply(ut,Ie);var Re=Function.bind.apply(he,ut),ze=new Re;return ke&&H(ze,ke.prototype),ze},L.apply(null,arguments)}function D(){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 W(X){return Function.toString.call(X).indexOf("[native code]")!==-1}function H(X,de){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(ce,he){return ce.__proto__=he,ce},H(X,de)}function G(X){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Y){return Y.__proto__||Object.getPrototypeOf(Y)},G(X)}function Z(X){"@babel/helpers - typeof";return Z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(de){return typeof de}:function(de){return de&&typeof Symbol=="function"&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de},Z(X)}var Q=x(1344),ie=Q.inspect,le=x(35349),be=le.codes.ERR_INVALID_ARG_TYPE;function we(X,de,Y){return(Y===void 0||Y>X.length)&&(Y=X.length),X.substring(Y-de.length,Y)===de}function Ae(X,de){if(de=Math.floor(de),X.length==0||de==0)return"";var Y=X.length*de;for(de=Math.floor(Math.log(de)/Math.log(2));de;)X+=X,de--;return X+=X.substring(0,Y-X.length),X}var re="",N="",z="",V="",U={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:"},j=10;function $(X){var de=Object.keys(X),Y=Object.create(Object.getPrototypeOf(X));return de.forEach(function(ce){Y[ce]=X[ce]}),Object.defineProperty(Y,"message",{value:X.message}),Y}function ee(X){return ie(X,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function J(X,de,Y){var ce="",he="",Ie=0,ke="",ut=!1,Re=ee(X),ze=Re.split(`
|
||
`),_t=ee(de).split(`
|
||
`),Ct=0,$t="";if(Y==="strictEqual"&&Z(X)==="object"&&Z(de)==="object"&&X!==null&&de!==null&&(Y="strictEqualObject"),ze.length===1&&_t.length===1&&ze[0]!==_t[0]){var ft=ze[0].length+_t[0].length;if(ft<=j){if((Z(X)!=="object"||X===null)&&(Z(de)!=="object"||de===null)&&(X!==0||de!==0))return"".concat(U[Y],`
|
||
|
||
`)+"".concat(ze[0]," !== ").concat(_t[0],`
|
||
`)}else if(Y!=="strictEqualObject"){var Xe=v.stderr&&v.stderr.isTTY?v.stderr.columns:80;if(ft<Xe){for(;ze[0][Ct]===_t[0][Ct];)Ct++;Ct>2&&($t=`
|
||
`.concat(Ae(" ",Ct),"^"),Ct=0)}}}for(var ct=ze[ze.length-1],wt=_t[_t.length-1];ct===wt&&(Ct++<2?ke=`
|
||
`.concat(ct).concat(ke):ce=ct,ze.pop(),_t.pop(),!(ze.length===0||_t.length===0));)ct=ze[ze.length-1],wt=_t[_t.length-1];var Rt=Math.max(ze.length,_t.length);if(Rt===0){var Ge=Re.split(`
|
||
`);if(Ge.length>30)for(Ge[26]="".concat(re,"...").concat(V);Ge.length>27;)Ge.pop();return"".concat(U.notIdentical,`
|
||
|
||
`).concat(Ge.join(`
|
||
`),`
|
||
`)}Ct>3&&(ke=`
|
||
`.concat(re,"...").concat(V).concat(ke),ut=!0),ce!==""&&(ke=`
|
||
`.concat(ce).concat(ke),ce="");var zt=0,Ft=U[Y]+`
|
||
`.concat(N,"+ actual").concat(V," ").concat(z,"- expected").concat(V),tt=" ".concat(re,"...").concat(V," Lines skipped");for(Ct=0;Ct<Rt;Ct++){var qe=Ct-Ie;if(ze.length<Ct+1)qe>1&&Ct>2&&(qe>4?(he+=`
|
||
`.concat(re,"...").concat(V),ut=!0):qe>3&&(he+=`
|
||
`.concat(_t[Ct-2]),zt++),he+=`
|
||
`.concat(_t[Ct-1]),zt++),Ie=Ct,ce+=`
|
||
`.concat(z,"-").concat(V," ").concat(_t[Ct]),zt++;else if(_t.length<Ct+1)qe>1&&Ct>2&&(qe>4?(he+=`
|
||
`.concat(re,"...").concat(V),ut=!0):qe>3&&(he+=`
|
||
`.concat(ze[Ct-2]),zt++),he+=`
|
||
`.concat(ze[Ct-1]),zt++),Ie=Ct,he+=`
|
||
`.concat(N,"+").concat(V," ").concat(ze[Ct]),zt++;else{var dt=_t[Ct],De=ze[Ct],He=De!==dt&&(!we(De,",")||De.slice(0,-1)!==dt);He&&we(dt,",")&&dt.slice(0,-1)===De&&(He=!1,De+=","),He?(qe>1&&Ct>2&&(qe>4?(he+=`
|
||
`.concat(re,"...").concat(V),ut=!0):qe>3&&(he+=`
|
||
`.concat(ze[Ct-2]),zt++),he+=`
|
||
`.concat(ze[Ct-1]),zt++),Ie=Ct,he+=`
|
||
`.concat(N,"+").concat(V," ").concat(De),ce+=`
|
||
`.concat(z,"-").concat(V," ").concat(dt),zt+=2):(he+=ce,ce="",(qe===1||Ct===0)&&(he+=`
|
||
`.concat(De),zt++))}if(zt>20&&Ct<Rt-2)return"".concat(Ft).concat(tt,`
|
||
`).concat(he,`
|
||
`).concat(re,"...").concat(V).concat(ce,`
|
||
`)+"".concat(re,"...").concat(V)}return"".concat(Ft).concat(ut?tt:"",`
|
||
`).concat(he).concat(ce).concat(ke).concat($t)}var F=function(X,de){A(ce,X);var Y=S(ce);function ce(he){var Ie;if(m(this,ce),Z(he)!=="object"||he===null)throw new be("options","Object",he);var ke=he.message,ut=he.operator,Re=he.stackStartFn,ze=he.actual,_t=he.expected,Ct=Error.stackTraceLimit;if(Error.stackTraceLimit=0,ke!=null)Ie=Y.call(this,String(ke));else if(v.stderr&&v.stderr.isTTY&&(v.stderr&&v.stderr.getColorDepth&&v.stderr.getColorDepth()!==1?(re="\x1B[34m",N="\x1B[32m",V="\x1B[39m",z="\x1B[31m"):(re="",N="",V="",z="")),Z(ze)==="object"&&ze!==null&&Z(_t)==="object"&&_t!==null&&"stack"in ze&&ze instanceof Error&&"stack"in _t&&_t instanceof Error&&(ze=$(ze),_t=$(_t)),ut==="deepStrictEqual"||ut==="strictEqual")Ie=Y.call(this,J(ze,_t,ut));else if(ut==="notDeepStrictEqual"||ut==="notStrictEqual"){var $t=U[ut],ft=ee(ze).split(`
|
||
`);if(ut==="notStrictEqual"&&Z(ze)==="object"&&ze!==null&&($t=U.notStrictEqualObject),ft.length>30)for(ft[26]="".concat(re,"...").concat(V);ft.length>27;)ft.pop();ft.length===1?Ie=Y.call(this,"".concat($t," ").concat(ft[0])):Ie=Y.call(this,"".concat($t,`
|
||
|
||
`).concat(ft.join(`
|
||
`),`
|
||
`))}else{var Xe=ee(ze),ct="",wt=U[ut];ut==="notDeepEqual"||ut==="notEqual"?(Xe="".concat(U[ut],`
|
||
|
||
`).concat(Xe),Xe.length>1024&&(Xe="".concat(Xe.slice(0,1021),"..."))):(ct="".concat(ee(_t)),Xe.length>512&&(Xe="".concat(Xe.slice(0,509),"...")),ct.length>512&&(ct="".concat(ct.slice(0,509),"...")),ut==="deepEqual"||ut==="equal"?Xe="".concat(wt,`
|
||
|
||
`).concat(Xe,`
|
||
|
||
should equal
|
||
|
||
`):ct=" ".concat(ut," ").concat(ct)),Ie=Y.call(this,"".concat(Xe).concat(ct))}return Error.stackTraceLimit=Ct,Ie.generatedMessage=!ke,Object.defineProperty(B(Ie),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),Ie.code="ERR_ASSERTION",Ie.actual=ze,Ie.expected=_t,Ie.operator=ut,Error.captureStackTrace&&Error.captureStackTrace(B(Ie),Re),Ie.stack,Ie.name="AssertionError",k(Ie)}return g(ce,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:de,value:function(Ie,ke){return ie(this,C(C({},ke),{},{customInspect:!1,depth:0}))}}]),ce}(O(Error),ie.custom);fe.exports=F},35349:function(fe,p,x){"use strict";function v(ie){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},v(ie)}function T(ie,le){for(var be=0;be<le.length;be++){var we=le[be];we.enumerable=we.enumerable||!1,we.configurable=!0,"value"in we&&(we.writable=!0),Object.defineProperty(ie,I(we.key),we)}}function C(ie,le,be){return le&&T(ie.prototype,le),be&&T(ie,be),Object.defineProperty(ie,"prototype",{writable:!1}),ie}function I(ie){var le=m(ie,"string");return v(le)==="symbol"?le:String(le)}function m(ie,le){if(v(ie)!=="object"||ie===null)return ie;var be=ie[Symbol.toPrimitive];if(be!==void 0){var we=be.call(ie,le||"default");if(v(we)!=="object")return we;throw new TypeError("@@toPrimitive must return a primitive value.")}return(le==="string"?String:Number)(ie)}function b(ie,le){if(!(ie instanceof le))throw new TypeError("Cannot call a class as a function")}function g(ie,le){if(typeof le!="function"&&le!==null)throw new TypeError("Super expression must either be null or a function");ie.prototype=Object.create(le&&le.prototype,{constructor:{value:ie,writable:!0,configurable:!0}}),Object.defineProperty(ie,"prototype",{writable:!1}),le&&w(ie,le)}function w(ie,le){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(we,Ae){return we.__proto__=Ae,we},w(ie,le)}function _(ie){var le=k();return function(){var we=B(ie),Ae;if(le){var re=B(this).constructor;Ae=Reflect.construct(we,arguments,re)}else Ae=we.apply(this,arguments);return A(this,Ae)}}function A(ie,le){if(le&&(v(le)==="object"||typeof le=="function"))return le;if(le!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S(ie)}function S(ie){if(ie===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ie}function k(){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 B(ie){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(be){return be.__proto__||Object.getPrototypeOf(be)},B(ie)}var O={},L,D;function W(ie,le,be){be||(be=Error);function we(re,N,z){return typeof le=="string"?le:le(re,N,z)}var Ae=function(re){g(z,re);var N=_(z);function z(V,U,j){var $;return b(this,z),$=N.call(this,we(V,U,j)),$.code=ie,$}return C(z)}(be);O[ie]=Ae}function H(ie,le){if(Array.isArray(ie)){var be=ie.length;return ie=ie.map(function(we){return String(we)}),be>2?"one of ".concat(le," ").concat(ie.slice(0,be-1).join(", "),", or ")+ie[be-1]:be===2?"one of ".concat(le," ").concat(ie[0]," or ").concat(ie[1]):"of ".concat(le," ").concat(ie[0])}else return"of ".concat(le," ").concat(String(ie))}function G(ie,le,be){return ie.substr(!be||be<0?0:+be,le.length)===le}function Z(ie,le,be){return(be===void 0||be>ie.length)&&(be=ie.length),ie.substring(be-le.length,be)===le}function Q(ie,le,be){return typeof be!="number"&&(be=0),be+le.length>ie.length?!1:ie.indexOf(le,be)!==-1}W("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),W("ERR_INVALID_ARG_TYPE",function(ie,le,be){L===void 0&&(L=x(46732)),L(typeof ie=="string","'name' must be a string");var we;typeof le=="string"&&G(le,"not ")?(we="must not be",le=le.replace(/^not /,"")):we="must be";var Ae;if(Z(ie," argument"))Ae="The ".concat(ie," ").concat(we," ").concat(H(le,"type"));else{var re=Q(ie,".")?"property":"argument";Ae='The "'.concat(ie,'" ').concat(re," ").concat(we," ").concat(H(le,"type"))}return Ae+=". Received type ".concat(v(be)),Ae},TypeError),W("ERR_INVALID_ARG_VALUE",function(ie,le){var be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";D===void 0&&(D=x(1344));var we=D.inspect(le);return we.length>128&&(we="".concat(we.slice(0,128),"...")),"The argument '".concat(ie,"' ").concat(be,". Received ").concat(we)},TypeError,RangeError),W("ERR_INVALID_RETURN_VALUE",function(ie,le,be){var we;return be&&be.constructor&&be.constructor.name?we="instance of ".concat(be.constructor.name):we="type ".concat(v(be)),"Expected ".concat(ie,' to be returned from the "').concat(le,'"')+" function but got ".concat(we,".")},TypeError),W("ERR_MISSING_ARGS",function(){for(var ie=arguments.length,le=new Array(ie),be=0;be<ie;be++)le[be]=arguments[be];L===void 0&&(L=x(46732)),L(le.length>0,"At least one arg needs to be specified");var we="The ",Ae=le.length;switch(le=le.map(function(re){return'"'.concat(re,'"')}),Ae){case 1:we+="".concat(le[0]," argument");break;case 2:we+="".concat(le[0]," and ").concat(le[1]," arguments");break;default:we+=le.slice(0,Ae-1).join(", "),we+=", and ".concat(le[Ae-1]," arguments");break}return"".concat(we," must be specified")},TypeError),fe.exports.codes=O},31235:function(fe,p,x){"use strict";function v(He,se){return b(He)||m(He,se)||C(He,se)||T()}function T(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C(He,se){if(He){if(typeof He=="string")return I(He,se);var oe=Object.prototype.toString.call(He).slice(8,-1);if(oe==="Object"&&He.constructor&&(oe=He.constructor.name),oe==="Map"||oe==="Set")return Array.from(He);if(oe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(oe))return I(He,se)}}function I(He,se){(se==null||se>He.length)&&(se=He.length);for(var oe=0,ye=new Array(se);oe<se;oe++)ye[oe]=He[oe];return ye}function m(He,se){var oe=He==null?null:typeof Symbol<"u"&&He[Symbol.iterator]||He["@@iterator"];if(oe!=null){var ye,Ee,me,Te,Oe=[],Qe=!0,Vt=!1;try{if(me=(oe=oe.call(He)).next,se===0){if(Object(oe)!==oe)return;Qe=!1}else for(;!(Qe=(ye=me.call(oe)).done)&&(Oe.push(ye.value),Oe.length!==se);Qe=!0);}catch(vt){Vt=!0,Ee=vt}finally{try{if(!Qe&&oe.return!=null&&(Te=oe.return(),Object(Te)!==Te))return}finally{if(Vt)throw Ee}}return Oe}}function b(He){if(Array.isArray(He))return He}function g(He){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(se){return typeof se}:function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},g(He)}var w=/a/g.flags!==void 0,_=function(se){var oe=[];return se.forEach(function(ye){return oe.push(ye)}),oe},A=function(se){var oe=[];return se.forEach(function(ye,Ee){return oe.push([Ee,ye])}),oe},S=Object.is?Object.is:x(19068),k=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},B=Number.isNaN?Number.isNaN:x(14954);function O(He){return He.call.bind(He)}var L=O(Object.prototype.hasOwnProperty),D=O(Object.prototype.propertyIsEnumerable),W=O(Object.prototype.toString),H=x(1344).types,G=H.isAnyArrayBuffer,Z=H.isArrayBufferView,Q=H.isDate,ie=H.isMap,le=H.isRegExp,be=H.isSet,we=H.isNativeError,Ae=H.isBoxedPrimitive,re=H.isNumberObject,N=H.isStringObject,z=H.isBooleanObject,V=H.isBigIntObject,U=H.isSymbolObject,j=H.isFloat32Array,$=H.isFloat64Array;function ee(He){if(He.length===0||He.length>10)return!0;for(var se=0;se<He.length;se++){var oe=He.charCodeAt(se);if(oe<48||oe>57)return!0}return He.length===10&&He>=Math.pow(2,32)}function J(He){return Object.keys(He).filter(ee).concat(k(He).filter(Object.prototype.propertyIsEnumerable.bind(He)))}/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||
* @license MIT
|
||
*/function F(He,se){if(He===se)return 0;for(var oe=He.length,ye=se.length,Ee=0,me=Math.min(oe,ye);Ee<me;++Ee)if(He[Ee]!==se[Ee]){oe=He[Ee],ye=se[Ee];break}return oe<ye?-1:ye<oe?1:0}var X=void 0,de=!0,Y=!1,ce=0,he=1,Ie=2,ke=3;function ut(He,se){return w?He.source===se.source&&He.flags===se.flags:RegExp.prototype.toString.call(He)===RegExp.prototype.toString.call(se)}function Re(He,se){if(He.byteLength!==se.byteLength)return!1;for(var oe=0;oe<He.byteLength;oe++)if(He[oe]!==se[oe])return!1;return!0}function ze(He,se){return He.byteLength!==se.byteLength?!1:F(new Uint8Array(He.buffer,He.byteOffset,He.byteLength),new Uint8Array(se.buffer,se.byteOffset,se.byteLength))===0}function _t(He,se){return He.byteLength===se.byteLength&&F(new Uint8Array(He),new Uint8Array(se))===0}function Ct(He,se){return re(He)?re(se)&&S(Number.prototype.valueOf.call(He),Number.prototype.valueOf.call(se)):N(He)?N(se)&&String.prototype.valueOf.call(He)===String.prototype.valueOf.call(se):z(He)?z(se)&&Boolean.prototype.valueOf.call(He)===Boolean.prototype.valueOf.call(se):V(He)?V(se)&&BigInt.prototype.valueOf.call(He)===BigInt.prototype.valueOf.call(se):U(se)&&Symbol.prototype.valueOf.call(He)===Symbol.prototype.valueOf.call(se)}function $t(He,se,oe,ye){if(He===se)return He!==0?!0:oe?S(He,se):!0;if(oe){if(g(He)!=="object")return typeof He=="number"&&B(He)&&B(se);if(g(se)!=="object"||He===null||se===null||Object.getPrototypeOf(He)!==Object.getPrototypeOf(se))return!1}else{if(He===null||g(He)!=="object")return se===null||g(se)!=="object"?He==se:!1;if(se===null||g(se)!=="object")return!1}var Ee=W(He),me=W(se);if(Ee!==me)return!1;if(Array.isArray(He)){if(He.length!==se.length)return!1;var Te=J(He,X),Oe=J(se,X);return Te.length!==Oe.length?!1:Xe(He,se,oe,ye,he,Te)}if(Ee==="[object Object]"&&(!ie(He)&&ie(se)||!be(He)&&be(se)))return!1;if(Q(He)){if(!Q(se)||Date.prototype.getTime.call(He)!==Date.prototype.getTime.call(se))return!1}else if(le(He)){if(!le(se)||!ut(He,se))return!1}else if(we(He)||He instanceof Error){if(He.message!==se.message||He.name!==se.name)return!1}else if(Z(He)){if(!oe&&(j(He)||$(He))){if(!Re(He,se))return!1}else if(!ze(He,se))return!1;var Qe=J(He,X),Vt=J(se,X);return Qe.length!==Vt.length?!1:Xe(He,se,oe,ye,ce,Qe)}else{if(be(He))return!be(se)||He.size!==se.size?!1:Xe(He,se,oe,ye,Ie);if(ie(He))return!ie(se)||He.size!==se.size?!1:Xe(He,se,oe,ye,ke);if(G(He)){if(!_t(He,se))return!1}else if(Ae(He)&&!Ct(He,se))return!1}return Xe(He,se,oe,ye,ce)}function ft(He,se){return se.filter(function(oe){return D(He,oe)})}function Xe(He,se,oe,ye,Ee,me){if(arguments.length===5){me=Object.keys(He);var Te=Object.keys(se);if(me.length!==Te.length)return!1}for(var Oe=0;Oe<me.length;Oe++)if(!L(se,me[Oe]))return!1;if(oe&&arguments.length===5){var Qe=k(He);if(Qe.length!==0){var Vt=0;for(Oe=0;Oe<Qe.length;Oe++){var vt=Qe[Oe];if(D(He,vt)){if(!D(se,vt))return!1;me.push(vt),Vt++}else if(D(se,vt))return!1}var Zt=k(se);if(Qe.length!==Zt.length&&ft(se,Zt).length!==Vt)return!1}else{var dn=k(se);if(dn.length!==0&&ft(se,dn).length!==0)return!1}}if(me.length===0&&(Ee===ce||Ee===he&&He.length===0||He.size===0))return!0;if(ye===void 0)ye={val1:new Map,val2:new Map,position:0};else{var ln=ye.val1.get(He);if(ln!==void 0){var yn=ye.val2.get(se);if(yn!==void 0)return ln===yn}ye.position++}ye.val1.set(He,ye.position),ye.val2.set(se,ye.position);var or=qe(He,se,oe,me,ye,Ee);return ye.val1.delete(He),ye.val2.delete(se),or}function ct(He,se,oe,ye){for(var Ee=_(He),me=0;me<Ee.length;me++){var Te=Ee[me];if($t(se,Te,oe,ye))return He.delete(Te),!0}return!1}function wt(He){switch(g(He)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":He=+He;case"number":if(B(He))return!1}return!0}function Rt(He,se,oe){var ye=wt(oe);return ye??(se.has(ye)&&!He.has(ye))}function Ge(He,se,oe,ye,Ee){var me=wt(oe);if(me!=null)return me;var Te=se.get(me);return Te===void 0&&!se.has(me)||!$t(ye,Te,!1,Ee)?!1:!He.has(me)&&$t(ye,Te,!1,Ee)}function zt(He,se,oe,ye){for(var Ee=null,me=_(He),Te=0;Te<me.length;Te++){var Oe=me[Te];if(g(Oe)==="object"&&Oe!==null)Ee===null&&(Ee=new Set),Ee.add(Oe);else if(!se.has(Oe)){if(oe||!Rt(He,se,Oe))return!1;Ee===null&&(Ee=new Set),Ee.add(Oe)}}if(Ee!==null){for(var Qe=_(se),Vt=0;Vt<Qe.length;Vt++){var vt=Qe[Vt];if(g(vt)==="object"&&vt!==null){if(!ct(Ee,vt,oe,ye))return!1}else if(!oe&&!He.has(vt)&&!ct(Ee,vt,oe,ye))return!1}return Ee.size===0}return!0}function Ft(He,se,oe,ye,Ee,me){for(var Te=_(He),Oe=0;Oe<Te.length;Oe++){var Qe=Te[Oe];if($t(oe,Qe,Ee,me)&&$t(ye,se.get(Qe),Ee,me))return He.delete(Qe),!0}return!1}function tt(He,se,oe,ye){for(var Ee=null,me=A(He),Te=0;Te<me.length;Te++){var Oe=v(me[Te],2),Qe=Oe[0],Vt=Oe[1];if(g(Qe)==="object"&&Qe!==null)Ee===null&&(Ee=new Set),Ee.add(Qe);else{var vt=se.get(Qe);if(vt===void 0&&!se.has(Qe)||!$t(Vt,vt,oe,ye)){if(oe||!Ge(He,se,Qe,Vt,ye))return!1;Ee===null&&(Ee=new Set),Ee.add(Qe)}}}if(Ee!==null){for(var Zt=A(se),dn=0;dn<Zt.length;dn++){var ln=v(Zt[dn],2),yn=ln[0],or=ln[1];if(g(yn)==="object"&&yn!==null){if(!Ft(Ee,He,yn,or,oe,ye))return!1}else if(!oe&&(!He.has(yn)||!$t(He.get(yn),or,!1,ye))&&!Ft(Ee,He,yn,or,!1,ye))return!1}return Ee.size===0}return!0}function qe(He,se,oe,ye,Ee,me){var Te=0;if(me===Ie){if(!zt(He,se,oe,Ee))return!1}else if(me===ke){if(!tt(He,se,oe,Ee))return!1}else if(me===he)for(;Te<He.length;Te++)if(L(He,Te)){if(!L(se,Te)||!$t(He[Te],se[Te],oe,Ee))return!1}else{if(L(se,Te))return!1;for(var Oe=Object.keys(He);Te<Oe.length;Te++){var Qe=Oe[Te];if(!L(se,Qe)||!$t(He[Qe],se[Qe],oe,Ee))return!1}return Oe.length===Object.keys(se).length}for(Te=0;Te<ye.length;Te++){var Vt=ye[Te];if(!$t(He[Vt],se[Vt],oe,Ee))return!1}return!0}function dt(He,se){return $t(He,se,Y)}function De(He,se){return $t(He,se,de)}fe.exports={isDeepEqual:dt,isDeepStrictEqual:De}},29622:function(fe,p,x){"use strict";var v=x(56608).Buffer;function T(C){if(C.length>=255)throw new TypeError("Alphabet too long");for(var I=new Uint8Array(256),m=0;m<I.length;m++)I[m]=255;for(var b=0;b<C.length;b++){var g=C.charAt(b),w=g.charCodeAt(0);if(I[w]!==255)throw new TypeError(g+" is ambiguous");I[w]=b}var _=C.length,A=C.charAt(0),S=Math.log(_)/Math.log(256),k=Math.log(256)/Math.log(_);function B(D){if((Array.isArray(D)||D instanceof Uint8Array)&&(D=v.from(D)),!v.isBuffer(D))throw new TypeError("Expected Buffer");if(D.length===0)return"";for(var W=0,H=0,G=0,Z=D.length;G!==Z&&D[G]===0;)G++,W++;for(var Q=(Z-G)*k+1>>>0,ie=new Uint8Array(Q);G!==Z;){for(var le=D[G],be=0,we=Q-1;(le!==0||be<H)&&we!==-1;we--,be++)le+=256*ie[we]>>>0,ie[we]=le%_>>>0,le=le/_>>>0;if(le!==0)throw new Error("Non-zero carry");H=be,G++}for(var Ae=Q-H;Ae!==Q&&ie[Ae]===0;)Ae++;for(var re=A.repeat(W);Ae<Q;++Ae)re+=C.charAt(ie[Ae]);return re}function O(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return v.alloc(0);for(var W=0,H=0,G=0;D[W]===A;)H++,W++;for(var Z=(D.length-W)*S+1>>>0,Q=new Uint8Array(Z);W<D.length;){var ie=D.charCodeAt(W);if(ie>255)return;var le=I[ie];if(le===255)return;for(var be=0,we=Z-1;(le!==0||be<G)&&we!==-1;we--,be++)le+=_*Q[we]>>>0,Q[we]=le%256>>>0,le=le/256>>>0;if(le!==0)throw new Error("Non-zero carry");G=be,W++}for(var Ae=Z-G;Ae!==Z&&Q[Ae]===0;)Ae++;var re=v.allocUnsafe(H+(Z-Ae));re.fill(0,0,H);for(var N=H;Ae!==Z;)re[N++]=Q[Ae++];return re}function L(D){var W=O(D);if(W)return W;throw new Error("Non-base"+_+" character")}return{encode:B,decodeUnsafe:O,decode:L}}fe.exports=T},51219:function(fe){"use strict";function p(x){if(x.length>=255)throw new TypeError("Alphabet too long");for(var v=new Uint8Array(256),T=0;T<v.length;T++)v[T]=255;for(var C=0;C<x.length;C++){var I=x.charAt(C),m=I.charCodeAt(0);if(v[m]!==255)throw new TypeError(I+" is ambiguous");v[m]=C}var b=x.length,g=x.charAt(0),w=Math.log(b)/Math.log(256),_=Math.log(256)/Math.log(b);function A(B){if(B instanceof Uint8Array||(ArrayBuffer.isView(B)?B=new Uint8Array(B.buffer,B.byteOffset,B.byteLength):Array.isArray(B)&&(B=Uint8Array.from(B))),!(B instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(B.length===0)return"";for(var O=0,L=0,D=0,W=B.length;D!==W&&B[D]===0;)D++,O++;for(var H=(W-D)*_+1>>>0,G=new Uint8Array(H);D!==W;){for(var Z=B[D],Q=0,ie=H-1;(Z!==0||Q<L)&&ie!==-1;ie--,Q++)Z+=256*G[ie]>>>0,G[ie]=Z%b>>>0,Z=Z/b>>>0;if(Z!==0)throw new Error("Non-zero carry");L=Q,D++}for(var le=H-L;le!==H&&G[le]===0;)le++;for(var be=g.repeat(O);le<H;++le)be+=x.charAt(G[le]);return be}function S(B){if(typeof B!="string")throw new TypeError("Expected String");if(B.length===0)return new Uint8Array;for(var O=0,L=0,D=0;B[O]===g;)L++,O++;for(var W=(B.length-O)*w+1>>>0,H=new Uint8Array(W);B[O];){var G=v[B.charCodeAt(O)];if(G===255)return;for(var Z=0,Q=W-1;(G!==0||Z<D)&&Q!==-1;Q--,Z++)G+=b*H[Q]>>>0,H[Q]=G%256>>>0,G=G/256>>>0;if(G!==0)throw new Error("Non-zero carry");D=Z,O++}for(var ie=W-D;ie!==W&&H[ie]===0;)ie++;for(var le=new Uint8Array(L+(W-ie)),be=L;ie!==W;)le[be++]=H[ie++];return le}function k(B){var O=S(B);if(O)return O;throw new Error("Non-base"+b+" character")}return{encode:A,decodeUnsafe:S,decode:k}}fe.exports=p},84933:function(fe,p){"use strict";p.byteLength=g,p.toByteArray=_,p.fromByteArray=k;for(var x=[],v=[],T=typeof Uint8Array<"u"?Uint8Array:Array,C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=0,m=C.length;I<m;++I)x[I]=C[I],v[C.charCodeAt(I)]=I;v[45]=62,v[95]=63;function b(B){var O=B.length;if(O%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var L=B.indexOf("=");L===-1&&(L=O);var D=L===O?0:4-L%4;return[L,D]}function g(B){var O=b(B),L=O[0],D=O[1];return(L+D)*3/4-D}function w(B,O,L){return(O+L)*3/4-L}function _(B){var O,L=b(B),D=L[0],W=L[1],H=new T(w(B,D,W)),G=0,Z=W>0?D-4:D,Q;for(Q=0;Q<Z;Q+=4)O=v[B.charCodeAt(Q)]<<18|v[B.charCodeAt(Q+1)]<<12|v[B.charCodeAt(Q+2)]<<6|v[B.charCodeAt(Q+3)],H[G++]=O>>16&255,H[G++]=O>>8&255,H[G++]=O&255;return W===2&&(O=v[B.charCodeAt(Q)]<<2|v[B.charCodeAt(Q+1)]>>4,H[G++]=O&255),W===1&&(O=v[B.charCodeAt(Q)]<<10|v[B.charCodeAt(Q+1)]<<4|v[B.charCodeAt(Q+2)]>>2,H[G++]=O>>8&255,H[G++]=O&255),H}function A(B){return x[B>>18&63]+x[B>>12&63]+x[B>>6&63]+x[B&63]}function S(B,O,L){for(var D,W=[],H=O;H<L;H+=3)D=(B[H]<<16&16711680)+(B[H+1]<<8&65280)+(B[H+2]&255),W.push(A(D));return W.join("")}function k(B){for(var O,L=B.length,D=L%3,W=[],H=16383,G=0,Z=L-D;G<Z;G+=H)W.push(S(B,G,G+H>Z?Z:G+H));return D===1?(O=B[L-1],W.push(x[O>>2]+x[O<<4&63]+"==")):D===2&&(O=(B[L-2]<<8)+B[L-1],W.push(x[O>>10]+x[O>>4&63]+x[O<<2&63]+"=")),W.join("")}},60509:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.bech32m=p.bech32=void 0;const x="qpzry9x8gf2tvdw0s3jn54khce6mua7l",v={};for(let _=0;_<x.length;_++){const A=x.charAt(_);v[A]=_}function T(_){const A=_>>25;return(_&33554431)<<5^-(A>>0&1)&996825010^-(A>>1&1)&642813549^-(A>>2&1)&513874426^-(A>>3&1)&1027748829^-(A>>4&1)&705979059}function C(_){let A=1;for(let S=0;S<_.length;++S){const k=_.charCodeAt(S);if(k<33||k>126)return"Invalid prefix ("+_+")";A=T(A)^k>>5}A=T(A);for(let S=0;S<_.length;++S){const k=_.charCodeAt(S);A=T(A)^k&31}return A}function I(_,A,S,k){let B=0,O=0;const L=(1<<S)-1,D=[];for(let W=0;W<_.length;++W)for(B=B<<A|_[W],O+=A;O>=S;)O-=S,D.push(B>>O&L);if(k)O>0&&D.push(B<<S-O&L);else{if(O>=A)return"Excess padding";if(B<<S-O&L)return"Non-zero padding"}return D}function m(_){return I(_,8,5,!0)}function b(_){const A=I(_,5,8,!1);if(Array.isArray(A))return A}function g(_){const A=I(_,5,8,!1);if(Array.isArray(A))return A;throw new Error(A)}function w(_){let A;_==="bech32"?A=1:A=734539939;function S(L,D,W){if(W=W||90,L.length+7+D.length>W)throw new TypeError("Exceeds length limit");L=L.toLowerCase();let H=C(L);if(typeof H=="string")throw new Error(H);let G=L+"1";for(let Z=0;Z<D.length;++Z){const Q=D[Z];if(Q>>5)throw new Error("Non 5-bit word");H=T(H)^Q,G+=x.charAt(Q)}for(let Z=0;Z<6;++Z)H=T(H);H^=A;for(let Z=0;Z<6;++Z){const Q=H>>(5-Z)*5&31;G+=x.charAt(Q)}return G}function k(L,D){if(D=D||90,L.length<8)return L+" too short";if(L.length>D)return"Exceeds length limit";const W=L.toLowerCase(),H=L.toUpperCase();if(L!==W&&L!==H)return"Mixed-case string "+L;L=W;const G=L.lastIndexOf("1");if(G===-1)return"No separator character for "+L;if(G===0)return"Missing prefix for "+L;const Z=L.slice(0,G),Q=L.slice(G+1);if(Q.length<6)return"Data too short";let ie=C(Z);if(typeof ie=="string")return ie;const le=[];for(let be=0;be<Q.length;++be){const we=Q.charAt(be),Ae=v[we];if(Ae===void 0)return"Unknown character "+we;ie=T(ie)^Ae,!(be+6>=Q.length)&&le.push(Ae)}return ie!==A?"Invalid checksum for "+L:{prefix:Z,words:le}}function B(L,D){const W=k(L,D);if(typeof W=="object")return W}function O(L,D){const W=k(L,D);if(typeof W=="object")return W;throw new Error(W)}return{decodeUnsafe:B,decode:O,encode:S,toWords:m,fromWordsUnsafe:b,fromWords:g}}p.bech32=w("bech32"),p.bech32m=w("bech32m")},19808:function(fe,p,x){"use strict";var v,T=x(36533).Buffer;v={value:!0};let C;function I(w){{const _=T.from(w);_.reverse();const A=_.toString("hex");return A.length===0?BigInt(0):BigInt(`0x${A}`)}return C.toBigInt(w,!1)}p.toBigIntLE=I;function m(w){{const _=w.toString("hex");return _.length===0?BigInt(0):BigInt(`0x${_}`)}return C.toBigInt(w,!0)}v=m;function b(w,_){{const A=w.toString(16),S=T.from(A.padStart(_*2,"0").slice(0,_*2),"hex");return S.reverse(),S}return C.fromBigInt(w,T.allocUnsafe(_),!1)}p.toBufferLE=b;function g(w,_){{const A=w.toString(16);return T.from(A.padStart(_*2,"0").slice(0,_*2),"hex")}return C.fromBigInt(w,T.allocUnsafe(_),!0)}v=g},33599:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0});const v=x(33153);function T(b){const g=b[0],w=v.psbtToKeyVals(g),_=b.slice(1);if(_.length===0)throw new Error("Combine: Nothing to combine");const A=I(g);if(A===void 0)throw new Error("Combine: Self missing transaction");const S=m(w.globalKeyVals),k=w.inputKeyVals.map(m),B=w.outputKeyVals.map(m);for(const O of _){const L=I(O);if(L===void 0||!L.toBuffer().equals(A.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");const D=v.psbtToKeyVals(O);m(D.globalKeyVals).forEach(C(S,w.globalKeyVals,D.globalKeyVals)),D.inputKeyVals.map(m).forEach((Z,Q)=>Z.forEach(C(k[Q],w.inputKeyVals[Q],D.inputKeyVals[Q]))),D.outputKeyVals.map(m).forEach((Z,Q)=>Z.forEach(C(B[Q],w.outputKeyVals[Q],D.outputKeyVals[Q])))}return v.psbtFromKeyVals(A,{globalMapKeyVals:w.globalKeyVals,inputKeyVals:w.inputKeyVals,outputKeyVals:w.outputKeyVals})}p.combine=T;function C(b,g,w){return _=>{if(b.has(_))return;const A=w.filter(S=>S.key.toString("hex")===_)[0];g.push(A),b.add(_)}}function I(b){return b.globalMap.unsignedTx}function m(b){const g=new Set;return b.forEach(w=>{const _=w.key.toString("hex");if(g.has(_))throw new Error("Combine: KeyValue Map keys should be unique");g.add(_)}),g}},44962:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776),C=w=>[...Array(w).keys()];function I(w){if(w.key[0]!==T.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+w.key.toString("hex"));if(w.key.length!==79||![2,3].includes(w.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+w.key.toString("hex"));if(w.value.length/4%1!==0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");const _=w.key.slice(1),A={masterFingerprint:w.value.slice(0,4),extendedPubkey:_,path:"m"};for(const S of C(w.value.length/4-1)){const k=w.value.readUInt32LE(S*4+4),B=!!(k&2147483648),O=k&2147483647;A.path+="/"+O.toString(10)+(B?"'":"")}return A}p.decode=I;function m(w){const _=v.from([T.GlobalTypes.GLOBAL_XPUB]),A=v.concat([_,w.extendedPubkey]),S=w.path.split("/"),k=v.allocUnsafe(S.length*4);w.masterFingerprint.copy(k,0);let B=4;return S.slice(1).forEach(O=>{const L=O.slice(-1)==="'";let D=2147483647&parseInt(L?O.slice(0,-1):O,10);L&&(D+=2147483648),k.writeUInt32LE(D,B),B+=4}),{key:A,value:k}}p.encode=m,p.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }";function b(w){const _=w.extendedPubkey,A=w.masterFingerprint,S=w.path;return v.isBuffer(_)&&_.length===78&&[2,3].indexOf(_[45])>-1&&v.isBuffer(A)&&A.length===4&&typeof S=="string"&&!!S.match(/^m(\/\d+'?)*$/)}p.check=b;function g(w,_,A){const S=_.extendedPubkey.toString("hex");return A.has(S)?!1:(A.add(S),w.filter(k=>k.extendedPubkey.equals(_.extendedPubkey)).length===0)}p.canAddToArray=g},55157:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(I){return{key:v.from([T.GlobalTypes.UNSIGNED_TX]),value:I.toBuffer()}}p.encode=C},30674:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0});const v=x(72776),T=x(44962),C=x(55157),I=x(79549),m=x(88819),b=x(82895),g=x(24187),w=x(23629),_=x(95152),A=x(56248),S=x(64639),k=x(97641),B=x(55674),O=x(53006),L=x(14171),D=x(71913),W=x(35628),H=x(25347),G=x(22804),Z=x(56527),Q=x(186),ie={unsignedTx:C,globalXpub:T,checkPubkey:W.makeChecker([])};p.globals=ie;const le={nonWitnessUtxo:b,partialSig:g,sighashType:_,finalScriptSig:I,finalScriptWitness:m,porCommitment:w,witnessUtxo:O,bip32Derivation:D.makeConverter(v.InputTypes.BIP32_DERIVATION),redeemScript:H.makeConverter(v.InputTypes.REDEEM_SCRIPT),witnessScript:Q.makeConverter(v.InputTypes.WITNESS_SCRIPT),checkPubkey:W.makeChecker([v.InputTypes.PARTIAL_SIG,v.InputTypes.BIP32_DERIVATION]),tapKeySig:A,tapScriptSig:B,tapLeafScript:S,tapBip32Derivation:G.makeConverter(v.InputTypes.TAP_BIP32_DERIVATION),tapInternalKey:Z.makeConverter(v.InputTypes.TAP_INTERNAL_KEY),tapMerkleRoot:k};p.inputs=le;const be={bip32Derivation:D.makeConverter(v.OutputTypes.BIP32_DERIVATION),redeemScript:H.makeConverter(v.OutputTypes.REDEEM_SCRIPT),witnessScript:Q.makeConverter(v.OutputTypes.WITNESS_SCRIPT),checkPubkey:W.makeChecker([v.OutputTypes.BIP32_DERIVATION]),tapBip32Derivation:G.makeConverter(v.OutputTypes.TAP_BIP32_DERIVATION),tapTree:L,tapInternalKey:Z.makeConverter(v.OutputTypes.TAP_INTERNAL_KEY)};p.outputs=be},79549:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(g){if(g.key[0]!==T.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+g.key.toString("hex"));return g.value}p.decode=C;function I(g){return{key:v.from([T.InputTypes.FINAL_SCRIPTSIG]),value:g}}p.encode=I,p.expected="Buffer";function m(g){return v.isBuffer(g)}p.check=m;function b(g,w){return!!g&&!!w&&g.finalScriptSig===void 0}p.canAdd=b},88819:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(g){if(g.key[0]!==T.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+g.key.toString("hex"));return g.value}p.decode=C;function I(g){return{key:v.from([T.InputTypes.FINAL_SCRIPTWITNESS]),value:g}}p.encode=I,p.expected="Buffer";function m(g){return v.isBuffer(g)}p.check=m;function b(g,w){return!!g&&!!w&&g.finalScriptWitness===void 0}p.canAdd=b},82895:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(g){if(g.key[0]!==T.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+g.key.toString("hex"));return g.value}p.decode=C;function I(g){return{key:v.from([T.InputTypes.NON_WITNESS_UTXO]),value:g}}p.encode=I,p.expected="Buffer";function m(g){return v.isBuffer(g)}p.check=m;function b(g,w){return!!g&&!!w&&g.nonWitnessUtxo===void 0}p.canAdd=b},24187:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(w){if(w.key[0]!==T.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+w.key.toString("hex"));if(!(w.key.length===34||w.key.length===66)||![2,3,4].includes(w.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+w.key.toString("hex"));return{pubkey:w.key.slice(1),signature:w.value}}p.decode=C;function I(w){const _=v.from([T.InputTypes.PARTIAL_SIG]);return{key:v.concat([_,w.pubkey]),value:w.signature}}p.encode=I,p.expected="{ pubkey: Buffer; signature: Buffer; }";function m(w){return v.isBuffer(w.pubkey)&&v.isBuffer(w.signature)&&[33,65].includes(w.pubkey.length)&&[2,3,4].includes(w.pubkey[0])&&b(w.signature)}p.check=m;function b(w){if(!v.isBuffer(w)||w.length<9||w[0]!==48||w.length!==w[1]+3||w[2]!==2)return!1;const _=w[3];if(_>33||_<1||w[3+_+1]!==2)return!1;const A=w[3+_+2];return!(A>33||A<1||w.length!==3+_+2+A+2)}function g(w,_,A){const S=_.pubkey.toString("hex");return A.has(S)?!1:(A.add(S),w.filter(k=>k.pubkey.equals(_.pubkey)).length===0)}p.canAddToArray=g},23629:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(g){if(g.key[0]!==T.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+g.key.toString("hex"));return g.value.toString("utf8")}p.decode=C;function I(g){return{key:v.from([T.InputTypes.POR_COMMITMENT]),value:v.from(g,"utf8")}}p.encode=I,p.expected="string";function m(g){return typeof g=="string"}p.check=m;function b(g,w){return!!g&&!!w&&g.porCommitment===void 0}p.canAdd=b},95152:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(g){if(g.key[0]!==T.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+g.key.toString("hex"));return g.value.readUInt32LE(0)}p.decode=C;function I(g){const w=v.from([T.InputTypes.SIGHASH_TYPE]),_=v.allocUnsafe(4);return _.writeUInt32LE(g,0),{key:w,value:_}}p.encode=I,p.expected="number";function m(g){return typeof g=="number"}p.check=m;function b(g,w){return!!g&&!!w&&g.sighashType===void 0}p.canAdd=b},56248:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(g){if(g.key[0]!==T.InputTypes.TAP_KEY_SIG||g.key.length!==1)throw new Error("Decode Error: could not decode tapKeySig with key 0x"+g.key.toString("hex"));if(!m(g.value))throw new Error("Decode Error: tapKeySig not a valid 64-65-byte BIP340 signature");return g.value}p.decode=C;function I(g){return{key:v.from([T.InputTypes.TAP_KEY_SIG]),value:g}}p.encode=I,p.expected="Buffer";function m(g){return v.isBuffer(g)&&(g.length===64||g.length===65)}p.check=m;function b(g,w){return!!g&&!!w&&g.tapKeySig===void 0}p.canAdd=b},64639:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(g){if(g.key[0]!==T.InputTypes.TAP_LEAF_SCRIPT)throw new Error("Decode Error: could not decode tapLeafScript with key 0x"+g.key.toString("hex"));if((g.key.length-2)%32!==0)throw new Error("Decode Error: tapLeafScript has invalid control block in key 0x"+g.key.toString("hex"));const w=g.value[g.value.length-1];if((g.key[1]&254)!==w)throw new Error("Decode Error: tapLeafScript bad leaf version in key 0x"+g.key.toString("hex"));const _=g.value.slice(0,-1);return{controlBlock:g.key.slice(1),script:_,leafVersion:w}}p.decode=C;function I(g){const w=v.from([T.InputTypes.TAP_LEAF_SCRIPT]),_=v.from([g.leafVersion]);return{key:v.concat([w,g.controlBlock]),value:v.concat([g.script,_])}}p.encode=I,p.expected="{ controlBlock: Buffer; leafVersion: number, script: Buffer; }";function m(g){return v.isBuffer(g.controlBlock)&&(g.controlBlock.length-1)%32===0&&(g.controlBlock[0]&254)===g.leafVersion&&v.isBuffer(g.script)}p.check=m;function b(g,w,_){const A=w.controlBlock.toString("hex");return _.has(A)?!1:(_.add(A),g.filter(S=>S.controlBlock.equals(w.controlBlock)).length===0)}p.canAddToArray=b},97641:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(g){if(g.key[0]!==T.InputTypes.TAP_MERKLE_ROOT||g.key.length!==1)throw new Error("Decode Error: could not decode tapMerkleRoot with key 0x"+g.key.toString("hex"));if(!m(g.value))throw new Error("Decode Error: tapMerkleRoot not a 32-byte hash");return g.value}p.decode=C;function I(g){return{key:v.from([T.InputTypes.TAP_MERKLE_ROOT]),value:g}}p.encode=I,p.expected="Buffer";function m(g){return v.isBuffer(g)&&g.length===32}p.check=m;function b(g,w){return!!g&&!!w&&g.tapMerkleRoot===void 0}p.canAdd=b},55674:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776);function C(g){if(g.key[0]!==T.InputTypes.TAP_SCRIPT_SIG)throw new Error("Decode Error: could not decode tapScriptSig with key 0x"+g.key.toString("hex"));if(g.key.length!==65)throw new Error("Decode Error: tapScriptSig has invalid key 0x"+g.key.toString("hex"));if(g.value.length!==64&&g.value.length!==65)throw new Error("Decode Error: tapScriptSig has invalid signature in key 0x"+g.key.toString("hex"));const w=g.key.slice(1,33),_=g.key.slice(33);return{pubkey:w,leafHash:_,signature:g.value}}p.decode=C;function I(g){const w=v.from([T.InputTypes.TAP_SCRIPT_SIG]);return{key:v.concat([w,g.pubkey,g.leafHash]),value:g.signature}}p.encode=I,p.expected="{ pubkey: Buffer; leafHash: Buffer; signature: Buffer; }";function m(g){return v.isBuffer(g.pubkey)&&v.isBuffer(g.leafHash)&&v.isBuffer(g.signature)&&g.pubkey.length===32&&g.leafHash.length===32&&(g.signature.length===64||g.signature.length===65)}p.check=m;function b(g,w,_){const A=w.pubkey.toString("hex")+w.leafHash.toString("hex");return _.has(A)?!1:(_.add(A),g.filter(S=>S.pubkey.equals(w.pubkey)&&S.leafHash.equals(w.leafHash)).length===0)}p.canAddToArray=b},53006:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776),C=x(17365),I=x(40586);function m(_){if(_.key[0]!==T.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+_.key.toString("hex"));const A=C.readUInt64LE(_.value,0);let S=8;const k=I.decode(_.value,S);S+=I.encodingLength(k);const B=_.value.slice(S);if(B.length!==k)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:B,value:A}}p.decode=m;function b(_){const{script:A,value:S}=_,k=I.encodingLength(A.length),B=v.allocUnsafe(8+k+A.length);return C.writeUInt64LE(B,S,0),I.encode(A.length,B,8),A.copy(B,8+k),{key:v.from([T.InputTypes.WITNESS_UTXO]),value:B}}p.encode=b,p.expected="{ script: Buffer; value: number; }";function g(_){return v.isBuffer(_.script)&&typeof _.value=="number"}p.check=g;function w(_,A){return!!_&&!!A&&_.witnessUtxo===void 0}p.canAdd=w},14171:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(72776),C=x(40586);function I(w){if(w.key[0]!==T.OutputTypes.TAP_TREE||w.key.length!==1)throw new Error("Decode Error: could not decode tapTree with key 0x"+w.key.toString("hex"));let _=0;const A=[];for(;_<w.value.length;){const S=w.value[_++],k=w.value[_++],B=C.decode(w.value,_);_+=C.encodingLength(B),A.push({depth:S,leafVersion:k,script:w.value.slice(_,_+B)}),_+=B}return{leaves:A}}p.decode=I;function m(w){const _=v.from([T.OutputTypes.TAP_TREE]),A=[].concat(...w.leaves.map(S=>[v.of(S.depth,S.leafVersion),C.encode(S.script.length),S.script]));return{key:_,value:v.concat(A)}}p.encode=m,p.expected="{ leaves: [{ depth: number; leafVersion: number, script: Buffer; }] }";function b(w){return Array.isArray(w.leaves)&&w.leaves.every(_=>_.depth>=0&&_.depth<=128&&(_.leafVersion&254)===_.leafVersion&&v.isBuffer(_.script))}p.check=b;function g(w,_){return!!w&&!!_&&w.tapTree===void 0}p.canAdd=g},71913:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=m=>[...Array(m).keys()],C=m=>m.length===33&&[2,3].includes(m[0])||m.length===65&&m[0]===4;function I(m,b=C){function g(k){if(k.key[0]!==m)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+k.key.toString("hex"));const B=k.key.slice(1);if(!b(B))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+k.key.toString("hex"));if(k.value.length/4%1!==0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const O={masterFingerprint:k.value.slice(0,4),pubkey:B,path:"m"};for(const L of T(k.value.length/4-1)){const D=k.value.readUInt32LE(L*4+4),W=!!(D&2147483648),H=D&2147483647;O.path+="/"+H.toString(10)+(W?"'":"")}return O}function w(k){const B=v.from([m]),O=v.concat([B,k.pubkey]),L=k.path.split("/"),D=v.allocUnsafe(L.length*4);k.masterFingerprint.copy(D,0);let W=4;return L.slice(1).forEach(H=>{const G=H.slice(-1)==="'";let Z=2147483647&parseInt(G?H.slice(0,-1):H,10);G&&(Z+=2147483648),D.writeUInt32LE(Z,W),W+=4}),{key:O,value:D}}const _="{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }";function A(k){return v.isBuffer(k.pubkey)&&v.isBuffer(k.masterFingerprint)&&typeof k.path=="string"&&b(k.pubkey)&&k.masterFingerprint.length===4}function S(k,B,O){const L=B.pubkey.toString("hex");return O.has(L)?!1:(O.add(L),k.filter(D=>D.pubkey.equals(B.pubkey)).length===0)}return{decode:g,encode:w,check:A,expected:_,canAddToArray:S}}p.makeConverter=I},35628:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0});function x(v){return T;function T(C){let I;if(v.includes(C.key[0])&&(I=C.key.slice(1),!(I.length===33||I.length===65)||![2,3,4].includes(I[0])))throw new Error("Format Error: invalid pubkey in key 0x"+C.key.toString("hex"));return I}}p.makeChecker=x},25347:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});function T(C){function I(_){if(_.key[0]!==C)throw new Error("Decode Error: could not decode redeemScript with key 0x"+_.key.toString("hex"));return _.value}function m(_){return{key:v.from([C]),value:_}}const b="Buffer";function g(_){return v.isBuffer(_)}function w(_,A){return!!_&&!!A&&_.redeemScript===void 0}return{decode:I,encode:m,check:g,expected:b,canAdd:w}}p.makeConverter=T},22804:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(40586),C=x(71913),I=b=>b.length===32;function m(b){const g=C.makeConverter(b,I);function w(k){const B=T.decode(k.value),O=T.encodingLength(B),L=g.decode({key:k.key,value:k.value.slice(O+B*32)}),D=new Array(B);for(let W=0,H=O;W<B;W++,H+=32)D[W]=k.value.slice(H,H+32);return Object.assign({},L,{leafHashes:D})}function _(k){const B=g.encode(k),O=T.encodingLength(k.leafHashes.length),L=v.allocUnsafe(O);T.encode(k.leafHashes.length,L);const D=v.concat([L,...k.leafHashes,B.value]);return Object.assign({},B,{value:D})}const A="{ masterFingerprint: Buffer; pubkey: Buffer; path: string; leafHashes: Buffer[]; }";function S(k){return Array.isArray(k.leafHashes)&&k.leafHashes.every(B=>v.isBuffer(B)&&B.length===32)&&g.check(k)}return{decode:w,encode:_,check:S,expected:A,canAddToArray:g.canAddToArray}}p.makeConverter=m},56527:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});function T(C){function I(_){if(_.key[0]!==C||_.key.length!==1)throw new Error("Decode Error: could not decode tapInternalKey with key 0x"+_.key.toString("hex"));if(_.value.length!==32)throw new Error("Decode Error: tapInternalKey not a 32-byte x-only pubkey");return _.value}function m(_){return{key:v.from([C]),value:_}}const b="Buffer";function g(_){return v.isBuffer(_)&&_.length===32}function w(_,A){return!!_&&!!A&&_.tapInternalKey===void 0}return{decode:I,encode:m,check:g,expected:b,canAdd:w}}p.makeConverter=T},186:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});function T(C){function I(_){if(_.key[0]!==C)throw new Error("Decode Error: could not decode witnessScript with key 0x"+_.key.toString("hex"));return _.value}function m(_){return{key:v.from([C]),value:_}}const b="Buffer";function g(_){return v.isBuffer(_)}function w(_,A){return!!_&&!!A&&_.witnessScript===void 0}return{decode:I,encode:m,check:g,expected:b,canAdd:w}}p.makeConverter=T},17365:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(40586);p.range=_=>[...Array(_).keys()];function C(_){if(_.length<1)return _;let A=_.length-1,S=0;for(let k=0;k<_.length/2;k++)S=_[k],_[k]=_[A],_[A]=S,A--;return _}p.reverseBuffer=C;function I(_){const A=_.map(m);return A.push(v.from([0])),v.concat(A)}p.keyValsToBuffer=I;function m(_){const A=_.key.length,S=_.value.length,k=T.encodingLength(A),B=T.encodingLength(S),O=v.allocUnsafe(k+A+B+S);return T.encode(A,O,0),_.key.copy(O,k),T.encode(S,O,k+A),_.value.copy(O,k+A+B),O}p.keyValToBuffer=m;function b(_,A){if(typeof _!="number")throw new Error("cannot write a non-number as a number");if(_<0)throw new Error("specified a negative value for writing an unsigned value");if(_>A)throw new Error("RangeError: value out of range");if(Math.floor(_)!==_)throw new Error("value has a fractional component")}function g(_,A){const S=_.readUInt32LE(A);let k=_.readUInt32LE(A+4);return k*=4294967296,b(k+S,9007199254740991),k+S}p.readUInt64LE=g;function w(_,A,S){return b(A,9007199254740991),_.writeInt32LE(A&-1,S),_.writeUInt32LE(Math.floor(A/4294967296),S+4),S+8}p.writeUInt64LE=w},40586:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=9007199254740991;function C(g){if(g<0||g>T||g%1!==0)throw new RangeError("value out of range")}function I(g,w,_){if(C(g),w||(w=v.allocUnsafe(b(g))),!v.isBuffer(w))throw new TypeError("buffer must be a Buffer instance");return _||(_=0),g<253?(w.writeUInt8(g,_),Object.assign(I,{bytes:1})):g<=65535?(w.writeUInt8(253,_),w.writeUInt16LE(g,_+1),Object.assign(I,{bytes:3})):g<=4294967295?(w.writeUInt8(254,_),w.writeUInt32LE(g,_+1),Object.assign(I,{bytes:5})):(w.writeUInt8(255,_),w.writeUInt32LE(g>>>0,_+1),w.writeUInt32LE(g/4294967296|0,_+5),Object.assign(I,{bytes:9})),w}p.encode=I;function m(g,w){if(!v.isBuffer(g))throw new TypeError("buffer must be a Buffer instance");w||(w=0);const _=g.readUInt8(w);if(_<253)return Object.assign(m,{bytes:1}),_;if(_===253)return Object.assign(m,{bytes:3}),g.readUInt16LE(w+1);if(_===254)return Object.assign(m,{bytes:5}),g.readUInt32LE(w+1);{Object.assign(m,{bytes:9});const A=g.readUInt32LE(w+1),k=g.readUInt32LE(w+5)*4294967296+A;return C(k),k}}p.decode=m;function b(g){return C(g),g<253?1:g<=65535?3:g<=4294967295?5:9}p.encodingLength=b},50887:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(30674),C=x(17365),I=x(40586),m=x(72776);function b(_,A){let S=0;function k(){const we=I.decode(_,S);S+=I.encodingLength(we);const Ae=_.slice(S,S+we);return S+=we,Ae}function B(){const we=_.readUInt32BE(S);return S+=4,we}function O(){const we=_.readUInt8(S);return S+=1,we}function L(){const we=k(),Ae=k();return{key:we,value:Ae}}function D(){if(S>=_.length)throw new Error("Format Error: Unexpected End of PSBT");const we=_.readUInt8(S)===0;return we&&S++,we}if(B()!==1886610036)throw new Error("Format Error: Invalid Magic Number");if(O()!==255)throw new Error("Format Error: Magic Number must be followed by 0xff separator");const W=[],H={};for(;!D();){const we=L(),Ae=we.key.toString("hex");if(H[Ae])throw new Error("Format Error: Keys must be unique for global keymap: key "+Ae);H[Ae]=1,W.push(we)}const G=W.filter(we=>we.key[0]===m.GlobalTypes.UNSIGNED_TX);if(G.length!==1)throw new Error("Format Error: Only one UNSIGNED_TX allowed");const Z=A(G[0].value),{inputCount:Q,outputCount:ie}=Z.getInputOutputCounts(),le=[],be=[];for(const we of C.range(Q)){const Ae={},re=[];for(;!D();){const N=L(),z=N.key.toString("hex");if(Ae[z])throw new Error("Format Error: Keys must be unique for each input: input index "+we+" key "+z);Ae[z]=1,re.push(N)}le.push(re)}for(const we of C.range(ie)){const Ae={},re=[];for(;!D();){const N=L(),z=N.key.toString("hex");if(Ae[z])throw new Error("Format Error: Keys must be unique for each output: output index "+we+" key "+z);Ae[z]=1,re.push(N)}be.push(re)}return w(Z,{globalMapKeyVals:W,inputKeyVals:le,outputKeyVals:be})}p.psbtFromBuffer=b;function g(_,A,S){if(!A.equals(v.from([S])))throw new Error(`Format Error: Invalid ${_} key: ${A.toString("hex")}`)}p.checkKeyBuffer=g;function w(_,{globalMapKeyVals:A,inputKeyVals:S,outputKeyVals:k}){const B={unsignedTx:_};let O=0;for(const G of A)switch(G.key[0]){case m.GlobalTypes.UNSIGNED_TX:if(g("global",G.key,m.GlobalTypes.UNSIGNED_TX),O>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");O++;break;case m.GlobalTypes.GLOBAL_XPUB:B.globalXpub===void 0&&(B.globalXpub=[]),B.globalXpub.push(T.globals.globalXpub.decode(G));break;default:B.unknownKeyVals||(B.unknownKeyVals=[]),B.unknownKeyVals.push(G)}const L=S.length,D=k.length,W=[],H=[];for(const G of C.range(L)){const Z={};for(const Q of S[G])switch(T.inputs.checkPubkey(Q),Q.key[0]){case m.InputTypes.NON_WITNESS_UTXO:if(g("input",Q.key,m.InputTypes.NON_WITNESS_UTXO),Z.nonWitnessUtxo!==void 0)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");Z.nonWitnessUtxo=T.inputs.nonWitnessUtxo.decode(Q);break;case m.InputTypes.WITNESS_UTXO:if(g("input",Q.key,m.InputTypes.WITNESS_UTXO),Z.witnessUtxo!==void 0)throw new Error("Format Error: Input has multiple WITNESS_UTXO");Z.witnessUtxo=T.inputs.witnessUtxo.decode(Q);break;case m.InputTypes.PARTIAL_SIG:Z.partialSig===void 0&&(Z.partialSig=[]),Z.partialSig.push(T.inputs.partialSig.decode(Q));break;case m.InputTypes.SIGHASH_TYPE:if(g("input",Q.key,m.InputTypes.SIGHASH_TYPE),Z.sighashType!==void 0)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");Z.sighashType=T.inputs.sighashType.decode(Q);break;case m.InputTypes.REDEEM_SCRIPT:if(g("input",Q.key,m.InputTypes.REDEEM_SCRIPT),Z.redeemScript!==void 0)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");Z.redeemScript=T.inputs.redeemScript.decode(Q);break;case m.InputTypes.WITNESS_SCRIPT:if(g("input",Q.key,m.InputTypes.WITNESS_SCRIPT),Z.witnessScript!==void 0)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");Z.witnessScript=T.inputs.witnessScript.decode(Q);break;case m.InputTypes.BIP32_DERIVATION:Z.bip32Derivation===void 0&&(Z.bip32Derivation=[]),Z.bip32Derivation.push(T.inputs.bip32Derivation.decode(Q));break;case m.InputTypes.FINAL_SCRIPTSIG:g("input",Q.key,m.InputTypes.FINAL_SCRIPTSIG),Z.finalScriptSig=T.inputs.finalScriptSig.decode(Q);break;case m.InputTypes.FINAL_SCRIPTWITNESS:g("input",Q.key,m.InputTypes.FINAL_SCRIPTWITNESS),Z.finalScriptWitness=T.inputs.finalScriptWitness.decode(Q);break;case m.InputTypes.POR_COMMITMENT:g("input",Q.key,m.InputTypes.POR_COMMITMENT),Z.porCommitment=T.inputs.porCommitment.decode(Q);break;case m.InputTypes.TAP_KEY_SIG:g("input",Q.key,m.InputTypes.TAP_KEY_SIG),Z.tapKeySig=T.inputs.tapKeySig.decode(Q);break;case m.InputTypes.TAP_SCRIPT_SIG:Z.tapScriptSig===void 0&&(Z.tapScriptSig=[]),Z.tapScriptSig.push(T.inputs.tapScriptSig.decode(Q));break;case m.InputTypes.TAP_LEAF_SCRIPT:Z.tapLeafScript===void 0&&(Z.tapLeafScript=[]),Z.tapLeafScript.push(T.inputs.tapLeafScript.decode(Q));break;case m.InputTypes.TAP_BIP32_DERIVATION:Z.tapBip32Derivation===void 0&&(Z.tapBip32Derivation=[]),Z.tapBip32Derivation.push(T.inputs.tapBip32Derivation.decode(Q));break;case m.InputTypes.TAP_INTERNAL_KEY:g("input",Q.key,m.InputTypes.TAP_INTERNAL_KEY),Z.tapInternalKey=T.inputs.tapInternalKey.decode(Q);break;case m.InputTypes.TAP_MERKLE_ROOT:g("input",Q.key,m.InputTypes.TAP_MERKLE_ROOT),Z.tapMerkleRoot=T.inputs.tapMerkleRoot.decode(Q);break;default:Z.unknownKeyVals||(Z.unknownKeyVals=[]),Z.unknownKeyVals.push(Q)}W.push(Z)}for(const G of C.range(D)){const Z={};for(const Q of k[G])switch(T.outputs.checkPubkey(Q),Q.key[0]){case m.OutputTypes.REDEEM_SCRIPT:if(g("output",Q.key,m.OutputTypes.REDEEM_SCRIPT),Z.redeemScript!==void 0)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");Z.redeemScript=T.outputs.redeemScript.decode(Q);break;case m.OutputTypes.WITNESS_SCRIPT:if(g("output",Q.key,m.OutputTypes.WITNESS_SCRIPT),Z.witnessScript!==void 0)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");Z.witnessScript=T.outputs.witnessScript.decode(Q);break;case m.OutputTypes.BIP32_DERIVATION:Z.bip32Derivation===void 0&&(Z.bip32Derivation=[]),Z.bip32Derivation.push(T.outputs.bip32Derivation.decode(Q));break;case m.OutputTypes.TAP_INTERNAL_KEY:g("output",Q.key,m.OutputTypes.TAP_INTERNAL_KEY),Z.tapInternalKey=T.outputs.tapInternalKey.decode(Q);break;case m.OutputTypes.TAP_TREE:g("output",Q.key,m.OutputTypes.TAP_TREE),Z.tapTree=T.outputs.tapTree.decode(Q);break;case m.OutputTypes.TAP_BIP32_DERIVATION:Z.tapBip32Derivation===void 0&&(Z.tapBip32Derivation=[]),Z.tapBip32Derivation.push(T.outputs.tapBip32Derivation.decode(Q));break;default:Z.unknownKeyVals||(Z.unknownKeyVals=[]),Z.unknownKeyVals.push(Q)}H.push(Z)}return{globalMap:B,inputs:W,outputs:H}}p.psbtFromKeyVals=w},33153:function(fe,p,x){"use strict";function v(T){for(var C in T)p.hasOwnProperty(C)||(p[C]=T[C])}Object.defineProperty(p,"__esModule",{value:!0}),v(x(50887)),v(x(30094))},30094:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(30674),C=x(17365);function I({globalMap:w,inputs:_,outputs:A}){const{globalKeyVals:S,inputKeyVals:k,outputKeyVals:B}=g({globalMap:w,inputs:_,outputs:A}),O=C.keyValsToBuffer(S),L=G=>G.length===0?[v.from([0])]:G.map(C.keyValsToBuffer),D=L(k),W=L(B),H=v.allocUnsafe(5);return H.writeUIntBE(482972169471,0,5),v.concat([H,O].concat(D,W))}p.psbtToBuffer=I;const m=(w,_)=>w.key.compare(_.key);function b(w,_){const A=new Set,S=Object.entries(w).reduce((B,[O,L])=>{if(O==="unknownKeyVals")return B;const D=_[O];if(D===void 0)return B;const W=(Array.isArray(L)?L:[L]).map(D.encode);return W.map(G=>G.key.toString("hex")).forEach(G=>{if(A.has(G))throw new Error("Serialize Error: Duplicate key: "+G);A.add(G)}),B.concat(W)},[]),k=w.unknownKeyVals?w.unknownKeyVals.filter(B=>!A.has(B.key.toString("hex"))):[];return S.concat(k).sort(m)}function g({globalMap:w,inputs:_,outputs:A}){return{globalKeyVals:b(w,T.globals),inputKeyVals:_.map(S=>b(S,T.inputs)),outputKeyVals:A.map(S=>b(S,T.outputs))}}p.psbtToKeyVals=g},65646:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(33599),C=x(33153),I=x(72776),m=x(88536);class b{constructor(w){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:w}}static fromBase64(w,_){const A=v.from(w,"base64");return this.fromBuffer(A,_)}static fromHex(w,_){const A=v.from(w,"hex");return this.fromBuffer(A,_)}static fromBuffer(w,_){const A=C.psbtFromBuffer(w,_),S=new this(A.globalMap.unsignedTx);return Object.assign(S,A),S}toBase64(){return this.toBuffer().toString("base64")}toHex(){return this.toBuffer().toString("hex")}toBuffer(){return C.psbtToBuffer(this)}updateGlobal(w){return m.updateGlobal(w,this.globalMap),this}updateInput(w,_){const A=m.checkForInput(this.inputs,w);return m.updateInput(_,A),this}updateOutput(w,_){const A=m.checkForOutput(this.outputs,w);return m.updateOutput(_,A),this}addUnknownKeyValToGlobal(w){return m.checkHasKey(w,this.globalMap.unknownKeyVals,m.getEnumLength(I.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(w),this}addUnknownKeyValToInput(w,_){const A=m.checkForInput(this.inputs,w);return m.checkHasKey(_,A.unknownKeyVals,m.getEnumLength(I.InputTypes)),A.unknownKeyVals||(A.unknownKeyVals=[]),A.unknownKeyVals.push(_),this}addUnknownKeyValToOutput(w,_){const A=m.checkForOutput(this.outputs,w);return m.checkHasKey(_,A.unknownKeyVals,m.getEnumLength(I.OutputTypes)),A.unknownKeyVals||(A.unknownKeyVals=[]),A.unknownKeyVals.push(_),this}addInput(w){this.globalMap.unsignedTx.addInput(w),this.inputs.push({unknownKeyVals:[]});const _=w.unknownKeyVals||[],A=this.inputs.length-1;if(!Array.isArray(_))throw new Error("unknownKeyVals must be an Array");return _.forEach(S=>this.addUnknownKeyValToInput(A,S)),m.addInputAttributes(this.inputs,w),this}addOutput(w){this.globalMap.unsignedTx.addOutput(w),this.outputs.push({unknownKeyVals:[]});const _=w.unknownKeyVals||[],A=this.outputs.length-1;if(!Array.isArray(_))throw new Error("unknownKeyVals must be an Array");return _.forEach(S=>this.addUnknownKeyValToOutput(A,S)),m.addOutputAttributes(this.outputs,w),this}clearFinalizedInput(w){const _=m.checkForInput(this.inputs,w);m.inputCheckUncleanFinalized(w,_);for(const A of Object.keys(_))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(A)||delete _[A];return this}combine(...w){const _=T.combine([this].concat(w));return Object.assign(this,_),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}}p.Psbt=b},72776:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0});var x;(function(C){C[C.UNSIGNED_TX=0]="UNSIGNED_TX",C[C.GLOBAL_XPUB=1]="GLOBAL_XPUB"})(x=p.GlobalTypes||(p.GlobalTypes={})),p.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"];var v;(function(C){C[C.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",C[C.WITNESS_UTXO=1]="WITNESS_UTXO",C[C.PARTIAL_SIG=2]="PARTIAL_SIG",C[C.SIGHASH_TYPE=3]="SIGHASH_TYPE",C[C.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",C[C.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",C[C.BIP32_DERIVATION=6]="BIP32_DERIVATION",C[C.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",C[C.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",C[C.POR_COMMITMENT=9]="POR_COMMITMENT",C[C.TAP_KEY_SIG=19]="TAP_KEY_SIG",C[C.TAP_SCRIPT_SIG=20]="TAP_SCRIPT_SIG",C[C.TAP_LEAF_SCRIPT=21]="TAP_LEAF_SCRIPT",C[C.TAP_BIP32_DERIVATION=22]="TAP_BIP32_DERIVATION",C[C.TAP_INTERNAL_KEY=23]="TAP_INTERNAL_KEY",C[C.TAP_MERKLE_ROOT=24]="TAP_MERKLE_ROOT"})(v=p.InputTypes||(p.InputTypes={})),p.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment","tapKeySig","tapScriptSig","tapLeafScript","tapBip32Derivation","tapInternalKey","tapMerkleRoot"];var T;(function(C){C[C.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",C[C.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",C[C.BIP32_DERIVATION=2]="BIP32_DERIVATION",C[C.TAP_INTERNAL_KEY=5]="TAP_INTERNAL_KEY",C[C.TAP_TREE=6]="TAP_TREE",C[C.TAP_BIP32_DERIVATION=7]="TAP_BIP32_DERIVATION"})(T=p.OutputTypes||(p.OutputTypes={})),p.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation","tapInternalKey","tapTree","tapBip32Derivation"]},88536:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});const T=x(30674);function C(O,L){const D=O[L];if(D===void 0)throw new Error(`No input #${L}`);return D}p.checkForInput=C;function I(O,L){const D=O[L];if(D===void 0)throw new Error(`No output #${L}`);return D}p.checkForOutput=I;function m(O,L,D){if(O.key[0]<D)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(L&&L.filter(W=>W.key.equals(O.key)).length!==0)throw new Error(`Duplicate Key: ${O.key.toString("hex")}`)}p.checkHasKey=m;function b(O){let L=0;return Object.keys(O).forEach(D=>{Number(isNaN(Number(D)))&&L++}),L}p.getEnumLength=b;function g(O,L){let D=!1;if(L.nonWitnessUtxo||L.witnessUtxo){const W=!!L.redeemScript,H=!!L.witnessScript,G=!W||!!L.finalScriptSig,Z=!H||!!L.finalScriptWitness,Q=!!L.finalScriptSig||!!L.finalScriptWitness;D=G&&Z&&Q}if(D===!1)throw new Error(`Input #${O} has too much or too little data to clean`)}p.inputCheckUncleanFinalized=g;function w(O,L,D,W){throw new Error(`Data for ${O} key ${L} is incorrect: Expected ${D} and got ${JSON.stringify(W)}`)}function _(O){return(L,D)=>{for(const W of Object.keys(L)){const H=L[W],{canAdd:G,canAddToArray:Z,check:Q,expected:ie}=T[O+"s"][W]||{},le=!!Z;if(Q)if(le){if(!Array.isArray(H)||D[W]&&!Array.isArray(D[W]))throw new Error(`Key type ${W} must be an array`);H.every(Q)||w(O,W,ie,H);const be=D[W]||[],we=new Set;if(!H.every(Ae=>Z(be,Ae,we)))throw new Error("Can not add duplicate data to array");D[W]=be.concat(H)}else{if(Q(H)||w(O,W,ie,H),!G(D,H))throw new Error(`Can not add duplicate data to ${O}`);D[W]=H}}}}p.updateGlobal=_("global"),p.updateInput=_("input"),p.updateOutput=_("output");function A(O,L){const D=O.length-1,W=C(O,D);p.updateInput(L,W)}p.addInputAttributes=A;function S(O,L){const D=O.length-1,W=I(O,D);p.updateOutput(L,W)}p.addOutputAttributes=S;function k(O,L){if(!v.isBuffer(L)||L.length<4)throw new Error("Set Version: Invalid Transaction");return L.writeUInt32LE(O,0),L}p.defaultVersionSetter=k;function B(O,L){if(!v.isBuffer(L)||L.length<4)throw new Error("Set Locktime: Invalid Transaction");return L.writeUInt32LE(O,L.length-4),L}p.defaultLocktimeSetter=B},90163:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.toOutputScript=p.fromOutputScript=p.toBech32=p.toBase58Check=p.fromBech32=p.fromBase58Check=void 0;const T=x(12784),C=x(52127),I=x(42940),m=x(9550),b=x(60509),g=x(65916),w=40,_=2,A=16,S=2,k=80,B="WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";function O(Q,ie){const le=Q.slice(2);if(le.length<_||le.length>w)throw new TypeError("Invalid program length for segwit address");const be=Q[0]-k;if(be<S||be>A)throw new TypeError("Invalid version for segwit address");if(Q[1]!==le.length)throw new TypeError("Invalid script for segwit address");return console.warn(B),H(le,be,ie.bech32)}function L(Q){const ie=v.from(g.decode(Q));if(ie.length<21)throw new TypeError(Q+" is too short");if(ie.length>21)throw new TypeError(Q+" is too long");const le=ie.readUInt8(0),be=ie.slice(1);return{version:le,hash:be}}p.fromBase58Check=L;function D(Q){let ie,le;try{ie=b.bech32.decode(Q)}catch{}if(ie){if(le=ie.words[0],le!==0)throw new TypeError(Q+" uses wrong encoding")}else if(ie=b.bech32m.decode(Q),le=ie.words[0],le===0)throw new TypeError(Q+" uses wrong encoding");const be=b.bech32.fromWords(ie.words.slice(1));return{version:le,prefix:ie.prefix,data:v.from(be)}}p.fromBech32=D;function W(Q,ie){(0,m.typeforce)((0,m.tuple)(m.Hash160bit,m.UInt8),arguments);const le=v.allocUnsafe(21);return le.writeUInt8(ie,0),Q.copy(le,1),g.encode(le)}p.toBase58Check=W;function H(Q,ie,le){const be=b.bech32.toWords(Q);return be.unshift(ie),ie===0?b.bech32.encode(le,be):b.bech32m.encode(le,be)}p.toBech32=H;function G(Q,ie){ie=ie||T.bitcoin;try{return C.p2pkh({output:Q,network:ie}).address}catch{}try{return C.p2sh({output:Q,network:ie}).address}catch{}try{return C.p2wpkh({output:Q,network:ie}).address}catch{}try{return C.p2wsh({output:Q,network:ie}).address}catch{}try{return C.p2tr({output:Q,network:ie}).address}catch{}try{return O(Q,ie)}catch{}throw new Error(I.toASM(Q)+" has no matching Address")}p.fromOutputScript=G;function Z(Q,ie){ie=ie||T.bitcoin;let le,be;try{le=L(Q)}catch{}if(le){if(le.version===ie.pubKeyHash)return C.p2pkh({hash:le.hash}).output;if(le.version===ie.scriptHash)return C.p2sh({hash:le.hash}).output}else{try{be=D(Q)}catch{}if(be){if(be.prefix!==ie.bech32)throw new Error(Q+" has an invalid prefix");if(be.version===0){if(be.data.length===20)return C.p2wpkh({hash:be.data}).output;if(be.data.length===32)return C.p2wsh({hash:be.data}).output}else if(be.version===1){if(be.data.length===32)return C.p2tr({pubkey:be.data}).output}else if(be.version>=S&&be.version<=A&&be.data.length>=_&&be.data.length<=w)return console.warn(B),I.compile([be.version+k,be.data])}}throw new Error(Q+" has no matching Script")}p.toOutputScript=Z},89584:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.encode=p.decode=p.check=void 0;function T(m){if(m.length<8||m.length>72||m[0]!==48||m[1]!==m.length-2||m[2]!==2)return!1;const b=m[3];if(b===0||5+b>=m.length||m[4+b]!==2)return!1;const g=m[5+b];return!(g===0||6+b+g!==m.length||m[4]&128||b>1&&m[4]===0&&!(m[5]&128)||m[b+6]&128||g>1&&m[b+6]===0&&!(m[b+7]&128))}p.check=T;function C(m){if(m.length<8)throw new Error("DER sequence length is too short");if(m.length>72)throw new Error("DER sequence length is too long");if(m[0]!==48)throw new Error("Expected DER sequence");if(m[1]!==m.length-2)throw new Error("DER sequence length is invalid");if(m[2]!==2)throw new Error("Expected DER integer");const b=m[3];if(b===0)throw new Error("R length is zero");if(5+b>=m.length)throw new Error("R length is too long");if(m[4+b]!==2)throw new Error("Expected DER integer (2)");const g=m[5+b];if(g===0)throw new Error("S length is zero");if(6+b+g!==m.length)throw new Error("S length is invalid");if(m[4]&128)throw new Error("R value is negative");if(b>1&&m[4]===0&&!(m[5]&128))throw new Error("R value excessively padded");if(m[b+6]&128)throw new Error("S value is negative");if(g>1&&m[b+6]===0&&!(m[b+7]&128))throw new Error("S value excessively padded");return{r:m.slice(4,4+b),s:m.slice(6+b)}}p.decode=C;function I(m,b){const g=m.length,w=b.length;if(g===0)throw new Error("R length is zero");if(w===0)throw new Error("S length is zero");if(g>33)throw new Error("R length is too long");if(w>33)throw new Error("S length is too long");if(m[0]&128)throw new Error("R value is negative");if(b[0]&128)throw new Error("S value is negative");if(g>1&&m[0]===0&&!(m[1]&128))throw new Error("R value excessively padded");if(w>1&&b[0]===0&&!(b[1]&128))throw new Error("S value excessively padded");const _=v.allocUnsafe(6+g+w);return _[0]=48,_[1]=_.length-2,_[2]=2,_[3]=m.length,m.copy(_,4),_[4+g]=2,_[5+g]=b.length,b.copy(_,6+g),_}p.encode=I},62206:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.Block=void 0;const T=x(67640),C=x(1502),I=x(3153),m=x(44491),b=x(9550),{typeforce:g}=b,w=new TypeError("Cannot compute merkle root for zero transactions"),_=new TypeError("Cannot compute witness commit for non-segwit block");class A{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(O){if(O.length<80)throw new Error("Buffer too small (< 80 bytes)");const L=new T.BufferReader(O),D=new A;if(D.version=L.readInt32(),D.prevHash=L.readSlice(32),D.merkleRoot=L.readSlice(32),D.timestamp=L.readUInt32(),D.bits=L.readUInt32(),D.nonce=L.readUInt32(),O.length===80)return D;const W=()=>{const Z=m.Transaction.fromBuffer(L.buffer.slice(L.offset),!0);return L.offset+=Z.byteLength(),Z},H=L.readVarInt();D.transactions=[];for(let Z=0;Z<H;++Z){const Q=W();D.transactions.push(Q)}const G=D.getWitnessCommit();return G&&(D.witnessCommit=G),D}static fromHex(O){return A.fromBuffer(v.from(O,"hex"))}static calculateTarget(O){const L=((O&4278190080)>>24)-3,D=O&8388607,W=v.alloc(32,0);return W.writeUIntBE(D,29-L,3),W}static calculateMerkleRoot(O,L){if(g([{getHash:b.Function}],O),O.length===0)throw w;if(L&&!S(O))throw _;const D=O.map(H=>H.getHash(L)),W=(0,I.fastMerkleRoot)(D,C.hash256);return L?C.hash256(v.concat([W,O[0].ins[0].witness[0]])):W}getWitnessCommit(){if(!S(this.transactions))return null;const O=this.transactions[0].outs.filter(D=>D.script.slice(0,6).equals(v.from("6a24aa21a9ed","hex"))).map(D=>D.script.slice(6,38));if(O.length===0)return null;const L=O[O.length-1];return L instanceof v&&L.length===32?L:null}hasWitnessCommit(){return this.witnessCommit instanceof v&&this.witnessCommit.length===32||this.getWitnessCommit()!==null}hasWitness(){return k(this.transactions)}weight(){const O=this.byteLength(!1,!1),L=this.byteLength(!1,!0);return O*3+L}byteLength(O,L=!0){return O||!this.transactions?80:80+T.varuint.encodingLength(this.transactions.length)+this.transactions.reduce((D,W)=>D+W.byteLength(L),0)}getHash(){return C.hash256(this.toBuffer(!0))}getId(){return(0,T.reverseBuffer)(this.getHash()).toString("hex")}getUTCDate(){const O=new Date(0);return O.setUTCSeconds(this.timestamp),O}toBuffer(O){const L=v.allocUnsafe(this.byteLength(O)),D=new T.BufferWriter(L);return D.writeInt32(this.version),D.writeSlice(this.prevHash),D.writeSlice(this.merkleRoot),D.writeUInt32(this.timestamp),D.writeUInt32(this.bits),D.writeUInt32(this.nonce),O||!this.transactions||(T.varuint.encode(this.transactions.length,L,D.offset),D.offset+=T.varuint.encode.bytes,this.transactions.forEach(W=>{const H=W.byteLength();W.toBuffer(L,D.offset),D.offset+=H})),L}toHex(O){return this.toBuffer(O).toString("hex")}checkTxRoots(){const O=this.hasWitnessCommit();return!O&&this.hasWitness()?!1:this.__checkMerkleRoot()&&(O?this.__checkWitnessCommit():!0)}checkProofOfWork(){const O=(0,T.reverseBuffer)(this.getHash()),L=A.calculateTarget(this.bits);return O.compare(L)<=0}__checkMerkleRoot(){if(!this.transactions)throw w;const O=A.calculateMerkleRoot(this.transactions);return this.merkleRoot.compare(O)===0}__checkWitnessCommit(){if(!this.transactions)throw w;if(!this.hasWitnessCommit())throw _;const O=A.calculateMerkleRoot(this.transactions,!0);return this.witnessCommit.compare(O)===0}}p.Block=A;function S(B){return B instanceof Array&&B[0]&&B[0].ins&&B[0].ins instanceof Array&&B[0].ins[0]&&B[0].ins[0].witness&&B[0].ins[0].witness instanceof Array&&B[0].ins[0].witness.length>0}function k(B){return B instanceof Array&&B.some(O=>typeof O=="object"&&O.ins instanceof Array&&O.ins.some(L=>typeof L=="object"&&L.witness instanceof Array&&L.witness.length>0))}},67640:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.BufferReader=p.BufferWriter=p.cloneBuffer=p.reverseBuffer=p.writeUInt64LE=p.readUInt64LE=p.varuint=void 0;const T=x(9550),{typeforce:C}=T,I=x(60488);p.varuint=I;function m(k,B){if(typeof k!="number")throw new Error("cannot write a non-number as a number");if(k<0)throw new Error("specified a negative value for writing an unsigned value");if(k>B)throw new Error("RangeError: value out of range");if(Math.floor(k)!==k)throw new Error("value has a fractional component")}function b(k,B){const O=k.readUInt32LE(B);let L=k.readUInt32LE(B+4);return L*=4294967296,m(L+O,9007199254740991),L+O}p.readUInt64LE=b;function g(k,B,O){return m(B,9007199254740991),k.writeInt32LE(B&-1,O),k.writeUInt32LE(Math.floor(B/4294967296),O+4),O+8}p.writeUInt64LE=g;function w(k){if(k.length<1)return k;let B=k.length-1,O=0;for(let L=0;L<k.length/2;L++)O=k[L],k[L]=k[B],k[B]=O,B--;return k}p.reverseBuffer=w;function _(k){const B=v.allocUnsafe(k.length);return k.copy(B),B}p.cloneBuffer=_;class A{static withCapacity(B){return new A(v.alloc(B))}constructor(B,O=0){this.buffer=B,this.offset=O,C(T.tuple(T.Buffer,T.UInt32),[B,O])}writeUInt8(B){this.offset=this.buffer.writeUInt8(B,this.offset)}writeInt32(B){this.offset=this.buffer.writeInt32LE(B,this.offset)}writeUInt32(B){this.offset=this.buffer.writeUInt32LE(B,this.offset)}writeUInt64(B){this.offset=g(this.buffer,B,this.offset)}writeVarInt(B){I.encode(B,this.buffer,this.offset),this.offset+=I.encode.bytes}writeSlice(B){if(this.buffer.length<this.offset+B.length)throw new Error("Cannot write slice out of bounds");this.offset+=B.copy(this.buffer,this.offset)}writeVarSlice(B){this.writeVarInt(B.length),this.writeSlice(B)}writeVector(B){this.writeVarInt(B.length),B.forEach(O=>this.writeVarSlice(O))}end(){if(this.buffer.length===this.offset)return this.buffer;throw new Error(`buffer size ${this.buffer.length}, offset ${this.offset}`)}}p.BufferWriter=A;class S{constructor(B,O=0){this.buffer=B,this.offset=O,C(T.tuple(T.Buffer,T.UInt32),[B,O])}readUInt8(){const B=this.buffer.readUInt8(this.offset);return this.offset++,B}readInt32(){const B=this.buffer.readInt32LE(this.offset);return this.offset+=4,B}readUInt32(){const B=this.buffer.readUInt32LE(this.offset);return this.offset+=4,B}readUInt64(){const B=b(this.buffer,this.offset);return this.offset+=8,B}readVarInt(){const B=I.decode(this.buffer,this.offset);return this.offset+=I.decode.bytes,B}readSlice(B){if(this.buffer.length<this.offset+B)throw new Error("Cannot read slice out of bounds");const O=this.buffer.slice(this.offset,this.offset+B);return this.offset+=B,O}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){const B=this.readVarInt(),O=[];for(let L=0;L<B;L++)O.push(this.readVarSlice());return O}}p.BufferReader=S},1502:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.taggedHash=p.TAGGED_HASH_PREFIXES=p.TAGS=p.hash256=p.hash160=p.sha256=p.sha1=p.ripemd160=void 0;const T=x(84556),C=x(85035),I=x(23741);function m(S){return v.from((0,T.ripemd160)(Uint8Array.from(S)))}p.ripemd160=m;function b(S){return v.from((0,C.sha1)(Uint8Array.from(S)))}p.sha1=b;function g(S){return v.from((0,I.sha256)(Uint8Array.from(S)))}p.sha256=g;function w(S){return v.from((0,T.ripemd160)((0,I.sha256)(Uint8Array.from(S))))}p.hash160=w;function _(S){return v.from((0,I.sha256)((0,I.sha256)(Uint8Array.from(S))))}p.hash256=_,p.TAGS=["BIP0340/challenge","BIP0340/aux","BIP0340/nonce","TapLeaf","TapBranch","TapSighash","TapTweak","KeyAgg list","KeyAgg coefficient"],p.TAGGED_HASH_PREFIXES={"BIP0340/challenge":v.from([123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124,123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124]),"BIP0340/aux":v.from([241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144,241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144]),"BIP0340/nonce":v.from([7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47,7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47]),TapLeaf:v.from([174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238,174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238]),TapBranch:v.from([25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21,25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21]),TapSighash:v.from([244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49,244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49]),TapTweak:v.from([232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233,232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233]),"KeyAgg list":v.from([72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240,72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240]),"KeyAgg coefficient":v.from([191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129,191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129])};function A(S,k){return g(v.concat([p.TAGGED_HASH_PREFIXES[S],k]))}p.taggedHash=A},73618:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.getEccLib=p.initEccLib=void 0;const T={};function C(_){_?_!==T.eccLib&&(b(_),T.eccLib=_):T.eccLib=_}p.initEccLib=C;function I(){if(!T.eccLib)throw new Error("No ECC Library provided. You must call initEccLib() with a valid TinySecp256k1Interface instance");return T.eccLib}p.getEccLib=I;const m=_=>v.from(_,"hex");function b(_){g(typeof _.isXOnlyPoint=="function"),g(_.isXOnlyPoint(m("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),g(_.isXOnlyPoint(m("fffffffffffffffffffffffffffffffffffffffffffffffffffffffeeffffc2e"))),g(_.isXOnlyPoint(m("f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9"))),g(_.isXOnlyPoint(m("0000000000000000000000000000000000000000000000000000000000000001"))),g(!_.isXOnlyPoint(m("0000000000000000000000000000000000000000000000000000000000000000"))),g(!_.isXOnlyPoint(m("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"))),g(typeof _.xOnlyPointAddTweak=="function"),w.forEach(A=>{const S=_.xOnlyPointAddTweak(m(A.pubkey),m(A.tweak));A.result===null?g(S===null):(g(S!==null),g(S.parity===A.parity),g(v.from(S.xOnlyPubkey).equals(m(A.result))))})}function g(_){if(!_)throw new Error("ecc library invalid")}const w=[{pubkey:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",tweak:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",parity:-1,result:null},{pubkey:"1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b",tweak:"a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac",parity:1,result:"e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"},{pubkey:"2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991",tweak:"823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47",parity:0,result:"9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"}]},83351:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.initEccLib=p.Transaction=p.opcodes=p.Psbt=p.Block=p.script=p.payments=p.networks=p.crypto=p.address=void 0;const v=x(90163);p.address=v;const T=x(1502);p.crypto=T;const C=x(12784);p.networks=C;const I=x(52127);p.payments=I;const m=x(42940);p.script=m;var b=x(62206);Object.defineProperty(p,"Block",{enumerable:!0,get:function(){return b.Block}});var g=x(58176);Object.defineProperty(p,"Psbt",{enumerable:!0,get:function(){return g.Psbt}});var w=x(29991);Object.defineProperty(p,"opcodes",{enumerable:!0,get:function(){return w.OPS}});var _=x(44491);Object.defineProperty(p,"Transaction",{enumerable:!0,get:function(){return _.Transaction}});var A=x(73618);Object.defineProperty(p,"initEccLib",{enumerable:!0,get:function(){return A.initEccLib}})},3153:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.fastMerkleRoot=void 0;function T(C,I){if(!Array.isArray(C))throw TypeError("Expected values Array");if(typeof I!="function")throw TypeError("Expected digest Function");let m=C.length;const b=C.concat();for(;m>1;){let g=0;for(let w=0;w<m;w+=2,++g){const _=b[w],A=w+1===m?_:b[w+1],S=v.concat([_,A]);b[g]=I(S)}m=g}return b[0]}p.fastMerkleRoot=T},12784:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.testnet=p.regtest=p.bitcoin=void 0,p.bitcoin={messagePrefix:`Bitcoin Signed Message:
|
||
`,bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},p.regtest={messagePrefix:`Bitcoin Signed Message:
|
||
`,bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},p.testnet={messagePrefix:`Bitcoin Signed Message:
|
||
`,bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},29991:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.REVERSE_OPS=p.OPS=void 0;const x={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_SUBSTR:127,OP_LEFT:128,OP_RIGHT: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_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_CHECKSIGADD:186,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};p.OPS=x;const v={};p.REVERSE_OPS=v;for(const T of Object.keys(x)){const C=x[T];v[C]=T}},31340:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.tweakKey=p.tapTweakHash=p.tapleafHash=p.findScriptPath=p.toHashTree=p.rootHashFromPath=p.MAX_TAPTREE_DEPTH=p.LEAF_VERSION_TAPSCRIPT=void 0;const v=x(36533),T=x(73618),C=x(1502),I=x(67640),m=x(9550);p.LEAF_VERSION_TAPSCRIPT=192,p.MAX_TAPTREE_DEPTH=128;const b=L=>"left"in L&&"right"in L;function g(L,D){if(L.length<33)throw new TypeError(`The control-block length is too small. Got ${L.length}, expected min 33.`);const W=(L.length-33)/32;let H=D;for(let G=0;G<W;G++){const Z=L.slice(33+32*G,65+32*G);H.compare(Z)<0?H=B(H,Z):H=B(Z,H)}return H}p.rootHashFromPath=g;function w(L){if((0,m.isTapleaf)(L))return{hash:A(L)};const D=[w(L[0]),w(L[1])];D.sort((G,Z)=>G.hash.compare(Z.hash));const[W,H]=D;return{hash:B(W.hash,H.hash),left:W,right:H}}p.toHashTree=w;function _(L,D){if(b(L)){const W=_(L.left,D);if(W!==void 0)return[...W,L.right.hash];const H=_(L.right,D);if(H!==void 0)return[...H,L.left.hash]}else if(L.hash.equals(D))return[]}p.findScriptPath=_;function A(L){const D=L.version||p.LEAF_VERSION_TAPSCRIPT;return C.taggedHash("TapLeaf",v.Buffer.concat([v.Buffer.from([D]),O(L.output)]))}p.tapleafHash=A;function S(L,D){return C.taggedHash("TapTweak",v.Buffer.concat(D?[L,D]:[L]))}p.tapTweakHash=S;function k(L,D){if(!v.Buffer.isBuffer(L)||L.length!==32||D&&D.length!==32)return null;const W=S(L,D),H=(0,T.getEccLib)().xOnlyPointAddTweak(L,W);return!H||H.xOnlyPubkey===null?null:{parity:H.parity,x:v.Buffer.from(H.xOnlyPubkey)}}p.tweakKey=k;function B(L,D){return C.taggedHash("TapBranch",v.Buffer.concat([L,D]))}function O(L){const D=I.varuint.encodingLength(L.length),W=v.Buffer.allocUnsafe(D);return I.varuint.encode(L.length,W),v.Buffer.concat([W,L])}},83402:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.p2data=void 0;const v=x(12784),T=x(42940),C=x(9550),I=x(87089),m=T.OPS;function b(w,_){return w.length!==_.length?!1:w.every((A,S)=>A.equals(_[S]))}function g(w,_){if(!w.data&&!w.output)throw new TypeError("Not enough data");_=Object.assign({validate:!0},_||{}),(0,C.typeforce)({network:C.typeforce.maybe(C.typeforce.Object),output:C.typeforce.maybe(C.typeforce.Buffer),data:C.typeforce.maybe(C.typeforce.arrayOf(C.typeforce.Buffer))},w);const S={name:"embed",network:w.network||v.bitcoin};if(I.prop(S,"output",()=>{if(w.data)return T.compile([m.OP_RETURN].concat(w.data))}),I.prop(S,"data",()=>{if(w.output)return T.decompile(w.output).slice(1)}),_.validate&&w.output){const k=T.decompile(w.output);if(k[0]!==m.OP_RETURN)throw new TypeError("Output is invalid");if(!k.slice(1).every(C.typeforce.Buffer))throw new TypeError("Output is invalid");if(w.data&&!b(w.data,S.data))throw new TypeError("Data mismatch")}return Object.assign(S,w)}p.p2data=g},52127:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.p2tr=p.p2wsh=p.p2wpkh=p.p2sh=p.p2pkh=p.p2pk=p.p2ms=p.embed=void 0;const v=x(83402);Object.defineProperty(p,"embed",{enumerable:!0,get:function(){return v.p2data}});const T=x(69165);Object.defineProperty(p,"p2ms",{enumerable:!0,get:function(){return T.p2ms}});const C=x(32316);Object.defineProperty(p,"p2pk",{enumerable:!0,get:function(){return C.p2pk}});const I=x(50958);Object.defineProperty(p,"p2pkh",{enumerable:!0,get:function(){return I.p2pkh}});const m=x(93090);Object.defineProperty(p,"p2sh",{enumerable:!0,get:function(){return m.p2sh}});const b=x(11657);Object.defineProperty(p,"p2wpkh",{enumerable:!0,get:function(){return b.p2wpkh}});const g=x(21331);Object.defineProperty(p,"p2wsh",{enumerable:!0,get:function(){return g.p2wsh}});const w=x(25519);Object.defineProperty(p,"p2tr",{enumerable:!0,get:function(){return w.p2tr}})},87089:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.value=p.prop=void 0;function x(T,C,I){Object.defineProperty(T,C,{configurable:!0,enumerable:!0,get(){const m=I.call(this);return this[C]=m,m},set(m){Object.defineProperty(this,C,{configurable:!0,enumerable:!0,value:m,writable:!0})}})}p.prop=x;function v(T){let C;return()=>(C!==void 0||(C=T()),C)}p.value=v},69165:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.p2ms=void 0;const v=x(12784),T=x(42940),C=x(9550),I=x(87089),m=T.OPS,b=m.OP_RESERVED;function g(_,A){return _.length!==A.length?!1:_.every((S,k)=>S.equals(A[k]))}function w(_,A){if(!_.input&&!_.output&&!(_.pubkeys&&_.m!==void 0)&&!_.signatures)throw new TypeError("Not enough data");A=Object.assign({validate:!0},A||{});function S(W){return T.isCanonicalScriptSignature(W)||(A.allowIncomplete&&W===m.OP_0)!==void 0}(0,C.typeforce)({network:C.typeforce.maybe(C.typeforce.Object),m:C.typeforce.maybe(C.typeforce.Number),n:C.typeforce.maybe(C.typeforce.Number),output:C.typeforce.maybe(C.typeforce.Buffer),pubkeys:C.typeforce.maybe(C.typeforce.arrayOf(C.isPoint)),signatures:C.typeforce.maybe(C.typeforce.arrayOf(S)),input:C.typeforce.maybe(C.typeforce.Buffer)},_);const B={network:_.network||v.bitcoin};let O=[],L=!1;function D(W){L||(L=!0,O=T.decompile(W),B.m=O[0]-b,B.n=O[O.length-2]-b,B.pubkeys=O.slice(1,-2))}if(I.prop(B,"output",()=>{if(_.m&&B.n&&_.pubkeys)return T.compile([].concat(b+_.m,_.pubkeys,b+B.n,m.OP_CHECKMULTISIG))}),I.prop(B,"m",()=>{if(B.output)return D(B.output),B.m}),I.prop(B,"n",()=>{if(B.pubkeys)return B.pubkeys.length}),I.prop(B,"pubkeys",()=>{if(_.output)return D(_.output),B.pubkeys}),I.prop(B,"signatures",()=>{if(_.input)return T.decompile(_.input).slice(1)}),I.prop(B,"input",()=>{if(_.signatures)return T.compile([m.OP_0].concat(_.signatures))}),I.prop(B,"witness",()=>{if(B.input)return[]}),I.prop(B,"name",()=>{if(!(!B.m||!B.n))return`p2ms(${B.m} of ${B.n})`}),A.validate){if(_.output){if(D(_.output),!C.typeforce.Number(O[0]))throw new TypeError("Output is invalid");if(!C.typeforce.Number(O[O.length-2]))throw new TypeError("Output is invalid");if(O[O.length-1]!==m.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(B.m<=0||B.n>16||B.m>B.n||B.n!==O.length-3)throw new TypeError("Output is invalid");if(!B.pubkeys.every(W=>(0,C.isPoint)(W)))throw new TypeError("Output is invalid");if(_.m!==void 0&&_.m!==B.m)throw new TypeError("m mismatch");if(_.n!==void 0&&_.n!==B.n)throw new TypeError("n mismatch");if(_.pubkeys&&!g(_.pubkeys,B.pubkeys))throw new TypeError("Pubkeys mismatch")}if(_.pubkeys){if(_.n!==void 0&&_.n!==_.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(B.n=_.pubkeys.length,B.n<B.m)throw new TypeError("Pubkey count cannot be less than m")}if(_.signatures){if(_.signatures.length<B.m)throw new TypeError("Not enough signatures provided");if(_.signatures.length>B.m)throw new TypeError("Too many signatures provided")}if(_.input){if(_.input[0]!==m.OP_0)throw new TypeError("Input is invalid");if(B.signatures.length===0||!B.signatures.every(S))throw new TypeError("Input has invalid signature(s)");if(_.signatures&&!g(_.signatures,B.signatures))throw new TypeError("Signature mismatch");if(_.m!==void 0&&_.m!==_.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(B,_)}p.p2ms=w},32316:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.p2pk=void 0;const v=x(12784),T=x(42940),C=x(9550),I=x(87089),m=T.OPS;function b(g,w){if(!g.input&&!g.output&&!g.pubkey&&!g.input&&!g.signature)throw new TypeError("Not enough data");w=Object.assign({validate:!0},w||{}),(0,C.typeforce)({network:C.typeforce.maybe(C.typeforce.Object),output:C.typeforce.maybe(C.typeforce.Buffer),pubkey:C.typeforce.maybe(C.isPoint),signature:C.typeforce.maybe(T.isCanonicalScriptSignature),input:C.typeforce.maybe(C.typeforce.Buffer)},g);const _=I.value(()=>T.decompile(g.input)),S={name:"p2pk",network:g.network||v.bitcoin};if(I.prop(S,"output",()=>{if(g.pubkey)return T.compile([g.pubkey,m.OP_CHECKSIG])}),I.prop(S,"pubkey",()=>{if(g.output)return g.output.slice(1,-1)}),I.prop(S,"signature",()=>{if(g.input)return _()[0]}),I.prop(S,"input",()=>{if(g.signature)return T.compile([g.signature])}),I.prop(S,"witness",()=>{if(S.input)return[]}),w.validate){if(g.output){if(g.output[g.output.length-1]!==m.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!(0,C.isPoint)(S.pubkey))throw new TypeError("Output pubkey is invalid");if(g.pubkey&&!g.pubkey.equals(S.pubkey))throw new TypeError("Pubkey mismatch")}if(g.signature&&g.input&&!g.input.equals(S.input))throw new TypeError("Signature mismatch");if(g.input){if(_().length!==1)throw new TypeError("Input is invalid");if(!T.isCanonicalScriptSignature(S.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(S,g)}p.p2pk=b},50958:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.p2pkh=void 0;const T=x(1502),C=x(12784),I=x(42940),m=x(9550),b=x(87089),g=x(65916),w=I.OPS;function _(A,S){if(!A.address&&!A.hash&&!A.output&&!A.pubkey&&!A.input)throw new TypeError("Not enough data");S=Object.assign({validate:!0},S||{}),(0,m.typeforce)({network:m.typeforce.maybe(m.typeforce.Object),address:m.typeforce.maybe(m.typeforce.String),hash:m.typeforce.maybe(m.typeforce.BufferN(20)),output:m.typeforce.maybe(m.typeforce.BufferN(25)),pubkey:m.typeforce.maybe(m.isPoint),signature:m.typeforce.maybe(I.isCanonicalScriptSignature),input:m.typeforce.maybe(m.typeforce.Buffer)},A);const k=b.value(()=>{const D=v.from(g.decode(A.address)),W=D.readUInt8(0),H=D.slice(1);return{version:W,hash:H}}),B=b.value(()=>I.decompile(A.input)),O=A.network||C.bitcoin,L={name:"p2pkh",network:O};if(b.prop(L,"address",()=>{if(!L.hash)return;const D=v.allocUnsafe(21);return D.writeUInt8(O.pubKeyHash,0),L.hash.copy(D,1),g.encode(D)}),b.prop(L,"hash",()=>{if(A.output)return A.output.slice(3,23);if(A.address)return k().hash;if(A.pubkey||L.pubkey)return T.hash160(A.pubkey||L.pubkey)}),b.prop(L,"output",()=>{if(L.hash)return I.compile([w.OP_DUP,w.OP_HASH160,L.hash,w.OP_EQUALVERIFY,w.OP_CHECKSIG])}),b.prop(L,"pubkey",()=>{if(A.input)return B()[1]}),b.prop(L,"signature",()=>{if(A.input)return B()[0]}),b.prop(L,"input",()=>{if(A.pubkey&&A.signature)return I.compile([A.signature,A.pubkey])}),b.prop(L,"witness",()=>{if(L.input)return[]}),S.validate){let D=v.from([]);if(A.address){if(k().version!==O.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(k().hash.length!==20)throw new TypeError("Invalid address");D=k().hash}if(A.hash){if(D.length>0&&!D.equals(A.hash))throw new TypeError("Hash mismatch");D=A.hash}if(A.output){if(A.output.length!==25||A.output[0]!==w.OP_DUP||A.output[1]!==w.OP_HASH160||A.output[2]!==20||A.output[23]!==w.OP_EQUALVERIFY||A.output[24]!==w.OP_CHECKSIG)throw new TypeError("Output is invalid");const W=A.output.slice(3,23);if(D.length>0&&!D.equals(W))throw new TypeError("Hash mismatch");D=W}if(A.pubkey){const W=T.hash160(A.pubkey);if(D.length>0&&!D.equals(W))throw new TypeError("Hash mismatch");D=W}if(A.input){const W=B();if(W.length!==2)throw new TypeError("Input is invalid");if(!I.isCanonicalScriptSignature(W[0]))throw new TypeError("Input has invalid signature");if(!(0,m.isPoint)(W[1]))throw new TypeError("Input has invalid pubkey");if(A.signature&&!A.signature.equals(W[0]))throw new TypeError("Signature mismatch");if(A.pubkey&&!A.pubkey.equals(W[1]))throw new TypeError("Pubkey mismatch");const H=T.hash160(W[1]);if(D.length>0&&!D.equals(H))throw new TypeError("Hash mismatch")}}return Object.assign(L,A)}p.p2pkh=_},93090:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.p2sh=void 0;const T=x(1502),C=x(12784),I=x(42940),m=x(9550),b=x(87089),g=x(65916),w=I.OPS;function _(S,k){return S.length!==k.length?!1:S.every((B,O)=>B.equals(k[O]))}function A(S,k){if(!S.address&&!S.hash&&!S.output&&!S.redeem&&!S.input)throw new TypeError("Not enough data");k=Object.assign({validate:!0},k||{}),(0,m.typeforce)({network:m.typeforce.maybe(m.typeforce.Object),address:m.typeforce.maybe(m.typeforce.String),hash:m.typeforce.maybe(m.typeforce.BufferN(20)),output:m.typeforce.maybe(m.typeforce.BufferN(23)),redeem:m.typeforce.maybe({network:m.typeforce.maybe(m.typeforce.Object),output:m.typeforce.maybe(m.typeforce.Buffer),input:m.typeforce.maybe(m.typeforce.Buffer),witness:m.typeforce.maybe(m.typeforce.arrayOf(m.typeforce.Buffer))}),input:m.typeforce.maybe(m.typeforce.Buffer),witness:m.typeforce.maybe(m.typeforce.arrayOf(m.typeforce.Buffer))},S);let B=S.network;B||(B=S.redeem&&S.redeem.network||C.bitcoin);const O={network:B},L=b.value(()=>{const H=v.from(g.decode(S.address)),G=H.readUInt8(0),Z=H.slice(1);return{version:G,hash:Z}}),D=b.value(()=>I.decompile(S.input)),W=b.value(()=>{const H=D(),G=H[H.length-1];return{network:B,output:G===w.OP_FALSE?v.from([]):G,input:I.compile(H.slice(0,-1)),witness:S.witness||[]}});if(b.prop(O,"address",()=>{if(!O.hash)return;const H=v.allocUnsafe(21);return H.writeUInt8(O.network.scriptHash,0),O.hash.copy(H,1),g.encode(H)}),b.prop(O,"hash",()=>{if(S.output)return S.output.slice(2,22);if(S.address)return L().hash;if(O.redeem&&O.redeem.output)return T.hash160(O.redeem.output)}),b.prop(O,"output",()=>{if(O.hash)return I.compile([w.OP_HASH160,O.hash,w.OP_EQUAL])}),b.prop(O,"redeem",()=>{if(S.input)return W()}),b.prop(O,"input",()=>{if(!(!S.redeem||!S.redeem.input||!S.redeem.output))return I.compile([].concat(I.decompile(S.redeem.input),S.redeem.output))}),b.prop(O,"witness",()=>{if(O.redeem&&O.redeem.witness)return O.redeem.witness;if(O.input)return[]}),b.prop(O,"name",()=>{const H=["p2sh"];return O.redeem!==void 0&&O.redeem.name!==void 0&&H.push(O.redeem.name),H.join("-")}),k.validate){let H=v.from([]);if(S.address){if(L().version!==B.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(L().hash.length!==20)throw new TypeError("Invalid address");H=L().hash}if(S.hash){if(H.length>0&&!H.equals(S.hash))throw new TypeError("Hash mismatch");H=S.hash}if(S.output){if(S.output.length!==23||S.output[0]!==w.OP_HASH160||S.output[1]!==20||S.output[22]!==w.OP_EQUAL)throw new TypeError("Output is invalid");const Z=S.output.slice(2,22);if(H.length>0&&!H.equals(Z))throw new TypeError("Hash mismatch");H=Z}const G=Z=>{if(Z.output){const Q=I.decompile(Z.output);if(!Q||Q.length<1)throw new TypeError("Redeem.output too short");if(Z.output.byteLength>520)throw new TypeError("Redeem.output unspendable if larger than 520 bytes");if(I.countNonPushOnlyOPs(Q)>201)throw new TypeError("Redeem.output unspendable with more than 201 non-push ops");const ie=T.hash160(Z.output);if(H.length>0&&!H.equals(ie))throw new TypeError("Hash mismatch");H=ie}if(Z.input){const Q=Z.input.length>0,ie=Z.witness&&Z.witness.length>0;if(!Q&&!ie)throw new TypeError("Empty input");if(Q&&ie)throw new TypeError("Input and witness provided");if(Q){const le=I.decompile(Z.input);if(!I.isPushOnly(le))throw new TypeError("Non push-only scriptSig")}}};if(S.input){const Z=D();if(!Z||Z.length<1)throw new TypeError("Input too short");if(!v.isBuffer(W().output))throw new TypeError("Input is invalid");G(W())}if(S.redeem){if(S.redeem.network&&S.redeem.network!==B)throw new TypeError("Network mismatch");if(S.input){const Z=W();if(S.redeem.output&&!S.redeem.output.equals(Z.output))throw new TypeError("Redeem.output mismatch");if(S.redeem.input&&!S.redeem.input.equals(Z.input))throw new TypeError("Redeem.input mismatch")}G(S.redeem)}if(S.witness&&S.redeem&&S.redeem.witness&&!_(S.redeem.witness,S.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(O,S)}p.p2sh=A},25519:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.p2tr=void 0;const v=x(36533),T=x(12784),C=x(42940),I=x(9550),m=x(73618),b=x(31340),g=x(87089),w=x(60509),_=C.OPS,A=1,S=80;function k(O,L){if(!O.address&&!O.output&&!O.pubkey&&!O.internalPubkey&&!(O.witness&&O.witness.length>1))throw new TypeError("Not enough data");L=Object.assign({validate:!0},L||{}),(0,I.typeforce)({address:I.typeforce.maybe(I.typeforce.String),input:I.typeforce.maybe(I.typeforce.BufferN(0)),network:I.typeforce.maybe(I.typeforce.Object),output:I.typeforce.maybe(I.typeforce.BufferN(34)),internalPubkey:I.typeforce.maybe(I.typeforce.BufferN(32)),hash:I.typeforce.maybe(I.typeforce.BufferN(32)),pubkey:I.typeforce.maybe(I.typeforce.BufferN(32)),signature:I.typeforce.maybe(I.typeforce.anyOf(I.typeforce.BufferN(64),I.typeforce.BufferN(65))),witness:I.typeforce.maybe(I.typeforce.arrayOf(I.typeforce.Buffer)),scriptTree:I.typeforce.maybe(I.isTaptree),redeem:I.typeforce.maybe({output:I.typeforce.maybe(I.typeforce.Buffer),redeemVersion:I.typeforce.maybe(I.typeforce.Number),witness:I.typeforce.maybe(I.typeforce.arrayOf(I.typeforce.Buffer))}),redeemVersion:I.typeforce.maybe(I.typeforce.Number)},O);const D=g.value(()=>{const Q=w.bech32m.decode(O.address),ie=Q.words.shift(),le=w.bech32m.fromWords(Q.words);return{version:ie,prefix:Q.prefix,data:v.Buffer.from(le)}}),W=g.value(()=>{if(!(!O.witness||!O.witness.length))return O.witness.length>=2&&O.witness[O.witness.length-1][0]===S?O.witness.slice(0,-1):O.witness.slice()}),H=g.value(()=>{if(O.scriptTree)return(0,b.toHashTree)(O.scriptTree);if(O.hash)return{hash:O.hash}}),G=O.network||T.bitcoin,Z={name:"p2tr",network:G};if(g.prop(Z,"address",()=>{if(!Z.pubkey)return;const Q=w.bech32m.toWords(Z.pubkey);return Q.unshift(A),w.bech32m.encode(G.bech32,Q)}),g.prop(Z,"hash",()=>{const Q=H();if(Q)return Q.hash;const ie=W();if(ie&&ie.length>1){const le=ie[ie.length-1],be=le[0]&I.TAPLEAF_VERSION_MASK,we=ie[ie.length-2],Ae=(0,b.tapleafHash)({output:we,version:be});return(0,b.rootHashFromPath)(le,Ae)}return null}),g.prop(Z,"output",()=>{if(Z.pubkey)return C.compile([_.OP_1,Z.pubkey])}),g.prop(Z,"redeemVersion",()=>O.redeemVersion?O.redeemVersion:O.redeem&&O.redeem.redeemVersion!==void 0&&O.redeem.redeemVersion!==null?O.redeem.redeemVersion:b.LEAF_VERSION_TAPSCRIPT),g.prop(Z,"redeem",()=>{const Q=W();if(!(!Q||Q.length<2))return{output:Q[Q.length-2],witness:Q.slice(0,-2),redeemVersion:Q[Q.length-1][0]&I.TAPLEAF_VERSION_MASK}}),g.prop(Z,"pubkey",()=>{if(O.pubkey)return O.pubkey;if(O.output)return O.output.slice(2);if(O.address)return D().data;if(Z.internalPubkey){const Q=(0,b.tweakKey)(Z.internalPubkey,Z.hash);if(Q)return Q.x}}),g.prop(Z,"internalPubkey",()=>{if(O.internalPubkey)return O.internalPubkey;const Q=W();if(Q&&Q.length>1)return Q[Q.length-1].slice(1,33)}),g.prop(Z,"signature",()=>{if(O.signature)return O.signature;const Q=W();if(!(!Q||Q.length!==1))return Q[0]}),g.prop(Z,"witness",()=>{if(O.witness)return O.witness;const Q=H();if(Q&&O.redeem&&O.redeem.output&&O.internalPubkey){const ie=(0,b.tapleafHash)({output:O.redeem.output,version:Z.redeemVersion}),le=(0,b.findScriptPath)(Q,ie);if(!le)return;const be=(0,b.tweakKey)(O.internalPubkey,Q.hash);if(!be)return;const we=v.Buffer.concat([v.Buffer.from([Z.redeemVersion|be.parity]),O.internalPubkey].concat(le));return[O.redeem.output,we]}if(O.signature)return[O.signature]}),L.validate){let Q=v.Buffer.from([]);if(O.address){if(G&&G.bech32!==D().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(D().version!==A)throw new TypeError("Invalid address version");if(D().data.length!==32)throw new TypeError("Invalid address data");Q=D().data}if(O.pubkey){if(Q.length>0&&!Q.equals(O.pubkey))throw new TypeError("Pubkey mismatch");Q=O.pubkey}if(O.output){if(O.output.length!==34||O.output[0]!==_.OP_1||O.output[1]!==32)throw new TypeError("Output is invalid");if(Q.length>0&&!Q.equals(O.output.slice(2)))throw new TypeError("Pubkey mismatch");Q=O.output.slice(2)}if(O.internalPubkey){const be=(0,b.tweakKey)(O.internalPubkey,Z.hash);if(Q.length>0&&!Q.equals(be.x))throw new TypeError("Pubkey mismatch");Q=be.x}if(Q&&Q.length&&!(0,m.getEccLib)().isXOnlyPoint(Q))throw new TypeError("Invalid pubkey for p2tr");const ie=H();if(O.hash&&ie&&!O.hash.equals(ie.hash))throw new TypeError("Hash mismatch");if(O.redeem&&O.redeem.output&&ie){const be=(0,b.tapleafHash)({output:O.redeem.output,version:Z.redeemVersion});if(!(0,b.findScriptPath)(ie,be))throw new TypeError("Redeem script not in tree")}const le=W();if(O.redeem&&Z.redeem){if(O.redeem.redeemVersion&&O.redeem.redeemVersion!==Z.redeem.redeemVersion)throw new TypeError("Redeem.redeemVersion and witness mismatch");if(O.redeem.output){if(C.decompile(O.redeem.output).length===0)throw new TypeError("Redeem.output is invalid");if(Z.redeem.output&&!O.redeem.output.equals(Z.redeem.output))throw new TypeError("Redeem.output and witness mismatch")}if(O.redeem.witness&&Z.redeem.witness&&!B(O.redeem.witness,Z.redeem.witness))throw new TypeError("Redeem.witness and witness mismatch")}if(le&&le.length)if(le.length===1){if(O.signature&&!O.signature.equals(le[0]))throw new TypeError("Signature mismatch")}else{const be=le[le.length-1];if(be.length<33)throw new TypeError(`The control-block length is too small. Got ${be.length}, expected min 33.`);if((be.length-33)%32!==0)throw new TypeError(`The control-block length of ${be.length} is incorrect!`);const we=(be.length-33)/32;if(we>128)throw new TypeError(`The script path is too long. Got ${we}, expected max 128.`);const Ae=be.slice(1,33);if(O.internalPubkey&&!O.internalPubkey.equals(Ae))throw new TypeError("Internal pubkey mismatch");if(!(0,m.getEccLib)().isXOnlyPoint(Ae))throw new TypeError("Invalid internalPubkey for p2tr witness");const re=be[0]&I.TAPLEAF_VERSION_MASK,N=le[le.length-2],z=(0,b.tapleafHash)({output:N,version:re}),V=(0,b.rootHashFromPath)(be,z),U=(0,b.tweakKey)(Ae,V);if(!U)throw new TypeError("Invalid outputKey for p2tr witness");if(Q.length&&!Q.equals(U.x))throw new TypeError("Pubkey mismatch for p2tr witness");if(U.parity!==(be[0]&1))throw new Error("Incorrect parity")}}return Object.assign(Z,O)}p.p2tr=k;function B(O,L){return O.length!==L.length?!1:O.every((D,W)=>D.equals(L[W]))}},11657:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.p2wpkh=void 0;const T=x(1502),C=x(12784),I=x(42940),m=x(9550),b=x(87089),g=x(60509),w=I.OPS,_=v.alloc(0);function A(S,k){if(!S.address&&!S.hash&&!S.output&&!S.pubkey&&!S.witness)throw new TypeError("Not enough data");k=Object.assign({validate:!0},k||{}),(0,m.typeforce)({address:m.typeforce.maybe(m.typeforce.String),hash:m.typeforce.maybe(m.typeforce.BufferN(20)),input:m.typeforce.maybe(m.typeforce.BufferN(0)),network:m.typeforce.maybe(m.typeforce.Object),output:m.typeforce.maybe(m.typeforce.BufferN(22)),pubkey:m.typeforce.maybe(m.isPoint),signature:m.typeforce.maybe(I.isCanonicalScriptSignature),witness:m.typeforce.maybe(m.typeforce.arrayOf(m.typeforce.Buffer))},S);const B=b.value(()=>{const D=g.bech32.decode(S.address),W=D.words.shift(),H=g.bech32.fromWords(D.words);return{version:W,prefix:D.prefix,data:v.from(H)}}),O=S.network||C.bitcoin,L={name:"p2wpkh",network:O};if(b.prop(L,"address",()=>{if(!L.hash)return;const D=g.bech32.toWords(L.hash);return D.unshift(0),g.bech32.encode(O.bech32,D)}),b.prop(L,"hash",()=>{if(S.output)return S.output.slice(2,22);if(S.address)return B().data;if(S.pubkey||L.pubkey)return T.hash160(S.pubkey||L.pubkey)}),b.prop(L,"output",()=>{if(L.hash)return I.compile([w.OP_0,L.hash])}),b.prop(L,"pubkey",()=>{if(S.pubkey)return S.pubkey;if(S.witness)return S.witness[1]}),b.prop(L,"signature",()=>{if(S.witness)return S.witness[0]}),b.prop(L,"input",()=>{if(L.witness)return _}),b.prop(L,"witness",()=>{if(S.pubkey&&S.signature)return[S.signature,S.pubkey]}),k.validate){let D=v.from([]);if(S.address){if(O&&O.bech32!==B().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(B().version!==0)throw new TypeError("Invalid address version");if(B().data.length!==20)throw new TypeError("Invalid address data");D=B().data}if(S.hash){if(D.length>0&&!D.equals(S.hash))throw new TypeError("Hash mismatch");D=S.hash}if(S.output){if(S.output.length!==22||S.output[0]!==w.OP_0||S.output[1]!==20)throw new TypeError("Output is invalid");if(D.length>0&&!D.equals(S.output.slice(2)))throw new TypeError("Hash mismatch");D=S.output.slice(2)}if(S.pubkey){const W=T.hash160(S.pubkey);if(D.length>0&&!D.equals(W))throw new TypeError("Hash mismatch");if(D=W,!(0,m.isPoint)(S.pubkey)||S.pubkey.length!==33)throw new TypeError("Invalid pubkey for p2wpkh")}if(S.witness){if(S.witness.length!==2)throw new TypeError("Witness is invalid");if(!I.isCanonicalScriptSignature(S.witness[0]))throw new TypeError("Witness has invalid signature");if(!(0,m.isPoint)(S.witness[1])||S.witness[1].length!==33)throw new TypeError("Witness has invalid pubkey");if(S.signature&&!S.signature.equals(S.witness[0]))throw new TypeError("Signature mismatch");if(S.pubkey&&!S.pubkey.equals(S.witness[1]))throw new TypeError("Pubkey mismatch");const W=T.hash160(S.witness[1]);if(D.length>0&&!D.equals(W))throw new TypeError("Hash mismatch")}}return Object.assign(L,S)}p.p2wpkh=A},21331:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.p2wsh=void 0;const T=x(1502),C=x(12784),I=x(42940),m=x(9550),b=x(87089),g=x(60509),w=I.OPS,_=v.alloc(0);function A(B,O){return B.length!==O.length?!1:B.every((L,D)=>L.equals(O[D]))}function S(B){return!!(v.isBuffer(B)&&B.length===65&&B[0]===4&&(0,m.isPoint)(B))}function k(B,O){if(!B.address&&!B.hash&&!B.output&&!B.redeem&&!B.witness)throw new TypeError("Not enough data");O=Object.assign({validate:!0},O||{}),(0,m.typeforce)({network:m.typeforce.maybe(m.typeforce.Object),address:m.typeforce.maybe(m.typeforce.String),hash:m.typeforce.maybe(m.typeforce.BufferN(32)),output:m.typeforce.maybe(m.typeforce.BufferN(34)),redeem:m.typeforce.maybe({input:m.typeforce.maybe(m.typeforce.Buffer),network:m.typeforce.maybe(m.typeforce.Object),output:m.typeforce.maybe(m.typeforce.Buffer),witness:m.typeforce.maybe(m.typeforce.arrayOf(m.typeforce.Buffer))}),input:m.typeforce.maybe(m.typeforce.BufferN(0)),witness:m.typeforce.maybe(m.typeforce.arrayOf(m.typeforce.Buffer))},B);const L=b.value(()=>{const G=g.bech32.decode(B.address),Z=G.words.shift(),Q=g.bech32.fromWords(G.words);return{version:Z,prefix:G.prefix,data:v.from(Q)}}),D=b.value(()=>I.decompile(B.redeem.input));let W=B.network;W||(W=B.redeem&&B.redeem.network||C.bitcoin);const H={network:W};if(b.prop(H,"address",()=>{if(!H.hash)return;const G=g.bech32.toWords(H.hash);return G.unshift(0),g.bech32.encode(W.bech32,G)}),b.prop(H,"hash",()=>{if(B.output)return B.output.slice(2);if(B.address)return L().data;if(H.redeem&&H.redeem.output)return T.sha256(H.redeem.output)}),b.prop(H,"output",()=>{if(H.hash)return I.compile([w.OP_0,H.hash])}),b.prop(H,"redeem",()=>{if(B.witness)return{output:B.witness[B.witness.length-1],input:_,witness:B.witness.slice(0,-1)}}),b.prop(H,"input",()=>{if(H.witness)return _}),b.prop(H,"witness",()=>{if(B.redeem&&B.redeem.input&&B.redeem.input.length>0&&B.redeem.output&&B.redeem.output.length>0){const G=I.toStack(D());return H.redeem=Object.assign({witness:G},B.redeem),H.redeem.input=_,[].concat(G,B.redeem.output)}if(B.redeem&&B.redeem.output&&B.redeem.witness)return[].concat(B.redeem.witness,B.redeem.output)}),b.prop(H,"name",()=>{const G=["p2wsh"];return H.redeem!==void 0&&H.redeem.name!==void 0&&G.push(H.redeem.name),G.join("-")}),O.validate){let G=v.from([]);if(B.address){if(L().prefix!==W.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(L().version!==0)throw new TypeError("Invalid address version");if(L().data.length!==32)throw new TypeError("Invalid address data");G=L().data}if(B.hash){if(G.length>0&&!G.equals(B.hash))throw new TypeError("Hash mismatch");G=B.hash}if(B.output){if(B.output.length!==34||B.output[0]!==w.OP_0||B.output[1]!==32)throw new TypeError("Output is invalid");const Z=B.output.slice(2);if(G.length>0&&!G.equals(Z))throw new TypeError("Hash mismatch");G=Z}if(B.redeem){if(B.redeem.network&&B.redeem.network!==W)throw new TypeError("Network mismatch");if(B.redeem.input&&B.redeem.input.length>0&&B.redeem.witness&&B.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(B.redeem.output){const Z=I.decompile(B.redeem.output);if(!Z||Z.length<1)throw new TypeError("Redeem.output is invalid");if(B.redeem.output.byteLength>3600)throw new TypeError("Redeem.output unspendable if larger than 3600 bytes");if(I.countNonPushOnlyOPs(Z)>201)throw new TypeError("Redeem.output unspendable with more than 201 non-push ops");const Q=T.sha256(B.redeem.output);if(G.length>0&&!G.equals(Q))throw new TypeError("Hash mismatch");G=Q}if(B.redeem.input&&!I.isPushOnly(D()))throw new TypeError("Non push-only scriptSig");if(B.witness&&B.redeem.witness&&!A(B.witness,B.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(B.redeem.input&&D().some(S)||B.redeem.output&&(I.decompile(B.redeem.output)||[]).some(S))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(B.witness&&B.witness.length>0){const Z=B.witness[B.witness.length-1];if(B.redeem&&B.redeem.output&&!B.redeem.output.equals(Z))throw new TypeError("Witness and redeem.output mismatch");if(B.witness.some(S)||(I.decompile(Z)||[]).some(S))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(H,B)}p.p2wsh=k},58176:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.Psbt=void 0;const T=x(65646),C=x(40586),I=x(88536),m=x(90163),b=x(67640),g=x(12784),w=x(52127),_=x(31340),A=x(42940),S=x(44491),k=x(97379),B=x(52155),O={network:g.bitcoin,maximumFeeRate:5e3};class L{static fromBase64(me,Te={}){const Oe=v.from(me,"base64");return this.fromBuffer(Oe,Te)}static fromHex(me,Te={}){const Oe=v.from(me,"hex");return this.fromBuffer(Oe,Te)}static fromBuffer(me,Te={}){const Oe=T.Psbt.fromBuffer(me,D),Qe=new L(Te,Oe);return z(Qe.__CACHE.__TX,Qe.__CACHE),Qe}constructor(me={},Te=new T.Psbt(new W)){this.data=Te,this.opts=Object.assign({},O,me),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},this.data.inputs.length===0&&this.setVersion(2);const Oe=(Qe,Vt,vt,Zt)=>Object.defineProperty(Qe,Vt,{enumerable:vt,writable:Zt});Oe(this,"__CACHE",!1,!0),Oe(this,"opts",!1,!0)}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(me){this.setVersion(me)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(me){this.setLocktime(me)}get txInputs(){return this.__CACHE.__TX.ins.map(me=>({hash:(0,b.cloneBuffer)(me.hash),index:me.index,sequence:me.sequence}))}get txOutputs(){return this.__CACHE.__TX.outs.map(me=>{let Te;try{Te=(0,m.fromOutputScript)(me.script,this.opts.network)}catch{}return{script:(0,b.cloneBuffer)(me.script),value:me.value,address:Te}})}combine(...me){return this.data.combine(...me.map(Te=>Te.data)),this}clone(){const me=L.fromBuffer(this.data.toBuffer());return me.opts=JSON.parse(JSON.stringify(this.opts)),me}setMaximumFeeRate(me){le(me),this.opts.maximumFeeRate=me}setVersion(me){le(me),we(this.data.inputs,"setVersion");const Te=this.__CACHE;return Te.__TX.version=me,Te.__EXTRACTED_TX=void 0,this}setLocktime(me){le(me),we(this.data.inputs,"setLocktime");const Te=this.__CACHE;return Te.__TX.locktime=me,Te.__EXTRACTED_TX=void 0,this}setInputSequence(me,Te){le(Te),we(this.data.inputs,"setInputSequence");const Oe=this.__CACHE;if(Oe.__TX.ins.length<=me)throw new Error("Input index too high");return Oe.__TX.ins[me].sequence=Te,Oe.__EXTRACTED_TX=void 0,this}addInputs(me){return me.forEach(Te=>this.addInput(Te)),this}addInput(me){if(arguments.length>1||!me||me.hash===void 0||me.index===void 0)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");(0,k.checkTaprootInputFields)(me,me,"addInput"),we(this.data.inputs,"addInput"),me.witnessScript&&se(me.witnessScript);const Te=this.__CACHE;this.data.addInput(me);const Oe=Te.__TX.ins[Te.__TX.ins.length-1];V(Te,Oe);const Qe=this.data.inputs.length-1,Vt=this.data.inputs[Qe];return Vt.nonWitnessUtxo&&ft(this.__CACHE,Vt,Qe),Te.__FEE=void 0,Te.__FEE_RATE=void 0,Te.__EXTRACTED_TX=void 0,this}addOutputs(me){return me.forEach(Te=>this.addOutput(Te)),this}addOutput(me){if(arguments.length>1||!me||me.value===void 0||me.address===void 0&&me.script===void 0)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");we(this.data.inputs,"addOutput");const{address:Te}=me;if(typeof Te=="string"){const{network:Qe}=this.opts,Vt=(0,m.toOutputScript)(Te,Qe);me=Object.assign(me,{script:Vt})}(0,k.checkTaprootOutputFields)(me,me,"addOutput");const Oe=this.__CACHE;return this.data.addOutput(me),Oe.__FEE=void 0,Oe.__FEE_RATE=void 0,Oe.__EXTRACTED_TX=void 0,this}extractTransaction(me){if(!this.data.inputs.every(Q))throw new Error("Not finalized");const Te=this.__CACHE;if(me||be(this,Te,this.opts),Te.__EXTRACTED_TX)return Te.__EXTRACTED_TX;const Oe=Te.__TX.clone();return Xe(this.data.inputs,Oe,Te,!0),Oe}getFeeRate(){return ee("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return ee("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return(0,I.checkForInput)(this.data.inputs,0),ye(this.data.inputs.length).forEach(me=>this.finalizeInput(me)),this}finalizeInput(me,Te){const Oe=(0,I.checkForInput)(this.data.inputs,me);return(0,k.isTaprootInput)(Oe)?this._finalizeTaprootInput(me,Oe,void 0,Te):this._finalizeInput(me,Oe,Te)}finalizeTaprootInput(me,Te,Oe=k.tapScriptFinalizer){const Qe=(0,I.checkForInput)(this.data.inputs,me);if((0,k.isTaprootInput)(Qe))return this._finalizeTaprootInput(me,Qe,Te,Oe);throw new Error(`Cannot finalize input #${me}. Not Taproot.`)}_finalizeInput(me,Te,Oe=J){const{script:Qe,isP2SH:Vt,isP2WSH:vt,isSegwit:Zt}=Re(me,Te,this.__CACHE);if(!Qe)throw new Error(`No script found for input #${me}`);Ae(Te);const{finalScriptSig:dn,finalScriptWitness:ln}=Oe(me,Te,Qe,Zt,Vt,vt);if(dn&&this.data.updateInput(me,{finalScriptSig:dn}),ln&&this.data.updateInput(me,{finalScriptWitness:ln}),!dn&&!ln)throw new Error(`Unknown error finalizing input #${me}`);return this.data.clearFinalizedInput(me),this}_finalizeTaprootInput(me,Te,Oe,Qe=k.tapScriptFinalizer){if(!Te.witnessUtxo)throw new Error(`Cannot finalize input #${me}. Missing withness utxo.`);if(Te.tapKeySig){const Vt=w.p2tr({output:Te.witnessUtxo.script,signature:Te.tapKeySig}),vt=(0,B.witnessStackToScriptWitness)(Vt.witness);this.data.updateInput(me,{finalScriptWitness:vt})}else{const{finalScriptWitness:Vt}=Qe(me,Te,Oe);this.data.updateInput(me,{finalScriptWitness:Vt})}return this.data.clearFinalizedInput(me),this}getInputType(me){const Te=(0,I.checkForInput)(this.data.inputs,me),Oe=wt(me,Te,this.__CACHE),Qe=He(Oe,me,"input",Te.redeemScript||Ft(Te.finalScriptSig),Te.witnessScript||tt(Te.finalScriptWitness)),Vt=Qe.type==="raw"?"":Qe.type+"-",vt=oe(Qe.meaningfulScript);return Vt+vt}inputHasPubkey(me,Te){const Oe=(0,I.checkForInput)(this.data.inputs,me);return Ge(Te,Oe,me,this.__CACHE)}inputHasHDKey(me,Te){const Oe=(0,I.checkForInput)(this.data.inputs,me),Qe=ie(Te);return!!Oe.bip32Derivation&&Oe.bip32Derivation.some(Qe)}outputHasPubkey(me,Te){const Oe=(0,I.checkForOutput)(this.data.outputs,me);return zt(Te,Oe,me,this.__CACHE)}outputHasHDKey(me,Te){const Oe=(0,I.checkForOutput)(this.data.outputs,me),Qe=ie(Te);return!!Oe.bip32Derivation&&Oe.bip32Derivation.some(Qe)}validateSignaturesOfAllInputs(me){return(0,I.checkForInput)(this.data.inputs,0),ye(this.data.inputs.length).map(Oe=>this.validateSignaturesOfInput(Oe,me)).reduce((Oe,Qe)=>Qe===!0&&Oe,!0)}validateSignaturesOfInput(me,Te,Oe){const Qe=this.data.inputs[me];return(0,k.isTaprootInput)(Qe)?this.validateSignaturesOfTaprootInput(me,Te,Oe):this._validateSignaturesOfInput(me,Te,Oe)}_validateSignaturesOfInput(me,Te,Oe){const Qe=this.data.inputs[me],Vt=(Qe||{}).partialSig;if(!Qe||!Vt||Vt.length<1)throw new Error("No signatures to validate");if(typeof Te!="function")throw new Error("Need validator function to validate signatures");const vt=Oe?Vt.filter(or=>or.pubkey.equals(Oe)):Vt;if(vt.length<1)throw new Error("No signatures for this pubkey");const Zt=[];let dn,ln,yn;for(const or of vt){const An=A.signature.decode(or.signature),{hash:Un,script:Er}=yn!==An.hashType?de(me,Object.assign({},Qe,{sighashType:An.hashType}),this.__CACHE,!0):{hash:dn,script:ln};yn=An.hashType,dn=Un,ln=Er,re(or.pubkey,Er,"verify"),Zt.push(Te(or.pubkey,Un,An.signature))}return Zt.every(or=>or===!0)}validateSignaturesOfTaprootInput(me,Te,Oe){const Qe=this.data.inputs[me],Vt=(Qe||{}).tapKeySig,vt=(Qe||{}).tapScriptSig;if(!Qe&&!Vt&&!(vt&&!vt.length))throw new Error("No signatures to validate");if(typeof Te!="function")throw new Error("Need validator function to validate signatures");Oe=Oe&&(0,k.toXOnly)(Oe);const Zt=Oe?Ie(me,Qe,this.data.inputs,Oe,this.__CACHE):Y(me,Qe,this.data.inputs,this.__CACHE);if(!Zt.length)throw new Error("No signatures for this pubkey");const dn=Zt.find(yn=>!yn.leafHash);let ln=0;if(Vt&&dn){if(!Te(dn.pubkey,dn.hash,he(Vt)))return!1;ln++}if(vt)for(const yn of vt){const or=Zt.find(An=>yn.pubkey.equals(An.pubkey));if(or){if(!Te(yn.pubkey,or.hash,he(yn.signature)))return!1;ln++}}return ln>0}signAllInputsHD(me,Te=[S.Transaction.SIGHASH_ALL]){if(!me||!me.publicKey||!me.fingerprint)throw new Error("Need HDSigner to sign input");const Oe=[];for(const Qe of ye(this.data.inputs.length))try{this.signInputHD(Qe,me,Te),Oe.push(!0)}catch{Oe.push(!1)}if(Oe.every(Qe=>Qe===!1))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(me,Te=[S.Transaction.SIGHASH_ALL]){return new Promise((Oe,Qe)=>{if(!me||!me.publicKey||!me.fingerprint)return Qe(new Error("Need HDSigner to sign input"));const Vt=[],vt=[];for(const Zt of ye(this.data.inputs.length))vt.push(this.signInputHDAsync(Zt,me,Te).then(()=>{Vt.push(!0)},()=>{Vt.push(!1)}));return Promise.all(vt).then(()=>{if(Vt.every(Zt=>Zt===!1))return Qe(new Error("No inputs were signed"));Oe()})})}signInputHD(me,Te,Oe=[S.Transaction.SIGHASH_ALL]){if(!Te||!Te.publicKey||!Te.fingerprint)throw new Error("Need HDSigner to sign input");return ze(me,this.data.inputs,Te).forEach(Vt=>this.signInput(me,Vt,Oe)),this}signInputHDAsync(me,Te,Oe=[S.Transaction.SIGHASH_ALL]){return new Promise((Qe,Vt)=>{if(!Te||!Te.publicKey||!Te.fingerprint)return Vt(new Error("Need HDSigner to sign input"));const Zt=ze(me,this.data.inputs,Te).map(dn=>this.signInputAsync(me,dn,Oe));return Promise.all(Zt).then(()=>{Qe()}).catch(Vt)})}signAllInputs(me,Te){if(!me||!me.publicKey)throw new Error("Need Signer to sign input");const Oe=[];for(const Qe of ye(this.data.inputs.length))try{this.signInput(Qe,me,Te),Oe.push(!0)}catch{Oe.push(!1)}if(Oe.every(Qe=>Qe===!1))throw new Error("No inputs were signed");return this}signAllInputsAsync(me,Te){return new Promise((Oe,Qe)=>{if(!me||!me.publicKey)return Qe(new Error("Need Signer to sign input"));const Vt=[],vt=[];for(const[Zt]of this.data.inputs.entries())vt.push(this.signInputAsync(Zt,me,Te).then(()=>{Vt.push(!0)},()=>{Vt.push(!1)}));return Promise.all(vt).then(()=>{if(Vt.every(Zt=>Zt===!1))return Qe(new Error("No inputs were signed"));Oe()})})}signInput(me,Te,Oe){if(!Te||!Te.publicKey)throw new Error("Need Signer to sign input");const Qe=(0,I.checkForInput)(this.data.inputs,me);return(0,k.isTaprootInput)(Qe)?this._signTaprootInput(me,Qe,Te,void 0,Oe):this._signInput(me,Te,Oe)}signTaprootInput(me,Te,Oe,Qe){if(!Te||!Te.publicKey)throw new Error("Need Signer to sign input");const Vt=(0,I.checkForInput)(this.data.inputs,me);if((0,k.isTaprootInput)(Vt))return this._signTaprootInput(me,Vt,Te,Oe,Qe);throw new Error(`Input #${me} is not of type Taproot.`)}_signInput(me,Te,Oe=[S.Transaction.SIGHASH_ALL]){const{hash:Qe,sighashType:Vt}=X(this.data.inputs,me,Te.publicKey,this.__CACHE,Oe),vt=[{pubkey:Te.publicKey,signature:A.signature.encode(Te.sign(Qe),Vt)}];return this.data.updateInput(me,{partialSig:vt}),this}_signTaprootInput(me,Te,Oe,Qe,Vt=[S.Transaction.SIGHASH_DEFAULT]){const vt=this.checkTaprootHashesForSig(me,Te,Oe,Qe,Vt),Zt=vt.filter(ln=>!ln.leafHash).map(ln=>(0,k.serializeTaprootSignature)(Oe.signSchnorr(ln.hash),Te.sighashType))[0],dn=vt.filter(ln=>!!ln.leafHash).map(ln=>({pubkey:(0,k.toXOnly)(Oe.publicKey),signature:(0,k.serializeTaprootSignature)(Oe.signSchnorr(ln.hash),Te.sighashType),leafHash:ln.leafHash}));return Zt&&this.data.updateInput(me,{tapKeySig:Zt}),dn.length&&this.data.updateInput(me,{tapScriptSig:dn}),this}signInputAsync(me,Te,Oe){return Promise.resolve().then(()=>{if(!Te||!Te.publicKey)throw new Error("Need Signer to sign input");const Qe=(0,I.checkForInput)(this.data.inputs,me);return(0,k.isTaprootInput)(Qe)?this._signTaprootInputAsync(me,Qe,Te,void 0,Oe):this._signInputAsync(me,Te,Oe)})}signTaprootInputAsync(me,Te,Oe,Qe){return Promise.resolve().then(()=>{if(!Te||!Te.publicKey)throw new Error("Need Signer to sign input");const Vt=(0,I.checkForInput)(this.data.inputs,me);if((0,k.isTaprootInput)(Vt))return this._signTaprootInputAsync(me,Vt,Te,Oe,Qe);throw new Error(`Input #${me} is not of type Taproot.`)})}_signInputAsync(me,Te,Oe=[S.Transaction.SIGHASH_ALL]){const{hash:Qe,sighashType:Vt}=X(this.data.inputs,me,Te.publicKey,this.__CACHE,Oe);return Promise.resolve(Te.sign(Qe)).then(vt=>{const Zt=[{pubkey:Te.publicKey,signature:A.signature.encode(vt,Vt)}];this.data.updateInput(me,{partialSig:Zt})})}async _signTaprootInputAsync(me,Te,Oe,Qe,Vt=[S.Transaction.SIGHASH_DEFAULT]){const vt=this.checkTaprootHashesForSig(me,Te,Oe,Qe,Vt),Zt=[],dn=vt.filter(yn=>!yn.leafHash)[0];if(dn){const yn=Promise.resolve(Oe.signSchnorr(dn.hash)).then(or=>({tapKeySig:(0,k.serializeTaprootSignature)(or,Te.sighashType)}));Zt.push(yn)}const ln=vt.filter(yn=>!!yn.leafHash);if(ln.length){const yn=ln.map(or=>Promise.resolve(Oe.signSchnorr(or.hash)).then(An=>({tapScriptSig:[{pubkey:(0,k.toXOnly)(Oe.publicKey),signature:(0,k.serializeTaprootSignature)(An,Te.sighashType),leafHash:or.leafHash}]})));Zt.push(...yn)}return Promise.all(Zt).then(yn=>{yn.forEach(or=>this.data.updateInput(me,or))})}checkTaprootHashesForSig(me,Te,Oe,Qe,Vt){if(typeof Oe.signSchnorr!="function")throw new Error(`Need Schnorr Signer to sign taproot input #${me}.`);const vt=Ie(me,Te,this.data.inputs,Oe.publicKey,this.__CACHE,Qe,Vt);if(!vt||!vt.length)throw new Error(`Can not sign for input #${me} with the key ${Oe.publicKey.toString("hex")}`);return vt}toBuffer(){return G(this.__CACHE),this.data.toBuffer()}toHex(){return G(this.__CACHE),this.data.toHex()}toBase64(){return G(this.__CACHE),this.data.toBase64()}updateGlobal(me){return this.data.updateGlobal(me),this}updateInput(me,Te){return Te.witnessScript&&se(Te.witnessScript),(0,k.checkTaprootInputFields)(this.data.inputs[me],Te,"updateInput"),this.data.updateInput(me,Te),Te.nonWitnessUtxo&&ft(this.__CACHE,this.data.inputs[me],me),this}updateOutput(me,Te){const Oe=this.data.outputs[me];return(0,k.checkTaprootOutputFields)(Oe,Te,"updateOutput"),this.data.updateOutput(me,Te),this}addUnknownKeyValToGlobal(me){return this.data.addUnknownKeyValToGlobal(me),this}addUnknownKeyValToInput(me,Te){return this.data.addUnknownKeyValToInput(me,Te),this}addUnknownKeyValToOutput(me,Te){return this.data.addUnknownKeyValToOutput(me,Te),this}clearFinalizedInput(me){return this.data.clearFinalizedInput(me),this}}p.Psbt=L;const D=Ee=>new W(Ee);class W{constructor(me=v.from([2,0,0,0,0,0,0,0,0,0])){this.tx=S.Transaction.fromBuffer(me),N(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(me){if(me.hash===void 0||me.index===void 0||!v.isBuffer(me.hash)&&typeof me.hash!="string"||typeof me.index!="number")throw new Error("Error adding input.");const Te=typeof me.hash=="string"?(0,b.reverseBuffer)(v.from(me.hash,"hex")):me.hash;this.tx.addInput(Te,me.index,me.sequence)}addOutput(me){if(me.script===void 0||me.value===void 0||!v.isBuffer(me.script)||typeof me.value!="number")throw new Error("Error adding output.");this.tx.addOutput(me.script,me.value)}toBuffer(){return this.tx.toBuffer()}}function H(Ee,me,Te){switch(Te){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return Z(1,Ee.partialSig);case"multisig":const Oe=w.p2ms({output:me});return Z(Oe.m,Ee.partialSig,Oe.pubkeys);default:return!1}}function G(Ee){if(Ee.__UNSAFE_SIGN_NONSEGWIT!==!1)throw new Error("Not BIP174 compliant, can not export")}function Z(Ee,me,Te){if(!me)return!1;let Oe;if(Te?Oe=Te.map(Qe=>{const Vt=qe(Qe);return me.find(vt=>vt.pubkey.equals(Vt))}).filter(Qe=>!!Qe):Oe=me,Oe.length>Ee)throw new Error("Too many signatures");return Oe.length===Ee}function Q(Ee){return!!Ee.finalScriptSig||!!Ee.finalScriptWitness}function ie(Ee){return me=>!(!me.masterFingerprint.equals(Ee.fingerprint)||!Ee.derivePath(me.path).publicKey.equals(me.pubkey))}function le(Ee){if(typeof Ee!="number"||Ee!==Math.floor(Ee)||Ee>4294967295||Ee<0)throw new Error("Invalid 32 bit integer")}function be(Ee,me,Te){const Oe=me.__FEE_RATE||Ee.getFeeRate(),Qe=me.__EXTRACTED_TX.virtualSize(),Vt=Oe*Qe;if(Oe>=Te.maximumFeeRate)throw new Error(`Warning: You are paying around ${(Vt/1e8).toFixed(8)} in fees, which is ${Oe} satoshi per byte for a transaction with a VSize of ${Qe} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`)}function we(Ee,me){Ee.forEach(Te=>{if((0,k.isTaprootInput)(Te)?(0,k.checkTaprootInputForSigs)(Te,me):(0,B.checkInputForSig)(Te,me))throw new Error("Can not modify transaction, signatures exist.")})}function Ae(Ee){if(!Ee.sighashType||!Ee.partialSig)return;const{partialSig:me,sighashType:Te}=Ee;me.forEach(Oe=>{const{hashType:Qe}=A.signature.decode(Oe.signature);if(Te!==Qe)throw new Error("Signature sighash does not match input sighash type")})}function re(Ee,me,Te){if(!(0,B.pubkeyInScript)(Ee,me))throw new Error(`Can not ${Te} for this input with the key ${Ee.toString("hex")}`)}function N(Ee){if(!Ee.ins.every(Te=>Te.script&&Te.script.length===0&&Te.witness&&Te.witness.length===0))throw new Error("Format Error: Transaction ScriptSigs are not empty")}function z(Ee,me){Ee.ins.forEach(Te=>{V(me,Te)})}function V(Ee,me){const Te=(0,b.reverseBuffer)(v.from(me.hash)).toString("hex")+":"+me.index;if(Ee.__TX_IN_CACHE[Te])throw new Error("Duplicate input detected.");Ee.__TX_IN_CACHE[Te]=1}function U(Ee,me){return(Te,Oe,Qe,Vt)=>{const vt=Ee({redeem:{output:Qe}}).output;if(!Oe.equals(vt))throw new Error(`${me} for ${Vt} #${Te} doesn't match the scriptPubKey in the prevout`)}}const j=U(w.p2sh,"Redeem script"),$=U(w.p2wsh,"Witness script");function ee(Ee,me,Te,Oe){if(!Te.every(Q))throw new Error(`PSBT must be finalized to calculate ${me}`);if(Ee==="__FEE_RATE"&&Oe.__FEE_RATE)return Oe.__FEE_RATE;if(Ee==="__FEE"&&Oe.__FEE)return Oe.__FEE;let Qe,Vt=!0;if(Oe.__EXTRACTED_TX?(Qe=Oe.__EXTRACTED_TX,Vt=!1):Qe=Oe.__TX.clone(),Xe(Te,Qe,Oe,Vt),Ee==="__FEE_RATE")return Oe.__FEE_RATE;if(Ee==="__FEE")return Oe.__FEE}function J(Ee,me,Te,Oe,Qe,Vt){const vt=oe(Te);if(!H(me,Te,vt))throw new Error(`Can not finalize input #${Ee}`);return F(Te,vt,me.partialSig,Oe,Qe,Vt)}function F(Ee,me,Te,Oe,Qe,Vt){let vt,Zt;const dn=ut(Ee,me,Te),ln=Vt?w.p2wsh({redeem:dn}):null,yn=Qe?w.p2sh({redeem:ln||dn}):null;return Oe?(ln?Zt=(0,B.witnessStackToScriptWitness)(ln.witness):Zt=(0,B.witnessStackToScriptWitness)(dn.witness),yn&&(vt=yn.input)):yn?vt=yn.input:vt=dn.input,{finalScriptSig:vt,finalScriptWitness:Zt}}function X(Ee,me,Te,Oe,Qe){const Vt=(0,I.checkForInput)(Ee,me),{hash:vt,sighashType:Zt,script:dn}=de(me,Vt,Oe,!1,Qe);return re(Te,dn,"sign"),{hash:vt,sighashType:Zt}}function de(Ee,me,Te,Oe,Qe){const Vt=Te.__TX,vt=me.sighashType||S.Transaction.SIGHASH_ALL;ke(vt,Qe);let Zt,dn;if(me.nonWitnessUtxo){const or=ct(Te,me,Ee),An=Vt.ins[Ee].hash,Un=or.getHash();if(!An.equals(Un))throw new Error(`Non-witness UTXO hash for input #${Ee} doesn't match the hash specified in the prevout`);const Er=Vt.ins[Ee].index;dn=or.outs[Er]}else if(me.witnessUtxo)dn=me.witnessUtxo;else throw new Error("Need a Utxo input item for signing");const{meaningfulScript:ln,type:yn}=He(dn.script,Ee,"input",me.redeemScript,me.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(yn)>=0)Zt=Vt.hashForWitnessV0(Ee,ln,dn.value,vt);else if((0,B.isP2WPKH)(ln)){const or=w.p2pkh({hash:ln.slice(2)}).output;Zt=Vt.hashForWitnessV0(Ee,or,dn.value,vt)}else{if(me.nonWitnessUtxo===void 0&&Te.__UNSAFE_SIGN_NONSEGWIT===!1)throw new Error(`Input #${Ee} has witnessUtxo but non-segwit script: ${ln.toString("hex")}`);!Oe&&Te.__UNSAFE_SIGN_NONSEGWIT!==!1&&console.warn(`Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as Psbt's predecesor (TransactionBuilder - now removed) when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.
|
||
*********************
|
||
PROCEED WITH CAUTION!
|
||
*********************`),Zt=Vt.hashForSignature(Ee,ln,vt)}return{script:ln,sighashType:vt,hash:Zt}}function Y(Ee,me,Te,Oe){const Qe=[];if(me.tapInternalKey){const vt=ce(Ee,me,Oe);vt&&Qe.push(vt)}if(me.tapScriptSig){const vt=me.tapScriptSig.map(Zt=>Zt.pubkey);Qe.push(...vt)}return Qe.map(vt=>Ie(Ee,me,Te,vt,Oe)).flat()}function ce(Ee,me,Te){const{script:Oe}=Rt(Ee,me,Te);return(0,B.isP2TR)(Oe)?Oe.subarray(2,34):null}function he(Ee){return Ee.length===64?Ee:Ee.subarray(0,64)}function Ie(Ee,me,Te,Oe,Qe,Vt,vt){const Zt=Qe.__TX,dn=me.sighashType||S.Transaction.SIGHASH_DEFAULT;ke(dn,vt);const ln=Te.map((Er,ht)=>Rt(ht,Er,Qe)),yn=ln.map(Er=>Er.script),or=ln.map(Er=>Er.value),An=[];if(me.tapInternalKey&&!Vt){const Er=ce(Ee,me,Qe)||v.from([]);if((0,k.toXOnly)(Oe).equals(Er)){const ht=Zt.hashForWitnessV1(Ee,yn,or,dn);An.push({pubkey:Oe,hash:ht})}}const Un=(me.tapLeafScript||[]).filter(Er=>(0,B.pubkeyInScript)(Oe,Er.script)).map(Er=>{const ht=(0,_.tapleafHash)({output:Er.script,version:Er.leafVersion});return Object.assign({hash:ht},Er)}).filter(Er=>!Vt||Vt.equals(Er.hash)).map(Er=>{const ht=Zt.hashForWitnessV1(Ee,yn,or,S.Transaction.SIGHASH_DEFAULT,Er.hash);return{pubkey:Oe,hash:ht,leafHash:Er.hash}});return An.concat(Un)}function ke(Ee,me){if(me&&me.indexOf(Ee)<0){const Te=$t(Ee);throw new Error(`Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: ${Te}`)}}function ut(Ee,me,Te){let Oe;switch(me){case"multisig":const Qe=_t(Ee,Te);Oe=w.p2ms({output:Ee,signatures:Qe});break;case"pubkey":Oe=w.p2pk({output:Ee,signature:Te[0].signature});break;case"pubkeyhash":Oe=w.p2pkh({output:Ee,pubkey:Te[0].pubkey,signature:Te[0].signature});break;case"witnesspubkeyhash":Oe=w.p2wpkh({output:Ee,pubkey:Te[0].pubkey,signature:Te[0].signature});break}return Oe}function Re(Ee,me,Te){const Oe=Te.__TX,Qe={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(Qe.isP2SH=!!me.redeemScript,Qe.isP2WSH=!!me.witnessScript,me.witnessScript)Qe.script=me.witnessScript;else if(me.redeemScript)Qe.script=me.redeemScript;else if(me.nonWitnessUtxo){const Vt=ct(Te,me,Ee),vt=Oe.ins[Ee].index;Qe.script=Vt.outs[vt].script}else me.witnessUtxo&&(Qe.script=me.witnessUtxo.script);return(me.witnessScript||(0,B.isP2WPKH)(Qe.script))&&(Qe.isSegwit=!0),Qe}function ze(Ee,me,Te){const Oe=(0,I.checkForInput)(me,Ee);if(!Oe.bip32Derivation||Oe.bip32Derivation.length===0)throw new Error("Need bip32Derivation to sign with HD");const Qe=Oe.bip32Derivation.map(vt=>{if(vt.masterFingerprint.equals(Te.fingerprint))return vt}).filter(vt=>!!vt);if(Qe.length===0)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return Qe.map(vt=>{const Zt=Te.derivePath(vt.path);if(!vt.pubkey.equals(Zt.publicKey))throw new Error("pubkey did not match bip32Derivation");return Zt})}function _t(Ee,me){return w.p2ms({output:Ee}).pubkeys.map(Oe=>(me.filter(Qe=>Qe.pubkey.equals(Oe))[0]||{}).signature).filter(Oe=>!!Oe)}function Ct(Ee){let me=0;function Te(vt){return me+=vt,Ee.slice(me-vt,me)}function Oe(){const vt=C.decode(Ee,me);return me+=C.decode.bytes,vt}function Qe(){return Te(Oe())}function Vt(){const vt=Oe(),Zt=[];for(let dn=0;dn<vt;dn++)Zt.push(Qe());return Zt}return Vt()}function $t(Ee){let me=Ee&S.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(Ee&31){case S.Transaction.SIGHASH_ALL:me+="SIGHASH_ALL";break;case S.Transaction.SIGHASH_SINGLE:me+="SIGHASH_SINGLE";break;case S.Transaction.SIGHASH_NONE:me+="SIGHASH_NONE";break}return me}function ft(Ee,me,Te){Ee.__NON_WITNESS_UTXO_BUF_CACHE[Te]=me.nonWitnessUtxo;const Oe=S.Transaction.fromBuffer(me.nonWitnessUtxo);Ee.__NON_WITNESS_UTXO_TX_CACHE[Te]=Oe;const Qe=Ee,Vt=Te;delete me.nonWitnessUtxo,Object.defineProperty(me,"nonWitnessUtxo",{enumerable:!0,get(){const vt=Qe.__NON_WITNESS_UTXO_BUF_CACHE[Vt],Zt=Qe.__NON_WITNESS_UTXO_TX_CACHE[Vt];if(vt!==void 0)return vt;{const dn=Zt.toBuffer();return Qe.__NON_WITNESS_UTXO_BUF_CACHE[Vt]=dn,dn}},set(vt){Qe.__NON_WITNESS_UTXO_BUF_CACHE[Vt]=vt}})}function Xe(Ee,me,Te,Oe){let Qe=0;Ee.forEach((dn,ln)=>{if(Oe&&dn.finalScriptSig&&(me.ins[ln].script=dn.finalScriptSig),Oe&&dn.finalScriptWitness&&(me.ins[ln].witness=Ct(dn.finalScriptWitness)),dn.witnessUtxo)Qe+=dn.witnessUtxo.value;else if(dn.nonWitnessUtxo){const yn=ct(Te,dn,ln),or=me.ins[ln].index,An=yn.outs[or];Qe+=An.value}});const Vt=me.outs.reduce((dn,ln)=>dn+ln.value,0),vt=Qe-Vt;if(vt<0)throw new Error("Outputs are spending more than Inputs");const Zt=me.virtualSize();Te.__FEE=vt,Te.__EXTRACTED_TX=me,Te.__FEE_RATE=Math.floor(vt/Zt)}function ct(Ee,me,Te){const Oe=Ee.__NON_WITNESS_UTXO_TX_CACHE;return Oe[Te]||ft(Ee,me,Te),Oe[Te]}function wt(Ee,me,Te){const{script:Oe}=Rt(Ee,me,Te);return Oe}function Rt(Ee,me,Te){if(me.witnessUtxo!==void 0)return{script:me.witnessUtxo.script,value:me.witnessUtxo.value};if(me.nonWitnessUtxo!==void 0){const Qe=ct(Te,me,Ee).outs[Te.__TX.ins[Ee].index];return{script:Qe.script,value:Qe.value}}else throw new Error("Can't find pubkey in input without Utxo data")}function Ge(Ee,me,Te,Oe){const Qe=wt(Te,me,Oe),{meaningfulScript:Vt}=He(Qe,Te,"input",me.redeemScript,me.witnessScript);return(0,B.pubkeyInScript)(Ee,Vt)}function zt(Ee,me,Te,Oe){const Qe=Oe.__TX.outs[Te].script,{meaningfulScript:Vt}=He(Qe,Te,"output",me.redeemScript,me.witnessScript);return(0,B.pubkeyInScript)(Ee,Vt)}function Ft(Ee){if(!Ee)return;const me=A.decompile(Ee);if(!me)return;const Te=me[me.length-1];if(!(!v.isBuffer(Te)||dt(Te)||De(Te)||!A.decompile(Te)))return Te}function tt(Ee){if(!Ee)return;const me=Ct(Ee),Te=me[me.length-1];if(!(dt(Te)||!A.decompile(Te)))return Te}function qe(Ee){if(Ee.length===65){const me=Ee[64]&1,Te=Ee.slice(0,33);return Te[0]=2|me,Te}return Ee.slice()}function dt(Ee){return Ee.length===33&&A.isCanonicalPubKey(Ee)}function De(Ee){return A.isCanonicalScriptSignature(Ee)}function He(Ee,me,Te,Oe,Qe){const Vt=(0,B.isP2SHScript)(Ee),vt=Vt&&Oe&&(0,B.isP2WSHScript)(Oe),Zt=(0,B.isP2WSHScript)(Ee);if(Vt&&Oe===void 0)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((Zt||vt)&&Qe===void 0)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let dn;return vt?(dn=Qe,j(me,Ee,Oe,Te),$(me,Oe,Qe,Te),se(dn)):Zt?(dn=Qe,$(me,Ee,Qe,Te),se(dn)):Vt?(dn=Oe,j(me,Ee,Oe,Te)):dn=Ee,{meaningfulScript:dn,type:vt?"p2sh-p2wsh":Vt?"p2sh":Zt?"p2wsh":"raw"}}function se(Ee){if((0,B.isP2WPKH)(Ee)||(0,B.isP2SHScript)(Ee))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function oe(Ee){return(0,B.isP2WPKH)(Ee)?"witnesspubkeyhash":(0,B.isP2PKH)(Ee)?"pubkeyhash":(0,B.isP2MS)(Ee)?"multisig":(0,B.isP2PK)(Ee)?"pubkey":"nonstandard"}function ye(Ee){return[...Array(Ee).keys()]}},97379:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.checkTaprootInputForSigs=p.tapTreeFromList=p.tapTreeToList=p.tweakInternalPubKey=p.checkTaprootOutputFields=p.checkTaprootInputFields=p.isTaprootOutput=p.isTaprootInput=p.serializeTaprootSignature=p.tapScriptFinalizer=p.toXOnly=void 0;const T=x(9550),C=x(44491),I=x(52155),m=x(31340),b=x(52127),g=x(52155),w=F=>F.length===32?F:F.slice(1,33);p.toXOnly=w;function _(F,X,de){const Y=$(X,F,de);try{const he=U(X,Y).concat(Y.script).concat(Y.controlBlock);return{finalScriptWitness:(0,I.witnessStackToScriptWitness)(he)}}catch(ce){throw new Error(`Can not finalize taproot input #${F}: ${ce}`)}}p.tapScriptFinalizer=_;function A(F,X){const de=X?v.from([X]):v.from([]);return v.concat([F,de])}p.serializeTaprootSignature=A;function S(F){return F&&!!(F.tapInternalKey||F.tapMerkleRoot||F.tapLeafScript&&F.tapLeafScript.length||F.tapBip32Derivation&&F.tapBip32Derivation.length||F.witnessUtxo&&(0,I.isP2TR)(F.witnessUtxo.script))}p.isTaprootInput=S;function k(F,X){return F&&!!(F.tapInternalKey||F.tapTree||F.tapBip32Derivation&&F.tapBip32Derivation.length||X&&(0,I.isP2TR)(X))}p.isTaprootOutput=k;function B(F,X,de){re(F,X,de),z(F,X,de)}p.checkTaprootInputFields=B;function O(F,X,de){N(F,X,de),L(F,X)}p.checkTaprootOutputFields=O;function L(F,X){if(!X.tapTree&&!X.tapInternalKey)return;const de=X.tapInternalKey||F.tapInternalKey,Y=X.tapTree||F.tapTree;if(de){const{script:ce}=F,he=D(de,Y);if(ce&&!ce.equals(he))throw new Error("Error adding output. Script or address missmatch.")}}function D(F,X){const de=X&&G(X.leaves),{output:Y}=(0,b.p2tr)({internalPubkey:F,scriptTree:de});return Y}function W(F,X){const de=X.tapInternalKey,Y=de&&(0,m.tweakKey)(de,X.tapMerkleRoot);if(!Y)throw new Error(`Cannot tweak tap internal key for input #${F}. Public key: ${de&&de.toString("hex")}`);return Y.x}p.tweakInternalPubKey=W;function H(F){if(!(0,T.isTaptree)(F))throw new Error("Cannot convert taptree to tapleaf list. Expecting a tapree structure.");return be(F)}p.tapTreeToList=H;function G(F=[]){return F.length===1&&F[0].depth===0?{output:F[0].script,version:F[0].leafVersion}:we(F)}p.tapTreeFromList=G;function Z(F,X){return ie(F).some(Y=>(0,g.signatureBlocksAction)(Y,Q,X))}p.checkTaprootInputForSigs=Z;function Q(F){return{signature:F.slice(0,64),hashType:F.slice(64)[0]||C.Transaction.SIGHASH_DEFAULT}}function ie(F){const X=[];if(F.tapKeySig&&X.push(F.tapKeySig),F.tapScriptSig&&X.push(...F.tapScriptSig.map(de=>de.signature)),!X.length){const de=le(F.finalScriptWitness);de&&X.push(de)}return X}function le(F){if(!F)return;const X=F.slice(2);if(X.length===64||X.length===65)return X}function be(F,X=[],de=0){if(de>m.MAX_TAPTREE_DEPTH)throw new Error("Max taptree depth exceeded.");return F?(0,T.isTapleaf)(F)?(X.push({depth:de,leafVersion:F.version||m.LEAF_VERSION_TAPSCRIPT,script:F.output}),X):(F[0]&&be(F[0],X,de+1),F[1]&&be(F[1],X,de+1),X):[]}function we(F){let X;for(const de of F)if(X=Ae(de,X),!X)throw new Error("No room left to insert tapleaf in tree");return X}function Ae(F,X,de=0){if(de>m.MAX_TAPTREE_DEPTH)throw new Error("Max taptree depth exceeded.");if(F.depth===de)return X?void 0:{output:F.script,version:F.leafVersion};if((0,T.isTapleaf)(X))return;const Y=Ae(F,X&&X[0],de+1);if(Y)return[Y,X&&X[1]];const ce=Ae(F,X&&X[1],de+1);if(ce)return[X&&X[0],ce]}function re(F,X,de){const Y=S(F)&&J(X),ce=J(F)&&S(X),he=F===X&&S(X)&&J(X);if(Y||ce||he)throw new Error(`Invalid arguments for Psbt.${de}. Cannot use both taproot and non-taproot fields.`)}function N(F,X,de){const Y=k(F)&&J(X),ce=J(F)&&k(X),he=F===X&&k(X)&&J(X);if(Y||ce||he)throw new Error(`Invalid arguments for Psbt.${de}. Cannot use both taproot and non-taproot fields.`)}function z(F,X,de){if(X.tapMerkleRoot){const Y=(X.tapLeafScript||[]).every(he=>V(he,X.tapMerkleRoot)),ce=(F.tapLeafScript||[]).every(he=>V(he,X.tapMerkleRoot));if(!Y||!ce)throw new Error(`Invalid arguments for Psbt.${de}. Tapleaf not part of taptree.`)}else if(F.tapMerkleRoot&&!(X.tapLeafScript||[]).every(ce=>V(ce,F.tapMerkleRoot)))throw new Error(`Invalid arguments for Psbt.${de}. Tapleaf not part of taptree.`)}function V(F,X){if(!X)return!0;const de=(0,m.tapleafHash)({output:F.script,version:F.leafVersion});return(0,m.rootHashFromPath)(F.controlBlock,de).equals(X)}function U(F,X){const de=(0,m.tapleafHash)({output:X.script,version:X.leafVersion});return(F.tapScriptSig||[]).filter(Y=>Y.leafHash.equals(de)).map(Y=>j(X.script,Y)).sort((Y,ce)=>ce.positionInScript-Y.positionInScript).map(Y=>Y.signature)}function j(F,X){return Object.assign({positionInScript:(0,I.pubkeyPositionInScript)(X.pubkey,F)},X)}function $(F,X,de){if(!F.tapScriptSig||!F.tapScriptSig.length)throw new Error(`Can not finalize taproot input #${X}. No tapleaf script signature provided.`);const Y=(F.tapLeafScript||[]).sort((ce,he)=>ce.controlBlock.length-he.controlBlock.length).find(ce=>ee(ce,F.tapScriptSig,de));if(!Y)throw new Error(`Can not finalize taproot input #${X}. Signature for tapleaf script not found.`);return Y}function ee(F,X,de){const Y=(0,m.tapleafHash)({output:F.script,version:F.leafVersion});return(!de||de.equals(Y))&&X.find(he=>he.leafHash.equals(Y))!==void 0}function J(F){return F&&!!(F.redeemScript||F.witnessScript||F.bip32Derivation&&F.bip32Derivation.length)}},52155:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.signatureBlocksAction=p.checkInputForSig=p.pubkeyInScript=p.pubkeyPositionInScript=p.witnessStackToScriptWitness=p.isP2TR=p.isP2SHScript=p.isP2WSHScript=p.isP2WPKH=p.isP2PKH=p.isP2PK=p.isP2MS=void 0;const T=x(40586),C=x(42940),I=x(44491),m=x(1502),b=x(52127);function g(L){return D=>{try{return L({output:D}),!0}catch{return!1}}}p.isP2MS=g(b.p2ms),p.isP2PK=g(b.p2pk),p.isP2PKH=g(b.p2pkh),p.isP2WPKH=g(b.p2wpkh),p.isP2WSHScript=g(b.p2wsh),p.isP2SHScript=g(b.p2sh),p.isP2TR=g(b.p2tr);function w(L){let D=v.allocUnsafe(0);function W(Q){D=v.concat([D,v.from(Q)])}function H(Q){const ie=D.length,le=T.encodingLength(Q);D=v.concat([D,v.allocUnsafe(le)]),T.encode(Q,D,ie)}function G(Q){H(Q.length),W(Q)}function Z(Q){H(Q.length),Q.forEach(G)}return Z(L),D}p.witnessStackToScriptWitness=w;function _(L,D){const W=(0,m.hash160)(L),H=L.slice(1,33),G=C.decompile(D);if(G===null)throw new Error("Unknown script error");return G.findIndex(Z=>typeof Z=="number"?!1:Z.equals(L)||Z.equals(W)||Z.equals(H))}p.pubkeyPositionInScript=_;function A(L,D){return _(L,D)!==-1}p.pubkeyInScript=A;function S(L,D){return B(L).some(H=>k(H,C.signature.decode,D))}p.checkInputForSig=S;function k(L,D,W){const{hashType:H}=D(L),G=[];switch(H&I.Transaction.SIGHASH_ANYONECANPAY&&G.push("addInput"),H&31){case I.Transaction.SIGHASH_ALL:break;case I.Transaction.SIGHASH_SINGLE:case I.Transaction.SIGHASH_NONE:G.push("addOutput"),G.push("setInputSequence");break}return G.indexOf(W)===-1}p.signatureBlocksAction=k;function B(L){let D=[];if((L.partialSig||[]).length===0){if(!L.finalScriptSig&&!L.finalScriptWitness)return[];D=O(L)}else D=L.partialSig;return D.map(W=>W.signature)}function O(L){const D=L.finalScriptSig?C.decompile(L.finalScriptSig)||[]:[],W=L.finalScriptWitness?C.decompile(L.finalScriptWitness)||[]:[];return D.concat(W).filter(H=>v.isBuffer(H)&&C.isCanonicalScriptSignature(H)).map(H=>({signature:H}))}},43342:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.decode=p.encode=p.encodingLength=void 0;const v=x(29991);function T(m){return m<v.OPS.OP_PUSHDATA1?1:m<=255?2:m<=65535?3:5}p.encodingLength=T;function C(m,b,g){const w=T(b);return w===1?m.writeUInt8(b,g):w===2?(m.writeUInt8(v.OPS.OP_PUSHDATA1,g),m.writeUInt8(b,g+1)):w===3?(m.writeUInt8(v.OPS.OP_PUSHDATA2,g),m.writeUInt16LE(b,g+1)):(m.writeUInt8(v.OPS.OP_PUSHDATA4,g),m.writeUInt32LE(b,g+1)),w}p.encode=C;function I(m,b){const g=m.readUInt8(b);let w,_;if(g<v.OPS.OP_PUSHDATA1)w=g,_=1;else if(g===v.OPS.OP_PUSHDATA1){if(b+2>m.length)return null;w=m.readUInt8(b+1),_=2}else if(g===v.OPS.OP_PUSHDATA2){if(b+3>m.length)return null;w=m.readUInt16LE(b+1),_=3}else{if(b+5>m.length)return null;if(g!==v.OPS.OP_PUSHDATA4)throw new Error("Unexpected opcode");w=m.readUInt32LE(b+1),_=5}return{opcode:g,number:w,size:_}}p.decode=I},42940:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.signature=p.number=p.isCanonicalScriptSignature=p.isDefinedHashType=p.isCanonicalPubKey=p.toStack=p.fromASM=p.toASM=p.decompile=p.compile=p.countNonPushOnlyOPs=p.isPushOnly=p.OPS=void 0;const T=x(89584),C=x(29991);Object.defineProperty(p,"OPS",{enumerable:!0,get:function(){return C.OPS}});const I=x(43342),m=x(18314),b=x(67565),g=x(9550),{typeforce:w}=g,_=C.OPS.OP_RESERVED;function A(Ae){return g.Number(Ae)&&(Ae===C.OPS.OP_0||Ae>=C.OPS.OP_1&&Ae<=C.OPS.OP_16||Ae===C.OPS.OP_1NEGATE)}function S(Ae){return g.Buffer(Ae)||A(Ae)}function k(Ae){return g.Array(Ae)&&Ae.every(S)}p.isPushOnly=k;function B(Ae){return Ae.length-Ae.filter(S).length}p.countNonPushOnlyOPs=B;function O(Ae){if(Ae.length===0)return C.OPS.OP_0;if(Ae.length===1){if(Ae[0]>=1&&Ae[0]<=16)return _+Ae[0];if(Ae[0]===129)return C.OPS.OP_1NEGATE}}function L(Ae){return v.isBuffer(Ae)}function D(Ae){return g.Array(Ae)}function W(Ae){return v.isBuffer(Ae)}function H(Ae){if(L(Ae))return Ae;w(g.Array,Ae);const re=Ae.reduce((V,U)=>W(U)?U.length===1&&O(U)!==void 0?V+1:V+I.encodingLength(U.length)+U.length:V+1,0),N=v.allocUnsafe(re);let z=0;if(Ae.forEach(V=>{if(W(V)){const U=O(V);if(U!==void 0){N.writeUInt8(U,z),z+=1;return}z+=I.encode(N,V.length,z),V.copy(N,z),z+=V.length}else N.writeUInt8(V,z),z+=1}),z!==N.length)throw new Error("Could not decode chunks");return N}p.compile=H;function G(Ae){if(D(Ae))return Ae;w(g.Buffer,Ae);const re=[];let N=0;for(;N<Ae.length;){const z=Ae[N];if(z>C.OPS.OP_0&&z<=C.OPS.OP_PUSHDATA4){const V=I.decode(Ae,N);if(V===null||(N+=V.size,N+V.number>Ae.length))return null;const U=Ae.slice(N,N+V.number);N+=V.number;const j=O(U);j!==void 0?re.push(j):re.push(U)}else re.push(z),N+=1}return re}p.decompile=G;function Z(Ae){return L(Ae)&&(Ae=G(Ae)),Ae.map(re=>{if(W(re)){const N=O(re);if(N===void 0)return re.toString("hex");re=N}return C.REVERSE_OPS[re]}).join(" ")}p.toASM=Z;function Q(Ae){return w(g.String,Ae),H(Ae.split(" ").map(re=>C.OPS[re]!==void 0?C.OPS[re]:(w(g.Hex,re),v.from(re,"hex"))))}p.fromASM=Q;function ie(Ae){return Ae=G(Ae),w(k,Ae),Ae.map(re=>W(re)?re:re===C.OPS.OP_0?v.allocUnsafe(0):m.encode(re-_))}p.toStack=ie;function le(Ae){return g.isPoint(Ae)}p.isCanonicalPubKey=le;function be(Ae){const re=Ae&-129;return re>0&&re<4}p.isDefinedHashType=be;function we(Ae){return!v.isBuffer(Ae)||!be(Ae[Ae.length-1])?!1:T.check(Ae.slice(0,-1))}p.isCanonicalScriptSignature=we,p.number=m,p.signature=b},18314:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.encode=p.decode=void 0;function T(m,b,g){b=b||4,g=g===void 0?!0:g;const w=m.length;if(w===0)return 0;if(w>b)throw new TypeError("Script number overflow");if(g&&!(m[w-1]&127)&&(w<=1||!(m[w-2]&128)))throw new Error("Non-minimally encoded script number");if(w===5){const A=m.readUInt32LE(0),S=m.readUInt8(4);return S&128?-((S&-129)*4294967296+A):S*4294967296+A}let _=0;for(let A=0;A<w;++A)_|=m[A]<<8*A;return m[w-1]&128?-(_&~(128<<8*(w-1))):_}p.decode=T;function C(m){return m>2147483647?5:m>8388607?4:m>32767?3:m>127?2:m>0?1:0}function I(m){let b=Math.abs(m);const g=C(b),w=v.allocUnsafe(g),_=m<0;for(let A=0;A<g;++A)w.writeUInt8(b&255,A),b>>=8;return w[g-1]&128?w.writeUInt8(_?128:0,g-1):_&&(w[g-1]|=128),w}p.encode=I},67565:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.encode=p.decode=void 0;const T=x(89584),C=x(9550),{typeforce:I}=C,m=v.alloc(1,0);function b(A){let S=0;for(;A[S]===0;)++S;return S===A.length?m:(A=A.slice(S),A[0]&128?v.concat([m,A],1+A.length):A)}function g(A){A[0]===0&&(A=A.slice(1));const S=v.alloc(32,0),k=Math.max(0,32-A.length);return A.copy(S,k),S}function w(A){const S=A.readUInt8(A.length-1),k=S&-129;if(k<=0||k>=4)throw new Error("Invalid hashType "+S);const B=T.decode(A.slice(0,-1)),O=g(B.r),L=g(B.s);return{signature:v.concat([O,L],64),hashType:S}}p.decode=w;function _(A,S){I({signature:C.BufferN(64),hashType:C.UInt8},{signature:A,hashType:S});const k=S&-129;if(k<=0||k>=4)throw new Error("Invalid hashType "+S);const B=v.allocUnsafe(1);B.writeUInt8(S,0);const O=b(A.slice(0,32)),L=b(A.slice(32,64));return v.concat([T.encode(O,L),B])}p.encode=_},44491:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.Transaction=void 0;const T=x(67640),C=x(1502),I=x(42940),m=x(42940),b=x(9550),{typeforce:g}=b;function w(H){const G=H.length;return T.varuint.encodingLength(G)+G}function _(H){const G=H.length;return T.varuint.encodingLength(G)+H.reduce((Z,Q)=>Z+w(Q),0)}const A=v.allocUnsafe(0),S=[],k=v.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),B=v.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),O=v.from("ffffffffffffffff","hex"),L={script:A,valueBuffer:O};function D(H){return H.value!==void 0}class W{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(G,Z){const Q=new T.BufferReader(G),ie=new W;ie.version=Q.readInt32();const le=Q.readUInt8(),be=Q.readUInt8();let we=!1;le===W.ADVANCED_TRANSACTION_MARKER&&be===W.ADVANCED_TRANSACTION_FLAG?we=!0:Q.offset-=2;const Ae=Q.readVarInt();for(let N=0;N<Ae;++N)ie.ins.push({hash:Q.readSlice(32),index:Q.readUInt32(),script:Q.readVarSlice(),sequence:Q.readUInt32(),witness:S});const re=Q.readVarInt();for(let N=0;N<re;++N)ie.outs.push({value:Q.readUInt64(),script:Q.readVarSlice()});if(we){for(let N=0;N<Ae;++N)ie.ins[N].witness=Q.readVector();if(!ie.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(ie.locktime=Q.readUInt32(),Z)return ie;if(Q.offset!==G.length)throw new Error("Transaction has unexpected data");return ie}static fromHex(G){return W.fromBuffer(v.from(G,"hex"),!1)}static isCoinbaseHash(G){g(b.Hash256bit,G);for(let Z=0;Z<32;++Z)if(G[Z]!==0)return!1;return!0}isCoinbase(){return this.ins.length===1&&W.isCoinbaseHash(this.ins[0].hash)}addInput(G,Z,Q,ie){return g(b.tuple(b.Hash256bit,b.UInt32,b.maybe(b.UInt32),b.maybe(b.Buffer)),arguments),b.Null(Q)&&(Q=W.DEFAULT_SEQUENCE),this.ins.push({hash:G,index:Z,script:ie||A,sequence:Q,witness:S})-1}addOutput(G,Z){return g(b.tuple(b.Buffer,b.Satoshi),arguments),this.outs.push({script:G,value:Z})-1}hasWitnesses(){return this.ins.some(G=>G.witness.length!==0)}weight(){const G=this.byteLength(!1),Z=this.byteLength(!0);return G*3+Z}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(G=!0){const Z=G&&this.hasWitnesses();return(Z?10:8)+T.varuint.encodingLength(this.ins.length)+T.varuint.encodingLength(this.outs.length)+this.ins.reduce((Q,ie)=>Q+40+w(ie.script),0)+this.outs.reduce((Q,ie)=>Q+8+w(ie.script),0)+(Z?this.ins.reduce((Q,ie)=>Q+_(ie.witness),0):0)}clone(){const G=new W;return G.version=this.version,G.locktime=this.locktime,G.ins=this.ins.map(Z=>({hash:Z.hash,index:Z.index,script:Z.script,sequence:Z.sequence,witness:Z.witness})),G.outs=this.outs.map(Z=>({script:Z.script,value:Z.value})),G}hashForSignature(G,Z,Q){if(g(b.tuple(b.UInt32,b.Buffer,b.Number),arguments),G>=this.ins.length)return B;const ie=I.compile(I.decompile(Z).filter(we=>we!==m.OPS.OP_CODESEPARATOR)),le=this.clone();if((Q&31)===W.SIGHASH_NONE)le.outs=[],le.ins.forEach((we,Ae)=>{Ae!==G&&(we.sequence=0)});else if((Q&31)===W.SIGHASH_SINGLE){if(G>=this.outs.length)return B;le.outs.length=G+1;for(let we=0;we<G;we++)le.outs[we]=L;le.ins.forEach((we,Ae)=>{Ae!==G&&(we.sequence=0)})}Q&W.SIGHASH_ANYONECANPAY?(le.ins=[le.ins[G]],le.ins[0].script=ie):(le.ins.forEach(we=>{we.script=A}),le.ins[G].script=ie);const be=v.allocUnsafe(le.byteLength(!1)+4);return be.writeInt32LE(Q,be.length-4),le.__toBuffer(be,0,!1),C.hash256(be)}hashForWitnessV1(G,Z,Q,ie,le,be){if(g(b.tuple(b.UInt32,g.arrayOf(b.Buffer),g.arrayOf(b.Satoshi),b.UInt32),arguments),Q.length!==this.ins.length||Z.length!==this.ins.length)throw new Error("Must supply prevout script and value for all inputs");const we=ie===W.SIGHASH_DEFAULT?W.SIGHASH_ALL:ie&W.SIGHASH_OUTPUT_MASK,re=(ie&W.SIGHASH_INPUT_MASK)===W.SIGHASH_ANYONECANPAY,N=we===W.SIGHASH_NONE,z=we===W.SIGHASH_SINGLE;let V=A,U=A,j=A,$=A,ee=A;if(!re){let de=T.BufferWriter.withCapacity(36*this.ins.length);this.ins.forEach(Y=>{de.writeSlice(Y.hash),de.writeUInt32(Y.index)}),V=C.sha256(de.end()),de=T.BufferWriter.withCapacity(8*this.ins.length),Q.forEach(Y=>de.writeUInt64(Y)),U=C.sha256(de.end()),de=T.BufferWriter.withCapacity(Z.map(w).reduce((Y,ce)=>Y+ce)),Z.forEach(Y=>de.writeVarSlice(Y)),j=C.sha256(de.end()),de=T.BufferWriter.withCapacity(4*this.ins.length),this.ins.forEach(Y=>de.writeUInt32(Y.sequence)),$=C.sha256(de.end())}if(N||z){if(z&&G<this.outs.length){const de=this.outs[G],Y=T.BufferWriter.withCapacity(8+w(de.script));Y.writeUInt64(de.value),Y.writeVarSlice(de.script),ee=C.sha256(Y.end())}}else{const de=this.outs.map(ce=>8+w(ce.script)).reduce((ce,he)=>ce+he),Y=T.BufferWriter.withCapacity(de);this.outs.forEach(ce=>{Y.writeUInt64(ce.value),Y.writeVarSlice(ce.script)}),ee=C.sha256(Y.end())}const J=(le?2:0)+(be?1:0),F=174-(re?49:0)-(N?32:0)+(be?32:0)+(le?37:0),X=T.BufferWriter.withCapacity(F);if(X.writeUInt8(ie),X.writeInt32(this.version),X.writeUInt32(this.locktime),X.writeSlice(V),X.writeSlice(U),X.writeSlice(j),X.writeSlice($),N||z||X.writeSlice(ee),X.writeUInt8(J),re){const de=this.ins[G];X.writeSlice(de.hash),X.writeUInt32(de.index),X.writeUInt64(Q[G]),X.writeVarSlice(Z[G]),X.writeUInt32(de.sequence)}else X.writeUInt32(G);if(be){const de=T.BufferWriter.withCapacity(w(be));de.writeVarSlice(be),X.writeSlice(C.sha256(de.end()))}return z&&X.writeSlice(ee),le&&(X.writeSlice(le),X.writeUInt8(0),X.writeUInt32(4294967295)),C.taggedHash("TapSighash",v.concat([v.from([0]),X.end()]))}hashForWitnessV0(G,Z,Q,ie){g(b.tuple(b.UInt32,b.Buffer,b.Satoshi,b.UInt32),arguments);let le=v.from([]),be,we=k,Ae=k,re=k;if(ie&W.SIGHASH_ANYONECANPAY||(le=v.allocUnsafe(36*this.ins.length),be=new T.BufferWriter(le,0),this.ins.forEach(z=>{be.writeSlice(z.hash),be.writeUInt32(z.index)}),Ae=C.hash256(le)),!(ie&W.SIGHASH_ANYONECANPAY)&&(ie&31)!==W.SIGHASH_SINGLE&&(ie&31)!==W.SIGHASH_NONE&&(le=v.allocUnsafe(4*this.ins.length),be=new T.BufferWriter(le,0),this.ins.forEach(z=>{be.writeUInt32(z.sequence)}),re=C.hash256(le)),(ie&31)!==W.SIGHASH_SINGLE&&(ie&31)!==W.SIGHASH_NONE){const z=this.outs.reduce((V,U)=>V+8+w(U.script),0);le=v.allocUnsafe(z),be=new T.BufferWriter(le,0),this.outs.forEach(V=>{be.writeUInt64(V.value),be.writeVarSlice(V.script)}),we=C.hash256(le)}else if((ie&31)===W.SIGHASH_SINGLE&&G<this.outs.length){const z=this.outs[G];le=v.allocUnsafe(8+w(z.script)),be=new T.BufferWriter(le,0),be.writeUInt64(z.value),be.writeVarSlice(z.script),we=C.hash256(le)}le=v.allocUnsafe(156+w(Z)),be=new T.BufferWriter(le,0);const N=this.ins[G];return be.writeInt32(this.version),be.writeSlice(Ae),be.writeSlice(re),be.writeSlice(N.hash),be.writeUInt32(N.index),be.writeVarSlice(Z),be.writeUInt64(Q),be.writeUInt32(N.sequence),be.writeSlice(we),be.writeUInt32(this.locktime),be.writeUInt32(ie),C.hash256(le)}getHash(G){return G&&this.isCoinbase()?v.alloc(32,0):C.hash256(this.__toBuffer(void 0,void 0,G))}getId(){return(0,T.reverseBuffer)(this.getHash(!1)).toString("hex")}toBuffer(G,Z){return this.__toBuffer(G,Z,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(G,Z){g(b.tuple(b.Number,b.Buffer),arguments),this.ins[G].script=Z}setWitness(G,Z){g(b.tuple(b.Number,[b.Buffer]),arguments),this.ins[G].witness=Z}__toBuffer(G,Z,Q=!1){G||(G=v.allocUnsafe(this.byteLength(Q)));const ie=new T.BufferWriter(G,Z||0);ie.writeInt32(this.version);const le=Q&&this.hasWitnesses();return le&&(ie.writeUInt8(W.ADVANCED_TRANSACTION_MARKER),ie.writeUInt8(W.ADVANCED_TRANSACTION_FLAG)),ie.writeVarInt(this.ins.length),this.ins.forEach(be=>{ie.writeSlice(be.hash),ie.writeUInt32(be.index),ie.writeVarSlice(be.script),ie.writeUInt32(be.sequence)}),ie.writeVarInt(this.outs.length),this.outs.forEach(be=>{D(be)?ie.writeUInt64(be.value):ie.writeSlice(be.valueBuffer),ie.writeVarSlice(be.script)}),le&&this.ins.forEach(be=>{ie.writeVector(be.witness)}),ie.writeUInt32(this.locktime),Z!==void 0?G.slice(Z,ie.offset):G}}p.Transaction=W,W.DEFAULT_SEQUENCE=4294967295,W.SIGHASH_DEFAULT=0,W.SIGHASH_ALL=1,W.SIGHASH_NONE=2,W.SIGHASH_SINGLE=3,W.SIGHASH_ANYONECANPAY=128,W.SIGHASH_OUTPUT_MASK=3,W.SIGHASH_INPUT_MASK=128,W.ADVANCED_TRANSACTION_MARKER=0,W.ADVANCED_TRANSACTION_FLAG=1},9550:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.oneOf=p.Null=p.BufferN=p.Function=p.UInt32=p.UInt8=p.tuple=p.maybe=p.Hex=p.Buffer=p.String=p.Boolean=p.Array=p.Number=p.Hash256bit=p.Hash160bit=p.Buffer256bit=p.isTaptree=p.isTapleaf=p.TAPLEAF_VERSION_MASK=p.Network=p.ECPoint=p.Satoshi=p.Signer=p.BIP32Path=p.UInt31=p.isPoint=p.typeforce=void 0;const v=x(36533);p.typeforce=x(41042);const T=v.Buffer.alloc(32,0),C=v.Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex");function I(B){if(!v.Buffer.isBuffer(B)||B.length<33)return!1;const O=B[0],L=B.slice(1,33);if(L.compare(T)===0||L.compare(C)>=0)return!1;if((O===2||O===3)&&B.length===33)return!0;const D=B.slice(33);return D.compare(T)===0||D.compare(C)>=0?!1:O===4&&B.length===65}p.isPoint=I;const m=Math.pow(2,31)-1;function b(B){return p.typeforce.UInt32(B)&&B<=m}p.UInt31=b;function g(B){return p.typeforce.String(B)&&!!B.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}p.BIP32Path=g,g.toJSON=()=>"BIP32 derivation path";function w(B){return(p.typeforce.Buffer(B.publicKey)||typeof B.getPublicKey=="function")&&typeof B.sign=="function"}p.Signer=w;const _=21*1e14;function A(B){return p.typeforce.UInt53(B)&&B<=_}p.Satoshi=A,p.ECPoint=p.typeforce.quacksLike("Point"),p.Network=p.typeforce.compile({messagePrefix:p.typeforce.oneOf(p.typeforce.Buffer,p.typeforce.String),bip32:{public:p.typeforce.UInt32,private:p.typeforce.UInt32},pubKeyHash:p.typeforce.UInt8,scriptHash:p.typeforce.UInt8,wif:p.typeforce.UInt8}),p.TAPLEAF_VERSION_MASK=254;function S(B){return!B||!("output"in B)||!v.Buffer.isBuffer(B.output)?!1:B.version!==void 0?(B.version&p.TAPLEAF_VERSION_MASK)===B.version:!0}p.isTapleaf=S;function k(B){return(0,p.Array)(B)?B.length!==2?!1:B.every(O=>k(O)):S(B)}p.isTaptree=k,p.Buffer256bit=p.typeforce.BufferN(32),p.Hash160bit=p.typeforce.BufferN(20),p.Hash256bit=p.typeforce.BufferN(32),p.Number=p.typeforce.Number,p.Array=p.typeforce.Array,p.Boolean=p.typeforce.Boolean,p.String=p.typeforce.String,p.Buffer=p.typeforce.Buffer,p.Hex=p.typeforce.Hex,p.maybe=p.typeforce.maybe,p.tuple=p.typeforce.tuple,p.UInt8=p.typeforce.UInt8,p.UInt32=p.typeforce.UInt32,p.Function=p.typeforce.Function,p.BufferN=p.typeforce.BufferN,p.Null=p.typeforce.Null,p.oneOf=p.typeforce.oneOf},54619:function(fe,p,x){fe=x.nmd(fe),function(v,T){"use strict";function C(re,N){if(!re)throw new Error(N||"Assertion failed")}function I(re,N){re.super_=N;var z=function(){};z.prototype=N.prototype,re.prototype=new z,re.prototype.constructor=re}function m(re,N,z){if(m.isBN(re))return re;this.negative=0,this.words=null,this.length=0,this.red=null,re!==null&&((N==="le"||N==="be")&&(z=N,N=10),this._init(re||0,N||10,z||"be"))}typeof v=="object"?v.exports=m:T.BN=m,m.BN=m,m.wordSize=26;var b;try{typeof window.Buffer<"u"?b=window.Buffer:b=x(36646).Buffer}catch{}m.isBN=function(N){return N instanceof m?!0:N!==null&&typeof N=="object"&&N.constructor.wordSize===m.wordSize&&Array.isArray(N.words)},m.max=function(N,z){return N.cmp(z)>0?N:z},m.min=function(N,z){return N.cmp(z)<0?N:z},m.prototype._init=function(N,z,V){if(typeof N=="number")return this._initNumber(N,z,V);if(typeof N=="object")return this._initArray(N,z,V);z==="hex"&&(z=16),C(z===(z|0)&&z>=2&&z<=36),N=N.toString().replace(/\s+/g,"");var U=0;N[0]==="-"&&(U++,this.negative=1),U<N.length&&(z===16?this._parseHex(N,U,V):(this._parseBase(N,z,U),V==="le"&&this._initArray(this.toArray(),z,V)))},m.prototype._initNumber=function(N,z,V){N<0&&(this.negative=1,N=-N),N<67108864?(this.words=[N&67108863],this.length=1):N<4503599627370496?(this.words=[N&67108863,N/67108864&67108863],this.length=2):(C(N<9007199254740992),this.words=[N&67108863,N/67108864&67108863,1],this.length=3),V==="le"&&this._initArray(this.toArray(),z,V)},m.prototype._initArray=function(N,z,V){if(C(typeof N.length=="number"),N.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(N.length/3),this.words=new Array(this.length);for(var U=0;U<this.length;U++)this.words[U]=0;var j,$,ee=0;if(V==="be")for(U=N.length-1,j=0;U>=0;U-=3)$=N[U]|N[U-1]<<8|N[U-2]<<16,this.words[j]|=$<<ee&67108863,this.words[j+1]=$>>>26-ee&67108863,ee+=24,ee>=26&&(ee-=26,j++);else if(V==="le")for(U=0,j=0;U<N.length;U+=3)$=N[U]|N[U+1]<<8|N[U+2]<<16,this.words[j]|=$<<ee&67108863,this.words[j+1]=$>>>26-ee&67108863,ee+=24,ee>=26&&(ee-=26,j++);return this.strip()};function g(re,N){var z=re.charCodeAt(N);return z>=65&&z<=70?z-55:z>=97&&z<=102?z-87:z-48&15}function w(re,N,z){var V=g(re,z);return z-1>=N&&(V|=g(re,z-1)<<4),V}m.prototype._parseHex=function(N,z,V){this.length=Math.ceil((N.length-z)/6),this.words=new Array(this.length);for(var U=0;U<this.length;U++)this.words[U]=0;var j=0,$=0,ee;if(V==="be")for(U=N.length-1;U>=z;U-=2)ee=w(N,z,U)<<j,this.words[$]|=ee&67108863,j>=18?(j-=18,$+=1,this.words[$]|=ee>>>26):j+=8;else{var J=N.length-z;for(U=J%2===0?z+1:z;U<N.length;U+=2)ee=w(N,z,U)<<j,this.words[$]|=ee&67108863,j>=18?(j-=18,$+=1,this.words[$]|=ee>>>26):j+=8}this.strip()};function _(re,N,z,V){for(var U=0,j=Math.min(re.length,z),$=N;$<j;$++){var ee=re.charCodeAt($)-48;U*=V,ee>=49?U+=ee-49+10:ee>=17?U+=ee-17+10:U+=ee}return U}m.prototype._parseBase=function(N,z,V){this.words=[0],this.length=1;for(var U=0,j=1;j<=67108863;j*=z)U++;U--,j=j/z|0;for(var $=N.length-V,ee=$%U,J=Math.min($,$-ee)+V,F=0,X=V;X<J;X+=U)F=_(N,X,X+U,z),this.imuln(j),this.words[0]+F<67108864?this.words[0]+=F:this._iaddn(F);if(ee!==0){var de=1;for(F=_(N,X,N.length,z),X=0;X<ee;X++)de*=z;this.imuln(de),this.words[0]+F<67108864?this.words[0]+=F:this._iaddn(F)}this.strip()},m.prototype.copy=function(N){N.words=new Array(this.length);for(var z=0;z<this.length;z++)N.words[z]=this.words[z];N.length=this.length,N.negative=this.negative,N.red=this.red},m.prototype.clone=function(){var N=new m(null);return this.copy(N),N},m.prototype._expand=function(N){for(;this.length<N;)this.words[this.length++]=0;return this},m.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},m.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},m.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var A=["","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"],S=[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],k=[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];m.prototype.toString=function(N,z){N=N||10,z=z|0||1;var V;if(N===16||N==="hex"){V="";for(var U=0,j=0,$=0;$<this.length;$++){var ee=this.words[$],J=((ee<<U|j)&16777215).toString(16);j=ee>>>24-U&16777215,j!==0||$!==this.length-1?V=A[6-J.length]+J+V:V=J+V,U+=2,U>=26&&(U-=26,$--)}for(j!==0&&(V=j.toString(16)+V);V.length%z!==0;)V="0"+V;return this.negative!==0&&(V="-"+V),V}if(N===(N|0)&&N>=2&&N<=36){var F=S[N],X=k[N];V="";var de=this.clone();for(de.negative=0;!de.isZero();){var Y=de.modn(X).toString(N);de=de.idivn(X),de.isZero()?V=Y+V:V=A[F-Y.length]+Y+V}for(this.isZero()&&(V="0"+V);V.length%z!==0;)V="0"+V;return this.negative!==0&&(V="-"+V),V}C(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var N=this.words[0];return this.length===2?N+=this.words[1]*67108864:this.length===3&&this.words[2]===1?N+=4503599627370496+this.words[1]*67108864:this.length>2&&C(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-N:N},m.prototype.toJSON=function(){return this.toString(16)},m.prototype.toBuffer=function(N,z){return C(typeof b<"u"),this.toArrayLike(b,N,z)},m.prototype.toArray=function(N,z){return this.toArrayLike(Array,N,z)},m.prototype.toArrayLike=function(N,z,V){var U=this.byteLength(),j=V||Math.max(1,U);C(U<=j,"byte array longer than desired length"),C(j>0,"Requested array length <= 0"),this.strip();var $=z==="le",ee=new N(j),J,F,X=this.clone();if($){for(F=0;!X.isZero();F++)J=X.andln(255),X.iushrn(8),ee[F]=J;for(;F<j;F++)ee[F]=0}else{for(F=0;F<j-U;F++)ee[F]=0;for(F=0;!X.isZero();F++)J=X.andln(255),X.iushrn(8),ee[j-F-1]=J}return ee},Math.clz32?m.prototype._countBits=function(N){return 32-Math.clz32(N)}:m.prototype._countBits=function(N){var z=N,V=0;return z>=4096&&(V+=13,z>>>=13),z>=64&&(V+=7,z>>>=7),z>=8&&(V+=4,z>>>=4),z>=2&&(V+=2,z>>>=2),V+z},m.prototype._zeroBits=function(N){if(N===0)return 26;var z=N,V=0;return z&8191||(V+=13,z>>>=13),z&127||(V+=7,z>>>=7),z&15||(V+=4,z>>>=4),z&3||(V+=2,z>>>=2),z&1||V++,V},m.prototype.bitLength=function(){var N=this.words[this.length-1],z=this._countBits(N);return(this.length-1)*26+z};function B(re){for(var N=new Array(re.bitLength()),z=0;z<N.length;z++){var V=z/26|0,U=z%26;N[z]=(re.words[V]&1<<U)>>>U}return N}m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var N=0,z=0;z<this.length;z++){var V=this._zeroBits(this.words[z]);if(N+=V,V!==26)break}return N},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(N){return this.negative!==0?this.abs().inotn(N).iaddn(1):this.clone()},m.prototype.fromTwos=function(N){return this.testn(N-1)?this.notn(N).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return this.negative!==0},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(N){for(;this.length<N.length;)this.words[this.length++]=0;for(var z=0;z<N.length;z++)this.words[z]=this.words[z]|N.words[z];return this.strip()},m.prototype.ior=function(N){return C((this.negative|N.negative)===0),this.iuor(N)},m.prototype.or=function(N){return this.length>N.length?this.clone().ior(N):N.clone().ior(this)},m.prototype.uor=function(N){return this.length>N.length?this.clone().iuor(N):N.clone().iuor(this)},m.prototype.iuand=function(N){var z;this.length>N.length?z=N:z=this;for(var V=0;V<z.length;V++)this.words[V]=this.words[V]&N.words[V];return this.length=z.length,this.strip()},m.prototype.iand=function(N){return C((this.negative|N.negative)===0),this.iuand(N)},m.prototype.and=function(N){return this.length>N.length?this.clone().iand(N):N.clone().iand(this)},m.prototype.uand=function(N){return this.length>N.length?this.clone().iuand(N):N.clone().iuand(this)},m.prototype.iuxor=function(N){var z,V;this.length>N.length?(z=this,V=N):(z=N,V=this);for(var U=0;U<V.length;U++)this.words[U]=z.words[U]^V.words[U];if(this!==z)for(;U<z.length;U++)this.words[U]=z.words[U];return this.length=z.length,this.strip()},m.prototype.ixor=function(N){return C((this.negative|N.negative)===0),this.iuxor(N)},m.prototype.xor=function(N){return this.length>N.length?this.clone().ixor(N):N.clone().ixor(this)},m.prototype.uxor=function(N){return this.length>N.length?this.clone().iuxor(N):N.clone().iuxor(this)},m.prototype.inotn=function(N){C(typeof N=="number"&&N>=0);var z=Math.ceil(N/26)|0,V=N%26;this._expand(z),V>0&&z--;for(var U=0;U<z;U++)this.words[U]=~this.words[U]&67108863;return V>0&&(this.words[U]=~this.words[U]&67108863>>26-V),this.strip()},m.prototype.notn=function(N){return this.clone().inotn(N)},m.prototype.setn=function(N,z){C(typeof N=="number"&&N>=0);var V=N/26|0,U=N%26;return this._expand(V+1),z?this.words[V]=this.words[V]|1<<U:this.words[V]=this.words[V]&~(1<<U),this.strip()},m.prototype.iadd=function(N){var z;if(this.negative!==0&&N.negative===0)return this.negative=0,z=this.isub(N),this.negative^=1,this._normSign();if(this.negative===0&&N.negative!==0)return N.negative=0,z=this.isub(N),N.negative=1,z._normSign();var V,U;this.length>N.length?(V=this,U=N):(V=N,U=this);for(var j=0,$=0;$<U.length;$++)z=(V.words[$]|0)+(U.words[$]|0)+j,this.words[$]=z&67108863,j=z>>>26;for(;j!==0&&$<V.length;$++)z=(V.words[$]|0)+j,this.words[$]=z&67108863,j=z>>>26;if(this.length=V.length,j!==0)this.words[this.length]=j,this.length++;else if(V!==this)for(;$<V.length;$++)this.words[$]=V.words[$];return this},m.prototype.add=function(N){var z;return N.negative!==0&&this.negative===0?(N.negative=0,z=this.sub(N),N.negative^=1,z):N.negative===0&&this.negative!==0?(this.negative=0,z=N.sub(this),this.negative=1,z):this.length>N.length?this.clone().iadd(N):N.clone().iadd(this)},m.prototype.isub=function(N){if(N.negative!==0){N.negative=0;var z=this.iadd(N);return N.negative=1,z._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(N),this.negative=1,this._normSign();var V=this.cmp(N);if(V===0)return this.negative=0,this.length=1,this.words[0]=0,this;var U,j;V>0?(U=this,j=N):(U=N,j=this);for(var $=0,ee=0;ee<j.length;ee++)z=(U.words[ee]|0)-(j.words[ee]|0)+$,$=z>>26,this.words[ee]=z&67108863;for(;$!==0&&ee<U.length;ee++)z=(U.words[ee]|0)+$,$=z>>26,this.words[ee]=z&67108863;if($===0&&ee<U.length&&U!==this)for(;ee<U.length;ee++)this.words[ee]=U.words[ee];return this.length=Math.max(this.length,ee),U!==this&&(this.negative=1),this.strip()},m.prototype.sub=function(N){return this.clone().isub(N)};function O(re,N,z){z.negative=N.negative^re.negative;var V=re.length+N.length|0;z.length=V,V=V-1|0;var U=re.words[0]|0,j=N.words[0]|0,$=U*j,ee=$&67108863,J=$/67108864|0;z.words[0]=ee;for(var F=1;F<V;F++){for(var X=J>>>26,de=J&67108863,Y=Math.min(F,N.length-1),ce=Math.max(0,F-re.length+1);ce<=Y;ce++){var he=F-ce|0;U=re.words[he]|0,j=N.words[ce]|0,$=U*j+de,X+=$/67108864|0,de=$&67108863}z.words[F]=de|0,J=X|0}return J!==0?z.words[F]=J|0:z.length--,z.strip()}var L=function(N,z,V){var U=N.words,j=z.words,$=V.words,ee=0,J,F,X,de=U[0]|0,Y=de&8191,ce=de>>>13,he=U[1]|0,Ie=he&8191,ke=he>>>13,ut=U[2]|0,Re=ut&8191,ze=ut>>>13,_t=U[3]|0,Ct=_t&8191,$t=_t>>>13,ft=U[4]|0,Xe=ft&8191,ct=ft>>>13,wt=U[5]|0,Rt=wt&8191,Ge=wt>>>13,zt=U[6]|0,Ft=zt&8191,tt=zt>>>13,qe=U[7]|0,dt=qe&8191,De=qe>>>13,He=U[8]|0,se=He&8191,oe=He>>>13,ye=U[9]|0,Ee=ye&8191,me=ye>>>13,Te=j[0]|0,Oe=Te&8191,Qe=Te>>>13,Vt=j[1]|0,vt=Vt&8191,Zt=Vt>>>13,dn=j[2]|0,ln=dn&8191,yn=dn>>>13,or=j[3]|0,An=or&8191,Un=or>>>13,Er=j[4]|0,ht=Er&8191,st=Er>>>13,Dt=j[5]|0,Lt=Dt&8191,Gt=Dt>>>13,xn=j[6]|0,un=xn&8191,fn=xn>>>13,Pe=j[7]|0,Ue=Pe&8191,Le=Pe>>>13,_e=j[8]|0,Ze=_e&8191,Ot=_e>>>13,Yt=j[9]|0,Jt=Yt&8191,en=Yt>>>13;V.negative=N.negative^z.negative,V.length=19,J=Math.imul(Y,Oe),F=Math.imul(Y,Qe),F=F+Math.imul(ce,Oe)|0,X=Math.imul(ce,Qe);var Vn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,J=Math.imul(Ie,Oe),F=Math.imul(Ie,Qe),F=F+Math.imul(ke,Oe)|0,X=Math.imul(ke,Qe),J=J+Math.imul(Y,vt)|0,F=F+Math.imul(Y,Zt)|0,F=F+Math.imul(ce,vt)|0,X=X+Math.imul(ce,Zt)|0;var kn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(kn>>>26)|0,kn&=67108863,J=Math.imul(Re,Oe),F=Math.imul(Re,Qe),F=F+Math.imul(ze,Oe)|0,X=Math.imul(ze,Qe),J=J+Math.imul(Ie,vt)|0,F=F+Math.imul(Ie,Zt)|0,F=F+Math.imul(ke,vt)|0,X=X+Math.imul(ke,Zt)|0,J=J+Math.imul(Y,ln)|0,F=F+Math.imul(Y,yn)|0,F=F+Math.imul(ce,ln)|0,X=X+Math.imul(ce,yn)|0;var ir=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(ir>>>26)|0,ir&=67108863,J=Math.imul(Ct,Oe),F=Math.imul(Ct,Qe),F=F+Math.imul($t,Oe)|0,X=Math.imul($t,Qe),J=J+Math.imul(Re,vt)|0,F=F+Math.imul(Re,Zt)|0,F=F+Math.imul(ze,vt)|0,X=X+Math.imul(ze,Zt)|0,J=J+Math.imul(Ie,ln)|0,F=F+Math.imul(Ie,yn)|0,F=F+Math.imul(ke,ln)|0,X=X+Math.imul(ke,yn)|0,J=J+Math.imul(Y,An)|0,F=F+Math.imul(Y,Un)|0,F=F+Math.imul(ce,An)|0,X=X+Math.imul(ce,Un)|0;var Hn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,J=Math.imul(Xe,Oe),F=Math.imul(Xe,Qe),F=F+Math.imul(ct,Oe)|0,X=Math.imul(ct,Qe),J=J+Math.imul(Ct,vt)|0,F=F+Math.imul(Ct,Zt)|0,F=F+Math.imul($t,vt)|0,X=X+Math.imul($t,Zt)|0,J=J+Math.imul(Re,ln)|0,F=F+Math.imul(Re,yn)|0,F=F+Math.imul(ze,ln)|0,X=X+Math.imul(ze,yn)|0,J=J+Math.imul(Ie,An)|0,F=F+Math.imul(Ie,Un)|0,F=F+Math.imul(ke,An)|0,X=X+Math.imul(ke,Un)|0,J=J+Math.imul(Y,ht)|0,F=F+Math.imul(Y,st)|0,F=F+Math.imul(ce,ht)|0,X=X+Math.imul(ce,st)|0;var tr=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(tr>>>26)|0,tr&=67108863,J=Math.imul(Rt,Oe),F=Math.imul(Rt,Qe),F=F+Math.imul(Ge,Oe)|0,X=Math.imul(Ge,Qe),J=J+Math.imul(Xe,vt)|0,F=F+Math.imul(Xe,Zt)|0,F=F+Math.imul(ct,vt)|0,X=X+Math.imul(ct,Zt)|0,J=J+Math.imul(Ct,ln)|0,F=F+Math.imul(Ct,yn)|0,F=F+Math.imul($t,ln)|0,X=X+Math.imul($t,yn)|0,J=J+Math.imul(Re,An)|0,F=F+Math.imul(Re,Un)|0,F=F+Math.imul(ze,An)|0,X=X+Math.imul(ze,Un)|0,J=J+Math.imul(Ie,ht)|0,F=F+Math.imul(Ie,st)|0,F=F+Math.imul(ke,ht)|0,X=X+Math.imul(ke,st)|0,J=J+Math.imul(Y,Lt)|0,F=F+Math.imul(Y,Gt)|0,F=F+Math.imul(ce,Lt)|0,X=X+Math.imul(ce,Gt)|0;var gr=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(gr>>>26)|0,gr&=67108863,J=Math.imul(Ft,Oe),F=Math.imul(Ft,Qe),F=F+Math.imul(tt,Oe)|0,X=Math.imul(tt,Qe),J=J+Math.imul(Rt,vt)|0,F=F+Math.imul(Rt,Zt)|0,F=F+Math.imul(Ge,vt)|0,X=X+Math.imul(Ge,Zt)|0,J=J+Math.imul(Xe,ln)|0,F=F+Math.imul(Xe,yn)|0,F=F+Math.imul(ct,ln)|0,X=X+Math.imul(ct,yn)|0,J=J+Math.imul(Ct,An)|0,F=F+Math.imul(Ct,Un)|0,F=F+Math.imul($t,An)|0,X=X+Math.imul($t,Un)|0,J=J+Math.imul(Re,ht)|0,F=F+Math.imul(Re,st)|0,F=F+Math.imul(ze,ht)|0,X=X+Math.imul(ze,st)|0,J=J+Math.imul(Ie,Lt)|0,F=F+Math.imul(Ie,Gt)|0,F=F+Math.imul(ke,Lt)|0,X=X+Math.imul(ke,Gt)|0,J=J+Math.imul(Y,un)|0,F=F+Math.imul(Y,fn)|0,F=F+Math.imul(ce,un)|0,X=X+Math.imul(ce,fn)|0;var br=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(br>>>26)|0,br&=67108863,J=Math.imul(dt,Oe),F=Math.imul(dt,Qe),F=F+Math.imul(De,Oe)|0,X=Math.imul(De,Qe),J=J+Math.imul(Ft,vt)|0,F=F+Math.imul(Ft,Zt)|0,F=F+Math.imul(tt,vt)|0,X=X+Math.imul(tt,Zt)|0,J=J+Math.imul(Rt,ln)|0,F=F+Math.imul(Rt,yn)|0,F=F+Math.imul(Ge,ln)|0,X=X+Math.imul(Ge,yn)|0,J=J+Math.imul(Xe,An)|0,F=F+Math.imul(Xe,Un)|0,F=F+Math.imul(ct,An)|0,X=X+Math.imul(ct,Un)|0,J=J+Math.imul(Ct,ht)|0,F=F+Math.imul(Ct,st)|0,F=F+Math.imul($t,ht)|0,X=X+Math.imul($t,st)|0,J=J+Math.imul(Re,Lt)|0,F=F+Math.imul(Re,Gt)|0,F=F+Math.imul(ze,Lt)|0,X=X+Math.imul(ze,Gt)|0,J=J+Math.imul(Ie,un)|0,F=F+Math.imul(Ie,fn)|0,F=F+Math.imul(ke,un)|0,X=X+Math.imul(ke,fn)|0,J=J+Math.imul(Y,Ue)|0,F=F+Math.imul(Y,Le)|0,F=F+Math.imul(ce,Ue)|0,X=X+Math.imul(ce,Le)|0;var pr=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(pr>>>26)|0,pr&=67108863,J=Math.imul(se,Oe),F=Math.imul(se,Qe),F=F+Math.imul(oe,Oe)|0,X=Math.imul(oe,Qe),J=J+Math.imul(dt,vt)|0,F=F+Math.imul(dt,Zt)|0,F=F+Math.imul(De,vt)|0,X=X+Math.imul(De,Zt)|0,J=J+Math.imul(Ft,ln)|0,F=F+Math.imul(Ft,yn)|0,F=F+Math.imul(tt,ln)|0,X=X+Math.imul(tt,yn)|0,J=J+Math.imul(Rt,An)|0,F=F+Math.imul(Rt,Un)|0,F=F+Math.imul(Ge,An)|0,X=X+Math.imul(Ge,Un)|0,J=J+Math.imul(Xe,ht)|0,F=F+Math.imul(Xe,st)|0,F=F+Math.imul(ct,ht)|0,X=X+Math.imul(ct,st)|0,J=J+Math.imul(Ct,Lt)|0,F=F+Math.imul(Ct,Gt)|0,F=F+Math.imul($t,Lt)|0,X=X+Math.imul($t,Gt)|0,J=J+Math.imul(Re,un)|0,F=F+Math.imul(Re,fn)|0,F=F+Math.imul(ze,un)|0,X=X+Math.imul(ze,fn)|0,J=J+Math.imul(Ie,Ue)|0,F=F+Math.imul(Ie,Le)|0,F=F+Math.imul(ke,Ue)|0,X=X+Math.imul(ke,Le)|0,J=J+Math.imul(Y,Ze)|0,F=F+Math.imul(Y,Ot)|0,F=F+Math.imul(ce,Ze)|0,X=X+Math.imul(ce,Ot)|0;var _n=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(_n>>>26)|0,_n&=67108863,J=Math.imul(Ee,Oe),F=Math.imul(Ee,Qe),F=F+Math.imul(me,Oe)|0,X=Math.imul(me,Qe),J=J+Math.imul(se,vt)|0,F=F+Math.imul(se,Zt)|0,F=F+Math.imul(oe,vt)|0,X=X+Math.imul(oe,Zt)|0,J=J+Math.imul(dt,ln)|0,F=F+Math.imul(dt,yn)|0,F=F+Math.imul(De,ln)|0,X=X+Math.imul(De,yn)|0,J=J+Math.imul(Ft,An)|0,F=F+Math.imul(Ft,Un)|0,F=F+Math.imul(tt,An)|0,X=X+Math.imul(tt,Un)|0,J=J+Math.imul(Rt,ht)|0,F=F+Math.imul(Rt,st)|0,F=F+Math.imul(Ge,ht)|0,X=X+Math.imul(Ge,st)|0,J=J+Math.imul(Xe,Lt)|0,F=F+Math.imul(Xe,Gt)|0,F=F+Math.imul(ct,Lt)|0,X=X+Math.imul(ct,Gt)|0,J=J+Math.imul(Ct,un)|0,F=F+Math.imul(Ct,fn)|0,F=F+Math.imul($t,un)|0,X=X+Math.imul($t,fn)|0,J=J+Math.imul(Re,Ue)|0,F=F+Math.imul(Re,Le)|0,F=F+Math.imul(ze,Ue)|0,X=X+Math.imul(ze,Le)|0,J=J+Math.imul(Ie,Ze)|0,F=F+Math.imul(Ie,Ot)|0,F=F+Math.imul(ke,Ze)|0,X=X+Math.imul(ke,Ot)|0,J=J+Math.imul(Y,Jt)|0,F=F+Math.imul(Y,en)|0,F=F+Math.imul(ce,Jt)|0,X=X+Math.imul(ce,en)|0;var Qn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,J=Math.imul(Ee,vt),F=Math.imul(Ee,Zt),F=F+Math.imul(me,vt)|0,X=Math.imul(me,Zt),J=J+Math.imul(se,ln)|0,F=F+Math.imul(se,yn)|0,F=F+Math.imul(oe,ln)|0,X=X+Math.imul(oe,yn)|0,J=J+Math.imul(dt,An)|0,F=F+Math.imul(dt,Un)|0,F=F+Math.imul(De,An)|0,X=X+Math.imul(De,Un)|0,J=J+Math.imul(Ft,ht)|0,F=F+Math.imul(Ft,st)|0,F=F+Math.imul(tt,ht)|0,X=X+Math.imul(tt,st)|0,J=J+Math.imul(Rt,Lt)|0,F=F+Math.imul(Rt,Gt)|0,F=F+Math.imul(Ge,Lt)|0,X=X+Math.imul(Ge,Gt)|0,J=J+Math.imul(Xe,un)|0,F=F+Math.imul(Xe,fn)|0,F=F+Math.imul(ct,un)|0,X=X+Math.imul(ct,fn)|0,J=J+Math.imul(Ct,Ue)|0,F=F+Math.imul(Ct,Le)|0,F=F+Math.imul($t,Ue)|0,X=X+Math.imul($t,Le)|0,J=J+Math.imul(Re,Ze)|0,F=F+Math.imul(Re,Ot)|0,F=F+Math.imul(ze,Ze)|0,X=X+Math.imul(ze,Ot)|0,J=J+Math.imul(Ie,Jt)|0,F=F+Math.imul(Ie,en)|0,F=F+Math.imul(ke,Jt)|0,X=X+Math.imul(ke,en)|0;var Zn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Zn>>>26)|0,Zn&=67108863,J=Math.imul(Ee,ln),F=Math.imul(Ee,yn),F=F+Math.imul(me,ln)|0,X=Math.imul(me,yn),J=J+Math.imul(se,An)|0,F=F+Math.imul(se,Un)|0,F=F+Math.imul(oe,An)|0,X=X+Math.imul(oe,Un)|0,J=J+Math.imul(dt,ht)|0,F=F+Math.imul(dt,st)|0,F=F+Math.imul(De,ht)|0,X=X+Math.imul(De,st)|0,J=J+Math.imul(Ft,Lt)|0,F=F+Math.imul(Ft,Gt)|0,F=F+Math.imul(tt,Lt)|0,X=X+Math.imul(tt,Gt)|0,J=J+Math.imul(Rt,un)|0,F=F+Math.imul(Rt,fn)|0,F=F+Math.imul(Ge,un)|0,X=X+Math.imul(Ge,fn)|0,J=J+Math.imul(Xe,Ue)|0,F=F+Math.imul(Xe,Le)|0,F=F+Math.imul(ct,Ue)|0,X=X+Math.imul(ct,Le)|0,J=J+Math.imul(Ct,Ze)|0,F=F+Math.imul(Ct,Ot)|0,F=F+Math.imul($t,Ze)|0,X=X+Math.imul($t,Ot)|0,J=J+Math.imul(Re,Jt)|0,F=F+Math.imul(Re,en)|0,F=F+Math.imul(ze,Jt)|0,X=X+Math.imul(ze,en)|0;var Mn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,J=Math.imul(Ee,An),F=Math.imul(Ee,Un),F=F+Math.imul(me,An)|0,X=Math.imul(me,Un),J=J+Math.imul(se,ht)|0,F=F+Math.imul(se,st)|0,F=F+Math.imul(oe,ht)|0,X=X+Math.imul(oe,st)|0,J=J+Math.imul(dt,Lt)|0,F=F+Math.imul(dt,Gt)|0,F=F+Math.imul(De,Lt)|0,X=X+Math.imul(De,Gt)|0,J=J+Math.imul(Ft,un)|0,F=F+Math.imul(Ft,fn)|0,F=F+Math.imul(tt,un)|0,X=X+Math.imul(tt,fn)|0,J=J+Math.imul(Rt,Ue)|0,F=F+Math.imul(Rt,Le)|0,F=F+Math.imul(Ge,Ue)|0,X=X+Math.imul(Ge,Le)|0,J=J+Math.imul(Xe,Ze)|0,F=F+Math.imul(Xe,Ot)|0,F=F+Math.imul(ct,Ze)|0,X=X+Math.imul(ct,Ot)|0,J=J+Math.imul(Ct,Jt)|0,F=F+Math.imul(Ct,en)|0,F=F+Math.imul($t,Jt)|0,X=X+Math.imul($t,en)|0;var Ln=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,J=Math.imul(Ee,ht),F=Math.imul(Ee,st),F=F+Math.imul(me,ht)|0,X=Math.imul(me,st),J=J+Math.imul(se,Lt)|0,F=F+Math.imul(se,Gt)|0,F=F+Math.imul(oe,Lt)|0,X=X+Math.imul(oe,Gt)|0,J=J+Math.imul(dt,un)|0,F=F+Math.imul(dt,fn)|0,F=F+Math.imul(De,un)|0,X=X+Math.imul(De,fn)|0,J=J+Math.imul(Ft,Ue)|0,F=F+Math.imul(Ft,Le)|0,F=F+Math.imul(tt,Ue)|0,X=X+Math.imul(tt,Le)|0,J=J+Math.imul(Rt,Ze)|0,F=F+Math.imul(Rt,Ot)|0,F=F+Math.imul(Ge,Ze)|0,X=X+Math.imul(Ge,Ot)|0,J=J+Math.imul(Xe,Jt)|0,F=F+Math.imul(Xe,en)|0,F=F+Math.imul(ct,Jt)|0,X=X+Math.imul(ct,en)|0;var Rn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,J=Math.imul(Ee,Lt),F=Math.imul(Ee,Gt),F=F+Math.imul(me,Lt)|0,X=Math.imul(me,Gt),J=J+Math.imul(se,un)|0,F=F+Math.imul(se,fn)|0,F=F+Math.imul(oe,un)|0,X=X+Math.imul(oe,fn)|0,J=J+Math.imul(dt,Ue)|0,F=F+Math.imul(dt,Le)|0,F=F+Math.imul(De,Ue)|0,X=X+Math.imul(De,Le)|0,J=J+Math.imul(Ft,Ze)|0,F=F+Math.imul(Ft,Ot)|0,F=F+Math.imul(tt,Ze)|0,X=X+Math.imul(tt,Ot)|0,J=J+Math.imul(Rt,Jt)|0,F=F+Math.imul(Rt,en)|0,F=F+Math.imul(Ge,Jt)|0,X=X+Math.imul(Ge,en)|0;var In=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(In>>>26)|0,In&=67108863,J=Math.imul(Ee,un),F=Math.imul(Ee,fn),F=F+Math.imul(me,un)|0,X=Math.imul(me,fn),J=J+Math.imul(se,Ue)|0,F=F+Math.imul(se,Le)|0,F=F+Math.imul(oe,Ue)|0,X=X+Math.imul(oe,Le)|0,J=J+Math.imul(dt,Ze)|0,F=F+Math.imul(dt,Ot)|0,F=F+Math.imul(De,Ze)|0,X=X+Math.imul(De,Ot)|0,J=J+Math.imul(Ft,Jt)|0,F=F+Math.imul(Ft,en)|0,F=F+Math.imul(tt,Jt)|0,X=X+Math.imul(tt,en)|0;var Xn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,J=Math.imul(Ee,Ue),F=Math.imul(Ee,Le),F=F+Math.imul(me,Ue)|0,X=Math.imul(me,Le),J=J+Math.imul(se,Ze)|0,F=F+Math.imul(se,Ot)|0,F=F+Math.imul(oe,Ze)|0,X=X+Math.imul(oe,Ot)|0,J=J+Math.imul(dt,Jt)|0,F=F+Math.imul(dt,en)|0,F=F+Math.imul(De,Jt)|0,X=X+Math.imul(De,en)|0;var $n=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+($n>>>26)|0,$n&=67108863,J=Math.imul(Ee,Ze),F=Math.imul(Ee,Ot),F=F+Math.imul(me,Ze)|0,X=Math.imul(me,Ot),J=J+Math.imul(se,Jt)|0,F=F+Math.imul(se,en)|0,F=F+Math.imul(oe,Jt)|0,X=X+Math.imul(oe,en)|0;var hn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(hn>>>26)|0,hn&=67108863,J=Math.imul(Ee,Jt),F=Math.imul(Ee,en),F=F+Math.imul(me,Jt)|0,X=Math.imul(me,en);var an=(ee+J|0)+((F&8191)<<13)|0;return ee=(X+(F>>>13)|0)+(an>>>26)|0,an&=67108863,$[0]=Vn,$[1]=kn,$[2]=ir,$[3]=Hn,$[4]=tr,$[5]=gr,$[6]=br,$[7]=pr,$[8]=_n,$[9]=Qn,$[10]=Zn,$[11]=Mn,$[12]=Ln,$[13]=Rn,$[14]=In,$[15]=Xn,$[16]=$n,$[17]=hn,$[18]=an,ee!==0&&($[19]=ee,V.length++),V};Math.imul||(L=O);function D(re,N,z){z.negative=N.negative^re.negative,z.length=re.length+N.length;for(var V=0,U=0,j=0;j<z.length-1;j++){var $=U;U=0;for(var ee=V&67108863,J=Math.min(j,N.length-1),F=Math.max(0,j-re.length+1);F<=J;F++){var X=j-F,de=re.words[X]|0,Y=N.words[F]|0,ce=de*Y,he=ce&67108863;$=$+(ce/67108864|0)|0,he=he+ee|0,ee=he&67108863,$=$+(he>>>26)|0,U+=$>>>26,$&=67108863}z.words[j]=ee,V=$,$=U}return V!==0?z.words[j]=V:z.length--,z.strip()}function W(re,N,z){var V=new H;return V.mulp(re,N,z)}m.prototype.mulTo=function(N,z){var V,U=this.length+N.length;return this.length===10&&N.length===10?V=L(this,N,z):U<63?V=O(this,N,z):U<1024?V=D(this,N,z):V=W(this,N,z),V};function H(re,N){this.x=re,this.y=N}H.prototype.makeRBT=function(N){for(var z=new Array(N),V=m.prototype._countBits(N)-1,U=0;U<N;U++)z[U]=this.revBin(U,V,N);return z},H.prototype.revBin=function(N,z,V){if(N===0||N===V-1)return N;for(var U=0,j=0;j<z;j++)U|=(N&1)<<z-j-1,N>>=1;return U},H.prototype.permute=function(N,z,V,U,j,$){for(var ee=0;ee<$;ee++)U[ee]=z[N[ee]],j[ee]=V[N[ee]]},H.prototype.transform=function(N,z,V,U,j,$){this.permute($,N,z,V,U,j);for(var ee=1;ee<j;ee<<=1)for(var J=ee<<1,F=Math.cos(2*Math.PI/J),X=Math.sin(2*Math.PI/J),de=0;de<j;de+=J)for(var Y=F,ce=X,he=0;he<ee;he++){var Ie=V[de+he],ke=U[de+he],ut=V[de+he+ee],Re=U[de+he+ee],ze=Y*ut-ce*Re;Re=Y*Re+ce*ut,ut=ze,V[de+he]=Ie+ut,U[de+he]=ke+Re,V[de+he+ee]=Ie-ut,U[de+he+ee]=ke-Re,he!==J&&(ze=F*Y-X*ce,ce=F*ce+X*Y,Y=ze)}},H.prototype.guessLen13b=function(N,z){var V=Math.max(z,N)|1,U=V&1,j=0;for(V=V/2|0;V;V=V>>>1)j++;return 1<<j+1+U},H.prototype.conjugate=function(N,z,V){if(!(V<=1))for(var U=0;U<V/2;U++){var j=N[U];N[U]=N[V-U-1],N[V-U-1]=j,j=z[U],z[U]=-z[V-U-1],z[V-U-1]=-j}},H.prototype.normalize13b=function(N,z){for(var V=0,U=0;U<z/2;U++){var j=Math.round(N[2*U+1]/z)*8192+Math.round(N[2*U]/z)+V;N[U]=j&67108863,j<67108864?V=0:V=j/67108864|0}return N},H.prototype.convert13b=function(N,z,V,U){for(var j=0,$=0;$<z;$++)j=j+(N[$]|0),V[2*$]=j&8191,j=j>>>13,V[2*$+1]=j&8191,j=j>>>13;for($=2*z;$<U;++$)V[$]=0;C(j===0),C((j&-8192)===0)},H.prototype.stub=function(N){for(var z=new Array(N),V=0;V<N;V++)z[V]=0;return z},H.prototype.mulp=function(N,z,V){var U=2*this.guessLen13b(N.length,z.length),j=this.makeRBT(U),$=this.stub(U),ee=new Array(U),J=new Array(U),F=new Array(U),X=new Array(U),de=new Array(U),Y=new Array(U),ce=V.words;ce.length=U,this.convert13b(N.words,N.length,ee,U),this.convert13b(z.words,z.length,X,U),this.transform(ee,$,J,F,U,j),this.transform(X,$,de,Y,U,j);for(var he=0;he<U;he++){var Ie=J[he]*de[he]-F[he]*Y[he];F[he]=J[he]*Y[he]+F[he]*de[he],J[he]=Ie}return this.conjugate(J,F,U),this.transform(J,F,ce,$,U,j),this.conjugate(ce,$,U),this.normalize13b(ce,U),V.negative=N.negative^z.negative,V.length=N.length+z.length,V.strip()},m.prototype.mul=function(N){var z=new m(null);return z.words=new Array(this.length+N.length),this.mulTo(N,z)},m.prototype.mulf=function(N){var z=new m(null);return z.words=new Array(this.length+N.length),W(this,N,z)},m.prototype.imul=function(N){return this.clone().mulTo(N,this)},m.prototype.imuln=function(N){C(typeof N=="number"),C(N<67108864);for(var z=0,V=0;V<this.length;V++){var U=(this.words[V]|0)*N,j=(U&67108863)+(z&67108863);z>>=26,z+=U/67108864|0,z+=j>>>26,this.words[V]=j&67108863}return z!==0&&(this.words[V]=z,this.length++),this},m.prototype.muln=function(N){return this.clone().imuln(N)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(N){var z=B(N);if(z.length===0)return new m(1);for(var V=this,U=0;U<z.length&&z[U]===0;U++,V=V.sqr());if(++U<z.length)for(var j=V.sqr();U<z.length;U++,j=j.sqr())z[U]!==0&&(V=V.mul(j));return V},m.prototype.iushln=function(N){C(typeof N=="number"&&N>=0);var z=N%26,V=(N-z)/26,U=67108863>>>26-z<<26-z,j;if(z!==0){var $=0;for(j=0;j<this.length;j++){var ee=this.words[j]&U,J=(this.words[j]|0)-ee<<z;this.words[j]=J|$,$=ee>>>26-z}$&&(this.words[j]=$,this.length++)}if(V!==0){for(j=this.length-1;j>=0;j--)this.words[j+V]=this.words[j];for(j=0;j<V;j++)this.words[j]=0;this.length+=V}return this.strip()},m.prototype.ishln=function(N){return C(this.negative===0),this.iushln(N)},m.prototype.iushrn=function(N,z,V){C(typeof N=="number"&&N>=0);var U;z?U=(z-z%26)/26:U=0;var j=N%26,$=Math.min((N-j)/26,this.length),ee=67108863^67108863>>>j<<j,J=V;if(U-=$,U=Math.max(0,U),J){for(var F=0;F<$;F++)J.words[F]=this.words[F];J.length=$}if($!==0)if(this.length>$)for(this.length-=$,F=0;F<this.length;F++)this.words[F]=this.words[F+$];else this.words[0]=0,this.length=1;var X=0;for(F=this.length-1;F>=0&&(X!==0||F>=U);F--){var de=this.words[F]|0;this.words[F]=X<<26-j|de>>>j,X=de&ee}return J&&X!==0&&(J.words[J.length++]=X),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},m.prototype.ishrn=function(N,z,V){return C(this.negative===0),this.iushrn(N,z,V)},m.prototype.shln=function(N){return this.clone().ishln(N)},m.prototype.ushln=function(N){return this.clone().iushln(N)},m.prototype.shrn=function(N){return this.clone().ishrn(N)},m.prototype.ushrn=function(N){return this.clone().iushrn(N)},m.prototype.testn=function(N){C(typeof N=="number"&&N>=0);var z=N%26,V=(N-z)/26,U=1<<z;if(this.length<=V)return!1;var j=this.words[V];return!!(j&U)},m.prototype.imaskn=function(N){C(typeof N=="number"&&N>=0);var z=N%26,V=(N-z)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=V)return this;if(z!==0&&V++,this.length=Math.min(V,this.length),z!==0){var U=67108863^67108863>>>z<<z;this.words[this.length-1]&=U}return this.strip()},m.prototype.maskn=function(N){return this.clone().imaskn(N)},m.prototype.iaddn=function(N){return C(typeof N=="number"),C(N<67108864),N<0?this.isubn(-N):this.negative!==0?this.length===1&&(this.words[0]|0)<N?(this.words[0]=N-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(N),this.negative=1,this):this._iaddn(N)},m.prototype._iaddn=function(N){this.words[0]+=N;for(var z=0;z<this.length&&this.words[z]>=67108864;z++)this.words[z]-=67108864,z===this.length-1?this.words[z+1]=1:this.words[z+1]++;return this.length=Math.max(this.length,z+1),this},m.prototype.isubn=function(N){if(C(typeof N=="number"),C(N<67108864),N<0)return this.iaddn(-N);if(this.negative!==0)return this.negative=0,this.iaddn(N),this.negative=1,this;if(this.words[0]-=N,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var z=0;z<this.length&&this.words[z]<0;z++)this.words[z]+=67108864,this.words[z+1]-=1;return this.strip()},m.prototype.addn=function(N){return this.clone().iaddn(N)},m.prototype.subn=function(N){return this.clone().isubn(N)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(N,z,V){var U=N.length+V,j;this._expand(U);var $,ee=0;for(j=0;j<N.length;j++){$=(this.words[j+V]|0)+ee;var J=(N.words[j]|0)*z;$-=J&67108863,ee=($>>26)-(J/67108864|0),this.words[j+V]=$&67108863}for(;j<this.length-V;j++)$=(this.words[j+V]|0)+ee,ee=$>>26,this.words[j+V]=$&67108863;if(ee===0)return this.strip();for(C(ee===-1),ee=0,j=0;j<this.length;j++)$=-(this.words[j]|0)+ee,ee=$>>26,this.words[j]=$&67108863;return this.negative=1,this.strip()},m.prototype._wordDiv=function(N,z){var V=this.length-N.length,U=this.clone(),j=N,$=j.words[j.length-1]|0,ee=this._countBits($);V=26-ee,V!==0&&(j=j.ushln(V),U.iushln(V),$=j.words[j.length-1]|0);var J=U.length-j.length,F;if(z!=="mod"){F=new m(null),F.length=J+1,F.words=new Array(F.length);for(var X=0;X<F.length;X++)F.words[X]=0}var de=U.clone()._ishlnsubmul(j,1,J);de.negative===0&&(U=de,F&&(F.words[J]=1));for(var Y=J-1;Y>=0;Y--){var ce=(U.words[j.length+Y]|0)*67108864+(U.words[j.length+Y-1]|0);for(ce=Math.min(ce/$|0,67108863),U._ishlnsubmul(j,ce,Y);U.negative!==0;)ce--,U.negative=0,U._ishlnsubmul(j,1,Y),U.isZero()||(U.negative^=1);F&&(F.words[Y]=ce)}return F&&F.strip(),U.strip(),z!=="div"&&V!==0&&U.iushrn(V),{div:F||null,mod:U}},m.prototype.divmod=function(N,z,V){if(C(!N.isZero()),this.isZero())return{div:new m(0),mod:new m(0)};var U,j,$;return this.negative!==0&&N.negative===0?($=this.neg().divmod(N,z),z!=="mod"&&(U=$.div.neg()),z!=="div"&&(j=$.mod.neg(),V&&j.negative!==0&&j.iadd(N)),{div:U,mod:j}):this.negative===0&&N.negative!==0?($=this.divmod(N.neg(),z),z!=="mod"&&(U=$.div.neg()),{div:U,mod:$.mod}):this.negative&N.negative?($=this.neg().divmod(N.neg(),z),z!=="div"&&(j=$.mod.neg(),V&&j.negative!==0&&j.isub(N)),{div:$.div,mod:j}):N.length>this.length||this.cmp(N)<0?{div:new m(0),mod:this}:N.length===1?z==="div"?{div:this.divn(N.words[0]),mod:null}:z==="mod"?{div:null,mod:new m(this.modn(N.words[0]))}:{div:this.divn(N.words[0]),mod:new m(this.modn(N.words[0]))}:this._wordDiv(N,z)},m.prototype.div=function(N){return this.divmod(N,"div",!1).div},m.prototype.mod=function(N){return this.divmod(N,"mod",!1).mod},m.prototype.umod=function(N){return this.divmod(N,"mod",!0).mod},m.prototype.divRound=function(N){var z=this.divmod(N);if(z.mod.isZero())return z.div;var V=z.div.negative!==0?z.mod.isub(N):z.mod,U=N.ushrn(1),j=N.andln(1),$=V.cmp(U);return $<0||j===1&&$===0?z.div:z.div.negative!==0?z.div.isubn(1):z.div.iaddn(1)},m.prototype.modn=function(N){C(N<=67108863);for(var z=(1<<26)%N,V=0,U=this.length-1;U>=0;U--)V=(z*V+(this.words[U]|0))%N;return V},m.prototype.idivn=function(N){C(N<=67108863);for(var z=0,V=this.length-1;V>=0;V--){var U=(this.words[V]|0)+z*67108864;this.words[V]=U/N|0,z=U%N}return this.strip()},m.prototype.divn=function(N){return this.clone().idivn(N)},m.prototype.egcd=function(N){C(N.negative===0),C(!N.isZero());var z=this,V=N.clone();z.negative!==0?z=z.umod(N):z=z.clone();for(var U=new m(1),j=new m(0),$=new m(0),ee=new m(1),J=0;z.isEven()&&V.isEven();)z.iushrn(1),V.iushrn(1),++J;for(var F=V.clone(),X=z.clone();!z.isZero();){for(var de=0,Y=1;!(z.words[0]&Y)&&de<26;++de,Y<<=1);if(de>0)for(z.iushrn(de);de-- >0;)(U.isOdd()||j.isOdd())&&(U.iadd(F),j.isub(X)),U.iushrn(1),j.iushrn(1);for(var ce=0,he=1;!(V.words[0]&he)&&ce<26;++ce,he<<=1);if(ce>0)for(V.iushrn(ce);ce-- >0;)($.isOdd()||ee.isOdd())&&($.iadd(F),ee.isub(X)),$.iushrn(1),ee.iushrn(1);z.cmp(V)>=0?(z.isub(V),U.isub($),j.isub(ee)):(V.isub(z),$.isub(U),ee.isub(j))}return{a:$,b:ee,gcd:V.iushln(J)}},m.prototype._invmp=function(N){C(N.negative===0),C(!N.isZero());var z=this,V=N.clone();z.negative!==0?z=z.umod(N):z=z.clone();for(var U=new m(1),j=new m(0),$=V.clone();z.cmpn(1)>0&&V.cmpn(1)>0;){for(var ee=0,J=1;!(z.words[0]&J)&&ee<26;++ee,J<<=1);if(ee>0)for(z.iushrn(ee);ee-- >0;)U.isOdd()&&U.iadd($),U.iushrn(1);for(var F=0,X=1;!(V.words[0]&X)&&F<26;++F,X<<=1);if(F>0)for(V.iushrn(F);F-- >0;)j.isOdd()&&j.iadd($),j.iushrn(1);z.cmp(V)>=0?(z.isub(V),U.isub(j)):(V.isub(z),j.isub(U))}var de;return z.cmpn(1)===0?de=U:de=j,de.cmpn(0)<0&&de.iadd(N),de},m.prototype.gcd=function(N){if(this.isZero())return N.abs();if(N.isZero())return this.abs();var z=this.clone(),V=N.clone();z.negative=0,V.negative=0;for(var U=0;z.isEven()&&V.isEven();U++)z.iushrn(1),V.iushrn(1);do{for(;z.isEven();)z.iushrn(1);for(;V.isEven();)V.iushrn(1);var j=z.cmp(V);if(j<0){var $=z;z=V,V=$}else if(j===0||V.cmpn(1)===0)break;z.isub(V)}while(!0);return V.iushln(U)},m.prototype.invm=function(N){return this.egcd(N).a.umod(N)},m.prototype.isEven=function(){return(this.words[0]&1)===0},m.prototype.isOdd=function(){return(this.words[0]&1)===1},m.prototype.andln=function(N){return this.words[0]&N},m.prototype.bincn=function(N){C(typeof N=="number");var z=N%26,V=(N-z)/26,U=1<<z;if(this.length<=V)return this._expand(V+1),this.words[V]|=U,this;for(var j=U,$=V;j!==0&&$<this.length;$++){var ee=this.words[$]|0;ee+=j,j=ee>>>26,ee&=67108863,this.words[$]=ee}return j!==0&&(this.words[$]=j,this.length++),this},m.prototype.isZero=function(){return this.length===1&&this.words[0]===0},m.prototype.cmpn=function(N){var z=N<0;if(this.negative!==0&&!z)return-1;if(this.negative===0&&z)return 1;this.strip();var V;if(this.length>1)V=1;else{z&&(N=-N),C(N<=67108863,"Number is too big");var U=this.words[0]|0;V=U===N?0:U<N?-1:1}return this.negative!==0?-V|0:V},m.prototype.cmp=function(N){if(this.negative!==0&&N.negative===0)return-1;if(this.negative===0&&N.negative!==0)return 1;var z=this.ucmp(N);return this.negative!==0?-z|0:z},m.prototype.ucmp=function(N){if(this.length>N.length)return 1;if(this.length<N.length)return-1;for(var z=0,V=this.length-1;V>=0;V--){var U=this.words[V]|0,j=N.words[V]|0;if(U!==j){U<j?z=-1:U>j&&(z=1);break}}return z},m.prototype.gtn=function(N){return this.cmpn(N)===1},m.prototype.gt=function(N){return this.cmp(N)===1},m.prototype.gten=function(N){return this.cmpn(N)>=0},m.prototype.gte=function(N){return this.cmp(N)>=0},m.prototype.ltn=function(N){return this.cmpn(N)===-1},m.prototype.lt=function(N){return this.cmp(N)===-1},m.prototype.lten=function(N){return this.cmpn(N)<=0},m.prototype.lte=function(N){return this.cmp(N)<=0},m.prototype.eqn=function(N){return this.cmpn(N)===0},m.prototype.eq=function(N){return this.cmp(N)===0},m.red=function(N){return new we(N)},m.prototype.toRed=function(N){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),N.convertTo(this)._forceRed(N)},m.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(N){return this.red=N,this},m.prototype.forceRed=function(N){return C(!this.red,"Already a number in reduction context"),this._forceRed(N)},m.prototype.redAdd=function(N){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,N)},m.prototype.redIAdd=function(N){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,N)},m.prototype.redSub=function(N){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,N)},m.prototype.redISub=function(N){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,N)},m.prototype.redShl=function(N){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,N)},m.prototype.redMul=function(N){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.mul(this,N)},m.prototype.redIMul=function(N){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.imul(this,N)},m.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(N){return C(this.red&&!N.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,N)};var G={k256:null,p224:null,p192:null,p25519:null};function Z(re,N){this.name=re,this.p=new m(N,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Z.prototype._tmp=function(){var N=new m(null);return N.words=new Array(Math.ceil(this.n/13)),N},Z.prototype.ireduce=function(N){var z=N,V;do this.split(z,this.tmp),z=this.imulK(z),z=z.iadd(this.tmp),V=z.bitLength();while(V>this.n);var U=V<this.n?-1:z.ucmp(this.p);return U===0?(z.words[0]=0,z.length=1):U>0?z.isub(this.p):z.strip!==void 0?z.strip():z._strip(),z},Z.prototype.split=function(N,z){N.iushrn(this.n,0,z)},Z.prototype.imulK=function(N){return N.imul(this.k)};function Q(){Z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}I(Q,Z),Q.prototype.split=function(N,z){for(var V=4194303,U=Math.min(N.length,9),j=0;j<U;j++)z.words[j]=N.words[j];if(z.length=U,N.length<=9){N.words[0]=0,N.length=1;return}var $=N.words[9];for(z.words[z.length++]=$&V,j=10;j<N.length;j++){var ee=N.words[j]|0;N.words[j-10]=(ee&V)<<4|$>>>22,$=ee}$>>>=22,N.words[j-10]=$,$===0&&N.length>10?N.length-=10:N.length-=9},Q.prototype.imulK=function(N){N.words[N.length]=0,N.words[N.length+1]=0,N.length+=2;for(var z=0,V=0;V<N.length;V++){var U=N.words[V]|0;z+=U*977,N.words[V]=z&67108863,z=U*64+(z/67108864|0)}return N.words[N.length-1]===0&&(N.length--,N.words[N.length-1]===0&&N.length--),N};function ie(){Z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}I(ie,Z);function le(){Z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}I(le,Z);function be(){Z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}I(be,Z),be.prototype.imulK=function(N){for(var z=0,V=0;V<N.length;V++){var U=(N.words[V]|0)*19+z,j=U&67108863;U>>>=26,N.words[V]=j,z=U}return z!==0&&(N.words[N.length++]=z),N},m._prime=function(N){if(G[N])return G[N];var z;if(N==="k256")z=new Q;else if(N==="p224")z=new ie;else if(N==="p192")z=new le;else if(N==="p25519")z=new be;else throw new Error("Unknown prime "+N);return G[N]=z,z};function we(re){if(typeof re=="string"){var N=m._prime(re);this.m=N.p,this.prime=N}else C(re.gtn(1),"modulus must be greater than 1"),this.m=re,this.prime=null}we.prototype._verify1=function(N){C(N.negative===0,"red works only with positives"),C(N.red,"red works only with red numbers")},we.prototype._verify2=function(N,z){C((N.negative|z.negative)===0,"red works only with positives"),C(N.red&&N.red===z.red,"red works only with red numbers")},we.prototype.imod=function(N){return this.prime?this.prime.ireduce(N)._forceRed(this):N.umod(this.m)._forceRed(this)},we.prototype.neg=function(N){return N.isZero()?N.clone():this.m.sub(N)._forceRed(this)},we.prototype.add=function(N,z){this._verify2(N,z);var V=N.add(z);return V.cmp(this.m)>=0&&V.isub(this.m),V._forceRed(this)},we.prototype.iadd=function(N,z){this._verify2(N,z);var V=N.iadd(z);return V.cmp(this.m)>=0&&V.isub(this.m),V},we.prototype.sub=function(N,z){this._verify2(N,z);var V=N.sub(z);return V.cmpn(0)<0&&V.iadd(this.m),V._forceRed(this)},we.prototype.isub=function(N,z){this._verify2(N,z);var V=N.isub(z);return V.cmpn(0)<0&&V.iadd(this.m),V},we.prototype.shl=function(N,z){return this._verify1(N),this.imod(N.ushln(z))},we.prototype.imul=function(N,z){return this._verify2(N,z),this.imod(N.imul(z))},we.prototype.mul=function(N,z){return this._verify2(N,z),this.imod(N.mul(z))},we.prototype.isqr=function(N){return this.imul(N,N.clone())},we.prototype.sqr=function(N){return this.mul(N,N)},we.prototype.sqrt=function(N){if(N.isZero())return N.clone();var z=this.m.andln(3);if(C(z%2===1),z===3){var V=this.m.add(new m(1)).iushrn(2);return this.pow(N,V)}for(var U=this.m.subn(1),j=0;!U.isZero()&&U.andln(1)===0;)j++,U.iushrn(1);C(!U.isZero());var $=new m(1).toRed(this),ee=$.redNeg(),J=this.m.subn(1).iushrn(1),F=this.m.bitLength();for(F=new m(2*F*F).toRed(this);this.pow(F,J).cmp(ee)!==0;)F.redIAdd(ee);for(var X=this.pow(F,U),de=this.pow(N,U.addn(1).iushrn(1)),Y=this.pow(N,U),ce=j;Y.cmp($)!==0;){for(var he=Y,Ie=0;he.cmp($)!==0;Ie++)he=he.redSqr();C(Ie<ce);var ke=this.pow(X,new m(1).iushln(ce-Ie-1));de=de.redMul(ke),X=ke.redSqr(),Y=Y.redMul(X),ce=Ie}return de},we.prototype.invm=function(N){var z=N._invmp(this.m);return z.negative!==0?(z.negative=0,this.imod(z).redNeg()):this.imod(z)},we.prototype.pow=function(N,z){if(z.isZero())return new m(1).toRed(this);if(z.cmpn(1)===0)return N.clone();var V=4,U=new Array(1<<V);U[0]=new m(1).toRed(this),U[1]=N;for(var j=2;j<U.length;j++)U[j]=this.mul(U[j-1],N);var $=U[0],ee=0,J=0,F=z.bitLength()%26;for(F===0&&(F=26),j=z.length-1;j>=0;j--){for(var X=z.words[j],de=F-1;de>=0;de--){var Y=X>>de&1;if($!==U[0]&&($=this.sqr($)),Y===0&&ee===0){J=0;continue}ee<<=1,ee|=Y,J++,!(J!==V&&(j!==0||de!==0))&&($=this.mul($,U[ee]),J=0,ee=0)}F=26}return $},we.prototype.convertTo=function(N){var z=N.umod(this.m);return z===N?z.clone():z},we.prototype.convertFrom=function(N){var z=N.clone();return z.red=null,z},m.mont=function(N){return new Ae(N)};function Ae(re){we.call(this,re),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new m(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(Ae,we),Ae.prototype.convertTo=function(N){return this.imod(N.ushln(this.shift))},Ae.prototype.convertFrom=function(N){var z=this.imod(N.mul(this.rinv));return z.red=null,z},Ae.prototype.imul=function(N,z){if(N.isZero()||z.isZero())return N.words[0]=0,N.length=1,N;var V=N.imul(z),U=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),j=V.isub(U).iushrn(this.shift),$=j;return j.cmp(this.m)>=0?$=j.isub(this.m):j.cmpn(0)<0&&($=j.iadd(this.m)),$._forceRed(this)},Ae.prototype.mul=function(N,z){if(N.isZero()||z.isZero())return new m(0)._forceRed(this);var V=N.mul(z),U=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),j=V.isub(U).iushrn(this.shift),$=j;return j.cmp(this.m)>=0?$=j.isub(this.m):j.cmpn(0)<0&&($=j.iadd(this.m)),$._forceRed(this)},Ae.prototype.invm=function(N){var z=this.imod(N._invmp(this.m).mul(this.r2));return z._forceRed(this)}}(fe,this)},23364:function(fe,p,x){fe=x.nmd(fe),function(v,T){"use strict";function C(re,N){if(!re)throw new Error(N||"Assertion failed")}function I(re,N){re.super_=N;var z=function(){};z.prototype=N.prototype,re.prototype=new z,re.prototype.constructor=re}function m(re,N,z){if(m.isBN(re))return re;this.negative=0,this.words=null,this.length=0,this.red=null,re!==null&&((N==="le"||N==="be")&&(z=N,N=10),this._init(re||0,N||10,z||"be"))}typeof v=="object"?v.exports=m:T.BN=m,m.BN=m,m.wordSize=26;var b;try{typeof window.Buffer<"u"?b=window.Buffer:b=x(65943).Buffer}catch{}m.isBN=function(N){return N instanceof m?!0:N!==null&&typeof N=="object"&&N.constructor.wordSize===m.wordSize&&Array.isArray(N.words)},m.max=function(N,z){return N.cmp(z)>0?N:z},m.min=function(N,z){return N.cmp(z)<0?N:z},m.prototype._init=function(N,z,V){if(typeof N=="number")return this._initNumber(N,z,V);if(typeof N=="object")return this._initArray(N,z,V);z==="hex"&&(z=16),C(z===(z|0)&&z>=2&&z<=36),N=N.toString().replace(/\s+/g,"");var U=0;N[0]==="-"&&(U++,this.negative=1),U<N.length&&(z===16?this._parseHex(N,U,V):(this._parseBase(N,z,U),V==="le"&&this._initArray(this.toArray(),z,V)))},m.prototype._initNumber=function(N,z,V){N<0&&(this.negative=1,N=-N),N<67108864?(this.words=[N&67108863],this.length=1):N<4503599627370496?(this.words=[N&67108863,N/67108864&67108863],this.length=2):(C(N<9007199254740992),this.words=[N&67108863,N/67108864&67108863,1],this.length=3),V==="le"&&this._initArray(this.toArray(),z,V)},m.prototype._initArray=function(N,z,V){if(C(typeof N.length=="number"),N.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(N.length/3),this.words=new Array(this.length);for(var U=0;U<this.length;U++)this.words[U]=0;var j,$,ee=0;if(V==="be")for(U=N.length-1,j=0;U>=0;U-=3)$=N[U]|N[U-1]<<8|N[U-2]<<16,this.words[j]|=$<<ee&67108863,this.words[j+1]=$>>>26-ee&67108863,ee+=24,ee>=26&&(ee-=26,j++);else if(V==="le")for(U=0,j=0;U<N.length;U+=3)$=N[U]|N[U+1]<<8|N[U+2]<<16,this.words[j]|=$<<ee&67108863,this.words[j+1]=$>>>26-ee&67108863,ee+=24,ee>=26&&(ee-=26,j++);return this.strip()};function g(re,N){var z=re.charCodeAt(N);return z>=65&&z<=70?z-55:z>=97&&z<=102?z-87:z-48&15}function w(re,N,z){var V=g(re,z);return z-1>=N&&(V|=g(re,z-1)<<4),V}m.prototype._parseHex=function(N,z,V){this.length=Math.ceil((N.length-z)/6),this.words=new Array(this.length);for(var U=0;U<this.length;U++)this.words[U]=0;var j=0,$=0,ee;if(V==="be")for(U=N.length-1;U>=z;U-=2)ee=w(N,z,U)<<j,this.words[$]|=ee&67108863,j>=18?(j-=18,$+=1,this.words[$]|=ee>>>26):j+=8;else{var J=N.length-z;for(U=J%2===0?z+1:z;U<N.length;U+=2)ee=w(N,z,U)<<j,this.words[$]|=ee&67108863,j>=18?(j-=18,$+=1,this.words[$]|=ee>>>26):j+=8}this.strip()};function _(re,N,z,V){for(var U=0,j=Math.min(re.length,z),$=N;$<j;$++){var ee=re.charCodeAt($)-48;U*=V,ee>=49?U+=ee-49+10:ee>=17?U+=ee-17+10:U+=ee}return U}m.prototype._parseBase=function(N,z,V){this.words=[0],this.length=1;for(var U=0,j=1;j<=67108863;j*=z)U++;U--,j=j/z|0;for(var $=N.length-V,ee=$%U,J=Math.min($,$-ee)+V,F=0,X=V;X<J;X+=U)F=_(N,X,X+U,z),this.imuln(j),this.words[0]+F<67108864?this.words[0]+=F:this._iaddn(F);if(ee!==0){var de=1;for(F=_(N,X,N.length,z),X=0;X<ee;X++)de*=z;this.imuln(de),this.words[0]+F<67108864?this.words[0]+=F:this._iaddn(F)}this.strip()},m.prototype.copy=function(N){N.words=new Array(this.length);for(var z=0;z<this.length;z++)N.words[z]=this.words[z];N.length=this.length,N.negative=this.negative,N.red=this.red},m.prototype.clone=function(){var N=new m(null);return this.copy(N),N},m.prototype._expand=function(N){for(;this.length<N;)this.words[this.length++]=0;return this},m.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},m.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},m.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var A=["","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"],S=[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],k=[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];m.prototype.toString=function(N,z){N=N||10,z=z|0||1;var V;if(N===16||N==="hex"){V="";for(var U=0,j=0,$=0;$<this.length;$++){var ee=this.words[$],J=((ee<<U|j)&16777215).toString(16);j=ee>>>24-U&16777215,U+=2,U>=26&&(U-=26,$--),j!==0||$!==this.length-1?V=A[6-J.length]+J+V:V=J+V}for(j!==0&&(V=j.toString(16)+V);V.length%z!==0;)V="0"+V;return this.negative!==0&&(V="-"+V),V}if(N===(N|0)&&N>=2&&N<=36){var F=S[N],X=k[N];V="";var de=this.clone();for(de.negative=0;!de.isZero();){var Y=de.modn(X).toString(N);de=de.idivn(X),de.isZero()?V=Y+V:V=A[F-Y.length]+Y+V}for(this.isZero()&&(V="0"+V);V.length%z!==0;)V="0"+V;return this.negative!==0&&(V="-"+V),V}C(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var N=this.words[0];return this.length===2?N+=this.words[1]*67108864:this.length===3&&this.words[2]===1?N+=4503599627370496+this.words[1]*67108864:this.length>2&&C(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-N:N},m.prototype.toJSON=function(){return this.toString(16)},m.prototype.toBuffer=function(N,z){return C(typeof b<"u"),this.toArrayLike(b,N,z)},m.prototype.toArray=function(N,z){return this.toArrayLike(Array,N,z)},m.prototype.toArrayLike=function(N,z,V){var U=this.byteLength(),j=V||Math.max(1,U);C(U<=j,"byte array longer than desired length"),C(j>0,"Requested array length <= 0"),this.strip();var $=z==="le",ee=new N(j),J,F,X=this.clone();if($){for(F=0;!X.isZero();F++)J=X.andln(255),X.iushrn(8),ee[F]=J;for(;F<j;F++)ee[F]=0}else{for(F=0;F<j-U;F++)ee[F]=0;for(F=0;!X.isZero();F++)J=X.andln(255),X.iushrn(8),ee[j-F-1]=J}return ee},Math.clz32?m.prototype._countBits=function(N){return 32-Math.clz32(N)}:m.prototype._countBits=function(N){var z=N,V=0;return z>=4096&&(V+=13,z>>>=13),z>=64&&(V+=7,z>>>=7),z>=8&&(V+=4,z>>>=4),z>=2&&(V+=2,z>>>=2),V+z},m.prototype._zeroBits=function(N){if(N===0)return 26;var z=N,V=0;return z&8191||(V+=13,z>>>=13),z&127||(V+=7,z>>>=7),z&15||(V+=4,z>>>=4),z&3||(V+=2,z>>>=2),z&1||V++,V},m.prototype.bitLength=function(){var N=this.words[this.length-1],z=this._countBits(N);return(this.length-1)*26+z};function B(re){for(var N=new Array(re.bitLength()),z=0;z<N.length;z++){var V=z/26|0,U=z%26;N[z]=(re.words[V]&1<<U)>>>U}return N}m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var N=0,z=0;z<this.length;z++){var V=this._zeroBits(this.words[z]);if(N+=V,V!==26)break}return N},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(N){return this.negative!==0?this.abs().inotn(N).iaddn(1):this.clone()},m.prototype.fromTwos=function(N){return this.testn(N-1)?this.notn(N).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return this.negative!==0},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(N){for(;this.length<N.length;)this.words[this.length++]=0;for(var z=0;z<N.length;z++)this.words[z]=this.words[z]|N.words[z];return this.strip()},m.prototype.ior=function(N){return C((this.negative|N.negative)===0),this.iuor(N)},m.prototype.or=function(N){return this.length>N.length?this.clone().ior(N):N.clone().ior(this)},m.prototype.uor=function(N){return this.length>N.length?this.clone().iuor(N):N.clone().iuor(this)},m.prototype.iuand=function(N){var z;this.length>N.length?z=N:z=this;for(var V=0;V<z.length;V++)this.words[V]=this.words[V]&N.words[V];return this.length=z.length,this.strip()},m.prototype.iand=function(N){return C((this.negative|N.negative)===0),this.iuand(N)},m.prototype.and=function(N){return this.length>N.length?this.clone().iand(N):N.clone().iand(this)},m.prototype.uand=function(N){return this.length>N.length?this.clone().iuand(N):N.clone().iuand(this)},m.prototype.iuxor=function(N){var z,V;this.length>N.length?(z=this,V=N):(z=N,V=this);for(var U=0;U<V.length;U++)this.words[U]=z.words[U]^V.words[U];if(this!==z)for(;U<z.length;U++)this.words[U]=z.words[U];return this.length=z.length,this.strip()},m.prototype.ixor=function(N){return C((this.negative|N.negative)===0),this.iuxor(N)},m.prototype.xor=function(N){return this.length>N.length?this.clone().ixor(N):N.clone().ixor(this)},m.prototype.uxor=function(N){return this.length>N.length?this.clone().iuxor(N):N.clone().iuxor(this)},m.prototype.inotn=function(N){C(typeof N=="number"&&N>=0);var z=Math.ceil(N/26)|0,V=N%26;this._expand(z),V>0&&z--;for(var U=0;U<z;U++)this.words[U]=~this.words[U]&67108863;return V>0&&(this.words[U]=~this.words[U]&67108863>>26-V),this.strip()},m.prototype.notn=function(N){return this.clone().inotn(N)},m.prototype.setn=function(N,z){C(typeof N=="number"&&N>=0);var V=N/26|0,U=N%26;return this._expand(V+1),z?this.words[V]=this.words[V]|1<<U:this.words[V]=this.words[V]&~(1<<U),this.strip()},m.prototype.iadd=function(N){var z;if(this.negative!==0&&N.negative===0)return this.negative=0,z=this.isub(N),this.negative^=1,this._normSign();if(this.negative===0&&N.negative!==0)return N.negative=0,z=this.isub(N),N.negative=1,z._normSign();var V,U;this.length>N.length?(V=this,U=N):(V=N,U=this);for(var j=0,$=0;$<U.length;$++)z=(V.words[$]|0)+(U.words[$]|0)+j,this.words[$]=z&67108863,j=z>>>26;for(;j!==0&&$<V.length;$++)z=(V.words[$]|0)+j,this.words[$]=z&67108863,j=z>>>26;if(this.length=V.length,j!==0)this.words[this.length]=j,this.length++;else if(V!==this)for(;$<V.length;$++)this.words[$]=V.words[$];return this},m.prototype.add=function(N){var z;return N.negative!==0&&this.negative===0?(N.negative=0,z=this.sub(N),N.negative^=1,z):N.negative===0&&this.negative!==0?(this.negative=0,z=N.sub(this),this.negative=1,z):this.length>N.length?this.clone().iadd(N):N.clone().iadd(this)},m.prototype.isub=function(N){if(N.negative!==0){N.negative=0;var z=this.iadd(N);return N.negative=1,z._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(N),this.negative=1,this._normSign();var V=this.cmp(N);if(V===0)return this.negative=0,this.length=1,this.words[0]=0,this;var U,j;V>0?(U=this,j=N):(U=N,j=this);for(var $=0,ee=0;ee<j.length;ee++)z=(U.words[ee]|0)-(j.words[ee]|0)+$,$=z>>26,this.words[ee]=z&67108863;for(;$!==0&&ee<U.length;ee++)z=(U.words[ee]|0)+$,$=z>>26,this.words[ee]=z&67108863;if($===0&&ee<U.length&&U!==this)for(;ee<U.length;ee++)this.words[ee]=U.words[ee];return this.length=Math.max(this.length,ee),U!==this&&(this.negative=1),this.strip()},m.prototype.sub=function(N){return this.clone().isub(N)};function O(re,N,z){z.negative=N.negative^re.negative;var V=re.length+N.length|0;z.length=V,V=V-1|0;var U=re.words[0]|0,j=N.words[0]|0,$=U*j,ee=$&67108863,J=$/67108864|0;z.words[0]=ee;for(var F=1;F<V;F++){for(var X=J>>>26,de=J&67108863,Y=Math.min(F,N.length-1),ce=Math.max(0,F-re.length+1);ce<=Y;ce++){var he=F-ce|0;U=re.words[he]|0,j=N.words[ce]|0,$=U*j+de,X+=$/67108864|0,de=$&67108863}z.words[F]=de|0,J=X|0}return J!==0?z.words[F]=J|0:z.length--,z.strip()}var L=function(N,z,V){var U=N.words,j=z.words,$=V.words,ee=0,J,F,X,de=U[0]|0,Y=de&8191,ce=de>>>13,he=U[1]|0,Ie=he&8191,ke=he>>>13,ut=U[2]|0,Re=ut&8191,ze=ut>>>13,_t=U[3]|0,Ct=_t&8191,$t=_t>>>13,ft=U[4]|0,Xe=ft&8191,ct=ft>>>13,wt=U[5]|0,Rt=wt&8191,Ge=wt>>>13,zt=U[6]|0,Ft=zt&8191,tt=zt>>>13,qe=U[7]|0,dt=qe&8191,De=qe>>>13,He=U[8]|0,se=He&8191,oe=He>>>13,ye=U[9]|0,Ee=ye&8191,me=ye>>>13,Te=j[0]|0,Oe=Te&8191,Qe=Te>>>13,Vt=j[1]|0,vt=Vt&8191,Zt=Vt>>>13,dn=j[2]|0,ln=dn&8191,yn=dn>>>13,or=j[3]|0,An=or&8191,Un=or>>>13,Er=j[4]|0,ht=Er&8191,st=Er>>>13,Dt=j[5]|0,Lt=Dt&8191,Gt=Dt>>>13,xn=j[6]|0,un=xn&8191,fn=xn>>>13,Pe=j[7]|0,Ue=Pe&8191,Le=Pe>>>13,_e=j[8]|0,Ze=_e&8191,Ot=_e>>>13,Yt=j[9]|0,Jt=Yt&8191,en=Yt>>>13;V.negative=N.negative^z.negative,V.length=19,J=Math.imul(Y,Oe),F=Math.imul(Y,Qe),F=F+Math.imul(ce,Oe)|0,X=Math.imul(ce,Qe);var Vn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,J=Math.imul(Ie,Oe),F=Math.imul(Ie,Qe),F=F+Math.imul(ke,Oe)|0,X=Math.imul(ke,Qe),J=J+Math.imul(Y,vt)|0,F=F+Math.imul(Y,Zt)|0,F=F+Math.imul(ce,vt)|0,X=X+Math.imul(ce,Zt)|0;var kn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(kn>>>26)|0,kn&=67108863,J=Math.imul(Re,Oe),F=Math.imul(Re,Qe),F=F+Math.imul(ze,Oe)|0,X=Math.imul(ze,Qe),J=J+Math.imul(Ie,vt)|0,F=F+Math.imul(Ie,Zt)|0,F=F+Math.imul(ke,vt)|0,X=X+Math.imul(ke,Zt)|0,J=J+Math.imul(Y,ln)|0,F=F+Math.imul(Y,yn)|0,F=F+Math.imul(ce,ln)|0,X=X+Math.imul(ce,yn)|0;var ir=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(ir>>>26)|0,ir&=67108863,J=Math.imul(Ct,Oe),F=Math.imul(Ct,Qe),F=F+Math.imul($t,Oe)|0,X=Math.imul($t,Qe),J=J+Math.imul(Re,vt)|0,F=F+Math.imul(Re,Zt)|0,F=F+Math.imul(ze,vt)|0,X=X+Math.imul(ze,Zt)|0,J=J+Math.imul(Ie,ln)|0,F=F+Math.imul(Ie,yn)|0,F=F+Math.imul(ke,ln)|0,X=X+Math.imul(ke,yn)|0,J=J+Math.imul(Y,An)|0,F=F+Math.imul(Y,Un)|0,F=F+Math.imul(ce,An)|0,X=X+Math.imul(ce,Un)|0;var Hn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,J=Math.imul(Xe,Oe),F=Math.imul(Xe,Qe),F=F+Math.imul(ct,Oe)|0,X=Math.imul(ct,Qe),J=J+Math.imul(Ct,vt)|0,F=F+Math.imul(Ct,Zt)|0,F=F+Math.imul($t,vt)|0,X=X+Math.imul($t,Zt)|0,J=J+Math.imul(Re,ln)|0,F=F+Math.imul(Re,yn)|0,F=F+Math.imul(ze,ln)|0,X=X+Math.imul(ze,yn)|0,J=J+Math.imul(Ie,An)|0,F=F+Math.imul(Ie,Un)|0,F=F+Math.imul(ke,An)|0,X=X+Math.imul(ke,Un)|0,J=J+Math.imul(Y,ht)|0,F=F+Math.imul(Y,st)|0,F=F+Math.imul(ce,ht)|0,X=X+Math.imul(ce,st)|0;var tr=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(tr>>>26)|0,tr&=67108863,J=Math.imul(Rt,Oe),F=Math.imul(Rt,Qe),F=F+Math.imul(Ge,Oe)|0,X=Math.imul(Ge,Qe),J=J+Math.imul(Xe,vt)|0,F=F+Math.imul(Xe,Zt)|0,F=F+Math.imul(ct,vt)|0,X=X+Math.imul(ct,Zt)|0,J=J+Math.imul(Ct,ln)|0,F=F+Math.imul(Ct,yn)|0,F=F+Math.imul($t,ln)|0,X=X+Math.imul($t,yn)|0,J=J+Math.imul(Re,An)|0,F=F+Math.imul(Re,Un)|0,F=F+Math.imul(ze,An)|0,X=X+Math.imul(ze,Un)|0,J=J+Math.imul(Ie,ht)|0,F=F+Math.imul(Ie,st)|0,F=F+Math.imul(ke,ht)|0,X=X+Math.imul(ke,st)|0,J=J+Math.imul(Y,Lt)|0,F=F+Math.imul(Y,Gt)|0,F=F+Math.imul(ce,Lt)|0,X=X+Math.imul(ce,Gt)|0;var gr=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(gr>>>26)|0,gr&=67108863,J=Math.imul(Ft,Oe),F=Math.imul(Ft,Qe),F=F+Math.imul(tt,Oe)|0,X=Math.imul(tt,Qe),J=J+Math.imul(Rt,vt)|0,F=F+Math.imul(Rt,Zt)|0,F=F+Math.imul(Ge,vt)|0,X=X+Math.imul(Ge,Zt)|0,J=J+Math.imul(Xe,ln)|0,F=F+Math.imul(Xe,yn)|0,F=F+Math.imul(ct,ln)|0,X=X+Math.imul(ct,yn)|0,J=J+Math.imul(Ct,An)|0,F=F+Math.imul(Ct,Un)|0,F=F+Math.imul($t,An)|0,X=X+Math.imul($t,Un)|0,J=J+Math.imul(Re,ht)|0,F=F+Math.imul(Re,st)|0,F=F+Math.imul(ze,ht)|0,X=X+Math.imul(ze,st)|0,J=J+Math.imul(Ie,Lt)|0,F=F+Math.imul(Ie,Gt)|0,F=F+Math.imul(ke,Lt)|0,X=X+Math.imul(ke,Gt)|0,J=J+Math.imul(Y,un)|0,F=F+Math.imul(Y,fn)|0,F=F+Math.imul(ce,un)|0,X=X+Math.imul(ce,fn)|0;var br=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(br>>>26)|0,br&=67108863,J=Math.imul(dt,Oe),F=Math.imul(dt,Qe),F=F+Math.imul(De,Oe)|0,X=Math.imul(De,Qe),J=J+Math.imul(Ft,vt)|0,F=F+Math.imul(Ft,Zt)|0,F=F+Math.imul(tt,vt)|0,X=X+Math.imul(tt,Zt)|0,J=J+Math.imul(Rt,ln)|0,F=F+Math.imul(Rt,yn)|0,F=F+Math.imul(Ge,ln)|0,X=X+Math.imul(Ge,yn)|0,J=J+Math.imul(Xe,An)|0,F=F+Math.imul(Xe,Un)|0,F=F+Math.imul(ct,An)|0,X=X+Math.imul(ct,Un)|0,J=J+Math.imul(Ct,ht)|0,F=F+Math.imul(Ct,st)|0,F=F+Math.imul($t,ht)|0,X=X+Math.imul($t,st)|0,J=J+Math.imul(Re,Lt)|0,F=F+Math.imul(Re,Gt)|0,F=F+Math.imul(ze,Lt)|0,X=X+Math.imul(ze,Gt)|0,J=J+Math.imul(Ie,un)|0,F=F+Math.imul(Ie,fn)|0,F=F+Math.imul(ke,un)|0,X=X+Math.imul(ke,fn)|0,J=J+Math.imul(Y,Ue)|0,F=F+Math.imul(Y,Le)|0,F=F+Math.imul(ce,Ue)|0,X=X+Math.imul(ce,Le)|0;var pr=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(pr>>>26)|0,pr&=67108863,J=Math.imul(se,Oe),F=Math.imul(se,Qe),F=F+Math.imul(oe,Oe)|0,X=Math.imul(oe,Qe),J=J+Math.imul(dt,vt)|0,F=F+Math.imul(dt,Zt)|0,F=F+Math.imul(De,vt)|0,X=X+Math.imul(De,Zt)|0,J=J+Math.imul(Ft,ln)|0,F=F+Math.imul(Ft,yn)|0,F=F+Math.imul(tt,ln)|0,X=X+Math.imul(tt,yn)|0,J=J+Math.imul(Rt,An)|0,F=F+Math.imul(Rt,Un)|0,F=F+Math.imul(Ge,An)|0,X=X+Math.imul(Ge,Un)|0,J=J+Math.imul(Xe,ht)|0,F=F+Math.imul(Xe,st)|0,F=F+Math.imul(ct,ht)|0,X=X+Math.imul(ct,st)|0,J=J+Math.imul(Ct,Lt)|0,F=F+Math.imul(Ct,Gt)|0,F=F+Math.imul($t,Lt)|0,X=X+Math.imul($t,Gt)|0,J=J+Math.imul(Re,un)|0,F=F+Math.imul(Re,fn)|0,F=F+Math.imul(ze,un)|0,X=X+Math.imul(ze,fn)|0,J=J+Math.imul(Ie,Ue)|0,F=F+Math.imul(Ie,Le)|0,F=F+Math.imul(ke,Ue)|0,X=X+Math.imul(ke,Le)|0,J=J+Math.imul(Y,Ze)|0,F=F+Math.imul(Y,Ot)|0,F=F+Math.imul(ce,Ze)|0,X=X+Math.imul(ce,Ot)|0;var _n=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(_n>>>26)|0,_n&=67108863,J=Math.imul(Ee,Oe),F=Math.imul(Ee,Qe),F=F+Math.imul(me,Oe)|0,X=Math.imul(me,Qe),J=J+Math.imul(se,vt)|0,F=F+Math.imul(se,Zt)|0,F=F+Math.imul(oe,vt)|0,X=X+Math.imul(oe,Zt)|0,J=J+Math.imul(dt,ln)|0,F=F+Math.imul(dt,yn)|0,F=F+Math.imul(De,ln)|0,X=X+Math.imul(De,yn)|0,J=J+Math.imul(Ft,An)|0,F=F+Math.imul(Ft,Un)|0,F=F+Math.imul(tt,An)|0,X=X+Math.imul(tt,Un)|0,J=J+Math.imul(Rt,ht)|0,F=F+Math.imul(Rt,st)|0,F=F+Math.imul(Ge,ht)|0,X=X+Math.imul(Ge,st)|0,J=J+Math.imul(Xe,Lt)|0,F=F+Math.imul(Xe,Gt)|0,F=F+Math.imul(ct,Lt)|0,X=X+Math.imul(ct,Gt)|0,J=J+Math.imul(Ct,un)|0,F=F+Math.imul(Ct,fn)|0,F=F+Math.imul($t,un)|0,X=X+Math.imul($t,fn)|0,J=J+Math.imul(Re,Ue)|0,F=F+Math.imul(Re,Le)|0,F=F+Math.imul(ze,Ue)|0,X=X+Math.imul(ze,Le)|0,J=J+Math.imul(Ie,Ze)|0,F=F+Math.imul(Ie,Ot)|0,F=F+Math.imul(ke,Ze)|0,X=X+Math.imul(ke,Ot)|0,J=J+Math.imul(Y,Jt)|0,F=F+Math.imul(Y,en)|0,F=F+Math.imul(ce,Jt)|0,X=X+Math.imul(ce,en)|0;var Qn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,J=Math.imul(Ee,vt),F=Math.imul(Ee,Zt),F=F+Math.imul(me,vt)|0,X=Math.imul(me,Zt),J=J+Math.imul(se,ln)|0,F=F+Math.imul(se,yn)|0,F=F+Math.imul(oe,ln)|0,X=X+Math.imul(oe,yn)|0,J=J+Math.imul(dt,An)|0,F=F+Math.imul(dt,Un)|0,F=F+Math.imul(De,An)|0,X=X+Math.imul(De,Un)|0,J=J+Math.imul(Ft,ht)|0,F=F+Math.imul(Ft,st)|0,F=F+Math.imul(tt,ht)|0,X=X+Math.imul(tt,st)|0,J=J+Math.imul(Rt,Lt)|0,F=F+Math.imul(Rt,Gt)|0,F=F+Math.imul(Ge,Lt)|0,X=X+Math.imul(Ge,Gt)|0,J=J+Math.imul(Xe,un)|0,F=F+Math.imul(Xe,fn)|0,F=F+Math.imul(ct,un)|0,X=X+Math.imul(ct,fn)|0,J=J+Math.imul(Ct,Ue)|0,F=F+Math.imul(Ct,Le)|0,F=F+Math.imul($t,Ue)|0,X=X+Math.imul($t,Le)|0,J=J+Math.imul(Re,Ze)|0,F=F+Math.imul(Re,Ot)|0,F=F+Math.imul(ze,Ze)|0,X=X+Math.imul(ze,Ot)|0,J=J+Math.imul(Ie,Jt)|0,F=F+Math.imul(Ie,en)|0,F=F+Math.imul(ke,Jt)|0,X=X+Math.imul(ke,en)|0;var Zn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Zn>>>26)|0,Zn&=67108863,J=Math.imul(Ee,ln),F=Math.imul(Ee,yn),F=F+Math.imul(me,ln)|0,X=Math.imul(me,yn),J=J+Math.imul(se,An)|0,F=F+Math.imul(se,Un)|0,F=F+Math.imul(oe,An)|0,X=X+Math.imul(oe,Un)|0,J=J+Math.imul(dt,ht)|0,F=F+Math.imul(dt,st)|0,F=F+Math.imul(De,ht)|0,X=X+Math.imul(De,st)|0,J=J+Math.imul(Ft,Lt)|0,F=F+Math.imul(Ft,Gt)|0,F=F+Math.imul(tt,Lt)|0,X=X+Math.imul(tt,Gt)|0,J=J+Math.imul(Rt,un)|0,F=F+Math.imul(Rt,fn)|0,F=F+Math.imul(Ge,un)|0,X=X+Math.imul(Ge,fn)|0,J=J+Math.imul(Xe,Ue)|0,F=F+Math.imul(Xe,Le)|0,F=F+Math.imul(ct,Ue)|0,X=X+Math.imul(ct,Le)|0,J=J+Math.imul(Ct,Ze)|0,F=F+Math.imul(Ct,Ot)|0,F=F+Math.imul($t,Ze)|0,X=X+Math.imul($t,Ot)|0,J=J+Math.imul(Re,Jt)|0,F=F+Math.imul(Re,en)|0,F=F+Math.imul(ze,Jt)|0,X=X+Math.imul(ze,en)|0;var Mn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,J=Math.imul(Ee,An),F=Math.imul(Ee,Un),F=F+Math.imul(me,An)|0,X=Math.imul(me,Un),J=J+Math.imul(se,ht)|0,F=F+Math.imul(se,st)|0,F=F+Math.imul(oe,ht)|0,X=X+Math.imul(oe,st)|0,J=J+Math.imul(dt,Lt)|0,F=F+Math.imul(dt,Gt)|0,F=F+Math.imul(De,Lt)|0,X=X+Math.imul(De,Gt)|0,J=J+Math.imul(Ft,un)|0,F=F+Math.imul(Ft,fn)|0,F=F+Math.imul(tt,un)|0,X=X+Math.imul(tt,fn)|0,J=J+Math.imul(Rt,Ue)|0,F=F+Math.imul(Rt,Le)|0,F=F+Math.imul(Ge,Ue)|0,X=X+Math.imul(Ge,Le)|0,J=J+Math.imul(Xe,Ze)|0,F=F+Math.imul(Xe,Ot)|0,F=F+Math.imul(ct,Ze)|0,X=X+Math.imul(ct,Ot)|0,J=J+Math.imul(Ct,Jt)|0,F=F+Math.imul(Ct,en)|0,F=F+Math.imul($t,Jt)|0,X=X+Math.imul($t,en)|0;var Ln=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,J=Math.imul(Ee,ht),F=Math.imul(Ee,st),F=F+Math.imul(me,ht)|0,X=Math.imul(me,st),J=J+Math.imul(se,Lt)|0,F=F+Math.imul(se,Gt)|0,F=F+Math.imul(oe,Lt)|0,X=X+Math.imul(oe,Gt)|0,J=J+Math.imul(dt,un)|0,F=F+Math.imul(dt,fn)|0,F=F+Math.imul(De,un)|0,X=X+Math.imul(De,fn)|0,J=J+Math.imul(Ft,Ue)|0,F=F+Math.imul(Ft,Le)|0,F=F+Math.imul(tt,Ue)|0,X=X+Math.imul(tt,Le)|0,J=J+Math.imul(Rt,Ze)|0,F=F+Math.imul(Rt,Ot)|0,F=F+Math.imul(Ge,Ze)|0,X=X+Math.imul(Ge,Ot)|0,J=J+Math.imul(Xe,Jt)|0,F=F+Math.imul(Xe,en)|0,F=F+Math.imul(ct,Jt)|0,X=X+Math.imul(ct,en)|0;var Rn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,J=Math.imul(Ee,Lt),F=Math.imul(Ee,Gt),F=F+Math.imul(me,Lt)|0,X=Math.imul(me,Gt),J=J+Math.imul(se,un)|0,F=F+Math.imul(se,fn)|0,F=F+Math.imul(oe,un)|0,X=X+Math.imul(oe,fn)|0,J=J+Math.imul(dt,Ue)|0,F=F+Math.imul(dt,Le)|0,F=F+Math.imul(De,Ue)|0,X=X+Math.imul(De,Le)|0,J=J+Math.imul(Ft,Ze)|0,F=F+Math.imul(Ft,Ot)|0,F=F+Math.imul(tt,Ze)|0,X=X+Math.imul(tt,Ot)|0,J=J+Math.imul(Rt,Jt)|0,F=F+Math.imul(Rt,en)|0,F=F+Math.imul(Ge,Jt)|0,X=X+Math.imul(Ge,en)|0;var In=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(In>>>26)|0,In&=67108863,J=Math.imul(Ee,un),F=Math.imul(Ee,fn),F=F+Math.imul(me,un)|0,X=Math.imul(me,fn),J=J+Math.imul(se,Ue)|0,F=F+Math.imul(se,Le)|0,F=F+Math.imul(oe,Ue)|0,X=X+Math.imul(oe,Le)|0,J=J+Math.imul(dt,Ze)|0,F=F+Math.imul(dt,Ot)|0,F=F+Math.imul(De,Ze)|0,X=X+Math.imul(De,Ot)|0,J=J+Math.imul(Ft,Jt)|0,F=F+Math.imul(Ft,en)|0,F=F+Math.imul(tt,Jt)|0,X=X+Math.imul(tt,en)|0;var Xn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,J=Math.imul(Ee,Ue),F=Math.imul(Ee,Le),F=F+Math.imul(me,Ue)|0,X=Math.imul(me,Le),J=J+Math.imul(se,Ze)|0,F=F+Math.imul(se,Ot)|0,F=F+Math.imul(oe,Ze)|0,X=X+Math.imul(oe,Ot)|0,J=J+Math.imul(dt,Jt)|0,F=F+Math.imul(dt,en)|0,F=F+Math.imul(De,Jt)|0,X=X+Math.imul(De,en)|0;var $n=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+($n>>>26)|0,$n&=67108863,J=Math.imul(Ee,Ze),F=Math.imul(Ee,Ot),F=F+Math.imul(me,Ze)|0,X=Math.imul(me,Ot),J=J+Math.imul(se,Jt)|0,F=F+Math.imul(se,en)|0,F=F+Math.imul(oe,Jt)|0,X=X+Math.imul(oe,en)|0;var hn=(ee+J|0)+((F&8191)<<13)|0;ee=(X+(F>>>13)|0)+(hn>>>26)|0,hn&=67108863,J=Math.imul(Ee,Jt),F=Math.imul(Ee,en),F=F+Math.imul(me,Jt)|0,X=Math.imul(me,en);var an=(ee+J|0)+((F&8191)<<13)|0;return ee=(X+(F>>>13)|0)+(an>>>26)|0,an&=67108863,$[0]=Vn,$[1]=kn,$[2]=ir,$[3]=Hn,$[4]=tr,$[5]=gr,$[6]=br,$[7]=pr,$[8]=_n,$[9]=Qn,$[10]=Zn,$[11]=Mn,$[12]=Ln,$[13]=Rn,$[14]=In,$[15]=Xn,$[16]=$n,$[17]=hn,$[18]=an,ee!==0&&($[19]=ee,V.length++),V};Math.imul||(L=O);function D(re,N,z){z.negative=N.negative^re.negative,z.length=re.length+N.length;for(var V=0,U=0,j=0;j<z.length-1;j++){var $=U;U=0;for(var ee=V&67108863,J=Math.min(j,N.length-1),F=Math.max(0,j-re.length+1);F<=J;F++){var X=j-F,de=re.words[X]|0,Y=N.words[F]|0,ce=de*Y,he=ce&67108863;$=$+(ce/67108864|0)|0,he=he+ee|0,ee=he&67108863,$=$+(he>>>26)|0,U+=$>>>26,$&=67108863}z.words[j]=ee,V=$,$=U}return V!==0?z.words[j]=V:z.length--,z.strip()}function W(re,N,z){var V=new H;return V.mulp(re,N,z)}m.prototype.mulTo=function(N,z){var V,U=this.length+N.length;return this.length===10&&N.length===10?V=L(this,N,z):U<63?V=O(this,N,z):U<1024?V=D(this,N,z):V=W(this,N,z),V};function H(re,N){this.x=re,this.y=N}H.prototype.makeRBT=function(N){for(var z=new Array(N),V=m.prototype._countBits(N)-1,U=0;U<N;U++)z[U]=this.revBin(U,V,N);return z},H.prototype.revBin=function(N,z,V){if(N===0||N===V-1)return N;for(var U=0,j=0;j<z;j++)U|=(N&1)<<z-j-1,N>>=1;return U},H.prototype.permute=function(N,z,V,U,j,$){for(var ee=0;ee<$;ee++)U[ee]=z[N[ee]],j[ee]=V[N[ee]]},H.prototype.transform=function(N,z,V,U,j,$){this.permute($,N,z,V,U,j);for(var ee=1;ee<j;ee<<=1)for(var J=ee<<1,F=Math.cos(2*Math.PI/J),X=Math.sin(2*Math.PI/J),de=0;de<j;de+=J)for(var Y=F,ce=X,he=0;he<ee;he++){var Ie=V[de+he],ke=U[de+he],ut=V[de+he+ee],Re=U[de+he+ee],ze=Y*ut-ce*Re;Re=Y*Re+ce*ut,ut=ze,V[de+he]=Ie+ut,U[de+he]=ke+Re,V[de+he+ee]=Ie-ut,U[de+he+ee]=ke-Re,he!==J&&(ze=F*Y-X*ce,ce=F*ce+X*Y,Y=ze)}},H.prototype.guessLen13b=function(N,z){var V=Math.max(z,N)|1,U=V&1,j=0;for(V=V/2|0;V;V=V>>>1)j++;return 1<<j+1+U},H.prototype.conjugate=function(N,z,V){if(!(V<=1))for(var U=0;U<V/2;U++){var j=N[U];N[U]=N[V-U-1],N[V-U-1]=j,j=z[U],z[U]=-z[V-U-1],z[V-U-1]=-j}},H.prototype.normalize13b=function(N,z){for(var V=0,U=0;U<z/2;U++){var j=Math.round(N[2*U+1]/z)*8192+Math.round(N[2*U]/z)+V;N[U]=j&67108863,j<67108864?V=0:V=j/67108864|0}return N},H.prototype.convert13b=function(N,z,V,U){for(var j=0,$=0;$<z;$++)j=j+(N[$]|0),V[2*$]=j&8191,j=j>>>13,V[2*$+1]=j&8191,j=j>>>13;for($=2*z;$<U;++$)V[$]=0;C(j===0),C((j&-8192)===0)},H.prototype.stub=function(N){for(var z=new Array(N),V=0;V<N;V++)z[V]=0;return z},H.prototype.mulp=function(N,z,V){var U=2*this.guessLen13b(N.length,z.length),j=this.makeRBT(U),$=this.stub(U),ee=new Array(U),J=new Array(U),F=new Array(U),X=new Array(U),de=new Array(U),Y=new Array(U),ce=V.words;ce.length=U,this.convert13b(N.words,N.length,ee,U),this.convert13b(z.words,z.length,X,U),this.transform(ee,$,J,F,U,j),this.transform(X,$,de,Y,U,j);for(var he=0;he<U;he++){var Ie=J[he]*de[he]-F[he]*Y[he];F[he]=J[he]*Y[he]+F[he]*de[he],J[he]=Ie}return this.conjugate(J,F,U),this.transform(J,F,ce,$,U,j),this.conjugate(ce,$,U),this.normalize13b(ce,U),V.negative=N.negative^z.negative,V.length=N.length+z.length,V.strip()},m.prototype.mul=function(N){var z=new m(null);return z.words=new Array(this.length+N.length),this.mulTo(N,z)},m.prototype.mulf=function(N){var z=new m(null);return z.words=new Array(this.length+N.length),W(this,N,z)},m.prototype.imul=function(N){return this.clone().mulTo(N,this)},m.prototype.imuln=function(N){C(typeof N=="number"),C(N<67108864);for(var z=0,V=0;V<this.length;V++){var U=(this.words[V]|0)*N,j=(U&67108863)+(z&67108863);z>>=26,z+=U/67108864|0,z+=j>>>26,this.words[V]=j&67108863}return z!==0&&(this.words[V]=z,this.length++),this},m.prototype.muln=function(N){return this.clone().imuln(N)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(N){var z=B(N);if(z.length===0)return new m(1);for(var V=this,U=0;U<z.length&&z[U]===0;U++,V=V.sqr());if(++U<z.length)for(var j=V.sqr();U<z.length;U++,j=j.sqr())z[U]!==0&&(V=V.mul(j));return V},m.prototype.iushln=function(N){C(typeof N=="number"&&N>=0);var z=N%26,V=(N-z)/26,U=67108863>>>26-z<<26-z,j;if(z!==0){var $=0;for(j=0;j<this.length;j++){var ee=this.words[j]&U,J=(this.words[j]|0)-ee<<z;this.words[j]=J|$,$=ee>>>26-z}$&&(this.words[j]=$,this.length++)}if(V!==0){for(j=this.length-1;j>=0;j--)this.words[j+V]=this.words[j];for(j=0;j<V;j++)this.words[j]=0;this.length+=V}return this.strip()},m.prototype.ishln=function(N){return C(this.negative===0),this.iushln(N)},m.prototype.iushrn=function(N,z,V){C(typeof N=="number"&&N>=0);var U;z?U=(z-z%26)/26:U=0;var j=N%26,$=Math.min((N-j)/26,this.length),ee=67108863^67108863>>>j<<j,J=V;if(U-=$,U=Math.max(0,U),J){for(var F=0;F<$;F++)J.words[F]=this.words[F];J.length=$}if($!==0)if(this.length>$)for(this.length-=$,F=0;F<this.length;F++)this.words[F]=this.words[F+$];else this.words[0]=0,this.length=1;var X=0;for(F=this.length-1;F>=0&&(X!==0||F>=U);F--){var de=this.words[F]|0;this.words[F]=X<<26-j|de>>>j,X=de&ee}return J&&X!==0&&(J.words[J.length++]=X),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},m.prototype.ishrn=function(N,z,V){return C(this.negative===0),this.iushrn(N,z,V)},m.prototype.shln=function(N){return this.clone().ishln(N)},m.prototype.ushln=function(N){return this.clone().iushln(N)},m.prototype.shrn=function(N){return this.clone().ishrn(N)},m.prototype.ushrn=function(N){return this.clone().iushrn(N)},m.prototype.testn=function(N){C(typeof N=="number"&&N>=0);var z=N%26,V=(N-z)/26,U=1<<z;if(this.length<=V)return!1;var j=this.words[V];return!!(j&U)},m.prototype.imaskn=function(N){C(typeof N=="number"&&N>=0);var z=N%26,V=(N-z)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=V)return this;if(z!==0&&V++,this.length=Math.min(V,this.length),z!==0){var U=67108863^67108863>>>z<<z;this.words[this.length-1]&=U}return this.strip()},m.prototype.maskn=function(N){return this.clone().imaskn(N)},m.prototype.iaddn=function(N){return C(typeof N=="number"),C(N<67108864),N<0?this.isubn(-N):this.negative!==0?this.length===1&&(this.words[0]|0)<N?(this.words[0]=N-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(N),this.negative=1,this):this._iaddn(N)},m.prototype._iaddn=function(N){this.words[0]+=N;for(var z=0;z<this.length&&this.words[z]>=67108864;z++)this.words[z]-=67108864,z===this.length-1?this.words[z+1]=1:this.words[z+1]++;return this.length=Math.max(this.length,z+1),this},m.prototype.isubn=function(N){if(C(typeof N=="number"),C(N<67108864),N<0)return this.iaddn(-N);if(this.negative!==0)return this.negative=0,this.iaddn(N),this.negative=1,this;if(this.words[0]-=N,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var z=0;z<this.length&&this.words[z]<0;z++)this.words[z]+=67108864,this.words[z+1]-=1;return this.strip()},m.prototype.addn=function(N){return this.clone().iaddn(N)},m.prototype.subn=function(N){return this.clone().isubn(N)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(N,z,V){var U=N.length+V,j;this._expand(U);var $,ee=0;for(j=0;j<N.length;j++){$=(this.words[j+V]|0)+ee;var J=(N.words[j]|0)*z;$-=J&67108863,ee=($>>26)-(J/67108864|0),this.words[j+V]=$&67108863}for(;j<this.length-V;j++)$=(this.words[j+V]|0)+ee,ee=$>>26,this.words[j+V]=$&67108863;if(ee===0)return this.strip();for(C(ee===-1),ee=0,j=0;j<this.length;j++)$=-(this.words[j]|0)+ee,ee=$>>26,this.words[j]=$&67108863;return this.negative=1,this.strip()},m.prototype._wordDiv=function(N,z){var V=this.length-N.length,U=this.clone(),j=N,$=j.words[j.length-1]|0,ee=this._countBits($);V=26-ee,V!==0&&(j=j.ushln(V),U.iushln(V),$=j.words[j.length-1]|0);var J=U.length-j.length,F;if(z!=="mod"){F=new m(null),F.length=J+1,F.words=new Array(F.length);for(var X=0;X<F.length;X++)F.words[X]=0}var de=U.clone()._ishlnsubmul(j,1,J);de.negative===0&&(U=de,F&&(F.words[J]=1));for(var Y=J-1;Y>=0;Y--){var ce=(U.words[j.length+Y]|0)*67108864+(U.words[j.length+Y-1]|0);for(ce=Math.min(ce/$|0,67108863),U._ishlnsubmul(j,ce,Y);U.negative!==0;)ce--,U.negative=0,U._ishlnsubmul(j,1,Y),U.isZero()||(U.negative^=1);F&&(F.words[Y]=ce)}return F&&F.strip(),U.strip(),z!=="div"&&V!==0&&U.iushrn(V),{div:F||null,mod:U}},m.prototype.divmod=function(N,z,V){if(C(!N.isZero()),this.isZero())return{div:new m(0),mod:new m(0)};var U,j,$;return this.negative!==0&&N.negative===0?($=this.neg().divmod(N,z),z!=="mod"&&(U=$.div.neg()),z!=="div"&&(j=$.mod.neg(),V&&j.negative!==0&&j.iadd(N)),{div:U,mod:j}):this.negative===0&&N.negative!==0?($=this.divmod(N.neg(),z),z!=="mod"&&(U=$.div.neg()),{div:U,mod:$.mod}):this.negative&N.negative?($=this.neg().divmod(N.neg(),z),z!=="div"&&(j=$.mod.neg(),V&&j.negative!==0&&j.isub(N)),{div:$.div,mod:j}):N.length>this.length||this.cmp(N)<0?{div:new m(0),mod:this}:N.length===1?z==="div"?{div:this.divn(N.words[0]),mod:null}:z==="mod"?{div:null,mod:new m(this.modn(N.words[0]))}:{div:this.divn(N.words[0]),mod:new m(this.modn(N.words[0]))}:this._wordDiv(N,z)},m.prototype.div=function(N){return this.divmod(N,"div",!1).div},m.prototype.mod=function(N){return this.divmod(N,"mod",!1).mod},m.prototype.umod=function(N){return this.divmod(N,"mod",!0).mod},m.prototype.divRound=function(N){var z=this.divmod(N);if(z.mod.isZero())return z.div;var V=z.div.negative!==0?z.mod.isub(N):z.mod,U=N.ushrn(1),j=N.andln(1),$=V.cmp(U);return $<0||j===1&&$===0?z.div:z.div.negative!==0?z.div.isubn(1):z.div.iaddn(1)},m.prototype.modn=function(N){C(N<=67108863);for(var z=(1<<26)%N,V=0,U=this.length-1;U>=0;U--)V=(z*V+(this.words[U]|0))%N;return V},m.prototype.idivn=function(N){C(N<=67108863);for(var z=0,V=this.length-1;V>=0;V--){var U=(this.words[V]|0)+z*67108864;this.words[V]=U/N|0,z=U%N}return this.strip()},m.prototype.divn=function(N){return this.clone().idivn(N)},m.prototype.egcd=function(N){C(N.negative===0),C(!N.isZero());var z=this,V=N.clone();z.negative!==0?z=z.umod(N):z=z.clone();for(var U=new m(1),j=new m(0),$=new m(0),ee=new m(1),J=0;z.isEven()&&V.isEven();)z.iushrn(1),V.iushrn(1),++J;for(var F=V.clone(),X=z.clone();!z.isZero();){for(var de=0,Y=1;!(z.words[0]&Y)&&de<26;++de,Y<<=1);if(de>0)for(z.iushrn(de);de-- >0;)(U.isOdd()||j.isOdd())&&(U.iadd(F),j.isub(X)),U.iushrn(1),j.iushrn(1);for(var ce=0,he=1;!(V.words[0]&he)&&ce<26;++ce,he<<=1);if(ce>0)for(V.iushrn(ce);ce-- >0;)($.isOdd()||ee.isOdd())&&($.iadd(F),ee.isub(X)),$.iushrn(1),ee.iushrn(1);z.cmp(V)>=0?(z.isub(V),U.isub($),j.isub(ee)):(V.isub(z),$.isub(U),ee.isub(j))}return{a:$,b:ee,gcd:V.iushln(J)}},m.prototype._invmp=function(N){C(N.negative===0),C(!N.isZero());var z=this,V=N.clone();z.negative!==0?z=z.umod(N):z=z.clone();for(var U=new m(1),j=new m(0),$=V.clone();z.cmpn(1)>0&&V.cmpn(1)>0;){for(var ee=0,J=1;!(z.words[0]&J)&&ee<26;++ee,J<<=1);if(ee>0)for(z.iushrn(ee);ee-- >0;)U.isOdd()&&U.iadd($),U.iushrn(1);for(var F=0,X=1;!(V.words[0]&X)&&F<26;++F,X<<=1);if(F>0)for(V.iushrn(F);F-- >0;)j.isOdd()&&j.iadd($),j.iushrn(1);z.cmp(V)>=0?(z.isub(V),U.isub(j)):(V.isub(z),j.isub(U))}var de;return z.cmpn(1)===0?de=U:de=j,de.cmpn(0)<0&&de.iadd(N),de},m.prototype.gcd=function(N){if(this.isZero())return N.abs();if(N.isZero())return this.abs();var z=this.clone(),V=N.clone();z.negative=0,V.negative=0;for(var U=0;z.isEven()&&V.isEven();U++)z.iushrn(1),V.iushrn(1);do{for(;z.isEven();)z.iushrn(1);for(;V.isEven();)V.iushrn(1);var j=z.cmp(V);if(j<0){var $=z;z=V,V=$}else if(j===0||V.cmpn(1)===0)break;z.isub(V)}while(!0);return V.iushln(U)},m.prototype.invm=function(N){return this.egcd(N).a.umod(N)},m.prototype.isEven=function(){return(this.words[0]&1)===0},m.prototype.isOdd=function(){return(this.words[0]&1)===1},m.prototype.andln=function(N){return this.words[0]&N},m.prototype.bincn=function(N){C(typeof N=="number");var z=N%26,V=(N-z)/26,U=1<<z;if(this.length<=V)return this._expand(V+1),this.words[V]|=U,this;for(var j=U,$=V;j!==0&&$<this.length;$++){var ee=this.words[$]|0;ee+=j,j=ee>>>26,ee&=67108863,this.words[$]=ee}return j!==0&&(this.words[$]=j,this.length++),this},m.prototype.isZero=function(){return this.length===1&&this.words[0]===0},m.prototype.cmpn=function(N){var z=N<0;if(this.negative!==0&&!z)return-1;if(this.negative===0&&z)return 1;this.strip();var V;if(this.length>1)V=1;else{z&&(N=-N),C(N<=67108863,"Number is too big");var U=this.words[0]|0;V=U===N?0:U<N?-1:1}return this.negative!==0?-V|0:V},m.prototype.cmp=function(N){if(this.negative!==0&&N.negative===0)return-1;if(this.negative===0&&N.negative!==0)return 1;var z=this.ucmp(N);return this.negative!==0?-z|0:z},m.prototype.ucmp=function(N){if(this.length>N.length)return 1;if(this.length<N.length)return-1;for(var z=0,V=this.length-1;V>=0;V--){var U=this.words[V]|0,j=N.words[V]|0;if(U!==j){U<j?z=-1:U>j&&(z=1);break}}return z},m.prototype.gtn=function(N){return this.cmpn(N)===1},m.prototype.gt=function(N){return this.cmp(N)===1},m.prototype.gten=function(N){return this.cmpn(N)>=0},m.prototype.gte=function(N){return this.cmp(N)>=0},m.prototype.ltn=function(N){return this.cmpn(N)===-1},m.prototype.lt=function(N){return this.cmp(N)===-1},m.prototype.lten=function(N){return this.cmpn(N)<=0},m.prototype.lte=function(N){return this.cmp(N)<=0},m.prototype.eqn=function(N){return this.cmpn(N)===0},m.prototype.eq=function(N){return this.cmp(N)===0},m.red=function(N){return new we(N)},m.prototype.toRed=function(N){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),N.convertTo(this)._forceRed(N)},m.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(N){return this.red=N,this},m.prototype.forceRed=function(N){return C(!this.red,"Already a number in reduction context"),this._forceRed(N)},m.prototype.redAdd=function(N){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,N)},m.prototype.redIAdd=function(N){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,N)},m.prototype.redSub=function(N){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,N)},m.prototype.redISub=function(N){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,N)},m.prototype.redShl=function(N){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,N)},m.prototype.redMul=function(N){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.mul(this,N)},m.prototype.redIMul=function(N){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.imul(this,N)},m.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(N){return C(this.red&&!N.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,N)};var G={k256:null,p224:null,p192:null,p25519:null};function Z(re,N){this.name=re,this.p=new m(N,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Z.prototype._tmp=function(){var N=new m(null);return N.words=new Array(Math.ceil(this.n/13)),N},Z.prototype.ireduce=function(N){var z=N,V;do this.split(z,this.tmp),z=this.imulK(z),z=z.iadd(this.tmp),V=z.bitLength();while(V>this.n);var U=V<this.n?-1:z.ucmp(this.p);return U===0?(z.words[0]=0,z.length=1):U>0?z.isub(this.p):z.strip!==void 0?z.strip():z._strip(),z},Z.prototype.split=function(N,z){N.iushrn(this.n,0,z)},Z.prototype.imulK=function(N){return N.imul(this.k)};function Q(){Z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}I(Q,Z),Q.prototype.split=function(N,z){for(var V=4194303,U=Math.min(N.length,9),j=0;j<U;j++)z.words[j]=N.words[j];if(z.length=U,N.length<=9){N.words[0]=0,N.length=1;return}var $=N.words[9];for(z.words[z.length++]=$&V,j=10;j<N.length;j++){var ee=N.words[j]|0;N.words[j-10]=(ee&V)<<4|$>>>22,$=ee}$>>>=22,N.words[j-10]=$,$===0&&N.length>10?N.length-=10:N.length-=9},Q.prototype.imulK=function(N){N.words[N.length]=0,N.words[N.length+1]=0,N.length+=2;for(var z=0,V=0;V<N.length;V++){var U=N.words[V]|0;z+=U*977,N.words[V]=z&67108863,z=U*64+(z/67108864|0)}return N.words[N.length-1]===0&&(N.length--,N.words[N.length-1]===0&&N.length--),N};function ie(){Z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}I(ie,Z);function le(){Z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}I(le,Z);function be(){Z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}I(be,Z),be.prototype.imulK=function(N){for(var z=0,V=0;V<N.length;V++){var U=(N.words[V]|0)*19+z,j=U&67108863;U>>>=26,N.words[V]=j,z=U}return z!==0&&(N.words[N.length++]=z),N},m._prime=function(N){if(G[N])return G[N];var z;if(N==="k256")z=new Q;else if(N==="p224")z=new ie;else if(N==="p192")z=new le;else if(N==="p25519")z=new be;else throw new Error("Unknown prime "+N);return G[N]=z,z};function we(re){if(typeof re=="string"){var N=m._prime(re);this.m=N.p,this.prime=N}else C(re.gtn(1),"modulus must be greater than 1"),this.m=re,this.prime=null}we.prototype._verify1=function(N){C(N.negative===0,"red works only with positives"),C(N.red,"red works only with red numbers")},we.prototype._verify2=function(N,z){C((N.negative|z.negative)===0,"red works only with positives"),C(N.red&&N.red===z.red,"red works only with red numbers")},we.prototype.imod=function(N){return this.prime?this.prime.ireduce(N)._forceRed(this):N.umod(this.m)._forceRed(this)},we.prototype.neg=function(N){return N.isZero()?N.clone():this.m.sub(N)._forceRed(this)},we.prototype.add=function(N,z){this._verify2(N,z);var V=N.add(z);return V.cmp(this.m)>=0&&V.isub(this.m),V._forceRed(this)},we.prototype.iadd=function(N,z){this._verify2(N,z);var V=N.iadd(z);return V.cmp(this.m)>=0&&V.isub(this.m),V},we.prototype.sub=function(N,z){this._verify2(N,z);var V=N.sub(z);return V.cmpn(0)<0&&V.iadd(this.m),V._forceRed(this)},we.prototype.isub=function(N,z){this._verify2(N,z);var V=N.isub(z);return V.cmpn(0)<0&&V.iadd(this.m),V},we.prototype.shl=function(N,z){return this._verify1(N),this.imod(N.ushln(z))},we.prototype.imul=function(N,z){return this._verify2(N,z),this.imod(N.imul(z))},we.prototype.mul=function(N,z){return this._verify2(N,z),this.imod(N.mul(z))},we.prototype.isqr=function(N){return this.imul(N,N.clone())},we.prototype.sqr=function(N){return this.mul(N,N)},we.prototype.sqrt=function(N){if(N.isZero())return N.clone();var z=this.m.andln(3);if(C(z%2===1),z===3){var V=this.m.add(new m(1)).iushrn(2);return this.pow(N,V)}for(var U=this.m.subn(1),j=0;!U.isZero()&&U.andln(1)===0;)j++,U.iushrn(1);C(!U.isZero());var $=new m(1).toRed(this),ee=$.redNeg(),J=this.m.subn(1).iushrn(1),F=this.m.bitLength();for(F=new m(2*F*F).toRed(this);this.pow(F,J).cmp(ee)!==0;)F.redIAdd(ee);for(var X=this.pow(F,U),de=this.pow(N,U.addn(1).iushrn(1)),Y=this.pow(N,U),ce=j;Y.cmp($)!==0;){for(var he=Y,Ie=0;he.cmp($)!==0;Ie++)he=he.redSqr();C(Ie<ce);var ke=this.pow(X,new m(1).iushln(ce-Ie-1));de=de.redMul(ke),X=ke.redSqr(),Y=Y.redMul(X),ce=Ie}return de},we.prototype.invm=function(N){var z=N._invmp(this.m);return z.negative!==0?(z.negative=0,this.imod(z).redNeg()):this.imod(z)},we.prototype.pow=function(N,z){if(z.isZero())return new m(1).toRed(this);if(z.cmpn(1)===0)return N.clone();var V=4,U=new Array(1<<V);U[0]=new m(1).toRed(this),U[1]=N;for(var j=2;j<U.length;j++)U[j]=this.mul(U[j-1],N);var $=U[0],ee=0,J=0,F=z.bitLength()%26;for(F===0&&(F=26),j=z.length-1;j>=0;j--){for(var X=z.words[j],de=F-1;de>=0;de--){var Y=X>>de&1;if($!==U[0]&&($=this.sqr($)),Y===0&&ee===0){J=0;continue}ee<<=1,ee|=Y,J++,!(J!==V&&(j!==0||de!==0))&&($=this.mul($,U[ee]),J=0,ee=0)}F=26}return $},we.prototype.convertTo=function(N){var z=N.umod(this.m);return z===N?z.clone():z},we.prototype.convertFrom=function(N){var z=N.clone();return z.red=null,z},m.mont=function(N){return new Ae(N)};function Ae(re){we.call(this,re),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new m(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(Ae,we),Ae.prototype.convertTo=function(N){return this.imod(N.ushln(this.shift))},Ae.prototype.convertFrom=function(N){var z=this.imod(N.mul(this.rinv));return z.red=null,z},Ae.prototype.imul=function(N,z){if(N.isZero()||z.isZero())return N.words[0]=0,N.length=1,N;var V=N.imul(z),U=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),j=V.isub(U).iushrn(this.shift),$=j;return j.cmp(this.m)>=0?$=j.isub(this.m):j.cmpn(0)<0&&($=j.iadd(this.m)),$._forceRed(this)},Ae.prototype.mul=function(N,z){if(N.isZero()||z.isZero())return new m(0)._forceRed(this);var V=N.mul(z),U=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),j=V.isub(U).iushrn(this.shift),$=j;return j.cmp(this.m)>=0?$=j.isub(this.m):j.cmpn(0)<0&&($=j.iadd(this.m)),$._forceRed(this)},Ae.prototype.invm=function(N){var z=this.imod(N._invmp(this.m).mul(this.r2));return z._forceRed(this)}}(fe,this)},83900:function(fe,p,x){fe=x.nmd(fe),function(v,T){"use strict";function C(V,U){if(!V)throw new Error(U||"Assertion failed")}function I(V,U){V.super_=U;var j=function(){};j.prototype=U.prototype,V.prototype=new j,V.prototype.constructor=V}function m(V,U,j){if(m.isBN(V))return V;this.negative=0,this.words=null,this.length=0,this.red=null,V!==null&&((U==="le"||U==="be")&&(j=U,U=10),this._init(V||0,U||10,j||"be"))}typeof v=="object"?v.exports=m:T.BN=m,m.BN=m,m.wordSize=26;var b;try{typeof window.Buffer<"u"?b=window.Buffer:b=x(53263).Buffer}catch{}m.isBN=function(U){return U instanceof m?!0:U!==null&&typeof U=="object"&&U.constructor.wordSize===m.wordSize&&Array.isArray(U.words)},m.max=function(U,j){return U.cmp(j)>0?U:j},m.min=function(U,j){return U.cmp(j)<0?U:j},m.prototype._init=function(U,j,$){if(typeof U=="number")return this._initNumber(U,j,$);if(typeof U=="object")return this._initArray(U,j,$);j==="hex"&&(j=16),C(j===(j|0)&&j>=2&&j<=36),U=U.toString().replace(/\s+/g,"");var ee=0;U[0]==="-"&&(ee++,this.negative=1),ee<U.length&&(j===16?this._parseHex(U,ee,$):(this._parseBase(U,j,ee),$==="le"&&this._initArray(this.toArray(),j,$)))},m.prototype._initNumber=function(U,j,$){U<0&&(this.negative=1,U=-U),U<67108864?(this.words=[U&67108863],this.length=1):U<4503599627370496?(this.words=[U&67108863,U/67108864&67108863],this.length=2):(C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3),$==="le"&&this._initArray(this.toArray(),j,$)},m.prototype._initArray=function(U,j,$){if(C(typeof U.length=="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=new Array(this.length);for(var ee=0;ee<this.length;ee++)this.words[ee]=0;var J,F,X=0;if($==="be")for(ee=U.length-1,J=0;ee>=0;ee-=3)F=U[ee]|U[ee-1]<<8|U[ee-2]<<16,this.words[J]|=F<<X&67108863,this.words[J+1]=F>>>26-X&67108863,X+=24,X>=26&&(X-=26,J++);else if($==="le")for(ee=0,J=0;ee<U.length;ee+=3)F=U[ee]|U[ee+1]<<8|U[ee+2]<<16,this.words[J]|=F<<X&67108863,this.words[J+1]=F>>>26-X&67108863,X+=24,X>=26&&(X-=26,J++);return this._strip()};function g(V,U){var j=V.charCodeAt(U);if(j>=48&&j<=57)return j-48;if(j>=65&&j<=70)return j-55;if(j>=97&&j<=102)return j-87;C(!1,"Invalid character in "+V)}function w(V,U,j){var $=g(V,j);return j-1>=U&&($|=g(V,j-1)<<4),$}m.prototype._parseHex=function(U,j,$){this.length=Math.ceil((U.length-j)/6),this.words=new Array(this.length);for(var ee=0;ee<this.length;ee++)this.words[ee]=0;var J=0,F=0,X;if($==="be")for(ee=U.length-1;ee>=j;ee-=2)X=w(U,j,ee)<<J,this.words[F]|=X&67108863,J>=18?(J-=18,F+=1,this.words[F]|=X>>>26):J+=8;else{var de=U.length-j;for(ee=de%2===0?j+1:j;ee<U.length;ee+=2)X=w(U,j,ee)<<J,this.words[F]|=X&67108863,J>=18?(J-=18,F+=1,this.words[F]|=X>>>26):J+=8}this._strip()};function _(V,U,j,$){for(var ee=0,J=0,F=Math.min(V.length,j),X=U;X<F;X++){var de=V.charCodeAt(X)-48;ee*=$,de>=49?J=de-49+10:de>=17?J=de-17+10:J=de,C(de>=0&&J<$,"Invalid character"),ee+=J}return ee}m.prototype._parseBase=function(U,j,$){this.words=[0],this.length=1;for(var ee=0,J=1;J<=67108863;J*=j)ee++;ee--,J=J/j|0;for(var F=U.length-$,X=F%ee,de=Math.min(F,F-X)+$,Y=0,ce=$;ce<de;ce+=ee)Y=_(U,ce,ce+ee,j),this.imuln(J),this.words[0]+Y<67108864?this.words[0]+=Y:this._iaddn(Y);if(X!==0){var he=1;for(Y=_(U,ce,U.length,j),ce=0;ce<X;ce++)he*=j;this.imuln(he),this.words[0]+Y<67108864?this.words[0]+=Y:this._iaddn(Y)}this._strip()},m.prototype.copy=function(U){U.words=new Array(this.length);for(var j=0;j<this.length;j++)U.words[j]=this.words[j];U.length=this.length,U.negative=this.negative,U.red=this.red};function A(V,U){V.words=U.words,V.length=U.length,V.negative=U.negative,V.red=U.red}if(m.prototype._move=function(U){A(U,this)},m.prototype.clone=function(){var U=new m(null);return this.copy(U),U},m.prototype._expand=function(U){for(;this.length<U;)this.words[this.length++]=0;return this},m.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},m.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{m.prototype[Symbol.for("nodejs.util.inspect.custom")]=S}catch{m.prototype.inspect=S}else m.prototype.inspect=S;function S(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var k=["","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"],B=[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],O=[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];m.prototype.toString=function(U,j){U=U||10,j=j|0||1;var $;if(U===16||U==="hex"){$="";for(var ee=0,J=0,F=0;F<this.length;F++){var X=this.words[F],de=((X<<ee|J)&16777215).toString(16);J=X>>>24-ee&16777215,ee+=2,ee>=26&&(ee-=26,F--),J!==0||F!==this.length-1?$=k[6-de.length]+de+$:$=de+$}for(J!==0&&($=J.toString(16)+$);$.length%j!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}if(U===(U|0)&&U>=2&&U<=36){var Y=B[U],ce=O[U];$="";var he=this.clone();for(he.negative=0;!he.isZero();){var Ie=he.modrn(ce).toString(U);he=he.idivn(ce),he.isZero()?$=Ie+$:$=k[Y-Ie.length]+Ie+$}for(this.isZero()&&($="0"+$);$.length%j!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}C(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var U=this.words[0];return this.length===2?U+=this.words[1]*67108864:this.length===3&&this.words[2]===1?U+=4503599627370496+this.words[1]*67108864:this.length>2&&C(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-U:U},m.prototype.toJSON=function(){return this.toString(16,2)},b&&(m.prototype.toBuffer=function(U,j){return this.toArrayLike(b,U,j)}),m.prototype.toArray=function(U,j){return this.toArrayLike(Array,U,j)};var L=function(U,j){return U.allocUnsafe?U.allocUnsafe(j):new U(j)};m.prototype.toArrayLike=function(U,j,$){this._strip();var ee=this.byteLength(),J=$||Math.max(1,ee);C(ee<=J,"byte array longer than desired length"),C(J>0,"Requested array length <= 0");var F=L(U,J),X=j==="le"?"LE":"BE";return this["_toArrayLike"+X](F,ee),F},m.prototype._toArrayLikeLE=function(U,j){for(var $=0,ee=0,J=0,F=0;J<this.length;J++){var X=this.words[J]<<F|ee;U[$++]=X&255,$<U.length&&(U[$++]=X>>8&255),$<U.length&&(U[$++]=X>>16&255),F===6?($<U.length&&(U[$++]=X>>24&255),ee=0,F=0):(ee=X>>>24,F+=2)}if($<U.length)for(U[$++]=ee;$<U.length;)U[$++]=0},m.prototype._toArrayLikeBE=function(U,j){for(var $=U.length-1,ee=0,J=0,F=0;J<this.length;J++){var X=this.words[J]<<F|ee;U[$--]=X&255,$>=0&&(U[$--]=X>>8&255),$>=0&&(U[$--]=X>>16&255),F===6?($>=0&&(U[$--]=X>>24&255),ee=0,F=0):(ee=X>>>24,F+=2)}if($>=0)for(U[$--]=ee;$>=0;)U[$--]=0},Math.clz32?m.prototype._countBits=function(U){return 32-Math.clz32(U)}:m.prototype._countBits=function(U){var j=U,$=0;return j>=4096&&($+=13,j>>>=13),j>=64&&($+=7,j>>>=7),j>=8&&($+=4,j>>>=4),j>=2&&($+=2,j>>>=2),$+j},m.prototype._zeroBits=function(U){if(U===0)return 26;var j=U,$=0;return j&8191||($+=13,j>>>=13),j&127||($+=7,j>>>=7),j&15||($+=4,j>>>=4),j&3||($+=2,j>>>=2),j&1||$++,$},m.prototype.bitLength=function(){var U=this.words[this.length-1],j=this._countBits(U);return(this.length-1)*26+j};function D(V){for(var U=new Array(V.bitLength()),j=0;j<U.length;j++){var $=j/26|0,ee=j%26;U[j]=V.words[$]>>>ee&1}return U}m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var U=0,j=0;j<this.length;j++){var $=this._zeroBits(this.words[j]);if(U+=$,$!==26)break}return U},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(U){return this.negative!==0?this.abs().inotn(U).iaddn(1):this.clone()},m.prototype.fromTwos=function(U){return this.testn(U-1)?this.notn(U).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return this.negative!==0},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(U){for(;this.length<U.length;)this.words[this.length++]=0;for(var j=0;j<U.length;j++)this.words[j]=this.words[j]|U.words[j];return this._strip()},m.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},m.prototype.or=function(U){return this.length>U.length?this.clone().ior(U):U.clone().ior(this)},m.prototype.uor=function(U){return this.length>U.length?this.clone().iuor(U):U.clone().iuor(this)},m.prototype.iuand=function(U){var j;this.length>U.length?j=U:j=this;for(var $=0;$<j.length;$++)this.words[$]=this.words[$]&U.words[$];return this.length=j.length,this._strip()},m.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},m.prototype.and=function(U){return this.length>U.length?this.clone().iand(U):U.clone().iand(this)},m.prototype.uand=function(U){return this.length>U.length?this.clone().iuand(U):U.clone().iuand(this)},m.prototype.iuxor=function(U){var j,$;this.length>U.length?(j=this,$=U):(j=U,$=this);for(var ee=0;ee<$.length;ee++)this.words[ee]=j.words[ee]^$.words[ee];if(this!==j)for(;ee<j.length;ee++)this.words[ee]=j.words[ee];return this.length=j.length,this._strip()},m.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},m.prototype.xor=function(U){return this.length>U.length?this.clone().ixor(U):U.clone().ixor(this)},m.prototype.uxor=function(U){return this.length>U.length?this.clone().iuxor(U):U.clone().iuxor(this)},m.prototype.inotn=function(U){C(typeof U=="number"&&U>=0);var j=Math.ceil(U/26)|0,$=U%26;this._expand(j),$>0&&j--;for(var ee=0;ee<j;ee++)this.words[ee]=~this.words[ee]&67108863;return $>0&&(this.words[ee]=~this.words[ee]&67108863>>26-$),this._strip()},m.prototype.notn=function(U){return this.clone().inotn(U)},m.prototype.setn=function(U,j){C(typeof U=="number"&&U>=0);var $=U/26|0,ee=U%26;return this._expand($+1),j?this.words[$]=this.words[$]|1<<ee:this.words[$]=this.words[$]&~(1<<ee),this._strip()},m.prototype.iadd=function(U){var j;if(this.negative!==0&&U.negative===0)return this.negative=0,j=this.isub(U),this.negative^=1,this._normSign();if(this.negative===0&&U.negative!==0)return U.negative=0,j=this.isub(U),U.negative=1,j._normSign();var $,ee;this.length>U.length?($=this,ee=U):($=U,ee=this);for(var J=0,F=0;F<ee.length;F++)j=($.words[F]|0)+(ee.words[F]|0)+J,this.words[F]=j&67108863,J=j>>>26;for(;J!==0&&F<$.length;F++)j=($.words[F]|0)+J,this.words[F]=j&67108863,J=j>>>26;if(this.length=$.length,J!==0)this.words[this.length]=J,this.length++;else if($!==this)for(;F<$.length;F++)this.words[F]=$.words[F];return this},m.prototype.add=function(U){var j;return U.negative!==0&&this.negative===0?(U.negative=0,j=this.sub(U),U.negative^=1,j):U.negative===0&&this.negative!==0?(this.negative=0,j=U.sub(this),this.negative=1,j):this.length>U.length?this.clone().iadd(U):U.clone().iadd(this)},m.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var j=this.iadd(U);return U.negative=1,j._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var $=this.cmp(U);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var ee,J;$>0?(ee=this,J=U):(ee=U,J=this);for(var F=0,X=0;X<J.length;X++)j=(ee.words[X]|0)-(J.words[X]|0)+F,F=j>>26,this.words[X]=j&67108863;for(;F!==0&&X<ee.length;X++)j=(ee.words[X]|0)+F,F=j>>26,this.words[X]=j&67108863;if(F===0&&X<ee.length&&ee!==this)for(;X<ee.length;X++)this.words[X]=ee.words[X];return this.length=Math.max(this.length,X),ee!==this&&(this.negative=1),this._strip()},m.prototype.sub=function(U){return this.clone().isub(U)};function W(V,U,j){j.negative=U.negative^V.negative;var $=V.length+U.length|0;j.length=$,$=$-1|0;var ee=V.words[0]|0,J=U.words[0]|0,F=ee*J,X=F&67108863,de=F/67108864|0;j.words[0]=X;for(var Y=1;Y<$;Y++){for(var ce=de>>>26,he=de&67108863,Ie=Math.min(Y,U.length-1),ke=Math.max(0,Y-V.length+1);ke<=Ie;ke++){var ut=Y-ke|0;ee=V.words[ut]|0,J=U.words[ke]|0,F=ee*J+he,ce+=F/67108864|0,he=F&67108863}j.words[Y]=he|0,de=ce|0}return de!==0?j.words[Y]=de|0:j.length--,j._strip()}var H=function(U,j,$){var ee=U.words,J=j.words,F=$.words,X=0,de,Y,ce,he=ee[0]|0,Ie=he&8191,ke=he>>>13,ut=ee[1]|0,Re=ut&8191,ze=ut>>>13,_t=ee[2]|0,Ct=_t&8191,$t=_t>>>13,ft=ee[3]|0,Xe=ft&8191,ct=ft>>>13,wt=ee[4]|0,Rt=wt&8191,Ge=wt>>>13,zt=ee[5]|0,Ft=zt&8191,tt=zt>>>13,qe=ee[6]|0,dt=qe&8191,De=qe>>>13,He=ee[7]|0,se=He&8191,oe=He>>>13,ye=ee[8]|0,Ee=ye&8191,me=ye>>>13,Te=ee[9]|0,Oe=Te&8191,Qe=Te>>>13,Vt=J[0]|0,vt=Vt&8191,Zt=Vt>>>13,dn=J[1]|0,ln=dn&8191,yn=dn>>>13,or=J[2]|0,An=or&8191,Un=or>>>13,Er=J[3]|0,ht=Er&8191,st=Er>>>13,Dt=J[4]|0,Lt=Dt&8191,Gt=Dt>>>13,xn=J[5]|0,un=xn&8191,fn=xn>>>13,Pe=J[6]|0,Ue=Pe&8191,Le=Pe>>>13,_e=J[7]|0,Ze=_e&8191,Ot=_e>>>13,Yt=J[8]|0,Jt=Yt&8191,en=Yt>>>13,Vn=J[9]|0,kn=Vn&8191,ir=Vn>>>13;$.negative=U.negative^j.negative,$.length=19,de=Math.imul(Ie,vt),Y=Math.imul(Ie,Zt),Y=Y+Math.imul(ke,vt)|0,ce=Math.imul(ke,Zt);var Hn=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,de=Math.imul(Re,vt),Y=Math.imul(Re,Zt),Y=Y+Math.imul(ze,vt)|0,ce=Math.imul(ze,Zt),de=de+Math.imul(Ie,ln)|0,Y=Y+Math.imul(Ie,yn)|0,Y=Y+Math.imul(ke,ln)|0,ce=ce+Math.imul(ke,yn)|0;var tr=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(tr>>>26)|0,tr&=67108863,de=Math.imul(Ct,vt),Y=Math.imul(Ct,Zt),Y=Y+Math.imul($t,vt)|0,ce=Math.imul($t,Zt),de=de+Math.imul(Re,ln)|0,Y=Y+Math.imul(Re,yn)|0,Y=Y+Math.imul(ze,ln)|0,ce=ce+Math.imul(ze,yn)|0,de=de+Math.imul(Ie,An)|0,Y=Y+Math.imul(Ie,Un)|0,Y=Y+Math.imul(ke,An)|0,ce=ce+Math.imul(ke,Un)|0;var gr=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(gr>>>26)|0,gr&=67108863,de=Math.imul(Xe,vt),Y=Math.imul(Xe,Zt),Y=Y+Math.imul(ct,vt)|0,ce=Math.imul(ct,Zt),de=de+Math.imul(Ct,ln)|0,Y=Y+Math.imul(Ct,yn)|0,Y=Y+Math.imul($t,ln)|0,ce=ce+Math.imul($t,yn)|0,de=de+Math.imul(Re,An)|0,Y=Y+Math.imul(Re,Un)|0,Y=Y+Math.imul(ze,An)|0,ce=ce+Math.imul(ze,Un)|0,de=de+Math.imul(Ie,ht)|0,Y=Y+Math.imul(Ie,st)|0,Y=Y+Math.imul(ke,ht)|0,ce=ce+Math.imul(ke,st)|0;var br=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(br>>>26)|0,br&=67108863,de=Math.imul(Rt,vt),Y=Math.imul(Rt,Zt),Y=Y+Math.imul(Ge,vt)|0,ce=Math.imul(Ge,Zt),de=de+Math.imul(Xe,ln)|0,Y=Y+Math.imul(Xe,yn)|0,Y=Y+Math.imul(ct,ln)|0,ce=ce+Math.imul(ct,yn)|0,de=de+Math.imul(Ct,An)|0,Y=Y+Math.imul(Ct,Un)|0,Y=Y+Math.imul($t,An)|0,ce=ce+Math.imul($t,Un)|0,de=de+Math.imul(Re,ht)|0,Y=Y+Math.imul(Re,st)|0,Y=Y+Math.imul(ze,ht)|0,ce=ce+Math.imul(ze,st)|0,de=de+Math.imul(Ie,Lt)|0,Y=Y+Math.imul(Ie,Gt)|0,Y=Y+Math.imul(ke,Lt)|0,ce=ce+Math.imul(ke,Gt)|0;var pr=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(pr>>>26)|0,pr&=67108863,de=Math.imul(Ft,vt),Y=Math.imul(Ft,Zt),Y=Y+Math.imul(tt,vt)|0,ce=Math.imul(tt,Zt),de=de+Math.imul(Rt,ln)|0,Y=Y+Math.imul(Rt,yn)|0,Y=Y+Math.imul(Ge,ln)|0,ce=ce+Math.imul(Ge,yn)|0,de=de+Math.imul(Xe,An)|0,Y=Y+Math.imul(Xe,Un)|0,Y=Y+Math.imul(ct,An)|0,ce=ce+Math.imul(ct,Un)|0,de=de+Math.imul(Ct,ht)|0,Y=Y+Math.imul(Ct,st)|0,Y=Y+Math.imul($t,ht)|0,ce=ce+Math.imul($t,st)|0,de=de+Math.imul(Re,Lt)|0,Y=Y+Math.imul(Re,Gt)|0,Y=Y+Math.imul(ze,Lt)|0,ce=ce+Math.imul(ze,Gt)|0,de=de+Math.imul(Ie,un)|0,Y=Y+Math.imul(Ie,fn)|0,Y=Y+Math.imul(ke,un)|0,ce=ce+Math.imul(ke,fn)|0;var _n=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(_n>>>26)|0,_n&=67108863,de=Math.imul(dt,vt),Y=Math.imul(dt,Zt),Y=Y+Math.imul(De,vt)|0,ce=Math.imul(De,Zt),de=de+Math.imul(Ft,ln)|0,Y=Y+Math.imul(Ft,yn)|0,Y=Y+Math.imul(tt,ln)|0,ce=ce+Math.imul(tt,yn)|0,de=de+Math.imul(Rt,An)|0,Y=Y+Math.imul(Rt,Un)|0,Y=Y+Math.imul(Ge,An)|0,ce=ce+Math.imul(Ge,Un)|0,de=de+Math.imul(Xe,ht)|0,Y=Y+Math.imul(Xe,st)|0,Y=Y+Math.imul(ct,ht)|0,ce=ce+Math.imul(ct,st)|0,de=de+Math.imul(Ct,Lt)|0,Y=Y+Math.imul(Ct,Gt)|0,Y=Y+Math.imul($t,Lt)|0,ce=ce+Math.imul($t,Gt)|0,de=de+Math.imul(Re,un)|0,Y=Y+Math.imul(Re,fn)|0,Y=Y+Math.imul(ze,un)|0,ce=ce+Math.imul(ze,fn)|0,de=de+Math.imul(Ie,Ue)|0,Y=Y+Math.imul(Ie,Le)|0,Y=Y+Math.imul(ke,Ue)|0,ce=ce+Math.imul(ke,Le)|0;var Qn=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,de=Math.imul(se,vt),Y=Math.imul(se,Zt),Y=Y+Math.imul(oe,vt)|0,ce=Math.imul(oe,Zt),de=de+Math.imul(dt,ln)|0,Y=Y+Math.imul(dt,yn)|0,Y=Y+Math.imul(De,ln)|0,ce=ce+Math.imul(De,yn)|0,de=de+Math.imul(Ft,An)|0,Y=Y+Math.imul(Ft,Un)|0,Y=Y+Math.imul(tt,An)|0,ce=ce+Math.imul(tt,Un)|0,de=de+Math.imul(Rt,ht)|0,Y=Y+Math.imul(Rt,st)|0,Y=Y+Math.imul(Ge,ht)|0,ce=ce+Math.imul(Ge,st)|0,de=de+Math.imul(Xe,Lt)|0,Y=Y+Math.imul(Xe,Gt)|0,Y=Y+Math.imul(ct,Lt)|0,ce=ce+Math.imul(ct,Gt)|0,de=de+Math.imul(Ct,un)|0,Y=Y+Math.imul(Ct,fn)|0,Y=Y+Math.imul($t,un)|0,ce=ce+Math.imul($t,fn)|0,de=de+Math.imul(Re,Ue)|0,Y=Y+Math.imul(Re,Le)|0,Y=Y+Math.imul(ze,Ue)|0,ce=ce+Math.imul(ze,Le)|0,de=de+Math.imul(Ie,Ze)|0,Y=Y+Math.imul(Ie,Ot)|0,Y=Y+Math.imul(ke,Ze)|0,ce=ce+Math.imul(ke,Ot)|0;var Zn=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(Zn>>>26)|0,Zn&=67108863,de=Math.imul(Ee,vt),Y=Math.imul(Ee,Zt),Y=Y+Math.imul(me,vt)|0,ce=Math.imul(me,Zt),de=de+Math.imul(se,ln)|0,Y=Y+Math.imul(se,yn)|0,Y=Y+Math.imul(oe,ln)|0,ce=ce+Math.imul(oe,yn)|0,de=de+Math.imul(dt,An)|0,Y=Y+Math.imul(dt,Un)|0,Y=Y+Math.imul(De,An)|0,ce=ce+Math.imul(De,Un)|0,de=de+Math.imul(Ft,ht)|0,Y=Y+Math.imul(Ft,st)|0,Y=Y+Math.imul(tt,ht)|0,ce=ce+Math.imul(tt,st)|0,de=de+Math.imul(Rt,Lt)|0,Y=Y+Math.imul(Rt,Gt)|0,Y=Y+Math.imul(Ge,Lt)|0,ce=ce+Math.imul(Ge,Gt)|0,de=de+Math.imul(Xe,un)|0,Y=Y+Math.imul(Xe,fn)|0,Y=Y+Math.imul(ct,un)|0,ce=ce+Math.imul(ct,fn)|0,de=de+Math.imul(Ct,Ue)|0,Y=Y+Math.imul(Ct,Le)|0,Y=Y+Math.imul($t,Ue)|0,ce=ce+Math.imul($t,Le)|0,de=de+Math.imul(Re,Ze)|0,Y=Y+Math.imul(Re,Ot)|0,Y=Y+Math.imul(ze,Ze)|0,ce=ce+Math.imul(ze,Ot)|0,de=de+Math.imul(Ie,Jt)|0,Y=Y+Math.imul(Ie,en)|0,Y=Y+Math.imul(ke,Jt)|0,ce=ce+Math.imul(ke,en)|0;var Mn=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,de=Math.imul(Oe,vt),Y=Math.imul(Oe,Zt),Y=Y+Math.imul(Qe,vt)|0,ce=Math.imul(Qe,Zt),de=de+Math.imul(Ee,ln)|0,Y=Y+Math.imul(Ee,yn)|0,Y=Y+Math.imul(me,ln)|0,ce=ce+Math.imul(me,yn)|0,de=de+Math.imul(se,An)|0,Y=Y+Math.imul(se,Un)|0,Y=Y+Math.imul(oe,An)|0,ce=ce+Math.imul(oe,Un)|0,de=de+Math.imul(dt,ht)|0,Y=Y+Math.imul(dt,st)|0,Y=Y+Math.imul(De,ht)|0,ce=ce+Math.imul(De,st)|0,de=de+Math.imul(Ft,Lt)|0,Y=Y+Math.imul(Ft,Gt)|0,Y=Y+Math.imul(tt,Lt)|0,ce=ce+Math.imul(tt,Gt)|0,de=de+Math.imul(Rt,un)|0,Y=Y+Math.imul(Rt,fn)|0,Y=Y+Math.imul(Ge,un)|0,ce=ce+Math.imul(Ge,fn)|0,de=de+Math.imul(Xe,Ue)|0,Y=Y+Math.imul(Xe,Le)|0,Y=Y+Math.imul(ct,Ue)|0,ce=ce+Math.imul(ct,Le)|0,de=de+Math.imul(Ct,Ze)|0,Y=Y+Math.imul(Ct,Ot)|0,Y=Y+Math.imul($t,Ze)|0,ce=ce+Math.imul($t,Ot)|0,de=de+Math.imul(Re,Jt)|0,Y=Y+Math.imul(Re,en)|0,Y=Y+Math.imul(ze,Jt)|0,ce=ce+Math.imul(ze,en)|0,de=de+Math.imul(Ie,kn)|0,Y=Y+Math.imul(Ie,ir)|0,Y=Y+Math.imul(ke,kn)|0,ce=ce+Math.imul(ke,ir)|0;var Ln=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,de=Math.imul(Oe,ln),Y=Math.imul(Oe,yn),Y=Y+Math.imul(Qe,ln)|0,ce=Math.imul(Qe,yn),de=de+Math.imul(Ee,An)|0,Y=Y+Math.imul(Ee,Un)|0,Y=Y+Math.imul(me,An)|0,ce=ce+Math.imul(me,Un)|0,de=de+Math.imul(se,ht)|0,Y=Y+Math.imul(se,st)|0,Y=Y+Math.imul(oe,ht)|0,ce=ce+Math.imul(oe,st)|0,de=de+Math.imul(dt,Lt)|0,Y=Y+Math.imul(dt,Gt)|0,Y=Y+Math.imul(De,Lt)|0,ce=ce+Math.imul(De,Gt)|0,de=de+Math.imul(Ft,un)|0,Y=Y+Math.imul(Ft,fn)|0,Y=Y+Math.imul(tt,un)|0,ce=ce+Math.imul(tt,fn)|0,de=de+Math.imul(Rt,Ue)|0,Y=Y+Math.imul(Rt,Le)|0,Y=Y+Math.imul(Ge,Ue)|0,ce=ce+Math.imul(Ge,Le)|0,de=de+Math.imul(Xe,Ze)|0,Y=Y+Math.imul(Xe,Ot)|0,Y=Y+Math.imul(ct,Ze)|0,ce=ce+Math.imul(ct,Ot)|0,de=de+Math.imul(Ct,Jt)|0,Y=Y+Math.imul(Ct,en)|0,Y=Y+Math.imul($t,Jt)|0,ce=ce+Math.imul($t,en)|0,de=de+Math.imul(Re,kn)|0,Y=Y+Math.imul(Re,ir)|0,Y=Y+Math.imul(ze,kn)|0,ce=ce+Math.imul(ze,ir)|0;var Rn=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,de=Math.imul(Oe,An),Y=Math.imul(Oe,Un),Y=Y+Math.imul(Qe,An)|0,ce=Math.imul(Qe,Un),de=de+Math.imul(Ee,ht)|0,Y=Y+Math.imul(Ee,st)|0,Y=Y+Math.imul(me,ht)|0,ce=ce+Math.imul(me,st)|0,de=de+Math.imul(se,Lt)|0,Y=Y+Math.imul(se,Gt)|0,Y=Y+Math.imul(oe,Lt)|0,ce=ce+Math.imul(oe,Gt)|0,de=de+Math.imul(dt,un)|0,Y=Y+Math.imul(dt,fn)|0,Y=Y+Math.imul(De,un)|0,ce=ce+Math.imul(De,fn)|0,de=de+Math.imul(Ft,Ue)|0,Y=Y+Math.imul(Ft,Le)|0,Y=Y+Math.imul(tt,Ue)|0,ce=ce+Math.imul(tt,Le)|0,de=de+Math.imul(Rt,Ze)|0,Y=Y+Math.imul(Rt,Ot)|0,Y=Y+Math.imul(Ge,Ze)|0,ce=ce+Math.imul(Ge,Ot)|0,de=de+Math.imul(Xe,Jt)|0,Y=Y+Math.imul(Xe,en)|0,Y=Y+Math.imul(ct,Jt)|0,ce=ce+Math.imul(ct,en)|0,de=de+Math.imul(Ct,kn)|0,Y=Y+Math.imul(Ct,ir)|0,Y=Y+Math.imul($t,kn)|0,ce=ce+Math.imul($t,ir)|0;var In=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(In>>>26)|0,In&=67108863,de=Math.imul(Oe,ht),Y=Math.imul(Oe,st),Y=Y+Math.imul(Qe,ht)|0,ce=Math.imul(Qe,st),de=de+Math.imul(Ee,Lt)|0,Y=Y+Math.imul(Ee,Gt)|0,Y=Y+Math.imul(me,Lt)|0,ce=ce+Math.imul(me,Gt)|0,de=de+Math.imul(se,un)|0,Y=Y+Math.imul(se,fn)|0,Y=Y+Math.imul(oe,un)|0,ce=ce+Math.imul(oe,fn)|0,de=de+Math.imul(dt,Ue)|0,Y=Y+Math.imul(dt,Le)|0,Y=Y+Math.imul(De,Ue)|0,ce=ce+Math.imul(De,Le)|0,de=de+Math.imul(Ft,Ze)|0,Y=Y+Math.imul(Ft,Ot)|0,Y=Y+Math.imul(tt,Ze)|0,ce=ce+Math.imul(tt,Ot)|0,de=de+Math.imul(Rt,Jt)|0,Y=Y+Math.imul(Rt,en)|0,Y=Y+Math.imul(Ge,Jt)|0,ce=ce+Math.imul(Ge,en)|0,de=de+Math.imul(Xe,kn)|0,Y=Y+Math.imul(Xe,ir)|0,Y=Y+Math.imul(ct,kn)|0,ce=ce+Math.imul(ct,ir)|0;var Xn=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,de=Math.imul(Oe,Lt),Y=Math.imul(Oe,Gt),Y=Y+Math.imul(Qe,Lt)|0,ce=Math.imul(Qe,Gt),de=de+Math.imul(Ee,un)|0,Y=Y+Math.imul(Ee,fn)|0,Y=Y+Math.imul(me,un)|0,ce=ce+Math.imul(me,fn)|0,de=de+Math.imul(se,Ue)|0,Y=Y+Math.imul(se,Le)|0,Y=Y+Math.imul(oe,Ue)|0,ce=ce+Math.imul(oe,Le)|0,de=de+Math.imul(dt,Ze)|0,Y=Y+Math.imul(dt,Ot)|0,Y=Y+Math.imul(De,Ze)|0,ce=ce+Math.imul(De,Ot)|0,de=de+Math.imul(Ft,Jt)|0,Y=Y+Math.imul(Ft,en)|0,Y=Y+Math.imul(tt,Jt)|0,ce=ce+Math.imul(tt,en)|0,de=de+Math.imul(Rt,kn)|0,Y=Y+Math.imul(Rt,ir)|0,Y=Y+Math.imul(Ge,kn)|0,ce=ce+Math.imul(Ge,ir)|0;var $n=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+($n>>>26)|0,$n&=67108863,de=Math.imul(Oe,un),Y=Math.imul(Oe,fn),Y=Y+Math.imul(Qe,un)|0,ce=Math.imul(Qe,fn),de=de+Math.imul(Ee,Ue)|0,Y=Y+Math.imul(Ee,Le)|0,Y=Y+Math.imul(me,Ue)|0,ce=ce+Math.imul(me,Le)|0,de=de+Math.imul(se,Ze)|0,Y=Y+Math.imul(se,Ot)|0,Y=Y+Math.imul(oe,Ze)|0,ce=ce+Math.imul(oe,Ot)|0,de=de+Math.imul(dt,Jt)|0,Y=Y+Math.imul(dt,en)|0,Y=Y+Math.imul(De,Jt)|0,ce=ce+Math.imul(De,en)|0,de=de+Math.imul(Ft,kn)|0,Y=Y+Math.imul(Ft,ir)|0,Y=Y+Math.imul(tt,kn)|0,ce=ce+Math.imul(tt,ir)|0;var hn=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(hn>>>26)|0,hn&=67108863,de=Math.imul(Oe,Ue),Y=Math.imul(Oe,Le),Y=Y+Math.imul(Qe,Ue)|0,ce=Math.imul(Qe,Le),de=de+Math.imul(Ee,Ze)|0,Y=Y+Math.imul(Ee,Ot)|0,Y=Y+Math.imul(me,Ze)|0,ce=ce+Math.imul(me,Ot)|0,de=de+Math.imul(se,Jt)|0,Y=Y+Math.imul(se,en)|0,Y=Y+Math.imul(oe,Jt)|0,ce=ce+Math.imul(oe,en)|0,de=de+Math.imul(dt,kn)|0,Y=Y+Math.imul(dt,ir)|0,Y=Y+Math.imul(De,kn)|0,ce=ce+Math.imul(De,ir)|0;var an=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(an>>>26)|0,an&=67108863,de=Math.imul(Oe,Ze),Y=Math.imul(Oe,Ot),Y=Y+Math.imul(Qe,Ze)|0,ce=Math.imul(Qe,Ot),de=de+Math.imul(Ee,Jt)|0,Y=Y+Math.imul(Ee,en)|0,Y=Y+Math.imul(me,Jt)|0,ce=ce+Math.imul(me,en)|0,de=de+Math.imul(se,kn)|0,Y=Y+Math.imul(se,ir)|0,Y=Y+Math.imul(oe,kn)|0,ce=ce+Math.imul(oe,ir)|0;var Tn=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,de=Math.imul(Oe,Jt),Y=Math.imul(Oe,en),Y=Y+Math.imul(Qe,Jt)|0,ce=Math.imul(Qe,en),de=de+Math.imul(Ee,kn)|0,Y=Y+Math.imul(Ee,ir)|0,Y=Y+Math.imul(me,kn)|0,ce=ce+Math.imul(me,ir)|0;var Sn=(X+de|0)+((Y&8191)<<13)|0;X=(ce+(Y>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,de=Math.imul(Oe,kn),Y=Math.imul(Oe,ir),Y=Y+Math.imul(Qe,kn)|0,ce=Math.imul(Qe,ir);var Bn=(X+de|0)+((Y&8191)<<13)|0;return X=(ce+(Y>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,F[0]=Hn,F[1]=tr,F[2]=gr,F[3]=br,F[4]=pr,F[5]=_n,F[6]=Qn,F[7]=Zn,F[8]=Mn,F[9]=Ln,F[10]=Rn,F[11]=In,F[12]=Xn,F[13]=$n,F[14]=hn,F[15]=an,F[16]=Tn,F[17]=Sn,F[18]=Bn,X!==0&&(F[19]=X,$.length++),$};Math.imul||(H=W);function G(V,U,j){j.negative=U.negative^V.negative,j.length=V.length+U.length;for(var $=0,ee=0,J=0;J<j.length-1;J++){var F=ee;ee=0;for(var X=$&67108863,de=Math.min(J,U.length-1),Y=Math.max(0,J-V.length+1);Y<=de;Y++){var ce=J-Y,he=V.words[ce]|0,Ie=U.words[Y]|0,ke=he*Ie,ut=ke&67108863;F=F+(ke/67108864|0)|0,ut=ut+X|0,X=ut&67108863,F=F+(ut>>>26)|0,ee+=F>>>26,F&=67108863}j.words[J]=X,$=F,F=ee}return $!==0?j.words[J]=$:j.length--,j._strip()}function Z(V,U,j){return G(V,U,j)}m.prototype.mulTo=function(U,j){var $,ee=this.length+U.length;return this.length===10&&U.length===10?$=H(this,U,j):ee<63?$=W(this,U,j):ee<1024?$=G(this,U,j):$=Z(this,U,j),$};function Q(V,U){this.x=V,this.y=U}Q.prototype.makeRBT=function(U){for(var j=new Array(U),$=m.prototype._countBits(U)-1,ee=0;ee<U;ee++)j[ee]=this.revBin(ee,$,U);return j},Q.prototype.revBin=function(U,j,$){if(U===0||U===$-1)return U;for(var ee=0,J=0;J<j;J++)ee|=(U&1)<<j-J-1,U>>=1;return ee},Q.prototype.permute=function(U,j,$,ee,J,F){for(var X=0;X<F;X++)ee[X]=j[U[X]],J[X]=$[U[X]]},Q.prototype.transform=function(U,j,$,ee,J,F){this.permute(F,U,j,$,ee,J);for(var X=1;X<J;X<<=1)for(var de=X<<1,Y=Math.cos(2*Math.PI/de),ce=Math.sin(2*Math.PI/de),he=0;he<J;he+=de)for(var Ie=Y,ke=ce,ut=0;ut<X;ut++){var Re=$[he+ut],ze=ee[he+ut],_t=$[he+ut+X],Ct=ee[he+ut+X],$t=Ie*_t-ke*Ct;Ct=Ie*Ct+ke*_t,_t=$t,$[he+ut]=Re+_t,ee[he+ut]=ze+Ct,$[he+ut+X]=Re-_t,ee[he+ut+X]=ze-Ct,ut!==de&&($t=Y*Ie-ce*ke,ke=Y*ke+ce*Ie,Ie=$t)}},Q.prototype.guessLen13b=function(U,j){var $=Math.max(j,U)|1,ee=$&1,J=0;for($=$/2|0;$;$=$>>>1)J++;return 1<<J+1+ee},Q.prototype.conjugate=function(U,j,$){if(!($<=1))for(var ee=0;ee<$/2;ee++){var J=U[ee];U[ee]=U[$-ee-1],U[$-ee-1]=J,J=j[ee],j[ee]=-j[$-ee-1],j[$-ee-1]=-J}},Q.prototype.normalize13b=function(U,j){for(var $=0,ee=0;ee<j/2;ee++){var J=Math.round(U[2*ee+1]/j)*8192+Math.round(U[2*ee]/j)+$;U[ee]=J&67108863,J<67108864?$=0:$=J/67108864|0}return U},Q.prototype.convert13b=function(U,j,$,ee){for(var J=0,F=0;F<j;F++)J=J+(U[F]|0),$[2*F]=J&8191,J=J>>>13,$[2*F+1]=J&8191,J=J>>>13;for(F=2*j;F<ee;++F)$[F]=0;C(J===0),C((J&-8192)===0)},Q.prototype.stub=function(U){for(var j=new Array(U),$=0;$<U;$++)j[$]=0;return j},Q.prototype.mulp=function(U,j,$){var ee=2*this.guessLen13b(U.length,j.length),J=this.makeRBT(ee),F=this.stub(ee),X=new Array(ee),de=new Array(ee),Y=new Array(ee),ce=new Array(ee),he=new Array(ee),Ie=new Array(ee),ke=$.words;ke.length=ee,this.convert13b(U.words,U.length,X,ee),this.convert13b(j.words,j.length,ce,ee),this.transform(X,F,de,Y,ee,J),this.transform(ce,F,he,Ie,ee,J);for(var ut=0;ut<ee;ut++){var Re=de[ut]*he[ut]-Y[ut]*Ie[ut];Y[ut]=de[ut]*Ie[ut]+Y[ut]*he[ut],de[ut]=Re}return this.conjugate(de,Y,ee),this.transform(de,Y,ke,F,ee,J),this.conjugate(ke,F,ee),this.normalize13b(ke,ee),$.negative=U.negative^j.negative,$.length=U.length+j.length,$._strip()},m.prototype.mul=function(U){var j=new m(null);return j.words=new Array(this.length+U.length),this.mulTo(U,j)},m.prototype.mulf=function(U){var j=new m(null);return j.words=new Array(this.length+U.length),Z(this,U,j)},m.prototype.imul=function(U){return this.clone().mulTo(U,this)},m.prototype.imuln=function(U){var j=U<0;j&&(U=-U),C(typeof U=="number"),C(U<67108864);for(var $=0,ee=0;ee<this.length;ee++){var J=(this.words[ee]|0)*U,F=(J&67108863)+($&67108863);$>>=26,$+=J/67108864|0,$+=F>>>26,this.words[ee]=F&67108863}return $!==0&&(this.words[ee]=$,this.length++),j?this.ineg():this},m.prototype.muln=function(U){return this.clone().imuln(U)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(U){var j=D(U);if(j.length===0)return new m(1);for(var $=this,ee=0;ee<j.length&&j[ee]===0;ee++,$=$.sqr());if(++ee<j.length)for(var J=$.sqr();ee<j.length;ee++,J=J.sqr())j[ee]!==0&&($=$.mul(J));return $},m.prototype.iushln=function(U){C(typeof U=="number"&&U>=0);var j=U%26,$=(U-j)/26,ee=67108863>>>26-j<<26-j,J;if(j!==0){var F=0;for(J=0;J<this.length;J++){var X=this.words[J]&ee,de=(this.words[J]|0)-X<<j;this.words[J]=de|F,F=X>>>26-j}F&&(this.words[J]=F,this.length++)}if($!==0){for(J=this.length-1;J>=0;J--)this.words[J+$]=this.words[J];for(J=0;J<$;J++)this.words[J]=0;this.length+=$}return this._strip()},m.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},m.prototype.iushrn=function(U,j,$){C(typeof U=="number"&&U>=0);var ee;j?ee=(j-j%26)/26:ee=0;var J=U%26,F=Math.min((U-J)/26,this.length),X=67108863^67108863>>>J<<J,de=$;if(ee-=F,ee=Math.max(0,ee),de){for(var Y=0;Y<F;Y++)de.words[Y]=this.words[Y];de.length=F}if(F!==0)if(this.length>F)for(this.length-=F,Y=0;Y<this.length;Y++)this.words[Y]=this.words[Y+F];else this.words[0]=0,this.length=1;var ce=0;for(Y=this.length-1;Y>=0&&(ce!==0||Y>=ee);Y--){var he=this.words[Y]|0;this.words[Y]=ce<<26-J|he>>>J,ce=he&X}return de&&ce!==0&&(de.words[de.length++]=ce),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},m.prototype.ishrn=function(U,j,$){return C(this.negative===0),this.iushrn(U,j,$)},m.prototype.shln=function(U){return this.clone().ishln(U)},m.prototype.ushln=function(U){return this.clone().iushln(U)},m.prototype.shrn=function(U){return this.clone().ishrn(U)},m.prototype.ushrn=function(U){return this.clone().iushrn(U)},m.prototype.testn=function(U){C(typeof U=="number"&&U>=0);var j=U%26,$=(U-j)/26,ee=1<<j;if(this.length<=$)return!1;var J=this.words[$];return!!(J&ee)},m.prototype.imaskn=function(U){C(typeof U=="number"&&U>=0);var j=U%26,$=(U-j)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(j!==0&&$++,this.length=Math.min($,this.length),j!==0){var ee=67108863^67108863>>>j<<j;this.words[this.length-1]&=ee}return this._strip()},m.prototype.maskn=function(U){return this.clone().imaskn(U)},m.prototype.iaddn=function(U){return C(typeof U=="number"),C(U<67108864),U<0?this.isubn(-U):this.negative!==0?this.length===1&&(this.words[0]|0)<=U?(this.words[0]=U-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(U),this.negative=1,this):this._iaddn(U)},m.prototype._iaddn=function(U){this.words[0]+=U;for(var j=0;j<this.length&&this.words[j]>=67108864;j++)this.words[j]-=67108864,j===this.length-1?this.words[j+1]=1:this.words[j+1]++;return this.length=Math.max(this.length,j+1),this},m.prototype.isubn=function(U){if(C(typeof U=="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var j=0;j<this.length&&this.words[j]<0;j++)this.words[j]+=67108864,this.words[j+1]-=1;return this._strip()},m.prototype.addn=function(U){return this.clone().iaddn(U)},m.prototype.subn=function(U){return this.clone().isubn(U)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(U,j,$){var ee=U.length+$,J;this._expand(ee);var F,X=0;for(J=0;J<U.length;J++){F=(this.words[J+$]|0)+X;var de=(U.words[J]|0)*j;F-=de&67108863,X=(F>>26)-(de/67108864|0),this.words[J+$]=F&67108863}for(;J<this.length-$;J++)F=(this.words[J+$]|0)+X,X=F>>26,this.words[J+$]=F&67108863;if(X===0)return this._strip();for(C(X===-1),X=0,J=0;J<this.length;J++)F=-(this.words[J]|0)+X,X=F>>26,this.words[J]=F&67108863;return this.negative=1,this._strip()},m.prototype._wordDiv=function(U,j){var $=this.length-U.length,ee=this.clone(),J=U,F=J.words[J.length-1]|0,X=this._countBits(F);$=26-X,$!==0&&(J=J.ushln($),ee.iushln($),F=J.words[J.length-1]|0);var de=ee.length-J.length,Y;if(j!=="mod"){Y=new m(null),Y.length=de+1,Y.words=new Array(Y.length);for(var ce=0;ce<Y.length;ce++)Y.words[ce]=0}var he=ee.clone()._ishlnsubmul(J,1,de);he.negative===0&&(ee=he,Y&&(Y.words[de]=1));for(var Ie=de-1;Ie>=0;Ie--){var ke=(ee.words[J.length+Ie]|0)*67108864+(ee.words[J.length+Ie-1]|0);for(ke=Math.min(ke/F|0,67108863),ee._ishlnsubmul(J,ke,Ie);ee.negative!==0;)ke--,ee.negative=0,ee._ishlnsubmul(J,1,Ie),ee.isZero()||(ee.negative^=1);Y&&(Y.words[Ie]=ke)}return Y&&Y._strip(),ee._strip(),j!=="div"&&$!==0&&ee.iushrn($),{div:Y||null,mod:ee}},m.prototype.divmod=function(U,j,$){if(C(!U.isZero()),this.isZero())return{div:new m(0),mod:new m(0)};var ee,J,F;return this.negative!==0&&U.negative===0?(F=this.neg().divmod(U,j),j!=="mod"&&(ee=F.div.neg()),j!=="div"&&(J=F.mod.neg(),$&&J.negative!==0&&J.iadd(U)),{div:ee,mod:J}):this.negative===0&&U.negative!==0?(F=this.divmod(U.neg(),j),j!=="mod"&&(ee=F.div.neg()),{div:ee,mod:F.mod}):this.negative&U.negative?(F=this.neg().divmod(U.neg(),j),j!=="div"&&(J=F.mod.neg(),$&&J.negative!==0&&J.isub(U)),{div:F.div,mod:J}):U.length>this.length||this.cmp(U)<0?{div:new m(0),mod:this}:U.length===1?j==="div"?{div:this.divn(U.words[0]),mod:null}:j==="mod"?{div:null,mod:new m(this.modrn(U.words[0]))}:{div:this.divn(U.words[0]),mod:new m(this.modrn(U.words[0]))}:this._wordDiv(U,j)},m.prototype.div=function(U){return this.divmod(U,"div",!1).div},m.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},m.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},m.prototype.divRound=function(U){var j=this.divmod(U);if(j.mod.isZero())return j.div;var $=j.div.negative!==0?j.mod.isub(U):j.mod,ee=U.ushrn(1),J=U.andln(1),F=$.cmp(ee);return F<0||J===1&&F===0?j.div:j.div.negative!==0?j.div.isubn(1):j.div.iaddn(1)},m.prototype.modrn=function(U){var j=U<0;j&&(U=-U),C(U<=67108863);for(var $=(1<<26)%U,ee=0,J=this.length-1;J>=0;J--)ee=($*ee+(this.words[J]|0))%U;return j?-ee:ee},m.prototype.modn=function(U){return this.modrn(U)},m.prototype.idivn=function(U){var j=U<0;j&&(U=-U),C(U<=67108863);for(var $=0,ee=this.length-1;ee>=0;ee--){var J=(this.words[ee]|0)+$*67108864;this.words[ee]=J/U|0,$=J%U}return this._strip(),j?this.ineg():this},m.prototype.divn=function(U){return this.clone().idivn(U)},m.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var j=this,$=U.clone();j.negative!==0?j=j.umod(U):j=j.clone();for(var ee=new m(1),J=new m(0),F=new m(0),X=new m(1),de=0;j.isEven()&&$.isEven();)j.iushrn(1),$.iushrn(1),++de;for(var Y=$.clone(),ce=j.clone();!j.isZero();){for(var he=0,Ie=1;!(j.words[0]&Ie)&&he<26;++he,Ie<<=1);if(he>0)for(j.iushrn(he);he-- >0;)(ee.isOdd()||J.isOdd())&&(ee.iadd(Y),J.isub(ce)),ee.iushrn(1),J.iushrn(1);for(var ke=0,ut=1;!($.words[0]&ut)&&ke<26;++ke,ut<<=1);if(ke>0)for($.iushrn(ke);ke-- >0;)(F.isOdd()||X.isOdd())&&(F.iadd(Y),X.isub(ce)),F.iushrn(1),X.iushrn(1);j.cmp($)>=0?(j.isub($),ee.isub(F),J.isub(X)):($.isub(j),F.isub(ee),X.isub(J))}return{a:F,b:X,gcd:$.iushln(de)}},m.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var j=this,$=U.clone();j.negative!==0?j=j.umod(U):j=j.clone();for(var ee=new m(1),J=new m(0),F=$.clone();j.cmpn(1)>0&&$.cmpn(1)>0;){for(var X=0,de=1;!(j.words[0]&de)&&X<26;++X,de<<=1);if(X>0)for(j.iushrn(X);X-- >0;)ee.isOdd()&&ee.iadd(F),ee.iushrn(1);for(var Y=0,ce=1;!($.words[0]&ce)&&Y<26;++Y,ce<<=1);if(Y>0)for($.iushrn(Y);Y-- >0;)J.isOdd()&&J.iadd(F),J.iushrn(1);j.cmp($)>=0?(j.isub($),ee.isub(J)):($.isub(j),J.isub(ee))}var he;return j.cmpn(1)===0?he=ee:he=J,he.cmpn(0)<0&&he.iadd(U),he},m.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var j=this.clone(),$=U.clone();j.negative=0,$.negative=0;for(var ee=0;j.isEven()&&$.isEven();ee++)j.iushrn(1),$.iushrn(1);do{for(;j.isEven();)j.iushrn(1);for(;$.isEven();)$.iushrn(1);var J=j.cmp($);if(J<0){var F=j;j=$,$=F}else if(J===0||$.cmpn(1)===0)break;j.isub($)}while(!0);return $.iushln(ee)},m.prototype.invm=function(U){return this.egcd(U).a.umod(U)},m.prototype.isEven=function(){return(this.words[0]&1)===0},m.prototype.isOdd=function(){return(this.words[0]&1)===1},m.prototype.andln=function(U){return this.words[0]&U},m.prototype.bincn=function(U){C(typeof U=="number");var j=U%26,$=(U-j)/26,ee=1<<j;if(this.length<=$)return this._expand($+1),this.words[$]|=ee,this;for(var J=ee,F=$;J!==0&&F<this.length;F++){var X=this.words[F]|0;X+=J,J=X>>>26,X&=67108863,this.words[F]=X}return J!==0&&(this.words[F]=J,this.length++),this},m.prototype.isZero=function(){return this.length===1&&this.words[0]===0},m.prototype.cmpn=function(U){var j=U<0;if(this.negative!==0&&!j)return-1;if(this.negative===0&&j)return 1;this._strip();var $;if(this.length>1)$=1;else{j&&(U=-U),C(U<=67108863,"Number is too big");var ee=this.words[0]|0;$=ee===U?0:ee<U?-1:1}return this.negative!==0?-$|0:$},m.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var j=this.ucmp(U);return this.negative!==0?-j|0:j},m.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;for(var j=0,$=this.length-1;$>=0;$--){var ee=this.words[$]|0,J=U.words[$]|0;if(ee!==J){ee<J?j=-1:ee>J&&(j=1);break}}return j},m.prototype.gtn=function(U){return this.cmpn(U)===1},m.prototype.gt=function(U){return this.cmp(U)===1},m.prototype.gten=function(U){return this.cmpn(U)>=0},m.prototype.gte=function(U){return this.cmp(U)>=0},m.prototype.ltn=function(U){return this.cmpn(U)===-1},m.prototype.lt=function(U){return this.cmp(U)===-1},m.prototype.lten=function(U){return this.cmpn(U)<=0},m.prototype.lte=function(U){return this.cmp(U)<=0},m.prototype.eqn=function(U){return this.cmpn(U)===0},m.prototype.eq=function(U){return this.cmp(U)===0},m.red=function(U){return new N(U)},m.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},m.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(U){return this.red=U,this},m.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},m.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},m.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},m.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},m.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},m.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},m.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},m.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},m.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var ie={k256:null,p224:null,p192:null,p25519:null};function le(V,U){this.name=V,this.p=new m(U,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}le.prototype._tmp=function(){var U=new m(null);return U.words=new Array(Math.ceil(this.n/13)),U},le.prototype.ireduce=function(U){var j=U,$;do this.split(j,this.tmp),j=this.imulK(j),j=j.iadd(this.tmp),$=j.bitLength();while($>this.n);var ee=$<this.n?-1:j.ucmp(this.p);return ee===0?(j.words[0]=0,j.length=1):ee>0?j.isub(this.p):j.strip!==void 0?j.strip():j._strip(),j},le.prototype.split=function(U,j){U.iushrn(this.n,0,j)},le.prototype.imulK=function(U){return U.imul(this.k)};function be(){le.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}I(be,le),be.prototype.split=function(U,j){for(var $=4194303,ee=Math.min(U.length,9),J=0;J<ee;J++)j.words[J]=U.words[J];if(j.length=ee,U.length<=9){U.words[0]=0,U.length=1;return}var F=U.words[9];for(j.words[j.length++]=F&$,J=10;J<U.length;J++){var X=U.words[J]|0;U.words[J-10]=(X&$)<<4|F>>>22,F=X}F>>>=22,U.words[J-10]=F,F===0&&U.length>10?U.length-=10:U.length-=9},be.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;for(var j=0,$=0;$<U.length;$++){var ee=U.words[$]|0;j+=ee*977,U.words[$]=j&67108863,j=ee*64+(j/67108864|0)}return U.words[U.length-1]===0&&(U.length--,U.words[U.length-1]===0&&U.length--),U};function we(){le.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}I(we,le);function Ae(){le.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}I(Ae,le);function re(){le.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}I(re,le),re.prototype.imulK=function(U){for(var j=0,$=0;$<U.length;$++){var ee=(U.words[$]|0)*19+j,J=ee&67108863;ee>>>=26,U.words[$]=J,j=ee}return j!==0&&(U.words[U.length++]=j),U},m._prime=function(U){if(ie[U])return ie[U];var j;if(U==="k256")j=new be;else if(U==="p224")j=new we;else if(U==="p192")j=new Ae;else if(U==="p25519")j=new re;else throw new Error("Unknown prime "+U);return ie[U]=j,j};function N(V){if(typeof V=="string"){var U=m._prime(V);this.m=U.p,this.prime=U}else C(V.gtn(1),"modulus must be greater than 1"),this.m=V,this.prime=null}N.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},N.prototype._verify2=function(U,j){C((U.negative|j.negative)===0,"red works only with positives"),C(U.red&&U.red===j.red,"red works only with red numbers")},N.prototype.imod=function(U){return this.prime?this.prime.ireduce(U)._forceRed(this):(A(U,U.umod(this.m)._forceRed(this)),U)},N.prototype.neg=function(U){return U.isZero()?U.clone():this.m.sub(U)._forceRed(this)},N.prototype.add=function(U,j){this._verify2(U,j);var $=U.add(j);return $.cmp(this.m)>=0&&$.isub(this.m),$._forceRed(this)},N.prototype.iadd=function(U,j){this._verify2(U,j);var $=U.iadd(j);return $.cmp(this.m)>=0&&$.isub(this.m),$},N.prototype.sub=function(U,j){this._verify2(U,j);var $=U.sub(j);return $.cmpn(0)<0&&$.iadd(this.m),$._forceRed(this)},N.prototype.isub=function(U,j){this._verify2(U,j);var $=U.isub(j);return $.cmpn(0)<0&&$.iadd(this.m),$},N.prototype.shl=function(U,j){return this._verify1(U),this.imod(U.ushln(j))},N.prototype.imul=function(U,j){return this._verify2(U,j),this.imod(U.imul(j))},N.prototype.mul=function(U,j){return this._verify2(U,j),this.imod(U.mul(j))},N.prototype.isqr=function(U){return this.imul(U,U.clone())},N.prototype.sqr=function(U){return this.mul(U,U)},N.prototype.sqrt=function(U){if(U.isZero())return U.clone();var j=this.m.andln(3);if(C(j%2===1),j===3){var $=this.m.add(new m(1)).iushrn(2);return this.pow(U,$)}for(var ee=this.m.subn(1),J=0;!ee.isZero()&&ee.andln(1)===0;)J++,ee.iushrn(1);C(!ee.isZero());var F=new m(1).toRed(this),X=F.redNeg(),de=this.m.subn(1).iushrn(1),Y=this.m.bitLength();for(Y=new m(2*Y*Y).toRed(this);this.pow(Y,de).cmp(X)!==0;)Y.redIAdd(X);for(var ce=this.pow(Y,ee),he=this.pow(U,ee.addn(1).iushrn(1)),Ie=this.pow(U,ee),ke=J;Ie.cmp(F)!==0;){for(var ut=Ie,Re=0;ut.cmp(F)!==0;Re++)ut=ut.redSqr();C(Re<ke);var ze=this.pow(ce,new m(1).iushln(ke-Re-1));he=he.redMul(ze),ce=ze.redSqr(),Ie=Ie.redMul(ce),ke=Re}return he},N.prototype.invm=function(U){var j=U._invmp(this.m);return j.negative!==0?(j.negative=0,this.imod(j).redNeg()):this.imod(j)},N.prototype.pow=function(U,j){if(j.isZero())return new m(1).toRed(this);if(j.cmpn(1)===0)return U.clone();var $=4,ee=new Array(1<<$);ee[0]=new m(1).toRed(this),ee[1]=U;for(var J=2;J<ee.length;J++)ee[J]=this.mul(ee[J-1],U);var F=ee[0],X=0,de=0,Y=j.bitLength()%26;for(Y===0&&(Y=26),J=j.length-1;J>=0;J--){for(var ce=j.words[J],he=Y-1;he>=0;he--){var Ie=ce>>he&1;if(F!==ee[0]&&(F=this.sqr(F)),Ie===0&&X===0){de=0;continue}X<<=1,X|=Ie,de++,!(de!==$&&(J!==0||he!==0))&&(F=this.mul(F,ee[X]),de=0,X=0)}Y=26}return F},N.prototype.convertTo=function(U){var j=U.umod(this.m);return j===U?j.clone():j},N.prototype.convertFrom=function(U){var j=U.clone();return j.red=null,j},m.mont=function(U){return new z(U)};function z(V){N.call(this,V),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new m(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(z,N),z.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},z.prototype.convertFrom=function(U){var j=this.imod(U.mul(this.rinv));return j.red=null,j},z.prototype.imul=function(U,j){if(U.isZero()||j.isZero())return U.words[0]=0,U.length=1,U;var $=U.imul(j),ee=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),J=$.isub(ee).iushrn(this.shift),F=J;return J.cmp(this.m)>=0?F=J.isub(this.m):J.cmpn(0)<0&&(F=J.iadd(this.m)),F._forceRed(this)},z.prototype.mul=function(U,j){if(U.isZero()||j.isZero())return new m(0)._forceRed(this);var $=U.mul(j),ee=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),J=$.isub(ee).iushrn(this.shift),F=J;return J.cmp(this.m)>=0?F=J.isub(this.m):J.cmpn(0)<0&&(F=J.iadd(this.m)),F._forceRed(this)},z.prototype.invm=function(U){var j=this.imod(U._invmp(this.m).mul(this.r2));return j._forceRed(this)}}(fe,this)},59229:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__createBinding||(Object.create?function(re,N,z,V){V===void 0&&(V=z),Object.defineProperty(re,V,{enumerable:!0,get:function(){return N[z]}})}:function(re,N,z,V){V===void 0&&(V=z),re[V]=N[z]}),C=this&&this.__setModuleDefault||(Object.create?function(re,N){Object.defineProperty(re,"default",{enumerable:!0,value:N})}:function(re,N){re.default=N}),I=this&&this.__decorate||function(re,N,z,V){var U=arguments.length,j=U<3?N:V===null?V=Object.getOwnPropertyDescriptor(N,z):V,$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(re,N,z,V);else for(var ee=re.length-1;ee>=0;ee--)($=re[ee])&&(j=(U<3?$(j):U>3?$(N,z,j):$(N,z))||j);return U>3&&j&&Object.defineProperty(N,z,j),j},m=this&&this.__importStar||function(re){if(re&&re.__esModule)return re;var N={};if(re!=null)for(var z in re)z!=="default"&&Object.hasOwnProperty.call(re,z)&&T(N,re,z);return C(N,re),N},b=this&&this.__importDefault||function(re){return re&&re.__esModule?re:{default:re}};Object.defineProperty(p,"__esModule",{value:!0}),p.deserializeUnchecked=p.deserialize=p.serialize=p.BinaryReader=p.BinaryWriter=p.BorshError=p.baseDecode=p.baseEncode=void 0;const g=b(x(83900)),w=b(x(22265)),_=m(x(69637)),A=typeof TextDecoder!="function"?_.TextDecoder:TextDecoder,S=new A("utf-8",{fatal:!0});function k(re){return typeof re=="string"&&(re=v.from(re,"utf8")),w.default.encode(v.from(re))}p.baseEncode=k;function B(re){return v.from(w.default.decode(re))}p.baseDecode=B;const O=1024;class L extends Error{constructor(N){super(N),this.fieldPath=[],this.originalMessage=N}addToFieldPath(N){this.fieldPath.splice(0,0,N),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}p.BorshError=L;class D{constructor(){this.buf=v.alloc(O),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=v.concat([this.buf,v.alloc(O)]))}writeU8(N){this.maybeResize(),this.buf.writeUInt8(N,this.length),this.length+=1}writeU16(N){this.maybeResize(),this.buf.writeUInt16LE(N,this.length),this.length+=2}writeU32(N){this.maybeResize(),this.buf.writeUInt32LE(N,this.length),this.length+=4}writeU64(N){this.maybeResize(),this.writeBuffer(v.from(new g.default(N).toArray("le",8)))}writeU128(N){this.maybeResize(),this.writeBuffer(v.from(new g.default(N).toArray("le",16)))}writeU256(N){this.maybeResize(),this.writeBuffer(v.from(new g.default(N).toArray("le",32)))}writeU512(N){this.maybeResize(),this.writeBuffer(v.from(new g.default(N).toArray("le",64)))}writeBuffer(N){this.buf=v.concat([v.from(this.buf.subarray(0,this.length)),N,v.alloc(O)]),this.length+=N.length}writeString(N){this.maybeResize();const z=v.from(N,"utf8");this.writeU32(z.length),this.writeBuffer(z)}writeFixedArray(N){this.writeBuffer(v.from(N))}writeArray(N,z){this.maybeResize(),this.writeU32(N.length);for(const V of N)this.maybeResize(),z(V)}toArray(){return this.buf.subarray(0,this.length)}}p.BinaryWriter=D;function W(re,N,z){const V=z.value;z.value=function(...U){try{return V.apply(this,U)}catch(j){if(j instanceof RangeError){const $=j.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf($)>=0)throw new L("Reached the end of buffer when deserializing")}throw j}}}class H{constructor(N){this.buf=N,this.offset=0}readU8(){const N=this.buf.readUInt8(this.offset);return this.offset+=1,N}readU16(){const N=this.buf.readUInt16LE(this.offset);return this.offset+=2,N}readU32(){const N=this.buf.readUInt32LE(this.offset);return this.offset+=4,N}readU64(){const N=this.readBuffer(8);return new g.default(N,"le")}readU128(){const N=this.readBuffer(16);return new g.default(N,"le")}readU256(){const N=this.readBuffer(32);return new g.default(N,"le")}readU512(){const N=this.readBuffer(64);return new g.default(N,"le")}readBuffer(N){if(this.offset+N>this.buf.length)throw new L(`Expected buffer length ${N} isn't within bounds`);const z=this.buf.slice(this.offset,this.offset+N);return this.offset+=N,z}readString(){const N=this.readU32(),z=this.readBuffer(N);try{return S.decode(z)}catch(V){throw new L(`Error decoding UTF-8 string: ${V}`)}}readFixedArray(N){return new Uint8Array(this.readBuffer(N))}readArray(N){const z=this.readU32(),V=Array();for(let U=0;U<z;++U)V.push(N());return V}}I([W],H.prototype,"readU8",null),I([W],H.prototype,"readU16",null),I([W],H.prototype,"readU32",null),I([W],H.prototype,"readU64",null),I([W],H.prototype,"readU128",null),I([W],H.prototype,"readU256",null),I([W],H.prototype,"readU512",null),I([W],H.prototype,"readString",null),I([W],H.prototype,"readFixedArray",null),I([W],H.prototype,"readArray",null),p.BinaryReader=H;function G(re){return re.charAt(0).toUpperCase()+re.slice(1)}function Z(re,N,z,V,U){try{if(typeof V=="string")U[`write${G(V)}`](z);else if(V instanceof Array)if(typeof V[0]=="number"){if(z.length!==V[0])throw new L(`Expecting byte array of length ${V[0]}, but got ${z.length} bytes`);U.writeFixedArray(z)}else if(V.length===2&&typeof V[1]=="number"){if(z.length!==V[1])throw new L(`Expecting byte array of length ${V[1]}, but got ${z.length} bytes`);for(let j=0;j<V[1];j++)Z(re,null,z[j],V[0],U)}else U.writeArray(z,j=>{Z(re,N,j,V[0],U)});else if(V.kind!==void 0)switch(V.kind){case"option":{z==null?U.writeU8(0):(U.writeU8(1),Z(re,N,z,V.type,U));break}case"map":{U.writeU32(z.size),z.forEach((j,$)=>{Z(re,N,$,V.key,U),Z(re,N,j,V.value,U)});break}default:throw new L(`FieldType ${V} unrecognized`)}else Q(re,z,U)}catch(j){throw j instanceof L&&j.addToFieldPath(N),j}}function Q(re,N,z){if(typeof N.borshSerialize=="function"){N.borshSerialize(z);return}const V=re.get(N.constructor);if(!V)throw new L(`Class ${N.constructor.name} is missing in schema`);if(V.kind==="struct")V.fields.map(([U,j])=>{Z(re,U,N[U],j,z)});else if(V.kind==="enum"){const U=N[V.field];for(let j=0;j<V.values.length;++j){const[$,ee]=V.values[j];if($===U){z.writeU8(j),Z(re,$,N[$],ee,z);break}}}else throw new L(`Unexpected schema kind: ${V.kind} for ${N.constructor.name}`)}function ie(re,N,z=D){const V=new z;return Q(re,N,V),V.toArray()}p.serialize=ie;function le(re,N,z,V){try{if(typeof z=="string")return V[`read${G(z)}`]();if(z instanceof Array){if(typeof z[0]=="number")return V.readFixedArray(z[0]);if(typeof z[1]=="number"){const U=[];for(let j=0;j<z[1];j++)U.push(le(re,null,z[0],V));return U}else return V.readArray(()=>le(re,N,z[0],V))}if(z.kind==="option")return V.readU8()?le(re,N,z.type,V):void 0;if(z.kind==="map"){let U=new Map;const j=V.readU32();for(let $=0;$<j;$++){const ee=le(re,N,z.key,V),J=le(re,N,z.value,V);U.set(ee,J)}return U}return be(re,z,V)}catch(U){throw U instanceof L&&U.addToFieldPath(N),U}}function be(re,N,z){if(typeof N.borshDeserialize=="function")return N.borshDeserialize(z);const V=re.get(N);if(!V)throw new L(`Class ${N.name} is missing in schema`);if(V.kind==="struct"){const U={};for(const[j,$]of re.get(N).fields)U[j]=le(re,j,$,z);return new N(U)}if(V.kind==="enum"){const U=z.readU8();if(U>=V.values.length)throw new L(`Enum index: ${U} is out of range`);const[j,$]=V.values[U],ee=le(re,j,$,z);return new N({[j]:ee})}throw new L(`Unexpected schema kind: ${V.kind} for ${N.constructor.name}`)}function we(re,N,z,V=H){const U=new V(z),j=be(re,N,U);if(U.offset<z.length)throw new L(`Unexpected ${z.length-U.offset} bytes after deserialized data`);return j}p.deserialize=we;function Ae(re,N,z,V=H){const U=new V(z);return be(re,N,U)}p.deserializeUnchecked=Ae},65442:function(fe,p,x){var v;fe.exports=function(m){return v||(v=new T(null)),v.generate(m)};function T(I){this.rand=I}if(fe.exports.Rand=T,T.prototype.generate=function(m){return this._rand(m)},T.prototype._rand=function(m){if(this.rand.getBytes)return this.rand.getBytes(m);for(var b=new Uint8Array(m),g=0;g<b.length;g++)b[g]=this.rand.getByte();return b},typeof self=="object")self.crypto&&self.crypto.getRandomValues?T.prototype._rand=function(m){var b=new Uint8Array(m);return self.crypto.getRandomValues(b),b}:self.msCrypto&&self.msCrypto.getRandomValues?T.prototype._rand=function(m){var b=new Uint8Array(m);return self.msCrypto.getRandomValues(b),b}:T.prototype._rand=function(){throw new Error("Not implemented yet")};else try{var C=x(26138);if(typeof C.randomBytes!="function")throw new Error("Not supported");T.prototype._rand=function(m){return C.randomBytes(m)}}catch{}},22265:function(fe,p,x){var v=x(29622),T="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";fe.exports=v(T)},70329:function(fe,p,x){const v=x(51219),T="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";fe.exports=v(T)},83330:function(fe,p,x){"use strict";var v=x(22265),T=x(56608).Buffer;fe.exports=function(C){function I(w){var _=C(w);return v.encode(T.concat([w,_],w.length+4))}function m(w){var _=w.slice(0,-4),A=w.slice(-4),S=C(_);if(!(A[0]^S[0]|A[1]^S[1]|A[2]^S[2]|A[3]^S[3]))return _}function b(w){var _=v.decodeUnsafe(w);if(_)return m(_)}function g(w){var _=v.decode(w),A=m(_,C);if(!A)throw new Error("Invalid checksum");return A}return{encode:I,decode:g,decodeUnsafe:b}}},83295:function(fe,p,x){"use strict";var v=x(18955),T=x(83330);function C(I){var m=v("sha256").update(I).digest();return v("sha256").update(m).digest()}fe.exports=T(C)},99491:function(fe,p,x){"use strict";var v=x(70329);fe.exports=function(T){function C(g){var w=Uint8Array.from(g),_=T(w),A=w.length+4,S=new Uint8Array(A);return S.set(w,0),S.set(_.subarray(0,4),w.length),v.encode(S,A)}function I(g){var w=g.slice(0,-4),_=g.slice(-4),A=T(w);if(!(_[0]^A[0]|_[1]^A[1]|_[2]^A[2]|_[3]^A[3]))return w}function m(g){var w=v.decodeUnsafe(g);if(w)return I(w)}function b(g){var w=v.decode(g),_=I(w,T);if(!_)throw new Error("Invalid checksum");return _}return{encode:C,decode:b,decodeUnsafe:m}}},65916:function(fe,p,x){"use strict";var{sha256:v}=x(23741),T=x(99491);function C(I){return v(v(I))}fe.exports=T(C)},36533:function(fe,p,x){"use strict";/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <https://feross.org>
|
||
* @license MIT
|
||
*/const v=x(84933),T=x(63328),C=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;p.Buffer=g,p.SlowBuffer=H,p.INSPECT_MAX_BYTES=50;const I=2147483647;p.kMaxLength=I,g.TYPED_ARRAY_SUPPORT=m(),!g.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function m(){try{const se=new Uint8Array(1),oe={foo:function(){return 42}};return Object.setPrototypeOf(oe,Uint8Array.prototype),Object.setPrototypeOf(se,oe),se.foo()===42}catch{return!1}}Object.defineProperty(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}}),Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}});function b(se){if(se>I)throw new RangeError('The value "'+se+'" is invalid for option "size"');const oe=new Uint8Array(se);return Object.setPrototypeOf(oe,g.prototype),oe}function g(se,oe,ye){if(typeof se=="number"){if(typeof oe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(se)}return w(se,oe,ye)}g.poolSize=8192;function w(se,oe,ye){if(typeof se=="string")return k(se,oe);if(ArrayBuffer.isView(se))return O(se);if(se==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se);if(tt(se,ArrayBuffer)||se&&tt(se.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(tt(se,SharedArrayBuffer)||se&&tt(se.buffer,SharedArrayBuffer)))return L(se,oe,ye);if(typeof se=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Ee=se.valueOf&&se.valueOf();if(Ee!=null&&Ee!==se)return g.from(Ee,oe,ye);const me=D(se);if(me)return me;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof se[Symbol.toPrimitive]=="function")return g.from(se[Symbol.toPrimitive]("string"),oe,ye);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se)}g.from=function(se,oe,ye){return w(se,oe,ye)},Object.setPrototypeOf(g.prototype,Uint8Array.prototype),Object.setPrototypeOf(g,Uint8Array);function _(se){if(typeof se!="number")throw new TypeError('"size" argument must be of type number');if(se<0)throw new RangeError('The value "'+se+'" is invalid for option "size"')}function A(se,oe,ye){return _(se),se<=0?b(se):oe!==void 0?typeof ye=="string"?b(se).fill(oe,ye):b(se).fill(oe):b(se)}g.alloc=function(se,oe,ye){return A(se,oe,ye)};function S(se){return _(se),b(se<0?0:W(se)|0)}g.allocUnsafe=function(se){return S(se)},g.allocUnsafeSlow=function(se){return S(se)};function k(se,oe){if((typeof oe!="string"||oe==="")&&(oe="utf8"),!g.isEncoding(oe))throw new TypeError("Unknown encoding: "+oe);const ye=G(se,oe)|0;let Ee=b(ye);const me=Ee.write(se,oe);return me!==ye&&(Ee=Ee.slice(0,me)),Ee}function B(se){const oe=se.length<0?0:W(se.length)|0,ye=b(oe);for(let Ee=0;Ee<oe;Ee+=1)ye[Ee]=se[Ee]&255;return ye}function O(se){if(tt(se,Uint8Array)){const oe=new Uint8Array(se);return L(oe.buffer,oe.byteOffset,oe.byteLength)}return B(se)}function L(se,oe,ye){if(oe<0||se.byteLength<oe)throw new RangeError('"offset" is outside of buffer bounds');if(se.byteLength<oe+(ye||0))throw new RangeError('"length" is outside of buffer bounds');let Ee;return oe===void 0&&ye===void 0?Ee=new Uint8Array(se):ye===void 0?Ee=new Uint8Array(se,oe):Ee=new Uint8Array(se,oe,ye),Object.setPrototypeOf(Ee,g.prototype),Ee}function D(se){if(g.isBuffer(se)){const oe=W(se.length)|0,ye=b(oe);return ye.length===0||se.copy(ye,0,0,oe),ye}if(se.length!==void 0)return typeof se.length!="number"||qe(se.length)?b(0):B(se);if(se.type==="Buffer"&&Array.isArray(se.data))return B(se.data)}function W(se){if(se>=I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");return se|0}function H(se){return+se!=se&&(se=0),g.alloc(+se)}g.isBuffer=function(oe){return oe!=null&&oe._isBuffer===!0&&oe!==g.prototype},g.compare=function(oe,ye){if(tt(oe,Uint8Array)&&(oe=g.from(oe,oe.offset,oe.byteLength)),tt(ye,Uint8Array)&&(ye=g.from(ye,ye.offset,ye.byteLength)),!g.isBuffer(oe)||!g.isBuffer(ye))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(oe===ye)return 0;let Ee=oe.length,me=ye.length;for(let Te=0,Oe=Math.min(Ee,me);Te<Oe;++Te)if(oe[Te]!==ye[Te]){Ee=oe[Te],me=ye[Te];break}return Ee<me?-1:me<Ee?1:0},g.isEncoding=function(oe){switch(String(oe).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},g.concat=function(oe,ye){if(!Array.isArray(oe))throw new TypeError('"list" argument must be an Array of Buffers');if(oe.length===0)return g.alloc(0);let Ee;if(ye===void 0)for(ye=0,Ee=0;Ee<oe.length;++Ee)ye+=oe[Ee].length;const me=g.allocUnsafe(ye);let Te=0;for(Ee=0;Ee<oe.length;++Ee){let Oe=oe[Ee];if(tt(Oe,Uint8Array))Te+Oe.length>me.length?(g.isBuffer(Oe)||(Oe=g.from(Oe)),Oe.copy(me,Te)):Uint8Array.prototype.set.call(me,Oe,Te);else if(g.isBuffer(Oe))Oe.copy(me,Te);else throw new TypeError('"list" argument must be an Array of Buffers');Te+=Oe.length}return me};function G(se,oe){if(g.isBuffer(se))return se.length;if(ArrayBuffer.isView(se)||tt(se,ArrayBuffer))return se.byteLength;if(typeof se!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof se);const ye=se.length,Ee=arguments.length>2&&arguments[2]===!0;if(!Ee&&ye===0)return 0;let me=!1;for(;;)switch(oe){case"ascii":case"latin1":case"binary":return ye;case"utf8":case"utf-8":return wt(se).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye*2;case"hex":return ye>>>1;case"base64":return zt(se).length;default:if(me)return Ee?-1:wt(se).length;oe=(""+oe).toLowerCase(),me=!0}}g.byteLength=G;function Z(se,oe,ye){let Ee=!1;if((oe===void 0||oe<0)&&(oe=0),oe>this.length||((ye===void 0||ye>this.length)&&(ye=this.length),ye<=0)||(ye>>>=0,oe>>>=0,ye<=oe))return"";for(se||(se="utf8");;)switch(se){case"hex":return J(this,oe,ye);case"utf8":case"utf-8":return V(this,oe,ye);case"ascii":return $(this,oe,ye);case"latin1":case"binary":return ee(this,oe,ye);case"base64":return z(this,oe,ye);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,oe,ye);default:if(Ee)throw new TypeError("Unknown encoding: "+se);se=(se+"").toLowerCase(),Ee=!0}}g.prototype._isBuffer=!0;function Q(se,oe,ye){const Ee=se[oe];se[oe]=se[ye],se[ye]=Ee}g.prototype.swap16=function(){const oe=this.length;if(oe%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ye=0;ye<oe;ye+=2)Q(this,ye,ye+1);return this},g.prototype.swap32=function(){const oe=this.length;if(oe%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let ye=0;ye<oe;ye+=4)Q(this,ye,ye+3),Q(this,ye+1,ye+2);return this},g.prototype.swap64=function(){const oe=this.length;if(oe%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let ye=0;ye<oe;ye+=8)Q(this,ye,ye+7),Q(this,ye+1,ye+6),Q(this,ye+2,ye+5),Q(this,ye+3,ye+4);return this},g.prototype.toString=function(){const oe=this.length;return oe===0?"":arguments.length===0?V(this,0,oe):Z.apply(this,arguments)},g.prototype.toLocaleString=g.prototype.toString,g.prototype.equals=function(oe){if(!g.isBuffer(oe))throw new TypeError("Argument must be a Buffer");return this===oe?!0:g.compare(this,oe)===0},g.prototype.inspect=function(){let oe="";const ye=p.INSPECT_MAX_BYTES;return oe=this.toString("hex",0,ye).replace(/(.{2})/g,"$1 ").trim(),this.length>ye&&(oe+=" ... "),"<Buffer "+oe+">"},C&&(g.prototype[C]=g.prototype.inspect),g.prototype.compare=function(oe,ye,Ee,me,Te){if(tt(oe,Uint8Array)&&(oe=g.from(oe,oe.offset,oe.byteLength)),!g.isBuffer(oe))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof oe);if(ye===void 0&&(ye=0),Ee===void 0&&(Ee=oe?oe.length:0),me===void 0&&(me=0),Te===void 0&&(Te=this.length),ye<0||Ee>oe.length||me<0||Te>this.length)throw new RangeError("out of range index");if(me>=Te&&ye>=Ee)return 0;if(me>=Te)return-1;if(ye>=Ee)return 1;if(ye>>>=0,Ee>>>=0,me>>>=0,Te>>>=0,this===oe)return 0;let Oe=Te-me,Qe=Ee-ye;const Vt=Math.min(Oe,Qe),vt=this.slice(me,Te),Zt=oe.slice(ye,Ee);for(let dn=0;dn<Vt;++dn)if(vt[dn]!==Zt[dn]){Oe=vt[dn],Qe=Zt[dn];break}return Oe<Qe?-1:Qe<Oe?1:0};function ie(se,oe,ye,Ee,me){if(se.length===0)return-1;if(typeof ye=="string"?(Ee=ye,ye=0):ye>2147483647?ye=2147483647:ye<-2147483648&&(ye=-2147483648),ye=+ye,qe(ye)&&(ye=me?0:se.length-1),ye<0&&(ye=se.length+ye),ye>=se.length){if(me)return-1;ye=se.length-1}else if(ye<0)if(me)ye=0;else return-1;if(typeof oe=="string"&&(oe=g.from(oe,Ee)),g.isBuffer(oe))return oe.length===0?-1:le(se,oe,ye,Ee,me);if(typeof oe=="number")return oe=oe&255,typeof Uint8Array.prototype.indexOf=="function"?me?Uint8Array.prototype.indexOf.call(se,oe,ye):Uint8Array.prototype.lastIndexOf.call(se,oe,ye):le(se,[oe],ye,Ee,me);throw new TypeError("val must be string, number or Buffer")}function le(se,oe,ye,Ee,me){let Te=1,Oe=se.length,Qe=oe.length;if(Ee!==void 0&&(Ee=String(Ee).toLowerCase(),Ee==="ucs2"||Ee==="ucs-2"||Ee==="utf16le"||Ee==="utf-16le")){if(se.length<2||oe.length<2)return-1;Te=2,Oe/=2,Qe/=2,ye/=2}function Vt(Zt,dn){return Te===1?Zt[dn]:Zt.readUInt16BE(dn*Te)}let vt;if(me){let Zt=-1;for(vt=ye;vt<Oe;vt++)if(Vt(se,vt)===Vt(oe,Zt===-1?0:vt-Zt)){if(Zt===-1&&(Zt=vt),vt-Zt+1===Qe)return Zt*Te}else Zt!==-1&&(vt-=vt-Zt),Zt=-1}else for(ye+Qe>Oe&&(ye=Oe-Qe),vt=ye;vt>=0;vt--){let Zt=!0;for(let dn=0;dn<Qe;dn++)if(Vt(se,vt+dn)!==Vt(oe,dn)){Zt=!1;break}if(Zt)return vt}return-1}g.prototype.includes=function(oe,ye,Ee){return this.indexOf(oe,ye,Ee)!==-1},g.prototype.indexOf=function(oe,ye,Ee){return ie(this,oe,ye,Ee,!0)},g.prototype.lastIndexOf=function(oe,ye,Ee){return ie(this,oe,ye,Ee,!1)};function be(se,oe,ye,Ee){ye=Number(ye)||0;const me=se.length-ye;Ee?(Ee=Number(Ee),Ee>me&&(Ee=me)):Ee=me;const Te=oe.length;Ee>Te/2&&(Ee=Te/2);let Oe;for(Oe=0;Oe<Ee;++Oe){const Qe=parseInt(oe.substr(Oe*2,2),16);if(qe(Qe))return Oe;se[ye+Oe]=Qe}return Oe}function we(se,oe,ye,Ee){return Ft(wt(oe,se.length-ye),se,ye,Ee)}function Ae(se,oe,ye,Ee){return Ft(Rt(oe),se,ye,Ee)}function re(se,oe,ye,Ee){return Ft(zt(oe),se,ye,Ee)}function N(se,oe,ye,Ee){return Ft(Ge(oe,se.length-ye),se,ye,Ee)}g.prototype.write=function(oe,ye,Ee,me){if(ye===void 0)me="utf8",Ee=this.length,ye=0;else if(Ee===void 0&&typeof ye=="string")me=ye,Ee=this.length,ye=0;else if(isFinite(ye))ye=ye>>>0,isFinite(Ee)?(Ee=Ee>>>0,me===void 0&&(me="utf8")):(me=Ee,Ee=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Te=this.length-ye;if((Ee===void 0||Ee>Te)&&(Ee=Te),oe.length>0&&(Ee<0||ye<0)||ye>this.length)throw new RangeError("Attempt to write outside buffer bounds");me||(me="utf8");let Oe=!1;for(;;)switch(me){case"hex":return be(this,oe,ye,Ee);case"utf8":case"utf-8":return we(this,oe,ye,Ee);case"ascii":case"latin1":case"binary":return Ae(this,oe,ye,Ee);case"base64":return re(this,oe,ye,Ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,oe,ye,Ee);default:if(Oe)throw new TypeError("Unknown encoding: "+me);me=(""+me).toLowerCase(),Oe=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function z(se,oe,ye){return oe===0&&ye===se.length?v.fromByteArray(se):v.fromByteArray(se.slice(oe,ye))}function V(se,oe,ye){ye=Math.min(se.length,ye);const Ee=[];let me=oe;for(;me<ye;){const Te=se[me];let Oe=null,Qe=Te>239?4:Te>223?3:Te>191?2:1;if(me+Qe<=ye){let Vt,vt,Zt,dn;switch(Qe){case 1:Te<128&&(Oe=Te);break;case 2:Vt=se[me+1],(Vt&192)===128&&(dn=(Te&31)<<6|Vt&63,dn>127&&(Oe=dn));break;case 3:Vt=se[me+1],vt=se[me+2],(Vt&192)===128&&(vt&192)===128&&(dn=(Te&15)<<12|(Vt&63)<<6|vt&63,dn>2047&&(dn<55296||dn>57343)&&(Oe=dn));break;case 4:Vt=se[me+1],vt=se[me+2],Zt=se[me+3],(Vt&192)===128&&(vt&192)===128&&(Zt&192)===128&&(dn=(Te&15)<<18|(Vt&63)<<12|(vt&63)<<6|Zt&63,dn>65535&&dn<1114112&&(Oe=dn))}}Oe===null?(Oe=65533,Qe=1):Oe>65535&&(Oe-=65536,Ee.push(Oe>>>10&1023|55296),Oe=56320|Oe&1023),Ee.push(Oe),me+=Qe}return j(Ee)}const U=4096;function j(se){const oe=se.length;if(oe<=U)return String.fromCharCode.apply(String,se);let ye="",Ee=0;for(;Ee<oe;)ye+=String.fromCharCode.apply(String,se.slice(Ee,Ee+=U));return ye}function $(se,oe,ye){let Ee="";ye=Math.min(se.length,ye);for(let me=oe;me<ye;++me)Ee+=String.fromCharCode(se[me]&127);return Ee}function ee(se,oe,ye){let Ee="";ye=Math.min(se.length,ye);for(let me=oe;me<ye;++me)Ee+=String.fromCharCode(se[me]);return Ee}function J(se,oe,ye){const Ee=se.length;(!oe||oe<0)&&(oe=0),(!ye||ye<0||ye>Ee)&&(ye=Ee);let me="";for(let Te=oe;Te<ye;++Te)me+=dt[se[Te]];return me}function F(se,oe,ye){const Ee=se.slice(oe,ye);let me="";for(let Te=0;Te<Ee.length-1;Te+=2)me+=String.fromCharCode(Ee[Te]+Ee[Te+1]*256);return me}g.prototype.slice=function(oe,ye){const Ee=this.length;oe=~~oe,ye=ye===void 0?Ee:~~ye,oe<0?(oe+=Ee,oe<0&&(oe=0)):oe>Ee&&(oe=Ee),ye<0?(ye+=Ee,ye<0&&(ye=0)):ye>Ee&&(ye=Ee),ye<oe&&(ye=oe);const me=this.subarray(oe,ye);return Object.setPrototypeOf(me,g.prototype),me};function X(se,oe,ye){if(se%1!==0||se<0)throw new RangeError("offset is not uint");if(se+oe>ye)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUintLE=g.prototype.readUIntLE=function(oe,ye,Ee){oe=oe>>>0,ye=ye>>>0,Ee||X(oe,ye,this.length);let me=this[oe],Te=1,Oe=0;for(;++Oe<ye&&(Te*=256);)me+=this[oe+Oe]*Te;return me},g.prototype.readUintBE=g.prototype.readUIntBE=function(oe,ye,Ee){oe=oe>>>0,ye=ye>>>0,Ee||X(oe,ye,this.length);let me=this[oe+--ye],Te=1;for(;ye>0&&(Te*=256);)me+=this[oe+--ye]*Te;return me},g.prototype.readUint8=g.prototype.readUInt8=function(oe,ye){return oe=oe>>>0,ye||X(oe,1,this.length),this[oe]},g.prototype.readUint16LE=g.prototype.readUInt16LE=function(oe,ye){return oe=oe>>>0,ye||X(oe,2,this.length),this[oe]|this[oe+1]<<8},g.prototype.readUint16BE=g.prototype.readUInt16BE=function(oe,ye){return oe=oe>>>0,ye||X(oe,2,this.length),this[oe]<<8|this[oe+1]},g.prototype.readUint32LE=g.prototype.readUInt32LE=function(oe,ye){return oe=oe>>>0,ye||X(oe,4,this.length),(this[oe]|this[oe+1]<<8|this[oe+2]<<16)+this[oe+3]*16777216},g.prototype.readUint32BE=g.prototype.readUInt32BE=function(oe,ye){return oe=oe>>>0,ye||X(oe,4,this.length),this[oe]*16777216+(this[oe+1]<<16|this[oe+2]<<8|this[oe+3])},g.prototype.readBigUInt64LE=De(function(oe){oe=oe>>>0,$t(oe,"offset");const ye=this[oe],Ee=this[oe+7];(ye===void 0||Ee===void 0)&&ft(oe,this.length-8);const me=ye+this[++oe]*2**8+this[++oe]*2**16+this[++oe]*2**24,Te=this[++oe]+this[++oe]*2**8+this[++oe]*2**16+Ee*2**24;return BigInt(me)+(BigInt(Te)<<BigInt(32))}),g.prototype.readBigUInt64BE=De(function(oe){oe=oe>>>0,$t(oe,"offset");const ye=this[oe],Ee=this[oe+7];(ye===void 0||Ee===void 0)&&ft(oe,this.length-8);const me=ye*2**24+this[++oe]*2**16+this[++oe]*2**8+this[++oe],Te=this[++oe]*2**24+this[++oe]*2**16+this[++oe]*2**8+Ee;return(BigInt(me)<<BigInt(32))+BigInt(Te)}),g.prototype.readIntLE=function(oe,ye,Ee){oe=oe>>>0,ye=ye>>>0,Ee||X(oe,ye,this.length);let me=this[oe],Te=1,Oe=0;for(;++Oe<ye&&(Te*=256);)me+=this[oe+Oe]*Te;return Te*=128,me>=Te&&(me-=Math.pow(2,8*ye)),me},g.prototype.readIntBE=function(oe,ye,Ee){oe=oe>>>0,ye=ye>>>0,Ee||X(oe,ye,this.length);let me=ye,Te=1,Oe=this[oe+--me];for(;me>0&&(Te*=256);)Oe+=this[oe+--me]*Te;return Te*=128,Oe>=Te&&(Oe-=Math.pow(2,8*ye)),Oe},g.prototype.readInt8=function(oe,ye){return oe=oe>>>0,ye||X(oe,1,this.length),this[oe]&128?(255-this[oe]+1)*-1:this[oe]},g.prototype.readInt16LE=function(oe,ye){oe=oe>>>0,ye||X(oe,2,this.length);const Ee=this[oe]|this[oe+1]<<8;return Ee&32768?Ee|4294901760:Ee},g.prototype.readInt16BE=function(oe,ye){oe=oe>>>0,ye||X(oe,2,this.length);const Ee=this[oe+1]|this[oe]<<8;return Ee&32768?Ee|4294901760:Ee},g.prototype.readInt32LE=function(oe,ye){return oe=oe>>>0,ye||X(oe,4,this.length),this[oe]|this[oe+1]<<8|this[oe+2]<<16|this[oe+3]<<24},g.prototype.readInt32BE=function(oe,ye){return oe=oe>>>0,ye||X(oe,4,this.length),this[oe]<<24|this[oe+1]<<16|this[oe+2]<<8|this[oe+3]},g.prototype.readBigInt64LE=De(function(oe){oe=oe>>>0,$t(oe,"offset");const ye=this[oe],Ee=this[oe+7];(ye===void 0||Ee===void 0)&&ft(oe,this.length-8);const me=this[oe+4]+this[oe+5]*2**8+this[oe+6]*2**16+(Ee<<24);return(BigInt(me)<<BigInt(32))+BigInt(ye+this[++oe]*256+this[++oe]*65536+this[++oe]*16777216)}),g.prototype.readBigInt64BE=De(function(oe){oe=oe>>>0,$t(oe,"offset");const ye=this[oe],Ee=this[oe+7];(ye===void 0||Ee===void 0)&&ft(oe,this.length-8);const me=(ye<<24)+this[++oe]*2**16+this[++oe]*2**8+this[++oe];return(BigInt(me)<<BigInt(32))+BigInt(this[++oe]*16777216+this[++oe]*65536+this[++oe]*256+Ee)}),g.prototype.readFloatLE=function(oe,ye){return oe=oe>>>0,ye||X(oe,4,this.length),T.read(this,oe,!0,23,4)},g.prototype.readFloatBE=function(oe,ye){return oe=oe>>>0,ye||X(oe,4,this.length),T.read(this,oe,!1,23,4)},g.prototype.readDoubleLE=function(oe,ye){return oe=oe>>>0,ye||X(oe,8,this.length),T.read(this,oe,!0,52,8)},g.prototype.readDoubleBE=function(oe,ye){return oe=oe>>>0,ye||X(oe,8,this.length),T.read(this,oe,!1,52,8)};function de(se,oe,ye,Ee,me,Te){if(!g.isBuffer(se))throw new TypeError('"buffer" argument must be a Buffer instance');if(oe>me||oe<Te)throw new RangeError('"value" argument is out of bounds');if(ye+Ee>se.length)throw new RangeError("Index out of range")}g.prototype.writeUintLE=g.prototype.writeUIntLE=function(oe,ye,Ee,me){if(oe=+oe,ye=ye>>>0,Ee=Ee>>>0,!me){const Qe=Math.pow(2,8*Ee)-1;de(this,oe,ye,Ee,Qe,0)}let Te=1,Oe=0;for(this[ye]=oe&255;++Oe<Ee&&(Te*=256);)this[ye+Oe]=oe/Te&255;return ye+Ee},g.prototype.writeUintBE=g.prototype.writeUIntBE=function(oe,ye,Ee,me){if(oe=+oe,ye=ye>>>0,Ee=Ee>>>0,!me){const Qe=Math.pow(2,8*Ee)-1;de(this,oe,ye,Ee,Qe,0)}let Te=Ee-1,Oe=1;for(this[ye+Te]=oe&255;--Te>=0&&(Oe*=256);)this[ye+Te]=oe/Oe&255;return ye+Ee},g.prototype.writeUint8=g.prototype.writeUInt8=function(oe,ye,Ee){return oe=+oe,ye=ye>>>0,Ee||de(this,oe,ye,1,255,0),this[ye]=oe&255,ye+1},g.prototype.writeUint16LE=g.prototype.writeUInt16LE=function(oe,ye,Ee){return oe=+oe,ye=ye>>>0,Ee||de(this,oe,ye,2,65535,0),this[ye]=oe&255,this[ye+1]=oe>>>8,ye+2},g.prototype.writeUint16BE=g.prototype.writeUInt16BE=function(oe,ye,Ee){return oe=+oe,ye=ye>>>0,Ee||de(this,oe,ye,2,65535,0),this[ye]=oe>>>8,this[ye+1]=oe&255,ye+2},g.prototype.writeUint32LE=g.prototype.writeUInt32LE=function(oe,ye,Ee){return oe=+oe,ye=ye>>>0,Ee||de(this,oe,ye,4,4294967295,0),this[ye+3]=oe>>>24,this[ye+2]=oe>>>16,this[ye+1]=oe>>>8,this[ye]=oe&255,ye+4},g.prototype.writeUint32BE=g.prototype.writeUInt32BE=function(oe,ye,Ee){return oe=+oe,ye=ye>>>0,Ee||de(this,oe,ye,4,4294967295,0),this[ye]=oe>>>24,this[ye+1]=oe>>>16,this[ye+2]=oe>>>8,this[ye+3]=oe&255,ye+4};function Y(se,oe,ye,Ee,me){Ct(oe,Ee,me,se,ye,7);let Te=Number(oe&BigInt(4294967295));se[ye++]=Te,Te=Te>>8,se[ye++]=Te,Te=Te>>8,se[ye++]=Te,Te=Te>>8,se[ye++]=Te;let Oe=Number(oe>>BigInt(32)&BigInt(4294967295));return se[ye++]=Oe,Oe=Oe>>8,se[ye++]=Oe,Oe=Oe>>8,se[ye++]=Oe,Oe=Oe>>8,se[ye++]=Oe,ye}function ce(se,oe,ye,Ee,me){Ct(oe,Ee,me,se,ye,7);let Te=Number(oe&BigInt(4294967295));se[ye+7]=Te,Te=Te>>8,se[ye+6]=Te,Te=Te>>8,se[ye+5]=Te,Te=Te>>8,se[ye+4]=Te;let Oe=Number(oe>>BigInt(32)&BigInt(4294967295));return se[ye+3]=Oe,Oe=Oe>>8,se[ye+2]=Oe,Oe=Oe>>8,se[ye+1]=Oe,Oe=Oe>>8,se[ye]=Oe,ye+8}g.prototype.writeBigUInt64LE=De(function(oe,ye=0){return Y(this,oe,ye,BigInt(0),BigInt("0xffffffffffffffff"))}),g.prototype.writeBigUInt64BE=De(function(oe,ye=0){return ce(this,oe,ye,BigInt(0),BigInt("0xffffffffffffffff"))}),g.prototype.writeIntLE=function(oe,ye,Ee,me){if(oe=+oe,ye=ye>>>0,!me){const Vt=Math.pow(2,8*Ee-1);de(this,oe,ye,Ee,Vt-1,-Vt)}let Te=0,Oe=1,Qe=0;for(this[ye]=oe&255;++Te<Ee&&(Oe*=256);)oe<0&&Qe===0&&this[ye+Te-1]!==0&&(Qe=1),this[ye+Te]=(oe/Oe>>0)-Qe&255;return ye+Ee},g.prototype.writeIntBE=function(oe,ye,Ee,me){if(oe=+oe,ye=ye>>>0,!me){const Vt=Math.pow(2,8*Ee-1);de(this,oe,ye,Ee,Vt-1,-Vt)}let Te=Ee-1,Oe=1,Qe=0;for(this[ye+Te]=oe&255;--Te>=0&&(Oe*=256);)oe<0&&Qe===0&&this[ye+Te+1]!==0&&(Qe=1),this[ye+Te]=(oe/Oe>>0)-Qe&255;return ye+Ee},g.prototype.writeInt8=function(oe,ye,Ee){return oe=+oe,ye=ye>>>0,Ee||de(this,oe,ye,1,127,-128),oe<0&&(oe=255+oe+1),this[ye]=oe&255,ye+1},g.prototype.writeInt16LE=function(oe,ye,Ee){return oe=+oe,ye=ye>>>0,Ee||de(this,oe,ye,2,32767,-32768),this[ye]=oe&255,this[ye+1]=oe>>>8,ye+2},g.prototype.writeInt16BE=function(oe,ye,Ee){return oe=+oe,ye=ye>>>0,Ee||de(this,oe,ye,2,32767,-32768),this[ye]=oe>>>8,this[ye+1]=oe&255,ye+2},g.prototype.writeInt32LE=function(oe,ye,Ee){return oe=+oe,ye=ye>>>0,Ee||de(this,oe,ye,4,2147483647,-2147483648),this[ye]=oe&255,this[ye+1]=oe>>>8,this[ye+2]=oe>>>16,this[ye+3]=oe>>>24,ye+4},g.prototype.writeInt32BE=function(oe,ye,Ee){return oe=+oe,ye=ye>>>0,Ee||de(this,oe,ye,4,2147483647,-2147483648),oe<0&&(oe=4294967295+oe+1),this[ye]=oe>>>24,this[ye+1]=oe>>>16,this[ye+2]=oe>>>8,this[ye+3]=oe&255,ye+4},g.prototype.writeBigInt64LE=De(function(oe,ye=0){return Y(this,oe,ye,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),g.prototype.writeBigInt64BE=De(function(oe,ye=0){return ce(this,oe,ye,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function he(se,oe,ye,Ee,me,Te){if(ye+Ee>se.length)throw new RangeError("Index out of range");if(ye<0)throw new RangeError("Index out of range")}function Ie(se,oe,ye,Ee,me){return oe=+oe,ye=ye>>>0,me||he(se,oe,ye,4,34028234663852886e22,-34028234663852886e22),T.write(se,oe,ye,Ee,23,4),ye+4}g.prototype.writeFloatLE=function(oe,ye,Ee){return Ie(this,oe,ye,!0,Ee)},g.prototype.writeFloatBE=function(oe,ye,Ee){return Ie(this,oe,ye,!1,Ee)};function ke(se,oe,ye,Ee,me){return oe=+oe,ye=ye>>>0,me||he(se,oe,ye,8,17976931348623157e292,-17976931348623157e292),T.write(se,oe,ye,Ee,52,8),ye+8}g.prototype.writeDoubleLE=function(oe,ye,Ee){return ke(this,oe,ye,!0,Ee)},g.prototype.writeDoubleBE=function(oe,ye,Ee){return ke(this,oe,ye,!1,Ee)},g.prototype.copy=function(oe,ye,Ee,me){if(!g.isBuffer(oe))throw new TypeError("argument should be a Buffer");if(Ee||(Ee=0),!me&&me!==0&&(me=this.length),ye>=oe.length&&(ye=oe.length),ye||(ye=0),me>0&&me<Ee&&(me=Ee),me===Ee||oe.length===0||this.length===0)return 0;if(ye<0)throw new RangeError("targetStart out of bounds");if(Ee<0||Ee>=this.length)throw new RangeError("Index out of range");if(me<0)throw new RangeError("sourceEnd out of bounds");me>this.length&&(me=this.length),oe.length-ye<me-Ee&&(me=oe.length-ye+Ee);const Te=me-Ee;return this===oe&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(ye,Ee,me):Uint8Array.prototype.set.call(oe,this.subarray(Ee,me),ye),Te},g.prototype.fill=function(oe,ye,Ee,me){if(typeof oe=="string"){if(typeof ye=="string"?(me=ye,ye=0,Ee=this.length):typeof Ee=="string"&&(me=Ee,Ee=this.length),me!==void 0&&typeof me!="string")throw new TypeError("encoding must be a string");if(typeof me=="string"&&!g.isEncoding(me))throw new TypeError("Unknown encoding: "+me);if(oe.length===1){const Oe=oe.charCodeAt(0);(me==="utf8"&&Oe<128||me==="latin1")&&(oe=Oe)}}else typeof oe=="number"?oe=oe&255:typeof oe=="boolean"&&(oe=Number(oe));if(ye<0||this.length<ye||this.length<Ee)throw new RangeError("Out of range index");if(Ee<=ye)return this;ye=ye>>>0,Ee=Ee===void 0?this.length:Ee>>>0,oe||(oe=0);let Te;if(typeof oe=="number")for(Te=ye;Te<Ee;++Te)this[Te]=oe;else{const Oe=g.isBuffer(oe)?oe:g.from(oe,me),Qe=Oe.length;if(Qe===0)throw new TypeError('The value "'+oe+'" is invalid for argument "value"');for(Te=0;Te<Ee-ye;++Te)this[Te+ye]=Oe[Te%Qe]}return this};const ut={};function Re(se,oe,ye){ut[se]=class extends ye{constructor(){super(),Object.defineProperty(this,"message",{value:oe.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${se}]`,this.stack,delete this.name}get code(){return se}set code(me){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:me,writable:!0})}toString(){return`${this.name} [${se}]: ${this.message}`}}}Re("ERR_BUFFER_OUT_OF_BOUNDS",function(se){return se?`${se} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Re("ERR_INVALID_ARG_TYPE",function(se,oe){return`The "${se}" argument must be of type number. Received type ${typeof oe}`},TypeError),Re("ERR_OUT_OF_RANGE",function(se,oe,ye){let Ee=`The value of "${se}" is out of range.`,me=ye;return Number.isInteger(ye)&&Math.abs(ye)>4294967296?me=ze(String(ye)):typeof ye=="bigint"&&(me=String(ye),(ye>BigInt(2)**BigInt(32)||ye<-(BigInt(2)**BigInt(32)))&&(me=ze(me)),me+="n"),Ee+=` It must be ${oe}. Received ${me}`,Ee},RangeError);function ze(se){let oe="",ye=se.length;const Ee=se[0]==="-"?1:0;for(;ye>=Ee+4;ye-=3)oe=`_${se.slice(ye-3,ye)}${oe}`;return`${se.slice(0,ye)}${oe}`}function _t(se,oe,ye){$t(oe,"offset"),(se[oe]===void 0||se[oe+ye]===void 0)&&ft(oe,se.length-(ye+1))}function Ct(se,oe,ye,Ee,me,Te){if(se>ye||se<oe){const Oe=typeof oe=="bigint"?"n":"";let Qe;throw Te>3?oe===0||oe===BigInt(0)?Qe=`>= 0${Oe} and < 2${Oe} ** ${(Te+1)*8}${Oe}`:Qe=`>= -(2${Oe} ** ${(Te+1)*8-1}${Oe}) and < 2 ** ${(Te+1)*8-1}${Oe}`:Qe=`>= ${oe}${Oe} and <= ${ye}${Oe}`,new ut.ERR_OUT_OF_RANGE("value",Qe,se)}_t(Ee,me,Te)}function $t(se,oe){if(typeof se!="number")throw new ut.ERR_INVALID_ARG_TYPE(oe,"number",se)}function ft(se,oe,ye){throw Math.floor(se)!==se?($t(se,ye),new ut.ERR_OUT_OF_RANGE(ye||"offset","an integer",se)):oe<0?new ut.ERR_BUFFER_OUT_OF_BOUNDS:new ut.ERR_OUT_OF_RANGE(ye||"offset",`>= ${ye?1:0} and <= ${oe}`,se)}const Xe=/[^+/0-9A-Za-z-_]/g;function ct(se){if(se=se.split("=")[0],se=se.trim().replace(Xe,""),se.length<2)return"";for(;se.length%4!==0;)se=se+"=";return se}function wt(se,oe){oe=oe||1/0;let ye;const Ee=se.length;let me=null;const Te=[];for(let Oe=0;Oe<Ee;++Oe){if(ye=se.charCodeAt(Oe),ye>55295&&ye<57344){if(!me){if(ye>56319){(oe-=3)>-1&&Te.push(239,191,189);continue}else if(Oe+1===Ee){(oe-=3)>-1&&Te.push(239,191,189);continue}me=ye;continue}if(ye<56320){(oe-=3)>-1&&Te.push(239,191,189),me=ye;continue}ye=(me-55296<<10|ye-56320)+65536}else me&&(oe-=3)>-1&&Te.push(239,191,189);if(me=null,ye<128){if((oe-=1)<0)break;Te.push(ye)}else if(ye<2048){if((oe-=2)<0)break;Te.push(ye>>6|192,ye&63|128)}else if(ye<65536){if((oe-=3)<0)break;Te.push(ye>>12|224,ye>>6&63|128,ye&63|128)}else if(ye<1114112){if((oe-=4)<0)break;Te.push(ye>>18|240,ye>>12&63|128,ye>>6&63|128,ye&63|128)}else throw new Error("Invalid code point")}return Te}function Rt(se){const oe=[];for(let ye=0;ye<se.length;++ye)oe.push(se.charCodeAt(ye)&255);return oe}function Ge(se,oe){let ye,Ee,me;const Te=[];for(let Oe=0;Oe<se.length&&!((oe-=2)<0);++Oe)ye=se.charCodeAt(Oe),Ee=ye>>8,me=ye%256,Te.push(me),Te.push(Ee);return Te}function zt(se){return v.toByteArray(ct(se))}function Ft(se,oe,ye,Ee){let me;for(me=0;me<Ee&&!(me+ye>=oe.length||me>=se.length);++me)oe[me+ye]=se[me];return me}function tt(se,oe){return se instanceof oe||se!=null&&se.constructor!=null&&se.constructor.name!=null&&se.constructor.name===oe.name}function qe(se){return se!==se}const dt=function(){const se="0123456789abcdef",oe=new Array(256);for(let ye=0;ye<16;++ye){const Ee=ye*16;for(let me=0;me<16;++me)oe[Ee+me]=se[ye]+se[me]}return oe}();function De(se){return typeof BigInt>"u"?He:se}function He(){throw new Error("BigInt not supported")}},97785:function(fe,p,x){"use strict";var v=x(79524),T=x(64811),C=x(46255),I=x(12728);fe.exports=I||v.call(C,T)},96440:function(fe,p,x){"use strict";var v=x(79524),T=x(64811),C=x(97785);fe.exports=function(){return C(v,T,arguments)}},64811:function(fe){"use strict";fe.exports=Function.prototype.apply},46255:function(fe){"use strict";fe.exports=Function.prototype.call},92427:function(fe,p,x){"use strict";var v=x(79524),T=x(71102),C=x(46255),I=x(97785);fe.exports=function(b){if(b.length<1||typeof b[0]!="function")throw new T("a function is required");return I(v,C,b)}},12728:function(fe){"use strict";fe.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply},11187:function(fe,p,x){"use strict";var v=x(49336),T=x(17695),C=T(v("String.prototype.indexOf"));fe.exports=function(m,b){var g=v(m,!!b);return typeof g=="function"&&C(m,".prototype.")>-1?T(g):g}},17695:function(fe,p,x){"use strict";var v=x(7755),T=x(39886),C=x(92427),I=x(96440);fe.exports=function(b){var g=C(arguments),w=b.length-(arguments.length-1);return v(g,1+(w>0?w:0),!0)},T?T(fe.exports,"apply",{value:I}):fe.exports.apply=I},98801:function(fe,p,x){"use strict";var v=x(49336),T=x(92427),C=T([v("%String.prototype.indexOf%")]);fe.exports=function(m,b){var g=v(m,!!b);return typeof g=="function"&&C(m,".prototype.")>-1?T([g]):g}},84705:function(fe,p,x){var v=x(56608).Buffer,T=x(43803).Transform,C=x(86704).StringDecoder,I=x(91193);function m(b){T.call(this),this.hashMode=typeof b=="string",this.hashMode?this[b]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}I(m,T),m.prototype.update=function(b,g,w){typeof b=="string"&&(b=v.from(b,g));var _=this._update(b);return this.hashMode?this:(w&&(_=this._toString(_,w)),_)},m.prototype.setAutoPadding=function(){},m.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},m.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},m.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},m.prototype._transform=function(b,g,w){var _;try{this.hashMode?this._update(b):this.push(this._update(b))}catch(A){_=A}finally{w(_)}},m.prototype._flush=function(b){var g;try{this.push(this.__final())}catch(w){g=w}b(g)},m.prototype._finalOrDigest=function(b){var g=this.__final()||v.alloc(0);return b&&(g=this._toString(g,b,!0)),g},m.prototype._toString=function(b,g,w){if(this._decoder||(this._decoder=new C(g),this._encoding=g),this._encoding!==g)throw new Error("can't switch encodings");var _=this._decoder.write(b);return w&&(_+=this._decoder.end()),_},fe.exports=m},18955:function(fe,p,x){"use strict";var v=x(91193),T=x(75035),C=x(33934),I=x(5244),m=x(84705);function b(g){m.call(this,"digest"),this._hash=g}v(b,m),b.prototype._update=function(g){this._hash.update(g)},b.prototype._final=function(){return this._hash.digest()},fe.exports=function(w){return w=w.toLowerCase(),w==="md5"?new T:w==="rmd160"||w==="ripemd160"?new C:new b(I(w))}},20136:function(fe,p,x){"use strict";var v=x(85409),T=function(){function L(W,H){if(typeof W!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+W+"."));this._batchLoadFn=W,this._maxBatchSize=_(H),this._batchScheduleFn=A(H),this._cacheKeyFn=S(H),this._cacheMap=k(H),this._batch=null,this.name=B(H)}var D=L.prototype;return D.load=function(H){if(H==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(H)+"."));var G=m(this),Z=this._cacheMap,Q=this._cacheKeyFn(H);if(Z){var ie=Z.get(Q);if(ie){var le=G.cacheHits||(G.cacheHits=[]);return new Promise(function(we){le.push(function(){we(ie)})})}}G.keys.push(H);var be=new Promise(function(we,Ae){G.callbacks.push({resolve:we,reject:Ae})});return Z&&Z.set(Q,be),be},D.loadMany=function(H){if(!O(H))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+H+"."));for(var G=[],Z=0;Z<H.length;Z++)G.push(this.load(H[Z]).catch(function(Q){return Q}));return Promise.all(G)},D.clear=function(H){var G=this._cacheMap;if(G){var Z=this._cacheKeyFn(H);G.delete(Z)}return this},D.clearAll=function(){var H=this._cacheMap;return H&&H.clear(),this},D.prime=function(H,G){var Z=this._cacheMap;if(Z){var Q=this._cacheKeyFn(H);if(Z.get(Q)===void 0){var ie;G instanceof Error?(ie=Promise.reject(G),ie.catch(function(){})):ie=Promise.resolve(G),Z.set(Q,ie)}}return this},L}(),C=typeof v=="object"&&typeof v.nextTick=="function"?function(L){I||(I=Promise.resolve()),I.then(function(){v.nextTick(L)})}:typeof setImmediate=="function"?function(L){setImmediate(L)}:function(L){setTimeout(L)},I;function m(L){var D=L._batch;if(D!==null&&!D.hasDispatched&&D.keys.length<L._maxBatchSize)return D;var W={hasDispatched:!1,keys:[],callbacks:[]};return L._batch=W,L._batchScheduleFn(function(){b(L,W)}),W}function b(L,D){if(D.hasDispatched=!0,D.keys.length===0){w(D);return}var W;try{W=L._batchLoadFn(D.keys)}catch(H){return g(L,D,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function "+("errored synchronously: "+String(H)+".")))}if(!W||typeof W.then!="function")return g(L,D,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise: "+String(W)+".")));W.then(function(H){if(!O(H))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise of an Array: "+String(H)+"."));if(H.length!==D.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys."+(`
|
||
|
||
Keys:
|
||
`+String(D.keys))+(`
|
||
|
||
Values:
|
||
`+String(H)));w(D);for(var G=0;G<D.callbacks.length;G++){var Z=H[G];Z instanceof Error?D.callbacks[G].reject(Z):D.callbacks[G].resolve(Z)}}).catch(function(H){g(L,D,H)})}function g(L,D,W){w(D);for(var H=0;H<D.keys.length;H++)L.clear(D.keys[H]),D.callbacks[H].reject(W)}function w(L){if(L.cacheHits)for(var D=0;D<L.cacheHits.length;D++)L.cacheHits[D]()}function _(L){var D=!L||L.batch!==!1;if(!D)return 1;var W=L&&L.maxBatchSize;if(W===void 0)return 1/0;if(typeof W!="number"||W<1)throw new TypeError("maxBatchSize must be a positive number: "+W);return W}function A(L){var D=L&&L.batchScheduleFn;if(D===void 0)return C;if(typeof D!="function")throw new TypeError("batchScheduleFn must be a function: "+D);return D}function S(L){var D=L&&L.cacheKeyFn;if(D===void 0)return function(W){return W};if(typeof D!="function")throw new TypeError("cacheKeyFn must be a function: "+D);return D}function k(L){var D=!L||L.cache!==!1;if(!D)return null;var W=L&&L.cacheMap;if(W===void 0)return new Map;if(W!==null){var H=["get","set","delete","clear"],G=H.filter(function(Z){return W&&typeof W[Z]!="function"});if(G.length!==0)throw new TypeError("Custom cacheMap missing methods: "+G.join(", "))}return W}function B(L){return L&&L.name?L.name:null}function O(L){return typeof L=="object"&&L!==null&&typeof L.length=="number"&&(L.length===0||L.length>0&&Object.prototype.hasOwnProperty.call(L,L.length-1))}fe.exports=T},20022:function(fe,p,x){"use strict";var v=x(39886),T=x(63429),C=x(71102),I=x(25667);fe.exports=function(b,g,w){if(!b||typeof b!="object"&&typeof b!="function")throw new C("`obj` must be an object or a function`");if(typeof g!="string"&&typeof g!="symbol")throw new C("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new C("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new C("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new C("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new C("`loose`, if provided, must be a boolean");var _=arguments.length>3?arguments[3]:null,A=arguments.length>4?arguments[4]:null,S=arguments.length>5?arguments[5]:null,k=arguments.length>6?arguments[6]:!1,B=!!I&&I(b,g);if(v)v(b,g,{configurable:S===null&&B?B.configurable:!S,enumerable:_===null&&B?B.enumerable:!_,value:w,writable:A===null&&B?B.writable:!A});else if(k||!_&&!A&&!S)b[g]=w;else throw new T("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}},4938:function(fe,p,x){"use strict";var v=x(5187),T=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",C=Object.prototype.toString,I=Array.prototype.concat,m=x(20022),b=function(A){return typeof A=="function"&&C.call(A)==="[object Function]"},g=x(491)(),w=function(A,S,k,B){if(S in A){if(B===!0){if(A[S]===k)return}else if(!b(B)||!B())return}g?m(A,S,k,!0):m(A,S,k)},_=function(A,S){var k=arguments.length>2?arguments[2]:{},B=v(S);T&&(B=I.call(B,Object.getOwnPropertySymbols(S)));for(var O=0;O<B.length;O+=1)w(A,B[O],S[B[O]],k[B[O]])};_.supportsDescriptors=!!g,fe.exports=_},57678:function(fe,p,x){"use strict";var v=x(92427),T=x(25667),C;try{C=[].__proto__===Array.prototype}catch(g){if(!g||typeof g!="object"||!("code"in g)||g.code!=="ERR_PROTO_ACCESS")throw g}var I=!!C&&T&&T(Object.prototype,"__proto__"),m=Object,b=m.getPrototypeOf;fe.exports=I&&typeof I.get=="function"?v([I.get]):typeof b=="function"?function(w){return b(w==null?w:m(w))}:!1},96656:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.ECPairFactory=p.networks=void 0;const T=x(22159);p.networks=T;const C=x(61823),I=x(82869),m=x(5854),b=x(4995),g=C.typeforce.maybe(C.typeforce.compile({compressed:C.maybe(C.Boolean),network:C.maybe(C.Network)})),w=A=>A.length===32?A:A.slice(1,33);function _(A){(0,b.testEcc)(A);function S(W){return A.isPoint(W)}function k(W,H){if(C.typeforce(C.Buffer256bit,W),!A.isPrivate(W))throw new TypeError("Private key not in range [1, n)");return C.typeforce(g,H),new D(W,void 0,H)}function B(W,H){return C.typeforce(A.isPoint,W),C.typeforce(g,H),new D(void 0,W,H)}function O(W,H){const G=m.decode(W),Z=G.version;if(C.Array(H)){if(H=H.filter(Q=>Z===Q.wif).pop(),!H)throw new Error("Unknown network version")}else if(H=H||T.bitcoin,Z!==H.wif)throw new Error("Invalid network version");return k(G.privateKey,{compressed:G.compressed,network:H})}function L(W){C.typeforce(g,W),W===void 0&&(W={});const H=W.rng||I;let G;do G=H(32),C.typeforce(C.Buffer256bit,G);while(!A.isPrivate(G));return k(G,W)}class D{__D;__Q;compressed;network;lowR;constructor(H,G,Z){this.__D=H,this.__Q=G,this.lowR=!1,Z===void 0&&(Z={}),this.compressed=Z.compressed===void 0?!0:Z.compressed,this.network=Z.network||T.bitcoin,G!==void 0&&(this.__Q=v.from(A.pointCompress(G,this.compressed)))}get privateKey(){return this.__D}get publicKey(){if(!this.__Q){const H=A.pointFromScalar(this.__D,this.compressed);this.__Q=v.from(H)}return this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return m.encode(this.network.wif,this.__D,this.compressed)}tweak(H){return this.privateKey?this.tweakFromPrivateKey(H):this.tweakFromPublicKey(H)}sign(H,G){if(!this.__D)throw new Error("Missing private key");if(G===void 0&&(G=this.lowR),G===!1)return v.from(A.sign(H,this.__D));{let Z=A.sign(H,this.__D);const Q=v.alloc(32,0);let ie=0;for(;Z[0]>127;)ie++,Q.writeUIntLE(ie,0,6),Z=A.sign(H,this.__D,Q);return v.from(Z)}}signSchnorr(H){if(!this.privateKey)throw new Error("Missing private key");if(!A.signSchnorr)throw new Error("signSchnorr not supported by ecc library");return v.from(A.signSchnorr(H,this.privateKey))}verify(H,G){return A.verify(H,this.publicKey,G)}verifySchnorr(H,G){if(!A.verifySchnorr)throw new Error("verifySchnorr not supported by ecc library");return A.verifySchnorr(H,this.publicKey.subarray(1,33),G)}tweakFromPublicKey(H){const G=w(this.publicKey),Z=A.xOnlyPointAddTweak(G,H);if(!Z||Z.xOnlyPubkey===null)throw new Error("Cannot tweak public key!");const Q=v.from([Z.parity===0?2:3]);return B(v.concat([Q,Z.xOnlyPubkey]),{network:this.network,compressed:this.compressed})}tweakFromPrivateKey(H){const Z=this.publicKey[0]===3||this.publicKey[0]===4&&(this.publicKey[64]&1)===1?A.privateNegate(this.privateKey):this.privateKey,Q=A.privateAdd(Z,H);if(!Q)throw new Error("Invalid tweaked private key!");return k(v.from(Q),{network:this.network,compressed:this.compressed})}}return{isPoint:S,fromPrivateKey:k,fromPublicKey:B,fromWIF:O,makeRandom:L}}p.ECPairFactory=_},70978:function(fe,p,x){"use strict";var v;v={value:!0},v=v=v=void 0;var T=x(96656);v={enumerable:!0,get:function(){return T.ECPairFactory}},v={enumerable:!0,get:function(){return T.ECPairFactory}},v={enumerable:!0,get:function(){return T.networks}}},22159:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.testnet=p.bitcoin=void 0,p.bitcoin={messagePrefix:`Bitcoin Signed Message:
|
||
`,bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},p.testnet={messagePrefix:`Bitcoin Signed Message:
|
||
`,bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},4995:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.testEcc=void 0;const T=m=>v.from(m,"hex");function C(m){I(m.isPoint(T("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),I(!m.isPoint(T("030000000000000000000000000000000000000000000000000000000000000005"))),I(m.isPrivate(T("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),I(m.isPrivate(T("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),I(!m.isPrivate(T("0000000000000000000000000000000000000000000000000000000000000000"))),I(!m.isPrivate(T("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"))),I(!m.isPrivate(T("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142"))),I(v.from(m.privateAdd(T("0000000000000000000000000000000000000000000000000000000000000001"),T("0000000000000000000000000000000000000000000000000000000000000000"))).equals(T("0000000000000000000000000000000000000000000000000000000000000001"))),I(m.privateAdd(T("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"),T("0000000000000000000000000000000000000000000000000000000000000003"))===null),I(v.from(m.privateAdd(T("e211078564db65c3ce7704f08262b1f38f1ef412ad15b5ac2d76657a63b2c500"),T("b51fbb69051255d1becbd683de5848242a89c229348dd72896a87ada94ae8665"))).equals(T("9730c2ee69edbb958d42db7460bafa18fef9d955325aec99044c81c8282b0a24"))),I(v.from(m.privateNegate(T("0000000000000000000000000000000000000000000000000000000000000001"))).equals(T("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),I(v.from(m.privateNegate(T("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"))).equals(T("0000000000000000000000000000000000000000000000000000000000000003"))),I(v.from(m.privateNegate(T("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(T("4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792"))),I(v.from(m.pointCompress(T("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!0)).equals(T("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),I(v.from(m.pointCompress(T("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!1)).equals(T("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),I(v.from(m.pointCompress(T("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!0)).equals(T("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),I(v.from(m.pointCompress(T("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!1)).equals(T("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),I(v.from(m.pointFromScalar(T("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(T("02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99"))),I(m.xOnlyPointAddTweak(T("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),T("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))===null);let b=m.xOnlyPointAddTweak(T("1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b"),T("a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac"));I(v.from(b.xOnlyPubkey).equals(T("e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"))&&b.parity===1),b=m.xOnlyPointAddTweak(T("2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991"),T("823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47")),I(v.from(b.xOnlyPubkey).equals(T("9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"))&&b.parity===0),I(v.from(m.sign(T("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),T("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))).equals(T("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),I(m.verify(T("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),T("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),T("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),m.signSchnorr&&I(v.from(m.signSchnorr(T("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),T("c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9"),T("c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906"))).equals(T("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"))),m.verifySchnorr&&I(m.verifySchnorr(T("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),T("dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8"),T("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7")))}p.testEcc=C;function I(m){if(!m)throw new Error("ecc library invalid")}},61823:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.maybe=p.Boolean=p.Array=p.Buffer256bit=p.Network=p.typeforce=void 0,p.typeforce=x(41042),p.Network=p.typeforce.compile({messagePrefix:p.typeforce.oneOf(p.typeforce.Buffer,p.typeforce.String),bip32:{public:p.typeforce.UInt32,private:p.typeforce.UInt32},pubKeyHash:p.typeforce.UInt8,scriptHash:p.typeforce.UInt8,wif:p.typeforce.UInt8}),p.Buffer256bit=p.typeforce.BufferN(32),p.Array=p.typeforce.Array,p.Boolean=p.typeforce.Boolean,p.maybe=p.typeforce.maybe},23071:function(fe,p,x){"use strict";var v=p;v.version=x(54044).rE,v.utils=x(9185),v.rand=x(65442),v.curve=x(95228),v.curves=x(25366),v.ec=x(72961),v.eddsa=x(87808)},94499:function(fe,p,x){"use strict";var v=x(23364),T=x(9185),C=T.getNAF,I=T.getJSF,m=T.assert;function b(w,_){this.type=w,this.p=new v(_.p,16),this.red=_.prime?v.red(_.prime):v.mont(this.p),this.zero=new v(0).toRed(this.red),this.one=new v(1).toRed(this.red),this.two=new v(2).toRed(this.red),this.n=_.n&&new v(_.n,16),this.g=_.g&&this.pointFromJSON(_.g,_.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var A=this.n&&this.p.div(this.n);!A||A.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}fe.exports=b,b.prototype.point=function(){throw new Error("Not implemented")},b.prototype.validate=function(){throw new Error("Not implemented")},b.prototype._fixedNafMul=function(_,A){m(_.precomputed);var S=_._getDoubles(),k=C(A,1,this._bitLength),B=(1<<S.step+1)-(S.step%2===0?2:1);B/=3;var O=[],L,D;for(L=0;L<k.length;L+=S.step){D=0;for(var W=L+S.step-1;W>=L;W--)D=(D<<1)+k[W];O.push(D)}for(var H=this.jpoint(null,null,null),G=this.jpoint(null,null,null),Z=B;Z>0;Z--){for(L=0;L<O.length;L++)D=O[L],D===Z?G=G.mixedAdd(S.points[L]):D===-Z&&(G=G.mixedAdd(S.points[L].neg()));H=H.add(G)}return H.toP()},b.prototype._wnafMul=function(_,A){var S=4,k=_._getNAFPoints(S);S=k.wnd;for(var B=k.points,O=C(A,S,this._bitLength),L=this.jpoint(null,null,null),D=O.length-1;D>=0;D--){for(var W=0;D>=0&&O[D]===0;D--)W++;if(D>=0&&W++,L=L.dblp(W),D<0)break;var H=O[D];m(H!==0),_.type==="affine"?H>0?L=L.mixedAdd(B[H-1>>1]):L=L.mixedAdd(B[-H-1>>1].neg()):H>0?L=L.add(B[H-1>>1]):L=L.add(B[-H-1>>1].neg())}return _.type==="affine"?L.toP():L},b.prototype._wnafMulAdd=function(_,A,S,k,B){var O=this._wnafT1,L=this._wnafT2,D=this._wnafT3,W=0,H,G,Z;for(H=0;H<k;H++){Z=A[H];var Q=Z._getNAFPoints(_);O[H]=Q.wnd,L[H]=Q.points}for(H=k-1;H>=1;H-=2){var ie=H-1,le=H;if(O[ie]!==1||O[le]!==1){D[ie]=C(S[ie],O[ie],this._bitLength),D[le]=C(S[le],O[le],this._bitLength),W=Math.max(D[ie].length,W),W=Math.max(D[le].length,W);continue}var be=[A[ie],null,null,A[le]];A[ie].y.cmp(A[le].y)===0?(be[1]=A[ie].add(A[le]),be[2]=A[ie].toJ().mixedAdd(A[le].neg())):A[ie].y.cmp(A[le].y.redNeg())===0?(be[1]=A[ie].toJ().mixedAdd(A[le]),be[2]=A[ie].add(A[le].neg())):(be[1]=A[ie].toJ().mixedAdd(A[le]),be[2]=A[ie].toJ().mixedAdd(A[le].neg()));var we=[-3,-1,-5,-7,0,7,5,1,3],Ae=I(S[ie],S[le]);for(W=Math.max(Ae[0].length,W),D[ie]=new Array(W),D[le]=new Array(W),G=0;G<W;G++){var re=Ae[0][G]|0,N=Ae[1][G]|0;D[ie][G]=we[(re+1)*3+(N+1)],D[le][G]=0,L[ie]=be}}var z=this.jpoint(null,null,null),V=this._wnafT4;for(H=W;H>=0;H--){for(var U=0;H>=0;){var j=!0;for(G=0;G<k;G++)V[G]=D[G][H]|0,V[G]!==0&&(j=!1);if(!j)break;U++,H--}if(H>=0&&U++,z=z.dblp(U),H<0)break;for(G=0;G<k;G++){var $=V[G];$!==0&&($>0?Z=L[G][$-1>>1]:$<0&&(Z=L[G][-$-1>>1].neg()),Z.type==="affine"?z=z.mixedAdd(Z):z=z.add(Z))}}for(H=0;H<k;H++)L[H]=null;return B?z:z.toP()};function g(w,_){this.curve=w,this.type=_,this.precomputed=null}b.BasePoint=g,g.prototype.eq=function(){throw new Error("Not implemented")},g.prototype.validate=function(){return this.curve.validate(this)},b.prototype.decodePoint=function(_,A){_=T.toArray(_,A);var S=this.p.byteLength();if((_[0]===4||_[0]===6||_[0]===7)&&_.length-1===2*S){_[0]===6?m(_[_.length-1]%2===0):_[0]===7&&m(_[_.length-1]%2===1);var k=this.point(_.slice(1,1+S),_.slice(1+S,1+2*S));return k}else if((_[0]===2||_[0]===3)&&_.length-1===S)return this.pointFromX(_.slice(1,1+S),_[0]===3);throw new Error("Unknown point format")},g.prototype.encodeCompressed=function(_){return this.encode(_,!0)},g.prototype._encode=function(_){var A=this.curve.p.byteLength(),S=this.getX().toArray("be",A);return _?[this.getY().isEven()?2:3].concat(S):[4].concat(S,this.getY().toArray("be",A))},g.prototype.encode=function(_,A){return T.encode(this._encode(A),_)},g.prototype.precompute=function(_){if(this.precomputed)return this;var A={doubles:null,naf:null,beta:null};return A.naf=this._getNAFPoints(8),A.doubles=this._getDoubles(4,_),A.beta=this._getBeta(),this.precomputed=A,this},g.prototype._hasDoubles=function(_){if(!this.precomputed)return!1;var A=this.precomputed.doubles;return A?A.points.length>=Math.ceil((_.bitLength()+1)/A.step):!1},g.prototype._getDoubles=function(_,A){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var S=[this],k=this,B=0;B<A;B+=_){for(var O=0;O<_;O++)k=k.dbl();S.push(k)}return{step:_,points:S}},g.prototype._getNAFPoints=function(_){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var A=[this],S=(1<<_)-1,k=S===1?null:this.dbl(),B=1;B<S;B++)A[B]=A[B-1].add(k);return{wnd:_,points:A}},g.prototype._getBeta=function(){return null},g.prototype.dblp=function(_){for(var A=this,S=0;S<_;S++)A=A.dbl();return A}},83544:function(fe,p,x){"use strict";var v=x(9185),T=x(23364),C=x(91193),I=x(94499),m=v.assert;function b(w){this.twisted=(w.a|0)!==1,this.mOneA=this.twisted&&(w.a|0)===-1,this.extended=this.mOneA,I.call(this,"edwards",w),this.a=new T(w.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new T(w.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new T(w.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),m(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(w.c|0)===1}C(b,I),fe.exports=b,b.prototype._mulA=function(_){return this.mOneA?_.redNeg():this.a.redMul(_)},b.prototype._mulC=function(_){return this.oneC?_:this.c.redMul(_)},b.prototype.jpoint=function(_,A,S,k){return this.point(_,A,S,k)},b.prototype.pointFromX=function(_,A){_=new T(_,16),_.red||(_=_.toRed(this.red));var S=_.redSqr(),k=this.c2.redSub(this.a.redMul(S)),B=this.one.redSub(this.c2.redMul(this.d).redMul(S)),O=k.redMul(B.redInvm()),L=O.redSqrt();if(L.redSqr().redSub(O).cmp(this.zero)!==0)throw new Error("invalid point");var D=L.fromRed().isOdd();return(A&&!D||!A&&D)&&(L=L.redNeg()),this.point(_,L)},b.prototype.pointFromY=function(_,A){_=new T(_,16),_.red||(_=_.toRed(this.red));var S=_.redSqr(),k=S.redSub(this.c2),B=S.redMul(this.d).redMul(this.c2).redSub(this.a),O=k.redMul(B.redInvm());if(O.cmp(this.zero)===0){if(A)throw new Error("invalid point");return this.point(this.zero,_)}var L=O.redSqrt();if(L.redSqr().redSub(O).cmp(this.zero)!==0)throw new Error("invalid point");return L.fromRed().isOdd()!==A&&(L=L.redNeg()),this.point(L,_)},b.prototype.validate=function(_){if(_.isInfinity())return!0;_.normalize();var A=_.x.redSqr(),S=_.y.redSqr(),k=A.redMul(this.a).redAdd(S),B=this.c2.redMul(this.one.redAdd(this.d.redMul(A).redMul(S)));return k.cmp(B)===0};function g(w,_,A,S,k){I.BasePoint.call(this,w,"projective"),_===null&&A===null&&S===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new T(_,16),this.y=new T(A,16),this.z=S?new T(S,16):this.curve.one,this.t=k&&new T(k,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}C(g,I.BasePoint),b.prototype.pointFromJSON=function(_){return g.fromJSON(this,_)},b.prototype.point=function(_,A,S,k){return new g(this,_,A,S,k)},g.fromJSON=function(_,A){return new g(_,A[0],A[1],A[2])},g.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},g.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},g.prototype._extDbl=function(){var _=this.x.redSqr(),A=this.y.redSqr(),S=this.z.redSqr();S=S.redIAdd(S);var k=this.curve._mulA(_),B=this.x.redAdd(this.y).redSqr().redISub(_).redISub(A),O=k.redAdd(A),L=O.redSub(S),D=k.redSub(A),W=B.redMul(L),H=O.redMul(D),G=B.redMul(D),Z=L.redMul(O);return this.curve.point(W,H,Z,G)},g.prototype._projDbl=function(){var _=this.x.redAdd(this.y).redSqr(),A=this.x.redSqr(),S=this.y.redSqr(),k,B,O,L,D,W;if(this.curve.twisted){L=this.curve._mulA(A);var H=L.redAdd(S);this.zOne?(k=_.redSub(A).redSub(S).redMul(H.redSub(this.curve.two)),B=H.redMul(L.redSub(S)),O=H.redSqr().redSub(H).redSub(H)):(D=this.z.redSqr(),W=H.redSub(D).redISub(D),k=_.redSub(A).redISub(S).redMul(W),B=H.redMul(L.redSub(S)),O=H.redMul(W))}else L=A.redAdd(S),D=this.curve._mulC(this.z).redSqr(),W=L.redSub(D).redSub(D),k=this.curve._mulC(_.redISub(L)).redMul(W),B=this.curve._mulC(L).redMul(A.redISub(S)),O=L.redMul(W);return this.curve.point(k,B,O)},g.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},g.prototype._extAdd=function(_){var A=this.y.redSub(this.x).redMul(_.y.redSub(_.x)),S=this.y.redAdd(this.x).redMul(_.y.redAdd(_.x)),k=this.t.redMul(this.curve.dd).redMul(_.t),B=this.z.redMul(_.z.redAdd(_.z)),O=S.redSub(A),L=B.redSub(k),D=B.redAdd(k),W=S.redAdd(A),H=O.redMul(L),G=D.redMul(W),Z=O.redMul(W),Q=L.redMul(D);return this.curve.point(H,G,Q,Z)},g.prototype._projAdd=function(_){var A=this.z.redMul(_.z),S=A.redSqr(),k=this.x.redMul(_.x),B=this.y.redMul(_.y),O=this.curve.d.redMul(k).redMul(B),L=S.redSub(O),D=S.redAdd(O),W=this.x.redAdd(this.y).redMul(_.x.redAdd(_.y)).redISub(k).redISub(B),H=A.redMul(L).redMul(W),G,Z;return this.curve.twisted?(G=A.redMul(D).redMul(B.redSub(this.curve._mulA(k))),Z=L.redMul(D)):(G=A.redMul(D).redMul(B.redSub(k)),Z=this.curve._mulC(L).redMul(D)),this.curve.point(H,G,Z)},g.prototype.add=function(_){return this.isInfinity()?_:_.isInfinity()?this:this.curve.extended?this._extAdd(_):this._projAdd(_)},g.prototype.mul=function(_){return this._hasDoubles(_)?this.curve._fixedNafMul(this,_):this.curve._wnafMul(this,_)},g.prototype.mulAdd=function(_,A,S){return this.curve._wnafMulAdd(1,[this,A],[_,S],2,!1)},g.prototype.jmulAdd=function(_,A,S){return this.curve._wnafMulAdd(1,[this,A],[_,S],2,!0)},g.prototype.normalize=function(){if(this.zOne)return this;var _=this.z.redInvm();return this.x=this.x.redMul(_),this.y=this.y.redMul(_),this.t&&(this.t=this.t.redMul(_)),this.z=this.curve.one,this.zOne=!0,this},g.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},g.prototype.getX=function(){return this.normalize(),this.x.fromRed()},g.prototype.getY=function(){return this.normalize(),this.y.fromRed()},g.prototype.eq=function(_){return this===_||this.getX().cmp(_.getX())===0&&this.getY().cmp(_.getY())===0},g.prototype.eqXToP=function(_){var A=_.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(A)===0)return!0;for(var S=_.clone(),k=this.curve.redN.redMul(this.z);;){if(S.iadd(this.curve.n),S.cmp(this.curve.p)>=0)return!1;if(A.redIAdd(k),this.x.cmp(A)===0)return!0}},g.prototype.toP=g.prototype.normalize,g.prototype.mixedAdd=g.prototype.add},95228:function(fe,p,x){"use strict";var v=p;v.base=x(94499),v.short=x(53970),v.mont=x(50536),v.edwards=x(83544)},50536:function(fe,p,x){"use strict";var v=x(23364),T=x(91193),C=x(94499),I=x(9185);function m(g){C.call(this,"mont",g),this.a=new v(g.a,16).toRed(this.red),this.b=new v(g.b,16).toRed(this.red),this.i4=new v(4).toRed(this.red).redInvm(),this.two=new v(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}T(m,C),fe.exports=m,m.prototype.validate=function(w){var _=w.normalize().x,A=_.redSqr(),S=A.redMul(_).redAdd(A.redMul(this.a)).redAdd(_),k=S.redSqrt();return k.redSqr().cmp(S)===0};function b(g,w,_){C.BasePoint.call(this,g,"projective"),w===null&&_===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new v(w,16),this.z=new v(_,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}T(b,C.BasePoint),m.prototype.decodePoint=function(w,_){return this.point(I.toArray(w,_),1)},m.prototype.point=function(w,_){return new b(this,w,_)},m.prototype.pointFromJSON=function(w){return b.fromJSON(this,w)},b.prototype.precompute=function(){},b.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},b.fromJSON=function(w,_){return new b(w,_[0],_[1]||w.one)},b.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},b.prototype.isInfinity=function(){return this.z.cmpn(0)===0},b.prototype.dbl=function(){var w=this.x.redAdd(this.z),_=w.redSqr(),A=this.x.redSub(this.z),S=A.redSqr(),k=_.redSub(S),B=_.redMul(S),O=k.redMul(S.redAdd(this.curve.a24.redMul(k)));return this.curve.point(B,O)},b.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},b.prototype.diffAdd=function(w,_){var A=this.x.redAdd(this.z),S=this.x.redSub(this.z),k=w.x.redAdd(w.z),B=w.x.redSub(w.z),O=B.redMul(A),L=k.redMul(S),D=_.z.redMul(O.redAdd(L).redSqr()),W=_.x.redMul(O.redISub(L).redSqr());return this.curve.point(D,W)},b.prototype.mul=function(w){for(var _=w.clone(),A=this,S=this.curve.point(null,null),k=this,B=[];_.cmpn(0)!==0;_.iushrn(1))B.push(_.andln(1));for(var O=B.length-1;O>=0;O--)B[O]===0?(A=A.diffAdd(S,k),S=S.dbl()):(S=A.diffAdd(S,k),A=A.dbl());return S},b.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},b.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},b.prototype.eq=function(w){return this.getX().cmp(w.getX())===0},b.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},b.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},53970:function(fe,p,x){"use strict";var v=x(9185),T=x(23364),C=x(91193),I=x(94499),m=v.assert;function b(_){I.call(this,"short",_),this.a=new T(_.a,16).toRed(this.red),this.b=new T(_.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(_),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}C(b,I),fe.exports=b,b.prototype._getEndomorphism=function(A){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var S,k;if(A.beta)S=new T(A.beta,16).toRed(this.red);else{var B=this._getEndoRoots(this.p);S=B[0].cmp(B[1])<0?B[0]:B[1],S=S.toRed(this.red)}if(A.lambda)k=new T(A.lambda,16);else{var O=this._getEndoRoots(this.n);this.g.mul(O[0]).x.cmp(this.g.x.redMul(S))===0?k=O[0]:(k=O[1],m(this.g.mul(k).x.cmp(this.g.x.redMul(S))===0))}var L;return A.basis?L=A.basis.map(function(D){return{a:new T(D.a,16),b:new T(D.b,16)}}):L=this._getEndoBasis(k),{beta:S,lambda:k,basis:L}}},b.prototype._getEndoRoots=function(A){var S=A===this.p?this.red:T.mont(A),k=new T(2).toRed(S).redInvm(),B=k.redNeg(),O=new T(3).toRed(S).redNeg().redSqrt().redMul(k),L=B.redAdd(O).fromRed(),D=B.redSub(O).fromRed();return[L,D]},b.prototype._getEndoBasis=function(A){for(var S=this.n.ushrn(Math.floor(this.n.bitLength()/2)),k=A,B=this.n.clone(),O=new T(1),L=new T(0),D=new T(0),W=new T(1),H,G,Z,Q,ie,le,be,we=0,Ae,re;k.cmpn(0)!==0;){var N=B.div(k);Ae=B.sub(N.mul(k)),re=D.sub(N.mul(O));var z=W.sub(N.mul(L));if(!Z&&Ae.cmp(S)<0)H=be.neg(),G=O,Z=Ae.neg(),Q=re;else if(Z&&++we===2)break;be=Ae,B=k,k=Ae,D=O,O=re,W=L,L=z}ie=Ae.neg(),le=re;var V=Z.sqr().add(Q.sqr()),U=ie.sqr().add(le.sqr());return U.cmp(V)>=0&&(ie=H,le=G),Z.negative&&(Z=Z.neg(),Q=Q.neg()),ie.negative&&(ie=ie.neg(),le=le.neg()),[{a:Z,b:Q},{a:ie,b:le}]},b.prototype._endoSplit=function(A){var S=this.endo.basis,k=S[0],B=S[1],O=B.b.mul(A).divRound(this.n),L=k.b.neg().mul(A).divRound(this.n),D=O.mul(k.a),W=L.mul(B.a),H=O.mul(k.b),G=L.mul(B.b),Z=A.sub(D).sub(W),Q=H.add(G).neg();return{k1:Z,k2:Q}},b.prototype.pointFromX=function(A,S){A=new T(A,16),A.red||(A=A.toRed(this.red));var k=A.redSqr().redMul(A).redIAdd(A.redMul(this.a)).redIAdd(this.b),B=k.redSqrt();if(B.redSqr().redSub(k).cmp(this.zero)!==0)throw new Error("invalid point");var O=B.fromRed().isOdd();return(S&&!O||!S&&O)&&(B=B.redNeg()),this.point(A,B)},b.prototype.validate=function(A){if(A.inf)return!0;var S=A.x,k=A.y,B=this.a.redMul(S),O=S.redSqr().redMul(S).redIAdd(B).redIAdd(this.b);return k.redSqr().redISub(O).cmpn(0)===0},b.prototype._endoWnafMulAdd=function(A,S,k){for(var B=this._endoWnafT1,O=this._endoWnafT2,L=0;L<A.length;L++){var D=this._endoSplit(S[L]),W=A[L],H=W._getBeta();D.k1.negative&&(D.k1.ineg(),W=W.neg(!0)),D.k2.negative&&(D.k2.ineg(),H=H.neg(!0)),B[L*2]=W,B[L*2+1]=H,O[L*2]=D.k1,O[L*2+1]=D.k2}for(var G=this._wnafMulAdd(1,B,O,L*2,k),Z=0;Z<L*2;Z++)B[Z]=null,O[Z]=null;return G};function g(_,A,S,k){I.BasePoint.call(this,_,"affine"),A===null&&S===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new T(A,16),this.y=new T(S,16),k&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}C(g,I.BasePoint),b.prototype.point=function(A,S,k){return new g(this,A,S,k)},b.prototype.pointFromJSON=function(A,S){return g.fromJSON(this,A,S)},g.prototype._getBeta=function(){if(this.curve.endo){var A=this.precomputed;if(A&&A.beta)return A.beta;var S=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(A){var k=this.curve,B=function(O){return k.point(O.x.redMul(k.endo.beta),O.y)};A.beta=S,S.precomputed={beta:null,naf:A.naf&&{wnd:A.naf.wnd,points:A.naf.points.map(B)},doubles:A.doubles&&{step:A.doubles.step,points:A.doubles.points.map(B)}}}return S}},g.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},g.fromJSON=function(A,S,k){typeof S=="string"&&(S=JSON.parse(S));var B=A.point(S[0],S[1],k);if(!S[2])return B;function O(D){return A.point(D[0],D[1],k)}var L=S[2];return B.precomputed={beta:null,doubles:L.doubles&&{step:L.doubles.step,points:[B].concat(L.doubles.points.map(O))},naf:L.naf&&{wnd:L.naf.wnd,points:[B].concat(L.naf.points.map(O))}},B},g.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},g.prototype.isInfinity=function(){return this.inf},g.prototype.add=function(A){if(this.inf)return A;if(A.inf)return this;if(this.eq(A))return this.dbl();if(this.neg().eq(A))return this.curve.point(null,null);if(this.x.cmp(A.x)===0)return this.curve.point(null,null);var S=this.y.redSub(A.y);S.cmpn(0)!==0&&(S=S.redMul(this.x.redSub(A.x).redInvm()));var k=S.redSqr().redISub(this.x).redISub(A.x),B=S.redMul(this.x.redSub(k)).redISub(this.y);return this.curve.point(k,B)},g.prototype.dbl=function(){if(this.inf)return this;var A=this.y.redAdd(this.y);if(A.cmpn(0)===0)return this.curve.point(null,null);var S=this.curve.a,k=this.x.redSqr(),B=A.redInvm(),O=k.redAdd(k).redIAdd(k).redIAdd(S).redMul(B),L=O.redSqr().redISub(this.x.redAdd(this.x)),D=O.redMul(this.x.redSub(L)).redISub(this.y);return this.curve.point(L,D)},g.prototype.getX=function(){return this.x.fromRed()},g.prototype.getY=function(){return this.y.fromRed()},g.prototype.mul=function(A){return A=new T(A,16),this.isInfinity()?this:this._hasDoubles(A)?this.curve._fixedNafMul(this,A):this.curve.endo?this.curve._endoWnafMulAdd([this],[A]):this.curve._wnafMul(this,A)},g.prototype.mulAdd=function(A,S,k){var B=[this,S],O=[A,k];return this.curve.endo?this.curve._endoWnafMulAdd(B,O):this.curve._wnafMulAdd(1,B,O,2)},g.prototype.jmulAdd=function(A,S,k){var B=[this,S],O=[A,k];return this.curve.endo?this.curve._endoWnafMulAdd(B,O,!0):this.curve._wnafMulAdd(1,B,O,2,!0)},g.prototype.eq=function(A){return this===A||this.inf===A.inf&&(this.inf||this.x.cmp(A.x)===0&&this.y.cmp(A.y)===0)},g.prototype.neg=function(A){if(this.inf)return this;var S=this.curve.point(this.x,this.y.redNeg());if(A&&this.precomputed){var k=this.precomputed,B=function(O){return O.neg()};S.precomputed={naf:k.naf&&{wnd:k.naf.wnd,points:k.naf.points.map(B)},doubles:k.doubles&&{step:k.doubles.step,points:k.doubles.points.map(B)}}}return S},g.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var A=this.curve.jpoint(this.x,this.y,this.curve.one);return A};function w(_,A,S,k){I.BasePoint.call(this,_,"jacobian"),A===null&&S===null&&k===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new T(0)):(this.x=new T(A,16),this.y=new T(S,16),this.z=new T(k,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}C(w,I.BasePoint),b.prototype.jpoint=function(A,S,k){return new w(this,A,S,k)},w.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var A=this.z.redInvm(),S=A.redSqr(),k=this.x.redMul(S),B=this.y.redMul(S).redMul(A);return this.curve.point(k,B)},w.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},w.prototype.add=function(A){if(this.isInfinity())return A;if(A.isInfinity())return this;var S=A.z.redSqr(),k=this.z.redSqr(),B=this.x.redMul(S),O=A.x.redMul(k),L=this.y.redMul(S.redMul(A.z)),D=A.y.redMul(k.redMul(this.z)),W=B.redSub(O),H=L.redSub(D);if(W.cmpn(0)===0)return H.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var G=W.redSqr(),Z=G.redMul(W),Q=B.redMul(G),ie=H.redSqr().redIAdd(Z).redISub(Q).redISub(Q),le=H.redMul(Q.redISub(ie)).redISub(L.redMul(Z)),be=this.z.redMul(A.z).redMul(W);return this.curve.jpoint(ie,le,be)},w.prototype.mixedAdd=function(A){if(this.isInfinity())return A.toJ();if(A.isInfinity())return this;var S=this.z.redSqr(),k=this.x,B=A.x.redMul(S),O=this.y,L=A.y.redMul(S).redMul(this.z),D=k.redSub(B),W=O.redSub(L);if(D.cmpn(0)===0)return W.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var H=D.redSqr(),G=H.redMul(D),Z=k.redMul(H),Q=W.redSqr().redIAdd(G).redISub(Z).redISub(Z),ie=W.redMul(Z.redISub(Q)).redISub(O.redMul(G)),le=this.z.redMul(D);return this.curve.jpoint(Q,ie,le)},w.prototype.dblp=function(A){if(A===0)return this;if(this.isInfinity())return this;if(!A)return this.dbl();var S;if(this.curve.zeroA||this.curve.threeA){var k=this;for(S=0;S<A;S++)k=k.dbl();return k}var B=this.curve.a,O=this.curve.tinv,L=this.x,D=this.y,W=this.z,H=W.redSqr().redSqr(),G=D.redAdd(D);for(S=0;S<A;S++){var Z=L.redSqr(),Q=G.redSqr(),ie=Q.redSqr(),le=Z.redAdd(Z).redIAdd(Z).redIAdd(B.redMul(H)),be=L.redMul(Q),we=le.redSqr().redISub(be.redAdd(be)),Ae=be.redISub(we),re=le.redMul(Ae);re=re.redIAdd(re).redISub(ie);var N=G.redMul(W);S+1<A&&(H=H.redMul(ie)),L=we,W=N,G=re}return this.curve.jpoint(L,G.redMul(O),W)},w.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},w.prototype._zeroDbl=function(){var A,S,k;if(this.zOne){var B=this.x.redSqr(),O=this.y.redSqr(),L=O.redSqr(),D=this.x.redAdd(O).redSqr().redISub(B).redISub(L);D=D.redIAdd(D);var W=B.redAdd(B).redIAdd(B),H=W.redSqr().redISub(D).redISub(D),G=L.redIAdd(L);G=G.redIAdd(G),G=G.redIAdd(G),A=H,S=W.redMul(D.redISub(H)).redISub(G),k=this.y.redAdd(this.y)}else{var Z=this.x.redSqr(),Q=this.y.redSqr(),ie=Q.redSqr(),le=this.x.redAdd(Q).redSqr().redISub(Z).redISub(ie);le=le.redIAdd(le);var be=Z.redAdd(Z).redIAdd(Z),we=be.redSqr(),Ae=ie.redIAdd(ie);Ae=Ae.redIAdd(Ae),Ae=Ae.redIAdd(Ae),A=we.redISub(le).redISub(le),S=be.redMul(le.redISub(A)).redISub(Ae),k=this.y.redMul(this.z),k=k.redIAdd(k)}return this.curve.jpoint(A,S,k)},w.prototype._threeDbl=function(){var A,S,k;if(this.zOne){var B=this.x.redSqr(),O=this.y.redSqr(),L=O.redSqr(),D=this.x.redAdd(O).redSqr().redISub(B).redISub(L);D=D.redIAdd(D);var W=B.redAdd(B).redIAdd(B).redIAdd(this.curve.a),H=W.redSqr().redISub(D).redISub(D);A=H;var G=L.redIAdd(L);G=G.redIAdd(G),G=G.redIAdd(G),S=W.redMul(D.redISub(H)).redISub(G),k=this.y.redAdd(this.y)}else{var Z=this.z.redSqr(),Q=this.y.redSqr(),ie=this.x.redMul(Q),le=this.x.redSub(Z).redMul(this.x.redAdd(Z));le=le.redAdd(le).redIAdd(le);var be=ie.redIAdd(ie);be=be.redIAdd(be);var we=be.redAdd(be);A=le.redSqr().redISub(we),k=this.y.redAdd(this.z).redSqr().redISub(Q).redISub(Z);var Ae=Q.redSqr();Ae=Ae.redIAdd(Ae),Ae=Ae.redIAdd(Ae),Ae=Ae.redIAdd(Ae),S=le.redMul(be.redISub(A)).redISub(Ae)}return this.curve.jpoint(A,S,k)},w.prototype._dbl=function(){var A=this.curve.a,S=this.x,k=this.y,B=this.z,O=B.redSqr().redSqr(),L=S.redSqr(),D=k.redSqr(),W=L.redAdd(L).redIAdd(L).redIAdd(A.redMul(O)),H=S.redAdd(S);H=H.redIAdd(H);var G=H.redMul(D),Z=W.redSqr().redISub(G.redAdd(G)),Q=G.redISub(Z),ie=D.redSqr();ie=ie.redIAdd(ie),ie=ie.redIAdd(ie),ie=ie.redIAdd(ie);var le=W.redMul(Q).redISub(ie),be=k.redAdd(k).redMul(B);return this.curve.jpoint(Z,le,be)},w.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var A=this.x.redSqr(),S=this.y.redSqr(),k=this.z.redSqr(),B=S.redSqr(),O=A.redAdd(A).redIAdd(A),L=O.redSqr(),D=this.x.redAdd(S).redSqr().redISub(A).redISub(B);D=D.redIAdd(D),D=D.redAdd(D).redIAdd(D),D=D.redISub(L);var W=D.redSqr(),H=B.redIAdd(B);H=H.redIAdd(H),H=H.redIAdd(H),H=H.redIAdd(H);var G=O.redIAdd(D).redSqr().redISub(L).redISub(W).redISub(H),Z=S.redMul(G);Z=Z.redIAdd(Z),Z=Z.redIAdd(Z);var Q=this.x.redMul(W).redISub(Z);Q=Q.redIAdd(Q),Q=Q.redIAdd(Q);var ie=this.y.redMul(G.redMul(H.redISub(G)).redISub(D.redMul(W)));ie=ie.redIAdd(ie),ie=ie.redIAdd(ie),ie=ie.redIAdd(ie);var le=this.z.redAdd(D).redSqr().redISub(k).redISub(W);return this.curve.jpoint(Q,ie,le)},w.prototype.mul=function(A,S){return A=new T(A,S),this.curve._wnafMul(this,A)},w.prototype.eq=function(A){if(A.type==="affine")return this.eq(A.toJ());if(this===A)return!0;var S=this.z.redSqr(),k=A.z.redSqr();if(this.x.redMul(k).redISub(A.x.redMul(S)).cmpn(0)!==0)return!1;var B=S.redMul(this.z),O=k.redMul(A.z);return this.y.redMul(O).redISub(A.y.redMul(B)).cmpn(0)===0},w.prototype.eqXToP=function(A){var S=this.z.redSqr(),k=A.toRed(this.curve.red).redMul(S);if(this.x.cmp(k)===0)return!0;for(var B=A.clone(),O=this.curve.redN.redMul(S);;){if(B.iadd(this.curve.n),B.cmp(this.curve.p)>=0)return!1;if(k.redIAdd(O),this.x.cmp(k)===0)return!0}},w.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},w.prototype.isInfinity=function(){return this.z.cmpn(0)===0}},25366:function(fe,p,x){"use strict";var v=p,T=x(61631),C=x(95228),I=x(9185),m=I.assert;function b(_){_.type==="short"?this.curve=new C.short(_):_.type==="edwards"?this.curve=new C.edwards(_):this.curve=new C.mont(_),this.g=this.curve.g,this.n=this.curve.n,this.hash=_.hash,m(this.g.validate(),"Invalid curve"),m(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}v.PresetCurve=b;function g(_,A){Object.defineProperty(v,_,{configurable:!0,enumerable:!0,get:function(){var S=new b(A);return Object.defineProperty(v,_,{configurable:!0,enumerable:!0,value:S}),S}})}g("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:T.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),g("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:T.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),g("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:T.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),g("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:T.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),g("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:T.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),g("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:T.sha256,gRed:!1,g:["9"]}),g("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:T.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var w;try{w=x(67153)}catch{w=void 0}g("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:T.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",w]})},72961:function(fe,p,x){"use strict";var v=x(23364),T=x(52519),C=x(9185),I=x(25366),m=x(65442),b=C.assert,g=x(5666),w=x(44375);function _(A){if(!(this instanceof _))return new _(A);typeof A=="string"&&(b(Object.prototype.hasOwnProperty.call(I,A),"Unknown curve "+A),A=I[A]),A instanceof I.PresetCurve&&(A={curve:A}),this.curve=A.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=A.curve.g,this.g.precompute(A.curve.n.bitLength()+1),this.hash=A.hash||A.curve.hash}fe.exports=_,_.prototype.keyPair=function(S){return new g(this,S)},_.prototype.keyFromPrivate=function(S,k){return g.fromPrivate(this,S,k)},_.prototype.keyFromPublic=function(S,k){return g.fromPublic(this,S,k)},_.prototype.genKeyPair=function(S){S||(S={});for(var k=new T({hash:this.hash,pers:S.pers,persEnc:S.persEnc||"utf8",entropy:S.entropy||m(this.hash.hmacStrength),entropyEnc:S.entropy&&S.entropyEnc||"utf8",nonce:this.n.toArray()}),B=this.n.byteLength(),O=this.n.sub(new v(2));;){var L=new v(k.generate(B));if(!(L.cmp(O)>0))return L.iaddn(1),this.keyFromPrivate(L)}},_.prototype._truncateToN=function(S,k,B){var O;if(v.isBN(S)||typeof S=="number")S=new v(S,16),O=S.byteLength();else if(typeof S=="object")O=S.length,S=new v(S,16);else{var L=S.toString();O=L.length+1>>>1,S=new v(L,16)}typeof B!="number"&&(B=O*8);var D=B-this.n.bitLength();return D>0&&(S=S.ushrn(D)),!k&&S.cmp(this.n)>=0?S.sub(this.n):S},_.prototype.sign=function(S,k,B,O){if(typeof B=="object"&&(O=B,B=null),O||(O={}),typeof S!="string"&&typeof S!="number"&&!v.isBN(S)){b(typeof S=="object"&&S&&typeof S.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),b(S.length>>>0===S.length);for(var L=0;L<S.length;L++)b((S[L]&255)===S[L])}k=this.keyFromPrivate(k,B),S=this._truncateToN(S,!1,O.msgBitLength),b(!S.isNeg(),"Can not sign a negative message");var D=this.n.byteLength(),W=k.getPrivate().toArray("be",D),H=S.toArray("be",D);b(new v(H).eq(S),"Can not sign message");for(var G=new T({hash:this.hash,entropy:W,nonce:H,pers:O.pers,persEnc:O.persEnc||"utf8"}),Z=this.n.sub(new v(1)),Q=0;;Q++){var ie=O.k?O.k(Q):new v(G.generate(this.n.byteLength()));if(ie=this._truncateToN(ie,!0),!(ie.cmpn(1)<=0||ie.cmp(Z)>=0)){var le=this.g.mul(ie);if(!le.isInfinity()){var be=le.getX(),we=be.umod(this.n);if(we.cmpn(0)!==0){var Ae=ie.invm(this.n).mul(we.mul(k.getPrivate()).iadd(S));if(Ae=Ae.umod(this.n),Ae.cmpn(0)!==0){var re=(le.getY().isOdd()?1:0)|(be.cmp(we)!==0?2:0);return O.canonical&&Ae.cmp(this.nh)>0&&(Ae=this.n.sub(Ae),re^=1),new w({r:we,s:Ae,recoveryParam:re})}}}}}},_.prototype.verify=function(S,k,B,O,L){L||(L={}),S=this._truncateToN(S,!1,L.msgBitLength),B=this.keyFromPublic(B,O),k=new w(k,"hex");var D=k.r,W=k.s;if(D.cmpn(1)<0||D.cmp(this.n)>=0||W.cmpn(1)<0||W.cmp(this.n)>=0)return!1;var H=W.invm(this.n),G=H.mul(S).umod(this.n),Z=H.mul(D).umod(this.n),Q;return this.curve._maxwellTrick?(Q=this.g.jmulAdd(G,B.getPublic(),Z),Q.isInfinity()?!1:Q.eqXToP(D)):(Q=this.g.mulAdd(G,B.getPublic(),Z),Q.isInfinity()?!1:Q.getX().umod(this.n).cmp(D)===0)},_.prototype.recoverPubKey=function(A,S,k,B){b((3&k)===k,"The recovery param is more than two bits"),S=new w(S,B);var O=this.n,L=new v(A),D=S.r,W=S.s,H=k&1,G=k>>1;if(D.cmp(this.curve.p.umod(this.curve.n))>=0&&G)throw new Error("Unable to find sencond key candinate");G?D=this.curve.pointFromX(D.add(this.curve.n),H):D=this.curve.pointFromX(D,H);var Z=S.r.invm(O),Q=O.sub(L).mul(Z).umod(O),ie=W.mul(Z).umod(O);return this.g.mulAdd(Q,D,ie)},_.prototype.getKeyRecoveryParam=function(A,S,k,B){if(S=new w(S,B),S.recoveryParam!==null)return S.recoveryParam;for(var O=0;O<4;O++){var L;try{L=this.recoverPubKey(A,S,O)}catch{continue}if(L.eq(k))return O}throw new Error("Unable to find valid recovery factor")}},5666:function(fe,p,x){"use strict";var v=x(23364),T=x(9185),C=T.assert;function I(m,b){this.ec=m,this.priv=null,this.pub=null,b.priv&&this._importPrivate(b.priv,b.privEnc),b.pub&&this._importPublic(b.pub,b.pubEnc)}fe.exports=I,I.fromPublic=function(b,g,w){return g instanceof I?g:new I(b,{pub:g,pubEnc:w})},I.fromPrivate=function(b,g,w){return g instanceof I?g:new I(b,{priv:g,privEnc:w})},I.prototype.validate=function(){var b=this.getPublic();return b.isInfinity()?{result:!1,reason:"Invalid public key"}:b.validate()?b.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},I.prototype.getPublic=function(b,g){return typeof b=="string"&&(g=b,b=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),g?this.pub.encode(g,b):this.pub},I.prototype.getPrivate=function(b){return b==="hex"?this.priv.toString(16,2):this.priv},I.prototype._importPrivate=function(b,g){this.priv=new v(b,g||16),this.priv=this.priv.umod(this.ec.curve.n)},I.prototype._importPublic=function(b,g){if(b.x||b.y){this.ec.curve.type==="mont"?C(b.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&C(b.x&&b.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(b.x,b.y);return}this.pub=this.ec.curve.decodePoint(b,g)},I.prototype.derive=function(b){return b.validate()||C(b.validate(),"public point not validated"),b.mul(this.priv).getX()},I.prototype.sign=function(b,g,w){return this.ec.sign(b,this,g,w)},I.prototype.verify=function(b,g,w){return this.ec.verify(b,g,this,void 0,w)},I.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},44375:function(fe,p,x){"use strict";var v=x(23364),T=x(9185),C=T.assert;function I(_,A){if(_ instanceof I)return _;this._importDER(_,A)||(C(_.r&&_.s,"Signature without r or s"),this.r=new v(_.r,16),this.s=new v(_.s,16),_.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=_.recoveryParam)}fe.exports=I;function m(){this.place=0}function b(_,A){var S=_[A.place++];if(!(S&128))return S;var k=S&15;if(k===0||k>4||_[A.place]===0)return!1;for(var B=0,O=0,L=A.place;O<k;O++,L++)B<<=8,B|=_[L],B>>>=0;return B<=127?!1:(A.place=L,B)}function g(_){for(var A=0,S=_.length-1;!_[A]&&!(_[A+1]&128)&&A<S;)A++;return A===0?_:_.slice(A)}I.prototype._importDER=function(A,S){A=T.toArray(A,S);var k=new m;if(A[k.place++]!==48)return!1;var B=b(A,k);if(B===!1||B+k.place!==A.length||A[k.place++]!==2)return!1;var O=b(A,k);if(O===!1||A[k.place]&128)return!1;var L=A.slice(k.place,O+k.place);if(k.place+=O,A[k.place++]!==2)return!1;var D=b(A,k);if(D===!1||A.length!==D+k.place||A[k.place]&128)return!1;var W=A.slice(k.place,D+k.place);if(L[0]===0)if(L[1]&128)L=L.slice(1);else return!1;if(W[0]===0)if(W[1]&128)W=W.slice(1);else return!1;return this.r=new v(L),this.s=new v(W),this.recoveryParam=null,!0};function w(_,A){if(A<128){_.push(A);return}var S=1+(Math.log(A)/Math.LN2>>>3);for(_.push(S|128);--S;)_.push(A>>>(S<<3)&255);_.push(A)}I.prototype.toDER=function(A){var S=this.r.toArray(),k=this.s.toArray();for(S[0]&128&&(S=[0].concat(S)),k[0]&128&&(k=[0].concat(k)),S=g(S),k=g(k);!k[0]&&!(k[1]&128);)k=k.slice(1);var B=[2];w(B,S.length),B=B.concat(S),B.push(2),w(B,k.length);var O=B.concat(k),L=[48];return w(L,O.length),L=L.concat(O),T.encode(L,A)}},87808:function(fe,p,x){"use strict";var v=x(61631),T=x(25366),C=x(9185),I=C.assert,m=C.parseBytes,b=x(36419),g=x(95406);function w(_){if(I(_==="ed25519","only tested with ed25519 so far"),!(this instanceof w))return new w(_);_=T[_].curve,this.curve=_,this.g=_.g,this.g.precompute(_.n.bitLength()+1),this.pointClass=_.point().constructor,this.encodingLength=Math.ceil(_.n.bitLength()/8),this.hash=v.sha512}fe.exports=w,w.prototype.sign=function(A,S){A=m(A);var k=this.keyFromSecret(S),B=this.hashInt(k.messagePrefix(),A),O=this.g.mul(B),L=this.encodePoint(O),D=this.hashInt(L,k.pubBytes(),A).mul(k.priv()),W=B.add(D).umod(this.curve.n);return this.makeSignature({R:O,S:W,Rencoded:L})},w.prototype.verify=function(A,S,k){if(A=m(A),S=this.makeSignature(S),S.S().gte(S.eddsa.curve.n)||S.S().isNeg())return!1;var B=this.keyFromPublic(k),O=this.hashInt(S.Rencoded(),B.pubBytes(),A),L=this.g.mul(S.S()),D=S.R().add(B.pub().mul(O));return D.eq(L)},w.prototype.hashInt=function(){for(var A=this.hash(),S=0;S<arguments.length;S++)A.update(arguments[S]);return C.intFromLE(A.digest()).umod(this.curve.n)},w.prototype.keyFromPublic=function(A){return b.fromPublic(this,A)},w.prototype.keyFromSecret=function(A){return b.fromSecret(this,A)},w.prototype.makeSignature=function(A){return A instanceof g?A:new g(this,A)},w.prototype.encodePoint=function(A){var S=A.getY().toArray("le",this.encodingLength);return S[this.encodingLength-1]|=A.getX().isOdd()?128:0,S},w.prototype.decodePoint=function(A){A=C.parseBytes(A);var S=A.length-1,k=A.slice(0,S).concat(A[S]&-129),B=(A[S]&128)!==0,O=C.intFromLE(k);return this.curve.pointFromY(O,B)},w.prototype.encodeInt=function(A){return A.toArray("le",this.encodingLength)},w.prototype.decodeInt=function(A){return C.intFromLE(A)},w.prototype.isPoint=function(A){return A instanceof this.pointClass}},36419:function(fe,p,x){"use strict";var v=x(9185),T=v.assert,C=v.parseBytes,I=v.cachedProperty;function m(b,g){this.eddsa=b,this._secret=C(g.secret),b.isPoint(g.pub)?this._pub=g.pub:this._pubBytes=C(g.pub)}m.fromPublic=function(g,w){return w instanceof m?w:new m(g,{pub:w})},m.fromSecret=function(g,w){return w instanceof m?w:new m(g,{secret:w})},m.prototype.secret=function(){return this._secret},I(m,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),I(m,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),I(m,"privBytes",function(){var g=this.eddsa,w=this.hash(),_=g.encodingLength-1,A=w.slice(0,g.encodingLength);return A[0]&=248,A[_]&=127,A[_]|=64,A}),I(m,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),I(m,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),I(m,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),m.prototype.sign=function(g){return T(this._secret,"KeyPair can only verify"),this.eddsa.sign(g,this)},m.prototype.verify=function(g,w){return this.eddsa.verify(g,w,this)},m.prototype.getSecret=function(g){return T(this._secret,"KeyPair is public only"),v.encode(this.secret(),g)},m.prototype.getPublic=function(g){return v.encode(this.pubBytes(),g)},fe.exports=m},95406:function(fe,p,x){"use strict";var v=x(23364),T=x(9185),C=T.assert,I=T.cachedProperty,m=T.parseBytes;function b(g,w){this.eddsa=g,typeof w!="object"&&(w=m(w)),Array.isArray(w)&&(C(w.length===g.encodingLength*2,"Signature has invalid size"),w={R:w.slice(0,g.encodingLength),S:w.slice(g.encodingLength)}),C(w.R&&w.S,"Signature without R or S"),g.isPoint(w.R)&&(this._R=w.R),w.S instanceof v&&(this._S=w.S),this._Rencoded=Array.isArray(w.R)?w.R:w.Rencoded,this._Sencoded=Array.isArray(w.S)?w.S:w.Sencoded}I(b,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),I(b,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),I(b,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),I(b,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),b.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},b.prototype.toHex=function(){return T.encode(this.toBytes(),"hex").toUpperCase()},fe.exports=b},67153:function(fe){fe.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},9185:function(fe,p,x){"use strict";var v=p,T=x(23364),C=x(35578),I=x(94209);v.assert=C,v.toArray=I.toArray,v.zero2=I.zero2,v.toHex=I.toHex,v.encode=I.encode;function m(A,S,k){var B=new Array(Math.max(A.bitLength(),k)+1),O;for(O=0;O<B.length;O+=1)B[O]=0;var L=1<<S+1,D=A.clone();for(O=0;O<B.length;O++){var W,H=D.andln(L-1);D.isOdd()?(H>(L>>1)-1?W=(L>>1)-H:W=H,D.isubn(W)):W=0,B[O]=W,D.iushrn(1)}return B}v.getNAF=m;function b(A,S){var k=[[],[]];A=A.clone(),S=S.clone();for(var B=0,O=0,L;A.cmpn(-B)>0||S.cmpn(-O)>0;){var D=A.andln(3)+B&3,W=S.andln(3)+O&3;D===3&&(D=-1),W===3&&(W=-1);var H;D&1?(L=A.andln(7)+B&7,(L===3||L===5)&&W===2?H=-D:H=D):H=0,k[0].push(H);var G;W&1?(L=S.andln(7)+O&7,(L===3||L===5)&&D===2?G=-W:G=W):G=0,k[1].push(G),2*B===H+1&&(B=1-B),2*O===G+1&&(O=1-O),A.iushrn(1),S.iushrn(1)}return k}v.getJSF=b;function g(A,S,k){var B="_"+S;A.prototype[S]=function(){return this[B]!==void 0?this[B]:this[B]=k.call(this)}}v.cachedProperty=g;function w(A){return typeof A=="string"?v.toArray(A,"hex"):A}v.parseBytes=w;function _(A){return new T(A,"hex","le")}v.intFromLE=_},39886:function(fe){"use strict";var p=Object.defineProperty||!1;if(p)try{p({},"a",{value:1})}catch{p=!1}fe.exports=p},38004:function(fe){"use strict";fe.exports=EvalError},41488:function(fe){"use strict";fe.exports=Error},96469:function(fe){"use strict";fe.exports=RangeError},12557:function(fe){"use strict";fe.exports=ReferenceError},63429:function(fe){"use strict";fe.exports=SyntaxError},71102:function(fe){"use strict";fe.exports=TypeError},85966:function(fe){"use strict";fe.exports=URIError},25153:function(fe){"use strict";fe.exports=Object},83546:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});function T(C){return function(I){var m=C();return m.update(I),v.from(m.digest())}}p.createHashFunction=T},72660:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0});var v=x(83546),T=x(86876);p.keccak224=v.createHashFunction(function(){return T("keccak224")}),p.keccak256=v.createHashFunction(function(){return T("keccak256")}),p.keccak384=v.createHashFunction(function(){return T("keccak384")}),p.keccak512=v.createHashFunction(function(){return T("keccak512")})},14757:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0});var v=x(82869);function T(I){return new Promise(function(m,b){v(I,function(g,w){if(g){b(g);return}m(w)})})}p.getRandomBytes=T;function C(I){return v(I)}p.getRandomBytesSync=C},1532:function(fe,p,x){"use strict";var v=this&&this.__awaiter||function(_,A,S,k){function B(O){return O instanceof S?O:new S(function(L){L(O)})}return new(S||(S=Promise))(function(O,L){function D(G){try{H(k.next(G))}catch(Z){L(Z)}}function W(G){try{H(k.throw(G))}catch(Z){L(Z)}}function H(G){G.done?O(G.value):B(G.value).then(D,W)}H((k=k.apply(_,A||[])).next())})},T=this&&this.__generator||function(_,A){var S={label:0,sent:function(){if(O[0]&1)throw O[1];return O[1]},trys:[],ops:[]},k,B,O,L;return L={next:D(0),throw:D(1),return:D(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function D(H){return function(G){return W([H,G])}}function W(H){if(k)throw new TypeError("Generator is already executing.");for(;S;)try{if(k=1,B&&(O=H[0]&2?B.return:H[0]?B.throw||((O=B.return)&&O.call(B),0):B.next)&&!(O=O.call(B,H[1])).done)return O;switch(B=0,O&&(H=[H[0]&2,O.value]),H[0]){case 0:case 1:O=H;break;case 4:return S.label++,{value:H[1],done:!1};case 5:S.label++,B=H[1],H=[0];continue;case 7:H=S.ops.pop(),S.trys.pop();continue;default:if(O=S.trys,!(O=O.length>0&&O[O.length-1])&&(H[0]===6||H[0]===2)){S=0;continue}if(H[0]===3&&(!O||H[1]>O[0]&&H[1]<O[3])){S.label=H[1];break}if(H[0]===6&&S.label<O[1]){S.label=O[1],O=H;break}if(O&&S.label<O[2]){S.label=O[2],S.ops.push(H);break}O[2]&&S.ops.pop(),S.trys.pop();continue}H=A.call(_,S)}catch(G){H=[6,G],B=0}finally{k=O=0}if(H[0]&5)throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}};function C(_){for(var A in _)p.hasOwnProperty(A)||(p[A]=_[A])}Object.defineProperty(p,"__esModule",{value:!0});var I=x(44455),m=x(14757),b=32;function g(){return v(this,void 0,void 0,function(){var _;return T(this,function(A){switch(A.label){case 0:return[4,m.getRandomBytes(b)];case 1:return _=A.sent(),I.privateKeyVerify(_)?[2,_]:[3,0];case 2:return[2]}})})}p.createPrivateKey=g;function w(){for(;;){var _=m.getRandomBytesSync(b);if(I.privateKeyVerify(_))return _}}p.createPrivateKeySync=w,C(x(44455))},60344:function(fe,p,x){fe.exports=x(48852)},48852:function(fe,p,x){var v=x(36533).Buffer;const T=x(30162),C=x(54619);var I=function(){};function m(H){return H.startsWith("int[")?"int256"+H.slice(3):H==="int"?"int256":H.startsWith("uint[")?"uint256"+H.slice(4):H==="uint"?"uint256":H.startsWith("fixed[")?"fixed128x128"+H.slice(5):H==="fixed"?"fixed128x128":H.startsWith("ufixed[")?"ufixed128x128"+H.slice(6):H==="ufixed"?"ufixed128x128":H}I.eventID=function(H,G){var Z=H+"("+G.map(m).join(",")+")";return T.keccak256(v.from(Z))},I.methodID=function(H,G){return I.eventID(H,G).slice(0,4)};function b(H){return parseInt(/^\D+(\d+)$/.exec(H)[1],10)}function g(H){var G=/^\D+(\d+)x(\d+)$/.exec(H);return[parseInt(G[1],10),parseInt(G[2],10)]}function w(H){var G=H.match(/(.*)\[(.*?)\]$/);return G?G[2]===""?"dynamic":parseInt(G[2],10):null}function _(H){var G=typeof H;if(G==="string")return T.isHexPrefixed(H)?new C(T.stripHexPrefix(H),16):new C(H,10);if(G==="number")return new C(H);if(H.toArray)return H;throw new Error("Argument is not a number")}function A(H){var G=/^(\w+)\((.*)\)$/.exec(H);if(G.length!==3)throw new Error("Invalid method signature");var Z=/^(.+)\):\((.+)$/.exec(G[2]);if(Z!==null&&Z.length===3)return{method:G[1],args:Z[1].split(","),retargs:Z[2].split(",")};var Q=G[2].split(",");return Q.length===1&&Q[0]===""&&(Q=[]),{method:G[1],args:Q}}function S(H,G){var Z,Q,ie,le;if(H==="address")return S("uint160",_(G));if(H==="bool")return S("uint8",G?1:0);if(H==="string")return S("bytes",v.from(G,"utf8"));if(L(H)){if(typeof G.length>"u")throw new Error("Not an array?");if(Z=w(H),Z!=="dynamic"&&Z!==0&&G.length>Z)throw new Error("Elements exceed array size: "+Z);ie=[],H=H.slice(0,H.lastIndexOf("[")),typeof G=="string"&&(G=JSON.parse(G));for(le in G)ie.push(S(H,G[le]));if(Z==="dynamic"){var be=S("uint256",G.length);ie.unshift(be)}return v.concat(ie)}else{if(H==="bytes")return G=v.from(G),ie=v.concat([S("uint256",G.length),G]),G.length%32!==0&&(ie=v.concat([ie,T.zeros(32-G.length%32)])),ie;if(H.startsWith("bytes")){if(Z=b(H),Z<1||Z>32)throw new Error("Invalid bytes<N> width: "+Z);return T.setLengthRight(G,32)}else if(H.startsWith("uint")){if(Z=b(H),Z%8||Z<8||Z>256)throw new Error("Invalid uint<N> width: "+Z);if(Q=_(G),Q.bitLength()>Z)throw new Error("Supplied uint exceeds width: "+Z+" vs "+Q.bitLength());if(Q<0)throw new Error("Supplied uint is negative");return Q.toArrayLike(v,"be",32)}else if(H.startsWith("int")){if(Z=b(H),Z%8||Z<8||Z>256)throw new Error("Invalid int<N> width: "+Z);if(Q=_(G),Q.bitLength()>Z)throw new Error("Supplied int exceeds width: "+Z+" vs "+Q.bitLength());return Q.toTwos(256).toArrayLike(v,"be",32)}else if(H.startsWith("ufixed")){if(Z=g(H),Q=_(G),Q<0)throw new Error("Supplied ufixed is negative");return S("uint256",Q.mul(new C(2).pow(new C(Z[1]))))}else if(H.startsWith("fixed"))return Z=g(H),S("int256",_(G).mul(new C(2).pow(new C(Z[1]))))}throw new Error("Unsupported or invalid type: "+H)}function k(H,G,Z){typeof H=="string"&&(H=B(H));var Q,ie,le,be;if(H.name==="address")return k(H.rawType,G,Z).toArrayLike(v,"be",20).toString("hex");if(H.name==="bool")return k(H.rawType,G,Z).toString()===new C(1).toString();if(H.name==="string"){var we=k(H.rawType,G,Z);return v.from(we,"utf8").toString()}else if(H.isArray){for(le=[],Q=H.size,H.size==="dynamic"&&(Z=k("uint256",G,Z).toNumber(),Q=k("uint256",G,Z).toNumber(),Z=Z+32),be=0;be<Q;be++){var Ae=k(H.subArray,G,Z);le.push(Ae),Z+=H.subArray.memoryUsage}return le}else{if(H.name==="bytes")return Z=k("uint256",G,Z).toNumber(),Q=k("uint256",G,Z).toNumber(),G.slice(Z+32,Z+32+Q);if(H.name.startsWith("bytes"))return G.slice(Z,Z+H.size);if(H.name.startsWith("uint")){if(ie=new C(G.slice(Z,Z+32),16,"be"),ie.bitLength()>H.size)throw new Error("Decoded int exceeds width: "+H.size+" vs "+ie.bitLength());return ie}else if(H.name.startsWith("int")){if(ie=new C(G.slice(Z,Z+32),16,"be").fromTwos(256),ie.bitLength()>H.size)throw new Error("Decoded uint exceeds width: "+H.size+" vs "+ie.bitLength());return ie}else if(H.name.startsWith("ufixed")){if(Q=new C(2).pow(new C(H.size[1])),ie=k("uint256",G,Z),!ie.mod(Q).isZero())throw new Error("Decimals not supported yet");return ie.div(Q)}else if(H.name.startsWith("fixed")){if(Q=new C(2).pow(new C(H.size[1])),ie=k("int256",G,Z),!ie.mod(Q).isZero())throw new Error("Decimals not supported yet");return ie.div(Q)}}throw new Error("Unsupported or invalid type: "+H.name)}function B(H){var G,Z;if(L(H)){G=w(H);var Q=H.slice(0,H.lastIndexOf("["));return Q=B(Q),Z={isArray:!0,name:H,size:G,memoryUsage:G==="dynamic"?32:Q.memoryUsage*G,subArray:Q},Z}else{var ie;switch(H){case"address":ie="uint160";break;case"bool":ie="uint8";break;case"string":ie="bytes";break}if(Z={rawType:ie,name:H,memoryUsage:32},H.startsWith("bytes")&&H!=="bytes"||H.startsWith("uint")||H.startsWith("int")?Z.size=b(H):(H.startsWith("ufixed")||H.startsWith("fixed"))&&(Z.size=g(H)),H.startsWith("bytes")&&H!=="bytes"&&(Z.size<1||Z.size>32))throw new Error("Invalid bytes<N> width: "+Z.size);if((H.startsWith("uint")||H.startsWith("int"))&&(Z.size%8||Z.size<8||Z.size>256))throw new Error("Invalid int/uint<N> width: "+Z.size);return Z}}function O(H){return H==="string"||H==="bytes"||w(H)==="dynamic"}function L(H){return H.lastIndexOf("]")===H.length-1}I.rawEncode=function(H,G){var Z=[],Q=[],ie=0;H.forEach(function(re){if(L(re)){var N=w(re);N!=="dynamic"?ie+=32*N:ie+=32}else ie+=32});for(var le=0;le<H.length;le++){var be=m(H[le]),we=G[le],Ae=S(be,we);O(be)?(Z.push(S("uint256",ie)),Q.push(Ae),ie+=Ae.length):Z.push(Ae)}return v.concat(Z.concat(Q))},I.rawDecode=function(H,G){var Z=[];G=v.from(G);for(var Q=0,ie=0;ie<H.length;ie++){var le=m(H[ie]),be=B(le,G,Q),we=k(be,G,Q);Q+=be.memoryUsage,Z.push(we)}return Z},I.simpleEncode=function(H){var G=Array.prototype.slice.call(arguments).slice(1),Z=A(H);if(G.length!==Z.args.length)throw new Error("Argument count mismatch");return v.concat([I.methodID(Z.method,Z.args),I.rawEncode(Z.args,G)])},I.simpleDecode=function(H,G){var Z=A(H);if(!Z.retargs)throw new Error("No return values in method");return I.rawDecode(Z.retargs,G)};function D(H,G){return H.startsWith("address")||H.startsWith("bytes")?"0x"+G.toString("hex"):G.toString()}I.stringify=function(H,G){var Z=[];for(var Q in H){var ie=H[Q],le=G[Q];/^[^\[]+\[.*\]$/.test(ie)?le=le.map(function(be){return D(ie,be)}).join(", "):le=D(ie,le),Z.push(le)}return Z},I.solidityHexValue=function(H,G,Z){var Q,ie;if(L(H)){var le=H.replace(/\[.*?\]/,"");if(!L(le)){var be=w(H);if(be!=="dynamic"&&be!==0&&G.length>be)throw new Error("Elements exceed array size: "+be)}var we=G.map(function(N){return I.solidityHexValue(le,N,256)});return v.concat(we)}else{if(H==="bytes")return G;if(H==="string")return v.from(G,"utf8");if(H==="bool"){Z=Z||8;var Ae=Array(Z/4).join("0");return v.from(G?Ae+"1":Ae+"0","hex")}else if(H==="address"){var re=20;return Z&&(re=Z/8),T.setLengthLeft(G,re)}else if(H.startsWith("bytes")){if(Q=b(H),Q<1||Q>32)throw new Error("Invalid bytes<N> width: "+Q);return T.setLengthRight(G,Q)}else if(H.startsWith("uint")){if(Q=b(H),Q%8||Q<8||Q>256)throw new Error("Invalid uint<N> width: "+Q);if(ie=_(G),ie.bitLength()>Q)throw new Error("Supplied uint exceeds width: "+Q+" vs "+ie.bitLength());return Z=Z||Q,ie.toArrayLike(v,"be",Z/8)}else if(H.startsWith("int")){if(Q=b(H),Q%8||Q<8||Q>256)throw new Error("Invalid int<N> width: "+Q);if(ie=_(G),ie.bitLength()>Q)throw new Error("Supplied int exceeds width: "+Q+" vs "+ie.bitLength());return Z=Z||Q,ie.toTwos(Q).toArrayLike(v,"be",Z/8)}else throw new Error("Unsupported or invalid type: "+H)}},I.solidityPack=function(H,G){if(H.length!==G.length)throw new Error("Number of types are not matching the values");for(var Z=[],Q=0;Q<H.length;Q++){var ie=m(H[Q]),le=G[Q];Z.push(I.solidityHexValue(ie,le,null))}return v.concat(Z)},I.soliditySHA3=function(H,G){return T.keccak256(I.solidityPack(H,G))},I.soliditySHA256=function(H,G){return T.sha256(I.solidityPack(H,G))},I.solidityRIPEMD160=function(H,G){return T.ripemd160(I.solidityPack(H,G),!0)};function W(H){return H>="0"&&H<="9"}I.fromSerpent=function(H){for(var G=[],Z=0;Z<H.length;Z++){var Q=H[Z];if(Q==="s")G.push("bytes");else if(Q==="b"){for(var ie="bytes",le=Z+1;le<H.length&&W(H[le]);)ie+=H[le]-"0",le++;Z=le-1,G.push(ie)}else if(Q==="i")G.push("int256");else if(Q==="a")G.push("int256[]");else throw new Error("Unsupported or invalid type: "+Q)}return G},I.toSerpent=function(H){for(var G=[],Z=0;Z<H.length;Z++){var Q=H[Z];if(Q==="bytes")G.push("s");else if(Q.startsWith("bytes"))G.push("b"+b(Q));else if(Q==="int256")G.push("i");else if(Q==="int256[]")G.push("a");else throw new Error("Unsupported or invalid type: "+Q)}return G.join("")},fe.exports=I},69017:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.importPublic=p.privateToPublic=p.privateToAddress=p.publicToAddress=p.pubToAddress=p.isValidPublic=p.isValidPrivate=p.isPrecompiled=p.generateAddress2=p.generateAddress=p.isValidChecksumAddress=p.toChecksumAddress=p.isZeroAddress=p.isValidAddress=p.zeroAddress=void 0;var T=x(46732),C=x(90271),I=x(39895),m=x(54619),b=x(41689),g=x(29208);p.zeroAddress=function(){var w=20,_=b.zeros(w);return b.bufferToHex(_)},p.isValidAddress=function(w){return/^0x[0-9a-fA-F]{40}$/.test(w)},p.isZeroAddress=function(w){var _=p.zeroAddress();return _===b.addHexPrefix(w)},p.toChecksumAddress=function(w,_){w=C.stripHexPrefix(w).toLowerCase();for(var A=_!==void 0?_.toString()+"0x":"",S=g.keccak(A+w).toString("hex"),k="0x",B=0;B<w.length;B++)parseInt(S[B],16)>=8?k+=w[B].toUpperCase():k+=w[B];return k},p.isValidChecksumAddress=function(w,_){return p.isValidAddress(w)&&p.toChecksumAddress(w,_)===w},p.generateAddress=function(w,_){w=b.toBuffer(w);var A=new m(_);return A.isZero()?g.rlphash([w,null]).slice(-20):g.rlphash([w,v.from(A.toArray())]).slice(-20)},p.generateAddress2=function(w,_,A){var S=b.toBuffer(w),k=b.toBuffer(_),B=b.toBuffer(A);T(S.length===20),T(k.length===32);var O=g.keccak256(v.concat([v.from("ff","hex"),S,k,g.keccak256(B)]));return O.slice(-20)},p.isPrecompiled=function(w){var _=b.unpad(w);return _.length===1&&_[0]>=1&&_[0]<=8},p.isValidPrivate=function(w){return I.privateKeyVerify(w)},p.isValidPublic=function(w,_){return _===void 0&&(_=!1),w.length===64?I.publicKeyVerify(v.concat([v.from([4]),w])):_?I.publicKeyVerify(w):!1},p.pubToAddress=function(w,_){return _===void 0&&(_=!1),w=b.toBuffer(w),_&&w.length!==64&&(w=I.publicKeyConvert(w,!1).slice(1)),T(w.length===64),g.keccak(w).slice(-20)},p.publicToAddress=p.pubToAddress,p.privateToAddress=function(w){return p.publicToAddress(p.privateToPublic(w))},p.privateToPublic=function(w){return w=b.toBuffer(w),I.publicKeyCreate(w,!1).slice(1)},p.importPublic=function(w){return w=b.toBuffer(w),w.length!==64&&(w=I.publicKeyConvert(w,!1).slice(1)),w}},41689:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.baToJSON=p.addHexPrefix=p.toUnsigned=p.fromSigned=p.bufferToHex=p.bufferToInt=p.toBuffer=p.stripZeros=p.unpad=p.setLengthRight=p.setLength=p.setLengthLeft=p.zeros=void 0;var T=x(90271),C=x(54619);p.zeros=function(I){return v.allocUnsafe(I).fill(0)},p.setLengthLeft=function(I,m,b){b===void 0&&(b=!1);var g=p.zeros(m);return I=p.toBuffer(I),b?I.length<m?(I.copy(g),g):I.slice(0,m):I.length<m?(I.copy(g,m-I.length),g):I.slice(-m)},p.setLength=p.setLengthLeft,p.setLengthRight=function(I,m){return p.setLength(I,m,!0)},p.unpad=function(I){I=T.stripHexPrefix(I);for(var m=I[0];I.length>0&&m.toString()==="0";)I=I.slice(1),m=I[0];return I},p.stripZeros=p.unpad,p.toBuffer=function(I){if(!v.isBuffer(I))if(Array.isArray(I))I=v.from(I);else if(typeof I=="string")if(T.isHexString(I))I=v.from(T.padToEven(T.stripHexPrefix(I)),"hex");else throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+I);else if(typeof I=="number")I=T.intToBuffer(I);else if(I==null)I=v.allocUnsafe(0);else if(C.isBN(I))I=I.toArrayLike(v);else if(I.toArray)I=v.from(I.toArray());else throw new Error("invalid type");return I},p.bufferToInt=function(I){return new C(p.toBuffer(I)).toNumber()},p.bufferToHex=function(I){return I=p.toBuffer(I),"0x"+I.toString("hex")},p.fromSigned=function(I){return new C(I).fromTwos(256)},p.toUnsigned=function(I){return v.from(I.toTwos(256).toArray())},p.addHexPrefix=function(I){return typeof I!="string"||T.isHexPrefixed(I)?I:"0x"+I},p.baToJSON=function(I){if(v.isBuffer(I))return"0x"+I.toString("hex");if(I instanceof Array){for(var m=[],b=0;b<I.length;b++)m.push(p.baToJSON(I[b]));return m}}},19139:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.KECCAK256_RLP=p.KECCAK256_RLP_S=p.KECCAK256_RLP_ARRAY=p.KECCAK256_RLP_ARRAY_S=p.KECCAK256_NULL=p.KECCAK256_NULL_S=p.TWO_POW256=p.MAX_INTEGER=void 0;var T=x(54619);p.MAX_INTEGER=new T("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),p.TWO_POW256=new T("10000000000000000000000000000000000000000000000000000000000000000",16),p.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",p.KECCAK256_NULL=v.from(p.KECCAK256_NULL_S,"hex"),p.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",p.KECCAK256_RLP_ARRAY=v.from(p.KECCAK256_RLP_ARRAY_S,"hex"),p.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",p.KECCAK256_RLP=v.from(p.KECCAK256_RLP_S,"hex")},29208:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.rlphash=p.ripemd160=p.sha256=p.keccak256=p.keccak=void 0;var T=x(72660),C=T.keccak224,I=T.keccak384,m=T.keccak256,b=T.keccak512,g=x(18955),w=x(90271),_=x(84748),A=x(41689);p.keccak=function(S,k){switch(k===void 0&&(k=256),typeof S=="string"&&!w.isHexString(S)?S=v.from(S,"utf8"):S=A.toBuffer(S),k||(k=256),k){case 224:return C(S);case 256:return m(S);case 384:return I(S);case 512:return b(S);default:throw new Error("Invald algorithm: keccak"+k)}},p.keccak256=function(S){return p.keccak(S)},p.sha256=function(S){return S=A.toBuffer(S),g("sha256").update(S).digest()},p.ripemd160=function(S,k){S=A.toBuffer(S);var B=g("rmd160").update(S).digest();return k===!0?A.setLength(B,32):B},p.rlphash=function(S){return p.keccak(_.encode(S))}},30162:function(fe,p,x){"use strict";var v=this&&this.__createBinding||(Object.create?function(g,w,_,A){A===void 0&&(A=_),Object.defineProperty(g,A,{enumerable:!0,get:function(){return w[_]}})}:function(g,w,_,A){A===void 0&&(A=_),g[A]=w[_]}),T=this&&this.__exportStar||function(g,w){for(var _ in g)_!=="default"&&!w.hasOwnProperty(_)&&v(w,g,_)};Object.defineProperty(p,"__esModule",{value:!0}),p.secp256k1=p.rlp=p.BN=void 0;var C=x(39895);p.secp256k1=C;var I=x(90271),m=x(54619);p.BN=m;var b=x(84748);p.rlp=b,Object.assign(p,I),T(x(19139),p),T(x(69017),p),T(x(29208),p),T(x(54436),p),T(x(41689),p),T(x(37615),p)},37615:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.defineProperties=void 0;var T=x(46732),C=x(90271),I=x(84748),m=x(41689);p.defineProperties=function(b,g,w){if(b.raw=[],b._fields=[],b.toJSON=function(A){if(A===void 0&&(A=!1),A){var S={};return b._fields.forEach(function(k){S[k]="0x"+b[k].toString("hex")}),S}return m.baToJSON(b.raw)},b.serialize=function(){return I.encode(b.raw)},g.forEach(function(A,S){b._fields.push(A.name);function k(){return b.raw[S]}function B(O){O=m.toBuffer(O),O.toString("hex")==="00"&&!A.allowZero&&(O=v.allocUnsafe(0)),A.allowLess&&A.length?(O=m.stripZeros(O),T(A.length>=O.length,"The field "+A.name+" must not have more "+A.length+" bytes")):!(A.allowZero&&O.length===0)&&A.length&&T(A.length===O.length,"The field "+A.name+" must have byte length of "+A.length),b.raw[S]=O}Object.defineProperty(b,A.name,{enumerable:!0,configurable:!0,get:k,set:B}),A.default&&(b[A.name]=A.default),A.alias&&Object.defineProperty(b,A.alias,{enumerable:!1,configurable:!0,set:B,get:k})}),w)if(typeof w=="string"&&(w=v.from(C.stripHexPrefix(w),"hex")),v.isBuffer(w)&&(w=I.decode(w)),Array.isArray(w)){if(w.length>b._fields.length)throw new Error("wrong number of fields in data");w.forEach(function(A,S){b[b._fields[S]]=m.toBuffer(A)})}else if(typeof w=="object"){var _=Object.keys(w);g.forEach(function(A){_.indexOf(A.name)!==-1&&(b[A.name]=w[A.name]),_.indexOf(A.alias)!==-1&&(b[A.alias]=w[A.alias])})}else throw new Error("invalid data")}},39895:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.ecdhUnsafe=p.ecdh=p.recover=p.verify=p.sign=p.signatureImportLax=p.signatureImport=p.signatureExport=p.signatureNormalize=p.publicKeyCombine=p.publicKeyTweakMul=p.publicKeyTweakAdd=p.publicKeyVerify=p.publicKeyConvert=p.publicKeyCreate=p.privateKeyTweakMul=p.privateKeyTweakAdd=p.privateKeyModInverse=p.privateKeyNegate=p.privateKeyImport=p.privateKeyExport=p.privateKeyVerify=void 0;var T=x(1532),C=x(33608),I=x(59903);p.privateKeyVerify=function(m){return m.length!==32?!1:T.privateKeyVerify(Uint8Array.from(m))},p.privateKeyExport=function(m,b){if(m.length!==32)throw new RangeError("private key length is invalid");var g=C.privateKeyExport(m,b);return I.privateKeyExport(m,g,b)},p.privateKeyImport=function(m){if(m=I.privateKeyImport(m),m!==null&&m.length===32&&p.privateKeyVerify(m))return m;throw new Error("couldn't import from DER format")},p.privateKeyNegate=function(m){return v.from(T.privateKeyNegate(Uint8Array.from(m)))},p.privateKeyModInverse=function(m){if(m.length!==32)throw new Error("private key length is invalid");return v.from(C.privateKeyModInverse(Uint8Array.from(m)))},p.privateKeyTweakAdd=function(m,b){return v.from(T.privateKeyTweakAdd(Uint8Array.from(m),b))},p.privateKeyTweakMul=function(m,b){return v.from(T.privateKeyTweakMul(Uint8Array.from(m),Uint8Array.from(b)))},p.publicKeyCreate=function(m,b){return v.from(T.publicKeyCreate(Uint8Array.from(m),b))},p.publicKeyConvert=function(m,b){return v.from(T.publicKeyConvert(Uint8Array.from(m),b))},p.publicKeyVerify=function(m){return m.length!==33&&m.length!==65?!1:T.publicKeyVerify(Uint8Array.from(m))},p.publicKeyTweakAdd=function(m,b,g){return v.from(T.publicKeyTweakAdd(Uint8Array.from(m),Uint8Array.from(b),g))},p.publicKeyTweakMul=function(m,b,g){return v.from(T.publicKeyTweakMul(Uint8Array.from(m),Uint8Array.from(b),g))},p.publicKeyCombine=function(m,b){var g=[];return m.forEach(function(w){g.push(Uint8Array.from(w))}),v.from(T.publicKeyCombine(g,b))},p.signatureNormalize=function(m){return v.from(T.signatureNormalize(Uint8Array.from(m)))},p.signatureExport=function(m){return v.from(T.signatureExport(Uint8Array.from(m)))},p.signatureImport=function(m){return v.from(T.signatureImport(Uint8Array.from(m)))},p.signatureImportLax=function(m){if(m.length===0)throw new RangeError("signature length is invalid");var b=I.signatureImportLax(m);if(b===null)throw new Error("couldn't parse DER signature");return C.signatureImport(b)},p.sign=function(m,b,g){if(g===null)throw new TypeError("options should be an Object");var w=void 0;if(g){if(w={},g.data===null)throw new TypeError("options.data should be a Buffer");if(g.data){if(g.data.length!=32)throw new RangeError("options.data length is invalid");w.data=new Uint8Array(g.data)}if(g.noncefn===null)throw new TypeError("options.noncefn should be a Function");g.noncefn&&(w.noncefn=function(A,S,k,B,O){var L=k!=null?v.from(k):null,D=B!=null?v.from(B):null,W=v.from("");return g.noncefn&&(W=g.noncefn(v.from(A),v.from(S),L,D,O)),new Uint8Array(W)})}var _=T.ecdsaSign(Uint8Array.from(m),Uint8Array.from(b),w);return{signature:v.from(_.signature),recovery:_.recid}},p.verify=function(m,b,g){return T.ecdsaVerify(Uint8Array.from(b),Uint8Array.from(m),g)},p.recover=function(m,b,g,w){return v.from(T.ecdsaRecover(Uint8Array.from(b),g,Uint8Array.from(m),w))},p.ecdh=function(m,b){return v.from(T.ecdh(Uint8Array.from(m),Uint8Array.from(b),{}))},p.ecdhUnsafe=function(m,b,g){if(m.length!==33&&m.length!==65)throw new RangeError("public key length is invalid");if(b.length!==32)throw new RangeError("private key length is invalid");return v.from(C.ecdhUnsafe(Uint8Array.from(m),Uint8Array.from(b),g))}},59903:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});var T=v.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),C=v.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);p.privateKeyExport=function(I,m,b){b===void 0&&(b=!0);var g=v.from(b?T:C);return I.copy(g,b?8:9),m.copy(g,b?181:214),g},p.privateKeyImport=function(I){var m=I.length,b=0;if(m<b+1||I[b]!==48||(b+=1,m<b+1||!(I[b]&128)))return null;var g=I[b]&127;if(b+=1,g<1||g>2||m<b+g)return null;var w=I[b+g-1]|(g>1?I[b+g-2]<<8:0);return b+=g,m<b+w||m<b+3||I[b]!==2||I[b+1]!==1||I[b+2]!==1||(b+=3,m<b+2||I[b]!==4||I[b+1]>32||m<b+2+I[b+1])?null:I.slice(b+2,b+2+I[b+1])},p.signatureImportLax=function(I){var m=v.alloc(32,0),b=v.alloc(32,0),g=I.length,w=0;if(I[w++]!==48)return null;var _=I[w++];if(_&128&&(w+=_-128,w>g)||I[w++]!==2)return null;var A=I[w++];if(A&128){if(_=A-128,w+_>g)return null;for(;_>0&&I[w]===0;w+=1,_-=1);for(A=0;_>0;w+=1,_-=1)A=(A<<8)+I[w]}if(A>g-w)return null;var S=w;if(w+=A,I[w++]!==2)return null;var k=I[w++];if(k&128){if(_=k-128,w+_>g)return null;for(;_>0&&I[w]===0;w+=1,_-=1);for(k=0;_>0;w+=1,_-=1)k=(k<<8)+I[w]}if(k>g-w)return null;var B=w;for(w+=k;A>0&&I[S]===0;A-=1,S+=1);if(A>32)return null;var O=I.slice(S,S+A);for(O.copy(m,32-O.length);k>0&&I[B]===0;k-=1,B+=1);if(k>32)return null;var L=I.slice(B,B+k);return L.copy(b,32-L.length),{r:m,s:b}}},33608:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0});var T=x(54619),C=x(23071).ec,I=new C("secp256k1"),m=I.curve;p.privateKeyExport=function(g,w){w===void 0&&(w=!0);var _=new T(g);if(_.ucmp(m.n)>=0)throw new Error("couldn't export to DER format");var A=I.g.mul(_);return b(A.getX(),A.getY(),w)},p.privateKeyModInverse=function(g){var w=new T(g);if(w.ucmp(m.n)>=0||w.isZero())throw new Error("private key range is invalid");return w.invm(m.n).toArrayLike(v,"be",32)},p.signatureImport=function(g){var w=new T(g.r);w.ucmp(m.n)>=0&&(w=new T(0));var _=new T(g.s);return _.ucmp(m.n)>=0&&(_=new T(0)),v.concat([w.toArrayLike(v,"be",32),_.toArrayLike(v,"be",32)])},p.ecdhUnsafe=function(g,w,_){_===void 0&&(_=!0);var A=I.keyFromPublic(g),S=new T(w);if(S.ucmp(m.n)>=0||S.isZero())throw new Error("scalar was invalid (zero or overflow)");var k=A.pub.mul(S);return b(k.getX(),k.getY(),_)};var b=function(g,w,_){var A;return _?(A=v.alloc(33),A[0]=w.isOdd()?3:2,g.toArrayLike(v,"be",32).copy(A,1)):(A=v.alloc(65),A[0]=4,g.toArrayLike(v,"be",32).copy(A,1),w.toArrayLike(v,"be",32).copy(A,33)),A}},54436:function(fe,p,x){"use strict";var v=x(36533).Buffer;Object.defineProperty(p,"__esModule",{value:!0}),p.hashPersonalMessage=p.isValidSignature=p.fromRpcSig=p.toRpcSig=p.ecrecover=p.ecsign=void 0;var T=x(39895),C=x(54619),I=x(41689),m=x(29208);p.ecsign=function(w,_,A){var S=T.sign(w,_),k=S.recovery,B={r:S.signature.slice(0,32),s:S.signature.slice(32,64),v:A?k+(A*2+35):k+27};return B},p.ecrecover=function(w,_,A,S,k){var B=v.concat([I.setLength(A,32),I.setLength(S,32)],64),O=b(_,k);if(!g(O))throw new Error("Invalid signature v value");var L=T.recover(w,B,O);return T.publicKeyConvert(L,!1).slice(1)},p.toRpcSig=function(w,_,A,S){var k=b(w,S);if(!g(k))throw new Error("Invalid signature v value");return I.bufferToHex(v.concat([I.setLengthLeft(_,32),I.setLengthLeft(A,32),I.toBuffer(w)]))},p.fromRpcSig=function(w){var _=I.toBuffer(w);if(_.length!==65)throw new Error("Invalid signature length");var A=_[64];return A<27&&(A+=27),{v:A,r:_.slice(0,32),s:_.slice(32,64)}},p.isValidSignature=function(w,_,A,S,k){S===void 0&&(S=!0);var B=new C("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),O=new C("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(_.length!==32||A.length!==32||!g(b(w,k)))return!1;var L=new C(_),D=new C(A);return!(L.isZero()||L.gt(O)||D.isZero()||D.gt(O)||S&&D.cmp(B)===1)},p.hashPersonalMessage=function(w){var _=v.from(`Ethereum Signed Message:
|
||
`+w.length.toString(),"utf-8");return m.keccak(v.concat([_,w]))};function b(w,_){return _?w-(2*_+35):w-27}function g(w){return w===0||w===1}},98163:function(fe,p,x){"use strict";var v=x(54619),T=x(55689),C=new v(0),I=new v(-1),m={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function b(A){var S=A?A.toLowerCase():"ether",k=m[S];if(typeof k!="string")throw new Error("[ethjs-unit] the unit provided "+A+" doesn't exists, please use the one of the following units "+JSON.stringify(m,null,2));return new v(k,10)}function g(A){if(typeof A=="string"){if(!A.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+A+"', should be a number matching (^-?[0-9.]+).");return A}else{if(typeof A=="number")return String(A);if(typeof A=="object"&&A.toString&&(A.toTwos||A.dividedToIntegerBy))return A.toPrecision?String(A.toPrecision()):A.toString(10)}throw new Error("while converting number to string, invalid number value '"+A+"' type "+typeof A+".")}function w(A,S,k){var B=T(A),O=B.lt(C),L=b(S),D=m[S].length-1||1,W=k||{};O&&(B=B.mul(I));for(var H=B.mod(L).toString(10);H.length<D;)H="0"+H;W.pad||(H=H.match(/^([0-9]*[1-9]|0)(0*)/)[1]);var G=B.div(L).toString(10);W.commify&&(G=G.replace(/\B(?=(\d{3})+(?!\d))/g,","));var Z=""+G+(H=="0"?"":"."+H);return O&&(Z="-"+Z),Z}function _(A,S){var k=g(A),B=b(S),O=m[S].length-1||1,L=k.substring(0,1)==="-";if(L&&(k=k.substring(1)),k===".")throw new Error("[ethjs-unit] while converting number "+A+" to wei, invalid value");var D=k.split(".");if(D.length>2)throw new Error("[ethjs-unit] while converting number "+A+" to wei, too many decimal points");var W=D[0],H=D[1];if(W||(W="0"),H||(H="0"),H.length>O)throw new Error("[ethjs-unit] while converting number "+A+" to wei, too many decimal places");for(;H.length<O;)H+="0";W=new v(W),H=new v(H);var G=W.mul(B).add(H);return L&&(G=G.mul(I)),new v(G.toString(10),10)}fe.exports={unitMap:m,numberToString:g,getValueOfUnit:b,fromWei:w,toWei:_}},90271:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=x(94782),C=x(73180);function I(L){var D=L;if(typeof D!="string")throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof D+", while padToEven.");return D.length%2&&(D="0"+D),D}function m(L){var D=L.toString(16);return"0x"+D}function b(L){var D=m(L);return new v(I(D.slice(2)),"hex")}function g(L){if(typeof L!="string")throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof L+"'.");return v.byteLength(L,"utf8")}function w(L,D,W){if(Array.isArray(L)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof L+"'");if(Array.isArray(D)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof D+"'");return D[!!W&&"some"||"every"](function(H){return L.indexOf(H)>=0})}function _(L){var D=new v(I(C(L).replace(/^0+|0+$/g,"")),"hex");return D.toString("utf8")}function A(L){var D="",W=0,H=L.length;for(L.substring(0,2)==="0x"&&(W=2);W<H;W+=2){var G=parseInt(L.substr(W,2),16);D+=String.fromCharCode(G)}return D}function S(L){var D=new v(L,"utf8");return"0x"+I(D.toString("hex")).replace(/^0+|0+$/g,"")}function k(L){for(var D="",W=0;W<L.length;W++){var H=L.charCodeAt(W),G=H.toString(16);D+=G.length<2?"0"+G:G}return"0x"+D}function B(L,D,W){if(!Array.isArray(L))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof L+"'");if(typeof D!="string")throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof D+"'.");for(var H=[],G=0;G<L.length;G++){var Z=L[G][D];if(W&&!Z)Z="";else if(typeof Z!="string")throw new Error("invalid abi");H.push(Z)}return H}function O(L,D){return!(typeof L!="string"||!L.match(/^0x[0-9A-Fa-f]*$/)||D&&L.length!==2+2*D)}fe.exports={arrayContainsArray:w,intToBuffer:b,getBinarySize:g,isHexPrefixed:T,stripHexPrefix:C,padToEven:I,intToHex:m,fromAscii:k,fromUtf8:S,toAscii:A,toUtf8:_,getKeys:B,isHexString:O}},86296:function(fe){"use strict";var p=Object.prototype.hasOwnProperty,x="~";function v(){}Object.create&&(v.prototype=Object.create(null),new v().__proto__||(x=!1));function T(b,g,w){this.fn=b,this.context=g,this.once=w||!1}function C(b,g,w,_,A){if(typeof w!="function")throw new TypeError("The listener must be a function");var S=new T(w,_||b,A),k=x?x+g:g;return b._events[k]?b._events[k].fn?b._events[k]=[b._events[k],S]:b._events[k].push(S):(b._events[k]=S,b._eventsCount++),b}function I(b,g){--b._eventsCount===0?b._events=new v:delete b._events[g]}function m(){this._events=new v,this._eventsCount=0}m.prototype.eventNames=function(){var g=[],w,_;if(this._eventsCount===0)return g;for(_ in w=this._events)p.call(w,_)&&g.push(x?_.slice(1):_);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(w)):g},m.prototype.listeners=function(g){var w=x?x+g:g,_=this._events[w];if(!_)return[];if(_.fn)return[_.fn];for(var A=0,S=_.length,k=new Array(S);A<S;A++)k[A]=_[A].fn;return k},m.prototype.listenerCount=function(g){var w=x?x+g:g,_=this._events[w];return _?_.fn?1:_.length:0},m.prototype.emit=function(g,w,_,A,S,k){var B=x?x+g:g;if(!this._events[B])return!1;var O=this._events[B],L=arguments.length,D,W;if(O.fn){switch(O.once&&this.removeListener(g,O.fn,void 0,!0),L){case 1:return O.fn.call(O.context),!0;case 2:return O.fn.call(O.context,w),!0;case 3:return O.fn.call(O.context,w,_),!0;case 4:return O.fn.call(O.context,w,_,A),!0;case 5:return O.fn.call(O.context,w,_,A,S),!0;case 6:return O.fn.call(O.context,w,_,A,S,k),!0}for(W=1,D=new Array(L-1);W<L;W++)D[W-1]=arguments[W];O.fn.apply(O.context,D)}else{var H=O.length,G;for(W=0;W<H;W++)switch(O[W].once&&this.removeListener(g,O[W].fn,void 0,!0),L){case 1:O[W].fn.call(O[W].context);break;case 2:O[W].fn.call(O[W].context,w);break;case 3:O[W].fn.call(O[W].context,w,_);break;case 4:O[W].fn.call(O[W].context,w,_,A);break;default:if(!D)for(G=1,D=new Array(L-1);G<L;G++)D[G-1]=arguments[G];O[W].fn.apply(O[W].context,D)}}return!0},m.prototype.on=function(g,w,_){return C(this,g,w,_,!1)},m.prototype.once=function(g,w,_){return C(this,g,w,_,!0)},m.prototype.removeListener=function(g,w,_,A){var S=x?x+g:g;if(!this._events[S])return this;if(!w)return I(this,S),this;var k=this._events[S];if(k.fn)k.fn===w&&(!A||k.once)&&(!_||k.context===_)&&I(this,S);else{for(var B=0,O=[],L=k.length;B<L;B++)(k[B].fn!==w||A&&!k[B].once||_&&k[B].context!==_)&&O.push(k[B]);O.length?this._events[S]=O.length===1?O[0]:O:I(this,S)}return this},m.prototype.removeAllListeners=function(g){var w;return g?(w=x?x+g:g,this._events[w]&&I(this,w)):(this._events=new v,this._eventsCount=0),this},m.prototype.off=m.prototype.removeListener,m.prototype.addListener=m.prototype.on,m.prefixed=x,m.EventEmitter=m,fe.exports=m},80381:function(fe){"use strict";var p=typeof Reflect=="object"?Reflect:null,x=p&&typeof p.apply=="function"?p.apply:function(Z,Q,ie){return Function.prototype.apply.call(Z,Q,ie)},v;p&&typeof p.ownKeys=="function"?v=p.ownKeys:Object.getOwnPropertySymbols?v=function(Z){return Object.getOwnPropertyNames(Z).concat(Object.getOwnPropertySymbols(Z))}:v=function(Z){return Object.getOwnPropertyNames(Z)};function T(G){console&&console.warn&&console.warn(G)}var C=Number.isNaN||function(Z){return Z!==Z};function I(){I.init.call(this)}fe.exports=I,fe.exports.once=D,I.EventEmitter=I,I.prototype._events=void 0,I.prototype._eventsCount=0,I.prototype._maxListeners=void 0;var m=10;function b(G){if(typeof G!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof G)}Object.defineProperty(I,"defaultMaxListeners",{enumerable:!0,get:function(){return m},set:function(G){if(typeof G!="number"||G<0||C(G))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+G+".");m=G}}),I.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},I.prototype.setMaxListeners=function(Z){if(typeof Z!="number"||Z<0||C(Z))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+Z+".");return this._maxListeners=Z,this};function g(G){return G._maxListeners===void 0?I.defaultMaxListeners:G._maxListeners}I.prototype.getMaxListeners=function(){return g(this)},I.prototype.emit=function(Z){for(var Q=[],ie=1;ie<arguments.length;ie++)Q.push(arguments[ie]);var le=Z==="error",be=this._events;if(be!==void 0)le=le&&be.error===void 0;else if(!le)return!1;if(le){var we;if(Q.length>0&&(we=Q[0]),we instanceof Error)throw we;var Ae=new Error("Unhandled error."+(we?" ("+we.message+")":""));throw Ae.context=we,Ae}var re=be[Z];if(re===void 0)return!1;if(typeof re=="function")x(re,this,Q);else for(var N=re.length,z=B(re,N),ie=0;ie<N;++ie)x(z[ie],this,Q);return!0};function w(G,Z,Q,ie){var le,be,we;if(b(Q),be=G._events,be===void 0?(be=G._events=Object.create(null),G._eventsCount=0):(be.newListener!==void 0&&(G.emit("newListener",Z,Q.listener?Q.listener:Q),be=G._events),we=be[Z]),we===void 0)we=be[Z]=Q,++G._eventsCount;else if(typeof we=="function"?we=be[Z]=ie?[Q,we]:[we,Q]:ie?we.unshift(Q):we.push(Q),le=g(G),le>0&&we.length>le&&!we.warned){we.warned=!0;var Ae=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(Z)+" listeners added. Use emitter.setMaxListeners() to increase limit");Ae.name="MaxListenersExceededWarning",Ae.emitter=G,Ae.type=Z,Ae.count=we.length,T(Ae)}return G}I.prototype.addListener=function(Z,Q){return w(this,Z,Q,!1)},I.prototype.on=I.prototype.addListener,I.prototype.prependListener=function(Z,Q){return w(this,Z,Q,!0)};function _(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function A(G,Z,Q){var ie={fired:!1,wrapFn:void 0,target:G,type:Z,listener:Q},le=_.bind(ie);return le.listener=Q,ie.wrapFn=le,le}I.prototype.once=function(Z,Q){return b(Q),this.on(Z,A(this,Z,Q)),this},I.prototype.prependOnceListener=function(Z,Q){return b(Q),this.prependListener(Z,A(this,Z,Q)),this},I.prototype.removeListener=function(Z,Q){var ie,le,be,we,Ae;if(b(Q),le=this._events,le===void 0)return this;if(ie=le[Z],ie===void 0)return this;if(ie===Q||ie.listener===Q)--this._eventsCount===0?this._events=Object.create(null):(delete le[Z],le.removeListener&&this.emit("removeListener",Z,ie.listener||Q));else if(typeof ie!="function"){for(be=-1,we=ie.length-1;we>=0;we--)if(ie[we]===Q||ie[we].listener===Q){Ae=ie[we].listener,be=we;break}if(be<0)return this;be===0?ie.shift():O(ie,be),ie.length===1&&(le[Z]=ie[0]),le.removeListener!==void 0&&this.emit("removeListener",Z,Ae||Q)}return this},I.prototype.off=I.prototype.removeListener,I.prototype.removeAllListeners=function(Z){var Q,ie,le;if(ie=this._events,ie===void 0)return this;if(ie.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ie[Z]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ie[Z]),this;if(arguments.length===0){var be=Object.keys(ie),we;for(le=0;le<be.length;++le)we=be[le],we!=="removeListener"&&this.removeAllListeners(we);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(Q=ie[Z],typeof Q=="function")this.removeListener(Z,Q);else if(Q!==void 0)for(le=Q.length-1;le>=0;le--)this.removeListener(Z,Q[le]);return this};function S(G,Z,Q){var ie=G._events;if(ie===void 0)return[];var le=ie[Z];return le===void 0?[]:typeof le=="function"?Q?[le.listener||le]:[le]:Q?L(le):B(le,le.length)}I.prototype.listeners=function(Z){return S(this,Z,!0)},I.prototype.rawListeners=function(Z){return S(this,Z,!1)},I.listenerCount=function(G,Z){return typeof G.listenerCount=="function"?G.listenerCount(Z):k.call(G,Z)},I.prototype.listenerCount=k;function k(G){var Z=this._events;if(Z!==void 0){var Q=Z[G];if(typeof Q=="function")return 1;if(Q!==void 0)return Q.length}return 0}I.prototype.eventNames=function(){return this._eventsCount>0?v(this._events):[]};function B(G,Z){for(var Q=new Array(Z),ie=0;ie<Z;++ie)Q[ie]=G[ie];return Q}function O(G,Z){for(;Z+1<G.length;Z++)G[Z]=G[Z+1];G.pop()}function L(G){for(var Z=new Array(G.length),Q=0;Q<Z.length;++Q)Z[Q]=G[Q].listener||G[Q];return Z}function D(G,Z){return new Promise(function(Q,ie){function le(we){G.removeListener(Z,be),ie(we)}function be(){typeof G.removeListener=="function"&&G.removeListener("error",le),Q([].slice.call(arguments))}H(G,Z,be,{once:!0}),Z!=="error"&&W(G,le,{once:!0})})}function W(G,Z,Q){typeof G.on=="function"&&H(G,"error",Z,Q)}function H(G,Z,Q,ie){if(typeof G.on=="function")ie.once?G.once(Z,Q):G.on(Z,Q);else if(typeof G.addEventListener=="function")G.addEventListener(Z,function le(be){ie.once&&G.removeEventListener(Z,le),Q(be)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof G)}},87196:function(fe,p,x){"use strict";var v=x(22956),T=Object.prototype.toString,C=Object.prototype.hasOwnProperty,I=function(_,A,S){for(var k=0,B=_.length;k<B;k++)C.call(_,k)&&(S==null?A(_[k],k,_):A.call(S,_[k],k,_))},m=function(_,A,S){for(var k=0,B=_.length;k<B;k++)S==null?A(_.charAt(k),k,_):A.call(S,_.charAt(k),k,_)},b=function(_,A,S){for(var k in _)C.call(_,k)&&(S==null?A(_[k],k,_):A.call(S,_[k],k,_))};function g(w){return T.call(w)==="[object Array]"}fe.exports=function(_,A,S){if(!v(A))throw new TypeError("iterator must be a function");var k;arguments.length>=3&&(k=S),g(_)?I(_,A,k):typeof _=="string"?m(_,A,k):b(_,A,k)}},69992:function(fe){"use strict";var p="Function.prototype.bind called on incompatible ",x=Object.prototype.toString,v=Math.max,T="[object Function]",C=function(g,w){for(var _=[],A=0;A<g.length;A+=1)_[A]=g[A];for(var S=0;S<w.length;S+=1)_[S+g.length]=w[S];return _},I=function(g,w){for(var _=[],A=w||0,S=0;A<g.length;A+=1,S+=1)_[S]=g[A];return _},m=function(b,g){for(var w="",_=0;_<b.length;_+=1)w+=b[_],_+1<b.length&&(w+=g);return w};fe.exports=function(g){var w=this;if(typeof w!="function"||x.apply(w)!==T)throw new TypeError(p+w);for(var _=I(arguments,1),A,S=function(){if(this instanceof A){var D=w.apply(this,C(_,arguments));return Object(D)===D?D:this}return w.apply(g,C(_,arguments))},k=v(0,w.length-_.length),B=[],O=0;O<k;O++)B[O]="$"+O;if(A=Function("binder","return function ("+m(B,",")+"){ return binder.apply(this,arguments); }")(S),w.prototype){var L=function(){};L.prototype=w.prototype,A.prototype=new L,L.prototype=null}return A}},79524:function(fe,p,x){"use strict";var v=x(69992);fe.exports=Function.prototype.bind||v},49336:function(fe,p,x){"use strict";var v,T=x(25153),C=x(41488),I=x(38004),m=x(96469),b=x(12557),g=x(63429),w=x(71102),_=x(85966),A=x(77412),S=x(52418),k=x(57958),B=x(47384),O=x(250),L=x(51844),D=x(47279),W=Function,H=function(ze){try{return W('"use strict"; return ('+ze+").constructor;")()}catch{}},G=x(25667),Z=x(39886),Q=function(){throw new w},ie=G?function(){try{return arguments.callee,Q}catch{try{return G(arguments,"callee").get}catch{return Q}}}():Q,le=x(21514)(),be=x(14252),we=x(23752),Ae=x(60248),re=x(64811),N=x(46255),z={},V=typeof Uint8Array>"u"||!be?v:be(Uint8Array),U={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?v:ArrayBuffer,"%ArrayIteratorPrototype%":le&&be?be([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":z,"%AsyncGenerator%":z,"%AsyncGeneratorFunction%":z,"%AsyncIteratorPrototype%":z,"%Atomics%":typeof Atomics>"u"?v:Atomics,"%BigInt%":typeof BigInt>"u"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":C,"%eval%":eval,"%EvalError%":I,"%Float16Array%":typeof Float16Array>"u"?v:Float16Array,"%Float32Array%":typeof Float32Array>"u"?v:Float32Array,"%Float64Array%":typeof Float64Array>"u"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?v:FinalizationRegistry,"%Function%":W,"%GeneratorFunction%":z,"%Int8Array%":typeof Int8Array>"u"?v:Int8Array,"%Int16Array%":typeof Int16Array>"u"?v:Int16Array,"%Int32Array%":typeof Int32Array>"u"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":le&&be?be(be([][Symbol.iterator]())):v,"%JSON%":typeof JSON=="object"?JSON:v,"%Map%":typeof Map>"u"?v:Map,"%MapIteratorPrototype%":typeof Map>"u"||!le||!be?v:be(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":T,"%Object.getOwnPropertyDescriptor%":G,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?v:Promise,"%Proxy%":typeof Proxy>"u"?v:Proxy,"%RangeError%":m,"%ReferenceError%":b,"%Reflect%":typeof Reflect>"u"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?v:Set,"%SetIteratorPrototype%":typeof Set>"u"||!le||!be?v:be(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":le&&be?be(""[Symbol.iterator]()):v,"%Symbol%":le?Symbol:v,"%SyntaxError%":g,"%ThrowTypeError%":ie,"%TypedArray%":V,"%TypeError%":w,"%Uint8Array%":typeof Uint8Array>"u"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?v:Uint32Array,"%URIError%":_,"%WeakMap%":typeof WeakMap>"u"?v:WeakMap,"%WeakRef%":typeof WeakRef>"u"?v:WeakRef,"%WeakSet%":typeof WeakSet>"u"?v:WeakSet,"%Function.prototype.call%":N,"%Function.prototype.apply%":re,"%Object.defineProperty%":Z,"%Object.getPrototypeOf%":we,"%Math.abs%":A,"%Math.floor%":S,"%Math.max%":k,"%Math.min%":B,"%Math.pow%":O,"%Math.round%":L,"%Math.sign%":D,"%Reflect.getPrototypeOf%":Ae};if(be)try{null.error}catch(ze){var j=be(be(ze));U["%Error.prototype%"]=j}var $=function ze(_t){var Ct;if(_t==="%AsyncFunction%")Ct=H("async function () {}");else if(_t==="%GeneratorFunction%")Ct=H("function* () {}");else if(_t==="%AsyncGeneratorFunction%")Ct=H("async function* () {}");else if(_t==="%AsyncGenerator%"){var $t=ze("%AsyncGeneratorFunction%");$t&&(Ct=$t.prototype)}else if(_t==="%AsyncIteratorPrototype%"){var ft=ze("%AsyncGenerator%");ft&&be&&(Ct=be(ft.prototype))}return U[_t]=Ct,Ct},ee={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},J=x(79524),F=x(75630),X=J.call(N,Array.prototype.concat),de=J.call(re,Array.prototype.splice),Y=J.call(N,String.prototype.replace),ce=J.call(N,String.prototype.slice),he=J.call(N,RegExp.prototype.exec),Ie=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ke=/\\(\\)?/g,ut=function(_t){var Ct=ce(_t,0,1),$t=ce(_t,-1);if(Ct==="%"&&$t!=="%")throw new g("invalid intrinsic syntax, expected closing `%`");if($t==="%"&&Ct!=="%")throw new g("invalid intrinsic syntax, expected opening `%`");var ft=[];return Y(_t,Ie,function(Xe,ct,wt,Rt){ft[ft.length]=wt?Y(Rt,ke,"$1"):ct||Xe}),ft},Re=function(_t,Ct){var $t=_t,ft;if(F(ee,$t)&&(ft=ee[$t],$t="%"+ft[0]+"%"),F(U,$t)){var Xe=U[$t];if(Xe===z&&(Xe=$($t)),typeof Xe>"u"&&!Ct)throw new w("intrinsic "+_t+" exists, but is not available. Please file an issue!");return{alias:ft,name:$t,value:Xe}}throw new g("intrinsic "+_t+" does not exist!")};fe.exports=function(_t,Ct){if(typeof _t!="string"||_t.length===0)throw new w("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Ct!="boolean")throw new w('"allowMissing" argument must be a boolean');if(he(/^%?[^%]*%?$/,_t)===null)throw new g("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var $t=ut(_t),ft=$t.length>0?$t[0]:"",Xe=Re("%"+ft+"%",Ct),ct=Xe.name,wt=Xe.value,Rt=!1,Ge=Xe.alias;Ge&&(ft=Ge[0],de($t,X([0,1],Ge)));for(var zt=1,Ft=!0;zt<$t.length;zt+=1){var tt=$t[zt],qe=ce(tt,0,1),dt=ce(tt,-1);if((qe==='"'||qe==="'"||qe==="`"||dt==='"'||dt==="'"||dt==="`")&&qe!==dt)throw new g("property names with quotes must have matching quotes");if((tt==="constructor"||!Ft)&&(Rt=!0),ft+="."+tt,ct="%"+ft+"%",F(U,ct))wt=U[ct];else if(wt!=null){if(!(tt in wt)){if(!Ct)throw new w("base intrinsic for "+_t+" exists, but the property is not available.");return}if(G&&zt+1>=$t.length){var De=G(wt,tt);Ft=!!De,Ft&&"get"in De&&!("originalValue"in De.get)?wt=De.get:wt=wt[tt]}else Ft=F(wt,tt),wt=wt[tt];Ft&&!Rt&&(U[ct]=wt)}}return wt}},23752:function(fe,p,x){"use strict";var v=x(25153);fe.exports=v.getPrototypeOf||null},60248:function(fe){"use strict";fe.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null},14252:function(fe,p,x){"use strict";var v=x(60248),T=x(23752),C=x(57678);fe.exports=v?function(m){return v(m)}:T?function(m){if(!m||typeof m!="object"&&typeof m!="function")throw new TypeError("getProto: not an object");return T(m)}:C?function(m){return C(m)}:null},51333:function(fe){"use strict";fe.exports=Object.getOwnPropertyDescriptor},25667:function(fe,p,x){"use strict";var v=x(51333);if(v)try{v([],"length")}catch{v=null}fe.exports=v},491:function(fe,p,x){"use strict";var v=x(39886),T=function(){return!!v};T.hasArrayLengthDefineBug=function(){if(!v)return null;try{return v([],"length",{value:1}).length!==1}catch{return!0}},fe.exports=T},21514:function(fe,p,x){"use strict";var v=typeof Symbol<"u"&&Symbol,T=x(9712);fe.exports=function(){return typeof v!="function"||typeof Symbol!="function"||typeof v("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:T()}},9712:function(fe){"use strict";fe.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var x={},v=Symbol("test"),T=Object(v);if(typeof v=="string"||Object.prototype.toString.call(v)!=="[object Symbol]"||Object.prototype.toString.call(T)!=="[object Symbol]")return!1;var C=42;x[v]=C;for(var I in x)return!1;if(typeof Object.keys=="function"&&Object.keys(x).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(x).length!==0)return!1;var m=Object.getOwnPropertySymbols(x);if(m.length!==1||m[0]!==v||!Object.prototype.propertyIsEnumerable.call(x,v))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var b=Object.getOwnPropertyDescriptor(x,v);if(b.value!==C||b.enumerable!==!0)return!1}return!0}},77185:function(fe,p,x){"use strict";var v=x(9712);fe.exports=function(){return v()&&!!Symbol.toStringTag}},80800:function(fe,p,x){"use strict";var v=x(56608).Buffer,T=x(51094).Transform,C=x(91193);function I(b,g){if(!v.isBuffer(b)&&typeof b!="string")throw new TypeError(g+" must be a string or a buffer")}function m(b){T.call(this),this._block=v.allocUnsafe(b),this._blockSize=b,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}C(m,T),m.prototype._transform=function(b,g,w){var _=null;try{this.update(b,g)}catch(A){_=A}w(_)},m.prototype._flush=function(b){var g=null;try{this.push(this.digest())}catch(w){g=w}b(g)},m.prototype.update=function(b,g){if(I(b,"Data"),this._finalized)throw new Error("Digest already called");v.isBuffer(b)||(b=v.from(b,g));for(var w=this._block,_=0;this._blockOffset+b.length-_>=this._blockSize;){for(var A=this._blockOffset;A<this._blockSize;)w[A++]=b[_++];this._update(),this._blockOffset=0}for(;_<b.length;)w[this._blockOffset++]=b[_++];for(var S=0,k=b.length*8;k>0;++S)this._length[S]+=k,k=this._length[S]/4294967296|0,k>0&&(this._length[S]-=4294967296*k);return this},m.prototype._update=function(){throw new Error("_update is not implemented")},m.prototype.digest=function(b){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var g=this._digest();b!==void 0&&(g=g.toString(b)),this._block.fill(0),this._blockOffset=0;for(var w=0;w<4;++w)this._length[w]=0;return g},m.prototype._digest=function(){throw new Error("_digest is not implemented")},fe.exports=m},61631:function(fe,p,x){var v=p;v.utils=x(27905),v.common=x(14427),v.sha=x(61822),v.ripemd=x(47317),v.hmac=x(67309),v.sha1=v.sha.sha1,v.sha256=v.sha.sha256,v.sha224=v.sha.sha224,v.sha384=v.sha.sha384,v.sha512=v.sha.sha512,v.ripemd160=v.ripemd.ripemd160},14427:function(fe,p,x){"use strict";var v=x(27905),T=x(35578);function C(){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}p.BlockHash=C,C.prototype.update=function(m,b){if(m=v.toArray(m,b),this.pending?this.pending=this.pending.concat(m):this.pending=m,this.pendingTotal+=m.length,this.pending.length>=this._delta8){m=this.pending;var g=m.length%this._delta8;this.pending=m.slice(m.length-g,m.length),this.pending.length===0&&(this.pending=null),m=v.join32(m,0,m.length-g,this.endian);for(var w=0;w<m.length;w+=this._delta32)this._update(m,w,w+this._delta32)}return this},C.prototype.digest=function(m){return this.update(this._pad()),T(this.pending===null),this._digest(m)},C.prototype._pad=function(){var m=this.pendingTotal,b=this._delta8,g=b-(m+this.padLength)%b,w=new Array(g+this.padLength);w[0]=128;for(var _=1;_<g;_++)w[_]=0;if(m<<=3,this.endian==="big"){for(var A=8;A<this.padLength;A++)w[_++]=0;w[_++]=0,w[_++]=0,w[_++]=0,w[_++]=0,w[_++]=m>>>24&255,w[_++]=m>>>16&255,w[_++]=m>>>8&255,w[_++]=m&255}else for(w[_++]=m&255,w[_++]=m>>>8&255,w[_++]=m>>>16&255,w[_++]=m>>>24&255,w[_++]=0,w[_++]=0,w[_++]=0,w[_++]=0,A=8;A<this.padLength;A++)w[_++]=0;return w}},67309:function(fe,p,x){"use strict";var v=x(27905),T=x(35578);function C(I,m,b){if(!(this instanceof C))return new C(I,m,b);this.Hash=I,this.blockSize=I.blockSize/8,this.outSize=I.outSize/8,this.inner=null,this.outer=null,this._init(v.toArray(m,b))}fe.exports=C,C.prototype._init=function(m){m.length>this.blockSize&&(m=new this.Hash().update(m).digest()),T(m.length<=this.blockSize);for(var b=m.length;b<this.blockSize;b++)m.push(0);for(b=0;b<m.length;b++)m[b]^=54;for(this.inner=new this.Hash().update(m),b=0;b<m.length;b++)m[b]^=106;this.outer=new this.Hash().update(m)},C.prototype.update=function(m,b){return this.inner.update(m,b),this},C.prototype.digest=function(m){return this.outer.update(this.inner.digest()),this.outer.digest(m)}},47317:function(fe,p,x){"use strict";var v=x(27905),T=x(14427),C=v.rotl32,I=v.sum32,m=v.sum32_3,b=v.sum32_4,g=T.BlockHash;function w(){if(!(this instanceof w))return new w;g.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}v.inherits(w,g),p.ripemd160=w,w.blockSize=512,w.outSize=160,w.hmacStrength=192,w.padLength=64,w.prototype._update=function(W,H){for(var G=this.h[0],Z=this.h[1],Q=this.h[2],ie=this.h[3],le=this.h[4],be=G,we=Z,Ae=Q,re=ie,N=le,z=0;z<80;z++){var V=I(C(b(G,_(z,Z,Q,ie),W[k[z]+H],A(z)),O[z]),le);G=le,le=ie,ie=C(Q,10),Q=Z,Z=V,V=I(C(b(be,_(79-z,we,Ae,re),W[B[z]+H],S(z)),L[z]),N),be=N,N=re,re=C(Ae,10),Ae=we,we=V}V=m(this.h[1],Q,re),this.h[1]=m(this.h[2],ie,N),this.h[2]=m(this.h[3],le,be),this.h[3]=m(this.h[4],G,we),this.h[4]=m(this.h[0],Z,Ae),this.h[0]=V},w.prototype._digest=function(W){return W==="hex"?v.toHex32(this.h,"little"):v.split32(this.h,"little")};function _(D,W,H,G){return D<=15?W^H^G:D<=31?W&H|~W&G:D<=47?(W|~H)^G:D<=63?W&G|H&~G:W^(H|~G)}function A(D){return D<=15?0:D<=31?1518500249:D<=47?1859775393:D<=63?2400959708:2840853838}function S(D){return D<=15?1352829926:D<=31?1548603684:D<=47?1836072691:D<=63?2053994217:0}var k=[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],B=[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],O=[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],L=[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]},61822:function(fe,p,x){"use strict";p.sha1=x(12750),p.sha224=x(37485),p.sha256=x(77292),p.sha384=x(40696),p.sha512=x(58889)},12750:function(fe,p,x){"use strict";var v=x(27905),T=x(14427),C=x(45660),I=v.rotl32,m=v.sum32,b=v.sum32_5,g=C.ft_1,w=T.BlockHash,_=[1518500249,1859775393,2400959708,3395469782];function A(){if(!(this instanceof A))return new A;w.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}v.inherits(A,w),fe.exports=A,A.blockSize=512,A.outSize=160,A.hmacStrength=80,A.padLength=64,A.prototype._update=function(k,B){for(var O=this.W,L=0;L<16;L++)O[L]=k[B+L];for(;L<O.length;L++)O[L]=I(O[L-3]^O[L-8]^O[L-14]^O[L-16],1);var D=this.h[0],W=this.h[1],H=this.h[2],G=this.h[3],Z=this.h[4];for(L=0;L<O.length;L++){var Q=~~(L/20),ie=b(I(D,5),g(Q,W,H,G),Z,O[L],_[Q]);Z=G,G=H,H=I(W,30),W=D,D=ie}this.h[0]=m(this.h[0],D),this.h[1]=m(this.h[1],W),this.h[2]=m(this.h[2],H),this.h[3]=m(this.h[3],G),this.h[4]=m(this.h[4],Z)},A.prototype._digest=function(k){return k==="hex"?v.toHex32(this.h,"big"):v.split32(this.h,"big")}},37485:function(fe,p,x){"use strict";var v=x(27905),T=x(77292);function C(){if(!(this instanceof C))return new C;T.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}v.inherits(C,T),fe.exports=C,C.blockSize=512,C.outSize=224,C.hmacStrength=192,C.padLength=64,C.prototype._digest=function(m){return m==="hex"?v.toHex32(this.h.slice(0,7),"big"):v.split32(this.h.slice(0,7),"big")}},77292:function(fe,p,x){"use strict";var v=x(27905),T=x(14427),C=x(45660),I=x(35578),m=v.sum32,b=v.sum32_4,g=v.sum32_5,w=C.ch32,_=C.maj32,A=C.s0_256,S=C.s1_256,k=C.g0_256,B=C.g1_256,O=T.BlockHash,L=[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 D(){if(!(this instanceof D))return new D;O.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=L,this.W=new Array(64)}v.inherits(D,O),fe.exports=D,D.blockSize=512,D.outSize=256,D.hmacStrength=192,D.padLength=64,D.prototype._update=function(H,G){for(var Z=this.W,Q=0;Q<16;Q++)Z[Q]=H[G+Q];for(;Q<Z.length;Q++)Z[Q]=b(B(Z[Q-2]),Z[Q-7],k(Z[Q-15]),Z[Q-16]);var ie=this.h[0],le=this.h[1],be=this.h[2],we=this.h[3],Ae=this.h[4],re=this.h[5],N=this.h[6],z=this.h[7];for(I(this.k.length===Z.length),Q=0;Q<Z.length;Q++){var V=g(z,S(Ae),w(Ae,re,N),this.k[Q],Z[Q]),U=m(A(ie),_(ie,le,be));z=N,N=re,re=Ae,Ae=m(we,V),we=be,be=le,le=ie,ie=m(V,U)}this.h[0]=m(this.h[0],ie),this.h[1]=m(this.h[1],le),this.h[2]=m(this.h[2],be),this.h[3]=m(this.h[3],we),this.h[4]=m(this.h[4],Ae),this.h[5]=m(this.h[5],re),this.h[6]=m(this.h[6],N),this.h[7]=m(this.h[7],z)},D.prototype._digest=function(H){return H==="hex"?v.toHex32(this.h,"big"):v.split32(this.h,"big")}},40696:function(fe,p,x){"use strict";var v=x(27905),T=x(58889);function C(){if(!(this instanceof C))return new C;T.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}v.inherits(C,T),fe.exports=C,C.blockSize=1024,C.outSize=384,C.hmacStrength=192,C.padLength=128,C.prototype._digest=function(m){return m==="hex"?v.toHex32(this.h.slice(0,12),"big"):v.split32(this.h.slice(0,12),"big")}},58889:function(fe,p,x){"use strict";var v=x(27905),T=x(14427),C=x(35578),I=v.rotr64_hi,m=v.rotr64_lo,b=v.shr64_hi,g=v.shr64_lo,w=v.sum64,_=v.sum64_hi,A=v.sum64_lo,S=v.sum64_4_hi,k=v.sum64_4_lo,B=v.sum64_5_hi,O=v.sum64_5_lo,L=T.BlockHash,D=[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 W(){if(!(this instanceof W))return new W;L.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=D,this.W=new Array(160)}v.inherits(W,L),fe.exports=W,W.blockSize=1024,W.outSize=512,W.hmacStrength=192,W.padLength=128,W.prototype._prepareBlock=function(U,j){for(var $=this.W,ee=0;ee<32;ee++)$[ee]=U[j+ee];for(;ee<$.length;ee+=2){var J=N($[ee-4],$[ee-3]),F=z($[ee-4],$[ee-3]),X=$[ee-14],de=$[ee-13],Y=Ae($[ee-30],$[ee-29]),ce=re($[ee-30],$[ee-29]),he=$[ee-32],Ie=$[ee-31];$[ee]=S(J,F,X,de,Y,ce,he,Ie),$[ee+1]=k(J,F,X,de,Y,ce,he,Ie)}},W.prototype._update=function(U,j){this._prepareBlock(U,j);var $=this.W,ee=this.h[0],J=this.h[1],F=this.h[2],X=this.h[3],de=this.h[4],Y=this.h[5],ce=this.h[6],he=this.h[7],Ie=this.h[8],ke=this.h[9],ut=this.h[10],Re=this.h[11],ze=this.h[12],_t=this.h[13],Ct=this.h[14],$t=this.h[15];C(this.k.length===$.length);for(var ft=0;ft<$.length;ft+=2){var Xe=Ct,ct=$t,wt=be(Ie,ke),Rt=we(Ie,ke),Ge=H(Ie,ke,ut,Re,ze,_t),zt=G(Ie,ke,ut,Re,ze,_t),Ft=this.k[ft],tt=this.k[ft+1],qe=$[ft],dt=$[ft+1],De=B(Xe,ct,wt,Rt,Ge,zt,Ft,tt,qe,dt),He=O(Xe,ct,wt,Rt,Ge,zt,Ft,tt,qe,dt);Xe=ie(ee,J),ct=le(ee,J),wt=Z(ee,J,F,X,de,Y),Rt=Q(ee,J,F,X,de,Y);var se=_(Xe,ct,wt,Rt),oe=A(Xe,ct,wt,Rt);Ct=ze,$t=_t,ze=ut,_t=Re,ut=Ie,Re=ke,Ie=_(ce,he,De,He),ke=A(he,he,De,He),ce=de,he=Y,de=F,Y=X,F=ee,X=J,ee=_(De,He,se,oe),J=A(De,He,se,oe)}w(this.h,0,ee,J),w(this.h,2,F,X),w(this.h,4,de,Y),w(this.h,6,ce,he),w(this.h,8,Ie,ke),w(this.h,10,ut,Re),w(this.h,12,ze,_t),w(this.h,14,Ct,$t)},W.prototype._digest=function(U){return U==="hex"?v.toHex32(this.h,"big"):v.split32(this.h,"big")};function H(V,U,j,$,ee){var J=V&j^~Vⅇreturn J<0&&(J+=4294967296),J}function G(V,U,j,$,ee,J){var F=U&$^~U&J;return F<0&&(F+=4294967296),F}function Z(V,U,j,$,ee){var J=V&j^V&ee^jⅇreturn J<0&&(J+=4294967296),J}function Q(V,U,j,$,ee,J){var F=U&$^U&J^$&J;return F<0&&(F+=4294967296),F}function ie(V,U){var j=I(V,U,28),$=I(U,V,2),ee=I(U,V,7),J=j^$^ee;return J<0&&(J+=4294967296),J}function le(V,U){var j=m(V,U,28),$=m(U,V,2),ee=m(U,V,7),J=j^$^ee;return J<0&&(J+=4294967296),J}function be(V,U){var j=I(V,U,14),$=I(V,U,18),ee=I(U,V,9),J=j^$^ee;return J<0&&(J+=4294967296),J}function we(V,U){var j=m(V,U,14),$=m(V,U,18),ee=m(U,V,9),J=j^$^ee;return J<0&&(J+=4294967296),J}function Ae(V,U){var j=I(V,U,1),$=I(V,U,8),ee=b(V,U,7),J=j^$^ee;return J<0&&(J+=4294967296),J}function re(V,U){var j=m(V,U,1),$=m(V,U,8),ee=g(V,U,7),J=j^$^ee;return J<0&&(J+=4294967296),J}function N(V,U){var j=I(V,U,19),$=I(U,V,29),ee=b(V,U,6),J=j^$^ee;return J<0&&(J+=4294967296),J}function z(V,U){var j=m(V,U,19),$=m(U,V,29),ee=g(V,U,6),J=j^$^ee;return J<0&&(J+=4294967296),J}},45660:function(fe,p,x){"use strict";var v=x(27905),T=v.rotr32;function C(S,k,B,O){if(S===0)return I(k,B,O);if(S===1||S===3)return b(k,B,O);if(S===2)return m(k,B,O)}p.ft_1=C;function I(S,k,B){return S&k^~S&B}p.ch32=I;function m(S,k,B){return S&k^S&B^k&B}p.maj32=m;function b(S,k,B){return S^k^B}p.p32=b;function g(S){return T(S,2)^T(S,13)^T(S,22)}p.s0_256=g;function w(S){return T(S,6)^T(S,11)^T(S,25)}p.s1_256=w;function _(S){return T(S,7)^T(S,18)^S>>>3}p.g0_256=_;function A(S){return T(S,17)^T(S,19)^S>>>10}p.g1_256=A},27905:function(fe,p,x){"use strict";var v=x(35578),T=x(91193);p.inherits=T;function C(z,V){return(z.charCodeAt(V)&64512)!==55296||V<0||V+1>=z.length?!1:(z.charCodeAt(V+1)&64512)===56320}function I(z,V){if(Array.isArray(z))return z.slice();if(!z)return[];var U=[];if(typeof z=="string")if(V){if(V==="hex")for(z=z.replace(/[^a-z0-9]+/ig,""),z.length%2!==0&&(z="0"+z),$=0;$<z.length;$+=2)U.push(parseInt(z[$]+z[$+1],16))}else for(var j=0,$=0;$<z.length;$++){var ee=z.charCodeAt($);ee<128?U[j++]=ee:ee<2048?(U[j++]=ee>>6|192,U[j++]=ee&63|128):C(z,$)?(ee=65536+((ee&1023)<<10)+(z.charCodeAt(++$)&1023),U[j++]=ee>>18|240,U[j++]=ee>>12&63|128,U[j++]=ee>>6&63|128,U[j++]=ee&63|128):(U[j++]=ee>>12|224,U[j++]=ee>>6&63|128,U[j++]=ee&63|128)}else for($=0;$<z.length;$++)U[$]=z[$]|0;return U}p.toArray=I;function m(z){for(var V="",U=0;U<z.length;U++)V+=w(z[U].toString(16));return V}p.toHex=m;function b(z){var V=z>>>24|z>>>8&65280|z<<8&16711680|(z&255)<<24;return V>>>0}p.htonl=b;function g(z,V){for(var U="",j=0;j<z.length;j++){var $=z[j];V==="little"&&($=b($)),U+=_($.toString(16))}return U}p.toHex32=g;function w(z){return z.length===1?"0"+z:z}p.zero2=w;function _(z){return z.length===7?"0"+z:z.length===6?"00"+z:z.length===5?"000"+z:z.length===4?"0000"+z:z.length===3?"00000"+z:z.length===2?"000000"+z:z.length===1?"0000000"+z:z}p.zero8=_;function A(z,V,U,j){var $=U-V;v($%4===0);for(var ee=new Array($/4),J=0,F=V;J<ee.length;J++,F+=4){var X;j==="big"?X=z[F]<<24|z[F+1]<<16|z[F+2]<<8|z[F+3]:X=z[F+3]<<24|z[F+2]<<16|z[F+1]<<8|z[F],ee[J]=X>>>0}return ee}p.join32=A;function S(z,V){for(var U=new Array(z.length*4),j=0,$=0;j<z.length;j++,$+=4){var ee=z[j];V==="big"?(U[$]=ee>>>24,U[$+1]=ee>>>16&255,U[$+2]=ee>>>8&255,U[$+3]=ee&255):(U[$+3]=ee>>>24,U[$+2]=ee>>>16&255,U[$+1]=ee>>>8&255,U[$]=ee&255)}return U}p.split32=S;function k(z,V){return z>>>V|z<<32-V}p.rotr32=k;function B(z,V){return z<<V|z>>>32-V}p.rotl32=B;function O(z,V){return z+V>>>0}p.sum32=O;function L(z,V,U){return z+V+U>>>0}p.sum32_3=L;function D(z,V,U,j){return z+V+U+j>>>0}p.sum32_4=D;function W(z,V,U,j,$){return z+V+U+j+$>>>0}p.sum32_5=W;function H(z,V,U,j){var $=z[V],ee=z[V+1],J=j+ee>>>0,F=(J<j?1:0)+U+$;z[V]=F>>>0,z[V+1]=J}p.sum64=H;function G(z,V,U,j){var $=V+j>>>0,ee=($<V?1:0)+z+U;return ee>>>0}p.sum64_hi=G;function Z(z,V,U,j){var $=V+j;return $>>>0}p.sum64_lo=Z;function Q(z,V,U,j,$,ee,J,F){var X=0,de=V;de=de+j>>>0,X+=de<V?1:0,de=de+ee>>>0,X+=de<ee?1:0,de=de+F>>>0,X+=de<F?1:0;var Y=z+U+$+J+X;return Y>>>0}p.sum64_4_hi=Q;function ie(z,V,U,j,$,ee,J,F){var X=V+j+ee+F;return X>>>0}p.sum64_4_lo=ie;function le(z,V,U,j,$,ee,J,F,X,de){var Y=0,ce=V;ce=ce+j>>>0,Y+=ce<V?1:0,ce=ce+ee>>>0,Y+=ce<ee?1:0,ce=ce+F>>>0,Y+=ce<F?1:0,ce=ce+de>>>0,Y+=ce<de?1:0;var he=z+U+$+J+X+Y;return he>>>0}p.sum64_5_hi=le;function be(z,V,U,j,$,ee,J,F,X,de){var Y=V+j+ee+F+de;return Y>>>0}p.sum64_5_lo=be;function we(z,V,U){var j=V<<32-U|z>>>U;return j>>>0}p.rotr64_hi=we;function Ae(z,V,U){var j=z<<32-U|V>>>U;return j>>>0}p.rotr64_lo=Ae;function re(z,V,U){return z>>>U}p.shr64_hi=re;function N(z,V,U){var j=z<<32-U|V>>>U;return j>>>0}p.shr64_lo=N},75630:function(fe,p,x){"use strict";var v=Function.prototype.call,T=Object.prototype.hasOwnProperty,C=x(79524);fe.exports=C.call(v,T)},52519:function(fe,p,x){"use strict";var v=x(61631),T=x(94209),C=x(35578);function I(m){if(!(this instanceof I))return new I(m);this.hash=m.hash,this.predResist=!!m.predResist,this.outLen=this.hash.outSize,this.minEntropy=m.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var b=T.toArray(m.entropy,m.entropyEnc||"hex"),g=T.toArray(m.nonce,m.nonceEnc||"hex"),w=T.toArray(m.pers,m.persEnc||"hex");C(b.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(b,g,w)}fe.exports=I,I.prototype._init=function(b,g,w){var _=b.concat(g).concat(w);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var A=0;A<this.V.length;A++)this.K[A]=0,this.V[A]=1;this._update(_),this._reseed=1,this.reseedInterval=281474976710656},I.prototype._hmac=function(){return new v.hmac(this.hash,this.K)},I.prototype._update=function(b){var g=this._hmac().update(this.V).update([0]);b&&(g=g.update(b)),this.K=g.digest(),this.V=this._hmac().update(this.V).digest(),b&&(this.K=this._hmac().update(this.V).update([1]).update(b).digest(),this.V=this._hmac().update(this.V).digest())},I.prototype.reseed=function(b,g,w,_){typeof g!="string"&&(_=w,w=g,g=null),b=T.toArray(b,g),w=T.toArray(w,_),C(b.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(b.concat(w||[])),this._reseed=1},I.prototype.generate=function(b,g,w,_){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof g!="string"&&(_=w,w=g,g=null),w&&(w=T.toArray(w,_||"hex"),this._update(w));for(var A=[];A.length<b;)this.V=this._hmac().update(this.V).digest(),A=A.concat(this.V);var S=A.slice(0,b);return this._update(w),this._reseed++,T.encode(S,g)}},63328:function(fe,p){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */p.read=function(x,v,T,C,I){var m,b,g=I*8-C-1,w=(1<<g)-1,_=w>>1,A=-7,S=T?I-1:0,k=T?-1:1,B=x[v+S];for(S+=k,m=B&(1<<-A)-1,B>>=-A,A+=g;A>0;m=m*256+x[v+S],S+=k,A-=8);for(b=m&(1<<-A)-1,m>>=-A,A+=C;A>0;b=b*256+x[v+S],S+=k,A-=8);if(m===0)m=1-_;else{if(m===w)return b?NaN:(B?-1:1)*(1/0);b=b+Math.pow(2,C),m=m-_}return(B?-1:1)*b*Math.pow(2,m-C)},p.write=function(x,v,T,C,I,m){var b,g,w,_=m*8-I-1,A=(1<<_)-1,S=A>>1,k=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=C?0:m-1,O=C?1:-1,L=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(g=isNaN(v)?1:0,b=A):(b=Math.floor(Math.log(v)/Math.LN2),v*(w=Math.pow(2,-b))<1&&(b--,w*=2),b+S>=1?v+=k/w:v+=k*Math.pow(2,1-S),v*w>=2&&(b++,w/=2),b+S>=A?(g=0,b=A):b+S>=1?(g=(v*w-1)*Math.pow(2,I),b=b+S):(g=v*Math.pow(2,S-1)*Math.pow(2,I),b=0));I>=8;x[T+B]=g&255,B+=O,g/=256,I-=8);for(b=b<<I|g,_+=I;_>0;x[T+B]=b&255,B+=O,b/=256,_-=8);x[T+B-O]|=L*128}},91193:function(fe){typeof Object.create=="function"?fe.exports=function(x,v){v&&(x.super_=v,x.prototype=Object.create(v.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}))}:fe.exports=function(x,v){if(v){x.super_=v;var T=function(){};T.prototype=v.prototype,x.prototype=new T,x.prototype.constructor=x}}},5117:function(fe,p,x){"use strict";var v=x(77185)(),T=x(11187),C=T("Object.prototype.toString"),I=function(w){return v&&w&&typeof w=="object"&&Symbol.toStringTag in w?!1:C(w)==="[object Arguments]"},m=function(w){return I(w)?!0:w!==null&&typeof w=="object"&&typeof w.length=="number"&&w.length>=0&&C(w)!=="[object Array]"&&C(w.callee)==="[object Function]"},b=function(){return I(arguments)}();I.isLegacyArguments=m,fe.exports=b?I:m},22956:function(fe){"use strict";var p=Function.prototype.toString,x=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,v,T;if(typeof x=="function"&&typeof Object.defineProperty=="function")try{v=Object.defineProperty({},"length",{get:function(){throw T}}),T={},x(function(){throw 42},null,v)}catch(W){W!==T&&(x=null)}else x=null;var C=/^\s*class\b/,I=function(H){try{var G=p.call(H);return C.test(G)}catch{return!1}},m=function(H){try{return I(H)?!1:(p.call(H),!0)}catch{return!1}},b=Object.prototype.toString,g="[object Object]",w="[object Function]",_="[object GeneratorFunction]",A="[object HTMLAllCollection]",S="[object HTML document.all class]",k="[object HTMLCollection]",B=typeof Symbol=="function"&&!!Symbol.toStringTag,O=!(0 in[,]),L=function(){return!1};if(typeof document=="object"){var D=document.all;b.call(D)===b.call(document.all)&&(L=function(H){if((O||!H)&&(typeof H>"u"||typeof H=="object"))try{var G=b.call(H);return(G===A||G===S||G===k||G===g)&&H("")==null}catch{}return!1})}fe.exports=x?function(H){if(L(H))return!0;if(!H||typeof H!="function"&&typeof H!="object")return!1;try{x(H,null,v)}catch(G){if(G!==T)return!1}return!I(H)&&m(H)}:function(H){if(L(H))return!0;if(!H||typeof H!="function"&&typeof H!="object")return!1;if(B)return m(H);if(I(H))return!1;var G=b.call(H);return G!==w&&G!==_&&!/^\[object HTML/.test(G)?!1:m(H)}},94204:function(fe,p,x){"use strict";var v=x(98801),T=x(43282),C=T(/^\s*(?:function)?\*/),I=x(77185)(),m=x(14252),b=v("Object.prototype.toString"),g=v("Function.prototype.toString"),w=function(){if(!I)return!1;try{return Function("return function*() {}")()}catch{}},_;fe.exports=function(S){if(typeof S!="function")return!1;if(C(g(S)))return!0;if(!I){var k=b(S);return k==="[object GeneratorFunction]"}if(!m)return!1;if(typeof _>"u"){var B=w();_=B?m(B):!1}return m(S)===_}},94782:function(fe){fe.exports=function(x){if(typeof x!="string")throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof x+", while checking isHexPrefixed.");return x.slice(0,2)==="0x"}},84770:function(fe){"use strict";fe.exports=function(x){return x!==x}},14954:function(fe,p,x){"use strict";var v=x(17695),T=x(4938),C=x(84770),I=x(2219),m=x(54445),b=v(I(),Number);T(b,{getPolyfill:I,implementation:C,shim:m}),fe.exports=b},2219:function(fe,p,x){"use strict";var v=x(84770);fe.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:v}},54445:function(fe,p,x){"use strict";var v=x(4938),T=x(2219);fe.exports=function(){var I=T();return v(Number,{isNaN:I},{isNaN:function(){return Number.isNaN!==I}}),I}},10092:function(fe,p,x){"use strict";var v=x(98801),T=x(77185)(),C=x(75630),I=x(25667),m;if(T){var b=v("RegExp.prototype.exec"),g={},w=function(){throw g},_={toString:w,valueOf:w};typeof Symbol.toPrimitive=="symbol"&&(_[Symbol.toPrimitive]=w),m=function(B){if(!B||typeof B!="object")return!1;var O=I(B,"lastIndex"),L=O&&C(O,"value");if(!L)return!1;try{b(B,_)}catch(D){return D===g}}}else{var A=v("Object.prototype.toString"),S="[object RegExp]";m=function(B){return!B||typeof B!="object"&&typeof B!="function"?!1:A(B)===S}}fe.exports=m},40006:function(fe,p,x){"use strict";var v=x(1728);fe.exports=function(C){return!!v(C)}},52149:function(fe,p,x){"use strict";const v=x(33357).v4,T=x(89456),C=function(I,m){if(!(this instanceof C))return new C(I,m);m||(m={}),this.options={reviver:typeof m.reviver<"u"?m.reviver:null,replacer:typeof m.replacer<"u"?m.replacer:null,generator:typeof m.generator<"u"?m.generator:function(){return v()},version:typeof m.version<"u"?m.version:2,notificationIdNull:typeof m.notificationIdNull=="boolean"?m.notificationIdNull:!1},this.callServer=I};fe.exports=C,C.prototype.request=function(I,m,b,g){const w=this;let _=null;const A=Array.isArray(I)&&typeof m=="function";if(this.options.version===1&&A)throw new TypeError("JSON-RPC 1.0 does not support batching");if(A||!A&&I&&typeof I=="object"&&typeof m=="function")g=m,_=I;else{typeof b=="function"&&(g=b,b=void 0);const B=typeof g=="function";try{_=T(I,m,b,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(O){if(B)return g(O);throw O}if(!B)return _}let k;try{k=JSON.stringify(_,this.options.replacer)}catch(B){return g(B)}return this.callServer(k,function(B,O){w._parseResponse(B,O,g)}),_},C.prototype._parseResponse=function(I,m,b){if(I){b(I);return}if(!m)return b();let g;try{g=JSON.parse(m,this.options.reviver)}catch(w){return b(w)}if(b.length===3)if(Array.isArray(g)){const w=function(A){return typeof A.error<"u"},_=function(A){return!w(A)};return b(null,g.filter(w),g.filter(_))}else return b(null,g.error,g.result);b(null,g)}},89456:function(fe,p,x){"use strict";const v=x(33357).v4,T=function(C,I,m,b){if(typeof C!="string")throw new TypeError(C+" must be a string");b=b||{};const g=typeof b.version=="number"?b.version:2;if(g!==1&&g!==2)throw new TypeError(g+" must be 1 or 2");const w={method:C};if(g===2&&(w.jsonrpc="2.0"),I){if(typeof I!="object"&&!Array.isArray(I))throw new TypeError(I+" must be an object, array or omitted");w.params=I}if(typeof m>"u"){const _=typeof b.generator=="function"?b.generator:function(){return v()};w.id=_(w,b)}else g===2&&m===null?b.notificationIdNull&&(w.id=null):w.id=m;return w};fe.exports=T},77308:function(fe){(function(p,x){fe.exports=x()})(this,function(){"use strict";var p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function x(tt,qe,dt,De){var He,se,oe,ye=qe||[0],Ee=(dt=dt||0)>>>3,me=De===-1?3:0;for(He=0;He<tt.length;He+=1)se=(oe=He+Ee)>>>2,ye.length<=se&&ye.push(0),ye[se]|=tt[He]<<8*(me+De*(oe%4));return{value:ye,binLen:8*tt.length+dt}}function v(tt,qe,dt){switch(qe){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(tt){case"HEX":return function(De,He,se){return function(oe,ye,Ee,me){var Te,Oe,Qe,Vt;if(oe.length%2!=0)throw new Error("String of HEX type must be in byte increments");var vt=ye||[0],Zt=(Ee=Ee||0)>>>3,dn=me===-1?3:0;for(Te=0;Te<oe.length;Te+=2){if(Oe=parseInt(oe.substr(Te,2),16),isNaN(Oe))throw new Error("String of HEX type contains invalid characters");for(Qe=(Vt=(Te>>>1)+Zt)>>>2;vt.length<=Qe;)vt.push(0);vt[Qe]|=Oe<<8*(dn+me*(Vt%4))}return{value:vt,binLen:4*oe.length+Ee}}(De,He,se,dt)};case"TEXT":return function(De,He,se){return function(oe,ye,Ee,me,Te){var Oe,Qe,Vt,vt,Zt,dn,ln,yn,or=0,An=Ee||[0],Un=(me=me||0)>>>3;if(ye==="UTF8")for(ln=Te===-1?3:0,Vt=0;Vt<oe.length;Vt+=1)for(Qe=[],128>(Oe=oe.charCodeAt(Vt))?Qe.push(Oe):2048>Oe?(Qe.push(192|Oe>>>6),Qe.push(128|63&Oe)):55296>Oe||57344<=Oe?Qe.push(224|Oe>>>12,128|Oe>>>6&63,128|63&Oe):(Vt+=1,Oe=65536+((1023&Oe)<<10|1023&oe.charCodeAt(Vt)),Qe.push(240|Oe>>>18,128|Oe>>>12&63,128|Oe>>>6&63,128|63&Oe)),vt=0;vt<Qe.length;vt+=1){for(Zt=(dn=or+Un)>>>2;An.length<=Zt;)An.push(0);An[Zt]|=Qe[vt]<<8*(ln+Te*(dn%4)),or+=1}else for(ln=Te===-1?2:0,yn=ye==="UTF16LE"&&Te!==1||ye!=="UTF16LE"&&Te===1,Vt=0;Vt<oe.length;Vt+=1){for(Oe=oe.charCodeAt(Vt),yn===!0&&(Oe=(vt=255&Oe)<<8|Oe>>>8),Zt=(dn=or+Un)>>>2;An.length<=Zt;)An.push(0);An[Zt]|=Oe<<8*(ln+Te*(dn%4)),or+=2}return{value:An,binLen:8*or+me}}(De,qe,He,se,dt)};case"B64":return function(De,He,se){return function(oe,ye,Ee,me){var Te,Oe,Qe,Vt,vt,Zt,dn=0,ln=ye||[0],yn=(Ee=Ee||0)>>>3,or=me===-1?3:0,An=oe.indexOf("=");if(oe.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(oe=oe.replace(/=/g,""),An!==-1&&An<oe.length)throw new Error("Invalid '=' found in base-64 string");for(Te=0;Te<oe.length;Te+=4){for(Vt=oe.substr(Te,4),Qe=0,Oe=0;Oe<Vt.length;Oe+=1)Qe|=p.indexOf(Vt.charAt(Oe))<<18-6*Oe;for(Oe=0;Oe<Vt.length-1;Oe+=1){for(vt=(Zt=dn+yn)>>>2;ln.length<=vt;)ln.push(0);ln[vt]|=(Qe>>>16-8*Oe&255)<<8*(or+me*(Zt%4)),dn+=1}}return{value:ln,binLen:8*dn+Ee}}(De,He,se,dt)};case"BYTES":return function(De,He,se){return function(oe,ye,Ee,me){var Te,Oe,Qe,Vt,vt=ye||[0],Zt=(Ee=Ee||0)>>>3,dn=me===-1?3:0;for(Oe=0;Oe<oe.length;Oe+=1)Te=oe.charCodeAt(Oe),Qe=(Vt=Oe+Zt)>>>2,vt.length<=Qe&&vt.push(0),vt[Qe]|=Te<<8*(dn+me*(Vt%4));return{value:vt,binLen:8*oe.length+Ee}}(De,He,se,dt)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error("ARRAYBUFFER not supported by this environment")}return function(De,He,se){return function(oe,ye,Ee,me){return x(new Uint8Array(oe),ye,Ee,me)}(De,He,se,dt)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error("UINT8ARRAY not supported by this environment")}return function(De,He,se){return x(De,He,se,dt)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function T(tt,qe,dt,De){switch(tt){case"HEX":return function(He){return function(se,oe,ye,Ee){var me,Te,Oe="",Qe=oe/8,Vt=ye===-1?3:0;for(me=0;me<Qe;me+=1)Te=se[me>>>2]>>>8*(Vt+ye*(me%4)),Oe+="0123456789abcdef".charAt(Te>>>4&15)+"0123456789abcdef".charAt(15&Te);return Ee.outputUpper?Oe.toUpperCase():Oe}(He,qe,dt,De)};case"B64":return function(He){return function(se,oe,ye,Ee){var me,Te,Oe,Qe,Vt,vt="",Zt=oe/8,dn=ye===-1?3:0;for(me=0;me<Zt;me+=3)for(Qe=me+1<Zt?se[me+1>>>2]:0,Vt=me+2<Zt?se[me+2>>>2]:0,Oe=(se[me>>>2]>>>8*(dn+ye*(me%4))&255)<<16|(Qe>>>8*(dn+ye*((me+1)%4))&255)<<8|Vt>>>8*(dn+ye*((me+2)%4))&255,Te=0;Te<4;Te+=1)vt+=8*me+6*Te<=oe?p.charAt(Oe>>>6*(3-Te)&63):Ee.b64Pad;return vt}(He,qe,dt,De)};case"BYTES":return function(He){return function(se,oe,ye){var Ee,me,Te="",Oe=oe/8,Qe=ye===-1?3:0;for(Ee=0;Ee<Oe;Ee+=1)me=se[Ee>>>2]>>>8*(Qe+ye*(Ee%4))&255,Te+=String.fromCharCode(me);return Te}(He,qe,dt)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error("ARRAYBUFFER not supported by this environment")}return function(He){return function(se,oe,ye){var Ee,me=oe/8,Te=new ArrayBuffer(me),Oe=new Uint8Array(Te),Qe=ye===-1?3:0;for(Ee=0;Ee<me;Ee+=1)Oe[Ee]=se[Ee>>>2]>>>8*(Qe+ye*(Ee%4))&255;return Te}(He,qe,dt)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error("UINT8ARRAY not supported by this environment")}return function(He){return function(se,oe,ye){var Ee,me=oe/8,Te=ye===-1?3:0,Oe=new Uint8Array(me);for(Ee=0;Ee<me;Ee+=1)Oe[Ee]=se[Ee>>>2]>>>8*(Te+ye*(Ee%4))&255;return Oe}(He,qe,dt)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}var C=[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],I=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],m=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],b="Chosen SHA variant is not supported";function g(tt,qe){var dt,De,He=tt.binLen>>>3,se=qe.binLen>>>3,oe=He<<3,ye=4-He<<3;if(He%4!=0){for(dt=0;dt<se;dt+=4)De=He+dt>>>2,tt.value[De]|=qe.value[dt>>>2]<<oe,tt.value.push(0),tt.value[De+1]|=qe.value[dt>>>2]>>>ye;return(tt.value.length<<2)-4>=se+He&&tt.value.pop(),{value:tt.value,binLen:tt.binLen+qe.binLen}}return{value:tt.value.concat(qe.value),binLen:tt.binLen+qe.binLen}}function w(tt){var qe={outputUpper:!1,b64Pad:"=",outputLen:-1},dt=tt||{},De="Output length must be a multiple of 8";if(qe.outputUpper=dt.outputUpper||!1,dt.b64Pad&&(qe.b64Pad=dt.b64Pad),dt.outputLen){if(dt.outputLen%8!=0)throw new Error(De);qe.outputLen=dt.outputLen}else if(dt.shakeLen){if(dt.shakeLen%8!=0)throw new Error(De);qe.outputLen=dt.shakeLen}if(typeof qe.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof qe.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return qe}function _(tt,qe,dt,De){var He=tt+" must include a value and format";if(!qe){if(!De)throw new Error(He);return De}if(qe.value===void 0||!qe.format)throw new Error(He);return v(qe.format,qe.encoding||"UTF8",dt)(qe.value)}var A=function(){function tt(qe,dt,De){var He=De||{};if(this.t=dt,this.i=He.encoding||"UTF8",this.numRounds=He.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=qe,this.u=[],this.s=0,this.h=!1,this.v=0,this.A=!1,this.l=[],this.H=[]}return tt.prototype.update=function(qe){var dt,De=0,He=this.S>>>5,se=this.p(qe,this.u,this.s),oe=se.binLen,ye=se.value,Ee=oe>>>5;for(dt=0;dt<Ee;dt+=He)De+this.S<=oe&&(this.m=this.R(ye.slice(dt,dt+He),this.m),De+=this.S);this.v+=De,this.u=ye.slice(De>>>5),this.s=oe%this.S,this.h=!0},tt.prototype.getHash=function(qe,dt){var De,He,se=this.U,oe=w(dt);if(this.T){if(oe.outputLen===-1)throw new Error("Output length must be specified in options");se=oe.outputLen}var ye=T(qe,se,this.C,oe);if(this.A&&this.F)return ye(this.F(oe));for(He=this.K(this.u.slice(),this.s,this.v,this.B(this.m),se),De=1;De<this.numRounds;De+=1)this.T&&se%32!=0&&(He[He.length-1]&=16777215>>>24-se%32),He=this.K(He,se,0,this.L(this.o),se);return ye(He)},tt.prototype.setHMACKey=function(qe,dt,De){if(!this.g)throw new Error("Variant does not support HMAC");if(this.h)throw new Error("Cannot set MAC key after calling update");var He=v(dt,(De||{}).encoding||"UTF8",this.C);this.k(He(qe))},tt.prototype.k=function(qe){var dt,De=this.S>>>3,He=De/4-1;if(this.numRounds!==1)throw new Error("Cannot set numRounds with MAC");if(this.A)throw new Error("MAC key already set");for(De<qe.binLen/8&&(qe.value=this.K(qe.value,qe.binLen,0,this.L(this.o),this.U));qe.value.length<=He;)qe.value.push(0);for(dt=0;dt<=He;dt+=1)this.l[dt]=909522486^qe.value[dt],this.H[dt]=1549556828^qe.value[dt];this.m=this.R(this.l,this.m),this.v=this.S,this.A=!0},tt.prototype.getHMAC=function(qe,dt){var De=w(dt);return T(qe,this.U,this.C,De)(this.Y())},tt.prototype.Y=function(){var qe;if(!this.A)throw new Error("Cannot call getHMAC without first setting MAC key");var dt=this.K(this.u.slice(),this.s,this.v,this.B(this.m),this.U);return qe=this.R(this.H,this.L(this.o)),qe=this.K(dt,this.U,this.S,qe,this.U)},tt}(),S=function(tt,qe){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(dt,De){dt.__proto__=De}||function(dt,De){for(var He in De)Object.prototype.hasOwnProperty.call(De,He)&&(dt[He]=De[He])})(tt,qe)};function k(tt,qe){function dt(){this.constructor=tt}S(tt,qe),tt.prototype=qe===null?Object.create(qe):(dt.prototype=qe.prototype,new dt)}function B(tt,qe){return tt<<qe|tt>>>32-qe}function O(tt,qe){return tt>>>qe|tt<<32-qe}function L(tt,qe){return tt>>>qe}function D(tt,qe,dt){return tt^qe^dt}function W(tt,qe,dt){return tt&qe^~tt&dt}function H(tt,qe,dt){return tt&qe^tt&dt^qe&dt}function G(tt){return O(tt,2)^O(tt,13)^O(tt,22)}function Z(tt,qe){var dt=(65535&tt)+(65535&qe);return(65535&(tt>>>16)+(qe>>>16)+(dt>>>16))<<16|65535&dt}function Q(tt,qe,dt,De){var He=(65535&tt)+(65535&qe)+(65535&dt)+(65535&De);return(65535&(tt>>>16)+(qe>>>16)+(dt>>>16)+(De>>>16)+(He>>>16))<<16|65535&He}function ie(tt,qe,dt,De,He){var se=(65535&tt)+(65535&qe)+(65535&dt)+(65535&De)+(65535&He);return(65535&(tt>>>16)+(qe>>>16)+(dt>>>16)+(De>>>16)+(He>>>16)+(se>>>16))<<16|65535&se}function le(tt){return O(tt,7)^O(tt,18)^L(tt,3)}function be(tt){return O(tt,6)^O(tt,11)^O(tt,25)}function we(tt){return[1732584193,4023233417,2562383102,271733878,3285377520]}function Ae(tt,qe){var dt,De,He,se,oe,ye,Ee,me=[];for(dt=qe[0],De=qe[1],He=qe[2],se=qe[3],oe=qe[4],Ee=0;Ee<80;Ee+=1)me[Ee]=Ee<16?tt[Ee]:B(me[Ee-3]^me[Ee-8]^me[Ee-14]^me[Ee-16],1),ye=Ee<20?ie(B(dt,5),W(De,He,se),oe,1518500249,me[Ee]):Ee<40?ie(B(dt,5),D(De,He,se),oe,1859775393,me[Ee]):Ee<60?ie(B(dt,5),H(De,He,se),oe,2400959708,me[Ee]):ie(B(dt,5),D(De,He,se),oe,3395469782,me[Ee]),oe=se,se=He,He=B(De,30),De=dt,dt=ye;return qe[0]=Z(dt,qe[0]),qe[1]=Z(De,qe[1]),qe[2]=Z(He,qe[2]),qe[3]=Z(se,qe[3]),qe[4]=Z(oe,qe[4]),qe}function re(tt,qe,dt,De){for(var He,se=15+(qe+65>>>9<<4),oe=qe+dt;tt.length<=se;)tt.push(0);for(tt[qe>>>5]|=128<<24-qe%32,tt[se]=4294967295&oe,tt[se-1]=oe/4294967296|0,He=0;He<tt.length;He+=16)De=Ae(tt.slice(He,He+16),De);return De}var N=function(tt){function qe(dt,De,He){var se=this;if(dt!=="SHA-1")throw new Error(b);var oe=He||{};return(se=tt.call(this,dt,De,He)||this).g=!0,se.F=se.Y,se.C=-1,se.p=v(se.t,se.i,se.C),se.R=Ae,se.B=function(ye){return ye.slice()},se.L=we,se.K=re,se.m=[1732584193,4023233417,2562383102,271733878,3285377520],se.S=512,se.U=160,se.T=!1,oe.hmacKey&&se.k(_("hmacKey",oe.hmacKey,se.C)),se}return k(qe,tt),qe}(A);function z(tt){return tt=="SHA-224"?I.slice():m.slice()}function V(tt,qe){var dt,De,He,se,oe,ye,Ee,me,Te,Oe,Qe,Vt,vt=[];for(dt=qe[0],De=qe[1],He=qe[2],se=qe[3],oe=qe[4],ye=qe[5],Ee=qe[6],me=qe[7],Qe=0;Qe<64;Qe+=1)vt[Qe]=Qe<16?tt[Qe]:Q(O(Vt=vt[Qe-2],17)^O(Vt,19)^L(Vt,10),vt[Qe-7],le(vt[Qe-15]),vt[Qe-16]),Te=ie(me,be(oe),W(oe,ye,Ee),C[Qe],vt[Qe]),Oe=Z(G(dt),H(dt,De,He)),me=Ee,Ee=ye,ye=oe,oe=Z(se,Te),se=He,He=De,De=dt,dt=Z(Te,Oe);return qe[0]=Z(dt,qe[0]),qe[1]=Z(De,qe[1]),qe[2]=Z(He,qe[2]),qe[3]=Z(se,qe[3]),qe[4]=Z(oe,qe[4]),qe[5]=Z(ye,qe[5]),qe[6]=Z(Ee,qe[6]),qe[7]=Z(me,qe[7]),qe}var U=function(tt){function qe(dt,De,He){var se=this;if(dt!=="SHA-224"&&dt!=="SHA-256")throw new Error(b);var oe=He||{};return(se=tt.call(this,dt,De,He)||this).F=se.Y,se.g=!0,se.C=-1,se.p=v(se.t,se.i,se.C),se.R=V,se.B=function(ye){return ye.slice()},se.L=z,se.K=function(ye,Ee,me,Te){return function(Oe,Qe,Vt,vt,Zt){for(var dn,ln=15+(Qe+65>>>9<<4),yn=Qe+Vt;Oe.length<=ln;)Oe.push(0);for(Oe[Qe>>>5]|=128<<24-Qe%32,Oe[ln]=4294967295&yn,Oe[ln-1]=yn/4294967296|0,dn=0;dn<Oe.length;dn+=16)vt=V(Oe.slice(dn,dn+16),vt);return Zt==="SHA-224"?[vt[0],vt[1],vt[2],vt[3],vt[4],vt[5],vt[6]]:vt}(ye,Ee,me,Te,dt)},se.m=z(dt),se.S=512,se.U=dt==="SHA-224"?224:256,se.T=!1,oe.hmacKey&&se.k(_("hmacKey",oe.hmacKey,se.C)),se}return k(qe,tt),qe}(A),j=function(tt,qe){this.N=tt,this.I=qe};function $(tt,qe){var dt;return qe>32?(dt=64-qe,new j(tt.I<<qe|tt.N>>>dt,tt.N<<qe|tt.I>>>dt)):qe!==0?(dt=32-qe,new j(tt.N<<qe|tt.I>>>dt,tt.I<<qe|tt.N>>>dt)):tt}function ee(tt,qe){var dt;return qe<32?(dt=32-qe,new j(tt.N>>>qe|tt.I<<dt,tt.I>>>qe|tt.N<<dt)):(dt=64-qe,new j(tt.I>>>qe|tt.N<<dt,tt.N>>>qe|tt.I<<dt))}function J(tt,qe){return new j(tt.N>>>qe,tt.I>>>qe|tt.N<<32-qe)}function F(tt,qe,dt){return new j(tt.N&qe.N^~tt.N&dt.N,tt.I&qe.I^~tt.I&dt.I)}function X(tt,qe,dt){return new j(tt.N&qe.N^tt.N&dt.N^qe.N&dt.N,tt.I&qe.I^tt.I&dt.I^qe.I&dt.I)}function de(tt){var qe=ee(tt,28),dt=ee(tt,34),De=ee(tt,39);return new j(qe.N^dt.N^De.N,qe.I^dt.I^De.I)}function Y(tt,qe){var dt,De;dt=(65535&tt.I)+(65535&qe.I);var He=(65535&(De=(tt.I>>>16)+(qe.I>>>16)+(dt>>>16)))<<16|65535&dt;return dt=(65535&tt.N)+(65535&qe.N)+(De>>>16),De=(tt.N>>>16)+(qe.N>>>16)+(dt>>>16),new j((65535&De)<<16|65535&dt,He)}function ce(tt,qe,dt,De){var He,se;He=(65535&tt.I)+(65535&qe.I)+(65535&dt.I)+(65535&De.I);var oe=(65535&(se=(tt.I>>>16)+(qe.I>>>16)+(dt.I>>>16)+(De.I>>>16)+(He>>>16)))<<16|65535&He;return He=(65535&tt.N)+(65535&qe.N)+(65535&dt.N)+(65535&De.N)+(se>>>16),se=(tt.N>>>16)+(qe.N>>>16)+(dt.N>>>16)+(De.N>>>16)+(He>>>16),new j((65535&se)<<16|65535&He,oe)}function he(tt,qe,dt,De,He){var se,oe;se=(65535&tt.I)+(65535&qe.I)+(65535&dt.I)+(65535&De.I)+(65535&He.I);var ye=(65535&(oe=(tt.I>>>16)+(qe.I>>>16)+(dt.I>>>16)+(De.I>>>16)+(He.I>>>16)+(se>>>16)))<<16|65535&se;return se=(65535&tt.N)+(65535&qe.N)+(65535&dt.N)+(65535&De.N)+(65535&He.N)+(oe>>>16),oe=(tt.N>>>16)+(qe.N>>>16)+(dt.N>>>16)+(De.N>>>16)+(He.N>>>16)+(se>>>16),new j((65535&oe)<<16|65535&se,ye)}function Ie(tt,qe){return new j(tt.N^qe.N,tt.I^qe.I)}function ke(tt){var qe=ee(tt,1),dt=ee(tt,8),De=J(tt,7);return new j(qe.N^dt.N^De.N,qe.I^dt.I^De.I)}function ut(tt){var qe=ee(tt,14),dt=ee(tt,18),De=ee(tt,41);return new j(qe.N^dt.N^De.N,qe.I^dt.I^De.I)}var Re=[new j(C[0],3609767458),new j(C[1],602891725),new j(C[2],3964484399),new j(C[3],2173295548),new j(C[4],4081628472),new j(C[5],3053834265),new j(C[6],2937671579),new j(C[7],3664609560),new j(C[8],2734883394),new j(C[9],1164996542),new j(C[10],1323610764),new j(C[11],3590304994),new j(C[12],4068182383),new j(C[13],991336113),new j(C[14],633803317),new j(C[15],3479774868),new j(C[16],2666613458),new j(C[17],944711139),new j(C[18],2341262773),new j(C[19],2007800933),new j(C[20],1495990901),new j(C[21],1856431235),new j(C[22],3175218132),new j(C[23],2198950837),new j(C[24],3999719339),new j(C[25],766784016),new j(C[26],2566594879),new j(C[27],3203337956),new j(C[28],1034457026),new j(C[29],2466948901),new j(C[30],3758326383),new j(C[31],168717936),new j(C[32],1188179964),new j(C[33],1546045734),new j(C[34],1522805485),new j(C[35],2643833823),new j(C[36],2343527390),new j(C[37],1014477480),new j(C[38],1206759142),new j(C[39],344077627),new j(C[40],1290863460),new j(C[41],3158454273),new j(C[42],3505952657),new j(C[43],106217008),new j(C[44],3606008344),new j(C[45],1432725776),new j(C[46],1467031594),new j(C[47],851169720),new j(C[48],3100823752),new j(C[49],1363258195),new j(C[50],3750685593),new j(C[51],3785050280),new j(C[52],3318307427),new j(C[53],3812723403),new j(C[54],2003034995),new j(C[55],3602036899),new j(C[56],1575990012),new j(C[57],1125592928),new j(C[58],2716904306),new j(C[59],442776044),new j(C[60],593698344),new j(C[61],3733110249),new j(C[62],2999351573),new j(C[63],3815920427),new j(3391569614,3928383900),new j(3515267271,566280711),new j(3940187606,3454069534),new j(4118630271,4000239992),new j(116418474,1914138554),new j(174292421,2731055270),new j(289380356,3203993006),new j(460393269,320620315),new j(685471733,587496836),new j(852142971,1086792851),new j(1017036298,365543100),new j(1126000580,2618297676),new j(1288033470,3409855158),new j(1501505948,4234509866),new j(1607167915,987167468),new j(1816402316,1246189591)];function ze(tt){return tt==="SHA-384"?[new j(3418070365,I[0]),new j(1654270250,I[1]),new j(2438529370,I[2]),new j(355462360,I[3]),new j(1731405415,I[4]),new j(41048885895,I[5]),new j(3675008525,I[6]),new j(1203062813,I[7])]:[new j(m[0],4089235720),new j(m[1],2227873595),new j(m[2],4271175723),new j(m[3],1595750129),new j(m[4],2917565137),new j(m[5],725511199),new j(m[6],4215389547),new j(m[7],327033209)]}function _t(tt,qe){var dt,De,He,se,oe,ye,Ee,me,Te,Oe,Qe,Vt,vt,Zt,dn,ln,yn=[];for(dt=qe[0],De=qe[1],He=qe[2],se=qe[3],oe=qe[4],ye=qe[5],Ee=qe[6],me=qe[7],Qe=0;Qe<80;Qe+=1)Qe<16?(Vt=2*Qe,yn[Qe]=new j(tt[Vt],tt[Vt+1])):yn[Qe]=ce((vt=yn[Qe-2],Zt=void 0,dn=void 0,ln=void 0,Zt=ee(vt,19),dn=ee(vt,61),ln=J(vt,6),new j(Zt.N^dn.N^ln.N,Zt.I^dn.I^ln.I)),yn[Qe-7],ke(yn[Qe-15]),yn[Qe-16]),Te=he(me,ut(oe),F(oe,ye,Ee),Re[Qe],yn[Qe]),Oe=Y(de(dt),X(dt,De,He)),me=Ee,Ee=ye,ye=oe,oe=Y(se,Te),se=He,He=De,De=dt,dt=Y(Te,Oe);return qe[0]=Y(dt,qe[0]),qe[1]=Y(De,qe[1]),qe[2]=Y(He,qe[2]),qe[3]=Y(se,qe[3]),qe[4]=Y(oe,qe[4]),qe[5]=Y(ye,qe[5]),qe[6]=Y(Ee,qe[6]),qe[7]=Y(me,qe[7]),qe}var Ct=function(tt){function qe(dt,De,He){var se=this;if(dt!=="SHA-384"&&dt!=="SHA-512")throw new Error(b);var oe=He||{};return(se=tt.call(this,dt,De,He)||this).F=se.Y,se.g=!0,se.C=-1,se.p=v(se.t,se.i,se.C),se.R=_t,se.B=function(ye){return ye.slice()},se.L=ze,se.K=function(ye,Ee,me,Te){return function(Oe,Qe,Vt,vt,Zt){for(var dn,ln=31+(Qe+129>>>10<<5),yn=Qe+Vt;Oe.length<=ln;)Oe.push(0);for(Oe[Qe>>>5]|=128<<24-Qe%32,Oe[ln]=4294967295&yn,Oe[ln-1]=yn/4294967296|0,dn=0;dn<Oe.length;dn+=32)vt=_t(Oe.slice(dn,dn+32),vt);return Zt==="SHA-384"?[(vt=vt)[0].N,vt[0].I,vt[1].N,vt[1].I,vt[2].N,vt[2].I,vt[3].N,vt[3].I,vt[4].N,vt[4].I,vt[5].N,vt[5].I]:[vt[0].N,vt[0].I,vt[1].N,vt[1].I,vt[2].N,vt[2].I,vt[3].N,vt[3].I,vt[4].N,vt[4].I,vt[5].N,vt[5].I,vt[6].N,vt[6].I,vt[7].N,vt[7].I]}(ye,Ee,me,Te,dt)},se.m=ze(dt),se.S=1024,se.U=dt==="SHA-384"?384:512,se.T=!1,oe.hmacKey&&se.k(_("hmacKey",oe.hmacKey,se.C)),se}return k(qe,tt),qe}(A),$t=[new j(0,1),new j(0,32898),new j(2147483648,32906),new j(2147483648,2147516416),new j(0,32907),new j(0,2147483649),new j(2147483648,2147516545),new j(2147483648,32777),new j(0,138),new j(0,136),new j(0,2147516425),new j(0,2147483658),new j(0,2147516555),new j(2147483648,139),new j(2147483648,32905),new j(2147483648,32771),new j(2147483648,32770),new j(2147483648,128),new j(0,32778),new j(2147483648,2147483658),new j(2147483648,2147516545),new j(2147483648,32896),new j(0,2147483649),new j(2147483648,2147516424)],ft=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]];function Xe(tt){var qe,dt=[];for(qe=0;qe<5;qe+=1)dt[qe]=[new j(0,0),new j(0,0),new j(0,0),new j(0,0),new j(0,0)];return dt}function ct(tt){var qe,dt=[];for(qe=0;qe<5;qe+=1)dt[qe]=tt[qe].slice();return dt}function wt(tt,qe){var dt,De,He,se,oe,ye,Ee,me,Te,Oe=[],Qe=[];if(tt!==null)for(De=0;De<tt.length;De+=2)qe[(De>>>1)%5][(De>>>1)/5|0]=Ie(qe[(De>>>1)%5][(De>>>1)/5|0],new j(tt[De+1],tt[De]));for(dt=0;dt<24;dt+=1){for(se=Xe(),De=0;De<5;De+=1)Oe[De]=(oe=qe[De][0],ye=qe[De][1],Ee=qe[De][2],me=qe[De][3],Te=qe[De][4],new j(oe.N^ye.N^Ee.N^me.N^Te.N,oe.I^ye.I^Ee.I^me.I^Te.I));for(De=0;De<5;De+=1)Qe[De]=Ie(Oe[(De+4)%5],$(Oe[(De+1)%5],1));for(De=0;De<5;De+=1)for(He=0;He<5;He+=1)qe[De][He]=Ie(qe[De][He],Qe[De]);for(De=0;De<5;De+=1)for(He=0;He<5;He+=1)se[He][(2*De+3*He)%5]=$(qe[De][He],ft[De][He]);for(De=0;De<5;De+=1)for(He=0;He<5;He+=1)qe[De][He]=Ie(se[De][He],new j(~se[(De+1)%5][He].N&se[(De+2)%5][He].N,~se[(De+1)%5][He].I&se[(De+2)%5][He].I));qe[0][0]=Ie(qe[0][0],$t[dt])}return qe}function Rt(tt){var qe,dt,De=0,He=[0,0],se=[4294967295&tt,tt/4294967296&2097151];for(qe=6;qe>=0;qe--)(dt=se[qe>>2]>>>8*qe&255)===0&&De===0||(He[De+1>>2]|=dt<<8*(De+1),De+=1);return De=De!==0?De:1,He[0]|=De,{value:De+1>4?He:[He[0]],binLen:8+8*De}}function Ge(tt){return g(Rt(tt.binLen),tt)}function zt(tt,qe){var dt,De=Rt(qe),He=qe>>>2,se=(He-(De=g(De,tt)).value.length%He)%He;for(dt=0;dt<se;dt++)De.value.push(0);return De.value}var Ft=function(tt){function qe(dt,De,He){var se=this,oe=6,ye=0,Ee=He||{};if((se=tt.call(this,dt,De,He)||this).numRounds!==1){if(Ee.kmacKey||Ee.hmacKey)throw new Error("Cannot set numRounds with MAC");if(se.o==="CSHAKE128"||se.o==="CSHAKE256")throw new Error("Cannot set numRounds for CSHAKE variants")}switch(se.C=1,se.p=v(se.t,se.i,se.C),se.R=wt,se.B=ct,se.L=Xe,se.m=Xe(),se.T=!1,dt){case"SHA3-224":se.S=ye=1152,se.U=224,se.g=!0,se.F=se.Y;break;case"SHA3-256":se.S=ye=1088,se.U=256,se.g=!0,se.F=se.Y;break;case"SHA3-384":se.S=ye=832,se.U=384,se.g=!0,se.F=se.Y;break;case"SHA3-512":se.S=ye=576,se.U=512,se.g=!0,se.F=se.Y;break;case"SHAKE128":oe=31,se.S=ye=1344,se.U=-1,se.T=!0,se.g=!1,se.F=null;break;case"SHAKE256":oe=31,se.S=ye=1088,se.U=-1,se.T=!0,se.g=!1,se.F=null;break;case"KMAC128":oe=4,se.S=ye=1344,se.M(He),se.U=-1,se.T=!0,se.g=!1,se.F=se.X;break;case"KMAC256":oe=4,se.S=ye=1088,se.M(He),se.U=-1,se.T=!0,se.g=!1,se.F=se.X;break;case"CSHAKE128":se.S=ye=1344,oe=se.O(He),se.U=-1,se.T=!0,se.g=!1,se.F=null;break;case"CSHAKE256":se.S=ye=1088,oe=se.O(He),se.U=-1,se.T=!0,se.g=!1,se.F=null;break;default:throw new Error(b)}return se.K=function(me,Te,Oe,Qe,Vt){return function(vt,Zt,dn,ln,yn,or,An){var Un,Er,ht=0,st=[],Dt=yn>>>5,Lt=Zt>>>5;for(Un=0;Un<Lt&&Zt>=yn;Un+=Dt)ln=wt(vt.slice(Un,Un+Dt),ln),Zt-=yn;for(vt=vt.slice(Un),Zt%=yn;vt.length<Dt;)vt.push(0);for(vt[(Un=Zt>>>3)>>2]^=or<<Un%4*8,vt[Dt-1]^=2147483648,ln=wt(vt,ln);32*st.length<An&&(Er=ln[ht%5][ht/5|0],st.push(Er.I),!(32*st.length>=An));)st.push(Er.N),64*(ht+=1)%yn==0&&(wt(null,ln),ht=0);return st}(me,Te,0,Qe,ye,oe,Vt)},Ee.hmacKey&&se.k(_("hmacKey",Ee.hmacKey,se.C)),se}return k(qe,tt),qe.prototype.O=function(dt,De){var He=function(Ee){var me=Ee||{};return{funcName:_("funcName",me.funcName,1,{value:[],binLen:0}),customization:_("Customization",me.customization,1,{value:[],binLen:0})}}(dt||{});De&&(He.funcName=De);var se=g(Ge(He.funcName),Ge(He.customization));if(He.customization.binLen!==0||He.funcName.binLen!==0){for(var oe=zt(se,this.S>>>3),ye=0;ye<oe.length;ye+=this.S>>>5)this.m=this.R(oe.slice(ye,ye+(this.S>>>5)),this.m),this.v+=this.S;return 4}return 31},qe.prototype.M=function(dt){var De=function(oe){var ye=oe||{};return{kmacKey:_("kmacKey",ye.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:_("Customization",ye.customization,1,{value:[],binLen:0})}}(dt||{});this.O(dt,De.funcName);for(var He=zt(Ge(De.kmacKey),this.S>>>3),se=0;se<He.length;se+=this.S>>>5)this.m=this.R(He.slice(se,se+(this.S>>>5)),this.m),this.v+=this.S;this.A=!0},qe.prototype.X=function(dt){var De=g({value:this.u.slice(),binLen:this.s},function(He){var se,oe,ye=0,Ee=[0,0],me=[4294967295&He,He/4294967296&2097151];for(se=6;se>=0;se--)(oe=me[se>>2]>>>8*se&255)==0&&ye===0||(Ee[ye>>2]|=oe<<8*ye,ye+=1);return Ee[(ye=ye!==0?ye:1)>>2]|=ye<<8*ye,{value:ye+1>4?Ee:[Ee[0]],binLen:8+8*ye}}(dt.outputLen));return this.K(De.value,De.binLen,this.v,this.B(this.m),dt.outputLen)},qe}(A);return function(){function tt(qe,dt,De){if(qe=="SHA-1")this.j=new N(qe,dt,De);else if(qe=="SHA-224"||qe=="SHA-256")this.j=new U(qe,dt,De);else if(qe=="SHA-384"||qe=="SHA-512")this.j=new Ct(qe,dt,De);else{if(qe!="SHA3-224"&&qe!="SHA3-256"&&qe!="SHA3-384"&&qe!="SHA3-512"&&qe!="SHAKE128"&&qe!="SHAKE256"&&qe!="CSHAKE128"&&qe!="CSHAKE256"&&qe!="KMAC128"&&qe!="KMAC256")throw new Error(b);this.j=new Ft(qe,dt,De)}}return tt.prototype.update=function(qe){this.j.update(qe)},tt.prototype.getHash=function(qe,dt){return this.j.getHash(qe,dt)},tt.prototype.setHMACKey=function(qe,dt,De){this.j.setHMACKey(qe,dt,De)},tt.prototype.getHMAC=function(qe,dt){return this.j.getHMAC(qe,dt)},tt}()})},86876:function(fe,p,x){fe.exports=x(43928)(x(32217))},43928:function(fe,p,x){const v=x(40316),T=x(21102);fe.exports=function(C){const I=v(C),m=T(C);return function(b,g){switch(typeof b=="string"?b.toLowerCase():b){case"keccak224":return new I(1152,448,null,224,g);case"keccak256":return new I(1088,512,null,256,g);case"keccak384":return new I(832,768,null,384,g);case"keccak512":return new I(576,1024,null,512,g);case"sha3-224":return new I(1152,448,6,224,g);case"sha3-256":return new I(1088,512,6,256,g);case"sha3-384":return new I(832,768,6,384,g);case"sha3-512":return new I(576,1024,6,512,g);case"shake128":return new m(1344,256,31,g);case"shake256":return new m(1088,512,31,g);default:throw new Error("Invald algorithm: "+b)}}}},40316:function(fe,p,x){var v=x(36533).Buffer;const{Transform:T}=x(51094);fe.exports=C=>class TC extends T{constructor(m,b,g,w,_){super(_),this._rate=m,this._capacity=b,this._delimitedSuffix=g,this._hashBitLength=w,this._options=_,this._state=new C,this._state.initialize(m,b),this._finalized=!1}_transform(m,b,g){let w=null;try{this.update(m,b)}catch(_){w=_}g(w)}_flush(m){let b=null;try{this.push(this.digest())}catch(g){b=g}m(b)}update(m,b){if(!v.isBuffer(m)&&typeof m!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return v.isBuffer(m)||(m=v.from(m,b)),this._state.absorb(m),this}digest(m){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let b=this._state.squeeze(this._hashBitLength/8);return m!==void 0&&(b=b.toString(m)),this._resetState(),b}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const m=new TC(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(m._state),m._finalized=this._finalized,m}}},21102:function(fe,p,x){var v=x(36533).Buffer;const{Transform:T}=x(51094);fe.exports=C=>class CC extends T{constructor(m,b,g,w){super(w),this._rate=m,this._capacity=b,this._delimitedSuffix=g,this._options=w,this._state=new C,this._state.initialize(m,b),this._finalized=!1}_transform(m,b,g){let w=null;try{this.update(m,b)}catch(_){w=_}g(w)}_flush(){}_read(m){this.push(this.squeeze(m))}update(m,b){if(!v.isBuffer(m)&&typeof m!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return v.isBuffer(m)||(m=v.from(m,b)),this._state.absorb(m),this}squeeze(m,b){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let g=this._state.squeeze(m);return b!==void 0&&(g=g.toString(b)),g}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const m=new CC(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(m._state),m._finalized=this._finalized,m}}},14302:function(fe,p){const x=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];p.p1600=function(v){for(let T=0;T<24;++T){const C=v[0]^v[10]^v[20]^v[30]^v[40],I=v[1]^v[11]^v[21]^v[31]^v[41],m=v[2]^v[12]^v[22]^v[32]^v[42],b=v[3]^v[13]^v[23]^v[33]^v[43],g=v[4]^v[14]^v[24]^v[34]^v[44],w=v[5]^v[15]^v[25]^v[35]^v[45],_=v[6]^v[16]^v[26]^v[36]^v[46],A=v[7]^v[17]^v[27]^v[37]^v[47],S=v[8]^v[18]^v[28]^v[38]^v[48],k=v[9]^v[19]^v[29]^v[39]^v[49];let B=S^(m<<1|b>>>31),O=k^(b<<1|m>>>31);const L=v[0]^B,D=v[1]^O,W=v[10]^B,H=v[11]^O,G=v[20]^B,Z=v[21]^O,Q=v[30]^B,ie=v[31]^O,le=v[40]^B,be=v[41]^O;B=C^(g<<1|w>>>31),O=I^(w<<1|g>>>31);const we=v[2]^B,Ae=v[3]^O,re=v[12]^B,N=v[13]^O,z=v[22]^B,V=v[23]^O,U=v[32]^B,j=v[33]^O,$=v[42]^B,ee=v[43]^O;B=m^(_<<1|A>>>31),O=b^(A<<1|_>>>31);const J=v[4]^B,F=v[5]^O,X=v[14]^B,de=v[15]^O,Y=v[24]^B,ce=v[25]^O,he=v[34]^B,Ie=v[35]^O,ke=v[44]^B,ut=v[45]^O;B=g^(S<<1|k>>>31),O=w^(k<<1|S>>>31);const Re=v[6]^B,ze=v[7]^O,_t=v[16]^B,Ct=v[17]^O,$t=v[26]^B,ft=v[27]^O,Xe=v[36]^B,ct=v[37]^O,wt=v[46]^B,Rt=v[47]^O;B=_^(C<<1|I>>>31),O=A^(I<<1|C>>>31);const Ge=v[8]^B,zt=v[9]^O,Ft=v[18]^B,tt=v[19]^O,qe=v[28]^B,dt=v[29]^O,De=v[38]^B,He=v[39]^O,se=v[48]^B,oe=v[49]^O,ye=L,Ee=D,me=H<<4|W>>>28,Te=W<<4|H>>>28,Oe=G<<3|Z>>>29,Qe=Z<<3|G>>>29,Vt=ie<<9|Q>>>23,vt=Q<<9|ie>>>23,Zt=le<<18|be>>>14,dn=be<<18|le>>>14,ln=we<<1|Ae>>>31,yn=Ae<<1|we>>>31,or=N<<12|re>>>20,An=re<<12|N>>>20,Un=z<<10|V>>>22,Er=V<<10|z>>>22,ht=j<<13|U>>>19,st=U<<13|j>>>19,Dt=$<<2|ee>>>30,Lt=ee<<2|$>>>30,Gt=F<<30|J>>>2,xn=J<<30|F>>>2,un=X<<6|de>>>26,fn=de<<6|X>>>26,Pe=ce<<11|Y>>>21,Ue=Y<<11|ce>>>21,Le=he<<15|Ie>>>17,_e=Ie<<15|he>>>17,Ze=ut<<29|ke>>>3,Ot=ke<<29|ut>>>3,Yt=Re<<28|ze>>>4,Jt=ze<<28|Re>>>4,en=Ct<<23|_t>>>9,Vn=_t<<23|Ct>>>9,kn=$t<<25|ft>>>7,ir=ft<<25|$t>>>7,Hn=Xe<<21|ct>>>11,tr=ct<<21|Xe>>>11,gr=Rt<<24|wt>>>8,br=wt<<24|Rt>>>8,pr=Ge<<27|zt>>>5,_n=zt<<27|Ge>>>5,Qn=Ft<<20|tt>>>12,Zn=tt<<20|Ft>>>12,Mn=dt<<7|qe>>>25,Ln=qe<<7|dt>>>25,Rn=De<<8|He>>>24,In=He<<8|De>>>24,Xn=se<<14|oe>>>18,$n=oe<<14|se>>>18;v[0]=ye^~or&Pe,v[1]=Ee^~An&Ue,v[10]=Yt^~Qn&Oe,v[11]=Jt^~Zn&Qe,v[20]=ln^~un&kn,v[21]=yn^~fn&ir,v[30]=pr^~me&Un,v[31]=_n^~Te&Er,v[40]=Gt^~en&Mn,v[41]=xn^~Vn&Ln,v[2]=or^~Pe&Hn,v[3]=An^~Ue&tr,v[12]=Qn^~Oe&ht,v[13]=Zn^~Qe&st,v[22]=un^~kn&Rn,v[23]=fn^~ir&In,v[32]=me^~Un&Le,v[33]=Te^~Er&_e,v[42]=en^~Mn&Vt,v[43]=Vn^~Ln&vt,v[4]=Pe^~Hn&Xn,v[5]=Ue^~tr&$n,v[14]=Oe^~ht&Ze,v[15]=Qe^~st&Ot,v[24]=kn^~Rn&Zt,v[25]=ir^~In&dn,v[34]=Un^~Le&gr,v[35]=Er^~_e&br,v[44]=Mn^~Vt&Dt,v[45]=Ln^~vt&Lt,v[6]=Hn^~Xn&ye,v[7]=tr^~$n&Ee,v[16]=ht^~Ze&Yt,v[17]=st^~Ot&Jt,v[26]=Rn^~Zt&ln,v[27]=In^~dn&yn,v[36]=Le^~gr&pr,v[37]=_e^~br&_n,v[46]=Vt^~Dt&Gt,v[47]=vt^~Lt&xn,v[8]=Xn^~ye&or,v[9]=$n^~Ee&An,v[18]=Ze^~Yt&Qn,v[19]=Ot^~Jt&Zn,v[28]=Zt^~ln&un,v[29]=dn^~yn&fn,v[38]=gr^~pr&me,v[39]=br^~_n&Te,v[48]=Dt^~Gt&en,v[49]=Lt^~xn&Vn,v[0]^=x[T*2],v[1]^=x[T*2+1]}}},32217:function(fe,p,x){var v=x(36533).Buffer;const T=x(14302);function C(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}C.prototype.initialize=function(I,m){for(let b=0;b<50;++b)this.state[b]=0;this.blockSize=I/8,this.count=0,this.squeezing=!1},C.prototype.absorb=function(I){for(let m=0;m<I.length;++m)this.state[~~(this.count/4)]^=I[m]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(T.p1600(this.state),this.count=0)},C.prototype.absorbLastFewBits=function(I){this.state[~~(this.count/4)]^=I<<8*(this.count%4),I&128&&this.count===this.blockSize-1&&T.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),T.p1600(this.state),this.count=0,this.squeezing=!0},C.prototype.squeeze=function(I){this.squeezing||this.absorbLastFewBits(1);const m=v.alloc(I);for(let b=0;b<I;++b)m[b]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(T.p1600(this.state),this.count=0);return m},C.prototype.copy=function(I){for(let m=0;m<50;++m)I.state[m]=this.state[m];I.blockSize=this.blockSize,I.count=this.count,I.squeezing=this.squeezing},fe.exports=C},67918:function(fe,p,x){fe=x.nmd(fe);/**
|
||
* @license
|
||
* Lodash <https://lodash.com/>
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/(function(){var v,T="4.17.21",C=200,I="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",m="Expected a function",b="Invalid `variable` option passed into `_.template`",g="__lodash_hash_undefined__",w=500,_="__lodash_placeholder__",A=1,S=2,k=4,B=1,O=2,L=1,D=2,W=4,H=8,G=16,Z=32,Q=64,ie=128,le=256,be=512,we=30,Ae="...",re=800,N=16,z=1,V=2,U=3,j=1/0,$=9007199254740991,ee=17976931348623157e292,J=NaN,F=4294967295,X=F-1,de=F>>>1,Y=[["ary",ie],["bind",L],["bindKey",D],["curry",H],["curryRight",G],["flip",be],["partial",Z],["partialRight",Q],["rearg",le]],ce="[object Arguments]",he="[object Array]",Ie="[object AsyncFunction]",ke="[object Boolean]",ut="[object Date]",Re="[object DOMException]",ze="[object Error]",_t="[object Function]",Ct="[object GeneratorFunction]",$t="[object Map]",ft="[object Number]",Xe="[object Null]",ct="[object Object]",wt="[object Promise]",Rt="[object Proxy]",Ge="[object RegExp]",zt="[object Set]",Ft="[object String]",tt="[object Symbol]",qe="[object Undefined]",dt="[object WeakMap]",De="[object WeakSet]",He="[object ArrayBuffer]",se="[object DataView]",oe="[object Float32Array]",ye="[object Float64Array]",Ee="[object Int8Array]",me="[object Int16Array]",Te="[object Int32Array]",Oe="[object Uint8Array]",Qe="[object Uint8ClampedArray]",Vt="[object Uint16Array]",vt="[object Uint32Array]",Zt=/\b__p \+= '';/g,dn=/\b(__p \+=) '' \+/g,ln=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yn=/&(?:amp|lt|gt|quot|#39);/g,or=/[&<>"']/g,An=RegExp(yn.source),Un=RegExp(or.source),Er=/<%-([\s\S]+?)%>/g,ht=/<%([\s\S]+?)%>/g,st=/<%=([\s\S]+?)%>/g,Dt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lt=/^\w*$/,Gt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xn=/[\\^$.*+?()[\]{}|]/g,un=RegExp(xn.source),fn=/^\s+/,Pe=/\s/,Ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Le=/\{\n\/\* \[wrapped with (.+)\] \*/,_e=/,? & /,Ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ot=/[()=,{}\[\]\/\s]/,Yt=/\\(\\)?/g,Jt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,en=/\w*$/,Vn=/^[-+]0x[0-9a-f]+$/i,kn=/^0b[01]+$/i,ir=/^\[object .+?Constructor\]$/,Hn=/^0o[0-7]+$/i,tr=/^(?:0|[1-9]\d*)$/,gr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,br=/($^)/,pr=/['\n\r\u2028\u2029\\]/g,_n="\\ud800-\\udfff",Qn="\\u0300-\\u036f",Zn="\\ufe20-\\ufe2f",Mn="\\u20d0-\\u20ff",Ln=Qn+Zn+Mn,Rn="\\u2700-\\u27bf",In="a-z\\xdf-\\xf6\\xf8-\\xff",Xn="\\xac\\xb1\\xd7\\xf7",$n="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hn="\\u2000-\\u206f",an=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tn="A-Z\\xc0-\\xd6\\xd8-\\xde",Sn="\\ufe0e\\ufe0f",Bn=Xn+$n+hn+an,Fn="['\u2019]",bt="["+_n+"]",ve="["+Bn+"]",je="["+Ln+"]",at="\\d+",Ne="["+Rn+"]",Et="["+In+"]",vn="[^"+_n+Bn+at+Rn+In+Tn+"]",mn="\\ud83c[\\udffb-\\udfff]",Nn="(?:"+je+"|"+mn+")",Dn="[^"+_n+"]",Gn="(?:\\ud83c[\\udde6-\\uddff]){2}",$r="[\\ud800-\\udbff][\\udc00-\\udfff]",Vr="["+Tn+"]",vi="\\u200d",Pi="(?:"+Et+"|"+vn+")",et="(?:"+Vr+"|"+vn+")",it="(?:"+Fn+"(?:d|ll|m|re|s|t|ve))?",$e="(?:"+Fn+"(?:D|LL|M|RE|S|T|VE))?",mt=Nn+"?",It="["+Sn+"]?",sn="(?:"+vi+"(?:"+[Dn,Gn,$r].join("|")+")"+It+mt+")*",Wn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Or="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Nr=It+mt+sn,wi="(?:"+[Ne,Gn,$r].join("|")+")"+Nr,Ti="(?:"+[Dn+je+"?",je,Gn,$r,bt].join("|")+")",di=RegExp(Fn,"g"),mi=RegExp(je,"g"),So=RegExp(mn+"(?="+mn+")|"+Ti+Nr,"g"),Xu=RegExp([Vr+"?"+Et+"+"+it+"(?="+[ve,Vr,"$"].join("|")+")",et+"+"+$e+"(?="+[ve,Vr+Pi,"$"].join("|")+")",Vr+"?"+Pi+"+"+it,Vr+"+"+$e,Or,Wn,at,wi].join("|"),"g"),df=RegExp("["+vi+_n+Ln+Sn+"]"),Yu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,hf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],gu=-1,Mi={};Mi[oe]=Mi[ye]=Mi[Ee]=Mi[me]=Mi[Te]=Mi[Oe]=Mi[Qe]=Mi[Vt]=Mi[vt]=!0,Mi[ce]=Mi[he]=Mi[He]=Mi[ke]=Mi[se]=Mi[ut]=Mi[ze]=Mi[_t]=Mi[$t]=Mi[ft]=Mi[ct]=Mi[Ge]=Mi[zt]=Mi[Ft]=Mi[dt]=!1;var Ni={};Ni[ce]=Ni[he]=Ni[He]=Ni[se]=Ni[ke]=Ni[ut]=Ni[oe]=Ni[ye]=Ni[Ee]=Ni[me]=Ni[Te]=Ni[$t]=Ni[ft]=Ni[ct]=Ni[Ge]=Ni[zt]=Ni[Ft]=Ni[tt]=Ni[Oe]=Ni[Qe]=Ni[Vt]=Ni[vt]=!0,Ni[ze]=Ni[_t]=Ni[dt]=!1;var pf={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},pa={"&":"&","<":"<",">":">",'"':""","'":"'"},Ju={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ns={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qu=parseFloat,Yg=parseInt,v0=typeof x.g=="object"&&x.g&&x.g.Object===Object&&x.g,w0=typeof self=="object"&&self&&self.Object===Object&&self,ys=v0||w0||Function("return this")(),Ad=p&&!p.nodeType&&p,Qa=Ad&&!0&&fe&&!fe.nodeType&&fe,us=Qa&&Qa.exports===Ad,Ve=us&&v0.process,Ye=function(){try{var nn=Qa&&Qa.require&&Qa.require("util").types;return nn||Ve&&Ve.binding&&Ve.binding("util")}catch{}}(),St=Ye&&Ye.isArrayBuffer,At=Ye&&Ye.isDate,qt=Ye&&Ye.isMap,cn=Ye&&Ye.isRegExp,pn=Ye&&Ye.isSet,Kn=Ye&&Ye.isTypedArray;function yr(nn,wn,bn){switch(bn.length){case 0:return nn.call(wn);case 1:return nn.call(wn,bn[0]);case 2:return nn.call(wn,bn[0],bn[1]);case 3:return nn.call(wn,bn[0],bn[1],bn[2])}return nn.apply(wn,bn)}function ar(nn,wn,bn,cr){for(var zr=-1,_i=nn==null?0:nn.length;++zr<_i;){var Bs=nn[zr];wn(cr,Bs,bn(Bs),nn)}return cr}function Yn(nn,wn){for(var bn=-1,cr=nn==null?0:nn.length;++bn<cr&&wn(nn[bn],bn,nn)!==!1;);return nn}function Cr(nn,wn){for(var bn=nn==null?0:nn.length;bn--&&wn(nn[bn],bn,nn)!==!1;);return nn}function Oi(nn,wn){for(var bn=-1,cr=nn==null?0:nn.length;++bn<cr;)if(!wn(nn[bn],bn,nn))return!1;return!0}function Ui(nn,wn){for(var bn=-1,cr=nn==null?0:nn.length,zr=0,_i=[];++bn<cr;){var Bs=nn[bn];wn(Bs,bn,nn)&&(_i[zr++]=Bs)}return _i}function Tr(nn,wn){var bn=nn==null?0:nn.length;return!!bn&&tl(nn,wn,0)>-1}function Hr(nn,wn,bn){for(var cr=-1,zr=nn==null?0:nn.length;++cr<zr;)if(bn(wn,nn[cr]))return!0;return!1}function ur(nn,wn){for(var bn=-1,cr=nn==null?0:nn.length,zr=Array(cr);++bn<cr;)zr[bn]=wn(nn[bn],bn,nn);return zr}function xi(nn,wn){for(var bn=-1,cr=wn.length,zr=nn.length;++bn<cr;)nn[zr+bn]=wn[bn];return nn}function es(nn,wn,bn,cr){var zr=-1,_i=nn==null?0:nn.length;for(cr&&_i&&(bn=nn[++zr]);++zr<_i;)bn=wn(bn,nn[zr],zr,nn);return bn}function xs(nn,wn,bn,cr){var zr=nn==null?0:nn.length;for(cr&&zr&&(bn=nn[--zr]);zr--;)bn=wn(bn,nn[zr],zr,nn);return bn}function Uo(nn,wn){for(var bn=-1,cr=nn==null?0:nn.length;++bn<cr;)if(wn(nn[bn],bn,nn))return!0;return!1}var Is=E0("length");function ga(nn){return nn.split("")}function ya(nn){return nn.match(Ze)||[]}function Ic(nn,wn,bn){var cr;return bn(nn,function(zr,_i,Bs){if(wn(zr,_i,Bs))return cr=_i,!1}),cr}function el(nn,wn,bn,cr){for(var zr=nn.length,_i=bn+(cr?1:-1);cr?_i--:++_i<zr;)if(wn(nn[_i],_i,nn))return _i;return-1}function tl(nn,wn,bn){return wn===wn?_v(nn,wn,bn):el(nn,Jg,bn)}function mv(nn,wn,bn,cr){for(var zr=bn-1,_i=nn.length;++zr<_i;)if(cr(nn[zr],wn))return zr;return-1}function Jg(nn){return nn!==nn}function _0(nn,wn){var bn=nn==null?0:nn.length;return bn?A0(nn,wn)/bn:J}function E0(nn){return function(wn){return wn==null?v:wn[nn]}}function Qg(nn){return function(wn){return nn==null?v:nn[wn]}}function ey(nn,wn,bn,cr,zr){return zr(nn,function(_i,Bs,Di){bn=cr?(cr=!1,_i):wn(bn,_i,Bs,Di)}),bn}function S0(nn,wn){var bn=nn.length;for(nn.sort(wn);bn--;)nn[bn]=nn[bn].value;return nn}function A0(nn,wn){for(var bn,cr=-1,zr=nn.length;++cr<zr;){var _i=wn(nn[cr]);_i!==v&&(bn=bn===v?_i:bn+_i)}return bn}function gf(nn,wn){for(var bn=-1,cr=Array(nn);++bn<nn;)cr[bn]=wn(bn);return cr}function bv(nn,wn){return ur(wn,function(bn){return[bn,nn[bn]]})}function x0(nn){return nn&&nn.slice(0,Id(nn)+1).replace(fn,"")}function uo(nn){return function(wn){return nn(wn)}}function I0(nn,wn){return ur(wn,function(bn){return nn[bn]})}function xd(nn,wn){return nn.has(wn)}function B0(nn,wn){for(var bn=-1,cr=nn.length;++bn<cr&&tl(wn,nn[bn],0)>-1;);return bn}function ty(nn,wn){for(var bn=nn.length;bn--&&tl(wn,nn[bn],0)>-1;);return bn}function ny(nn,wn){for(var bn=nn.length,cr=0;bn--;)nn[bn]===wn&&++cr;return cr}var yf=Qg(pf),nl=Qg(pa);function vv(nn){return"\\"+Ns[nn]}function wv(nn,wn){return nn==null?v:nn[wn]}function rl(nn){return df.test(nn)}function AS(nn){return Yu.test(nn)}function ry(nn){for(var wn,bn=[];!(wn=nn.next()).done;)bn.push(wn.value);return bn}function yu(nn){var wn=-1,bn=Array(nn.size);return nn.forEach(function(cr,zr){bn[++wn]=[zr,cr]}),bn}function iy(nn,wn){return function(bn){return nn(wn(bn))}}function Ir(nn,wn){for(var bn=-1,cr=nn.length,zr=0,_i=[];++bn<cr;){var Bs=nn[bn];(Bs===wn||Bs===_)&&(nn[bn]=_,_i[zr++]=bn)}return _i}function mf(nn){var wn=-1,bn=Array(nn.size);return nn.forEach(function(cr){bn[++wn]=cr}),bn}function sy(nn){var wn=-1,bn=Array(nn.size);return nn.forEach(function(cr){bn[++wn]=[cr,cr]}),bn}function _v(nn,wn,bn){for(var cr=bn-1,zr=nn.length;++cr<zr;)if(nn[cr]===wn)return cr;return-1}function Ev(nn,wn,bn){for(var cr=bn+1;cr--;)if(nn[cr]===wn)return cr;return cr}function il(nn){return rl(nn)?k0(nn):Is(nn)}function qs(nn){return rl(nn)?Bc(nn):ga(nn)}function Id(nn){for(var wn=nn.length;wn--&&Pe.test(nn.charAt(wn)););return wn}var oy=Qg(Ju);function k0(nn){for(var wn=So.lastIndex=0;So.test(nn);)++wn;return wn}function Bc(nn){return nn.match(So)||[]}function sl(nn){return nn.match(Xu)||[]}var Bd=function nn(wn){wn=wn==null?ys:ma.defaults(ys.Object(),wn,ma.pick(ys,hf));var bn=wn.Array,cr=wn.Date,zr=wn.Error,_i=wn.Function,Bs=wn.Math,Di=wn.Object,ol=wn.RegExp,kd=wn.String,Ao=wn.TypeError,Td=bn.prototype,Zo=_i.prototype,mu=Di.prototype,Cd=wn["__core-js_shared__"],T0=Zo.toString,Li=mu.hasOwnProperty,xS=0,Sv=function(){var M=/[^.]+$/.exec(Cd&&Cd.keys&&Cd.keys.IE_PROTO||"");return M?"Symbol(src)_1."+M:""}(),C0=mu.toString,IS=T0.call(Di),BS=ys._,ay=ol("^"+T0.call(Li).replace(xn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bf=us?wn.Buffer:v,bu=wn.Symbol,P0=wn.Uint8Array,Av=bf?bf.allocUnsafe:v,M0=iy(Di.getPrototypeOf,Di),Pd=Di.create,Md=mu.propertyIsEnumerable,O0=Td.splice,xv=bu?bu.isConcatSpreadable:v,Od=bu?bu.iterator:v,al=bu?bu.toStringTag:v,R0=function(){try{var M=Su(Di,"defineProperty");return M({},"",{}),M}catch{}}(),kS=wn.clearTimeout!==ys.clearTimeout&&wn.clearTimeout,N0=cr&&cr.now!==ys.Date.now&&cr.now,cy=wn.setTimeout!==ys.setTimeout&&wn.setTimeout,kc=Bs.ceil,vf=Bs.floor,Rd=Di.getOwnPropertySymbols,Nd=bf?bf.isBuffer:v,Iv=wn.isFinite,TS=Td.join,CS=iy(Di.keys,Di),Us=Bs.max,lo=Bs.min,Ud=cr.now,uy=wn.parseInt,Bv=Bs.random,PS=Td.reverse,ly=Su(wn,"DataView"),Dd=Su(wn,"Map"),cl=Su(wn,"Promise"),ba=Su(wn,"Set"),ls=Su(wn,"WeakMap"),vu=Su(Di,"create"),Wi=ls&&new ls,Tc={},Cc=Hc(ly),kv=Hc(Dd),MS=Hc(cl),fy=Hc(ba),Tv=Hc(ls),wf=bu?bu.prototype:v,ec=wf?wf.valueOf:v,Do=wf?wf.toString:v;function gt(M){if(bs(M)&&!Zr(M)&&!(M instanceof hi)){if(M instanceof Xo)return M;if(Li.call(M,"__wrapped__"))return lm(M)}return new Xo(M)}var ul=function(){function M(){}return function(K){if(!ds(K))return{};if(Pd)return Pd(K);M.prototype=K;var ae=new M;return M.prototype=v,ae}}();function _f(){}function Xo(M,K){this.__wrapped__=M,this.__actions__=[],this.__chain__=!!K,this.__index__=0,this.__values__=v}gt.templateSettings={escape:Er,evaluate:ht,interpolate:st,variable:"",imports:{_:gt}},gt.prototype=_f.prototype,gt.prototype.constructor=gt,Xo.prototype=ul(_f.prototype),Xo.prototype.constructor=Xo;function hi(M){this.__wrapped__=M,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=F,this.__views__=[]}function dy(){var M=new hi(this.__wrapped__);return M.__actions__=ko(this.__actions__),M.__dir__=this.__dir__,M.__filtered__=this.__filtered__,M.__iteratees__=ko(this.__iteratees__),M.__takeCount__=this.__takeCount__,M.__views__=ko(this.__views__),M}function hy(){if(this.__filtered__){var M=new hi(this);M.__dir__=-1,M.__filtered__=!0}else M=this.clone(),M.__dir__*=-1;return M}function py(){var M=this.__wrapped__.value(),K=this.__dir__,ae=Zr(M),Be=K<0,Je=ae?M.length:0,yt=vw(0,Je,this.__views__),jt=yt.start,Xt=yt.end,tn=Xt-jt,On=Be?Xt:jt-1,Pn=this.__iteratees__,jn=Pn.length,er=0,kr=lo(tn,this.__takeCount__);if(!ae||!Be&&Je==tn&&kr==tn)return Ry(M,this.__actions__);var Mr=[];e:for(;tn--&&er<kr;){On+=K;for(var Jr=-1,Lr=M[On];++Jr<jn;){var Qr=Pn[Jr],qr=Qr.iteratee,Co=Qr.type,Ys=qr(Lr);if(Co==V)Lr=Ys;else if(!Ys){if(Co==z)continue e;break e}}Mr[er++]=Lr}return Mr}hi.prototype=ul(_f.prototype),hi.prototype.constructor=hi;function Pc(M){var K=-1,ae=M==null?0:M.length;for(this.clear();++K<ae;){var Be=M[K];this.set(Be[0],Be[1])}}function Mc(){this.__data__=vu?vu(null):{},this.size=0}function fs(M){var K=this.has(M)&&delete this.__data__[M];return this.size-=K?1:0,K}function ni(M){var K=this.__data__;if(vu){var ae=K[M];return ae===g?v:ae}return Li.call(K,M)?K[M]:v}function wu(M){var K=this.__data__;return vu?K[M]!==v:Li.call(K,M)}function Cv(M,K){var ae=this.__data__;return this.size+=this.has(M)?0:1,ae[M]=vu&&K===v?g:K,this}Pc.prototype.clear=Mc,Pc.prototype.delete=fs,Pc.prototype.get=ni,Pc.prototype.has=wu,Pc.prototype.set=Cv;function tc(M){var K=-1,ae=M==null?0:M.length;for(this.clear();++K<ae;){var Be=M[K];this.set(Be[0],Be[1])}}function Pv(){this.__data__=[],this.size=0}function Mv(M){var K=this.__data__,ae=Ld(K,M);if(ae<0)return!1;var Be=K.length-1;return ae==Be?K.pop():O0.call(K,ae,1),--this.size,!0}function Ov(M){var K=this.__data__,ae=Ld(K,M);return ae<0?v:K[ae][1]}function gy(M){return Ld(this.__data__,M)>-1}function xo(M,K){var ae=this.__data__,Be=Ld(ae,M);return Be<0?(++this.size,ae.push([M,K])):ae[Be][1]=K,this}tc.prototype.clear=Pv,tc.prototype.delete=Mv,tc.prototype.get=Ov,tc.prototype.has=gy,tc.prototype.set=xo;function nc(M){var K=-1,ae=M==null?0:M.length;for(this.clear();++K<ae;){var Be=M[K];this.set(Be[0],Be[1])}}function Rv(){this.size=0,this.__data__={hash:new Pc,map:new(Dd||tc),string:new Pc}}function yy(M){var K=Zd(this,M).delete(M);return this.size-=K?1:0,K}function my(M){return Zd(this,M).get(M)}function Nv(M){return Zd(this,M).has(M)}function U0(M,K){var ae=Zd(this,M),Be=ae.size;return ae.set(M,K),this.size+=ae.size==Be?0:1,this}nc.prototype.clear=Rv,nc.prototype.delete=yy,nc.prototype.get=my,nc.prototype.has=Nv,nc.prototype.set=U0;function Oc(M){var K=-1,ae=M==null?0:M.length;for(this.__data__=new nc;++K<ae;)this.add(M[K])}function Uv(M){return this.__data__.set(M,g),this}function D0(M){return this.__data__.has(M)}Oc.prototype.add=Oc.prototype.push=Uv,Oc.prototype.has=D0;function va(M){var K=this.__data__=new tc(M);this.size=K.size}function Dv(){this.__data__=new tc,this.size=0}function L0(M){var K=this.__data__,ae=K.delete(M);return this.size=K.size,ae}function F0(M){return this.__data__.get(M)}function Lv(M){return this.__data__.has(M)}function Fv(M,K){var ae=this.__data__;if(ae instanceof tc){var Be=ae.__data__;if(!Dd||Be.length<C-1)return Be.push([M,K]),this.size=++ae.size,this;ae=this.__data__=new nc(Be)}return ae.set(M,K),this.size=ae.size,this}va.prototype.clear=Dv,va.prototype.delete=L0,va.prototype.get=F0,va.prototype.has=Lv,va.prototype.set=Fv;function by(M,K){var ae=Zr(M),Be=!ae&&Au(M),Je=!ae&&!Be&&xu(M),yt=!ae&&!Be&&!Je&&Df(M),jt=ae||Be||Je||yt,Xt=jt?gf(M.length,kd):[],tn=Xt.length;for(var On in M)(K||Li.call(M,On))&&!(jt&&(On=="length"||Je&&(On=="offset"||On=="parent")||yt&&(On=="buffer"||On=="byteLength"||On=="byteOffset")||ac(On,tn)))&&Xt.push(On);return Xt}function vy(M){var K=M.length;return K?M[W0(0,K-1)]:v}function jv(M,K){return Xd(ko(M),Rc(K,0,M.length))}function wy(M){return Xd(ko(M))}function ll(M,K,ae){(ae!==v&&!Xs(M[K],ae)||ae===v&&!(K in M))&&wa(M,K,ae)}function Ef(M,K,ae){var Be=M[K];(!(Li.call(M,K)&&Xs(Be,ae))||ae===v&&!(K in M))&&wa(M,K,ae)}function Ld(M,K){for(var ae=M.length;ae--;)if(Xs(M[ae][0],K))return ae;return-1}function zv(M,K,ae,Be){return rc(M,function(Je,yt,jt){K(Be,Je,ae(Je),jt)}),Be}function _y(M,K){return M&&Na(K,js(K),M)}function j0(M,K){return M&&Na(K,hs(K),M)}function wa(M,K,ae){K=="__proto__"&&R0?R0(M,K,{configurable:!0,enumerable:!0,value:ae,writable:!0}):M[K]=ae}function Ds(M,K){for(var ae=-1,Be=K.length,Je=bn(Be),yt=M==null;++ae<Be;)Je[ae]=yt?v:jm(M,K[ae]);return Je}function Rc(M,K,ae){return M===M&&(ae!==v&&(M=M<=ae?M:ae),K!==v&&(M=M>=K?M:K)),M}function Yo(M,K,ae,Be,Je,yt){var jt,Xt=K&A,tn=K&S,On=K&k;if(ae&&(jt=Je?ae(M,Be,Je,yt):ae(M)),jt!==v)return jt;if(!ds(M))return M;var Pn=Zr(M);if(Pn){if(jt=_w(M),!Xt)return ko(M,jt)}else{var jn=io(M),er=jn==_t||jn==Ct;if(xu(M))return Dy(M,Xt);if(jn==ct||jn==ce||er&&!Je){if(jt=tn||er?{}:tm(M),!Xt)return tn?lw(M,j0(jt,M)):uw(M,_y(jt,M))}else{if(!Ni[jn])return Je?M:{};jt=Ew(M,jn,Xt)}}yt||(yt=new va);var kr=yt.get(M);if(kr)return kr;yt.set(M,jt),Pm(M)?M.forEach(function(Lr){jt.add(Yo(Lr,K,ae,Lr,M,yt))}):J2(M)&&M.forEach(function(Lr,Qr){jt.set(Qr,Yo(Lr,K,ae,Qr,M,yt))});var Mr=On?tn?rp:np:tn?hs:js,Jr=Pn?v:Mr(M);return Yn(Jr||M,function(Lr,Qr){Jr&&(Qr=Lr,Lr=M[Qr]),Ef(jt,Qr,Yo(Lr,K,ae,Qr,M,yt))}),jt}function Hv(M){var K=js(M);return function(ae){return z0(ae,M,K)}}function z0(M,K,ae){var Be=ae.length;if(M==null)return!Be;for(M=Di(M);Be--;){var Je=ae[Be],yt=K[Je],jt=M[Je];if(jt===v&&!(Je in M)||!yt(jt))return!1}return!0}function Ey(M,K,ae){if(typeof M!="function")throw new Ao(m);return Mf(function(){M.apply(v,ae)},K)}function fl(M,K,ae,Be){var Je=-1,yt=Tr,jt=!0,Xt=M.length,tn=[],On=K.length;if(!Xt)return tn;ae&&(K=ur(K,uo(ae))),Be?(yt=Hr,jt=!1):K.length>=C&&(yt=xd,jt=!1,K=new Oc(K));e:for(;++Je<Xt;){var Pn=M[Je],jn=ae==null?Pn:ae(Pn);if(Pn=Be||Pn!==0?Pn:0,jt&&jn===jn){for(var er=On;er--;)if(K[er]===jn)continue e;tn.push(Pn)}else yt(K,jn,Be)||tn.push(Pn)}return tn}var rc=Hy(Io),Sy=Hy(xy,!0);function Kv(M,K){var ae=!0;return rc(M,function(Be,Je,yt){return ae=!!K(Be,Je,yt),ae}),ae}function Fd(M,K,ae){for(var Be=-1,Je=M.length;++Be<Je;){var yt=M[Be],jt=K(yt);if(jt!=null&&(Xt===v?jt===jt&&!ho(jt):ae(jt,Xt)))var Xt=jt,tn=yt}return tn}function $v(M,K,ae,Be){var Je=M.length;for(ae=Xr(ae),ae<0&&(ae=-ae>Je?0:Je+ae),Be=Be===v||Be>Je?Je:Xr(Be),Be<0&&(Be+=Je),Be=ae>Be?0:Rm(Be);ae<Be;)M[ae++]=K;return M}function Ay(M,K){var ae=[];return rc(M,function(Be,Je,yt){K(Be,Je,yt)&&ae.push(Be)}),ae}function Zs(M,K,ae,Be,Je){var yt=-1,jt=M.length;for(ae||(ae=Aw),Je||(Je=[]);++yt<jt;){var Xt=M[yt];K>0&&ae(Xt)?K>1?Zs(Xt,K-1,ae,Be,Je):xi(Je,Xt):Be||(Je[Je.length]=Xt)}return Je}var Nc=Ky(),Vv=Ky(!0);function Io(M,K){return M&&Nc(M,K,js)}function xy(M,K){return M&&Vv(M,K,js)}function Uc(M,K){return Ui(K,function(ae){return Kc(M[ae])})}function dl(M,K){K=jc(K,M);for(var ae=0,Be=K.length;M!=null&&ae<Be;)M=M[_a(K[ae++])];return ae&&ae==Be?M:v}function Iy(M,K,ae){var Be=K(M);return Zr(M)?Be:xi(Be,ae(M))}function Bo(M){return M==null?M===v?qe:Xe:al&&al in Di(M)?bw(M):Pw(M)}function _u(M,K){return M>K}function OS(M,K){return M!=null&&Li.call(M,K)}function Wv(M,K){return M!=null&&K in Di(M)}function RS(M,K,ae){return M>=lo(K,ae)&&M<Us(K,ae)}function ic(M,K,ae){for(var Be=ae?Hr:Tr,Je=M[0].length,yt=M.length,jt=yt,Xt=bn(yt),tn=1/0,On=[];jt--;){var Pn=M[jt];jt&&K&&(Pn=ur(Pn,uo(K))),tn=lo(Pn.length,tn),Xt[jt]=!ae&&(K||Je>=120&&Pn.length>=120)?new Oc(jt&&Pn):v}Pn=M[0];var jn=-1,er=Xt[0];e:for(;++jn<Je&&On.length<tn;){var kr=Pn[jn],Mr=K?K(kr):kr;if(kr=ae||kr!==0?kr:0,!(er?xd(er,Mr):Be(On,Mr,ae))){for(jt=yt;--jt;){var Jr=Xt[jt];if(!(Jr?xd(Jr,Mr):Be(M[jt],Mr,ae)))continue e}er&&er.push(Mr),On.push(kr)}}return On}function NS(M,K,ae,Be){return Io(M,function(Je,yt,jt){K(Be,ae(Je),yt,jt)}),Be}function Sf(M,K,ae){K=jc(K,M),M=sm(M,K);var Be=M==null?M:M[_a(Qo(K))];return Be==null?v:yr(Be,M,ae)}function Gv(M){return bs(M)&&Bo(M)==ce}function ts(M){return bs(M)&&Bo(M)==He}function on(M){return bs(M)&&Bo(M)==ut}function Eu(M,K,ae,Be,Je){return M===K?!0:M==null||K==null||!bs(M)&&!bs(K)?M!==M&&K!==K:H0(M,K,ae,Be,Eu,Je)}function H0(M,K,ae,Be,Je,yt){var jt=Zr(M),Xt=Zr(K),tn=jt?he:io(M),On=Xt?he:io(K);tn=tn==ce?ct:tn,On=On==ce?ct:On;var Pn=tn==ct,jn=On==ct,er=tn==On;if(er&&xu(M)){if(!xu(K))return!1;jt=!0,Pn=!1}if(er&&!Pn)return yt||(yt=new va),jt||Df(M)?Jy(M,K,ae,Be,Je,yt):yw(M,K,tn,ae,Be,Je,yt);if(!(ae&B)){var kr=Pn&&Li.call(M,"__wrapped__"),Mr=jn&&Li.call(K,"__wrapped__");if(kr||Mr){var Jr=kr?M.value():M,Lr=Mr?K.value():K;return yt||(yt=new va),Je(Jr,Lr,ae,Be,yt)}}return er?(yt||(yt=new va),mw(M,K,ae,Be,Je,yt)):!1}function jd(M){return bs(M)&&io(M)==$t}function Af(M,K,ae,Be){var Je=ae.length,yt=Je,jt=!Be;if(M==null)return!yt;for(M=Di(M);Je--;){var Xt=ae[Je];if(jt&&Xt[2]?Xt[1]!==M[Xt[0]]:!(Xt[0]in M))return!1}for(;++Je<yt;){Xt=ae[Je];var tn=Xt[0],On=M[tn],Pn=Xt[1];if(jt&&Xt[2]){if(On===v&&!(tn in M))return!1}else{var jn=new va;if(Be)var er=Be(On,Pn,tn,M,K,jn);if(!(er===v?Eu(Pn,On,B|O,Be,jn):er))return!1}}return!0}function xf(M){if(!ds(M)||Iw(M))return!1;var K=Kc(M)?ay:ir;return K.test(Hc(M))}function K0(M){return bs(M)&&Bo(M)==Ge}function nr(M){return bs(M)&&io(M)==zt}function If(M){return bs(M)&&oh(M.length)&&!!Mi[Bo(M)]}function Bf(M){return typeof M=="function"?M:M==null?po:typeof M=="object"?Zr(M)?Zv(M[0],M[1]):qv(M):Cp(M)}function $0(M){if(!Pf(M))return CS(M);var K=[];for(var ae in Di(M))Li.call(M,ae)&&ae!="constructor"&&K.push(ae);return K}function By(M){if(!ds(M))return Cw(M);var K=Pf(M),ae=[];for(var Be in M)Be=="constructor"&&(K||!Li.call(M,Be))||ae.push(Be);return ae}function Dc(M,K){return M<K}function Lo(M,K){var ae=-1,Be=jo(M)?bn(M.length):[];return rc(M,function(Je,yt,jt){Be[++ae]=K(Je,yt,jt)}),Be}function qv(M){var K=sp(M);return K.length==1&&K[0][2]?rm(K[0][0],K[0][1]):function(ae){return ae===M||Af(ae,M,K)}}function Zv(M,K){return ap(M)&&nm(K)?rm(_a(M),K):function(ae){var Be=jm(ae,M);return Be===v&&Be===K?zm(ae,M):Eu(K,Be,B|O)}}function kf(M,K,ae,Be,Je){M!==K&&Nc(K,function(yt,jt){if(Je||(Je=new va),ds(yt))US(M,K,jt,ae,kf,Be,Je);else{var Xt=Be?Be(up(M,jt),yt,jt+"",M,K,Je):v;Xt===v&&(Xt=yt),ll(M,jt,Xt)}},hs)}function US(M,K,ae,Be,Je,yt,jt){var Xt=up(M,ae),tn=up(K,ae),On=jt.get(tn);if(On){ll(M,ae,On);return}var Pn=yt?yt(Xt,tn,ae+"",M,K,jt):v,jn=Pn===v;if(jn){var er=Zr(tn),kr=!er&&xu(tn),Mr=!er&&!kr&&Df(tn);Pn=tn,er||kr||Mr?Zr(Xt)?Pn=Xt:Wr(Xt)?Pn=ko(Xt):kr?(jn=!1,Pn=Dy(tn,!0)):Mr?(jn=!1,Pn=Ly(tn,!0)):Pn=[]:Uf(tn)||Au(tn)?(Pn=Xt,Au(Xt)?Pn=wp(Xt):(!ds(Xt)||Kc(Xt))&&(Pn=tm(tn))):jn=!1}jn&&(jt.set(tn,Pn),Je(Pn,tn,Be,yt,jt),jt.delete(tn)),ll(M,ae,Pn)}function Xv(M,K){var ae=M.length;if(ae)return K+=K<0?ae:0,ac(K,ae)?M[K]:v}function Yv(M,K,ae){K.length?K=ur(K,function(yt){return Zr(yt)?function(jt){return dl(jt,yt.length===1?yt[0]:yt)}:yt}):K=[po];var Be=-1;K=ur(K,uo(Ur()));var Je=Lo(M,function(yt,jt,Xt){var tn=ur(K,function(On){return On(yt)});return{criteria:tn,index:++Be,value:yt}});return S0(Je,function(yt,jt){return cw(yt,jt,ae)})}function Lc(M,K){return ky(M,K,function(ae,Be){return zm(M,Be)})}function ky(M,K,ae){for(var Be=-1,Je=K.length,yt={};++Be<Je;){var jt=K[Be],Xt=dl(M,jt);ae(Xt,jt)&&Tf(yt,jc(jt,M),Xt)}return yt}function Jv(M){return function(K){return dl(K,M)}}function V0(M,K,ae,Be){var Je=Be?mv:tl,yt=-1,jt=K.length,Xt=M;for(M===K&&(K=ko(K)),ae&&(Xt=ur(M,uo(ae)));++yt<jt;)for(var tn=0,On=K[yt],Pn=ae?ae(On):On;(tn=Je(Xt,Pn,tn,Be))>-1;)Xt!==M&&O0.call(Xt,tn,1),O0.call(M,tn,1);return M}function Ty(M,K){for(var ae=M?K.length:0,Be=ae-1;ae--;){var Je=K[ae];if(ae==Be||Je!==yt){var yt=Je;ac(Je)?O0.call(M,Je,1):Z0(M,Je)}}return M}function W0(M,K){return M+vf(Bv()*(K-M+1))}function Qv(M,K,ae,Be){for(var Je=-1,yt=Us(kc((K-M)/(ae||1)),0),jt=bn(yt);yt--;)jt[Be?yt:++Je]=M,M+=ae;return jt}function G0(M,K){var ae="";if(!M||K<1||K>$)return ae;do K%2&&(ae+=M),K=vf(K/2),K&&(M+=M);while(K);return ae}function ri(M,K){return lp(im(M,K,po),M+"")}function ew(M){return vy(wl(M))}function tw(M,K){var ae=wl(M);return Xd(ae,Rc(K,0,ae.length))}function Tf(M,K,ae,Be){if(!ds(M))return M;K=jc(K,M);for(var Je=-1,yt=K.length,jt=yt-1,Xt=M;Xt!=null&&++Je<yt;){var tn=_a(K[Je]),On=ae;if(tn==="__proto__"||tn==="constructor"||tn==="prototype")return M;if(Je!=jt){var Pn=Xt[tn];On=Be?Be(Pn,tn,Xt):v,On===v&&(On=ds(Pn)?Pn:ac(K[Je+1])?[]:{})}Ef(Xt,tn,On),Xt=Xt[tn]}return M}var Cy=Wi?function(M,K){return Wi.set(M,K),M}:po,nw=R0?function(M,K){return R0(M,"toString",{configurable:!0,enumerable:!1,value:hh(K),writable:!0})}:po;function rw(M){return Xd(wl(M))}function Jo(M,K,ae){var Be=-1,Je=M.length;K<0&&(K=-K>Je?0:Je+K),ae=ae>Je?Je:ae,ae<0&&(ae+=Je),Je=K>ae?0:ae-K>>>0,K>>>=0;for(var yt=bn(Je);++Be<Je;)yt[Be]=M[Be+K];return yt}function iw(M,K){var ae;return rc(M,function(Be,Je,yt){return ae=K(Be,Je,yt),!ae}),!!ae}function zd(M,K,ae){var Be=0,Je=M==null?Be:M.length;if(typeof K=="number"&&K===K&&Je<=de){for(;Be<Je;){var yt=Be+Je>>>1,jt=M[yt];jt!==null&&!ho(jt)&&(ae?jt<=K:jt<K)?Be=yt+1:Je=yt}return Je}return q0(M,K,po,ae)}function q0(M,K,ae,Be){var Je=0,yt=M==null?0:M.length;if(yt===0)return 0;K=ae(K);for(var jt=K!==K,Xt=K===null,tn=ho(K),On=K===v;Je<yt;){var Pn=vf((Je+yt)/2),jn=ae(M[Pn]),er=jn!==v,kr=jn===null,Mr=jn===jn,Jr=ho(jn);if(jt)var Lr=Be||Mr;else On?Lr=Mr&&(Be||er):Xt?Lr=Mr&&er&&(Be||!kr):tn?Lr=Mr&&er&&!kr&&(Be||!Jr):kr||Jr?Lr=!1:Lr=Be?jn<=K:jn<K;Lr?Je=Pn+1:yt=Pn}return lo(yt,X)}function Py(M,K){for(var ae=-1,Be=M.length,Je=0,yt=[];++ae<Be;){var jt=M[ae],Xt=K?K(jt):jt;if(!ae||!Xs(Xt,tn)){var tn=Xt;yt[Je++]=jt===0?0:jt}}return yt}function My(M){return typeof M=="number"?M:ho(M)?J:+M}function Fo(M){if(typeof M=="string")return M;if(Zr(M))return ur(M,Fo)+"";if(ho(M))return Do?Do.call(M):"";var K=M+"";return K=="0"&&1/M==-j?"-0":K}function Fc(M,K,ae){var Be=-1,Je=Tr,yt=M.length,jt=!0,Xt=[],tn=Xt;if(ae)jt=!1,Je=Hr;else if(yt>=C){var On=K?null:pw(M);if(On)return mf(On);jt=!1,Je=xd,tn=new Oc}else tn=K?[]:Xt;e:for(;++Be<yt;){var Pn=M[Be],jn=K?K(Pn):Pn;if(Pn=ae||Pn!==0?Pn:0,jt&&jn===jn){for(var er=tn.length;er--;)if(tn[er]===jn)continue e;K&&tn.push(jn),Xt.push(Pn)}else Je(tn,jn,ae)||(tn!==Xt&&tn.push(jn),Xt.push(Pn))}return Xt}function Z0(M,K){return K=jc(K,M),M=sm(M,K),M==null||delete M[_a(Qo(K))]}function Oy(M,K,ae,Be){return Tf(M,K,ae(dl(M,K)),Be)}function Hd(M,K,ae,Be){for(var Je=M.length,yt=Be?Je:-1;(Be?yt--:++yt<Je)&&K(M[yt],yt,M););return ae?Jo(M,Be?0:yt,Be?yt+1:Je):Jo(M,Be?yt+1:0,Be?Je:yt)}function Ry(M,K){var ae=M;return ae instanceof hi&&(ae=ae.value()),es(K,function(Be,Je){return Je.func.apply(Je.thisArg,xi([Be],Je.args))},ae)}function X0(M,K,ae){var Be=M.length;if(Be<2)return Be?Fc(M[0]):[];for(var Je=-1,yt=bn(Be);++Je<Be;)for(var jt=M[Je],Xt=-1;++Xt<Be;)Xt!=Je&&(yt[Je]=fl(yt[Je]||jt,M[Xt],K,ae));return Fc(Zs(yt,1),K,ae)}function Ny(M,K,ae){for(var Be=-1,Je=M.length,yt=K.length,jt={};++Be<Je;){var Xt=Be<yt?K[Be]:v;ae(jt,M[Be],Xt)}return jt}function Y0(M){return Wr(M)?M:[]}function J0(M){return typeof M=="function"?M:po}function jc(M,K){return Zr(M)?M:ap(M,K)?[M]:um(bi(M))}var sw=ri;function zc(M,K,ae){var Be=M.length;return ae=ae===v?Be:ae,!K&&ae>=Be?M:Jo(M,K,ae)}var Uy=kS||function(M){return ys.clearTimeout(M)};function Dy(M,K){if(K)return M.slice();var ae=M.length,Be=Av?Av(ae):new M.constructor(ae);return M.copy(Be),Be}function Q0(M){var K=new M.constructor(M.byteLength);return new P0(K).set(new P0(M)),K}function ow(M,K){var ae=K?Q0(M.buffer):M.buffer;return new M.constructor(ae,M.byteOffset,M.byteLength)}function aw(M){var K=new M.constructor(M.source,en.exec(M));return K.lastIndex=M.lastIndex,K}function hl(M){return ec?Di(ec.call(M)):{}}function Ly(M,K){var ae=K?Q0(M.buffer):M.buffer;return new M.constructor(ae,M.byteOffset,M.length)}function Fy(M,K){if(M!==K){var ae=M!==v,Be=M===null,Je=M===M,yt=ho(M),jt=K!==v,Xt=K===null,tn=K===K,On=ho(K);if(!Xt&&!On&&!yt&&M>K||yt&&jt&&tn&&!Xt&&!On||Be&&jt&&tn||!ae&&tn||!Je)return 1;if(!Be&&!yt&&!On&&M<K||On&&ae&&Je&&!Be&&!yt||Xt&&ae&&Je||!jt&&Je||!tn)return-1}return 0}function cw(M,K,ae){for(var Be=-1,Je=M.criteria,yt=K.criteria,jt=Je.length,Xt=ae.length;++Be<jt;){var tn=Fy(Je[Be],yt[Be]);if(tn){if(Be>=Xt)return tn;var On=ae[Be];return tn*(On=="desc"?-1:1)}}return M.index-K.index}function jy(M,K,ae,Be){for(var Je=-1,yt=M.length,jt=ae.length,Xt=-1,tn=K.length,On=Us(yt-jt,0),Pn=bn(tn+On),jn=!Be;++Xt<tn;)Pn[Xt]=K[Xt];for(;++Je<jt;)(jn||Je<yt)&&(Pn[ae[Je]]=M[Je]);for(;On--;)Pn[Xt++]=M[Je++];return Pn}function zy(M,K,ae,Be){for(var Je=-1,yt=M.length,jt=-1,Xt=ae.length,tn=-1,On=K.length,Pn=Us(yt-Xt,0),jn=bn(Pn+On),er=!Be;++Je<Pn;)jn[Je]=M[Je];for(var kr=Je;++tn<On;)jn[kr+tn]=K[tn];for(;++jt<Xt;)(er||Je<yt)&&(jn[kr+ae[jt]]=M[Je++]);return jn}function ko(M,K){var ae=-1,Be=M.length;for(K||(K=bn(Be));++ae<Be;)K[ae]=M[ae];return K}function Na(M,K,ae,Be){var Je=!ae;ae||(ae={});for(var yt=-1,jt=K.length;++yt<jt;){var Xt=K[yt],tn=Be?Be(ae[Xt],M[Xt],Xt,ae,M):v;tn===v&&(tn=M[Xt]),Je?wa(ae,Xt,tn):Ef(ae,Xt,tn)}return ae}function uw(M,K){return Na(M,op(M),K)}function lw(M,K){return Na(M,Qy(M),K)}function Kd(M,K){return function(ae,Be){var Je=Zr(ae)?ar:zv,yt=K?K():{};return Je(ae,M,Ur(Be,2),yt)}}function pl(M){return ri(function(K,ae){var Be=-1,Je=ae.length,yt=Je>1?ae[Je-1]:v,jt=Je>2?ae[2]:v;for(yt=M.length>3&&typeof yt=="function"?(Je--,yt):v,jt&&fo(ae[0],ae[1],jt)&&(yt=Je<3?v:yt,Je=1),K=Di(K);++Be<Je;){var Xt=ae[Be];Xt&&M(K,Xt,Be,yt)}return K})}function Hy(M,K){return function(ae,Be){if(ae==null)return ae;if(!jo(ae))return M(ae,Be);for(var Je=ae.length,yt=K?Je:-1,jt=Di(ae);(K?yt--:++yt<Je)&&Be(jt[yt],yt,jt)!==!1;);return ae}}function Ky(M){return function(K,ae,Be){for(var Je=-1,yt=Di(K),jt=Be(K),Xt=jt.length;Xt--;){var tn=jt[M?Xt:++Je];if(ae(yt[tn],tn,yt)===!1)break}return K}}function fw(M,K,ae){var Be=K&L,Je=Cf(M);function yt(){var jt=this&&this!==ys&&this instanceof yt?Je:M;return jt.apply(Be?ae:this,arguments)}return yt}function $y(M){return function(K){K=bi(K);var ae=rl(K)?qs(K):v,Be=ae?ae[0]:K.charAt(0),Je=ae?zc(ae,1).join(""):K.slice(1);return Be[M]()+Je}}function gl(M){return function(K){return es(dh($m(K).replace(di,"")),M,"")}}function Cf(M){return function(){var K=arguments;switch(K.length){case 0:return new M;case 1:return new M(K[0]);case 2:return new M(K[0],K[1]);case 3:return new M(K[0],K[1],K[2]);case 4:return new M(K[0],K[1],K[2],K[3]);case 5:return new M(K[0],K[1],K[2],K[3],K[4]);case 6:return new M(K[0],K[1],K[2],K[3],K[4],K[5]);case 7:return new M(K[0],K[1],K[2],K[3],K[4],K[5],K[6])}var ae=ul(M.prototype),Be=M.apply(ae,K);return ds(Be)?Be:ae}}function dw(M,K,ae){var Be=Cf(M);function Je(){for(var yt=arguments.length,jt=bn(yt),Xt=yt,tn=yl(Je);Xt--;)jt[Xt]=arguments[Xt];var On=yt<3&&jt[0]!==tn&&jt[yt-1]!==tn?[]:Ir(jt,tn);if(yt-=On.length,yt<ae)return Zy(M,K,$d,Je.placeholder,v,jt,On,v,v,ae-yt);var Pn=this&&this!==ys&&this instanceof Je?Be:M;return yr(Pn,this,jt)}return Je}function Vy(M){return function(K,ae,Be){var Je=Di(K);if(!jo(K)){var yt=Ur(ae,3);K=js(K),ae=function(Xt){return yt(Je[Xt],Xt,Je)}}var jt=M(K,ae,Be);return jt>-1?Je[yt?K[jt]:jt]:v}}function Wy(M){return oc(function(K){var ae=K.length,Be=ae,Je=Xo.prototype.thru;for(M&&K.reverse();Be--;){var yt=K[Be];if(typeof yt!="function")throw new Ao(m);if(Je&&!jt&&qd(yt)=="wrapper")var jt=new Xo([],!0)}for(Be=jt?Be:ae;++Be<ae;){yt=K[Be];var Xt=qd(yt),tn=Xt=="wrapper"?ip(yt):v;tn&&cp(tn[0])&&tn[1]==(ie|H|Z|le)&&!tn[4].length&&tn[9]==1?jt=jt[qd(tn[0])].apply(jt,tn[3]):jt=yt.length==1&&cp(yt)?jt[Xt]():jt.thru(yt)}return function(){var On=arguments,Pn=On[0];if(jt&&On.length==1&&Zr(Pn))return jt.plant(Pn).value();for(var jn=0,er=ae?K[jn].apply(this,On):Pn;++jn<ae;)er=K[jn].call(this,er);return er}})}function $d(M,K,ae,Be,Je,yt,jt,Xt,tn,On){var Pn=K&ie,jn=K&L,er=K&D,kr=K&(H|G),Mr=K&be,Jr=er?v:Cf(M);function Lr(){for(var Qr=arguments.length,qr=bn(Qr),Co=Qr;Co--;)qr[Co]=arguments[Co];if(kr)var Ys=yl(Lr),Ko=ny(qr,Ys);if(Be&&(qr=jy(qr,Be,Je,kr)),yt&&(qr=zy(qr,yt,jt,kr)),Qr-=Ko,kr&&Qr<On){var Ts=Ir(qr,Ys);return Zy(M,K,$d,Lr.placeholder,ae,qr,Ts,Xt,tn,On-Qr)}var Aa=jn?ae:this,Fa=er?Aa[M]:M;return Qr=qr.length,Xt?qr=Mw(qr,Xt):Mr&&Qr>1&&qr.reverse(),Pn&&tn<Qr&&(qr.length=tn),this&&this!==ys&&this instanceof Lr&&(Fa=Jr||Cf(Fa)),Fa.apply(Aa,qr)}return Lr}function Gy(M,K){return function(ae,Be){return NS(ae,M,K(Be),{})}}function Vd(M,K){return function(ae,Be){var Je;if(ae===v&&Be===v)return K;if(ae!==v&&(Je=ae),Be!==v){if(Je===v)return Be;typeof ae=="string"||typeof Be=="string"?(ae=Fo(ae),Be=Fo(Be)):(ae=My(ae),Be=My(Be)),Je=M(ae,Be)}return Je}}function ep(M){return oc(function(K){return K=ur(K,uo(Ur())),ri(function(ae){var Be=this;return M(K,function(Je){return yr(Je,Be,ae)})})})}function Wd(M,K){K=K===v?" ":Fo(K);var ae=K.length;if(ae<2)return ae?G0(K,M):K;var Be=G0(K,kc(M/il(K)));return rl(K)?zc(qs(Be),0,M).join(""):Be.slice(0,M)}function hw(M,K,ae,Be){var Je=K&L,yt=Cf(M);function jt(){for(var Xt=-1,tn=arguments.length,On=-1,Pn=Be.length,jn=bn(Pn+tn),er=this&&this!==ys&&this instanceof jt?yt:M;++On<Pn;)jn[On]=Be[On];for(;tn--;)jn[On++]=arguments[++Xt];return yr(er,Je?ae:this,jn)}return jt}function qy(M){return function(K,ae,Be){return Be&&typeof Be!="number"&&fo(K,ae,Be)&&(ae=Be=v),K=cc(K),ae===v?(ae=K,K=0):ae=cc(ae),Be=Be===v?K<ae?1:-1:cc(Be),Qv(K,ae,Be,M)}}function Gd(M){return function(K,ae){return typeof K=="string"&&typeof ae=="string"||(K=Ho(K),ae=Ho(ae)),M(K,ae)}}function Zy(M,K,ae,Be,Je,yt,jt,Xt,tn,On){var Pn=K&H,jn=Pn?jt:v,er=Pn?v:jt,kr=Pn?yt:v,Mr=Pn?v:yt;K|=Pn?Z:Q,K&=~(Pn?Q:Z),K&W||(K&=~(L|D));var Jr=[M,K,Je,kr,jn,Mr,er,Xt,tn,On],Lr=ae.apply(v,Jr);return cp(M)&&om(Lr,Jr),Lr.placeholder=Be,am(Lr,M,K)}function tp(M){var K=Bs[M];return function(ae,Be){if(ae=Ho(ae),Be=Be==null?0:lo(Xr(Be),292),Be&&Iv(ae)){var Je=(bi(ae)+"e").split("e"),yt=K(Je[0]+"e"+(+Je[1]+Be));return Je=(bi(yt)+"e").split("e"),+(Je[0]+"e"+(+Je[1]-Be))}return K(ae)}}var pw=ba&&1/mf(new ba([,-0]))[1]==j?function(M){return new ba(M)}:Tp;function Xy(M){return function(K){var ae=io(K);return ae==$t?yu(K):ae==zt?sy(K):bv(K,M(K))}}function sc(M,K,ae,Be,Je,yt,jt,Xt){var tn=K&D;if(!tn&&typeof M!="function")throw new Ao(m);var On=Be?Be.length:0;if(On||(K&=~(Z|Q),Be=Je=v),jt=jt===v?jt:Us(Xr(jt),0),Xt=Xt===v?Xt:Xr(Xt),On-=Je?Je.length:0,K&Q){var Pn=Be,jn=Je;Be=Je=v}var er=tn?v:ip(M),kr=[M,K,ae,Be,Je,Pn,jn,yt,jt,Xt];if(er&&Tw(kr,er),M=kr[0],K=kr[1],ae=kr[2],Be=kr[3],Je=kr[4],Xt=kr[9]=kr[9]===v?tn?0:M.length:Us(kr[9]-On,0),!Xt&&K&(H|G)&&(K&=~(H|G)),!K||K==L)var Mr=fw(M,K,ae);else K==H||K==G?Mr=dw(M,K,Xt):(K==Z||K==(L|Z))&&!Je.length?Mr=hw(M,K,ae,Be):Mr=$d.apply(v,kr);var Jr=er?Cy:om;return am(Jr(Mr,kr),M,K)}function ns(M,K,ae,Be){return M===v||Xs(M,mu[ae])&&!Li.call(Be,ae)?K:M}function Yy(M,K,ae,Be,Je,yt){return ds(M)&&ds(K)&&(yt.set(K,M),kf(M,K,v,Yy,yt),yt.delete(K)),M}function gw(M){return Uf(M)?v:M}function Jy(M,K,ae,Be,Je,yt){var jt=ae&B,Xt=M.length,tn=K.length;if(Xt!=tn&&!(jt&&tn>Xt))return!1;var On=yt.get(M),Pn=yt.get(K);if(On&&Pn)return On==K&&Pn==M;var jn=-1,er=!0,kr=ae&O?new Oc:v;for(yt.set(M,K),yt.set(K,M);++jn<Xt;){var Mr=M[jn],Jr=K[jn];if(Be)var Lr=jt?Be(Jr,Mr,jn,K,M,yt):Be(Mr,Jr,jn,M,K,yt);if(Lr!==v){if(Lr)continue;er=!1;break}if(kr){if(!Uo(K,function(Qr,qr){if(!xd(kr,qr)&&(Mr===Qr||Je(Mr,Qr,ae,Be,yt)))return kr.push(qr)})){er=!1;break}}else if(!(Mr===Jr||Je(Mr,Jr,ae,Be,yt))){er=!1;break}}return yt.delete(M),yt.delete(K),er}function yw(M,K,ae,Be,Je,yt,jt){switch(ae){case se:if(M.byteLength!=K.byteLength||M.byteOffset!=K.byteOffset)return!1;M=M.buffer,K=K.buffer;case He:return!(M.byteLength!=K.byteLength||!yt(new P0(M),new P0(K)));case ke:case ut:case ft:return Xs(+M,+K);case ze:return M.name==K.name&&M.message==K.message;case Ge:case Ft:return M==K+"";case $t:var Xt=yu;case zt:var tn=Be&B;if(Xt||(Xt=mf),M.size!=K.size&&!tn)return!1;var On=jt.get(M);if(On)return On==K;Be|=O,jt.set(M,K);var Pn=Jy(Xt(M),Xt(K),Be,Je,yt,jt);return jt.delete(M),Pn;case tt:if(ec)return ec.call(M)==ec.call(K)}return!1}function mw(M,K,ae,Be,Je,yt){var jt=ae&B,Xt=np(M),tn=Xt.length,On=np(K),Pn=On.length;if(tn!=Pn&&!jt)return!1;for(var jn=tn;jn--;){var er=Xt[jn];if(!(jt?er in K:Li.call(K,er)))return!1}var kr=yt.get(M),Mr=yt.get(K);if(kr&&Mr)return kr==K&&Mr==M;var Jr=!0;yt.set(M,K),yt.set(K,M);for(var Lr=jt;++jn<tn;){er=Xt[jn];var Qr=M[er],qr=K[er];if(Be)var Co=jt?Be(qr,Qr,er,K,M,yt):Be(Qr,qr,er,M,K,yt);if(!(Co===v?Qr===qr||Je(Qr,qr,ae,Be,yt):Co)){Jr=!1;break}Lr||(Lr=er=="constructor")}if(Jr&&!Lr){var Ys=M.constructor,Ko=K.constructor;Ys!=Ko&&"constructor"in M&&"constructor"in K&&!(typeof Ys=="function"&&Ys instanceof Ys&&typeof Ko=="function"&&Ko instanceof Ko)&&(Jr=!1)}return yt.delete(M),yt.delete(K),Jr}function oc(M){return lp(im(M,v,pm),M+"")}function np(M){return Iy(M,js,op)}function rp(M){return Iy(M,hs,Qy)}var ip=Wi?function(M){return Wi.get(M)}:Tp;function qd(M){for(var K=M.name+"",ae=Tc[K],Be=Li.call(Tc,K)?ae.length:0;Be--;){var Je=ae[Be],yt=Je.func;if(yt==null||yt==M)return Je.name}return K}function yl(M){var K=Li.call(gt,"placeholder")?gt:M;return K.placeholder}function Ur(){var M=gt.iteratee||ph;return M=M===ph?Bf:M,arguments.length?M(arguments[0],arguments[1]):M}function Zd(M,K){var ae=M.__data__;return xw(K)?ae[typeof K=="string"?"string":"hash"]:ae.map}function sp(M){for(var K=js(M),ae=K.length;ae--;){var Be=K[ae],Je=M[Be];K[ae]=[Be,Je,nm(Je)]}return K}function Su(M,K){var ae=wv(M,K);return xf(ae)?ae:v}function bw(M){var K=Li.call(M,al),ae=M[al];try{M[al]=v;var Be=!0}catch{}var Je=C0.call(M);return Be&&(K?M[al]=ae:delete M[al]),Je}var op=Rd?function(M){return M==null?[]:(M=Di(M),Ui(Rd(M),function(K){return Md.call(M,K)}))}:Pp,Qy=Rd?function(M){for(var K=[];M;)xi(K,op(M)),M=M0(M);return K}:Pp,io=Bo;(ly&&io(new ly(new ArrayBuffer(1)))!=se||Dd&&io(new Dd)!=$t||cl&&io(cl.resolve())!=wt||ba&&io(new ba)!=zt||ls&&io(new ls)!=dt)&&(io=function(M){var K=Bo(M),ae=K==ct?M.constructor:v,Be=ae?Hc(ae):"";if(Be)switch(Be){case Cc:return se;case kv:return $t;case MS:return wt;case fy:return zt;case Tv:return dt}return K});function vw(M,K,ae){for(var Be=-1,Je=ae.length;++Be<Je;){var yt=ae[Be],jt=yt.size;switch(yt.type){case"drop":M+=jt;break;case"dropRight":K-=jt;break;case"take":K=lo(K,M+jt);break;case"takeRight":M=Us(M,K-jt);break}}return{start:M,end:K}}function ww(M){var K=M.match(Le);return K?K[1].split(_e):[]}function em(M,K,ae){K=jc(K,M);for(var Be=-1,Je=K.length,yt=!1;++Be<Je;){var jt=_a(K[Be]);if(!(yt=M!=null&&ae(M,jt)))break;M=M[jt]}return yt||++Be!=Je?yt:(Je=M==null?0:M.length,!!Je&&oh(Je)&&ac(jt,Je)&&(Zr(M)||Au(M)))}function _w(M){var K=M.length,ae=new M.constructor(K);return K&&typeof M[0]=="string"&&Li.call(M,"index")&&(ae.index=M.index,ae.input=M.input),ae}function tm(M){return typeof M.constructor=="function"&&!Pf(M)?ul(M0(M)):{}}function Ew(M,K,ae){var Be=M.constructor;switch(K){case He:return Q0(M);case ke:case ut:return new Be(+M);case se:return ow(M,ae);case oe:case ye:case Ee:case me:case Te:case Oe:case Qe:case Vt:case vt:return Ly(M,ae);case $t:return new Be;case ft:case Ft:return new Be(M);case Ge:return aw(M);case zt:return new Be;case tt:return hl(M)}}function Sw(M,K){var ae=K.length;if(!ae)return M;var Be=ae-1;return K[Be]=(ae>1?"& ":"")+K[Be],K=K.join(ae>2?", ":" "),M.replace(Ue,`{
|
||
/* [wrapped with `+K+`] */
|
||
`)}function Aw(M){return Zr(M)||Au(M)||!!(xv&&M&&M[xv])}function ac(M,K){var ae=typeof M;return K=K??$,!!K&&(ae=="number"||ae!="symbol"&&tr.test(M))&&M>-1&&M%1==0&&M<K}function fo(M,K,ae){if(!ds(ae))return!1;var Be=typeof K;return(Be=="number"?jo(ae)&&ac(K,ae.length):Be=="string"&&K in ae)?Xs(ae[K],M):!1}function ap(M,K){if(Zr(M))return!1;var ae=typeof M;return ae=="number"||ae=="symbol"||ae=="boolean"||M==null||ho(M)?!0:Lt.test(M)||!Dt.test(M)||K!=null&&M in Di(K)}function xw(M){var K=typeof M;return K=="string"||K=="number"||K=="symbol"||K=="boolean"?M!=="__proto__":M===null}function cp(M){var K=qd(M),ae=gt[K];if(typeof ae!="function"||!(K in hi.prototype))return!1;if(M===ae)return!0;var Be=ip(ae);return!!Be&&M===Be[0]}function Iw(M){return!!Sv&&Sv in M}var Bw=Cd?Kc:yh;function Pf(M){var K=M&&M.constructor,ae=typeof K=="function"&&K.prototype||mu;return M===ae}function nm(M){return M===M&&!ds(M)}function rm(M,K){return function(ae){return ae==null?!1:ae[M]===K&&(K!==v||M in Di(ae))}}function kw(M){var K=rh(M,function(Be){return ae.size===w&&ae.clear(),Be}),ae=K.cache;return K}function Tw(M,K){var ae=M[1],Be=K[1],Je=ae|Be,yt=Je<(L|D|ie),jt=Be==ie&&ae==H||Be==ie&&ae==le&&M[7].length<=K[8]||Be==(ie|le)&&K[7].length<=K[8]&&ae==H;if(!(yt||jt))return M;Be&L&&(M[2]=K[2],Je|=ae&L?0:W);var Xt=K[3];if(Xt){var tn=M[3];M[3]=tn?jy(tn,Xt,K[4]):Xt,M[4]=tn?Ir(M[3],_):K[4]}return Xt=K[5],Xt&&(tn=M[5],M[5]=tn?zy(tn,Xt,K[6]):Xt,M[6]=tn?Ir(M[5],_):K[6]),Xt=K[7],Xt&&(M[7]=Xt),Be&ie&&(M[8]=M[8]==null?K[8]:lo(M[8],K[8])),M[9]==null&&(M[9]=K[9]),M[0]=K[0],M[1]=Je,M}function Cw(M){var K=[];if(M!=null)for(var ae in Di(M))K.push(ae);return K}function Pw(M){return C0.call(M)}function im(M,K,ae){return K=Us(K===v?M.length-1:K,0),function(){for(var Be=arguments,Je=-1,yt=Us(Be.length-K,0),jt=bn(yt);++Je<yt;)jt[Je]=Be[K+Je];Je=-1;for(var Xt=bn(K+1);++Je<K;)Xt[Je]=Be[Je];return Xt[K]=ae(jt),yr(M,this,Xt)}}function sm(M,K){return K.length<2?M:dl(M,Jo(K,0,-1))}function Mw(M,K){for(var ae=M.length,Be=lo(K.length,ae),Je=ko(M);Be--;){var yt=K[Be];M[Be]=ac(yt,ae)?Je[yt]:v}return M}function up(M,K){if(!(K==="constructor"&&typeof M[K]=="function")&&K!="__proto__")return M[K]}var om=cm(Cy),Mf=cy||function(M,K){return ys.setTimeout(M,K)},lp=cm(nw);function am(M,K,ae){var Be=K+"";return lp(M,Sw(Be,Ow(ww(Be),ae)))}function cm(M){var K=0,ae=0;return function(){var Be=Ud(),Je=N-(Be-ae);if(ae=Be,Je>0){if(++K>=re)return arguments[0]}else K=0;return M.apply(v,arguments)}}function Xd(M,K){var ae=-1,Be=M.length,Je=Be-1;for(K=K===v?Be:K;++ae<K;){var yt=W0(ae,Je),jt=M[yt];M[yt]=M[ae],M[ae]=jt}return M.length=K,M}var um=kw(function(M){var K=[];return M.charCodeAt(0)===46&&K.push(""),M.replace(Gt,function(ae,Be,Je,yt){K.push(Je?yt.replace(Yt,"$1"):Be||ae)}),K});function _a(M){if(typeof M=="string"||ho(M))return M;var K=M+"";return K=="0"&&1/M==-j?"-0":K}function Hc(M){if(M!=null){try{return T0.call(M)}catch{}try{return M+""}catch{}}return""}function Ow(M,K){return Yn(Y,function(ae){var Be="_."+ae[0];K&ae[1]&&!Tr(M,Be)&&M.push(Be)}),M.sort()}function lm(M){if(M instanceof hi)return M.clone();var K=new Xo(M.__wrapped__,M.__chain__);return K.__actions__=ko(M.__actions__),K.__index__=M.__index__,K.__values__=M.__values__,K}function fm(M,K,ae){(ae?fo(M,K,ae):K===v)?K=1:K=Us(Xr(K),0);var Be=M==null?0:M.length;if(!Be||K<1)return[];for(var Je=0,yt=0,jt=bn(kc(Be/K));Je<Be;)jt[yt++]=Jo(M,Je,Je+=K);return jt}function Rw(M){for(var K=-1,ae=M==null?0:M.length,Be=0,Je=[];++K<ae;){var yt=M[K];yt&&(Je[Be++]=yt)}return Je}function Nw(){var M=arguments.length;if(!M)return[];for(var K=bn(M-1),ae=arguments[0],Be=M;Be--;)K[Be-1]=arguments[Be];return xi(Zr(ae)?ko(ae):[ae],Zs(K,1))}var Uw=ri(function(M,K){return Wr(M)?fl(M,Zs(K,1,Wr,!0)):[]}),Dw=ri(function(M,K){var ae=Qo(K);return Wr(ae)&&(ae=v),Wr(M)?fl(M,Zs(K,1,Wr,!0),Ur(ae,2)):[]}),Lw=ri(function(M,K){var ae=Qo(K);return Wr(ae)&&(ae=v),Wr(M)?fl(M,Zs(K,1,Wr,!0),v,ae):[]});function Fw(M,K,ae){var Be=M==null?0:M.length;return Be?(K=ae||K===v?1:Xr(K),Jo(M,K<0?0:K,Be)):[]}function jw(M,K,ae){var Be=M==null?0:M.length;return Be?(K=ae||K===v?1:Xr(K),K=Be-K,Jo(M,0,K<0?0:K)):[]}function zw(M,K){return M&&M.length?Hd(M,Ur(K,3),!0,!0):[]}function Hw(M,K){return M&&M.length?Hd(M,Ur(K,3),!0):[]}function Kw(M,K,ae,Be){var Je=M==null?0:M.length;return Je?(ae&&typeof ae!="number"&&fo(M,K,ae)&&(ae=0,Be=Je),$v(M,K,ae,Be)):[]}function dm(M,K,ae){var Be=M==null?0:M.length;if(!Be)return-1;var Je=ae==null?0:Xr(ae);return Je<0&&(Je=Us(Be+Je,0)),el(M,Ur(K,3),Je)}function hm(M,K,ae){var Be=M==null?0:M.length;if(!Be)return-1;var Je=Be-1;return ae!==v&&(Je=Xr(ae),Je=ae<0?Us(Be+Je,0):lo(Je,Be-1)),el(M,Ur(K,3),Je,!0)}function pm(M){var K=M==null?0:M.length;return K?Zs(M,1):[]}function $w(M){var K=M==null?0:M.length;return K?Zs(M,j):[]}function Vw(M,K){var ae=M==null?0:M.length;return ae?(K=K===v?1:Xr(K),Zs(M,K)):[]}function Ww(M){for(var K=-1,ae=M==null?0:M.length,Be={};++K<ae;){var Je=M[K];Be[Je[0]]=Je[1]}return Be}function gm(M){return M&&M.length?M[0]:v}function Gw(M,K,ae){var Be=M==null?0:M.length;if(!Be)return-1;var Je=ae==null?0:Xr(ae);return Je<0&&(Je=Us(Be+Je,0)),tl(M,K,Je)}function qw(M){var K=M==null?0:M.length;return K?Jo(M,0,-1):[]}var Zw=ri(function(M){var K=ur(M,Y0);return K.length&&K[0]===M[0]?ic(K):[]}),Xw=ri(function(M){var K=Qo(M),ae=ur(M,Y0);return K===Qo(ae)?K=v:ae.pop(),ae.length&&ae[0]===M[0]?ic(ae,Ur(K,2)):[]}),Yw=ri(function(M){var K=Qo(M),ae=ur(M,Y0);return K=typeof K=="function"?K:v,K&&ae.pop(),ae.length&&ae[0]===M[0]?ic(ae,v,K):[]});function Jw(M,K){return M==null?"":TS.call(M,K)}function Qo(M){var K=M==null?0:M.length;return K?M[K-1]:v}function Qw(M,K,ae){var Be=M==null?0:M.length;if(!Be)return-1;var Je=Be;return ae!==v&&(Je=Xr(ae),Je=Je<0?Us(Be+Je,0):lo(Je,Be-1)),K===K?Ev(M,K,Je):el(M,Jg,Je,!0)}function e2(M,K){return M&&M.length?Xv(M,Xr(K)):v}var t2=ri(ym);function ym(M,K){return M&&M.length&&K&&K.length?V0(M,K):M}function n2(M,K,ae){return M&&M.length&&K&&K.length?V0(M,K,Ur(ae,2)):M}function fp(M,K,ae){return M&&M.length&&K&&K.length?V0(M,K,v,ae):M}var r2=oc(function(M,K){var ae=M==null?0:M.length,Be=Ds(M,K);return Ty(M,ur(K,function(Je){return ac(Je,ae)?+Je:Je}).sort(Fy)),Be});function i2(M,K){var ae=[];if(!(M&&M.length))return ae;var Be=-1,Je=[],yt=M.length;for(K=Ur(K,3);++Be<yt;){var jt=M[Be];K(jt,Be,M)&&(ae.push(jt),Je.push(Be))}return Ty(M,Je),ae}function dp(M){return M==null?M:PS.call(M)}function s2(M,K,ae){var Be=M==null?0:M.length;return Be?(ae&&typeof ae!="number"&&fo(M,K,ae)?(K=0,ae=Be):(K=K==null?0:Xr(K),ae=ae===v?Be:Xr(ae)),Jo(M,K,ae)):[]}function o2(M,K){return zd(M,K)}function a2(M,K,ae){return q0(M,K,Ur(ae,2))}function c2(M,K){var ae=M==null?0:M.length;if(ae){var Be=zd(M,K);if(Be<ae&&Xs(M[Be],K))return Be}return-1}function u2(M,K){return zd(M,K,!0)}function l2(M,K,ae){return q0(M,K,Ur(ae,2),!0)}function f2(M,K){var ae=M==null?0:M.length;if(ae){var Be=zd(M,K,!0)-1;if(Xs(M[Be],K))return Be}return-1}function DS(M){return M&&M.length?Py(M):[]}function mm(M,K){return M&&M.length?Py(M,Ur(K,2)):[]}function LS(M){var K=M==null?0:M.length;return K?Jo(M,1,K):[]}function FS(M,K,ae){return M&&M.length?(K=ae||K===v?1:Xr(K),Jo(M,0,K<0?0:K)):[]}function jS(M,K,ae){var Be=M==null?0:M.length;return Be?(K=ae||K===v?1:Xr(K),K=Be-K,Jo(M,K<0?0:K,Be)):[]}function ea(M,K){return M&&M.length?Hd(M,Ur(K,3),!1,!0):[]}function zS(M,K){return M&&M.length?Hd(M,Ur(K,3)):[]}var HS=ri(function(M){return Fc(Zs(M,1,Wr,!0))}),KS=ri(function(M){var K=Qo(M);return Wr(K)&&(K=v),Fc(Zs(M,1,Wr,!0),Ur(K,2))}),$S=ri(function(M){var K=Qo(M);return K=typeof K=="function"?K:v,Fc(Zs(M,1,Wr,!0),v,K)});function VS(M){return M&&M.length?Fc(M):[]}function Ls(M,K){return M&&M.length?Fc(M,Ur(K,2)):[]}function bm(M,K){return K=typeof K=="function"?K:v,M&&M.length?Fc(M,v,K):[]}function Yd(M){if(!(M&&M.length))return[];var K=0;return M=Ui(M,function(ae){if(Wr(ae))return K=Us(ae.length,K),!0}),gf(K,function(ae){return ur(M,E0(ae))})}function d2(M,K){if(!(M&&M.length))return[];var ae=Yd(M);return K==null?ae:ur(ae,function(Be){return yr(K,v,Be)})}var WS=ri(function(M,K){return Wr(M)?fl(M,K):[]}),vm=ri(function(M){return X0(Ui(M,Wr))}),wm=ri(function(M){var K=Qo(M);return Wr(K)&&(K=v),X0(Ui(M,Wr),Ur(K,2))}),GS=ri(function(M){var K=Qo(M);return K=typeof K=="function"?K:v,X0(Ui(M,Wr),v,K)}),qS=ri(Yd);function hp(M,K){return Ny(M||[],K||[],Ef)}function h2(M,K){return Ny(M||[],K||[],Tf)}var Fr=ri(function(M){var K=M.length,ae=K>1?M[K-1]:v;return ae=typeof ae=="function"?(M.pop(),ae):v,d2(M,ae)});function _m(M){var K=gt(M);return K.__chain__=!0,K}function Jd(M,K){return K(M),M}function Qd(M,K){return K(M)}var ml=oc(function(M){var K=M.length,ae=K?M[0]:0,Be=this.__wrapped__,Je=function(yt){return Ds(yt,M)};return K>1||this.__actions__.length||!(Be instanceof hi)||!ac(ae)?this.thru(Je):(Be=Be.slice(ae,+ae+(K?1:0)),Be.__actions__.push({func:Qd,args:[Je],thisArg:v}),new Xo(Be,this.__chain__).thru(function(yt){return K&&!yt.length&&yt.push(v),yt}))});function p2(){return _m(this)}function g2(){return new Xo(this.value(),this.__chain__)}function y2(){this.__values__===v&&(this.__values__=Om(this.value()));var M=this.__index__>=this.__values__.length,K=M?v:this.__values__[this.__index__++];return{done:M,value:K}}function m2(){return this}function b2(M){for(var K,ae=this;ae instanceof _f;){var Be=lm(ae);Be.__index__=0,Be.__values__=v,K?Je.__wrapped__=Be:K=Be;var Je=Be;ae=ae.__wrapped__}return Je.__wrapped__=M,K}function v2(){var M=this.__wrapped__;if(M instanceof hi){var K=M;return this.__actions__.length&&(K=new hi(this)),K=K.reverse(),K.__actions__.push({func:Qd,args:[dp],thisArg:v}),new Xo(K,this.__chain__)}return this.thru(dp)}function w2(){return Ry(this.__wrapped__,this.__actions__)}var _2=Kd(function(M,K,ae){Li.call(M,ae)?++M[ae]:wa(M,ae,1)});function E2(M,K,ae){var Be=Zr(M)?Oi:Kv;return ae&&fo(M,K,ae)&&(K=v),Be(M,Ur(K,3))}function eh(M,K){var ae=Zr(M)?Ui:Ay;return ae(M,Ur(K,3))}var S2=Vy(dm),A2=Vy(hm);function Of(M,K){return Zs(th(M,K),1)}function x2(M,K){return Zs(th(M,K),j)}function Rr(M,K,ae){return ae=ae===v?1:Xr(ae),Zs(th(M,K),ae)}function Em(M,K){var ae=Zr(M)?Yn:rc;return ae(M,Ur(K,3))}function Sm(M,K){var ae=Zr(M)?Cr:Sy;return ae(M,Ur(K,3))}var I2=Kd(function(M,K,ae){Li.call(M,ae)?M[ae].push(K):wa(M,ae,[K])});function B2(M,K,ae,Be){M=jo(M)?M:wl(M),ae=ae&&!Be?Xr(ae):0;var Je=M.length;return ae<0&&(ae=Us(Je+ae,0)),vp(M)?ae<=Je&&M.indexOf(K,ae)>-1:!!Je&&tl(M,K,ae)>-1}var k2=ri(function(M,K,ae){var Be=-1,Je=typeof K=="function",yt=jo(M)?bn(M.length):[];return rc(M,function(jt){yt[++Be]=Je?yr(K,jt,ae):Sf(jt,K,ae)}),yt}),T2=Kd(function(M,K,ae){wa(M,ae,K)});function th(M,K){var ae=Zr(M)?ur:Lo;return ae(M,Ur(K,3))}function C2(M,K,ae,Be){return M==null?[]:(Zr(K)||(K=K==null?[]:[K]),ae=Be?v:ae,Zr(ae)||(ae=ae==null?[]:[ae]),Yv(M,K,ae))}var P2=Kd(function(M,K,ae){M[ae?0:1].push(K)},function(){return[[],[]]});function M2(M,K,ae){var Be=Zr(M)?es:ey,Je=arguments.length<3;return Be(M,Ur(K,4),ae,Je,rc)}function O2(M,K,ae){var Be=Zr(M)?xs:ey,Je=arguments.length<3;return Be(M,Ur(K,4),ae,Je,Sy)}function R2(M,K){var ae=Zr(M)?Ui:Ay;return ae(M,ih(Ur(K,3)))}function Am(M){var K=Zr(M)?vy:ew;return K(M)}function xm(M,K,ae){(ae?fo(M,K,ae):K===v)?K=1:K=Xr(K);var Be=Zr(M)?jv:tw;return Be(M,K)}function N2(M){var K=Zr(M)?wy:rw;return K(M)}function fi(M){if(M==null)return 0;if(jo(M))return vp(M)?il(M):M.length;var K=io(M);return K==$t||K==zt?M.size:$0(M).length}function U2(M,K,ae){var Be=Zr(M)?Uo:iw;return ae&&fo(M,K,ae)&&(K=v),Be(M,Ur(K,3))}var bl=ri(function(M,K){if(M==null)return[];var ae=K.length;return ae>1&&fo(M,K[0],K[1])?K=[]:ae>2&&fo(K[0],K[1],K[2])&&(K=[K[0]]),Yv(M,Zs(K,1),[])}),nh=N0||function(){return ys.Date.now()};function rs(M,K){if(typeof K!="function")throw new Ao(m);return M=Xr(M),function(){if(--M<1)return K.apply(this,arguments)}}function Jn(M,K,ae){return K=ae?v:K,K=M&&K==null?M.length:K,sc(M,ie,v,v,v,v,K)}function Im(M,K){var ae;if(typeof K!="function")throw new Ao(m);return M=Xr(M),function(){return--M>0&&(ae=K.apply(this,arguments)),M<=1&&(K=v),ae}}var pp=ri(function(M,K,ae){var Be=L;if(ae.length){var Je=Ir(ae,yl(pp));Be|=Z}return sc(M,Be,K,ae,Je)}),Bm=ri(function(M,K,ae){var Be=L|D;if(ae.length){var Je=Ir(ae,yl(Bm));Be|=Z}return sc(K,Be,M,ae,Je)});function ms(M,K,ae){K=ae?v:K;var Be=sc(M,H,v,v,v,v,v,K);return Be.placeholder=ms.placeholder,Be}function gp(M,K,ae){K=ae?v:K;var Be=sc(M,G,v,v,v,v,v,K);return Be.placeholder=gp.placeholder,Be}function yp(M,K,ae){var Be,Je,yt,jt,Xt,tn,On=0,Pn=!1,jn=!1,er=!0;if(typeof M!="function")throw new Ao(m);K=Ho(K)||0,ds(ae)&&(Pn=!!ae.leading,jn="maxWait"in ae,yt=jn?Us(Ho(ae.maxWait)||0,K):yt,er="trailing"in ae?!!ae.trailing:er);function kr(Ts){var Aa=Be,Fa=Je;return Be=Je=v,On=Ts,jt=M.apply(Fa,Aa),jt}function Mr(Ts){return On=Ts,Xt=Mf(Qr,K),Pn?kr(Ts):jt}function Jr(Ts){var Aa=Ts-tn,Fa=Ts-On,Rp=K-Aa;return jn?lo(Rp,yt-Fa):Rp}function Lr(Ts){var Aa=Ts-tn,Fa=Ts-On;return tn===v||Aa>=K||Aa<0||jn&&Fa>=yt}function Qr(){var Ts=nh();if(Lr(Ts))return qr(Ts);Xt=Mf(Qr,Jr(Ts))}function qr(Ts){return Xt=v,er&&Be?kr(Ts):(Be=Je=v,jt)}function Co(){Xt!==v&&Uy(Xt),On=0,Be=tn=Je=Xt=v}function Ys(){return Xt===v?jt:qr(nh())}function Ko(){var Ts=nh(),Aa=Lr(Ts);if(Be=arguments,Je=this,tn=Ts,Aa){if(Xt===v)return Mr(tn);if(jn)return Uy(Xt),Xt=Mf(Qr,K),kr(tn)}return Xt===v&&(Xt=Mf(Qr,K)),jt}return Ko.cancel=Co,Ko.flush=Ys,Ko}var D2=ri(function(M,K){return Ey(M,1,K)}),Rf=ri(function(M,K,ae){return Ey(M,Ho(K)||0,ae)});function L2(M){return sc(M,be)}function rh(M,K){if(typeof M!="function"||K!=null&&typeof K!="function")throw new Ao(m);var ae=function(){var Be=arguments,Je=K?K.apply(this,Be):Be[0],yt=ae.cache;if(yt.has(Je))return yt.get(Je);var jt=M.apply(this,Be);return ae.cache=yt.set(Je,jt)||yt,jt};return ae.cache=new(rh.Cache||nc),ae}rh.Cache=nc;function ih(M){if(typeof M!="function")throw new Ao(m);return function(){var K=arguments;switch(K.length){case 0:return!M.call(this);case 1:return!M.call(this,K[0]);case 2:return!M.call(this,K[0],K[1]);case 3:return!M.call(this,K[0],K[1],K[2])}return!M.apply(this,K)}}function F2(M){return Im(2,M)}var j2=sw(function(M,K){K=K.length==1&&Zr(K[0])?ur(K[0],uo(Ur())):ur(Zs(K,1),uo(Ur()));var ae=K.length;return ri(function(Be){for(var Je=-1,yt=lo(Be.length,ae);++Je<yt;)Be[Je]=K[Je].call(this,Be[Je]);return yr(M,this,Be)})}),mp=ri(function(M,K){var ae=Ir(K,yl(mp));return sc(M,Z,v,K,ae)}),km=ri(function(M,K){var ae=Ir(K,yl(km));return sc(M,Q,v,K,ae)}),Gr=oc(function(M,K){return sc(M,le,v,v,v,K)});function z2(M,K){if(typeof M!="function")throw new Ao(m);return K=K===v?K:Xr(K),ri(M,K)}function bp(M,K){if(typeof M!="function")throw new Ao(m);return K=K==null?0:Us(Xr(K),0),ri(function(ae){var Be=ae[K],Je=zc(ae,0,K);return Be&&xi(Je,Be),yr(M,this,Je)})}function H2(M,K,ae){var Be=!0,Je=!0;if(typeof M!="function")throw new Ao(m);return ds(ae)&&(Be="leading"in ae?!!ae.leading:Be,Je="trailing"in ae?!!ae.trailing:Je),yp(M,K,{leading:Be,maxWait:K,trailing:Je})}function K2(M){return Jn(M,1)}function $2(M,K){return mp(J0(K),M)}function V2(){if(!arguments.length)return[];var M=arguments[0];return Zr(M)?M:[M]}function W2(M){return Yo(M,k)}function G2(M,K){return K=typeof K=="function"?K:v,Yo(M,k,K)}function sh(M){return Yo(M,A|k)}function Fs(M,K){return K=typeof K=="function"?K:v,Yo(M,A|k,K)}function q2(M,K){return K==null||z0(M,K,js(K))}function Xs(M,K){return M===K||M!==M&&K!==K}var Z2=Gd(_u),X2=Gd(function(M,K){return M>=K}),Au=Gv(function(){return arguments}())?Gv:function(M){return bs(M)&&Li.call(M,"callee")&&!Md.call(M,"callee")},Zr=bn.isArray,ZS=St?uo(St):ts;function jo(M){return M!=null&&oh(M.length)&&!Kc(M)}function Wr(M){return bs(M)&&jo(M)}function Y2(M){return M===!0||M===!1||bs(M)&&Bo(M)==ke}var xu=Nd||yh,XS=At?uo(At):on;function YS(M){return bs(M)&&M.nodeType===1&&!Uf(M)}function JS(M){if(M==null)return!0;if(jo(M)&&(Zr(M)||typeof M=="string"||typeof M.splice=="function"||xu(M)||Df(M)||Au(M)))return!M.length;var K=io(M);if(K==$t||K==zt)return!M.size;if(Pf(M))return!$0(M).length;for(var ae in M)if(Li.call(M,ae))return!1;return!0}function QS(M,K){return Eu(M,K)}function Hi(M,K,ae){ae=typeof ae=="function"?ae:v;var Be=ae?ae(M,K):v;return Be===v?Eu(M,K,v,ae):!!Be}function Tm(M){if(!bs(M))return!1;var K=Bo(M);return K==ze||K==Re||typeof M.message=="string"&&typeof M.name=="string"&&!Uf(M)}function e8(M){return typeof M=="number"&&Iv(M)}function Kc(M){if(!ds(M))return!1;var K=Bo(M);return K==_t||K==Ct||K==Ie||K==Rt}function Cm(M){return typeof M=="number"&&M==Xr(M)}function oh(M){return typeof M=="number"&&M>-1&&M%1==0&&M<=$}function ds(M){var K=typeof M;return M!=null&&(K=="object"||K=="function")}function bs(M){return M!=null&&typeof M=="object"}var J2=qt?uo(qt):jd;function t8(M,K){return M===K||Af(M,K,sp(K))}function Ua(M,K,ae){return ae=typeof ae=="function"?ae:v,Af(M,K,sp(K),ae)}function Nf(M){return ks(M)&&M!=+M}function vl(M){if(Bw(M))throw new zr(I);return xf(M)}function zo(M){return M===null}function Iu(M){return M==null}function ks(M){return typeof M=="number"||bs(M)&&Bo(M)==ft}function Uf(M){if(!bs(M)||Bo(M)!=ct)return!1;var K=M0(M);if(K===null)return!0;var ae=Li.call(K,"constructor")&&K.constructor;return typeof ae=="function"&&ae instanceof ae&&T0.call(ae)==IS}var Da=cn?uo(cn):K0;function Gi(M){return Cm(M)&&M>=-$&&M<=$}var Pm=pn?uo(pn):nr;function vp(M){return typeof M=="string"||!Zr(M)&&bs(M)&&Bo(M)==Ft}function ho(M){return typeof M=="symbol"||bs(M)&&Bo(M)==tt}var Df=Kn?uo(Kn):If;function n8(M){return M===v}function r8(M){return bs(M)&&io(M)==dt}function Q2(M){return bs(M)&&Bo(M)==De}var Mm=Gd(Dc),e3=Gd(function(M,K){return M<=K});function Om(M){if(!M)return[];if(jo(M))return vp(M)?qs(M):ko(M);if(Od&&M[Od])return ry(M[Od]());var K=io(M),ae=K==$t?yu:K==zt?mf:wl;return ae(M)}function cc(M){if(!M)return M===0?M:0;if(M=Ho(M),M===j||M===-j){var K=M<0?-1:1;return K*ee}return M===M?M:0}function Xr(M){var K=cc(M),ae=K%1;return K===K?ae?K-ae:K:0}function Rm(M){return M?Rc(Xr(M),0,F):0}function Ho(M){if(typeof M=="number")return M;if(ho(M))return J;if(ds(M)){var K=typeof M.valueOf=="function"?M.valueOf():M;M=ds(K)?K+"":K}if(typeof M!="string")return M===0?M:+M;M=x0(M);var ae=kn.test(M);return ae||Hn.test(M)?Yg(M.slice(2),ae?2:8):Vn.test(M)?J:+M}function wp(M){return Na(M,hs(M))}function Nm(M){return M?Rc(Xr(M),-$,$):M===0?M:0}function bi(M){return M==null?"":Fo(M)}var t3=pl(function(M,K){if(Pf(K)||jo(K)){Na(K,js(K),M);return}for(var ae in K)Li.call(K,ae)&&Ef(M,ae,K[ae])}),Um=pl(function(M,K){Na(K,hs(K),M)}),ta=pl(function(M,K,ae,Be){Na(K,hs(K),M,Be)}),i8=pl(function(M,K,ae,Be){Na(K,js(K),M,Be)}),_p=oc(Ds);function n3(M,K){var ae=ul(M);return K==null?ae:_y(ae,K)}var Dm=ri(function(M,K){M=Di(M);var ae=-1,Be=K.length,Je=Be>2?K[2]:v;for(Je&&fo(K[0],K[1],Je)&&(Be=1);++ae<Be;)for(var yt=K[ae],jt=hs(yt),Xt=-1,tn=jt.length;++Xt<tn;){var On=jt[Xt],Pn=M[On];(Pn===v||Xs(Pn,mu[On])&&!Li.call(M,On))&&(M[On]=yt[On])}return M}),Lm=ri(function(M){return M.push(v,Yy),yr(a3,v,M)});function r3(M,K){return Ic(M,Ur(K,3),Io)}function Fm(M,K){return Ic(M,Ur(K,3),xy)}function Ep(M,K){return M==null?M:Nc(M,Ur(K,3),hs)}function i3(M,K){return M==null?M:Vv(M,Ur(K,3),hs)}function s3(M,K){return M&&Io(M,Ur(K,3))}function s8(M,K){return M&&xy(M,Ur(K,3))}function uc(M){return M==null?[]:Uc(M,js(M))}function o8(M){return M==null?[]:Uc(M,hs(M))}function jm(M,K,ae){var Be=M==null?v:dl(M,K);return Be===v?ae:Be}function a8(M,K){return M!=null&&em(M,K,OS)}function zm(M,K){return M!=null&&em(M,K,Wv)}var c8=Gy(function(M,K,ae){K!=null&&typeof K.toString!="function"&&(K=C0.call(K)),M[K]=ae},hh(po)),u8=Gy(function(M,K,ae){K!=null&&typeof K.toString!="function"&&(K=C0.call(K)),Li.call(M,K)?M[K].push(ae):M[K]=[ae]},Ur),l8=ri(Sf);function js(M){return jo(M)?by(M):$0(M)}function hs(M){return jo(M)?by(M,!0):By(M)}function o3(M,K){var ae={};return K=Ur(K,3),Io(M,function(Be,Je,yt){wa(ae,K(Be,Je,yt),Be)}),ae}function lc(M,K){var ae={};return K=Ur(K,3),Io(M,function(Be,Je,yt){wa(ae,Je,K(Be,Je,yt))}),ae}var ah=pl(function(M,K,ae){kf(M,K,ae)}),a3=pl(function(M,K,ae,Be){kf(M,K,ae,Be)}),c3=oc(function(M,K){var ae={};if(M==null)return ae;var Be=!1;K=ur(K,function(yt){return yt=jc(yt,M),Be||(Be=yt.length>1),yt}),Na(M,rp(M),ae),Be&&(ae=Yo(ae,A|S|k,gw));for(var Je=K.length;Je--;)Z0(ae,K[Je]);return ae});function ch(M,K){return Hm(M,ih(Ur(K)))}var u3=oc(function(M,K){return M==null?{}:Lc(M,K)});function Hm(M,K){if(M==null)return{};var ae=ur(rp(M),function(Be){return[Be]});return K=Ur(K),ky(M,ae,function(Be,Je){return K(Be,Je[0])})}function l3(M,K,ae){K=jc(K,M);var Be=-1,Je=K.length;for(Je||(Je=1,M=v);++Be<Je;){var yt=M==null?v:M[_a(K[Be])];yt===v&&(Be=Je,yt=ae),M=Kc(yt)?yt.call(M):yt}return M}function Sp(M,K,ae){return M==null?M:Tf(M,K,ae)}function Ea(M,K,ae,Be){return Be=typeof Be=="function"?Be:v,M==null?M:Tf(M,K,ae,Be)}var Ap=Xy(js),uh=Xy(hs);function f3(M,K,ae){var Be=Zr(M),Je=Be||xu(M)||Df(M);if(K=Ur(K,4),ae==null){var yt=M&&M.constructor;Je?ae=Be?new yt:[]:ds(M)?ae=Kc(yt)?ul(M0(M)):{}:ae={}}return(Je?Yn:Io)(M,function(jt,Xt,tn){return K(ae,jt,Xt,tn)}),ae}function lh(M,K){return M==null?!0:Z0(M,K)}function xp(M,K,ae){return M==null?M:Oy(M,K,J0(ae))}function Ip(M,K,ae,Be){return Be=typeof Be=="function"?Be:v,M==null?M:Oy(M,K,J0(ae),Be)}function wl(M){return M==null?[]:I0(M,js(M))}function d3(M){return M==null?[]:I0(M,hs(M))}function h3(M,K,ae){return ae===v&&(ae=K,K=v),ae!==v&&(ae=Ho(ae),ae=ae===ae?ae:0),K!==v&&(K=Ho(K),K=K===K?K:0),Rc(Ho(M),K,ae)}function p3(M,K,ae){return K=cc(K),ae===v?(ae=K,K=0):ae=cc(ae),M=Ho(M),RS(M,K,ae)}function g3(M,K,ae){if(ae&&typeof ae!="boolean"&&fo(M,K,ae)&&(K=ae=v),ae===v&&(typeof K=="boolean"?(ae=K,K=v):typeof M=="boolean"&&(ae=M,M=v)),M===v&&K===v?(M=0,K=1):(M=cc(M),K===v?(K=M,M=0):K=cc(K)),M>K){var Be=M;M=K,K=Be}if(ae||M%1||K%1){var Je=Bv();return lo(M+Je*(K-M+Qu("1e-"+((Je+"").length-1))),K)}return W0(M,K)}var y3=gl(function(M,K,ae){return K=K.toLowerCase(),M+(ae?Km(K):K)});function Km(M){return fh(bi(M).toLowerCase())}function $m(M){return M=bi(M),M&&M.replace(gr,yf).replace(mi,"")}function m3(M,K,ae){M=bi(M),K=Fo(K);var Be=M.length;ae=ae===v?Be:Rc(Xr(ae),0,Be);var Je=ae;return ae-=K.length,ae>=0&&M.slice(ae,Je)==K}function b3(M){return M=bi(M),M&&Un.test(M)?M.replace(or,nl):M}function v3(M){return M=bi(M),M&&un.test(M)?M.replace(xn,"\\$&"):M}var Pt=gl(function(M,K,ae){return M+(ae?"-":"")+K.toLowerCase()}),w3=gl(function(M,K,ae){return M+(ae?" ":"")+K.toLowerCase()}),_3=$y("toLowerCase");function Ii(M,K,ae){M=bi(M),K=Xr(K);var Be=K?il(M):0;if(!K||Be>=K)return M;var Je=(K-Be)/2;return Wd(vf(Je),ae)+M+Wd(kc(Je),ae)}function To(M,K,ae){M=bi(M),K=Xr(K);var Be=K?il(M):0;return K&&Be<K?M+Wd(K-Be,ae):M}function na(M,K,ae){M=bi(M),K=Xr(K);var Be=K?il(M):0;return K&&Be<K?Wd(K-Be,ae)+M:M}function Vm(M,K,ae){return ae||K==null?K=0:K&&(K=+K),uy(bi(M).replace(fn,""),K||0)}function Wm(M,K,ae){return(ae?fo(M,K,ae):K===v)?K=1:K=Xr(K),G0(bi(M),K)}function $c(){var M=arguments,K=bi(M[0]);return M.length<3?K:K.replace(M[1],M[2])}var E3=gl(function(M,K,ae){return M+(ae?"_":"")+K.toLowerCase()});function S3(M,K,ae){return ae&&typeof ae!="number"&&fo(M,K,ae)&&(K=ae=v),ae=ae===v?F:ae>>>0,ae?(M=bi(M),M&&(typeof K=="string"||K!=null&&!Da(K))&&(K=Fo(K),!K&&rl(M))?zc(qs(M),0,ae):M.split(K,ae)):[]}var A3=gl(function(M,K,ae){return M+(ae?" ":"")+fh(K)});function x3(M,K,ae){return M=bi(M),ae=ae==null?0:Rc(Xr(ae),0,M.length),K=Fo(K),M.slice(ae,ae+K.length)==K}function Gm(M,K,ae){var Be=gt.templateSettings;ae&&fo(M,K,ae)&&(K=v),M=bi(M),K=ta({},K,Be,ns);var Je=ta({},K.imports,Be.imports,ns),yt=js(Je),jt=I0(Je,yt),Xt,tn,On=0,Pn=K.interpolate||br,jn="__p += '",er=ol((K.escape||br).source+"|"+Pn.source+"|"+(Pn===st?Jt:br).source+"|"+(K.evaluate||br).source+"|$","g"),kr="//# sourceURL="+(Li.call(K,"sourceURL")?(K.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++gu+"]")+`
|
||
`;M.replace(er,function(Lr,Qr,qr,Co,Ys,Ko){return qr||(qr=Co),jn+=M.slice(On,Ko).replace(pr,vv),Qr&&(Xt=!0,jn+=`' +
|
||
__e(`+Qr+`) +
|
||
'`),Ys&&(tn=!0,jn+=`';
|
||
`+Ys+`;
|
||
__p += '`),qr&&(jn+=`' +
|
||
((__t = (`+qr+`)) == null ? '' : __t) +
|
||
'`),On=Ko+Lr.length,Lr}),jn+=`';
|
||
`;var Mr=Li.call(K,"variable")&&K.variable;if(!Mr)jn=`with (obj) {
|
||
`+jn+`
|
||
}
|
||
`;else if(Ot.test(Mr))throw new zr(b);jn=(tn?jn.replace(Zt,""):jn).replace(dn,"$1").replace(ln,"$1;"),jn="function("+(Mr||"obj")+`) {
|
||
`+(Mr?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(Xt?", __e = _.escape":"")+(tn?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+jn+`return __p
|
||
}`;var Jr=kp(function(){return _i(yt,kr+"return "+jn).apply(v,jt)});if(Jr.source=jn,Tm(Jr))throw Jr;return Jr}function Bp(M){return bi(M).toLowerCase()}function _l(M){return bi(M).toUpperCase()}function La(M,K,ae){if(M=bi(M),M&&(ae||K===v))return x0(M);if(!M||!(K=Fo(K)))return M;var Be=qs(M),Je=qs(K),yt=B0(Be,Je),jt=ty(Be,Je)+1;return zc(Be,yt,jt).join("")}function qm(M,K,ae){if(M=bi(M),M&&(ae||K===v))return M.slice(0,Id(M)+1);if(!M||!(K=Fo(K)))return M;var Be=qs(M),Je=ty(Be,qs(K))+1;return zc(Be,0,Je).join("")}function Zm(M,K,ae){if(M=bi(M),M&&(ae||K===v))return M.replace(fn,"");if(!M||!(K=Fo(K)))return M;var Be=qs(M),Je=B0(Be,qs(K));return zc(Be,Je).join("")}function Xm(M,K){var ae=we,Be=Ae;if(ds(K)){var Je="separator"in K?K.separator:Je;ae="length"in K?Xr(K.length):ae,Be="omission"in K?Fo(K.omission):Be}M=bi(M);var yt=M.length;if(rl(M)){var jt=qs(M);yt=jt.length}if(ae>=yt)return M;var Xt=ae-il(Be);if(Xt<1)return Be;var tn=jt?zc(jt,0,Xt).join(""):M.slice(0,Xt);if(Je===v)return tn+Be;if(jt&&(Xt+=tn.length-Xt),Da(Je)){if(M.slice(Xt).search(Je)){var On,Pn=tn;for(Je.global||(Je=ol(Je.source,bi(en.exec(Je))+"g")),Je.lastIndex=0;On=Je.exec(Pn);)var jn=On.index;tn=tn.slice(0,jn===v?Xt:jn)}}else if(M.indexOf(Fo(Je),Xt)!=Xt){var er=tn.lastIndexOf(Je);er>-1&&(tn=tn.slice(0,er))}return tn+Be}function Ym(M){return M=bi(M),M&&An.test(M)?M.replace(yn,oy):M}var I3=gl(function(M,K,ae){return M+(ae?" ":"")+K.toUpperCase()}),fh=$y("toUpperCase");function dh(M,K,ae){return M=bi(M),K=ae?v:K,K===v?AS(M)?sl(M):ya(M):M.match(K)||[]}var kp=ri(function(M,K){try{return yr(M,v,K)}catch(ae){return Tm(ae)?ae:new zr(ae)}}),Jm=oc(function(M,K){return Yn(K,function(ae){ae=_a(ae),wa(M,ae,pp(M[ae],M))}),M});function Qm(M){var K=M==null?0:M.length,ae=Ur();return M=K?ur(M,function(Be){if(typeof Be[1]!="function")throw new Ao(m);return[ae(Be[0]),Be[1]]}):[],ri(function(Be){for(var Je=-1;++Je<K;){var yt=M[Je];if(yr(yt[0],this,Be))return yr(yt[1],this,Be)}})}function eb(M){return Hv(Yo(M,A))}function hh(M){return function(){return M}}function tb(M,K){return M==null||M!==M?K:M}var nb=Wy(),rb=Wy(!0);function po(M){return M}function ph(M){return Bf(typeof M=="function"?M:Yo(M,A))}function ib(M){return qv(Yo(M,A))}function sb(M,K){return Zv(M,Yo(K,A))}var B3=ri(function(M,K){return function(ae){return Sf(ae,M,K)}}),k3=ri(function(M,K){return function(ae){return Sf(M,ae,K)}});function gh(M,K,ae){var Be=js(K),Je=Uc(K,Be);ae==null&&!(ds(K)&&(Je.length||!Be.length))&&(ae=K,K=M,M=this,Je=Uc(K,js(K)));var yt=!(ds(ae)&&"chain"in ae)||!!ae.chain,jt=Kc(M);return Yn(Je,function(Xt){var tn=K[Xt];M[Xt]=tn,jt&&(M.prototype[Xt]=function(){var On=this.__chain__;if(yt||On){var Pn=M(this.__wrapped__),jn=Pn.__actions__=ko(this.__actions__);return jn.push({func:tn,args:arguments,thisArg:M}),Pn.__chain__=On,Pn}return tn.apply(M,xi([this.value()],arguments))})}),M}function T3(){return ys._===this&&(ys._=BS),this}function Tp(){}function ob(M){return M=Xr(M),ri(function(K){return Xv(K,M)})}var ab=ep(ur),cb=ep(Oi),ub=ep(Uo);function Cp(M){return ap(M)?E0(_a(M)):Jv(M)}function lb(M){return function(K){return M==null?v:dl(M,K)}}var C3=qy(),P3=qy(!0);function Pp(){return[]}function yh(){return!1}function M3(){return{}}function O3(){return""}function R3(){return!0}function Mp(M,K){if(M=Xr(M),M<1||M>$)return[];var ae=F,Be=lo(M,F);K=Ur(K),M-=F;for(var Je=gf(Be,K);++ae<M;)K(ae);return Je}function fb(M){return Zr(M)?ur(M,_a):ho(M)?[M]:ko(um(bi(M)))}function N3(M){var K=++xS;return bi(M)+K}var Op=Vd(function(M,K){return M+K},0),U3=tp("ceil"),D3=Vd(function(M,K){return M/K},1),L3=tp("floor");function F3(M){return M&&M.length?Fd(M,po,_u):v}function j3(M,K){return M&&M.length?Fd(M,Ur(K,2),_u):v}function z3(M){return _0(M,po)}function H3(M,K){return _0(M,Ur(K,2))}function K3(M){return M&&M.length?Fd(M,po,Dc):v}function $3(M,K){return M&&M.length?Fd(M,Ur(K,2),Dc):v}var V3=Vd(function(M,K){return M*K},1),W3=tp("round"),jr=Vd(function(M,K){return M-K},0);function db(M){return M&&M.length?A0(M,po):0}function Sa(M,K){return M&&M.length?A0(M,Ur(K,2)):0}return gt.after=rs,gt.ary=Jn,gt.assign=t3,gt.assignIn=Um,gt.assignInWith=ta,gt.assignWith=i8,gt.at=_p,gt.before=Im,gt.bind=pp,gt.bindAll=Jm,gt.bindKey=Bm,gt.castArray=V2,gt.chain=_m,gt.chunk=fm,gt.compact=Rw,gt.concat=Nw,gt.cond=Qm,gt.conforms=eb,gt.constant=hh,gt.countBy=_2,gt.create=n3,gt.curry=ms,gt.curryRight=gp,gt.debounce=yp,gt.defaults=Dm,gt.defaultsDeep=Lm,gt.defer=D2,gt.delay=Rf,gt.difference=Uw,gt.differenceBy=Dw,gt.differenceWith=Lw,gt.drop=Fw,gt.dropRight=jw,gt.dropRightWhile=zw,gt.dropWhile=Hw,gt.fill=Kw,gt.filter=eh,gt.flatMap=Of,gt.flatMapDeep=x2,gt.flatMapDepth=Rr,gt.flatten=pm,gt.flattenDeep=$w,gt.flattenDepth=Vw,gt.flip=L2,gt.flow=nb,gt.flowRight=rb,gt.fromPairs=Ww,gt.functions=uc,gt.functionsIn=o8,gt.groupBy=I2,gt.initial=qw,gt.intersection=Zw,gt.intersectionBy=Xw,gt.intersectionWith=Yw,gt.invert=c8,gt.invertBy=u8,gt.invokeMap=k2,gt.iteratee=ph,gt.keyBy=T2,gt.keys=js,gt.keysIn=hs,gt.map=th,gt.mapKeys=o3,gt.mapValues=lc,gt.matches=ib,gt.matchesProperty=sb,gt.memoize=rh,gt.merge=ah,gt.mergeWith=a3,gt.method=B3,gt.methodOf=k3,gt.mixin=gh,gt.negate=ih,gt.nthArg=ob,gt.omit=c3,gt.omitBy=ch,gt.once=F2,gt.orderBy=C2,gt.over=ab,gt.overArgs=j2,gt.overEvery=cb,gt.overSome=ub,gt.partial=mp,gt.partialRight=km,gt.partition=P2,gt.pick=u3,gt.pickBy=Hm,gt.property=Cp,gt.propertyOf=lb,gt.pull=t2,gt.pullAll=ym,gt.pullAllBy=n2,gt.pullAllWith=fp,gt.pullAt=r2,gt.range=C3,gt.rangeRight=P3,gt.rearg=Gr,gt.reject=R2,gt.remove=i2,gt.rest=z2,gt.reverse=dp,gt.sampleSize=xm,gt.set=Sp,gt.setWith=Ea,gt.shuffle=N2,gt.slice=s2,gt.sortBy=bl,gt.sortedUniq=DS,gt.sortedUniqBy=mm,gt.split=S3,gt.spread=bp,gt.tail=LS,gt.take=FS,gt.takeRight=jS,gt.takeRightWhile=ea,gt.takeWhile=zS,gt.tap=Jd,gt.throttle=H2,gt.thru=Qd,gt.toArray=Om,gt.toPairs=Ap,gt.toPairsIn=uh,gt.toPath=fb,gt.toPlainObject=wp,gt.transform=f3,gt.unary=K2,gt.union=HS,gt.unionBy=KS,gt.unionWith=$S,gt.uniq=VS,gt.uniqBy=Ls,gt.uniqWith=bm,gt.unset=lh,gt.unzip=Yd,gt.unzipWith=d2,gt.update=xp,gt.updateWith=Ip,gt.values=wl,gt.valuesIn=d3,gt.without=WS,gt.words=dh,gt.wrap=$2,gt.xor=vm,gt.xorBy=wm,gt.xorWith=GS,gt.zip=qS,gt.zipObject=hp,gt.zipObjectDeep=h2,gt.zipWith=Fr,gt.entries=Ap,gt.entriesIn=uh,gt.extend=Um,gt.extendWith=ta,gh(gt,gt),gt.add=Op,gt.attempt=kp,gt.camelCase=y3,gt.capitalize=Km,gt.ceil=U3,gt.clamp=h3,gt.clone=W2,gt.cloneDeep=sh,gt.cloneDeepWith=Fs,gt.cloneWith=G2,gt.conformsTo=q2,gt.deburr=$m,gt.defaultTo=tb,gt.divide=D3,gt.endsWith=m3,gt.eq=Xs,gt.escape=b3,gt.escapeRegExp=v3,gt.every=E2,gt.find=S2,gt.findIndex=dm,gt.findKey=r3,gt.findLast=A2,gt.findLastIndex=hm,gt.findLastKey=Fm,gt.floor=L3,gt.forEach=Em,gt.forEachRight=Sm,gt.forIn=Ep,gt.forInRight=i3,gt.forOwn=s3,gt.forOwnRight=s8,gt.get=jm,gt.gt=Z2,gt.gte=X2,gt.has=a8,gt.hasIn=zm,gt.head=gm,gt.identity=po,gt.includes=B2,gt.indexOf=Gw,gt.inRange=p3,gt.invoke=l8,gt.isArguments=Au,gt.isArray=Zr,gt.isArrayBuffer=ZS,gt.isArrayLike=jo,gt.isArrayLikeObject=Wr,gt.isBoolean=Y2,gt.isBuffer=xu,gt.isDate=XS,gt.isElement=YS,gt.isEmpty=JS,gt.isEqual=QS,gt.isEqualWith=Hi,gt.isError=Tm,gt.isFinite=e8,gt.isFunction=Kc,gt.isInteger=Cm,gt.isLength=oh,gt.isMap=J2,gt.isMatch=t8,gt.isMatchWith=Ua,gt.isNaN=Nf,gt.isNative=vl,gt.isNil=Iu,gt.isNull=zo,gt.isNumber=ks,gt.isObject=ds,gt.isObjectLike=bs,gt.isPlainObject=Uf,gt.isRegExp=Da,gt.isSafeInteger=Gi,gt.isSet=Pm,gt.isString=vp,gt.isSymbol=ho,gt.isTypedArray=Df,gt.isUndefined=n8,gt.isWeakMap=r8,gt.isWeakSet=Q2,gt.join=Jw,gt.kebabCase=Pt,gt.last=Qo,gt.lastIndexOf=Qw,gt.lowerCase=w3,gt.lowerFirst=_3,gt.lt=Mm,gt.lte=e3,gt.max=F3,gt.maxBy=j3,gt.mean=z3,gt.meanBy=H3,gt.min=K3,gt.minBy=$3,gt.stubArray=Pp,gt.stubFalse=yh,gt.stubObject=M3,gt.stubString=O3,gt.stubTrue=R3,gt.multiply=V3,gt.nth=e2,gt.noConflict=T3,gt.noop=Tp,gt.now=nh,gt.pad=Ii,gt.padEnd=To,gt.padStart=na,gt.parseInt=Vm,gt.random=g3,gt.reduce=M2,gt.reduceRight=O2,gt.repeat=Wm,gt.replace=$c,gt.result=l3,gt.round=W3,gt.runInContext=nn,gt.sample=Am,gt.size=fi,gt.snakeCase=E3,gt.some=U2,gt.sortedIndex=o2,gt.sortedIndexBy=a2,gt.sortedIndexOf=c2,gt.sortedLastIndex=u2,gt.sortedLastIndexBy=l2,gt.sortedLastIndexOf=f2,gt.startCase=A3,gt.startsWith=x3,gt.subtract=jr,gt.sum=db,gt.sumBy=Sa,gt.template=Gm,gt.times=Mp,gt.toFinite=cc,gt.toInteger=Xr,gt.toLength=Rm,gt.toLower=Bp,gt.toNumber=Ho,gt.toSafeInteger=Nm,gt.toString=bi,gt.toUpper=_l,gt.trim=La,gt.trimEnd=qm,gt.trimStart=Zm,gt.truncate=Xm,gt.unescape=Ym,gt.uniqueId=N3,gt.upperCase=I3,gt.upperFirst=fh,gt.each=Em,gt.eachRight=Sm,gt.first=gm,gh(gt,function(){var M={};return Io(gt,function(K,ae){Li.call(gt.prototype,ae)||(M[ae]=K)}),M}(),{chain:!1}),gt.VERSION=T,Yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(M){gt[M].placeholder=gt}),Yn(["drop","take"],function(M,K){hi.prototype[M]=function(ae){ae=ae===v?1:Us(Xr(ae),0);var Be=this.__filtered__&&!K?new hi(this):this.clone();return Be.__filtered__?Be.__takeCount__=lo(ae,Be.__takeCount__):Be.__views__.push({size:lo(ae,F),type:M+(Be.__dir__<0?"Right":"")}),Be},hi.prototype[M+"Right"]=function(ae){return this.reverse()[M](ae).reverse()}}),Yn(["filter","map","takeWhile"],function(M,K){var ae=K+1,Be=ae==z||ae==U;hi.prototype[M]=function(Je){var yt=this.clone();return yt.__iteratees__.push({iteratee:Ur(Je,3),type:ae}),yt.__filtered__=yt.__filtered__||Be,yt}}),Yn(["head","last"],function(M,K){var ae="take"+(K?"Right":"");hi.prototype[M]=function(){return this[ae](1).value()[0]}}),Yn(["initial","tail"],function(M,K){var ae="drop"+(K?"":"Right");hi.prototype[M]=function(){return this.__filtered__?new hi(this):this[ae](1)}}),hi.prototype.compact=function(){return this.filter(po)},hi.prototype.find=function(M){return this.filter(M).head()},hi.prototype.findLast=function(M){return this.reverse().find(M)},hi.prototype.invokeMap=ri(function(M,K){return typeof M=="function"?new hi(this):this.map(function(ae){return Sf(ae,M,K)})}),hi.prototype.reject=function(M){return this.filter(ih(Ur(M)))},hi.prototype.slice=function(M,K){M=Xr(M);var ae=this;return ae.__filtered__&&(M>0||K<0)?new hi(ae):(M<0?ae=ae.takeRight(-M):M&&(ae=ae.drop(M)),K!==v&&(K=Xr(K),ae=K<0?ae.dropRight(-K):ae.take(K-M)),ae)},hi.prototype.takeRightWhile=function(M){return this.reverse().takeWhile(M).reverse()},hi.prototype.toArray=function(){return this.take(F)},Io(hi.prototype,function(M,K){var ae=/^(?:filter|find|map|reject)|While$/.test(K),Be=/^(?:head|last)$/.test(K),Je=gt[Be?"take"+(K=="last"?"Right":""):K],yt=Be||/^find/.test(K);Je&&(gt.prototype[K]=function(){var jt=this.__wrapped__,Xt=Be?[1]:arguments,tn=jt instanceof hi,On=Xt[0],Pn=tn||Zr(jt),jn=function(Qr){var qr=Je.apply(gt,xi([Qr],Xt));return Be&&er?qr[0]:qr};Pn&&ae&&typeof On=="function"&&On.length!=1&&(tn=Pn=!1);var er=this.__chain__,kr=!!this.__actions__.length,Mr=yt&&!er,Jr=tn&&!kr;if(!yt&&Pn){jt=Jr?jt:new hi(this);var Lr=M.apply(jt,Xt);return Lr.__actions__.push({func:Qd,args:[jn],thisArg:v}),new Xo(Lr,er)}return Mr&&Jr?M.apply(this,Xt):(Lr=this.thru(jn),Mr?Be?Lr.value()[0]:Lr.value():Lr)})}),Yn(["pop","push","shift","sort","splice","unshift"],function(M){var K=Td[M],ae=/^(?:push|sort|unshift)$/.test(M)?"tap":"thru",Be=/^(?:pop|shift)$/.test(M);gt.prototype[M]=function(){var Je=arguments;if(Be&&!this.__chain__){var yt=this.value();return K.apply(Zr(yt)?yt:[],Je)}return this[ae](function(jt){return K.apply(Zr(jt)?jt:[],Je)})}}),Io(hi.prototype,function(M,K){var ae=gt[K];if(ae){var Be=ae.name+"";Li.call(Tc,Be)||(Tc[Be]=[]),Tc[Be].push({name:K,func:ae})}}),Tc[$d(v,D).name]=[{name:"wrapper",func:v}],hi.prototype.clone=dy,hi.prototype.reverse=hy,hi.prototype.value=py,gt.prototype.at=ml,gt.prototype.chain=p2,gt.prototype.commit=g2,gt.prototype.next=y2,gt.prototype.plant=b2,gt.prototype.reverse=v2,gt.prototype.toJSON=gt.prototype.valueOf=gt.prototype.value=w2,gt.prototype.first=gt.prototype.head,Od&&(gt.prototype[Od]=m2),gt},ma=Bd();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(ys._=ma,define(function(){return ma})):Qa?((Qa.exports=ma)._=ma,Ad._=ma):ys._=ma}).call(this)},77412:function(fe){"use strict";fe.exports=Math.abs},52418:function(fe){"use strict";fe.exports=Math.floor},19313:function(fe){"use strict";fe.exports=Number.isNaN||function(x){return x!==x}},57958:function(fe){"use strict";fe.exports=Math.max},47384:function(fe){"use strict";fe.exports=Math.min},250:function(fe){"use strict";fe.exports=Math.pow},51844:function(fe){"use strict";fe.exports=Math.round},47279:function(fe,p,x){"use strict";var v=x(19313);fe.exports=function(C){return v(C)||C===0?C:C<0?-1:1}},75035:function(fe,p,x){"use strict";var v=x(91193),T=x(80800),C=x(56608).Buffer,I=new Array(16);function m(){T.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}v(m,T),m.prototype._update=function(){for(var S=I,k=0;k<16;++k)S[k]=this._block.readInt32LE(k*4);var B=this._a,O=this._b,L=this._c,D=this._d;B=g(B,O,L,D,S[0],3614090360,7),D=g(D,B,O,L,S[1],3905402710,12),L=g(L,D,B,O,S[2],606105819,17),O=g(O,L,D,B,S[3],3250441966,22),B=g(B,O,L,D,S[4],4118548399,7),D=g(D,B,O,L,S[5],1200080426,12),L=g(L,D,B,O,S[6],2821735955,17),O=g(O,L,D,B,S[7],4249261313,22),B=g(B,O,L,D,S[8],1770035416,7),D=g(D,B,O,L,S[9],2336552879,12),L=g(L,D,B,O,S[10],4294925233,17),O=g(O,L,D,B,S[11],2304563134,22),B=g(B,O,L,D,S[12],1804603682,7),D=g(D,B,O,L,S[13],4254626195,12),L=g(L,D,B,O,S[14],2792965006,17),O=g(O,L,D,B,S[15],1236535329,22),B=w(B,O,L,D,S[1],4129170786,5),D=w(D,B,O,L,S[6],3225465664,9),L=w(L,D,B,O,S[11],643717713,14),O=w(O,L,D,B,S[0],3921069994,20),B=w(B,O,L,D,S[5],3593408605,5),D=w(D,B,O,L,S[10],38016083,9),L=w(L,D,B,O,S[15],3634488961,14),O=w(O,L,D,B,S[4],3889429448,20),B=w(B,O,L,D,S[9],568446438,5),D=w(D,B,O,L,S[14],3275163606,9),L=w(L,D,B,O,S[3],4107603335,14),O=w(O,L,D,B,S[8],1163531501,20),B=w(B,O,L,D,S[13],2850285829,5),D=w(D,B,O,L,S[2],4243563512,9),L=w(L,D,B,O,S[7],1735328473,14),O=w(O,L,D,B,S[12],2368359562,20),B=_(B,O,L,D,S[5],4294588738,4),D=_(D,B,O,L,S[8],2272392833,11),L=_(L,D,B,O,S[11],1839030562,16),O=_(O,L,D,B,S[14],4259657740,23),B=_(B,O,L,D,S[1],2763975236,4),D=_(D,B,O,L,S[4],1272893353,11),L=_(L,D,B,O,S[7],4139469664,16),O=_(O,L,D,B,S[10],3200236656,23),B=_(B,O,L,D,S[13],681279174,4),D=_(D,B,O,L,S[0],3936430074,11),L=_(L,D,B,O,S[3],3572445317,16),O=_(O,L,D,B,S[6],76029189,23),B=_(B,O,L,D,S[9],3654602809,4),D=_(D,B,O,L,S[12],3873151461,11),L=_(L,D,B,O,S[15],530742520,16),O=_(O,L,D,B,S[2],3299628645,23),B=A(B,O,L,D,S[0],4096336452,6),D=A(D,B,O,L,S[7],1126891415,10),L=A(L,D,B,O,S[14],2878612391,15),O=A(O,L,D,B,S[5],4237533241,21),B=A(B,O,L,D,S[12],1700485571,6),D=A(D,B,O,L,S[3],2399980690,10),L=A(L,D,B,O,S[10],4293915773,15),O=A(O,L,D,B,S[1],2240044497,21),B=A(B,O,L,D,S[8],1873313359,6),D=A(D,B,O,L,S[15],4264355552,10),L=A(L,D,B,O,S[6],2734768916,15),O=A(O,L,D,B,S[13],1309151649,21),B=A(B,O,L,D,S[4],4149444226,6),D=A(D,B,O,L,S[11],3174756917,10),L=A(L,D,B,O,S[2],718787259,15),O=A(O,L,D,B,S[9],3951481745,21),this._a=this._a+B|0,this._b=this._b+O|0,this._c=this._c+L|0,this._d=this._d+D|0},m.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 S=C.allocUnsafe(16);return S.writeInt32LE(this._a,0),S.writeInt32LE(this._b,4),S.writeInt32LE(this._c,8),S.writeInt32LE(this._d,12),S};function b(S,k){return S<<k|S>>>32-k}function g(S,k,B,O,L,D,W){return b(S+(k&B|~k&O)+L+D|0,W)+k|0}function w(S,k,B,O,L,D,W){return b(S+(k&O|B&~O)+L+D|0,W)+k|0}function _(S,k,B,O,L,D,W){return b(S+(k^B^O)+L+D|0,W)+k|0}function A(S,k,B,O,L,D,W){return b(S+(B^(k|~O))+L+D|0,W)+k|0}fe.exports=m},35578:function(fe){fe.exports=p;function p(x,v){if(!x)throw new Error(v||"Assertion failed")}p.equal=function(v,T,C){if(v!=T)throw new Error(C||"Assertion failed: "+v+" != "+T)}},94209:function(fe,p){"use strict";var x=p;function v(I,m){if(Array.isArray(I))return I.slice();if(!I)return[];var b=[];if(typeof I!="string"){for(var g=0;g<I.length;g++)b[g]=I[g]|0;return b}if(m==="hex"){I=I.replace(/[^a-z0-9]+/ig,""),I.length%2!==0&&(I="0"+I);for(var g=0;g<I.length;g+=2)b.push(parseInt(I[g]+I[g+1],16))}else for(var g=0;g<I.length;g++){var w=I.charCodeAt(g),_=w>>8,A=w&255;_?b.push(_,A):b.push(A)}return b}x.toArray=v;function T(I){return I.length===1?"0"+I:I}x.zero2=T;function C(I){for(var m="",b=0;b<I.length;b++)m+=T(I[b].toString(16));return m}x.toHex=C,x.encode=function(m,b){return b==="hex"?C(m):m}},55689:function(fe,p,x){var v=x(54619),T=x(73180);fe.exports=function(I){if(typeof I=="string"||typeof I=="number"){var m=new v(1),b=String(I).toLowerCase().trim(),g=b.substr(0,2)==="0x"||b.substr(0,3)==="-0x",w=T(b);if(w.substr(0,1)==="-"&&(w=T(w.slice(1)),m=new v(-1,10)),w=w===""?"0":w,!w.match(/^-?[0-9]+$/)&&w.match(/^[0-9A-Fa-f]+$/)||w.match(/^[a-fA-F]+$/)||g===!0&&w.match(/^[0-9A-Fa-f]+$/))return new v(w,16).mul(m);if((w.match(/^-?[0-9]+$/)||w==="")&&g===!1)return new v(w,10).mul(m)}else if(typeof I=="object"&&I.toString&&!I.pop&&!I.push&&I.toString(10).match(/^-?[0-9]+$/)&&(I.mul||I.dividedToIntegerBy))return new v(I.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(I)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},30656:function(fe){"use strict";var p=function(x){return x!==x};fe.exports=function(v,T){return v===0&&T===0?1/v===1/T:!!(v===T||p(v)&&p(T))}},19068:function(fe,p,x){"use strict";var v=x(4938),T=x(17695),C=x(30656),I=x(12197),m=x(49235),b=T(I(),Object);v(b,{getPolyfill:I,implementation:C,shim:m}),fe.exports=b},12197:function(fe,p,x){"use strict";var v=x(30656);fe.exports=function(){return typeof Object.is=="function"?Object.is:v}},49235:function(fe,p,x){"use strict";var v=x(12197),T=x(4938);fe.exports=function(){var I=v();return T(Object,{is:I},{is:function(){return Object.is!==I}}),I}},25717:function(fe,p,x){"use strict";var v;if(!Object.keys){var T=Object.prototype.hasOwnProperty,C=Object.prototype.toString,I=x(14635),m=Object.prototype.propertyIsEnumerable,b=!m.call({toString:null},"toString"),g=m.call(function(){},"prototype"),w=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],_=function(B){var O=B.constructor;return O&&O.prototype===B},A={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},S=function(){for(var B in window)try{if(!A["$"+B]&&T.call(window,B)&&window[B]!==null&&typeof window[B]=="object")try{_(window[B])}catch{return!0}}catch{return!0}return!1}(),k=function(B){if(!S)return _(B);try{return _(B)}catch{return!1}};v=function(O){var L=O!==null&&typeof O=="object",D=C.call(O)==="[object Function]",W=I(O),H=L&&C.call(O)==="[object String]",G=[];if(!L&&!D&&!W)throw new TypeError("Object.keys called on a non-object");var Z=g&&D;if(H&&O.length>0&&!T.call(O,0))for(var Q=0;Q<O.length;++Q)G.push(String(Q));if(W&&O.length>0)for(var ie=0;ie<O.length;++ie)G.push(String(ie));else for(var le in O)!(Z&&le==="prototype")&&T.call(O,le)&&G.push(String(le));if(b)for(var be=k(O),we=0;we<w.length;++we)!(be&&w[we]==="constructor")&&T.call(O,w[we])&&G.push(w[we]);return G}}fe.exports=v},5187:function(fe,p,x){"use strict";var v=Array.prototype.slice,T=x(14635),C=Object.keys,I=C?function(g){return C(g)}:x(25717),m=Object.keys;I.shim=function(){if(Object.keys){var g=function(){var w=Object.keys(arguments);return w&&w.length===arguments.length}(1,2);g||(Object.keys=function(_){return T(_)?m(v.call(_)):m(_)})}else Object.keys=I;return Object.keys||I},fe.exports=I},14635:function(fe){"use strict";var p=Object.prototype.toString;fe.exports=function(v){var T=p.call(v),C=T==="[object Arguments]";return C||(C=T!=="[object Array]"&&v!==null&&typeof v=="object"&&typeof v.length=="number"&&v.length>=0&&p.call(v.callee)==="[object Function]"),C}},1924:function(fe,p,x){"use strict";var v=x(5187),T=x(9712)(),C=x(98801),I=x(25153),m=C("Array.prototype.push"),b=C("Object.prototype.propertyIsEnumerable"),g=T?I.getOwnPropertySymbols:null;fe.exports=function(_,A){if(_==null)throw new TypeError("target must be an object");var S=I(_);if(arguments.length===1)return S;for(var k=1;k<arguments.length;++k){var B=I(arguments[k]),O=v(B),L=T&&(I.getOwnPropertySymbols||g);if(L)for(var D=L(B),W=0;W<D.length;++W){var H=D[W];b(B,H)&&m(O,H)}for(var G=0;G<O.length;++G){var Z=O[G];if(b(B,Z)){var Q=B[Z];S[Z]=Q}}}return S}},43921:function(fe,p,x){"use strict";var v=x(1924),T=function(){if(!Object.assign)return!1;for(var I="abcdefghijklmnopqrst",m=I.split(""),b={},g=0;g<m.length;++g)b[m[g]]=m[g];var w=Object.assign({},b),_="";for(var A in w)_+=A;return I!==_},C=function(){if(!Object.assign||!Object.preventExtensions)return!1;var I=Object.preventExtensions({1:2});try{Object.assign(I,"xy")}catch{return I[1]==="y"}return!1};fe.exports=function(){return!Object.assign||T()||C()?v:Object.assign}},7274:function(fe){"use strict";fe.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},85409:function(fe){var p=fe.exports={},x,v;function T(){throw new Error("setTimeout has not been defined")}function C(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?x=setTimeout:x=T}catch{x=T}try{typeof clearTimeout=="function"?v=clearTimeout:v=C}catch{v=C}})();function I(O){if(x===setTimeout)return setTimeout(O,0);if((x===T||!x)&&setTimeout)return x=setTimeout,setTimeout(O,0);try{return x(O,0)}catch{try{return x.call(null,O,0)}catch{return x.call(this,O,0)}}}function m(O){if(v===clearTimeout)return clearTimeout(O);if((v===C||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(O);try{return v(O)}catch{try{return v.call(null,O)}catch{return v.call(this,O)}}}var b=[],g=!1,w,_=-1;function A(){!g||!w||(g=!1,w.length?b=w.concat(b):_=-1,b.length&&S())}function S(){if(!g){var O=I(A);g=!0;for(var L=b.length;L;){for(w=b,b=[];++_<L;)w&&w[_].run();_=-1,L=b.length}w=null,g=!1,m(O)}}p.nextTick=function(O){var L=new Array(arguments.length-1);if(arguments.length>1)for(var D=1;D<arguments.length;D++)L[D-1]=arguments[D];b.push(new k(O,L)),b.length===1&&!g&&I(S)};function k(O,L){this.fun=O,this.array=L}k.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={};function B(){}p.on=B,p.addListener=B,p.once=B,p.off=B,p.removeListener=B,p.removeAllListeners=B,p.emit=B,p.prependListener=B,p.prependOnceListener=B,p.listeners=function(O){return[]},p.binding=function(O){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(O){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},82869:function(fe,p,x){"use strict";var v=x(85409),T=65536,C=4294967295;function I(){throw new Error(`Secure random number generation is not supported by this browser.
|
||
Use Chrome, Firefox or Internet Explorer 11`)}var m=x(56608).Buffer,b=x.g.crypto||x.g.msCrypto;b&&b.getRandomValues?fe.exports=g:fe.exports=I;function g(w,_){if(w>C)throw new RangeError("requested too many random bytes");var A=m.allocUnsafe(w);if(w>0)if(w>T)for(var S=0;S<w;S+=T)b.getRandomValues(A.slice(S,S+T));else b.getRandomValues(A);return typeof _=="function"?v.nextTick(function(){_(null,A)}):A}},20289:function(fe){"use strict";function p(b,g){b.prototype=Object.create(g.prototype),b.prototype.constructor=b,b.__proto__=g}var x={};function v(b,g,w){w||(w=Error);function _(S,k,B){return typeof g=="string"?g:g(S,k,B)}var A=function(S){p(k,S);function k(B,O,L){return S.call(this,_(B,O,L))||this}return k}(w);A.prototype.name=w.name,A.prototype.code=b,x[b]=A}function T(b,g){if(Array.isArray(b)){var w=b.length;return b=b.map(function(_){return String(_)}),w>2?"one of ".concat(g," ").concat(b.slice(0,w-1).join(", "),", or ")+b[w-1]:w===2?"one of ".concat(g," ").concat(b[0]," or ").concat(b[1]):"of ".concat(g," ").concat(b[0])}else return"of ".concat(g," ").concat(String(b))}function C(b,g,w){return b.substr(!w||w<0?0:+w,g.length)===g}function I(b,g,w){return(w===void 0||w>b.length)&&(w=b.length),b.substring(w-g.length,w)===g}function m(b,g,w){return typeof w!="number"&&(w=0),w+g.length>b.length?!1:b.indexOf(g,w)!==-1}v("ERR_INVALID_OPT_VALUE",function(b,g){return'The value "'+g+'" is invalid for option "'+b+'"'},TypeError),v("ERR_INVALID_ARG_TYPE",function(b,g,w){var _;typeof g=="string"&&C(g,"not ")?(_="must not be",g=g.replace(/^not /,"")):_="must be";var A;if(I(b," argument"))A="The ".concat(b," ").concat(_," ").concat(T(g,"type"));else{var S=m(b,".")?"property":"argument";A='The "'.concat(b,'" ').concat(S," ").concat(_," ").concat(T(g,"type"))}return A+=". Received type ".concat(typeof w),A},TypeError),v("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),v("ERR_METHOD_NOT_IMPLEMENTED",function(b){return"The "+b+" method is not implemented"}),v("ERR_STREAM_PREMATURE_CLOSE","Premature close"),v("ERR_STREAM_DESTROYED",function(b){return"Cannot call "+b+" after a stream was destroyed"}),v("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),v("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),v("ERR_STREAM_WRITE_AFTER_END","write after end"),v("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),v("ERR_UNKNOWN_ENCODING",function(b){return"Unknown encoding: "+b},TypeError),v("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),fe.exports.codes=x},35707:function(fe,p,x){"use strict";var v=x(85409),T=Object.keys||function(S){var k=[];for(var B in S)k.push(B);return k};fe.exports=w;var C=x(23033),I=x(92553);x(91193)(w,C);for(var m=T(I.prototype),b=0;b<m.length;b++){var g=m[b];w.prototype[g]||(w.prototype[g]=I.prototype[g])}function w(S){if(!(this instanceof w))return new w(S);C.call(this,S),I.call(this,S),this.allowHalfOpen=!0,S&&(S.readable===!1&&(this.readable=!1),S.writable===!1&&(this.writable=!1),S.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",_)))}Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function _(){this._writableState.ended||v.nextTick(A,this)}function A(S){S.end()}Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(k){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=k,this._writableState.destroyed=k)}})},75271:function(fe,p,x){"use strict";fe.exports=T;var v=x(50141);x(91193)(T,v);function T(C){if(!(this instanceof T))return new T(C);v.call(this,C)}T.prototype._transform=function(C,I,m){m(null,C)}},23033:function(fe,p,x){"use strict";var v=x(85409);fe.exports=N;var T;N.ReadableState=re;var C=x(80381).EventEmitter,I=function(Xe,ct){return Xe.listeners(ct).length},m=x(82534),b=x(36533).Buffer,g=(typeof x.g<"u"?x.g:window).Uint8Array||function(){};function w(ft){return b.from(ft)}function _(ft){return b.isBuffer(ft)||ft instanceof g}var A=x(49132),S;A&&A.debuglog?S=A.debuglog("stream"):S=function(){};var k=x(70020),B=x(50917),O=x(65750),L=O.getHighWaterMark,D=x(20289).codes,W=D.ERR_INVALID_ARG_TYPE,H=D.ERR_STREAM_PUSH_AFTER_EOF,G=D.ERR_METHOD_NOT_IMPLEMENTED,Z=D.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Q,ie,le;x(91193)(N,m);var be=B.errorOrDestroy,we=["error","close","destroy","pause","resume"];function Ae(ft,Xe,ct){if(typeof ft.prependListener=="function")return ft.prependListener(Xe,ct);!ft._events||!ft._events[Xe]?ft.on(Xe,ct):Array.isArray(ft._events[Xe])?ft._events[Xe].unshift(ct):ft._events[Xe]=[ct,ft._events[Xe]]}function re(ft,Xe,ct){T=T||x(35707),ft=ft||{},typeof ct!="boolean"&&(ct=Xe instanceof T),this.objectMode=!!ft.objectMode,ct&&(this.objectMode=this.objectMode||!!ft.readableObjectMode),this.highWaterMark=L(this,ft,"readableHighWaterMark",ct),this.buffer=new k,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=ft.emitClose!==!1,this.autoDestroy=!!ft.autoDestroy,this.destroyed=!1,this.defaultEncoding=ft.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ft.encoding&&(Q||(Q=x(86704).StringDecoder),this.decoder=new Q(ft.encoding),this.encoding=ft.encoding)}function N(ft){if(T=T||x(35707),!(this instanceof N))return new N(ft);var Xe=this instanceof T;this._readableState=new re(ft,this,Xe),this.readable=!0,ft&&(typeof ft.read=="function"&&(this._read=ft.read),typeof ft.destroy=="function"&&(this._destroy=ft.destroy)),m.call(this)}Object.defineProperty(N.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Xe){this._readableState&&(this._readableState.destroyed=Xe)}}),N.prototype.destroy=B.destroy,N.prototype._undestroy=B.undestroy,N.prototype._destroy=function(ft,Xe){Xe(ft)},N.prototype.push=function(ft,Xe){var ct=this._readableState,wt;return ct.objectMode?wt=!0:typeof ft=="string"&&(Xe=Xe||ct.defaultEncoding,Xe!==ct.encoding&&(ft=b.from(ft,Xe),Xe=""),wt=!0),z(this,ft,Xe,!1,wt)},N.prototype.unshift=function(ft){return z(this,ft,null,!0,!1)};function z(ft,Xe,ct,wt,Rt){S("readableAddChunk",Xe);var Ge=ft._readableState;if(Xe===null)Ge.reading=!1,J(ft,Ge);else{var zt;if(Rt||(zt=U(Ge,Xe)),zt)be(ft,zt);else if(Ge.objectMode||Xe&&Xe.length>0)if(typeof Xe!="string"&&!Ge.objectMode&&Object.getPrototypeOf(Xe)!==b.prototype&&(Xe=w(Xe)),wt)Ge.endEmitted?be(ft,new Z):V(ft,Ge,Xe,!0);else if(Ge.ended)be(ft,new H);else{if(Ge.destroyed)return!1;Ge.reading=!1,Ge.decoder&&!ct?(Xe=Ge.decoder.write(Xe),Ge.objectMode||Xe.length!==0?V(ft,Ge,Xe,!1):de(ft,Ge)):V(ft,Ge,Xe,!1)}else wt||(Ge.reading=!1,de(ft,Ge))}return!Ge.ended&&(Ge.length<Ge.highWaterMark||Ge.length===0)}function V(ft,Xe,ct,wt){Xe.flowing&&Xe.length===0&&!Xe.sync?(Xe.awaitDrain=0,ft.emit("data",ct)):(Xe.length+=Xe.objectMode?1:ct.length,wt?Xe.buffer.unshift(ct):Xe.buffer.push(ct),Xe.needReadable&&F(ft)),de(ft,Xe)}function U(ft,Xe){var ct;return!_(Xe)&&typeof Xe!="string"&&Xe!==void 0&&!ft.objectMode&&(ct=new W("chunk",["string","Buffer","Uint8Array"],Xe)),ct}N.prototype.isPaused=function(){return this._readableState.flowing===!1},N.prototype.setEncoding=function(ft){Q||(Q=x(86704).StringDecoder);var Xe=new Q(ft);this._readableState.decoder=Xe,this._readableState.encoding=this._readableState.decoder.encoding;for(var ct=this._readableState.buffer.head,wt="";ct!==null;)wt+=Xe.write(ct.data),ct=ct.next;return this._readableState.buffer.clear(),wt!==""&&this._readableState.buffer.push(wt),this._readableState.length=wt.length,this};var j=1073741824;function $(ft){return ft>=j?ft=j:(ft--,ft|=ft>>>1,ft|=ft>>>2,ft|=ft>>>4,ft|=ft>>>8,ft|=ft>>>16,ft++),ft}function ee(ft,Xe){return ft<=0||Xe.length===0&&Xe.ended?0:Xe.objectMode?1:ft!==ft?Xe.flowing&&Xe.length?Xe.buffer.head.data.length:Xe.length:(ft>Xe.highWaterMark&&(Xe.highWaterMark=$(ft)),ft<=Xe.length?ft:Xe.ended?Xe.length:(Xe.needReadable=!0,0))}N.prototype.read=function(ft){S("read",ft),ft=parseInt(ft,10);var Xe=this._readableState,ct=ft;if(ft!==0&&(Xe.emittedReadable=!1),ft===0&&Xe.needReadable&&((Xe.highWaterMark!==0?Xe.length>=Xe.highWaterMark:Xe.length>0)||Xe.ended))return S("read: emitReadable",Xe.length,Xe.ended),Xe.length===0&&Xe.ended?_t(this):F(this),null;if(ft=ee(ft,Xe),ft===0&&Xe.ended)return Xe.length===0&&_t(this),null;var wt=Xe.needReadable;S("need readable",wt),(Xe.length===0||Xe.length-ft<Xe.highWaterMark)&&(wt=!0,S("length less than watermark",wt)),Xe.ended||Xe.reading?(wt=!1,S("reading or ended",wt)):wt&&(S("do read"),Xe.reading=!0,Xe.sync=!0,Xe.length===0&&(Xe.needReadable=!0),this._read(Xe.highWaterMark),Xe.sync=!1,Xe.reading||(ft=ee(ct,Xe)));var Rt;return ft>0?Rt=ze(ft,Xe):Rt=null,Rt===null?(Xe.needReadable=Xe.length<=Xe.highWaterMark,ft=0):(Xe.length-=ft,Xe.awaitDrain=0),Xe.length===0&&(Xe.ended||(Xe.needReadable=!0),ct!==ft&&Xe.ended&&_t(this)),Rt!==null&&this.emit("data",Rt),Rt};function J(ft,Xe){if(S("onEofChunk"),!Xe.ended){if(Xe.decoder){var ct=Xe.decoder.end();ct&&ct.length&&(Xe.buffer.push(ct),Xe.length+=Xe.objectMode?1:ct.length)}Xe.ended=!0,Xe.sync?F(ft):(Xe.needReadable=!1,Xe.emittedReadable||(Xe.emittedReadable=!0,X(ft)))}}function F(ft){var Xe=ft._readableState;S("emitReadable",Xe.needReadable,Xe.emittedReadable),Xe.needReadable=!1,Xe.emittedReadable||(S("emitReadable",Xe.flowing),Xe.emittedReadable=!0,v.nextTick(X,ft))}function X(ft){var Xe=ft._readableState;S("emitReadable_",Xe.destroyed,Xe.length,Xe.ended),!Xe.destroyed&&(Xe.length||Xe.ended)&&(ft.emit("readable"),Xe.emittedReadable=!1),Xe.needReadable=!Xe.flowing&&!Xe.ended&&Xe.length<=Xe.highWaterMark,Re(ft)}function de(ft,Xe){Xe.readingMore||(Xe.readingMore=!0,v.nextTick(Y,ft,Xe))}function Y(ft,Xe){for(;!Xe.reading&&!Xe.ended&&(Xe.length<Xe.highWaterMark||Xe.flowing&&Xe.length===0);){var ct=Xe.length;if(S("maybeReadMore read 0"),ft.read(0),ct===Xe.length)break}Xe.readingMore=!1}N.prototype._read=function(ft){be(this,new G("_read()"))},N.prototype.pipe=function(ft,Xe){var ct=this,wt=this._readableState;switch(wt.pipesCount){case 0:wt.pipes=ft;break;case 1:wt.pipes=[wt.pipes,ft];break;default:wt.pipes.push(ft);break}wt.pipesCount+=1,S("pipe count=%d opts=%j",wt.pipesCount,Xe);var Rt=(!Xe||Xe.end!==!1)&&ft!==v.stdout&&ft!==v.stderr,Ge=Rt?Ft:ye;wt.endEmitted?v.nextTick(Ge):ct.once("end",Ge),ft.on("unpipe",zt);function zt(Ee,me){S("onunpipe"),Ee===ct&&me&&me.hasUnpiped===!1&&(me.hasUnpiped=!0,dt())}function Ft(){S("onend"),ft.end()}var tt=ce(ct);ft.on("drain",tt);var qe=!1;function dt(){S("cleanup"),ft.removeListener("close",se),ft.removeListener("finish",oe),ft.removeListener("drain",tt),ft.removeListener("error",He),ft.removeListener("unpipe",zt),ct.removeListener("end",Ft),ct.removeListener("end",ye),ct.removeListener("data",De),qe=!0,wt.awaitDrain&&(!ft._writableState||ft._writableState.needDrain)&&tt()}ct.on("data",De);function De(Ee){S("ondata");var me=ft.write(Ee);S("dest.write",me),me===!1&&((wt.pipesCount===1&&wt.pipes===ft||wt.pipesCount>1&&$t(wt.pipes,ft)!==-1)&&!qe&&(S("false write response, pause",wt.awaitDrain),wt.awaitDrain++),ct.pause())}function He(Ee){S("onerror",Ee),ye(),ft.removeListener("error",He),I(ft,"error")===0&&be(ft,Ee)}Ae(ft,"error",He);function se(){ft.removeListener("finish",oe),ye()}ft.once("close",se);function oe(){S("onfinish"),ft.removeListener("close",se),ye()}ft.once("finish",oe);function ye(){S("unpipe"),ct.unpipe(ft)}return ft.emit("pipe",ct),wt.flowing||(S("pipe resume"),ct.resume()),ft};function ce(ft){return function(){var ct=ft._readableState;S("pipeOnDrain",ct.awaitDrain),ct.awaitDrain&&ct.awaitDrain--,ct.awaitDrain===0&&I(ft,"data")&&(ct.flowing=!0,Re(ft))}}N.prototype.unpipe=function(ft){var Xe=this._readableState,ct={hasUnpiped:!1};if(Xe.pipesCount===0)return this;if(Xe.pipesCount===1)return ft&&ft!==Xe.pipes?this:(ft||(ft=Xe.pipes),Xe.pipes=null,Xe.pipesCount=0,Xe.flowing=!1,ft&&ft.emit("unpipe",this,ct),this);if(!ft){var wt=Xe.pipes,Rt=Xe.pipesCount;Xe.pipes=null,Xe.pipesCount=0,Xe.flowing=!1;for(var Ge=0;Ge<Rt;Ge++)wt[Ge].emit("unpipe",this,{hasUnpiped:!1});return this}var zt=$t(Xe.pipes,ft);return zt===-1?this:(Xe.pipes.splice(zt,1),Xe.pipesCount-=1,Xe.pipesCount===1&&(Xe.pipes=Xe.pipes[0]),ft.emit("unpipe",this,ct),this)},N.prototype.on=function(ft,Xe){var ct=m.prototype.on.call(this,ft,Xe),wt=this._readableState;return ft==="data"?(wt.readableListening=this.listenerCount("readable")>0,wt.flowing!==!1&&this.resume()):ft==="readable"&&!wt.endEmitted&&!wt.readableListening&&(wt.readableListening=wt.needReadable=!0,wt.flowing=!1,wt.emittedReadable=!1,S("on readable",wt.length,wt.reading),wt.length?F(this):wt.reading||v.nextTick(Ie,this)),ct},N.prototype.addListener=N.prototype.on,N.prototype.removeListener=function(ft,Xe){var ct=m.prototype.removeListener.call(this,ft,Xe);return ft==="readable"&&v.nextTick(he,this),ct},N.prototype.removeAllListeners=function(ft){var Xe=m.prototype.removeAllListeners.apply(this,arguments);return(ft==="readable"||ft===void 0)&&v.nextTick(he,this),Xe};function he(ft){var Xe=ft._readableState;Xe.readableListening=ft.listenerCount("readable")>0,Xe.resumeScheduled&&!Xe.paused?Xe.flowing=!0:ft.listenerCount("data")>0&&ft.resume()}function Ie(ft){S("readable nexttick read 0"),ft.read(0)}N.prototype.resume=function(){var ft=this._readableState;return ft.flowing||(S("resume"),ft.flowing=!ft.readableListening,ke(this,ft)),ft.paused=!1,this};function ke(ft,Xe){Xe.resumeScheduled||(Xe.resumeScheduled=!0,v.nextTick(ut,ft,Xe))}function ut(ft,Xe){S("resume",Xe.reading),Xe.reading||ft.read(0),Xe.resumeScheduled=!1,ft.emit("resume"),Re(ft),Xe.flowing&&!Xe.reading&&ft.read(0)}N.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Re(ft){var Xe=ft._readableState;for(S("flow",Xe.flowing);Xe.flowing&&ft.read()!==null;);}N.prototype.wrap=function(ft){var Xe=this,ct=this._readableState,wt=!1;ft.on("end",function(){if(S("wrapped end"),ct.decoder&&!ct.ended){var zt=ct.decoder.end();zt&&zt.length&&Xe.push(zt)}Xe.push(null)}),ft.on("data",function(zt){if(S("wrapped data"),ct.decoder&&(zt=ct.decoder.write(zt)),!(ct.objectMode&&zt==null)&&!(!ct.objectMode&&(!zt||!zt.length))){var Ft=Xe.push(zt);Ft||(wt=!0,ft.pause())}});for(var Rt in ft)this[Rt]===void 0&&typeof ft[Rt]=="function"&&(this[Rt]=function(Ft){return function(){return ft[Ft].apply(ft,arguments)}}(Rt));for(var Ge=0;Ge<we.length;Ge++)ft.on(we[Ge],this.emit.bind(this,we[Ge]));return this._read=function(zt){S("wrapped _read",zt),wt&&(wt=!1,ft.resume())},this},typeof Symbol=="function"&&(N.prototype[Symbol.asyncIterator]=function(){return ie===void 0&&(ie=x(39536)),ie(this)}),Object.defineProperty(N.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(N.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(N.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Xe){this._readableState&&(this._readableState.flowing=Xe)}}),N._fromList=ze,Object.defineProperty(N.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ze(ft,Xe){if(Xe.length===0)return null;var ct;return Xe.objectMode?ct=Xe.buffer.shift():!ft||ft>=Xe.length?(Xe.decoder?ct=Xe.buffer.join(""):Xe.buffer.length===1?ct=Xe.buffer.first():ct=Xe.buffer.concat(Xe.length),Xe.buffer.clear()):ct=Xe.buffer.consume(ft,Xe.decoder),ct}function _t(ft){var Xe=ft._readableState;S("endReadable",Xe.endEmitted),Xe.endEmitted||(Xe.ended=!0,v.nextTick(Ct,Xe,ft))}function Ct(ft,Xe){if(S("endReadableNT",ft.endEmitted,ft.length),!ft.endEmitted&&ft.length===0&&(ft.endEmitted=!0,Xe.readable=!1,Xe.emit("end"),ft.autoDestroy)){var ct=Xe._writableState;(!ct||ct.autoDestroy&&ct.finished)&&Xe.destroy()}}typeof Symbol=="function"&&(N.from=function(ft,Xe){return le===void 0&&(le=x(34918)),le(N,ft,Xe)});function $t(ft,Xe){for(var ct=0,wt=ft.length;ct<wt;ct++)if(ft[ct]===Xe)return ct;return-1}},50141:function(fe,p,x){"use strict";fe.exports=w;var v=x(20289).codes,T=v.ERR_METHOD_NOT_IMPLEMENTED,C=v.ERR_MULTIPLE_CALLBACK,I=v.ERR_TRANSFORM_ALREADY_TRANSFORMING,m=v.ERR_TRANSFORM_WITH_LENGTH_0,b=x(35707);x(91193)(w,b);function g(S,k){var B=this._transformState;B.transforming=!1;var O=B.writecb;if(O===null)return this.emit("error",new C);B.writechunk=null,B.writecb=null,k!=null&&this.push(k),O(S);var L=this._readableState;L.reading=!1,(L.needReadable||L.length<L.highWaterMark)&&this._read(L.highWaterMark)}function w(S){if(!(this instanceof w))return new w(S);b.call(this,S),this._transformState={afterTransform:g.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,S&&(typeof S.transform=="function"&&(this._transform=S.transform),typeof S.flush=="function"&&(this._flush=S.flush)),this.on("prefinish",_)}function _(){var S=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(k,B){A(S,k,B)}):A(this,null,null)}w.prototype.push=function(S,k){return this._transformState.needTransform=!1,b.prototype.push.call(this,S,k)},w.prototype._transform=function(S,k,B){B(new T("_transform()"))},w.prototype._write=function(S,k,B){var O=this._transformState;if(O.writecb=B,O.writechunk=S,O.writeencoding=k,!O.transforming){var L=this._readableState;(O.needTransform||L.needReadable||L.length<L.highWaterMark)&&this._read(L.highWaterMark)}},w.prototype._read=function(S){var k=this._transformState;k.writechunk!==null&&!k.transforming?(k.transforming=!0,this._transform(k.writechunk,k.writeencoding,k.afterTransform)):k.needTransform=!0},w.prototype._destroy=function(S,k){b.prototype._destroy.call(this,S,function(B){k(B)})};function A(S,k,B){if(k)return S.emit("error",k);if(B!=null&&S.push(B),S._writableState.length)throw new m;if(S._transformState.transforming)throw new I;return S.push(null)}},92553:function(fe,p,x){"use strict";var v=x(85409);fe.exports=re;function T(Re,ze,_t){this.chunk=Re,this.encoding=ze,this.callback=_t,this.next=null}function C(Re){var ze=this;this.next=null,this.entry=null,this.finish=function(){ut(ze,Re)}}var I;re.WritableState=we;var m={deprecate:x(91947)},b=x(82534),g=x(36533).Buffer,w=(typeof x.g<"u"?x.g:window).Uint8Array||function(){};function _(Re){return g.from(Re)}function A(Re){return g.isBuffer(Re)||Re instanceof w}var S=x(50917),k=x(65750),B=k.getHighWaterMark,O=x(20289).codes,L=O.ERR_INVALID_ARG_TYPE,D=O.ERR_METHOD_NOT_IMPLEMENTED,W=O.ERR_MULTIPLE_CALLBACK,H=O.ERR_STREAM_CANNOT_PIPE,G=O.ERR_STREAM_DESTROYED,Z=O.ERR_STREAM_NULL_VALUES,Q=O.ERR_STREAM_WRITE_AFTER_END,ie=O.ERR_UNKNOWN_ENCODING,le=S.errorOrDestroy;x(91193)(re,b);function be(){}function we(Re,ze,_t){I=I||x(35707),Re=Re||{},typeof _t!="boolean"&&(_t=ze instanceof I),this.objectMode=!!Re.objectMode,_t&&(this.objectMode=this.objectMode||!!Re.writableObjectMode),this.highWaterMark=B(this,Re,"writableHighWaterMark",_t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Ct=Re.decodeStrings===!1;this.decodeStrings=!Ct,this.defaultEncoding=Re.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function($t){J(ze,$t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Re.emitClose!==!1,this.autoDestroy=!!Re.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new C(this)}we.prototype.getBuffer=function(){for(var ze=this.bufferedRequest,_t=[];ze;)_t.push(ze),ze=ze.next;return _t},function(){try{Object.defineProperty(we.prototype,"buffer",{get:m.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Ae;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Ae=Function.prototype[Symbol.hasInstance],Object.defineProperty(re,Symbol.hasInstance,{value:function(ze){return Ae.call(this,ze)?!0:this!==re?!1:ze&&ze._writableState instanceof we}})):Ae=function(ze){return ze instanceof this};function re(Re){I=I||x(35707);var ze=this instanceof I;if(!ze&&!Ae.call(re,this))return new re(Re);this._writableState=new we(Re,this,ze),this.writable=!0,Re&&(typeof Re.write=="function"&&(this._write=Re.write),typeof Re.writev=="function"&&(this._writev=Re.writev),typeof Re.destroy=="function"&&(this._destroy=Re.destroy),typeof Re.final=="function"&&(this._final=Re.final)),b.call(this)}re.prototype.pipe=function(){le(this,new H)};function N(Re,ze){var _t=new Q;le(Re,_t),v.nextTick(ze,_t)}function z(Re,ze,_t,Ct){var $t;return _t===null?$t=new Z:typeof _t!="string"&&!ze.objectMode&&($t=new L("chunk",["string","Buffer"],_t)),$t?(le(Re,$t),v.nextTick(Ct,$t),!1):!0}re.prototype.write=function(Re,ze,_t){var Ct=this._writableState,$t=!1,ft=!Ct.objectMode&&A(Re);return ft&&!g.isBuffer(Re)&&(Re=_(Re)),typeof ze=="function"&&(_t=ze,ze=null),ft?ze="buffer":ze||(ze=Ct.defaultEncoding),typeof _t!="function"&&(_t=be),Ct.ending?N(this,_t):(ft||z(this,Ct,Re,_t))&&(Ct.pendingcb++,$t=U(this,Ct,ft,Re,ze,_t)),$t},re.prototype.cork=function(){this._writableState.corked++},re.prototype.uncork=function(){var Re=this._writableState;Re.corked&&(Re.corked--,!Re.writing&&!Re.corked&&!Re.bufferProcessing&&Re.bufferedRequest&&de(this,Re))},re.prototype.setDefaultEncoding=function(ze){if(typeof ze=="string"&&(ze=ze.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ze+"").toLowerCase())>-1))throw new ie(ze);return this._writableState.defaultEncoding=ze,this},Object.defineProperty(re.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function V(Re,ze,_t){return!Re.objectMode&&Re.decodeStrings!==!1&&typeof ze=="string"&&(ze=g.from(ze,_t)),ze}Object.defineProperty(re.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function U(Re,ze,_t,Ct,$t,ft){if(!_t){var Xe=V(ze,Ct,$t);Ct!==Xe&&(_t=!0,$t="buffer",Ct=Xe)}var ct=ze.objectMode?1:Ct.length;ze.length+=ct;var wt=ze.length<ze.highWaterMark;if(wt||(ze.needDrain=!0),ze.writing||ze.corked){var Rt=ze.lastBufferedRequest;ze.lastBufferedRequest={chunk:Ct,encoding:$t,isBuf:_t,callback:ft,next:null},Rt?Rt.next=ze.lastBufferedRequest:ze.bufferedRequest=ze.lastBufferedRequest,ze.bufferedRequestCount+=1}else j(Re,ze,!1,ct,Ct,$t,ft);return wt}function j(Re,ze,_t,Ct,$t,ft,Xe){ze.writelen=Ct,ze.writecb=Xe,ze.writing=!0,ze.sync=!0,ze.destroyed?ze.onwrite(new G("write")):_t?Re._writev($t,ze.onwrite):Re._write($t,ft,ze.onwrite),ze.sync=!1}function $(Re,ze,_t,Ct,$t){--ze.pendingcb,_t?(v.nextTick($t,Ct),v.nextTick(Ie,Re,ze),Re._writableState.errorEmitted=!0,le(Re,Ct)):($t(Ct),Re._writableState.errorEmitted=!0,le(Re,Ct),Ie(Re,ze))}function ee(Re){Re.writing=!1,Re.writecb=null,Re.length-=Re.writelen,Re.writelen=0}function J(Re,ze){var _t=Re._writableState,Ct=_t.sync,$t=_t.writecb;if(typeof $t!="function")throw new W;if(ee(_t),ze)$(Re,_t,Ct,ze,$t);else{var ft=Y(_t)||Re.destroyed;!ft&&!_t.corked&&!_t.bufferProcessing&&_t.bufferedRequest&&de(Re,_t),Ct?v.nextTick(F,Re,_t,ft,$t):F(Re,_t,ft,$t)}}function F(Re,ze,_t,Ct){_t||X(Re,ze),ze.pendingcb--,Ct(),Ie(Re,ze)}function X(Re,ze){ze.length===0&&ze.needDrain&&(ze.needDrain=!1,Re.emit("drain"))}function de(Re,ze){ze.bufferProcessing=!0;var _t=ze.bufferedRequest;if(Re._writev&&_t&&_t.next){var Ct=ze.bufferedRequestCount,$t=new Array(Ct),ft=ze.corkedRequestsFree;ft.entry=_t;for(var Xe=0,ct=!0;_t;)$t[Xe]=_t,_t.isBuf||(ct=!1),_t=_t.next,Xe+=1;$t.allBuffers=ct,j(Re,ze,!0,ze.length,$t,"",ft.finish),ze.pendingcb++,ze.lastBufferedRequest=null,ft.next?(ze.corkedRequestsFree=ft.next,ft.next=null):ze.corkedRequestsFree=new C(ze),ze.bufferedRequestCount=0}else{for(;_t;){var wt=_t.chunk,Rt=_t.encoding,Ge=_t.callback,zt=ze.objectMode?1:wt.length;if(j(Re,ze,!1,zt,wt,Rt,Ge),_t=_t.next,ze.bufferedRequestCount--,ze.writing)break}_t===null&&(ze.lastBufferedRequest=null)}ze.bufferedRequest=_t,ze.bufferProcessing=!1}re.prototype._write=function(Re,ze,_t){_t(new D("_write()"))},re.prototype._writev=null,re.prototype.end=function(Re,ze,_t){var Ct=this._writableState;return typeof Re=="function"?(_t=Re,Re=null,ze=null):typeof ze=="function"&&(_t=ze,ze=null),Re!=null&&this.write(Re,ze),Ct.corked&&(Ct.corked=1,this.uncork()),Ct.ending||ke(this,Ct,_t),this},Object.defineProperty(re.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Y(Re){return Re.ending&&Re.length===0&&Re.bufferedRequest===null&&!Re.finished&&!Re.writing}function ce(Re,ze){Re._final(function(_t){ze.pendingcb--,_t&&le(Re,_t),ze.prefinished=!0,Re.emit("prefinish"),Ie(Re,ze)})}function he(Re,ze){!ze.prefinished&&!ze.finalCalled&&(typeof Re._final=="function"&&!ze.destroyed?(ze.pendingcb++,ze.finalCalled=!0,v.nextTick(ce,Re,ze)):(ze.prefinished=!0,Re.emit("prefinish")))}function Ie(Re,ze){var _t=Y(ze);if(_t&&(he(Re,ze),ze.pendingcb===0&&(ze.finished=!0,Re.emit("finish"),ze.autoDestroy))){var Ct=Re._readableState;(!Ct||Ct.autoDestroy&&Ct.endEmitted)&&Re.destroy()}return _t}function ke(Re,ze,_t){ze.ending=!0,Ie(Re,ze),_t&&(ze.finished?v.nextTick(_t):Re.once("finish",_t)),ze.ended=!0,Re.writable=!1}function ut(Re,ze,_t){var Ct=Re.entry;for(Re.entry=null;Ct;){var $t=Ct.callback;ze.pendingcb--,$t(_t),Ct=Ct.next}ze.corkedRequestsFree.next=Re}Object.defineProperty(re.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ze){this._writableState&&(this._writableState.destroyed=ze)}}),re.prototype.destroy=S.destroy,re.prototype._undestroy=S.undestroy,re.prototype._destroy=function(Re,ze){ze(Re)}},39536:function(fe,p,x){"use strict";var v=x(85409),T;function C(Q,ie,le){return ie=I(ie),ie in Q?Object.defineProperty(Q,ie,{value:le,enumerable:!0,configurable:!0,writable:!0}):Q[ie]=le,Q}function I(Q){var ie=m(Q,"string");return typeof ie=="symbol"?ie:String(ie)}function m(Q,ie){if(typeof Q!="object"||Q===null)return Q;var le=Q[Symbol.toPrimitive];if(le!==void 0){var be=le.call(Q,ie||"default");if(typeof be!="object")return be;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ie==="string"?String:Number)(Q)}var b=x(32339),g=Symbol("lastResolve"),w=Symbol("lastReject"),_=Symbol("error"),A=Symbol("ended"),S=Symbol("lastPromise"),k=Symbol("handlePromise"),B=Symbol("stream");function O(Q,ie){return{value:Q,done:ie}}function L(Q){var ie=Q[g];if(ie!==null){var le=Q[B].read();le!==null&&(Q[S]=null,Q[g]=null,Q[w]=null,ie(O(le,!1)))}}function D(Q){v.nextTick(L,Q)}function W(Q,ie){return function(le,be){Q.then(function(){if(ie[A]){le(O(void 0,!0));return}ie[k](le,be)},be)}}var H=Object.getPrototypeOf(function(){}),G=Object.setPrototypeOf((T={get stream(){return this[B]},next:function(){var ie=this,le=this[_];if(le!==null)return Promise.reject(le);if(this[A])return Promise.resolve(O(void 0,!0));if(this[B].destroyed)return new Promise(function(re,N){v.nextTick(function(){ie[_]?N(ie[_]):re(O(void 0,!0))})});var be=this[S],we;if(be)we=new Promise(W(be,this));else{var Ae=this[B].read();if(Ae!==null)return Promise.resolve(O(Ae,!1));we=new Promise(this[k])}return this[S]=we,we}},C(T,Symbol.asyncIterator,function(){return this}),C(T,"return",function(){var ie=this;return new Promise(function(le,be){ie[B].destroy(null,function(we){if(we){be(we);return}le(O(void 0,!0))})})}),T),H),Z=function(ie){var le,be=Object.create(G,(le={},C(le,B,{value:ie,writable:!0}),C(le,g,{value:null,writable:!0}),C(le,w,{value:null,writable:!0}),C(le,_,{value:null,writable:!0}),C(le,A,{value:ie._readableState.endEmitted,writable:!0}),C(le,k,{value:function(Ae,re){var N=be[B].read();N?(be[S]=null,be[g]=null,be[w]=null,Ae(O(N,!1))):(be[g]=Ae,be[w]=re)},writable:!0}),le));return be[S]=null,b(ie,function(we){if(we&&we.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Ae=be[w];Ae!==null&&(be[S]=null,be[g]=null,be[w]=null,Ae(we)),be[_]=we;return}var re=be[g];re!==null&&(be[S]=null,be[g]=null,be[w]=null,re(O(void 0,!0))),be[A]=!0}),ie.on("readable",D.bind(null,be)),be};fe.exports=Z},70020:function(fe,p,x){"use strict";function v(L,D){var W=Object.keys(L);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(L);D&&(H=H.filter(function(G){return Object.getOwnPropertyDescriptor(L,G).enumerable})),W.push.apply(W,H)}return W}function T(L){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{};D%2?v(Object(W),!0).forEach(function(H){C(L,H,W[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(L,Object.getOwnPropertyDescriptors(W)):v(Object(W)).forEach(function(H){Object.defineProperty(L,H,Object.getOwnPropertyDescriptor(W,H))})}return L}function C(L,D,W){return D=g(D),D in L?Object.defineProperty(L,D,{value:W,enumerable:!0,configurable:!0,writable:!0}):L[D]=W,L}function I(L,D){if(!(L instanceof D))throw new TypeError("Cannot call a class as a function")}function m(L,D){for(var W=0;W<D.length;W++){var H=D[W];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(L,g(H.key),H)}}function b(L,D,W){return D&&m(L.prototype,D),W&&m(L,W),Object.defineProperty(L,"prototype",{writable:!1}),L}function g(L){var D=w(L,"string");return typeof D=="symbol"?D:String(D)}function w(L,D){if(typeof L!="object"||L===null)return L;var W=L[Symbol.toPrimitive];if(W!==void 0){var H=W.call(L,D||"default");if(typeof H!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)(L)}var _=x(36533),A=_.Buffer,S=x(20352),k=S.inspect,B=k&&k.custom||"inspect";function O(L,D,W){A.prototype.copy.call(L,D,W)}fe.exports=function(){function L(){I(this,L),this.head=null,this.tail=null,this.length=0}return b(L,[{key:"push",value:function(W){var H={data:W,next:null};this.length>0?this.tail.next=H:this.head=H,this.tail=H,++this.length}},{key:"unshift",value:function(W){var H={data:W,next:this.head};this.length===0&&(this.tail=H),this.head=H,++this.length}},{key:"shift",value:function(){if(this.length!==0){var W=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,W}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(W){if(this.length===0)return"";for(var H=this.head,G=""+H.data;H=H.next;)G+=W+H.data;return G}},{key:"concat",value:function(W){if(this.length===0)return A.alloc(0);for(var H=A.allocUnsafe(W>>>0),G=this.head,Z=0;G;)O(G.data,H,Z),Z+=G.data.length,G=G.next;return H}},{key:"consume",value:function(W,H){var G;return W<this.head.data.length?(G=this.head.data.slice(0,W),this.head.data=this.head.data.slice(W)):W===this.head.data.length?G=this.shift():G=H?this._getString(W):this._getBuffer(W),G}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(W){var H=this.head,G=1,Z=H.data;for(W-=Z.length;H=H.next;){var Q=H.data,ie=W>Q.length?Q.length:W;if(ie===Q.length?Z+=Q:Z+=Q.slice(0,W),W-=ie,W===0){ie===Q.length?(++G,H.next?this.head=H.next:this.head=this.tail=null):(this.head=H,H.data=Q.slice(ie));break}++G}return this.length-=G,Z}},{key:"_getBuffer",value:function(W){var H=A.allocUnsafe(W),G=this.head,Z=1;for(G.data.copy(H),W-=G.data.length;G=G.next;){var Q=G.data,ie=W>Q.length?Q.length:W;if(Q.copy(H,H.length-W,0,ie),W-=ie,W===0){ie===Q.length?(++Z,G.next?this.head=G.next:this.head=this.tail=null):(this.head=G,G.data=Q.slice(ie));break}++Z}return this.length-=Z,H}},{key:B,value:function(W,H){return k(this,T(T({},H),{},{depth:0,customInspect:!1}))}}]),L}()},50917:function(fe,p,x){"use strict";var v=x(85409);function T(w,_){var A=this,S=this._readableState&&this._readableState.destroyed,k=this._writableState&&this._writableState.destroyed;return S||k?(_?_(w):w&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,v.nextTick(b,this,w)):v.nextTick(b,this,w)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(w||null,function(B){!_&&B?A._writableState?A._writableState.errorEmitted?v.nextTick(I,A):(A._writableState.errorEmitted=!0,v.nextTick(C,A,B)):v.nextTick(C,A,B):_?(v.nextTick(I,A),_(B)):v.nextTick(I,A)}),this)}function C(w,_){b(w,_),I(w)}function I(w){w._writableState&&!w._writableState.emitClose||w._readableState&&!w._readableState.emitClose||w.emit("close")}function m(){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 b(w,_){w.emit("error",_)}function g(w,_){var A=w._readableState,S=w._writableState;A&&A.autoDestroy||S&&S.autoDestroy?w.destroy(_):w.emit("error",_)}fe.exports={destroy:T,undestroy:m,errorOrDestroy:g}},32339:function(fe,p,x){"use strict";var v=x(20289).codes.ERR_STREAM_PREMATURE_CLOSE;function T(b){var g=!1;return function(){if(!g){g=!0;for(var w=arguments.length,_=new Array(w),A=0;A<w;A++)_[A]=arguments[A];b.apply(this,_)}}}function C(){}function I(b){return b.setHeader&&typeof b.abort=="function"}function m(b,g,w){if(typeof g=="function")return m(b,null,g);g||(g={}),w=T(w||C);var _=g.readable||g.readable!==!1&&b.readable,A=g.writable||g.writable!==!1&&b.writable,S=function(){b.writable||B()},k=b._writableState&&b._writableState.finished,B=function(){A=!1,k=!0,_||w.call(b)},O=b._readableState&&b._readableState.endEmitted,L=function(){_=!1,O=!0,A||w.call(b)},D=function(Z){w.call(b,Z)},W=function(){var Z;if(_&&!O)return(!b._readableState||!b._readableState.ended)&&(Z=new v),w.call(b,Z);if(A&&!k)return(!b._writableState||!b._writableState.ended)&&(Z=new v),w.call(b,Z)},H=function(){b.req.on("finish",B)};return I(b)?(b.on("complete",B),b.on("abort",W),b.req?H():b.on("request",H)):A&&!b._writableState&&(b.on("end",S),b.on("close",S)),b.on("end",L),b.on("finish",B),g.error!==!1&&b.on("error",D),b.on("close",W),function(){b.removeListener("complete",B),b.removeListener("abort",W),b.removeListener("request",H),b.req&&b.req.removeListener("finish",B),b.removeListener("end",S),b.removeListener("close",S),b.removeListener("finish",B),b.removeListener("end",L),b.removeListener("error",D),b.removeListener("close",W)}}fe.exports=m},34918:function(fe){fe.exports=function(){throw new Error("Readable.from is not available in the browser")}},35481:function(fe,p,x){"use strict";var v;function T(B){var O=!1;return function(){O||(O=!0,B.apply(void 0,arguments))}}var C=x(20289).codes,I=C.ERR_MISSING_ARGS,m=C.ERR_STREAM_DESTROYED;function b(B){if(B)throw B}function g(B){return B.setHeader&&typeof B.abort=="function"}function w(B,O,L,D){D=T(D);var W=!1;B.on("close",function(){W=!0}),v===void 0&&(v=x(32339)),v(B,{readable:O,writable:L},function(G){if(G)return D(G);W=!0,D()});var H=!1;return function(G){if(!W&&!H){if(H=!0,g(B))return B.abort();if(typeof B.destroy=="function")return B.destroy();D(G||new m("pipe"))}}}function _(B){B()}function A(B,O){return B.pipe(O)}function S(B){return!B.length||typeof B[B.length-1]!="function"?b:B.pop()}function k(){for(var B=arguments.length,O=new Array(B),L=0;L<B;L++)O[L]=arguments[L];var D=S(O);if(Array.isArray(O[0])&&(O=O[0]),O.length<2)throw new I("streams");var W,H=O.map(function(G,Z){var Q=Z<O.length-1,ie=Z>0;return w(G,Q,ie,function(le){W||(W=le),le&&H.forEach(_),!Q&&(H.forEach(_),D(W))})});return O.reduce(A)}fe.exports=k},65750:function(fe,p,x){"use strict";var v=x(20289).codes.ERR_INVALID_OPT_VALUE;function T(I,m,b){return I.highWaterMark!=null?I.highWaterMark:m?I[b]:null}function C(I,m,b,g){var w=T(m,g,b);if(w!=null){if(!(isFinite(w)&&Math.floor(w)===w)||w<0){var _=g?b:"highWaterMark";throw new v(_,w)}return Math.floor(w)}return I.objectMode?16:16384}fe.exports={getHighWaterMark:C}},82534:function(fe,p,x){fe.exports=x(80381).EventEmitter},51094:function(fe,p,x){p=fe.exports=x(23033),p.Stream=p,p.Readable=p,p.Writable=x(92553),p.Duplex=x(35707),p.Transform=x(50141),p.PassThrough=x(75271),p.finished=x(32339),p.pipeline=x(35481)},39212:function(fe){var p=function(x){"use strict";var v=Object.prototype,T=v.hasOwnProperty,C=Object.defineProperty||function($,ee,J){$[ee]=J.value},I,m=typeof Symbol=="function"?Symbol:{},b=m.iterator||"@@iterator",g=m.asyncIterator||"@@asyncIterator",w=m.toStringTag||"@@toStringTag";function _($,ee,J){return Object.defineProperty($,ee,{value:J,enumerable:!0,configurable:!0,writable:!0}),$[ee]}try{_({},"")}catch{_=function(ee,J,F){return ee[J]=F}}function A($,ee,J,F){var X=ee&&ee.prototype instanceof W?ee:W,de=Object.create(X.prototype),Y=new V(F||[]);return C(de,"_invoke",{value:Ae($,J,Y)}),de}x.wrap=A;function S($,ee,J){try{return{type:"normal",arg:$.call(ee,J)}}catch(F){return{type:"throw",arg:F}}}var k="suspendedStart",B="suspendedYield",O="executing",L="completed",D={};function W(){}function H(){}function G(){}var Z={};_(Z,b,function(){return this});var Q=Object.getPrototypeOf,ie=Q&&Q(Q(U([])));ie&&ie!==v&&T.call(ie,b)&&(Z=ie);var le=G.prototype=W.prototype=Object.create(Z);H.prototype=G,C(le,"constructor",{value:G,configurable:!0}),C(G,"constructor",{value:H,configurable:!0}),H.displayName=_(G,w,"GeneratorFunction");function be($){["next","throw","return"].forEach(function(ee){_($,ee,function(J){return this._invoke(ee,J)})})}x.isGeneratorFunction=function($){var ee=typeof $=="function"&&$.constructor;return ee?ee===H||(ee.displayName||ee.name)==="GeneratorFunction":!1},x.mark=function($){return Object.setPrototypeOf?Object.setPrototypeOf($,G):($.__proto__=G,_($,w,"GeneratorFunction")),$.prototype=Object.create(le),$},x.awrap=function($){return{__await:$}};function we($,ee){function J(de,Y,ce,he){var Ie=S($[de],$,Y);if(Ie.type==="throw")he(Ie.arg);else{var ke=Ie.arg,ut=ke.value;return ut&&typeof ut=="object"&&T.call(ut,"__await")?ee.resolve(ut.__await).then(function(Re){J("next",Re,ce,he)},function(Re){J("throw",Re,ce,he)}):ee.resolve(ut).then(function(Re){ke.value=Re,ce(ke)},function(Re){return J("throw",Re,ce,he)})}}var F;function X(de,Y){function ce(){return new ee(function(he,Ie){J(de,Y,he,Ie)})}return F=F?F.then(ce,ce):ce()}C(this,"_invoke",{value:X})}be(we.prototype),_(we.prototype,g,function(){return this}),x.AsyncIterator=we,x.async=function($,ee,J,F,X){X===void 0&&(X=Promise);var de=new we(A($,ee,J,F),X);return x.isGeneratorFunction(ee)?de:de.next().then(function(Y){return Y.done?Y.value:de.next()})};function Ae($,ee,J){var F=k;return function(de,Y){if(F===O)throw new Error("Generator is already running");if(F===L){if(de==="throw")throw Y;return j()}for(J.method=de,J.arg=Y;;){var ce=J.delegate;if(ce){var he=re(ce,J);if(he){if(he===D)continue;return he}}if(J.method==="next")J.sent=J._sent=J.arg;else if(J.method==="throw"){if(F===k)throw F=L,J.arg;J.dispatchException(J.arg)}else J.method==="return"&&J.abrupt("return",J.arg);F=O;var Ie=S($,ee,J);if(Ie.type==="normal"){if(F=J.done?L:B,Ie.arg===D)continue;return{value:Ie.arg,done:J.done}}else Ie.type==="throw"&&(F=L,J.method="throw",J.arg=Ie.arg)}}}function re($,ee){var J=ee.method,F=$.iterator[J];if(F===I)return ee.delegate=null,J==="throw"&&$.iterator.return&&(ee.method="return",ee.arg=I,re($,ee),ee.method==="throw")||J!=="return"&&(ee.method="throw",ee.arg=new TypeError("The iterator does not provide a '"+J+"' method")),D;var X=S(F,$.iterator,ee.arg);if(X.type==="throw")return ee.method="throw",ee.arg=X.arg,ee.delegate=null,D;var de=X.arg;if(!de)return ee.method="throw",ee.arg=new TypeError("iterator result is not an object"),ee.delegate=null,D;if(de.done)ee[$.resultName]=de.value,ee.next=$.nextLoc,ee.method!=="return"&&(ee.method="next",ee.arg=I);else return de;return ee.delegate=null,D}be(le),_(le,w,"Generator"),_(le,b,function(){return this}),_(le,"toString",function(){return"[object Generator]"});function N($){var ee={tryLoc:$[0]};1 in $&&(ee.catchLoc=$[1]),2 in $&&(ee.finallyLoc=$[2],ee.afterLoc=$[3]),this.tryEntries.push(ee)}function z($){var ee=$.completion||{};ee.type="normal",delete ee.arg,$.completion=ee}function V($){this.tryEntries=[{tryLoc:"root"}],$.forEach(N,this),this.reset(!0)}x.keys=function($){var ee=Object($),J=[];for(var F in ee)J.push(F);return J.reverse(),function X(){for(;J.length;){var de=J.pop();if(de in ee)return X.value=de,X.done=!1,X}return X.done=!0,X}};function U($){if($!=null){var ee=$[b];if(ee)return ee.call($);if(typeof $.next=="function")return $;if(!isNaN($.length)){var J=-1,F=function X(){for(;++J<$.length;)if(T.call($,J))return X.value=$[J],X.done=!1,X;return X.value=I,X.done=!0,X};return F.next=F}}throw new TypeError(typeof $+" is not iterable")}x.values=U;function j(){return{value:I,done:!0}}return V.prototype={constructor:V,reset:function($){if(this.prev=0,this.next=0,this.sent=this._sent=I,this.done=!1,this.delegate=null,this.method="next",this.arg=I,this.tryEntries.forEach(z),!$)for(var ee in this)ee.charAt(0)==="t"&&T.call(this,ee)&&!isNaN(+ee.slice(1))&&(this[ee]=I)},stop:function(){this.done=!0;var $=this.tryEntries[0],ee=$.completion;if(ee.type==="throw")throw ee.arg;return this.rval},dispatchException:function($){if(this.done)throw $;var ee=this;function J(he,Ie){return de.type="throw",de.arg=$,ee.next=he,Ie&&(ee.method="next",ee.arg=I),!!Ie}for(var F=this.tryEntries.length-1;F>=0;--F){var X=this.tryEntries[F],de=X.completion;if(X.tryLoc==="root")return J("end");if(X.tryLoc<=this.prev){var Y=T.call(X,"catchLoc"),ce=T.call(X,"finallyLoc");if(Y&&ce){if(this.prev<X.catchLoc)return J(X.catchLoc,!0);if(this.prev<X.finallyLoc)return J(X.finallyLoc)}else if(Y){if(this.prev<X.catchLoc)return J(X.catchLoc,!0)}else if(ce){if(this.prev<X.finallyLoc)return J(X.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function($,ee){for(var J=this.tryEntries.length-1;J>=0;--J){var F=this.tryEntries[J];if(F.tryLoc<=this.prev&&T.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var X=F;break}}X&&($==="break"||$==="continue")&&X.tryLoc<=ee&&ee<=X.finallyLoc&&(X=null);var de=X?X.completion:{};return de.type=$,de.arg=ee,X?(this.method="next",this.next=X.finallyLoc,D):this.complete(de)},complete:function($,ee){if($.type==="throw")throw $.arg;return $.type==="break"||$.type==="continue"?this.next=$.arg:$.type==="return"?(this.rval=this.arg=$.arg,this.method="return",this.next="end"):$.type==="normal"&&ee&&(this.next=ee),D},finish:function($){for(var ee=this.tryEntries.length-1;ee>=0;--ee){var J=this.tryEntries[ee];if(J.finallyLoc===$)return this.complete(J.completion,J.afterLoc),z(J),D}},catch:function($){for(var ee=this.tryEntries.length-1;ee>=0;--ee){var J=this.tryEntries[ee];if(J.tryLoc===$){var F=J.completion;if(F.type==="throw"){var X=F.arg;z(J)}return X}}throw new Error("illegal catch attempt")},delegateYield:function($,ee,J){return this.delegate={iterator:U($),resultName:ee,nextLoc:J},this.method==="next"&&(this.arg=I),D}},x}(fe.exports);try{regeneratorRuntime=p}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=p:Function("r","regeneratorRuntime = r")(p)}},33934:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=x(91193),C=x(80800),I=new Array(16),m=[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],b=[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],g=[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],w=[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],_=[0,1518500249,1859775393,2400959708,2840853838],A=[1352829926,1548603684,1836072691,2053994217,0];function S(){C.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}T(S,C),S.prototype._update=function(){for(var H=I,G=0;G<16;++G)H[G]=this._block.readInt32LE(G*4);for(var Z=this._a|0,Q=this._b|0,ie=this._c|0,le=this._d|0,be=this._e|0,we=this._a|0,Ae=this._b|0,re=this._c|0,N=this._d|0,z=this._e|0,V=0;V<80;V+=1){var U,j;V<16?(U=B(Z,Q,ie,le,be,H[m[V]],_[0],g[V]),j=W(we,Ae,re,N,z,H[b[V]],A[0],w[V])):V<32?(U=O(Z,Q,ie,le,be,H[m[V]],_[1],g[V]),j=D(we,Ae,re,N,z,H[b[V]],A[1],w[V])):V<48?(U=L(Z,Q,ie,le,be,H[m[V]],_[2],g[V]),j=L(we,Ae,re,N,z,H[b[V]],A[2],w[V])):V<64?(U=D(Z,Q,ie,le,be,H[m[V]],_[3],g[V]),j=O(we,Ae,re,N,z,H[b[V]],A[3],w[V])):(U=W(Z,Q,ie,le,be,H[m[V]],_[4],g[V]),j=B(we,Ae,re,N,z,H[b[V]],A[4],w[V])),Z=be,be=le,le=k(ie,10),ie=Q,Q=U,we=z,z=N,N=k(re,10),re=Ae,Ae=j}var $=this._b+ie+N|0;this._b=this._c+le+z|0,this._c=this._d+be+we|0,this._d=this._e+Z+Ae|0,this._e=this._a+Q+re|0,this._a=$},S.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 H=v.alloc?v.alloc(20):new v(20);return H.writeInt32LE(this._a,0),H.writeInt32LE(this._b,4),H.writeInt32LE(this._c,8),H.writeInt32LE(this._d,12),H.writeInt32LE(this._e,16),H};function k(H,G){return H<<G|H>>>32-G}function B(H,G,Z,Q,ie,le,be,we){return k(H+(G^Z^Q)+le+be|0,we)+ie|0}function O(H,G,Z,Q,ie,le,be,we){return k(H+(G&Z|~G&Q)+le+be|0,we)+ie|0}function L(H,G,Z,Q,ie,le,be,we){return k(H+((G|~Z)^Q)+le+be|0,we)+ie|0}function D(H,G,Z,Q,ie,le,be,we){return k(H+(G&Q|Z&~Q)+le+be|0,we)+ie|0}function W(H,G,Z,Q,ie,le,be,we){return k(H+(G^(Z|~Q))+le+be|0,we)+ie|0}fe.exports=S},84748:function(fe,p,x){"use strict";var v=x(36533).Buffer,T=this&&this.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(p,"__esModule",{value:!0}),p.getLength=p.decode=p.encode=void 0;var C=T(x(83900));function I(D){if(Array.isArray(D)){for(var W=[],H=0;H<D.length;H++)W.push(I(D[H]));var G=v.concat(W);return v.concat([b(G.length,192),G])}else{var Z=L(D);return Z.length===1&&Z[0]<128?Z:v.concat([b(Z.length,128),Z])}}p.encode=I;function m(D,W){if(D[0]==="0"&&D[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(D,W)}function b(D,W){if(D<56)return v.from([D+W]);var H=k(D),G=H.length/2,Z=k(W+55+G);return v.from(Z+H,"hex")}function g(D,W){if(W===void 0&&(W=!1),!D||D.length===0)return v.from([]);var H=L(D),G=_(H);if(W)return G;if(G.remainder.length!==0)throw new Error("invalid remainder");return G.data}p.decode=g;function w(D){if(!D||D.length===0)return v.from([]);var W=L(D),H=W[0];if(H<=127)return W.length;if(H<=183)return H-127;if(H<=191)return H-182;if(H<=247)return H-191;var G=H-246,Z=m(W.slice(1,G).toString("hex"),16);return G+Z}p.getLength=w;function _(D){var W,H,G,Z,Q,ie=[],le=D[0];if(le<=127)return{data:D.slice(0,1),remainder:D.slice(1)};if(le<=183){if(W=le-127,le===128?G=v.from([]):G=D.slice(1,W),W===2&&G[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:G,remainder:D.slice(W)}}else if(le<=191){if(H=le-182,D.length-1<H)throw new Error("invalid RLP: not enough bytes for string length");if(W=m(D.slice(1,H).toString("hex"),16),W<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if(G=D.slice(H,W+H),G.length<W)throw new Error("invalid RLP: not enough bytes for string");return{data:G,remainder:D.slice(W+H)}}else if(le<=247){for(W=le-191,Z=D.slice(1,W);Z.length;)Q=_(Z),ie.push(Q.data),Z=Q.remainder;return{data:ie,remainder:D.slice(W)}}else{H=le-246,W=m(D.slice(1,H).toString("hex"),16);var be=H+W;if(be>D.length)throw new Error("invalid rlp: total length is larger than the data");if(Z=D.slice(H,be),Z.length===0)throw new Error("invalid rlp, List has a invalid length");for(;Z.length;)Q=_(Z),ie.push(Q.data),Z=Q.remainder;return{data:ie,remainder:D.slice(be)}}}function A(D){return D.slice(0,2)==="0x"}function S(D){return typeof D!="string"?D:A(D)?D.slice(2):D}function k(D){if(D<0)throw new Error("Invalid integer as argument, must be unsigned!");var W=D.toString(16);return W.length%2?"0"+W:W}function B(D){return D.length%2?"0"+D:D}function O(D){var W=k(D);return v.from(W,"hex")}function L(D){if(!v.isBuffer(D)){if(typeof D=="string")return A(D)?v.from(B(S(D)),"hex"):v.from(D);if(typeof D=="number"||typeof D=="bigint")return D?O(D):v.from([]);if(D==null)return v.from([]);if(D instanceof Uint8Array)return v.from(D);if(C.default.isBN(D))return v.from(D.toArray());throw new Error("invalid type")}return D}},99097:function(fe,p,x){"use strict";x.r(p),x.d(p,{never:()=>Rn,noop:()=>dt.l,partition:()=>Tn,Notification:()=>j,bindNodeCallback:()=>ln,queueScheduler:()=>Q,EmptyError:()=>oe.G,asapScheduler:()=>$t,ReplaySubject:()=>de,Subscription:()=>I.y,iif:()=>pr,isObservable:()=>He,ObjectUnsubscribedError:()=>B.P,Subject:()=>k.B7,asyncScheduler:()=>Xe,animationFrame:()=>zt,range:()=>bt,fromEvent:()=>en,using:()=>Ne,defer:()=>Ue.v,asap:()=>ft,animationFrameScheduler:()=>Ge,AsyncSubject:()=>ce,concat:()=>Pe,scheduled:()=>vi.c,TimeoutError:()=>me,NotificationKind:()=>U,zip:()=>mn,ArgumentOutOfRangeError:()=>se.k,queue:()=>ie,throwError:()=>z,race:()=>Sn,combineLatest:()=>Lt,Subscriber:()=>le.v,pipe:()=>qe.F,fromEventPattern:()=>tr,config:()=>Pi.$,onErrorResumeNext:()=>In,UnsubscriptionError:()=>ye.Z,Observable:()=>v.c,Scheduler:()=>H,async:()=>ct,observable:()=>S.s,interval:()=>Qn,VirtualTimeScheduler:()=>Ft,pairs:()=>Xn,GroupedObservable:()=>_,from:()=>_e.H,EMPTY:()=>be.w,BehaviorSubject:()=>O,bindCallback:()=>Vt,empty:()=>be.I,generate:()=>gr,identity:()=>De.D,ConnectableObservable:()=>T.G,merge:()=>Mn.h,of:()=>N,timer:()=>je,forkJoin:()=>Ze,VirtualAction:()=>tt,NEVER:()=>Ln});var v=x(84253),T=x(42532),C=x(65927),I=x(61220);function m(et,it,$e,mt){return function(It){return It.lift(new b(et,it,$e,mt))}}var b=null,g=null,w=null,_=function(et){C.C6(it,et);function it($e,mt,It){var sn=et.call(this)||this;return sn.key=$e,sn.groupSubject=mt,sn.refCountSubscription=It,sn}return it.prototype._subscribe=function($e){var mt=new I.y,It=this,sn=It.refCountSubscription,Wn=It.groupSubject;return sn&&!sn.closed&&mt.add(new A(sn)),mt.add(Wn.subscribe($e)),mt},it}(v.c),A=function(et){C.C6(it,et);function it($e){var mt=et.call(this)||this;return mt.parent=$e,$e.count++,mt}return it.prototype.unsubscribe=function(){var $e=this.parent;!$e.closed&&!this.closed&&(et.prototype.unsubscribe.call(this),$e.count-=1,$e.count===0&&$e.attemptedToUnsubscribe&&$e.unsubscribe())},it}(I.y),S=x(57221),k=x(2721),B=x(35656),O=function(et){C.C6(it,et);function it($e){var mt=et.call(this)||this;return mt._value=$e,mt}return Object.defineProperty(it.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),it.prototype._subscribe=function($e){var mt=et.prototype._subscribe.call(this,$e);return mt&&!mt.closed&&$e.next(this._value),mt},it.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new B.P;return this._value},it.prototype.next=function($e){et.prototype.next.call(this,this._value=$e)},it}(k.B7),L=function(et){C.C6(it,et);function it($e,mt){return et.call(this)||this}return it.prototype.schedule=function($e,mt){return mt===void 0&&(mt=0),this},it}(I.y),D=function(et){C.C6(it,et);function it($e,mt){var It=et.call(this,$e,mt)||this;return It.scheduler=$e,It.work=mt,It.pending=!1,It}return it.prototype.schedule=function($e,mt){if(mt===void 0&&(mt=0),this.closed)return this;this.state=$e;var It=this.id,sn=this.scheduler;return It!=null&&(this.id=this.recycleAsyncId(sn,It,mt)),this.pending=!0,this.delay=mt,this.id=this.id||this.requestAsyncId(sn,this.id,mt),this},it.prototype.requestAsyncId=function($e,mt,It){return It===void 0&&(It=0),setInterval($e.flush.bind($e,this),It)},it.prototype.recycleAsyncId=function($e,mt,It){if(It===void 0&&(It=0),It!==null&&this.delay===It&&this.pending===!1)return mt;clearInterval(mt)},it.prototype.execute=function($e,mt){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var It=this._execute($e,mt);if(It)return It;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},it.prototype._execute=function($e,mt){var It=!1,sn=void 0;try{this.work($e)}catch(Wn){It=!0,sn=!!Wn&&Wn||new Error(Wn)}if(It)return this.unsubscribe(),sn},it.prototype._unsubscribe=function(){var $e=this.id,mt=this.scheduler,It=mt.actions,sn=It.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,sn!==-1&&It.splice(sn,1),$e!=null&&(this.id=this.recycleAsyncId(mt,$e,null)),this.delay=null},it}(L),W=function(et){C.C6(it,et);function it($e,mt){var It=et.call(this,$e,mt)||this;return It.scheduler=$e,It.work=mt,It}return it.prototype.schedule=function($e,mt){return mt===void 0&&(mt=0),mt>0?et.prototype.schedule.call(this,$e,mt):(this.delay=mt,this.state=$e,this.scheduler.flush(this),this)},it.prototype.execute=function($e,mt){return mt>0||this.closed?et.prototype.execute.call(this,$e,mt):this._execute($e,mt)},it.prototype.requestAsyncId=function($e,mt,It){return It===void 0&&(It=0),It!==null&&It>0||It===null&&this.delay>0?et.prototype.requestAsyncId.call(this,$e,mt,It):$e.flush(this)},it}(D),H=function(){function et(it,$e){$e===void 0&&($e=et.now),this.SchedulerAction=it,this.now=$e}return et.prototype.schedule=function(it,$e,mt){return $e===void 0&&($e=0),new this.SchedulerAction(this,it).schedule(mt,$e)},et.now=function(){return Date.now()},et}(),G=function(et){C.C6(it,et);function it($e,mt){mt===void 0&&(mt=H.now);var It=et.call(this,$e,function(){return it.delegate&&it.delegate!==It?it.delegate.now():mt()})||this;return It.actions=[],It.active=!1,It.scheduled=void 0,It}return it.prototype.schedule=function($e,mt,It){return mt===void 0&&(mt=0),it.delegate&&it.delegate!==this?it.delegate.schedule($e,mt,It):et.prototype.schedule.call(this,$e,mt,It)},it.prototype.flush=function($e){var mt=this.actions;if(this.active){mt.push($e);return}var It;this.active=!0;do if(It=$e.execute($e.state,$e.delay))break;while($e=mt.shift());if(this.active=!1,It){for(;$e=mt.shift();)$e.unsubscribe();throw It}},it}(H),Z=function(et){C.C6(it,et);function it(){return et!==null&&et.apply(this,arguments)||this}return it}(G),Q=new Z(W),ie=Q,le=x(90443),be=x(90246),we=x(20915),Ae=x(24010),re=x(37795);function N(){for(var et=[],it=0;it<arguments.length;it++)et[it]=arguments[it];var $e=et[et.length-1];return(0,we.m)($e)?(et.pop(),(0,re.V)(et,$e)):(0,Ae.c)(et)}function z(et,it){return it?new v.c(function($e){return it.schedule(V,0,{error:et,subscriber:$e})}):new v.c(function($e){return $e.error(et)})}function V(et){var it=et.error,$e=et.subscriber;$e.error(it)}var U;U||(U={});var j=function(){function et(it,$e,mt){this.kind=it,this.value=$e,this.error=mt,this.hasValue=it==="N"}return et.prototype.observe=function(it){switch(this.kind){case"N":return it.next&&it.next(this.value);case"E":return it.error&&it.error(this.error);case"C":return it.complete&&it.complete()}},et.prototype.do=function(it,$e,mt){var It=this.kind;switch(It){case"N":return it&&it(this.value);case"E":return $e&&$e(this.error);case"C":return mt&&mt()}},et.prototype.accept=function(it,$e,mt){return it&&typeof it.next=="function"?this.observe(it):this.do(it,$e,mt)},et.prototype.toObservable=function(){var it=this.kind;switch(it){case"N":return N(this.value);case"E":return z(this.error);case"C":return(0,be.I)()}throw new Error("unexpected notification kind value")},et.createNext=function(it){return typeof it<"u"?new et("N",it):et.undefinedValueNotification},et.createError=function(it){return new et("E",void 0,it)},et.createComplete=function(){return et.completeNotification},et.completeNotification=new et("C"),et.undefinedValueNotification=new et("N",void 0),et}();function $(et,it){return it===void 0&&(it=0),function(mt){return mt.lift(new ee(et,it))}}var ee=null,J=function(et){C.C6(it,et);function it($e,mt,It){It===void 0&&(It=0);var sn=et.call(this,$e)||this;return sn.scheduler=mt,sn.delay=It,sn}return it.dispatch=function($e){var mt=$e.notification,It=$e.destination;mt.observe(It),this.unsubscribe()},it.prototype.scheduleMessage=function($e){var mt=this.destination;mt.add(this.scheduler.schedule(it.dispatch,this.delay,new F($e,this.destination)))},it.prototype._next=function($e){this.scheduleMessage(j.createNext($e))},it.prototype._error=function($e){this.scheduleMessage(j.createError($e)),this.unsubscribe()},it.prototype._complete=function(){this.scheduleMessage(j.createComplete()),this.unsubscribe()},it}(le.v),F=function(){function et(it,$e){this.notification=it,this.destination=$e}return et}(),X=x(43248),de=function(et){C.C6(it,et);function it($e,mt,It){$e===void 0&&($e=Number.POSITIVE_INFINITY),mt===void 0&&(mt=Number.POSITIVE_INFINITY);var sn=et.call(this)||this;return sn.scheduler=It,sn._events=[],sn._infiniteTimeWindow=!1,sn._bufferSize=$e<1?1:$e,sn._windowTime=mt<1?1:mt,mt===Number.POSITIVE_INFINITY?(sn._infiniteTimeWindow=!0,sn.next=sn.nextInfiniteTimeWindow):sn.next=sn.nextTimeWindow,sn}return it.prototype.nextInfiniteTimeWindow=function($e){if(!this.isStopped){var mt=this._events;mt.push($e),mt.length>this._bufferSize&&mt.shift()}et.prototype.next.call(this,$e)},it.prototype.nextTimeWindow=function($e){this.isStopped||(this._events.push(new Y(this._getNow(),$e)),this._trimBufferThenGetEvents()),et.prototype.next.call(this,$e)},it.prototype._subscribe=function($e){var mt=this._infiniteTimeWindow,It=mt?this._events:this._trimBufferThenGetEvents(),sn=this.scheduler,Wn=It.length,Or;if(this.closed)throw new B.P;if(this.isStopped||this.hasError?Or=I.y.EMPTY:(this.observers.push($e),Or=new X.Y(this,$e)),sn&&$e.add($e=new J($e,sn)),mt)for(var Nr=0;Nr<Wn&&!$e.closed;Nr++)$e.next(It[Nr]);else for(var Nr=0;Nr<Wn&&!$e.closed;Nr++)$e.next(It[Nr].value);return this.hasError?$e.error(this.thrownError):this.isStopped&&$e.complete(),Or},it.prototype._getNow=function(){return(this.scheduler||ie).now()},it.prototype._trimBufferThenGetEvents=function(){for(var $e=this._getNow(),mt=this._bufferSize,It=this._windowTime,sn=this._events,Wn=sn.length,Or=0;Or<Wn&&!($e-sn[Or].time<It);)Or++;return Wn>mt&&(Or=Math.max(Or,Wn-mt)),Or>0&&sn.splice(0,Or),sn},it}(k.B7),Y=function(){function et(it,$e){this.time=it,this.value=$e}return et}(),ce=function(et){C.C6(it,et);function it(){var $e=et!==null&&et.apply(this,arguments)||this;return $e.value=null,$e.hasNext=!1,$e.hasCompleted=!1,$e}return it.prototype._subscribe=function($e){return this.hasError?($e.error(this.thrownError),I.y.EMPTY):this.hasCompleted&&this.hasNext?($e.next(this.value),$e.complete(),I.y.EMPTY):et.prototype._subscribe.call(this,$e)},it.prototype.next=function($e){this.hasCompleted||(this.value=$e,this.hasNext=!0)},it.prototype.error=function($e){this.hasCompleted||et.prototype.error.call(this,$e)},it.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&et.prototype.next.call(this,this.value),et.prototype.complete.call(this)},it}(k.B7),he=1,Ie=function(){return Promise.resolve()}(),ke={};function ut(et){return et in ke?(delete ke[et],!0):!1}var Re={setImmediate:function(et){var it=he++;return ke[it]=!0,Ie.then(function(){return ut(it)&&et()}),it},clearImmediate:function(et){ut(et)}},ze=null,_t=function(et){C.C6(it,et);function it($e,mt){var It=et.call(this,$e,mt)||this;return It.scheduler=$e,It.work=mt,It}return it.prototype.requestAsyncId=function($e,mt,It){return It===void 0&&(It=0),It!==null&&It>0?et.prototype.requestAsyncId.call(this,$e,mt,It):($e.actions.push(this),$e.scheduled||($e.scheduled=Re.setImmediate($e.flush.bind($e,null))))},it.prototype.recycleAsyncId=function($e,mt,It){if(It===void 0&&(It=0),It!==null&&It>0||It===null&&this.delay>0)return et.prototype.recycleAsyncId.call(this,$e,mt,It);$e.actions.length===0&&(Re.clearImmediate(mt),$e.scheduled=void 0)},it}(D),Ct=function(et){C.C6(it,et);function it(){return et!==null&&et.apply(this,arguments)||this}return it.prototype.flush=function($e){this.active=!0,this.scheduled=void 0;var mt=this.actions,It,sn=-1,Wn=mt.length;$e=$e||mt.shift();do if(It=$e.execute($e.state,$e.delay))break;while(++sn<Wn&&($e=mt.shift()));if(this.active=!1,It){for(;++sn<Wn&&($e=mt.shift());)$e.unsubscribe();throw It}},it}(G),$t=new Ct(_t),ft=$t,Xe=new G(D),ct=Xe,wt=function(et){C.C6(it,et);function it($e,mt){var It=et.call(this,$e,mt)||this;return It.scheduler=$e,It.work=mt,It}return it.prototype.requestAsyncId=function($e,mt,It){return It===void 0&&(It=0),It!==null&&It>0?et.prototype.requestAsyncId.call(this,$e,mt,It):($e.actions.push(this),$e.scheduled||($e.scheduled=requestAnimationFrame(function(){return $e.flush(null)})))},it.prototype.recycleAsyncId=function($e,mt,It){if(It===void 0&&(It=0),It!==null&&It>0||It===null&&this.delay>0)return et.prototype.recycleAsyncId.call(this,$e,mt,It);$e.actions.length===0&&(cancelAnimationFrame(mt),$e.scheduled=void 0)},it}(D),Rt=function(et){C.C6(it,et);function it(){return et!==null&&et.apply(this,arguments)||this}return it.prototype.flush=function($e){this.active=!0,this.scheduled=void 0;var mt=this.actions,It,sn=-1,Wn=mt.length;$e=$e||mt.shift();do if(It=$e.execute($e.state,$e.delay))break;while(++sn<Wn&&($e=mt.shift()));if(this.active=!1,It){for(;++sn<Wn&&($e=mt.shift());)$e.unsubscribe();throw It}},it}(G),Ge=new Rt(wt),zt=Ge,Ft=function(et){C.C6(it,et);function it($e,mt){$e===void 0&&($e=tt),mt===void 0&&(mt=Number.POSITIVE_INFINITY);var It=et.call(this,$e,function(){return It.frame})||this;return It.maxFrames=mt,It.frame=0,It.index=-1,It}return it.prototype.flush=function(){for(var $e=this,mt=$e.actions,It=$e.maxFrames,sn,Wn;(Wn=mt[0])&&Wn.delay<=It&&(mt.shift(),this.frame=Wn.delay,!(sn=Wn.execute(Wn.state,Wn.delay))););if(sn){for(;Wn=mt.shift();)Wn.unsubscribe();throw sn}},it.frameTimeFactor=10,it}(G),tt=function(et){C.C6(it,et);function it($e,mt,It){It===void 0&&(It=$e.index+=1);var sn=et.call(this,$e,mt)||this;return sn.scheduler=$e,sn.work=mt,sn.index=It,sn.active=!0,sn.index=$e.index=It,sn}return it.prototype.schedule=function($e,mt){if(mt===void 0&&(mt=0),!this.id)return et.prototype.schedule.call(this,$e,mt);this.active=!1;var It=new it(this.scheduler,this.work);return this.add(It),It.schedule($e,mt)},it.prototype.requestAsyncId=function($e,mt,It){It===void 0&&(It=0),this.delay=$e.frame+It;var sn=$e.actions;return sn.push(this),sn.sort(it.sortActions),!0},it.prototype.recycleAsyncId=function($e,mt,It){It===void 0&&(It=0)},it.prototype._execute=function($e,mt){if(this.active===!0)return et.prototype._execute.call(this,$e,mt)},it.sortActions=function($e,mt){return $e.delay===mt.delay?$e.index===mt.index?0:$e.index>mt.index?1:-1:$e.delay>mt.delay?1:-1},it}(D),qe=x(40868),dt=x(62180),De=x(12486);function He(et){return!!et&&(et instanceof v.c||typeof et.lift=="function"&&typeof et.subscribe=="function")}var se=x(44931),oe=x(9801),ye=x(39642),Ee=function(){function et(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return et.prototype=Object.create(Error.prototype),et}(),me=Ee,Te=x(42933),Oe=x(70414),Qe=x(81379);function Vt(et,it,$e){if(it)if((0,we.m)(it))$e=it;else return function(){for(var mt=[],It=0;It<arguments.length;It++)mt[It]=arguments[It];return Vt(et,$e).apply(void 0,mt).pipe((0,Te.T)(function(sn){return(0,Qe.c)(sn)?it.apply(void 0,sn):it(sn)}))};return function(){for(var mt=[],It=0;It<arguments.length;It++)mt[It]=arguments[It];var sn=this,Wn,Or={context:sn,subject:Wn,callbackFunc:et,scheduler:$e};return new v.c(function(Nr){if($e){var Ti={args:mt,subscriber:Nr,params:Or};return $e.schedule(vt,0,Ti)}else{if(!Wn){Wn=new ce;var wi=function(){for(var di=[],mi=0;mi<arguments.length;mi++)di[mi]=arguments[mi];Wn.next(di.length<=1?di[0]:di),Wn.complete()};try{et.apply(sn,mt.concat([wi]))}catch(di){(0,Oe.H)(Wn)?Wn.error(di):console.warn(di)}}return Wn.subscribe(Nr)}})}}function vt(et){var it=this,$e=this,mt=et.args,It=et.subscriber,sn=et.params,Wn=sn.callbackFunc,Or=sn.context,Nr=sn.scheduler,wi=sn.subject;if(!wi){wi=sn.subject=new ce;var Ti=function(){for(var di=[],mi=0;mi<arguments.length;mi++)di[mi]=arguments[mi];var So=di.length<=1?di[0]:di;it.add(Nr.schedule(Zt,0,{value:So,subject:wi}))};try{Wn.apply(Or,mt.concat([Ti]))}catch(di){wi.error(di)}}this.add(wi.subscribe(It))}function Zt(et){var it=et.value,$e=et.subject;$e.next(it),$e.complete()}function dn(et){var it=et.err,$e=et.subject;$e.error(it)}function ln(et,it,$e){if(it)if((0,we.m)(it))$e=it;else return function(){for(var mt=[],It=0;It<arguments.length;It++)mt[It]=arguments[It];return ln(et,$e).apply(void 0,mt).pipe((0,Te.T)(function(sn){return(0,Qe.c)(sn)?it.apply(void 0,sn):it(sn)}))};return function(){for(var mt=[],It=0;It<arguments.length;It++)mt[It]=arguments[It];var sn={subject:void 0,args:mt,callbackFunc:et,scheduler:$e,context:this};return new v.c(function(Wn){var Or=sn.context,Nr=sn.subject;if($e)return $e.schedule(yn,0,{params:sn,subscriber:Wn,context:Or});if(!Nr){Nr=sn.subject=new ce;var wi=function(){for(var Ti=[],di=0;di<arguments.length;di++)Ti[di]=arguments[di];var mi=Ti.shift();if(mi){Nr.error(mi);return}Nr.next(Ti.length<=1?Ti[0]:Ti),Nr.complete()};try{et.apply(Or,mt.concat([wi]))}catch(Ti){(0,Oe.H)(Nr)?Nr.error(Ti):console.warn(Ti)}}return Nr.subscribe(Wn)})}}function yn(et){var it=this,$e=et.params,mt=et.subscriber,It=et.context,sn=$e.callbackFunc,Wn=$e.args,Or=$e.scheduler,Nr=$e.subject;if(!Nr){Nr=$e.subject=new ce;var wi=function(){for(var Ti=[],di=0;di<arguments.length;di++)Ti[di]=arguments[di];var mi=Ti.shift();if(mi)it.add(Or.schedule(An,0,{err:mi,subject:Nr}));else{var So=Ti.length<=1?Ti[0]:Ti;it.add(Or.schedule(or,0,{value:So,subject:Nr}))}};try{sn.apply(It,Wn.concat([wi]))}catch(Ti){this.add(Or.schedule(An,0,{err:Ti,subject:Nr}))}}this.add(Nr.subscribe(mt))}function or(et){var it=et.value,$e=et.subject;$e.next(it),$e.complete()}function An(et){var it=et.err,$e=et.subject;$e.error(it)}var Un=function(et){C.C6(it,et);function it(){return et!==null&&et.apply(this,arguments)||this}return it.prototype.notifyNext=function($e,mt,It,sn,Wn){this.destination.next(mt)},it.prototype.notifyError=function($e,mt){this.destination.error($e)},it.prototype.notifyComplete=function($e){this.destination.complete()},it}(le.v),Er=function(et){C.C6(it,et);function it($e,mt,It){var sn=et.call(this)||this;return sn.parent=$e,sn.outerValue=mt,sn.outerIndex=It,sn.index=0,sn}return it.prototype._next=function($e){this.parent.notifyNext(this.outerValue,$e,this.outerIndex,this.index++,this)},it.prototype._error=function($e){this.parent.notifyError($e,this),this.unsubscribe()},it.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},it}(le.v),ht=x(71471);function st(et,it,$e,mt,It){if(It===void 0&&(It=new Er(et,$e,mt)),!It.closed)return it instanceof v.c?it.subscribe(It):(0,ht.i)(it)(It)}var Dt={};function Lt(){for(var et=[],it=0;it<arguments.length;it++)et[it]=arguments[it];var $e=void 0,mt=void 0;return(0,we.m)(et[et.length-1])&&(mt=et.pop()),typeof et[et.length-1]=="function"&&($e=et.pop()),et.length===1&&(0,Qe.c)(et[0])&&(et=et[0]),(0,Ae.c)(et,mt).lift(new Gt($e))}var Gt=function(){function et(it){this.resultSelector=it}return et.prototype.call=function(it,$e){return $e.subscribe(new xn(it,this.resultSelector))},et}(),xn=function(et){C.C6(it,et);function it($e,mt){var It=et.call(this,$e)||this;return It.resultSelector=mt,It.active=0,It.values=[],It.observables=[],It}return it.prototype._next=function($e){this.values.push(Dt),this.observables.push($e)},it.prototype._complete=function(){var $e=this.observables,mt=$e.length;if(mt===0)this.destination.complete();else{this.active=mt,this.toRespond=mt;for(var It=0;It<mt;It++){var sn=$e[It];this.add(st(this,sn,void 0,It))}}},it.prototype.notifyComplete=function($e){(this.active-=1)===0&&this.destination.complete()},it.prototype.notifyNext=function($e,mt,It){var sn=this.values,Wn=sn[It],Or=this.toRespond?Wn===Dt?--this.toRespond:this.toRespond:0;sn[It]=mt,Or===0&&(this.resultSelector?this._tryResultSelector(sn):this.destination.next(sn.slice()))},it.prototype._tryResultSelector=function($e){var mt;try{mt=this.resultSelector.apply(this,$e)}catch(It){this.destination.error(It);return}this.destination.next(mt)},it}(Un),un=x(15652);function fn(){return(0,un.U)(1)}function Pe(){for(var et=[],it=0;it<arguments.length;it++)et[it]=arguments[it];return fn()(N.apply(void 0,et))}var Ue=x(92943),Le=x(86883),_e=x(24699);function Ze(){for(var et=[],it=0;it<arguments.length;it++)et[it]=arguments[it];if(et.length===1){var $e=et[0];if((0,Qe.c)($e))return Ot($e,null);if((0,Le.G)($e)&&Object.getPrototypeOf($e)===Object.prototype){var mt=Object.keys($e);return Ot(mt.map(function(sn){return $e[sn]}),mt)}}if(typeof et[et.length-1]=="function"){var It=et.pop();return et=et.length===1&&(0,Qe.c)(et[0])?et[0]:et,Ot(et,null).pipe((0,Te.T)(function(sn){return It.apply(void 0,sn)}))}return Ot(et,null)}function Ot(et,it){return new v.c(function($e){var mt=et.length;if(mt===0){$e.complete();return}for(var It=new Array(mt),sn=0,Wn=0,Or=function(wi){var Ti=(0,_e.H)(et[wi]),di=!1;$e.add(Ti.subscribe({next:function(mi){di||(di=!0,Wn++),It[wi]=mi},error:function(mi){return $e.error(mi)},complete:function(){sn++,(sn===mt||!di)&&(Wn===mt&&$e.next(it?it.reduce(function(mi,So,Xu){return mi[So]=It[Xu],mi},{}):It),$e.complete())}}))},Nr=0;Nr<mt;Nr++)Or(Nr)})}var Yt=x(564),Jt=null;function en(et,it,$e,mt){return(0,Yt.T)($e)&&(mt=$e,$e=void 0),mt?en(et,it,$e).pipe((0,Te.T)(function(It){return(0,Qe.c)(It)?mt.apply(void 0,It):mt(It)})):new v.c(function(It){function sn(Wn){arguments.length>1?It.next(Array.prototype.slice.call(arguments)):It.next(Wn)}Vn(et,it,sn,It,$e)})}function Vn(et,it,$e,mt,It){var sn;if(Hn(et)){var Wn=et;et.addEventListener(it,$e,It),sn=function(){return Wn.removeEventListener(it,$e,It)}}else if(ir(et)){var Or=et;et.on(it,$e),sn=function(){return Or.off(it,$e)}}else if(kn(et)){var Nr=et;et.addListener(it,$e),sn=function(){return Nr.removeListener(it,$e)}}else if(et&&et.length)for(var wi=0,Ti=et.length;wi<Ti;wi++)Vn(et[wi],it,$e,mt,It);else throw new TypeError("Invalid event target");mt.add(sn)}function kn(et){return et&&typeof et.addListener=="function"&&typeof et.removeListener=="function"}function ir(et){return et&&typeof et.on=="function"&&typeof et.off=="function"}function Hn(et){return et&&typeof et.addEventListener=="function"&&typeof et.removeEventListener=="function"}function tr(et,it,$e){return $e?tr(et,it).pipe((0,Te.T)(function(mt){return(0,Qe.c)(mt)?$e.apply(void 0,mt):$e(mt)})):new v.c(function(mt){var It=function(){for(var Wn=[],Or=0;Or<arguments.length;Or++)Wn[Or]=arguments[Or];return mt.next(Wn.length===1?Wn[0]:Wn)},sn;try{sn=et(It)}catch(Wn){mt.error(Wn);return}if((0,Yt.T)(it))return function(){return it(It,sn)}})}function gr(et,it,$e,mt,It){var sn,Wn;if(arguments.length==1){var Or=et;Wn=Or.initialState,it=Or.condition,$e=Or.iterate,sn=Or.resultSelector||De.D,It=Or.scheduler}else mt===void 0||(0,we.m)(mt)?(Wn=et,sn=De.D,It=mt):(Wn=et,sn=mt);return new v.c(function(Nr){var wi=Wn;if(It)return It.schedule(br,0,{subscriber:Nr,iterate:$e,condition:it,resultSelector:sn,state:wi});do{if(it){var Ti=void 0;try{Ti=it(wi)}catch(mi){Nr.error(mi);return}if(!Ti){Nr.complete();break}}var di=void 0;try{di=sn(wi)}catch(mi){Nr.error(mi);return}if(Nr.next(di),Nr.closed)break;try{wi=$e(wi)}catch(mi){Nr.error(mi);return}}while(!0)})}function br(et){var it=et.subscriber,$e=et.condition;if(!it.closed){if(et.needIterate)try{et.state=et.iterate(et.state)}catch(sn){it.error(sn);return}else et.needIterate=!0;if($e){var mt=void 0;try{mt=$e(et.state)}catch(sn){it.error(sn);return}if(!mt){it.complete();return}if(it.closed)return}var It;try{It=et.resultSelector(et.state)}catch(sn){it.error(sn);return}if(!it.closed&&(it.next(It),!it.closed))return this.schedule(et)}}function pr(et,it,$e){return it===void 0&&(it=be.w),$e===void 0&&($e=be.w),(0,Ue.v)(function(){return et()?it:$e})}function _n(et){return!(0,Qe.c)(et)&&et-parseFloat(et)+1>=0}function Qn(et,it){return et===void 0&&(et=0),it===void 0&&(it=ct),(!_n(et)||et<0)&&(et=0),(!it||typeof it.schedule!="function")&&(it=ct),new v.c(function($e){return $e.add(it.schedule(Zn,et,{subscriber:$e,counter:0,period:et})),$e})}function Zn(et){var it=et.subscriber,$e=et.counter,mt=et.period;it.next($e),this.schedule({subscriber:it,counter:$e+1,period:mt},mt)}var Mn=x(56927),Ln=new v.c(dt.l);function Rn(){return Ln}function In(){for(var et=[],it=0;it<arguments.length;it++)et[it]=arguments[it];if(et.length===0)return be.w;var $e=et[0],mt=et.slice(1);return et.length===1&&(0,Qe.c)($e)?In.apply(void 0,$e):new v.c(function(It){var sn=function(){return It.add(In.apply(void 0,mt).subscribe(It))};return(0,_e.H)($e).subscribe({next:function(Wn){It.next(Wn)},error:sn,complete:sn})})}function Xn(et,it){return it?new v.c(function($e){var mt=Object.keys(et),It=new I.y;return It.add(it.schedule($n,0,{keys:mt,index:0,subscriber:$e,subscription:It,obj:et})),It}):new v.c(function($e){for(var mt=Object.keys(et),It=0;It<mt.length&&!$e.closed;It++){var sn=mt[It];et.hasOwnProperty(sn)&&$e.next([sn,et[sn]])}$e.complete()})}function $n(et){var it=et.keys,$e=et.index,mt=et.subscriber,It=et.subscription,sn=et.obj;if(!mt.closed)if($e<it.length){var Wn=it[$e];mt.next([Wn,sn[Wn]]),It.add(this.schedule({keys:it,index:$e+1,subscriber:mt,subscription:It,obj:sn}))}else mt.complete()}function hn(et,it){function $e(){return!$e.pred.apply($e.thisArg,arguments)}return $e.pred=et,$e.thisArg=it,$e}var an=x(29513);function Tn(et,it,$e){return[(0,an.p)(it,$e)(new v.c((0,ht.i)(et))),(0,an.p)(hn(it,$e))(new v.c((0,ht.i)(et)))]}function Sn(){for(var et=[],it=0;it<arguments.length;it++)et[it]=arguments[it];if(et.length===1)if((0,Qe.c)(et[0]))et=et[0];else return et[0];return(0,Ae.c)(et,void 0).lift(new Bn)}var Bn=function(){function et(){}return et.prototype.call=function(it,$e){return $e.subscribe(new Fn(it))},et}(),Fn=function(et){C.C6(it,et);function it($e){var mt=et.call(this,$e)||this;return mt.hasFirst=!1,mt.observables=[],mt.subscriptions=[],mt}return it.prototype._next=function($e){this.observables.push($e)},it.prototype._complete=function(){var $e=this.observables,mt=$e.length;if(mt===0)this.destination.complete();else{for(var It=0;It<mt&&!this.hasFirst;It++){var sn=$e[It],Wn=st(this,sn,void 0,It);this.subscriptions&&this.subscriptions.push(Wn),this.add(Wn)}this.observables=null}},it.prototype.notifyNext=function($e,mt,It){if(!this.hasFirst){this.hasFirst=!0;for(var sn=0;sn<this.subscriptions.length;sn++)if(sn!==It){var Wn=this.subscriptions[sn];Wn.unsubscribe(),this.remove(Wn)}this.subscriptions=null}this.destination.next(mt)},it}(Un);function bt(et,it,$e){return et===void 0&&(et=0),new v.c(function(mt){it===void 0&&(it=et,et=0);var It=0,sn=et;if($e)return $e.schedule(ve,0,{index:It,count:it,start:et,subscriber:mt});do{if(It++>=it){mt.complete();break}if(mt.next(sn++),mt.closed)break}while(!0)})}function ve(et){var it=et.start,$e=et.index,mt=et.count,It=et.subscriber;if($e>=mt){It.complete();return}It.next(it),!It.closed&&(et.index=$e+1,et.start=it+1,this.schedule(et))}function je(et,it,$e){et===void 0&&(et=0);var mt=-1;return _n(it)?mt=Number(it)<1&&1||Number(it):(0,we.m)(it)&&($e=it),(0,we.m)($e)||($e=ct),new v.c(function(It){var sn=_n(et)?et:+et-$e.now();return $e.schedule(at,sn,{index:0,period:mt,subscriber:It})})}function at(et){var it=et.index,$e=et.period,mt=et.subscriber;if(mt.next(it),!mt.closed){if($e===-1)return mt.complete();et.index=it+1,this.schedule(et,$e)}}function Ne(et,it){return new v.c(function($e){var mt;try{mt=et()}catch(Or){$e.error(Or);return}var It;try{It=it(mt)}catch(Or){$e.error(Or);return}var sn=It?(0,_e.H)(It):be.w,Wn=sn.subscribe($e);return function(){Wn.unsubscribe(),mt&&mt.unsubscribe()}})}var Et=x(44966),vn=x(39713);function mn(){for(var et=[],it=0;it<arguments.length;it++)et[it]=arguments[it];var $e=et[et.length-1];return typeof $e=="function"&&et.pop(),(0,Ae.c)(et,void 0).lift(new Nn($e))}var Nn=function(){function et(it){this.resultSelector=it}return et.prototype.call=function(it,$e){return $e.subscribe(new Dn(it,this.resultSelector))},et}(),Dn=function(et){C.C6(it,et);function it($e,mt,It){It===void 0&&(It=Object.create(null));var sn=et.call(this,$e)||this;return sn.resultSelector=mt,sn.iterators=[],sn.active=0,sn.resultSelector=typeof mt=="function"?mt:void 0,sn}return it.prototype._next=function($e){var mt=this.iterators;(0,Qe.c)($e)?mt.push(new $r($e)):typeof $e[Et.lJ]=="function"?mt.push(new Gn($e[Et.lJ]())):mt.push(new Vr(this.destination,this,$e))},it.prototype._complete=function(){var $e=this.iterators,mt=$e.length;if(this.unsubscribe(),mt===0){this.destination.complete();return}this.active=mt;for(var It=0;It<mt;It++){var sn=$e[It];if(sn.stillUnsubscribed){var Wn=this.destination;Wn.add(sn.subscribe())}else this.active--}},it.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},it.prototype.checkIterators=function(){for(var $e=this.iterators,mt=$e.length,It=this.destination,sn=0;sn<mt;sn++){var Wn=$e[sn];if(typeof Wn.hasValue=="function"&&!Wn.hasValue())return}for(var Or=!1,Nr=[],sn=0;sn<mt;sn++){var Wn=$e[sn],wi=Wn.next();if(Wn.hasCompleted()&&(Or=!0),wi.done){It.complete();return}Nr.push(wi.value)}this.resultSelector?this._tryresultSelector(Nr):It.next(Nr),Or&&It.complete()},it.prototype._tryresultSelector=function($e){var mt;try{mt=this.resultSelector.apply(this,$e)}catch(It){this.destination.error(It);return}this.destination.next(mt)},it}(le.v),Gn=function(){function et(it){this.iterator=it,this.nextResult=it.next()}return et.prototype.hasValue=function(){return!0},et.prototype.next=function(){var it=this.nextResult;return this.nextResult=this.iterator.next(),it},et.prototype.hasCompleted=function(){var it=this.nextResult;return!!(it&&it.done)},et}(),$r=function(){function et(it){this.array=it,this.index=0,this.length=0,this.length=it.length}return et.prototype[Et.lJ]=function(){return this},et.prototype.next=function(it){var $e=this.index++,mt=this.array;return $e<this.length?{value:mt[$e],done:!1}:{value:null,done:!0}},et.prototype.hasValue=function(){return this.array.length>this.index},et.prototype.hasCompleted=function(){return this.array.length===this.index},et}(),Vr=function(et){C.C6(it,et);function it($e,mt,It){var sn=et.call(this,$e)||this;return sn.parent=mt,sn.observable=It,sn.stillUnsubscribed=!0,sn.buffer=[],sn.isComplete=!1,sn}return it.prototype[Et.lJ]=function(){return this},it.prototype.next=function(){var $e=this.buffer;return $e.length===0&&this.isComplete?{value:null,done:!0}:{value:$e.shift(),done:!1}},it.prototype.hasValue=function(){return this.buffer.length>0},it.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},it.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},it.prototype.notifyNext=function($e){this.buffer.push($e),this.parent.checkIterators()},it.prototype.subscribe=function(){return(0,vn.tS)(this.observable,new vn.zA(this))},it}(vn.gn),vi=x(38467),Pi=x(76371)},84253:function(fe,p,x){"use strict";x.d(p,{c:()=>_});var v=x(70414),T=x(90443),C=x(64608),I=x(46811);function m(S,k,B){if(S){if(S instanceof T.v)return S;if(S[C.D])return S[C.D]()}return!S&&!k&&!B?new T.v(I.I):new T.v(S,k,B)}var b=x(57221),g=x(40868),w=x(76371),_=function(){function S(k){this._isScalar=!1,k&&(this._subscribe=k)}return S.prototype.lift=function(k){var B=new S;return B.source=this,B.operator=k,B},S.prototype.subscribe=function(k,B,O){var L=this.operator,D=m(k,B,O);if(L?D.add(L.call(D,this.source)):D.add(this.source||w.$.useDeprecatedSynchronousErrorHandling&&!D.syncErrorThrowable?this._subscribe(D):this._trySubscribe(D)),w.$.useDeprecatedSynchronousErrorHandling&&D.syncErrorThrowable&&(D.syncErrorThrowable=!1,D.syncErrorThrown))throw D.syncErrorValue;return D},S.prototype._trySubscribe=function(k){try{return this._subscribe(k)}catch(B){w.$.useDeprecatedSynchronousErrorHandling&&(k.syncErrorThrown=!0,k.syncErrorValue=B),(0,v.H)(k)?k.error(B):console.warn(B)}},S.prototype.forEach=function(k,B){var O=this;return B=A(B),new B(function(L,D){var W;W=O.subscribe(function(H){try{k(H)}catch(G){D(G),W&&W.unsubscribe()}},D,L)})},S.prototype._subscribe=function(k){var B=this.source;return B&&B.subscribe(k)},S.prototype[b.s]=function(){return this},S.prototype.pipe=function(){for(var k=[],B=0;B<arguments.length;B++)k[B]=arguments[B];return k.length===0?this:(0,g.m)(k)(this)},S.prototype.toPromise=function(k){var B=this;return k=A(k),new k(function(O,L){var D;B.subscribe(function(W){return D=W},function(W){return L(W)},function(){return O(D)})})},S.create=function(k){return new S(k)},S}();function A(S){if(S||(S=w.$.Promise||Promise),!S)throw new Error("no Promise impl found");return S}},46811:function(fe,p,x){"use strict";x.d(p,{I:()=>C});var v=x(76371),T=x(14e3),C={closed:!0,next:function(I){},error:function(I){if(v.$.useDeprecatedSynchronousErrorHandling)throw I;(0,T.T)(I)},complete:function(){}}},2721:function(fe,p,x){"use strict";x.d(p,{B7:()=>_,PJ:()=>w});var v=x(65927),T=x(84253),C=x(90443),I=x(61220),m=x(35656),b=x(43248),g=x(64608),w=function(S){v.C6(k,S);function k(B){var O=S.call(this,B)||this;return O.destination=B,O}return k}(C.v),_=function(S){v.C6(k,S);function k(){var B=S.call(this)||this;return B.observers=[],B.closed=!1,B.isStopped=!1,B.hasError=!1,B.thrownError=null,B}return k.prototype[g.D]=function(){return new w(this)},k.prototype.lift=function(B){var O=new A(this,this);return O.operator=B,O},k.prototype.next=function(B){if(this.closed)throw new m.P;if(!this.isStopped)for(var O=this.observers,L=O.length,D=O.slice(),W=0;W<L;W++)D[W].next(B)},k.prototype.error=function(B){if(this.closed)throw new m.P;this.hasError=!0,this.thrownError=B,this.isStopped=!0;for(var O=this.observers,L=O.length,D=O.slice(),W=0;W<L;W++)D[W].error(B);this.observers.length=0},k.prototype.complete=function(){if(this.closed)throw new m.P;this.isStopped=!0;for(var B=this.observers,O=B.length,L=B.slice(),D=0;D<O;D++)L[D].complete();this.observers.length=0},k.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},k.prototype._trySubscribe=function(B){if(this.closed)throw new m.P;return S.prototype._trySubscribe.call(this,B)},k.prototype._subscribe=function(B){if(this.closed)throw new m.P;return this.hasError?(B.error(this.thrownError),I.y.EMPTY):this.isStopped?(B.complete(),I.y.EMPTY):(this.observers.push(B),new b.Y(this,B))},k.prototype.asObservable=function(){var B=new T.c;return B.source=this,B},k.create=function(B,O){return new A(B,O)},k}(T.c),A=function(S){v.C6(k,S);function k(B,O){var L=S.call(this)||this;return L.destination=B,L.source=O,L}return k.prototype.next=function(B){var O=this.destination;O&&O.next&&O.next(B)},k.prototype.error=function(B){var O=this.destination;O&&O.error&&this.destination.error(B)},k.prototype.complete=function(){var B=this.destination;B&&B.complete&&this.destination.complete()},k.prototype._subscribe=function(B){var O=this.source;return O?this.source.subscribe(B):I.y.EMPTY},k}(_)},43248:function(fe,p,x){"use strict";x.d(p,{Y:()=>C});var v=x(65927),T=x(61220),C=function(I){v.C6(m,I);function m(b,g){var w=I.call(this)||this;return w.subject=b,w.subscriber=g,w.closed=!1,w}return m.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var b=this.subject,g=b.observers;if(this.subject=null,!(!g||g.length===0||b.isStopped||b.closed)){var w=g.indexOf(this.subscriber);w!==-1&&g.splice(w,1)}}},m}(T.y)},90443:function(fe,p,x){"use strict";x.d(p,{v:()=>w});var v=x(65927),T=x(564),C=x(46811),I=x(61220),m=x(64608),b=x(76371),g=x(14e3),w=function(A){v.C6(S,A);function S(k,B,O){var L=A.call(this)||this;switch(L.syncErrorValue=null,L.syncErrorThrown=!1,L.syncErrorThrowable=!1,L.isStopped=!1,arguments.length){case 0:L.destination=C.I;break;case 1:if(!k){L.destination=C.I;break}if(typeof k=="object"){k instanceof S?(L.syncErrorThrowable=k.syncErrorThrowable,L.destination=k,k.add(L)):(L.syncErrorThrowable=!0,L.destination=new _(L,k));break}default:L.syncErrorThrowable=!0,L.destination=new _(L,k,B,O);break}return L}return S.prototype[m.D]=function(){return this},S.create=function(k,B,O){var L=new S(k,B,O);return L.syncErrorThrowable=!1,L},S.prototype.next=function(k){this.isStopped||this._next(k)},S.prototype.error=function(k){this.isStopped||(this.isStopped=!0,this._error(k))},S.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},S.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,A.prototype.unsubscribe.call(this))},S.prototype._next=function(k){this.destination.next(k)},S.prototype._error=function(k){this.destination.error(k),this.unsubscribe()},S.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},S.prototype._unsubscribeAndRecycle=function(){var k=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=k,this},S}(I.y),_=function(A){v.C6(S,A);function S(k,B,O,L){var D=A.call(this)||this;D._parentSubscriber=k;var W,H=D;return(0,T.T)(B)?W=B:B&&(W=B.next,O=B.error,L=B.complete,B!==C.I&&(H=Object.create(B),(0,T.T)(H.unsubscribe)&&D.add(H.unsubscribe.bind(H)),H.unsubscribe=D.unsubscribe.bind(D))),D._context=H,D._next=W,D._error=O,D._complete=L,D}return S.prototype.next=function(k){if(!this.isStopped&&this._next){var B=this._parentSubscriber;!b.$.useDeprecatedSynchronousErrorHandling||!B.syncErrorThrowable?this.__tryOrUnsub(this._next,k):this.__tryOrSetError(B,this._next,k)&&this.unsubscribe()}},S.prototype.error=function(k){if(!this.isStopped){var B=this._parentSubscriber,O=b.$.useDeprecatedSynchronousErrorHandling;if(this._error)!O||!B.syncErrorThrowable?(this.__tryOrUnsub(this._error,k),this.unsubscribe()):(this.__tryOrSetError(B,this._error,k),this.unsubscribe());else if(B.syncErrorThrowable)O?(B.syncErrorValue=k,B.syncErrorThrown=!0):(0,g.T)(k),this.unsubscribe();else{if(this.unsubscribe(),O)throw k;(0,g.T)(k)}}},S.prototype.complete=function(){var k=this;if(!this.isStopped){var B=this._parentSubscriber;if(this._complete){var O=function(){return k._complete.call(k._context)};!b.$.useDeprecatedSynchronousErrorHandling||!B.syncErrorThrowable?(this.__tryOrUnsub(O),this.unsubscribe()):(this.__tryOrSetError(B,O),this.unsubscribe())}else this.unsubscribe()}},S.prototype.__tryOrUnsub=function(k,B){try{k.call(this._context,B)}catch(O){if(this.unsubscribe(),b.$.useDeprecatedSynchronousErrorHandling)throw O;(0,g.T)(O)}},S.prototype.__tryOrSetError=function(k,B,O){if(!b.$.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{B.call(this._context,O)}catch(L){return b.$.useDeprecatedSynchronousErrorHandling?(k.syncErrorValue=L,k.syncErrorThrown=!0,!0):((0,g.T)(L),!0)}return!1},S.prototype._unsubscribe=function(){var k=this._parentSubscriber;this._context=null,this._parentSubscriber=null,k.unsubscribe()},S}(w)},61220:function(fe,p,x){"use strict";x.d(p,{y:()=>m});var v=x(81379),T=x(86883),C=x(564),I=x(39642),m=function(){function g(w){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,w&&(this._ctorUnsubscribe=!0,this._unsubscribe=w)}return g.prototype.unsubscribe=function(){var w;if(!this.closed){var _=this,A=_._parentOrParents,S=_._ctorUnsubscribe,k=_._unsubscribe,B=_._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,A instanceof g)A.remove(this);else if(A!==null)for(var O=0;O<A.length;++O){var L=A[O];L.remove(this)}if((0,C.T)(k)){S&&(this._unsubscribe=void 0);try{k.call(this)}catch(H){w=H instanceof I.Z?b(H.errors):[H]}}if((0,v.c)(B))for(var O=-1,D=B.length;++O<D;){var W=B[O];if((0,T.G)(W))try{W.unsubscribe()}catch(G){w=w||[],G instanceof I.Z?w=w.concat(b(G.errors)):w.push(G)}}if(w)throw new I.Z(w)}},g.prototype.add=function(w){var _=w;if(!w)return g.EMPTY;switch(typeof w){case"function":_=new g(w);case"object":if(_===this||_.closed||typeof _.unsubscribe!="function")return _;if(this.closed)return _.unsubscribe(),_;if(!(_ instanceof g)){var A=_;_=new g,_._subscriptions=[A]}break;default:throw new Error("unrecognized teardown "+w+" added to Subscription.")}var S=_._parentOrParents;if(S===null)_._parentOrParents=this;else if(S instanceof g){if(S===this)return _;_._parentOrParents=[S,this]}else if(S.indexOf(this)===-1)S.push(this);else return _;var k=this._subscriptions;return k===null?this._subscriptions=[_]:k.push(_),_},g.prototype.remove=function(w){var _=this._subscriptions;if(_){var A=_.indexOf(w);A!==-1&&_.splice(A,1)}},g.EMPTY=function(w){return w.closed=!0,w}(new g),g}();function b(g){return g.reduce(function(w,_){return w.concat(_ instanceof I.Z?_.errors:_)},[])}},76371:function(fe,p,x){"use strict";x.d(p,{$:()=>T});var v=!1,T={Promise:void 0,set useDeprecatedSynchronousErrorHandling(C){if(C){var I=new Error;""+I.stack}v=C},get useDeprecatedSynchronousErrorHandling(){return v}}},39713:function(fe,p,x){"use strict";x.d(p,{gn:()=>g,tS:()=>_,zA:()=>m});var v=x(65927),T=x(90443),C=x(84253),I=x(71471),m=function(A){v.C6(S,A);function S(k){var B=A.call(this)||this;return B.parent=k,B}return S.prototype._next=function(k){this.parent.notifyNext(k)},S.prototype._error=function(k){this.parent.notifyError(k),this.unsubscribe()},S.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},S}(T.v),b=null,g=function(A){v.C6(S,A);function S(){return A!==null&&A.apply(this,arguments)||this}return S.prototype.notifyNext=function(k){this.destination.next(k)},S.prototype.notifyError=function(k){this.destination.error(k)},S.prototype.notifyComplete=function(){this.destination.complete()},S}(T.v),w=null;function _(A,S){if(!S.closed){if(A instanceof C.c)return A.subscribe(S);var k;try{k=(0,I.i)(A)(S)}catch(B){S.error(B)}return k}}},42532:function(fe,p,x){"use strict";x.d(p,{G:()=>b,f:()=>g});var v=x(65927),T=x(2721),C=x(84253),I=x(61220),m=x(24887),b=function(S){v.C6(k,S);function k(B,O){var L=S.call(this)||this;return L.source=B,L.subjectFactory=O,L._refCount=0,L._isComplete=!1,L}return k.prototype._subscribe=function(B){return this.getSubject().subscribe(B)},k.prototype.getSubject=function(){var B=this._subject;return(!B||B.isStopped)&&(this._subject=this.subjectFactory()),this._subject},k.prototype.connect=function(){var B=this._connection;return B||(this._isComplete=!1,B=this._connection=new I.y,B.add(this.source.subscribe(new w(this.getSubject(),this))),B.closed&&(this._connection=null,B=I.y.EMPTY)),B},k.prototype.refCount=function(){return(0,m.B)()(this)},k}(C.c),g=function(){var S=b.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:S._subscribe},_isComplete:{value:S._isComplete,writable:!0},getSubject:{value:S.getSubject},connect:{value:S.connect},refCount:{value:S.refCount}}}(),w=function(S){v.C6(k,S);function k(B,O){var L=S.call(this,B)||this;return L.connectable=O,L}return k.prototype._error=function(B){this._unsubscribe(),S.prototype._error.call(this,B)},k.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),S.prototype._complete.call(this)},k.prototype._unsubscribe=function(){var B=this.connectable;if(B){this.connectable=null;var O=B._connection;B._refCount=0,B._subject=null,B._connection=null,O&&O.unsubscribe()}},k}(T.PJ),_=null,A=null},92943:function(fe,p,x){"use strict";x.d(p,{v:()=>I});var v=x(84253),T=x(24699),C=x(90246);function I(m){return new v.c(function(b){var g;try{g=m()}catch(_){b.error(_);return}var w=g?(0,T.H)(g):(0,C.I)();return w.subscribe(b)})}},90246:function(fe,p,x){"use strict";x.d(p,{I:()=>C,w:()=>T});var v=x(84253),T=new v.c(function(m){return m.complete()});function C(m){return m?I(m):T}function I(m){return new v.c(function(b){return m.schedule(function(){return b.complete()})})}},24699:function(fe,p,x){"use strict";x.d(p,{H:()=>I});var v=x(84253),T=x(71471),C=x(38467);function I(m,b){return b?(0,C.c)(m,b):m instanceof v.c?m:new v.c((0,T.i)(m))}},24010:function(fe,p,x){"use strict";x.d(p,{c:()=>I});var v=x(84253),T=x(71642),C=x(37795);function I(m,b){return b?(0,C.V)(m,b):new v.c((0,T.v)(m))}},56927:function(fe,p,x){"use strict";x.d(p,{h:()=>m});var v=x(84253),T=x(20915),C=x(15652),I=x(24010);function m(){for(var b=[],g=0;g<arguments.length;g++)b[g]=arguments[g];var w=Number.POSITIVE_INFINITY,_=null,A=b[b.length-1];return(0,T.m)(A)?(_=b.pop(),b.length>1&&typeof b[b.length-1]=="number"&&(w=b.pop())):typeof A=="number"&&(w=b.pop()),_===null&&b.length===1&&b[0]instanceof v.c?b[0]:(0,C.U)(w)((0,I.c)(b,_))}},29513:function(fe,p,x){"use strict";x.d(p,{p:()=>C});var v=x(65927),T=x(90443);function C(b,g){return function(_){return _.lift(new I(b,g))}}var I=function(){function b(g,w){this.predicate=g,this.thisArg=w}return b.prototype.call=function(g,w){return w.subscribe(new m(g,this.predicate,this.thisArg))},b}(),m=function(b){v.C6(g,b);function g(w,_,A){var S=b.call(this,w)||this;return S.predicate=_,S.thisArg=A,S.count=0,S}return g.prototype._next=function(w){var _;try{_=this.predicate.call(this.thisArg,w,this.count++)}catch(A){this.destination.error(A);return}_&&this.destination.next(w)},g}(T.v)},42933:function(fe,p,x){"use strict";x.d(p,{T:()=>C});var v=x(65927),T=x(90443);function C(b,g){return function(_){if(typeof b!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return _.lift(new I(b,g))}}var I=function(){function b(g,w){this.project=g,this.thisArg=w}return b.prototype.call=function(g,w){return w.subscribe(new m(g,this.project,this.thisArg))},b}(),m=function(b){v.C6(g,b);function g(w,_,A){var S=b.call(this,w)||this;return S.project=_,S.count=0,S.thisArg=A||S,S}return g.prototype._next=function(w){var _;try{_=this.project.call(this.thisArg,w,this.count++)}catch(A){this.destination.error(A);return}this.destination.next(_)},g}(T.v)},15652:function(fe,p,x){"use strict";x.d(p,{U:()=>A});var v=x(65927),T=x(42933),C=x(24699),I=x(39713);function m(S,k,B){return B===void 0&&(B=Number.POSITIVE_INFINITY),typeof k=="function"?function(O){return O.pipe(m(function(L,D){return(0,C.H)(S(L,D)).pipe((0,T.T)(function(W,H){return k(L,W,D,H)}))},B))}:(typeof k=="number"&&(B=k),function(O){return O.lift(new b(S,B))})}var b=function(){function S(k,B){B===void 0&&(B=Number.POSITIVE_INFINITY),this.project=k,this.concurrent=B}return S.prototype.call=function(k,B){return B.subscribe(new g(k,this.project,this.concurrent))},S}(),g=function(S){v.C6(k,S);function k(B,O,L){L===void 0&&(L=Number.POSITIVE_INFINITY);var D=S.call(this,B)||this;return D.project=O,D.concurrent=L,D.hasCompleted=!1,D.buffer=[],D.active=0,D.index=0,D}return k.prototype._next=function(B){this.active<this.concurrent?this._tryNext(B):this.buffer.push(B)},k.prototype._tryNext=function(B){var O,L=this.index++;try{O=this.project(B,L)}catch(D){this.destination.error(D);return}this.active++,this._innerSub(O)},k.prototype._innerSub=function(B){var O=new I.zA(this),L=this.destination;L.add(O);var D=(0,I.tS)(B,O);D!==O&&L.add(D)},k.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},k.prototype.notifyNext=function(B){this.destination.next(B)},k.prototype.notifyComplete=function(){var B=this.buffer;this.active--,B.length>0?this._next(B.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},k}(I.gn),w=null,_=x(12486);function A(S){return S===void 0&&(S=Number.POSITIVE_INFINITY),m(_.D,S)}},24887:function(fe,p,x){"use strict";x.d(p,{B:()=>C});var v=x(65927),T=x(90443);function C(){return function(g){return g.lift(new I(g))}}var I=function(){function b(g){this.connectable=g}return b.prototype.call=function(g,w){var _=this.connectable;_._refCount++;var A=new m(g,_),S=w.subscribe(A);return A.closed||(A.connection=_.connect()),S},b}(),m=function(b){v.C6(g,b);function g(w,_){var A=b.call(this,w)||this;return A.connectable=_,A}return g.prototype._unsubscribe=function(){var w=this.connectable;if(!w){this.connection=null;return}this.connectable=null;var _=w._refCount;if(_<=0){this.connection=null;return}if(w._refCount=_-1,_>1){this.connection=null;return}var A=this.connection,S=w._connection;this.connection=null,S&&(!A||S===A)&&S.unsubscribe()},g}(T.v)},37795:function(fe,p,x){"use strict";x.d(p,{V:()=>C});var v=x(84253),T=x(61220);function C(I,m){return new v.c(function(b){var g=new T.y,w=0;return g.add(m.schedule(function(){if(w===I.length){b.complete();return}b.next(I[w++]),b.closed||g.add(this.schedule())})),g})}},38467:function(fe,p,x){"use strict";x.d(p,{c:()=>B});var v=x(84253),T=x(61220),C=x(57221);function I(O,L){return new v.c(function(D){var W=new T.y;return W.add(L.schedule(function(){var H=O[C.s]();W.add(H.subscribe({next:function(G){W.add(L.schedule(function(){return D.next(G)}))},error:function(G){W.add(L.schedule(function(){return D.error(G)}))},complete:function(){W.add(L.schedule(function(){return D.complete()}))}}))})),W})}function m(O,L){return new v.c(function(D){var W=new T.y;return W.add(L.schedule(function(){return O.then(function(H){W.add(L.schedule(function(){D.next(H),W.add(L.schedule(function(){return D.complete()}))}))},function(H){W.add(L.schedule(function(){return D.error(H)}))})})),W})}var b=x(37795),g=x(44966);function w(O,L){if(!O)throw new Error("Iterable cannot be null");return new v.c(function(D){var W=new T.y,H;return W.add(function(){H&&typeof H.return=="function"&&H.return()}),W.add(L.schedule(function(){H=O[g.lJ](),W.add(L.schedule(function(){if(!D.closed){var G,Z;try{var Q=H.next();G=Q.value,Z=Q.done}catch(ie){D.error(ie);return}Z?D.complete():(D.next(G),this.schedule())}}))})),W})}function _(O){return O&&typeof O[C.s]=="function"}var A=x(69787),S=x(30652);function k(O){return O&&typeof O[g.lJ]=="function"}function B(O,L){if(O!=null){if(_(O))return I(O,L);if((0,A.y)(O))return m(O,L);if((0,S.X)(O))return(0,b.V)(O,L);if(k(O)||typeof O=="string")return w(O,L)}throw new TypeError((O!==null&&typeof O||O)+" is not observable")}},44966:function(fe,p,x){"use strict";x.d(p,{lJ:()=>T});function v(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var T=v(),C=null},57221:function(fe,p,x){"use strict";x.d(p,{s:()=>v});var v=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}()},64608:function(fe,p,x){"use strict";x.d(p,{D:()=>v});var v=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),T=null},44931:function(fe,p,x){"use strict";x.d(p,{k:()=>T});var v=function(){function C(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return C.prototype=Object.create(Error.prototype),C}(),T=v},9801:function(fe,p,x){"use strict";x.d(p,{G:()=>T});var v=function(){function C(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return C.prototype=Object.create(Error.prototype),C}(),T=v},35656:function(fe,p,x){"use strict";x.d(p,{P:()=>T});var v=function(){function C(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return C.prototype=Object.create(Error.prototype),C}(),T=v},39642:function(fe,p,x){"use strict";x.d(p,{Z:()=>T});var v=function(){function C(I){return Error.call(this),this.message=I?I.length+` errors occurred during unsubscription:
|
||
`+I.map(function(m,b){return b+1+") "+m.toString()}).join(`
|
||
`):"",this.name="UnsubscriptionError",this.errors=I,this}return C.prototype=Object.create(Error.prototype),C}(),T=v},70414:function(fe,p,x){"use strict";x.d(p,{H:()=>T});var v=x(90443);function T(C){for(;C;){var I=C,m=I.closed,b=I.destination,g=I.isStopped;if(m||g)return!1;b&&b instanceof v.v?C=b:C=null}return!0}},14e3:function(fe,p,x){"use strict";x.d(p,{T:()=>v});function v(T){setTimeout(function(){throw T},0)}},12486:function(fe,p,x){"use strict";x.d(p,{D:()=>v});function v(T){return T}},81379:function(fe,p,x){"use strict";x.d(p,{c:()=>v});var v=function(){return Array.isArray||function(T){return T&&typeof T.length=="number"}}()},30652:function(fe,p,x){"use strict";x.d(p,{X:()=>v});var v=function(T){return T&&typeof T.length=="number"&&typeof T!="function"}},564:function(fe,p,x){"use strict";x.d(p,{T:()=>v});function v(T){return typeof T=="function"}},86883:function(fe,p,x){"use strict";x.d(p,{G:()=>v});function v(T){return T!==null&&typeof T=="object"}},69787:function(fe,p,x){"use strict";x.d(p,{y:()=>v});function v(T){return!!T&&typeof T.subscribe!="function"&&typeof T.then=="function"}},20915:function(fe,p,x){"use strict";x.d(p,{m:()=>v});function v(T){return T&&typeof T.schedule=="function"}},62180:function(fe,p,x){"use strict";x.d(p,{l:()=>v});function v(){}},40868:function(fe,p,x){"use strict";x.d(p,{F:()=>T,m:()=>C});var v=x(12486);function T(){for(var I=[],m=0;m<arguments.length;m++)I[m]=arguments[m];return C(I)}function C(I){return I.length===0?v.D:I.length===1?I[0]:function(b){return I.reduce(function(g,w){return w(g)},b)}}},71471:function(fe,p,x){"use strict";x.d(p,{i:()=>S});var v=x(71642),T=x(14e3),C=function(k){return function(B){return k.then(function(O){B.closed||(B.next(O),B.complete())},function(O){return B.error(O)}).then(null,T.T),B}},I=x(44966),m=function(k){return function(B){var O=k[I.lJ]();do{var L=void 0;try{L=O.next()}catch(D){return B.error(D),B}if(L.done){B.complete();break}if(B.next(L.value),B.closed)break}while(!0);return typeof O.return=="function"&&B.add(function(){O.return&&O.return()}),B}},b=x(57221),g=function(k){return function(B){var O=k[b.s]();if(typeof O.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return O.subscribe(B)}},w=x(30652),_=x(69787),A=x(86883),S=function(k){if(k&&typeof k[b.s]=="function")return g(k);if((0,w.X)(k))return(0,v.v)(k);if((0,_.y)(k))return C(k);if(k&&typeof k[I.lJ]=="function")return m(k);var B=(0,A.G)(k)?"an invalid object":"'"+k+"'",O="You provided "+B+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(O)}},71642:function(fe,p,x){"use strict";x.d(p,{v:()=>v});var v=function(T){return function(C){for(var I=0,m=T.length;I<m&&!C.closed;I++)C.next(T[I]);C.complete()}}},56608:function(fe,p,x){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var v=x(36533),T=v.Buffer;function C(m,b){for(var g in m)b[g]=m[g]}T.from&&T.alloc&&T.allocUnsafe&&T.allocUnsafeSlow?fe.exports=v:(C(v,p),p.Buffer=I);function I(m,b,g){return T(m,b,g)}I.prototype=Object.create(T.prototype),C(T,I),I.from=function(m,b,g){if(typeof m=="number")throw new TypeError("Argument must not be a number");return T(m,b,g)},I.alloc=function(m,b,g){if(typeof m!="number")throw new TypeError("Argument must be a number");var w=T(m);return b!==void 0?typeof g=="string"?w.fill(b,g):w.fill(b):w.fill(0),w},I.allocUnsafe=function(m){if(typeof m!="number")throw new TypeError("Argument must be a number");return T(m)},I.allocUnsafeSlow=function(m){if(typeof m!="number")throw new TypeError("Argument must be a number");return v.SlowBuffer(m)}},43282:function(fe,p,x){"use strict";var v=x(98801),T=x(10092),C=v("RegExp.prototype.exec"),I=x(71102);fe.exports=function(b){if(!T(b))throw new I("`regex` must be a RegExp");return function(w){return C(b,w)!==null}}},44455:function(fe,p,x){fe.exports=x(36209)(x(72175))},72175:function(fe,p,x){const v=x(23071).ec,T=new v("secp256k1"),C=T.curve,I=C.n.constructor;function m(_,A){let S=new I(A);if(S.cmp(C.p)>=0)return null;S=S.toRed(C.red);let k=S.redSqr().redIMul(S).redIAdd(C.b).redSqrt();return _===3!==k.isOdd()&&(k=k.redNeg()),T.keyPair({pub:{x:S,y:k}})}function b(_,A,S){let k=new I(A),B=new I(S);if(k.cmp(C.p)>=0||B.cmp(C.p)>=0||(k=k.toRed(C.red),B=B.toRed(C.red),(_===6||_===7)&&B.isOdd()!==(_===7)))return null;const O=k.redSqr().redIMul(k);return B.redSqr().redISub(O.redIAdd(C.b)).isZero()?T.keyPair({pub:{x:k,y:B}}):null}function g(_){const A=_[0];switch(A){case 2:case 3:return _.length!==33?null:m(A,_.subarray(1,33));case 4:case 6:case 7:return _.length!==65?null:b(A,_.subarray(1,33),_.subarray(33,65));default:return null}}function w(_,A){const S=A.encode(null,_.length===33);for(let k=0;k<_.length;++k)_[k]=S[k]}fe.exports={contextRandomize(){return 0},privateKeyVerify(_){const A=new I(_);return A.cmp(C.n)<0&&!A.isZero()?0:1},privateKeyNegate(_){const A=new I(_),S=C.n.sub(A).umod(C.n).toArrayLike(Uint8Array,"be",32);return _.set(S),0},privateKeyTweakAdd(_,A){const S=new I(A);if(S.cmp(C.n)>=0||(S.iadd(new I(_)),S.cmp(C.n)>=0&&S.isub(C.n),S.isZero()))return 1;const k=S.toArrayLike(Uint8Array,"be",32);return _.set(k),0},privateKeyTweakMul(_,A){let S=new I(A);if(S.cmp(C.n)>=0||S.isZero())return 1;S.imul(new I(_)),S.cmp(C.n)>=0&&(S=S.umod(C.n));const k=S.toArrayLike(Uint8Array,"be",32);return _.set(k),0},publicKeyVerify(_){return g(_)===null?1:0},publicKeyCreate(_,A){const S=new I(A);if(S.cmp(C.n)>=0||S.isZero())return 1;const k=T.keyFromPrivate(A).getPublic();return w(_,k),0},publicKeyConvert(_,A){const S=g(A);if(S===null)return 1;const k=S.getPublic();return w(_,k),0},publicKeyNegate(_,A){const S=g(A);if(S===null)return 1;const k=S.getPublic();return k.y=k.y.redNeg(),w(_,k),0},publicKeyCombine(_,A){const S=new Array(A.length);for(let B=0;B<A.length;++B)if(S[B]=g(A[B]),S[B]===null)return 1;let k=S[0].getPublic();for(let B=1;B<S.length;++B)k=k.add(S[B].pub);return k.isInfinity()?2:(w(_,k),0)},publicKeyTweakAdd(_,A,S){const k=g(A);if(k===null)return 1;if(S=new I(S),S.cmp(C.n)>=0)return 2;const B=k.getPublic().add(C.g.mul(S));return B.isInfinity()?2:(w(_,B),0)},publicKeyTweakMul(_,A,S){const k=g(A);if(k===null)return 1;if(S=new I(S),S.cmp(C.n)>=0||S.isZero())return 2;const B=k.getPublic().mul(S);return w(_,B),0},signatureNormalize(_){const A=new I(_.subarray(0,32)),S=new I(_.subarray(32,64));return A.cmp(C.n)>=0||S.cmp(C.n)>=0?1:(S.cmp(T.nh)===1&&_.set(C.n.sub(S).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(_,A){const S=A.subarray(0,32),k=A.subarray(32,64);if(new I(S).cmp(C.n)>=0||new I(k).cmp(C.n)>=0)return 1;const{output:B}=_;let O=B.subarray(4,37);O[0]=0,O.set(S,1);let L=33,D=0;for(;L>1&&O[D]===0&&!(O[D+1]&128);--L,++D);if(O=O.subarray(D),O[0]&128||L>1&&O[0]===0&&!(O[1]&128))return 1;let W=B.subarray(39,72);W[0]=0,W.set(k,1);let H=33,G=0;for(;H>1&&W[G]===0&&!(W[G+1]&128);--H,++G);return W=W.subarray(G),W[0]&128||H>1&&W[0]===0&&!(W[1]&128)?1:(_.outputlen=6+L+H,B[0]=48,B[1]=_.outputlen-2,B[2]=2,B[3]=O.length,B.set(O,4),B[4+L]=2,B[5+L]=W.length,B.set(W,6+L),0)},signatureImport(_,A){if(A.length<8||A.length>72||A[0]!==48||A[1]!==A.length-2||A[2]!==2)return 1;const S=A[3];if(S===0||5+S>=A.length||A[4+S]!==2)return 1;const k=A[5+S];if(k===0||6+S+k!==A.length||A[4]&128||S>1&&A[4]===0&&!(A[5]&128)||A[S+6]&128||k>1&&A[S+6]===0&&!(A[S+7]&128))return 1;let B=A.subarray(4,4+S);if(B.length===33&&B[0]===0&&(B=B.subarray(1)),B.length>32)return 1;let O=A.subarray(6+S);if(O.length===33&&O[0]===0&&(O=O.slice(1)),O.length>32)throw new Error("S length is too long");let L=new I(B);L.cmp(C.n)>=0&&(L=new I(0));let D=new I(A.subarray(6+S));return D.cmp(C.n)>=0&&(D=new I(0)),_.set(L.toArrayLike(Uint8Array,"be",32),0),_.set(D.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(_,A,S,k,B){if(B){const D=B;B=W=>{const H=D(A,S,null,k,W);if(!(H instanceof Uint8Array&&H.length===32))throw new Error("This is the way");return new I(H)}}const O=new I(S);if(O.cmp(C.n)>=0||O.isZero())return 1;let L;try{L=T.sign(A,S,{canonical:!0,k:B,pers:k})}catch{return 1}return _.signature.set(L.r.toArrayLike(Uint8Array,"be",32),0),_.signature.set(L.s.toArrayLike(Uint8Array,"be",32),32),_.recid=L.recoveryParam,0},ecdsaVerify(_,A,S){const k={r:_.subarray(0,32),s:_.subarray(32,64)},B=new I(k.r),O=new I(k.s);if(B.cmp(C.n)>=0||O.cmp(C.n)>=0)return 1;if(O.cmp(T.nh)===1||B.isZero()||O.isZero())return 3;const L=g(S);if(L===null)return 2;const D=L.getPublic();return T.verify(A,k,D)?0:3},ecdsaRecover(_,A,S,k){const B={r:A.slice(0,32),s:A.slice(32,64)},O=new I(B.r),L=new I(B.s);if(O.cmp(C.n)>=0||L.cmp(C.n)>=0)return 1;if(O.isZero()||L.isZero())return 2;let D;try{D=T.recoverPubKey(k,B,S)}catch{return 2}return w(_,D),0},ecdh(_,A,S,k,B,O,L){const D=g(A);if(D===null)return 1;const W=new I(S);if(W.cmp(C.n)>=0||W.isZero())return 2;const H=D.getPublic().mul(W);if(B===void 0){const G=H.encode(null,!0),Z=T.hash().update(G).digest();for(let Q=0;Q<32;++Q)_[Q]=Z[Q]}else{O||(O=new Uint8Array(32));const G=H.getX().toArray("be",32);for(let le=0;le<32;++le)O[le]=G[le];L||(L=new Uint8Array(32));const Z=H.getY().toArray("be",32);for(let le=0;le<32;++le)L[le]=Z[le];const Q=B(O,L,k);if(!(Q instanceof Uint8Array&&Q.length===_.length))return 2;_.set(Q)}return 0}}},36209:function(fe){const p={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function x(m,b){if(!m)throw new Error(b)}function v(m,b,g){if(x(b instanceof Uint8Array,`Expected ${m} to be an Uint8Array`),g!==void 0)if(Array.isArray(g)){const w=g.join(", "),_=`Expected ${m} to be an Uint8Array with length [${w}]`;x(g.includes(b.length),_)}else{const w=`Expected ${m} to be an Uint8Array with length ${g}`;x(b.length===g,w)}}function T(m){x(I(m)==="Boolean","Expected compressed to be a Boolean")}function C(m=g=>new Uint8Array(g),b){return typeof m=="function"&&(m=m(b)),v("output",m,b),m}function I(m){return Object.prototype.toString.call(m).slice(8,-1)}fe.exports=m=>({contextRandomize(b){switch(x(b===null||b instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),b!==null&&v("seed",b,32),m.contextRandomize(b)){case 1:throw new Error(p.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(b){return v("private key",b,32),m.privateKeyVerify(b)===0},privateKeyNegate(b){switch(v("private key",b,32),m.privateKeyNegate(b)){case 0:return b;case 1:throw new Error(p.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(b,g){switch(v("private key",b,32),v("tweak",g,32),m.privateKeyTweakAdd(b,g)){case 0:return b;case 1:throw new Error(p.TWEAK_ADD)}},privateKeyTweakMul(b,g){switch(v("private key",b,32),v("tweak",g,32),m.privateKeyTweakMul(b,g)){case 0:return b;case 1:throw new Error(p.TWEAK_MUL)}},publicKeyVerify(b){return v("public key",b,[33,65]),m.publicKeyVerify(b)===0},publicKeyCreate(b,g=!0,w){switch(v("private key",b,32),T(g),w=C(w,g?33:65),m.publicKeyCreate(w,b)){case 0:return w;case 1:throw new Error(p.SECKEY_INVALID);case 2:throw new Error(p.PUBKEY_SERIALIZE)}},publicKeyConvert(b,g=!0,w){switch(v("public key",b,[33,65]),T(g),w=C(w,g?33:65),m.publicKeyConvert(w,b)){case 0:return w;case 1:throw new Error(p.PUBKEY_PARSE);case 2:throw new Error(p.PUBKEY_SERIALIZE)}},publicKeyNegate(b,g=!0,w){switch(v("public key",b,[33,65]),T(g),w=C(w,g?33:65),m.publicKeyNegate(w,b)){case 0:return w;case 1:throw new Error(p.PUBKEY_PARSE);case 2:throw new Error(p.IMPOSSIBLE_CASE);case 3:throw new Error(p.PUBKEY_SERIALIZE)}},publicKeyCombine(b,g=!0,w){x(Array.isArray(b),"Expected public keys to be an Array"),x(b.length>0,"Expected public keys array will have more than zero items");for(const _ of b)v("public key",_,[33,65]);switch(T(g),w=C(w,g?33:65),m.publicKeyCombine(w,b)){case 0:return w;case 1:throw new Error(p.PUBKEY_PARSE);case 2:throw new Error(p.PUBKEY_COMBINE);case 3:throw new Error(p.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(b,g,w=!0,_){switch(v("public key",b,[33,65]),v("tweak",g,32),T(w),_=C(_,w?33:65),m.publicKeyTweakAdd(_,b,g)){case 0:return _;case 1:throw new Error(p.PUBKEY_PARSE);case 2:throw new Error(p.TWEAK_ADD)}},publicKeyTweakMul(b,g,w=!0,_){switch(v("public key",b,[33,65]),v("tweak",g,32),T(w),_=C(_,w?33:65),m.publicKeyTweakMul(_,b,g)){case 0:return _;case 1:throw new Error(p.PUBKEY_PARSE);case 2:throw new Error(p.TWEAK_MUL)}},signatureNormalize(b){switch(v("signature",b,64),m.signatureNormalize(b)){case 0:return b;case 1:throw new Error(p.SIG_PARSE)}},signatureExport(b,g){v("signature",b,64),g=C(g,72);const w={output:g,outputlen:72};switch(m.signatureExport(w,b)){case 0:return g.slice(0,w.outputlen);case 1:throw new Error(p.SIG_PARSE);case 2:throw new Error(p.IMPOSSIBLE_CASE)}},signatureImport(b,g){switch(v("signature",b),g=C(g,64),m.signatureImport(g,b)){case 0:return g;case 1:throw new Error(p.SIG_PARSE);case 2:throw new Error(p.IMPOSSIBLE_CASE)}},ecdsaSign(b,g,w={},_){v("message",b,32),v("private key",g,32),x(I(w)==="Object","Expected options to be an Object"),w.data!==void 0&&v("options.data",w.data),w.noncefn!==void 0&&x(I(w.noncefn)==="Function","Expected options.noncefn to be a Function"),_=C(_,64);const A={signature:_,recid:null};switch(m.ecdsaSign(A,b,g,w.data,w.noncefn)){case 0:return A;case 1:throw new Error(p.SIGN);case 2:throw new Error(p.IMPOSSIBLE_CASE)}},ecdsaVerify(b,g,w){switch(v("signature",b,64),v("message",g,32),v("public key",w,[33,65]),m.ecdsaVerify(b,g,w)){case 0:return!0;case 3:return!1;case 1:throw new Error(p.SIG_PARSE);case 2:throw new Error(p.PUBKEY_PARSE)}},ecdsaRecover(b,g,w,_=!0,A){switch(v("signature",b,64),x(I(g)==="Number"&&g>=0&&g<=3,"Expected recovery id to be a Number within interval [0, 3]"),v("message",w,32),T(_),A=C(A,_?33:65),m.ecdsaRecover(A,b,g,w)){case 0:return A;case 1:throw new Error(p.SIG_PARSE);case 2:throw new Error(p.RECOVER);case 3:throw new Error(p.IMPOSSIBLE_CASE)}},ecdh(b,g,w={},_){switch(v("public key",b,[33,65]),v("private key",g,32),x(I(w)==="Object","Expected options to be an Object"),w.data!==void 0&&v("options.data",w.data),w.hashfn!==void 0?(x(I(w.hashfn)==="Function","Expected options.hashfn to be a Function"),w.xbuf!==void 0&&v("options.xbuf",w.xbuf,32),w.ybuf!==void 0&&v("options.ybuf",w.ybuf,32),v("output",_)):_=C(_,32),m.ecdh(_,b,g,w.data,w.hashfn,w.xbuf,w.ybuf)){case 0:return _;case 1:throw new Error(p.PUBKEY_PARSE);case 2:throw new Error(p.ECDH)}}})},79003:function(fe,p,x){"use strict";const v=Symbol("SemVer ANY");class T{static get ANY(){return v}constructor(S,k){if(k=C(k),S instanceof T){if(S.loose===!!k.loose)return S;S=S.value}S=S.trim().split(/\s+/).join(" "),g("comparator",S,k),this.options=k,this.loose=!!k.loose,this.parse(S),this.semver===v?this.value="":this.value=this.operator+this.semver.version,g("comp",this)}parse(S){const k=this.options.loose?I[m.COMPARATORLOOSE]:I[m.COMPARATOR],B=S.match(k);if(!B)throw new TypeError(`Invalid comparator: ${S}`);this.operator=B[1]!==void 0?B[1]:"",this.operator==="="&&(this.operator=""),B[2]?this.semver=new w(B[2],this.options.loose):this.semver=v}toString(){return this.value}test(S){if(g("Comparator.test",S,this.options.loose),this.semver===v||S===v)return!0;if(typeof S=="string")try{S=new w(S,this.options)}catch{return!1}return b(S,this.operator,this.semver,this.options)}intersects(S,k){if(!(S instanceof T))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new _(S.value,k).test(this.value):S.operator===""?S.value===""?!0:new _(this.value,k).test(S.semver):(k=C(k),k.includePrerelease&&(this.value==="<0.0.0-0"||S.value==="<0.0.0-0")||!k.includePrerelease&&(this.value.startsWith("<0.0.0")||S.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&S.operator.startsWith(">")||this.operator.startsWith("<")&&S.operator.startsWith("<")||this.semver.version===S.semver.version&&this.operator.includes("=")&&S.operator.includes("=")||b(this.semver,"<",S.semver,k)&&this.operator.startsWith(">")&&S.operator.startsWith("<")||b(this.semver,">",S.semver,k)&&this.operator.startsWith("<")&&S.operator.startsWith(">")))}}fe.exports=T;const C=x(12860),{safeRe:I,t:m}=x(86999),b=x(93566),g=x(4159),w=x(2771),_=x(62326)},62326:function(fe,p,x){"use strict";const v=/\s+/g;class T{constructor(j,$){if($=m($),j instanceof T)return j.loose===!!$.loose&&j.includePrerelease===!!$.includePrerelease?j:new T(j.raw,$);if(j instanceof b)return this.raw=j.value,this.set=[[j]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=j.trim().replace(v," "),this.set=this.raw.split("||").map(ee=>this.parseRange(ee.trim())).filter(ee=>ee.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const ee=this.set[0];if(this.set=this.set.filter(J=>!D(J[0])),this.set.length===0)this.set=[ee];else if(this.set.length>1){for(const J of this.set)if(J.length===1&&W(J[0])){this.set=[J];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let j=0;j<this.set.length;j++){j>0&&(this.formatted+="||");const $=this.set[j];for(let ee=0;ee<$.length;ee++)ee>0&&(this.formatted+=" "),this.formatted+=$[ee].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(j){const ee=((this.options.includePrerelease&&O)|(this.options.loose&&L))+":"+j,J=I.get(ee);if(J)return J;const F=this.options.loose,X=F?_[A.HYPHENRANGELOOSE]:_[A.HYPHENRANGE];j=j.replace(X,z(this.options.includePrerelease)),g("hyphen replace",j),j=j.replace(_[A.COMPARATORTRIM],S),g("comparator trim",j),j=j.replace(_[A.TILDETRIM],k),g("tilde trim",j),j=j.replace(_[A.CARETTRIM],B),g("caret trim",j);let de=j.split(" ").map(Ie=>G(Ie,this.options)).join(" ").split(/\s+/).map(Ie=>N(Ie,this.options));F&&(de=de.filter(Ie=>(g("loose invalid filter",Ie,this.options),!!Ie.match(_[A.COMPARATORLOOSE])))),g("range list",de);const Y=new Map,ce=de.map(Ie=>new b(Ie,this.options));for(const Ie of ce){if(D(Ie))return[Ie];Y.set(Ie.value,Ie)}Y.size>1&&Y.has("")&&Y.delete("");const he=[...Y.values()];return I.set(ee,he),he}intersects(j,$){if(!(j instanceof T))throw new TypeError("a Range is required");return this.set.some(ee=>H(ee,$)&&j.set.some(J=>H(J,$)&&ee.every(F=>J.every(X=>F.intersects(X,$)))))}test(j){if(!j)return!1;if(typeof j=="string")try{j=new w(j,this.options)}catch{return!1}for(let $=0;$<this.set.length;$++)if(V(this.set[$],j,this.options))return!0;return!1}}fe.exports=T;const C=x(62351),I=new C,m=x(12860),b=x(79003),g=x(4159),w=x(2771),{safeRe:_,t:A,comparatorTrimReplace:S,tildeTrimReplace:k,caretTrimReplace:B}=x(86999),{FLAG_INCLUDE_PRERELEASE:O,FLAG_LOOSE:L}=x(10229),D=U=>U.value==="<0.0.0-0",W=U=>U.value==="",H=(U,j)=>{let $=!0;const ee=U.slice();let J=ee.pop();for(;$&&ee.length;)$=ee.every(F=>J.intersects(F,j)),J=ee.pop();return $},G=(U,j)=>(g("comp",U,j),U=le(U,j),g("caret",U),U=Q(U,j),g("tildes",U),U=we(U,j),g("xrange",U),U=re(U,j),g("stars",U),U),Z=U=>!U||U.toLowerCase()==="x"||U==="*",Q=(U,j)=>U.trim().split(/\s+/).map($=>ie($,j)).join(" "),ie=(U,j)=>{const $=j.loose?_[A.TILDELOOSE]:_[A.TILDE];return U.replace($,(ee,J,F,X,de)=>{g("tilde",U,ee,J,F,X,de);let Y;return Z(J)?Y="":Z(F)?Y=`>=${J}.0.0 <${+J+1}.0.0-0`:Z(X)?Y=`>=${J}.${F}.0 <${J}.${+F+1}.0-0`:de?(g("replaceTilde pr",de),Y=`>=${J}.${F}.${X}-${de} <${J}.${+F+1}.0-0`):Y=`>=${J}.${F}.${X} <${J}.${+F+1}.0-0`,g("tilde return",Y),Y})},le=(U,j)=>U.trim().split(/\s+/).map($=>be($,j)).join(" "),be=(U,j)=>{g("caret",U,j);const $=j.loose?_[A.CARETLOOSE]:_[A.CARET],ee=j.includePrerelease?"-0":"";return U.replace($,(J,F,X,de,Y)=>{g("caret",U,J,F,X,de,Y);let ce;return Z(F)?ce="":Z(X)?ce=`>=${F}.0.0${ee} <${+F+1}.0.0-0`:Z(de)?F==="0"?ce=`>=${F}.${X}.0${ee} <${F}.${+X+1}.0-0`:ce=`>=${F}.${X}.0${ee} <${+F+1}.0.0-0`:Y?(g("replaceCaret pr",Y),F==="0"?X==="0"?ce=`>=${F}.${X}.${de}-${Y} <${F}.${X}.${+de+1}-0`:ce=`>=${F}.${X}.${de}-${Y} <${F}.${+X+1}.0-0`:ce=`>=${F}.${X}.${de}-${Y} <${+F+1}.0.0-0`):(g("no pr"),F==="0"?X==="0"?ce=`>=${F}.${X}.${de}${ee} <${F}.${X}.${+de+1}-0`:ce=`>=${F}.${X}.${de}${ee} <${F}.${+X+1}.0-0`:ce=`>=${F}.${X}.${de} <${+F+1}.0.0-0`),g("caret return",ce),ce})},we=(U,j)=>(g("replaceXRanges",U,j),U.split(/\s+/).map($=>Ae($,j)).join(" ")),Ae=(U,j)=>{U=U.trim();const $=j.loose?_[A.XRANGELOOSE]:_[A.XRANGE];return U.replace($,(ee,J,F,X,de,Y)=>{g("xRange",U,ee,J,F,X,de,Y);const ce=Z(F),he=ce||Z(X),Ie=he||Z(de),ke=Ie;return J==="="&&ke&&(J=""),Y=j.includePrerelease?"-0":"",ce?J===">"||J==="<"?ee="<0.0.0-0":ee="*":J&&ke?(he&&(X=0),de=0,J===">"?(J=">=",he?(F=+F+1,X=0,de=0):(X=+X+1,de=0)):J==="<="&&(J="<",he?F=+F+1:X=+X+1),J==="<"&&(Y="-0"),ee=`${J+F}.${X}.${de}${Y}`):he?ee=`>=${F}.0.0${Y} <${+F+1}.0.0-0`:Ie&&(ee=`>=${F}.${X}.0${Y} <${F}.${+X+1}.0-0`),g("xRange return",ee),ee})},re=(U,j)=>(g("replaceStars",U,j),U.trim().replace(_[A.STAR],"")),N=(U,j)=>(g("replaceGTE0",U,j),U.trim().replace(_[j.includePrerelease?A.GTE0PRE:A.GTE0],"")),z=U=>(j,$,ee,J,F,X,de,Y,ce,he,Ie,ke)=>(Z(ee)?$="":Z(J)?$=`>=${ee}.0.0${U?"-0":""}`:Z(F)?$=`>=${ee}.${J}.0${U?"-0":""}`:X?$=`>=${$}`:$=`>=${$}${U?"-0":""}`,Z(ce)?Y="":Z(he)?Y=`<${+ce+1}.0.0-0`:Z(Ie)?Y=`<${ce}.${+he+1}.0-0`:ke?Y=`<=${ce}.${he}.${Ie}-${ke}`:U?Y=`<${ce}.${he}.${+Ie+1}-0`:Y=`<=${Y}`,`${$} ${Y}`.trim()),V=(U,j,$)=>{for(let ee=0;ee<U.length;ee++)if(!U[ee].test(j))return!1;if(j.prerelease.length&&!$.includePrerelease){for(let ee=0;ee<U.length;ee++)if(g(U[ee].semver),U[ee].semver!==b.ANY&&U[ee].semver.prerelease.length>0){const J=U[ee].semver;if(J.major===j.major&&J.minor===j.minor&&J.patch===j.patch)return!0}return!1}return!0}},2771:function(fe,p,x){"use strict";const v=x(4159),{MAX_LENGTH:T,MAX_SAFE_INTEGER:C}=x(10229),{safeRe:I,t:m}=x(86999),b=x(12860),{compareIdentifiers:g}=x(53436);class w{constructor(A,S){if(S=b(S),A instanceof w){if(A.loose===!!S.loose&&A.includePrerelease===!!S.includePrerelease)return A;A=A.version}else if(typeof A!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof A}".`);if(A.length>T)throw new TypeError(`version is longer than ${T} characters`);v("SemVer",A,S),this.options=S,this.loose=!!S.loose,this.includePrerelease=!!S.includePrerelease;const k=A.trim().match(S.loose?I[m.LOOSE]:I[m.FULL]);if(!k)throw new TypeError(`Invalid Version: ${A}`);if(this.raw=A,this.major=+k[1],this.minor=+k[2],this.patch=+k[3],this.major>C||this.major<0)throw new TypeError("Invalid major version");if(this.minor>C||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>C||this.patch<0)throw new TypeError("Invalid patch version");k[4]?this.prerelease=k[4].split(".").map(B=>{if(/^[0-9]+$/.test(B)){const O=+B;if(O>=0&&O<C)return O}return B}):this.prerelease=[],this.build=k[5]?k[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(A){if(v("SemVer.compare",this.version,this.options,A),!(A instanceof w)){if(typeof A=="string"&&A===this.version)return 0;A=new w(A,this.options)}return A.version===this.version?0:this.compareMain(A)||this.comparePre(A)}compareMain(A){return A instanceof w||(A=new w(A,this.options)),g(this.major,A.major)||g(this.minor,A.minor)||g(this.patch,A.patch)}comparePre(A){if(A instanceof w||(A=new w(A,this.options)),this.prerelease.length&&!A.prerelease.length)return-1;if(!this.prerelease.length&&A.prerelease.length)return 1;if(!this.prerelease.length&&!A.prerelease.length)return 0;let S=0;do{const k=this.prerelease[S],B=A.prerelease[S];if(v("prerelease compare",S,k,B),k===void 0&&B===void 0)return 0;if(B===void 0)return 1;if(k===void 0)return-1;if(k===B)continue;return g(k,B)}while(++S)}compareBuild(A){A instanceof w||(A=new w(A,this.options));let S=0;do{const k=this.build[S],B=A.build[S];if(v("build compare",S,k,B),k===void 0&&B===void 0)return 0;if(B===void 0)return 1;if(k===void 0)return-1;if(k===B)continue;return g(k,B)}while(++S)}inc(A,S,k){if(A.startsWith("pre")){if(!S&&k===!1)throw new Error("invalid increment argument: identifier is empty");if(S){const B=`-${S}`.match(this.options.loose?I[m.PRERELEASELOOSE]:I[m.PRERELEASE]);if(!B||B[1]!==S)throw new Error(`invalid identifier: ${S}`)}}switch(A){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",S,k);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",S,k);break;case"prepatch":this.prerelease.length=0,this.inc("patch",S,k),this.inc("pre",S,k);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",S,k),this.inc("pre",S,k);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const B=Number(k)?1:0;if(this.prerelease.length===0)this.prerelease=[B];else{let O=this.prerelease.length;for(;--O>=0;)typeof this.prerelease[O]=="number"&&(this.prerelease[O]++,O=-2);if(O===-1){if(S===this.prerelease.join(".")&&k===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(B)}}if(S){let O=[S,B];k===!1&&(O=[S]),g(this.prerelease[0],S)===0?isNaN(this.prerelease[1])&&(this.prerelease=O):this.prerelease=O}break}default:throw new Error(`invalid increment argument: ${A}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}fe.exports=w},69903:function(fe,p,x){"use strict";const v=x(1289),T=(C,I)=>{const m=v(C.trim().replace(/^[=v]+/,""),I);return m?m.version:null};fe.exports=T},93566:function(fe,p,x){"use strict";const v=x(1314),T=x(47238),C=x(17743),I=x(70236),m=x(88200),b=x(33765),g=(w,_,A,S)=>{switch(_){case"===":return typeof w=="object"&&(w=w.version),typeof A=="object"&&(A=A.version),w===A;case"!==":return typeof w=="object"&&(w=w.version),typeof A=="object"&&(A=A.version),w!==A;case"":case"=":case"==":return v(w,A,S);case"!=":return T(w,A,S);case">":return C(w,A,S);case">=":return I(w,A,S);case"<":return m(w,A,S);case"<=":return b(w,A,S);default:throw new TypeError(`Invalid operator: ${_}`)}};fe.exports=g},75585:function(fe,p,x){"use strict";const v=x(2771),T=x(1289),{safeRe:C,t:I}=x(86999),m=(b,g)=>{if(b instanceof v)return b;if(typeof b=="number"&&(b=String(b)),typeof b!="string")return null;g=g||{};let w=null;if(!g.rtl)w=b.match(g.includePrerelease?C[I.COERCEFULL]:C[I.COERCE]);else{const O=g.includePrerelease?C[I.COERCERTLFULL]:C[I.COERCERTL];let L;for(;(L=O.exec(b))&&(!w||w.index+w[0].length!==b.length);)(!w||L.index+L[0].length!==w.index+w[0].length)&&(w=L),O.lastIndex=L.index+L[1].length+L[2].length;O.lastIndex=-1}if(w===null)return null;const _=w[2],A=w[3]||"0",S=w[4]||"0",k=g.includePrerelease&&w[5]?`-${w[5]}`:"",B=g.includePrerelease&&w[6]?`+${w[6]}`:"";return T(`${_}.${A}.${S}${k}${B}`,g)};fe.exports=m},84104:function(fe,p,x){"use strict";const v=x(2771),T=(C,I,m)=>{const b=new v(C,m),g=new v(I,m);return b.compare(g)||b.compareBuild(g)};fe.exports=T},86002:function(fe,p,x){"use strict";const v=x(35469),T=(C,I)=>v(C,I,!0);fe.exports=T},35469:function(fe,p,x){"use strict";const v=x(2771),T=(C,I,m)=>new v(C,m).compare(new v(I,m));fe.exports=T},32223:function(fe,p,x){"use strict";const v=x(1289),T=(C,I)=>{const m=v(C,null,!0),b=v(I,null,!0),g=m.compare(b);if(g===0)return null;const w=g>0,_=w?m:b,A=w?b:m,S=!!_.prerelease.length;if(!!A.prerelease.length&&!S){if(!A.patch&&!A.minor)return"major";if(A.compareMain(_)===0)return A.minor&&!A.patch?"minor":"patch"}const B=S?"pre":"";return m.major!==b.major?B+"major":m.minor!==b.minor?B+"minor":m.patch!==b.patch?B+"patch":"prerelease"};fe.exports=T},1314:function(fe,p,x){"use strict";const v=x(35469),T=(C,I,m)=>v(C,I,m)===0;fe.exports=T},17743:function(fe,p,x){"use strict";const v=x(35469),T=(C,I,m)=>v(C,I,m)>0;fe.exports=T},70236:function(fe,p,x){"use strict";const v=x(35469),T=(C,I,m)=>v(C,I,m)>=0;fe.exports=T},10826:function(fe,p,x){"use strict";const v=x(2771),T=(C,I,m,b,g)=>{typeof m=="string"&&(g=b,b=m,m=void 0);try{return new v(C instanceof v?C.version:C,m).inc(I,b,g).version}catch{return null}};fe.exports=T},88200:function(fe,p,x){"use strict";const v=x(35469),T=(C,I,m)=>v(C,I,m)<0;fe.exports=T},33765:function(fe,p,x){"use strict";const v=x(35469),T=(C,I,m)=>v(C,I,m)<=0;fe.exports=T},64247:function(fe,p,x){"use strict";const v=x(2771),T=(C,I)=>new v(C,I).major;fe.exports=T},95363:function(fe,p,x){"use strict";const v=x(2771),T=(C,I)=>new v(C,I).minor;fe.exports=T},47238:function(fe,p,x){"use strict";const v=x(35469),T=(C,I,m)=>v(C,I,m)!==0;fe.exports=T},1289:function(fe,p,x){"use strict";const v=x(2771),T=(C,I,m=!1)=>{if(C instanceof v)return C;try{return new v(C,I)}catch(b){if(!m)return null;throw b}};fe.exports=T},67148:function(fe,p,x){"use strict";const v=x(2771),T=(C,I)=>new v(C,I).patch;fe.exports=T},43306:function(fe,p,x){"use strict";const v=x(1289),T=(C,I)=>{const m=v(C,I);return m&&m.prerelease.length?m.prerelease:null};fe.exports=T},41861:function(fe,p,x){"use strict";const v=x(35469),T=(C,I,m)=>v(I,C,m);fe.exports=T},4240:function(fe,p,x){"use strict";const v=x(84104),T=(C,I)=>C.sort((m,b)=>v(b,m,I));fe.exports=T},94163:function(fe,p,x){"use strict";const v=x(62326),T=(C,I,m)=>{try{I=new v(I,m)}catch{return!1}return I.test(C)};fe.exports=T},67256:function(fe,p,x){"use strict";const v=x(84104),T=(C,I)=>C.sort((m,b)=>v(m,b,I));fe.exports=T},59140:function(fe,p,x){"use strict";const v=x(1289),T=(C,I)=>{const m=v(C,I);return m?m.version:null};fe.exports=T},90032:function(fe,p,x){"use strict";const v=x(86999),T=x(10229),C=x(2771),I=x(53436),m=x(1289),b=x(59140),g=x(69903),w=x(10826),_=x(32223),A=x(64247),S=x(95363),k=x(67148),B=x(43306),O=x(35469),L=x(41861),D=x(86002),W=x(84104),H=x(67256),G=x(4240),Z=x(17743),Q=x(88200),ie=x(1314),le=x(47238),be=x(70236),we=x(33765),Ae=x(93566),re=x(75585),N=x(79003),z=x(62326),V=x(94163),U=x(64678),j=x(79313),$=x(93835),ee=x(50898),J=x(51913),F=x(46640),X=x(46460),de=x(21573),Y=x(67713),ce=x(52468),he=x(52809);fe.exports={parse:m,valid:b,clean:g,inc:w,diff:_,major:A,minor:S,patch:k,prerelease:B,compare:O,rcompare:L,compareLoose:D,compareBuild:W,sort:H,rsort:G,gt:Z,lt:Q,eq:ie,neq:le,gte:be,lte:we,cmp:Ae,coerce:re,Comparator:N,Range:z,satisfies:V,toComparators:U,maxSatisfying:j,minSatisfying:$,minVersion:ee,validRange:J,outside:F,gtr:X,ltr:de,intersects:Y,simplifyRange:ce,subset:he,SemVer:C,re:v.re,src:v.src,tokens:v.t,SEMVER_SPEC_VERSION:T.SEMVER_SPEC_VERSION,RELEASE_TYPES:T.RELEASE_TYPES,compareIdentifiers:I.compareIdentifiers,rcompareIdentifiers:I.rcompareIdentifiers}},10229:function(fe){"use strict";const p="2.0.0",v=Number.MAX_SAFE_INTEGER||9007199254740991,T=16,C=250,I=["major","premajor","minor","preminor","patch","prepatch","prerelease"];fe.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:T,MAX_SAFE_BUILD_LENGTH:C,MAX_SAFE_INTEGER:v,RELEASE_TYPES:I,SEMVER_SPEC_VERSION:p,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},4159:function(fe,p,x){"use strict";var v=x(85409);const T=typeof v=="object"&&"{}".NODE_DEBUG&&/\bsemver\b/i.test("{}".NODE_DEBUG)?(...C)=>console.error("SEMVER",...C):()=>{};fe.exports=T},53436:function(fe){"use strict";const p=/^[0-9]+$/,x=(T,C)=>{const I=p.test(T),m=p.test(C);return I&&m&&(T=+T,C=+C),T===C?0:I&&!m?-1:m&&!I?1:T<C?-1:1},v=(T,C)=>x(C,T);fe.exports={compareIdentifiers:x,rcompareIdentifiers:v}},62351:function(fe){"use strict";class p{constructor(){this.max=1e3,this.map=new Map}get(v){const T=this.map.get(v);if(T!==void 0)return this.map.delete(v),this.map.set(v,T),T}delete(v){return this.map.delete(v)}set(v,T){if(!this.delete(v)&&T!==void 0){if(this.map.size>=this.max){const I=this.map.keys().next().value;this.delete(I)}this.map.set(v,T)}return this}}fe.exports=p},12860:function(fe){"use strict";const p=Object.freeze({loose:!0}),x=Object.freeze({}),v=T=>T?typeof T!="object"?p:T:x;fe.exports=v},86999:function(fe,p,x){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:v,MAX_SAFE_BUILD_LENGTH:T,MAX_LENGTH:C}=x(10229),I=x(4159);p=fe.exports={};const m=p.re=[],b=p.safeRe=[],g=p.src=[],w=p.safeSrc=[],_=p.t={};let A=0;const S="[a-zA-Z0-9-]",k=[["\\s",1],["\\d",C],[S,T]],B=L=>{for(const[D,W]of k)L=L.split(`${D}*`).join(`${D}{0,${W}}`).split(`${D}+`).join(`${D}{1,${W}}`);return L},O=(L,D,W)=>{const H=B(D),G=A++;I(L,G,D),_[L]=G,g[G]=D,w[G]=H,m[G]=new RegExp(D,W?"g":void 0),b[G]=new RegExp(H,W?"g":void 0)};O("NUMERICIDENTIFIER","0|[1-9]\\d*"),O("NUMERICIDENTIFIERLOOSE","\\d+"),O("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${S}*`),O("MAINVERSION",`(${g[_.NUMERICIDENTIFIER]})\\.(${g[_.NUMERICIDENTIFIER]})\\.(${g[_.NUMERICIDENTIFIER]})`),O("MAINVERSIONLOOSE",`(${g[_.NUMERICIDENTIFIERLOOSE]})\\.(${g[_.NUMERICIDENTIFIERLOOSE]})\\.(${g[_.NUMERICIDENTIFIERLOOSE]})`),O("PRERELEASEIDENTIFIER",`(?:${g[_.NONNUMERICIDENTIFIER]}|${g[_.NUMERICIDENTIFIER]})`),O("PRERELEASEIDENTIFIERLOOSE",`(?:${g[_.NONNUMERICIDENTIFIER]}|${g[_.NUMERICIDENTIFIERLOOSE]})`),O("PRERELEASE",`(?:-(${g[_.PRERELEASEIDENTIFIER]}(?:\\.${g[_.PRERELEASEIDENTIFIER]})*))`),O("PRERELEASELOOSE",`(?:-?(${g[_.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${g[_.PRERELEASEIDENTIFIERLOOSE]})*))`),O("BUILDIDENTIFIER",`${S}+`),O("BUILD",`(?:\\+(${g[_.BUILDIDENTIFIER]}(?:\\.${g[_.BUILDIDENTIFIER]})*))`),O("FULLPLAIN",`v?${g[_.MAINVERSION]}${g[_.PRERELEASE]}?${g[_.BUILD]}?`),O("FULL",`^${g[_.FULLPLAIN]}$`),O("LOOSEPLAIN",`[v=\\s]*${g[_.MAINVERSIONLOOSE]}${g[_.PRERELEASELOOSE]}?${g[_.BUILD]}?`),O("LOOSE",`^${g[_.LOOSEPLAIN]}$`),O("GTLT","((?:<|>)?=?)"),O("XRANGEIDENTIFIERLOOSE",`${g[_.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),O("XRANGEIDENTIFIER",`${g[_.NUMERICIDENTIFIER]}|x|X|\\*`),O("XRANGEPLAIN",`[v=\\s]*(${g[_.XRANGEIDENTIFIER]})(?:\\.(${g[_.XRANGEIDENTIFIER]})(?:\\.(${g[_.XRANGEIDENTIFIER]})(?:${g[_.PRERELEASE]})?${g[_.BUILD]}?)?)?`),O("XRANGEPLAINLOOSE",`[v=\\s]*(${g[_.XRANGEIDENTIFIERLOOSE]})(?:\\.(${g[_.XRANGEIDENTIFIERLOOSE]})(?:\\.(${g[_.XRANGEIDENTIFIERLOOSE]})(?:${g[_.PRERELEASELOOSE]})?${g[_.BUILD]}?)?)?`),O("XRANGE",`^${g[_.GTLT]}\\s*${g[_.XRANGEPLAIN]}$`),O("XRANGELOOSE",`^${g[_.GTLT]}\\s*${g[_.XRANGEPLAINLOOSE]}$`),O("COERCEPLAIN",`(^|[^\\d])(\\d{1,${v}})(?:\\.(\\d{1,${v}}))?(?:\\.(\\d{1,${v}}))?`),O("COERCE",`${g[_.COERCEPLAIN]}(?:$|[^\\d])`),O("COERCEFULL",g[_.COERCEPLAIN]+`(?:${g[_.PRERELEASE]})?(?:${g[_.BUILD]})?(?:$|[^\\d])`),O("COERCERTL",g[_.COERCE],!0),O("COERCERTLFULL",g[_.COERCEFULL],!0),O("LONETILDE","(?:~>?)"),O("TILDETRIM",`(\\s*)${g[_.LONETILDE]}\\s+`,!0),p.tildeTrimReplace="$1~",O("TILDE",`^${g[_.LONETILDE]}${g[_.XRANGEPLAIN]}$`),O("TILDELOOSE",`^${g[_.LONETILDE]}${g[_.XRANGEPLAINLOOSE]}$`),O("LONECARET","(?:\\^)"),O("CARETTRIM",`(\\s*)${g[_.LONECARET]}\\s+`,!0),p.caretTrimReplace="$1^",O("CARET",`^${g[_.LONECARET]}${g[_.XRANGEPLAIN]}$`),O("CARETLOOSE",`^${g[_.LONECARET]}${g[_.XRANGEPLAINLOOSE]}$`),O("COMPARATORLOOSE",`^${g[_.GTLT]}\\s*(${g[_.LOOSEPLAIN]})$|^$`),O("COMPARATOR",`^${g[_.GTLT]}\\s*(${g[_.FULLPLAIN]})$|^$`),O("COMPARATORTRIM",`(\\s*)${g[_.GTLT]}\\s*(${g[_.LOOSEPLAIN]}|${g[_.XRANGEPLAIN]})`,!0),p.comparatorTrimReplace="$1$2$3",O("HYPHENRANGE",`^\\s*(${g[_.XRANGEPLAIN]})\\s+-\\s+(${g[_.XRANGEPLAIN]})\\s*$`),O("HYPHENRANGELOOSE",`^\\s*(${g[_.XRANGEPLAINLOOSE]})\\s+-\\s+(${g[_.XRANGEPLAINLOOSE]})\\s*$`),O("STAR","(<|>)?=?\\s*\\*"),O("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),O("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},46460:function(fe,p,x){"use strict";const v=x(46640),T=(C,I,m)=>v(C,I,">",m);fe.exports=T},67713:function(fe,p,x){"use strict";const v=x(62326),T=(C,I,m)=>(C=new v(C,m),I=new v(I,m),C.intersects(I,m));fe.exports=T},21573:function(fe,p,x){"use strict";const v=x(46640),T=(C,I,m)=>v(C,I,"<",m);fe.exports=T},79313:function(fe,p,x){"use strict";const v=x(2771),T=x(62326),C=(I,m,b)=>{let g=null,w=null,_=null;try{_=new T(m,b)}catch{return null}return I.forEach(A=>{_.test(A)&&(!g||w.compare(A)===-1)&&(g=A,w=new v(g,b))}),g};fe.exports=C},93835:function(fe,p,x){"use strict";const v=x(2771),T=x(62326),C=(I,m,b)=>{let g=null,w=null,_=null;try{_=new T(m,b)}catch{return null}return I.forEach(A=>{_.test(A)&&(!g||w.compare(A)===1)&&(g=A,w=new v(g,b))}),g};fe.exports=C},50898:function(fe,p,x){"use strict";const v=x(2771),T=x(62326),C=x(17743),I=(m,b)=>{m=new T(m,b);let g=new v("0.0.0");if(m.test(g)||(g=new v("0.0.0-0"),m.test(g)))return g;g=null;for(let w=0;w<m.set.length;++w){const _=m.set[w];let A=null;_.forEach(S=>{const k=new v(S.semver.version);switch(S.operator){case">":k.prerelease.length===0?k.patch++:k.prerelease.push(0),k.raw=k.format();case"":case">=":(!A||C(k,A))&&(A=k);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${S.operator}`)}}),A&&(!g||C(g,A))&&(g=A)}return g&&m.test(g)?g:null};fe.exports=I},46640:function(fe,p,x){"use strict";const v=x(2771),T=x(79003),{ANY:C}=T,I=x(62326),m=x(94163),b=x(17743),g=x(88200),w=x(33765),_=x(70236),A=(S,k,B,O)=>{S=new v(S,O),k=new I(k,O);let L,D,W,H,G;switch(B){case">":L=b,D=w,W=g,H=">",G=">=";break;case"<":L=g,D=_,W=b,H="<",G="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(m(S,k,O))return!1;for(let Z=0;Z<k.set.length;++Z){const Q=k.set[Z];let ie=null,le=null;if(Q.forEach(be=>{be.semver===C&&(be=new T(">=0.0.0")),ie=ie||be,le=le||be,L(be.semver,ie.semver,O)?ie=be:W(be.semver,le.semver,O)&&(le=be)}),ie.operator===H||ie.operator===G||(!le.operator||le.operator===H)&&D(S,le.semver))return!1;if(le.operator===G&&W(S,le.semver))return!1}return!0};fe.exports=A},52468:function(fe,p,x){"use strict";const v=x(94163),T=x(35469);fe.exports=(C,I,m)=>{const b=[];let g=null,w=null;const _=C.sort((B,O)=>T(B,O,m));for(const B of _)v(B,I,m)?(w=B,g||(g=B)):(w&&b.push([g,w]),w=null,g=null);g&&b.push([g,null]);const A=[];for(const[B,O]of b)B===O?A.push(B):!O&&B===_[0]?A.push("*"):O?B===_[0]?A.push(`<=${O}`):A.push(`${B} - ${O}`):A.push(`>=${B}`);const S=A.join(" || "),k=typeof I.raw=="string"?I.raw:String(I);return S.length<k.length?S:I}},52809:function(fe,p,x){"use strict";const v=x(62326),T=x(79003),{ANY:C}=T,I=x(94163),m=x(35469),b=(k,B,O={})=>{if(k===B)return!0;k=new v(k,O),B=new v(B,O);let L=!1;e:for(const D of k.set){for(const W of B.set){const H=_(D,W,O);if(L=L||H!==null,H)continue e}if(L)return!1}return!0},g=[new T(">=0.0.0-0")],w=[new T(">=0.0.0")],_=(k,B,O)=>{if(k===B)return!0;if(k.length===1&&k[0].semver===C){if(B.length===1&&B[0].semver===C)return!0;O.includePrerelease?k=g:k=w}if(B.length===1&&B[0].semver===C){if(O.includePrerelease)return!0;B=w}const L=new Set;let D,W;for(const we of k)we.operator===">"||we.operator===">="?D=A(D,we,O):we.operator==="<"||we.operator==="<="?W=S(W,we,O):L.add(we.semver);if(L.size>1)return null;let H;if(D&&W){if(H=m(D.semver,W.semver,O),H>0)return null;if(H===0&&(D.operator!==">="||W.operator!=="<="))return null}for(const we of L){if(D&&!I(we,String(D),O)||W&&!I(we,String(W),O))return null;for(const Ae of B)if(!I(we,String(Ae),O))return!1;return!0}let G,Z,Q,ie,le=W&&!O.includePrerelease&&W.semver.prerelease.length?W.semver:!1,be=D&&!O.includePrerelease&&D.semver.prerelease.length?D.semver:!1;le&&le.prerelease.length===1&&W.operator==="<"&&le.prerelease[0]===0&&(le=!1);for(const we of B){if(ie=ie||we.operator===">"||we.operator===">=",Q=Q||we.operator==="<"||we.operator==="<=",D){if(be&&we.semver.prerelease&&we.semver.prerelease.length&&we.semver.major===be.major&&we.semver.minor===be.minor&&we.semver.patch===be.patch&&(be=!1),we.operator===">"||we.operator===">="){if(G=A(D,we,O),G===we&&G!==D)return!1}else if(D.operator===">="&&!I(D.semver,String(we),O))return!1}if(W){if(le&&we.semver.prerelease&&we.semver.prerelease.length&&we.semver.major===le.major&&we.semver.minor===le.minor&&we.semver.patch===le.patch&&(le=!1),we.operator==="<"||we.operator==="<="){if(Z=S(W,we,O),Z===we&&Z!==W)return!1}else if(W.operator==="<="&&!I(W.semver,String(we),O))return!1}if(!we.operator&&(W||D)&&H!==0)return!1}return!(D&&Q&&!W&&H!==0||W&&ie&&!D&&H!==0||be||le)},A=(k,B,O)=>{if(!k)return B;const L=m(k.semver,B.semver,O);return L>0?k:L<0||B.operator===">"&&k.operator===">="?B:k},S=(k,B,O)=>{if(!k)return B;const L=m(k.semver,B.semver,O);return L<0?k:L>0||B.operator==="<"&&k.operator==="<="?B:k};fe.exports=b},64678:function(fe,p,x){"use strict";const v=x(62326),T=(C,I)=>new v(C,I).set.map(m=>m.map(b=>b.value).join(" ").trim().split(" "));fe.exports=T},51913:function(fe,p,x){"use strict";const v=x(62326),T=(C,I)=>{try{return new v(C,I).range||"*"}catch{return null}};fe.exports=T},7755:function(fe,p,x){"use strict";var v=x(49336),T=x(20022),C=x(491)(),I=x(25667),m=x(71102),b=v("%Math.floor%");fe.exports=function(w,_){if(typeof w!="function")throw new m("`fn` is not a function");if(typeof _!="number"||_<0||_>4294967295||b(_)!==_)throw new m("`length` must be a positive 32-bit integer");var A=arguments.length>2&&!!arguments[2],S=!0,k=!0;if("length"in w&&I){var B=I(w,"length");B&&!B.configurable&&(S=!1),B&&!B.writable&&(k=!1)}return(S||k||!A)&&(C?T(w,"length",_,!0,!0):T(w,"length",_)),w}},3366:function(fe,p,x){var v=x(56608).Buffer;function T(C,I){this._block=v.alloc(C),this._finalSize=I,this._blockSize=C,this._len=0}T.prototype.update=function(C,I){typeof C=="string"&&(I=I||"utf8",C=v.from(C,I));for(var m=this._block,b=this._blockSize,g=C.length,w=this._len,_=0;_<g;){for(var A=w%b,S=Math.min(g-_,b-A),k=0;k<S;k++)m[A+k]=C[_+k];w+=S,_+=S,w%b===0&&this._update(m)}return this._len+=g,this},T.prototype.digest=function(C){var I=this._len%this._blockSize;this._block[I]=128,this._block.fill(0,I+1),I>=this._finalSize&&(this._update(this._block),this._block.fill(0));var m=this._len*8;if(m<=4294967295)this._block.writeUInt32BE(m,this._blockSize-4);else{var b=(m&4294967295)>>>0,g=(m-b)/4294967296;this._block.writeUInt32BE(g,this._blockSize-8),this._block.writeUInt32BE(b,this._blockSize-4)}this._update(this._block);var w=this._hash();return C?w.toString(C):w},T.prototype._update=function(){throw new Error("_update must be implemented by subclass")},fe.exports=T},5244:function(fe,p,x){var v=fe.exports=function(C){C=C.toLowerCase();var I=v[C];if(!I)throw new Error(C+" is not supported (we accept pull requests)");return new I};v.sha=x(2954),v.sha1=x(16375),v.sha224=x(64012),v.sha256=x(28729),v.sha384=x(91453),v.sha512=x(21756)},2954:function(fe,p,x){var v=x(91193),T=x(3366),C=x(56608).Buffer,I=[1518500249,1859775393,-1894007588,-899497514],m=new Array(80);function b(){this.init(),this._w=m,T.call(this,64,56)}v(b,T),b.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function g(A){return A<<5|A>>>27}function w(A){return A<<30|A>>>2}function _(A,S,k,B){return A===0?S&k|~S&B:A===2?S&k|S&B|k&B:S^k^B}b.prototype._update=function(A){for(var S=this._w,k=this._a|0,B=this._b|0,O=this._c|0,L=this._d|0,D=this._e|0,W=0;W<16;++W)S[W]=A.readInt32BE(W*4);for(;W<80;++W)S[W]=S[W-3]^S[W-8]^S[W-14]^S[W-16];for(var H=0;H<80;++H){var G=~~(H/20),Z=g(k)+_(G,B,O,L)+D+S[H]+I[G]|0;D=L,L=O,O=w(B),B=k,k=Z}this._a=k+this._a|0,this._b=B+this._b|0,this._c=O+this._c|0,this._d=L+this._d|0,this._e=D+this._e|0},b.prototype._hash=function(){var A=C.allocUnsafe(20);return A.writeInt32BE(this._a|0,0),A.writeInt32BE(this._b|0,4),A.writeInt32BE(this._c|0,8),A.writeInt32BE(this._d|0,12),A.writeInt32BE(this._e|0,16),A},fe.exports=b},16375:function(fe,p,x){var v=x(91193),T=x(3366),C=x(56608).Buffer,I=[1518500249,1859775393,-1894007588,-899497514],m=new Array(80);function b(){this.init(),this._w=m,T.call(this,64,56)}v(b,T),b.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function g(S){return S<<1|S>>>31}function w(S){return S<<5|S>>>27}function _(S){return S<<30|S>>>2}function A(S,k,B,O){return S===0?k&B|~k&O:S===2?k&B|k&O|B&O:k^B^O}b.prototype._update=function(S){for(var k=this._w,B=this._a|0,O=this._b|0,L=this._c|0,D=this._d|0,W=this._e|0,H=0;H<16;++H)k[H]=S.readInt32BE(H*4);for(;H<80;++H)k[H]=g(k[H-3]^k[H-8]^k[H-14]^k[H-16]);for(var G=0;G<80;++G){var Z=~~(G/20),Q=w(B)+A(Z,O,L,D)+W+k[G]+I[Z]|0;W=D,D=L,L=_(O),O=B,B=Q}this._a=B+this._a|0,this._b=O+this._b|0,this._c=L+this._c|0,this._d=D+this._d|0,this._e=W+this._e|0},b.prototype._hash=function(){var S=C.allocUnsafe(20);return S.writeInt32BE(this._a|0,0),S.writeInt32BE(this._b|0,4),S.writeInt32BE(this._c|0,8),S.writeInt32BE(this._d|0,12),S.writeInt32BE(this._e|0,16),S},fe.exports=b},64012:function(fe,p,x){var v=x(91193),T=x(28729),C=x(3366),I=x(56608).Buffer,m=new Array(64);function b(){this.init(),this._w=m,C.call(this,64,56)}v(b,T),b.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},b.prototype._hash=function(){var g=I.allocUnsafe(28);return g.writeInt32BE(this._a,0),g.writeInt32BE(this._b,4),g.writeInt32BE(this._c,8),g.writeInt32BE(this._d,12),g.writeInt32BE(this._e,16),g.writeInt32BE(this._f,20),g.writeInt32BE(this._g,24),g},fe.exports=b},28729:function(fe,p,x){var v=x(91193),T=x(3366),C=x(56608).Buffer,I=[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],m=new Array(64);function b(){this.init(),this._w=m,T.call(this,64,56)}v(b,T),b.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 g(B,O,L){return L^B&(O^L)}function w(B,O,L){return B&O|L&(B|O)}function _(B){return(B>>>2|B<<30)^(B>>>13|B<<19)^(B>>>22|B<<10)}function A(B){return(B>>>6|B<<26)^(B>>>11|B<<21)^(B>>>25|B<<7)}function S(B){return(B>>>7|B<<25)^(B>>>18|B<<14)^B>>>3}function k(B){return(B>>>17|B<<15)^(B>>>19|B<<13)^B>>>10}b.prototype._update=function(B){for(var O=this._w,L=this._a|0,D=this._b|0,W=this._c|0,H=this._d|0,G=this._e|0,Z=this._f|0,Q=this._g|0,ie=this._h|0,le=0;le<16;++le)O[le]=B.readInt32BE(le*4);for(;le<64;++le)O[le]=k(O[le-2])+O[le-7]+S(O[le-15])+O[le-16]|0;for(var be=0;be<64;++be){var we=ie+A(G)+g(G,Z,Q)+I[be]+O[be]|0,Ae=_(L)+w(L,D,W)|0;ie=Q,Q=Z,Z=G,G=H+we|0,H=W,W=D,D=L,L=we+Ae|0}this._a=L+this._a|0,this._b=D+this._b|0,this._c=W+this._c|0,this._d=H+this._d|0,this._e=G+this._e|0,this._f=Z+this._f|0,this._g=Q+this._g|0,this._h=ie+this._h|0},b.prototype._hash=function(){var B=C.allocUnsafe(32);return B.writeInt32BE(this._a,0),B.writeInt32BE(this._b,4),B.writeInt32BE(this._c,8),B.writeInt32BE(this._d,12),B.writeInt32BE(this._e,16),B.writeInt32BE(this._f,20),B.writeInt32BE(this._g,24),B.writeInt32BE(this._h,28),B},fe.exports=b},91453:function(fe,p,x){var v=x(91193),T=x(21756),C=x(3366),I=x(56608).Buffer,m=new Array(160);function b(){this.init(),this._w=m,C.call(this,128,112)}v(b,T),b.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},b.prototype._hash=function(){var g=I.allocUnsafe(48);function w(_,A,S){g.writeInt32BE(_,S),g.writeInt32BE(A,S+4)}return w(this._ah,this._al,0),w(this._bh,this._bl,8),w(this._ch,this._cl,16),w(this._dh,this._dl,24),w(this._eh,this._el,32),w(this._fh,this._fl,40),g},fe.exports=b},21756:function(fe,p,x){var v=x(91193),T=x(3366),C=x(56608).Buffer,I=[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],m=new Array(160);function b(){this.init(),this._w=m,T.call(this,128,112)}v(b,T),b.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 g(D,W,H){return H^D&(W^H)}function w(D,W,H){return D&W|H&(D|W)}function _(D,W){return(D>>>28|W<<4)^(W>>>2|D<<30)^(W>>>7|D<<25)}function A(D,W){return(D>>>14|W<<18)^(D>>>18|W<<14)^(W>>>9|D<<23)}function S(D,W){return(D>>>1|W<<31)^(D>>>8|W<<24)^D>>>7}function k(D,W){return(D>>>1|W<<31)^(D>>>8|W<<24)^(D>>>7|W<<25)}function B(D,W){return(D>>>19|W<<13)^(W>>>29|D<<3)^D>>>6}function O(D,W){return(D>>>19|W<<13)^(W>>>29|D<<3)^(D>>>6|W<<26)}function L(D,W){return D>>>0<W>>>0?1:0}b.prototype._update=function(D){for(var W=this._w,H=this._ah|0,G=this._bh|0,Z=this._ch|0,Q=this._dh|0,ie=this._eh|0,le=this._fh|0,be=this._gh|0,we=this._hh|0,Ae=this._al|0,re=this._bl|0,N=this._cl|0,z=this._dl|0,V=this._el|0,U=this._fl|0,j=this._gl|0,$=this._hl|0,ee=0;ee<32;ee+=2)W[ee]=D.readInt32BE(ee*4),W[ee+1]=D.readInt32BE(ee*4+4);for(;ee<160;ee+=2){var J=W[ee-30],F=W[ee-15*2+1],X=S(J,F),de=k(F,J);J=W[ee-4],F=W[ee-4+1];var Y=B(J,F),ce=O(F,J),he=W[ee-7*2],Ie=W[ee-7*2+1],ke=W[ee-16*2],ut=W[ee-16*2+1],Re=de+Ie|0,ze=X+he+L(Re,de)|0;Re=Re+ce|0,ze=ze+Y+L(Re,ce)|0,Re=Re+ut|0,ze=ze+ke+L(Re,ut)|0,W[ee]=ze,W[ee+1]=Re}for(var _t=0;_t<160;_t+=2){ze=W[_t],Re=W[_t+1];var Ct=w(H,G,Z),$t=w(Ae,re,N),ft=_(H,Ae),Xe=_(Ae,H),ct=A(ie,V),wt=A(V,ie),Rt=I[_t],Ge=I[_t+1],zt=g(ie,le,be),Ft=g(V,U,j),tt=$+wt|0,qe=we+ct+L(tt,$)|0;tt=tt+Ft|0,qe=qe+zt+L(tt,Ft)|0,tt=tt+Ge|0,qe=qe+Rt+L(tt,Ge)|0,tt=tt+Re|0,qe=qe+ze+L(tt,Re)|0;var dt=Xe+$t|0,De=ft+Ct+L(dt,Xe)|0;we=be,$=j,be=le,j=U,le=ie,U=V,V=z+tt|0,ie=Q+qe+L(V,z)|0,Q=Z,z=N,Z=G,N=re,G=H,re=Ae,Ae=tt+dt|0,H=qe+De+L(Ae,tt)|0}this._al=this._al+Ae|0,this._bl=this._bl+re|0,this._cl=this._cl+N|0,this._dl=this._dl+z|0,this._el=this._el+V|0,this._fl=this._fl+U|0,this._gl=this._gl+j|0,this._hl=this._hl+$|0,this._ah=this._ah+H+L(this._al,Ae)|0,this._bh=this._bh+G+L(this._bl,re)|0,this._ch=this._ch+Z+L(this._cl,N)|0,this._dh=this._dh+Q+L(this._dl,z)|0,this._eh=this._eh+ie+L(this._el,V)|0,this._fh=this._fh+le+L(this._fl,U)|0,this._gh=this._gh+be+L(this._gl,j)|0,this._hh=this._hh+we+L(this._hl,$)|0},b.prototype._hash=function(){var D=C.allocUnsafe(64);function W(H,G,Z){D.writeInt32BE(H,Z),D.writeInt32BE(G,Z+4)}return W(this._ah,this._al,0),W(this._bh,this._bl,8),W(this._ch,this._cl,16),W(this._dh,this._dl,24),W(this._eh,this._el,32),W(this._fh,this._fl,40),W(this._gh,this._gl,48),W(this._hh,this._hl,56),D},fe.exports=b},43803:function(fe,p,x){fe.exports=C;var v=x(80381).EventEmitter,T=x(91193);T(C,v),C.Readable=x(23033),C.Writable=x(92553),C.Duplex=x(35707),C.Transform=x(50141),C.PassThrough=x(75271),C.finished=x(32339),C.pipeline=x(35481),C.Stream=C;function C(){v.call(this)}C.prototype.pipe=function(I,m){var b=this;function g(O){I.writable&&I.write(O)===!1&&b.pause&&b.pause()}b.on("data",g);function w(){b.readable&&b.resume&&b.resume()}I.on("drain",w),!I._isStdio&&(!m||m.end!==!1)&&(b.on("end",A),b.on("close",S));var _=!1;function A(){_||(_=!0,I.end())}function S(){_||(_=!0,typeof I.destroy=="function"&&I.destroy())}function k(O){if(B(),v.listenerCount(this,"error")===0)throw O}b.on("error",k),I.on("error",k);function B(){b.removeListener("data",g),I.removeListener("drain",w),b.removeListener("end",A),b.removeListener("close",S),b.removeListener("error",k),I.removeListener("error",k),b.removeListener("end",B),b.removeListener("close",B),I.removeListener("close",B)}return b.on("end",B),b.on("close",B),I.on("close",B),I.emit("pipe",b),I}},86704:function(fe,p,x){"use strict";var v=x(56608).Buffer,T=v.isEncoding||function(H){switch(H=""+H,H&&H.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 C(H){if(!H)return"utf8";for(var G;;)switch(H){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 H;default:if(G)return;H=(""+H).toLowerCase(),G=!0}}function I(H){var G=C(H);if(typeof G!="string"&&(v.isEncoding===T||!T(H)))throw new Error("Unknown encoding: "+H);return G||H}p.StringDecoder=m;function m(H){this.encoding=I(H);var G;switch(this.encoding){case"utf16le":this.text=k,this.end=B,G=4;break;case"utf8":this.fillLast=_,G=4;break;case"base64":this.text=O,this.end=L,G=3;break;default:this.write=D,this.end=W;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=v.allocUnsafe(G)}m.prototype.write=function(H){if(H.length===0)return"";var G,Z;if(this.lastNeed){if(G=this.fillLast(H),G===void 0)return"";Z=this.lastNeed,this.lastNeed=0}else Z=0;return Z<H.length?G?G+this.text(H,Z):this.text(H,Z):G||""},m.prototype.end=S,m.prototype.text=A,m.prototype.fillLast=function(H){if(this.lastNeed<=H.length)return H.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);H.copy(this.lastChar,this.lastTotal-this.lastNeed,0,H.length),this.lastNeed-=H.length};function b(H){return H<=127?0:H>>5===6?2:H>>4===14?3:H>>3===30?4:H>>6===2?-1:-2}function g(H,G,Z){var Q=G.length-1;if(Q<Z)return 0;var ie=b(G[Q]);return ie>=0?(ie>0&&(H.lastNeed=ie-1),ie):--Q<Z||ie===-2?0:(ie=b(G[Q]),ie>=0?(ie>0&&(H.lastNeed=ie-2),ie):--Q<Z||ie===-2?0:(ie=b(G[Q]),ie>=0?(ie>0&&(ie===2?ie=0:H.lastNeed=ie-3),ie):0))}function w(H,G,Z){if((G[0]&192)!==128)return H.lastNeed=0,"\uFFFD";if(H.lastNeed>1&&G.length>1){if((G[1]&192)!==128)return H.lastNeed=1,"\uFFFD";if(H.lastNeed>2&&G.length>2&&(G[2]&192)!==128)return H.lastNeed=2,"\uFFFD"}}function _(H){var G=this.lastTotal-this.lastNeed,Z=w(this,H,G);if(Z!==void 0)return Z;if(this.lastNeed<=H.length)return H.copy(this.lastChar,G,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);H.copy(this.lastChar,G,0,H.length),this.lastNeed-=H.length}function A(H,G){var Z=g(this,H,G);if(!this.lastNeed)return H.toString("utf8",G);this.lastTotal=Z;var Q=H.length-(Z-this.lastNeed);return H.copy(this.lastChar,0,Q),H.toString("utf8",G,Q)}function S(H){var G=H&&H.length?this.write(H):"";return this.lastNeed?G+"\uFFFD":G}function k(H,G){if((H.length-G)%2===0){var Z=H.toString("utf16le",G);if(Z){var Q=Z.charCodeAt(Z.length-1);if(Q>=55296&&Q<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=H[H.length-2],this.lastChar[1]=H[H.length-1],Z.slice(0,-1)}return Z}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=H[H.length-1],H.toString("utf16le",G,H.length-1)}function B(H){var G=H&&H.length?this.write(H):"";if(this.lastNeed){var Z=this.lastTotal-this.lastNeed;return G+this.lastChar.toString("utf16le",0,Z)}return G}function O(H,G){var Z=(H.length-G)%3;return Z===0?H.toString("base64",G):(this.lastNeed=3-Z,this.lastTotal=3,Z===1?this.lastChar[0]=H[H.length-1]:(this.lastChar[0]=H[H.length-2],this.lastChar[1]=H[H.length-1]),H.toString("base64",G,H.length-Z))}function L(H){var G=H&&H.length?this.write(H):"";return this.lastNeed?G+this.lastChar.toString("base64",0,3-this.lastNeed):G}function D(H){return H.toString(this.encoding)}function W(H){return H&&H.length?this.write(H):""}},73180:function(fe,p,x){var v=x(94782);fe.exports=function(C){return typeof C!="string"?C:v(C)?C.slice(2):C}},2242:function(fe){"use strict";const p=Symbol.for("nodejs.util.inspect.custom");fe.exports=p},88841:function(fe,p,x){const{BN:v,bytesToHex:T}=x(12386);class C{constructor(m){this.array=Uint8Array.from({length:Math.ceil(m/8)},()=>0),this.cursor=0,this.length=m}getFreeBits(){return this.length-this.cursor}getUsedBits(){return this.cursor}getUsedBytes(){return Math.ceil(this.cursor/8)}get(m){return(this.array[m/8|0]&1<<7-m%8)>0}checkRange(m){if(m>this.length)throw Error("BitString overflow")}on(m){this.checkRange(m),this.array[m/8|0]|=1<<7-m%8}off(m){this.checkRange(m),this.array[m/8|0]&=~(1<<7-m%8)}toggle(m){this.checkRange(m),this.array[m/8|0]^=1<<7-m%8}forEach(m){const b=this.cursor;for(let g=0;g<b;g++)m(this.get(g))}writeBit(m){m&&m>0?this.on(this.cursor):this.off(this.cursor),this.cursor=this.cursor+1}writeBitArray(m){for(let b=0;b<m.length;b++)this.writeBit(m[b])}writeUint(m,b){if(isNaN(m))throw new Error("writeUint: value is NaN");if(m===null)throw new Error("writeUint: value is null");if(m===void 0)throw new Error("writeUint: value is undefined");if(!b)throw new Error("writeUint: no bitLength");if(m=new v(m),b==0||m.toString(2).length>b){if(m==0)return;throw Error("bitLength is too small for number, got number="+m+",bitLength="+b)}const g=m.toString(2,b);for(let w=0;w<b;w++)this.writeBit(g[w]==1)}writeInt(m,b){if(isNaN(m))throw new Error("writeInt: value is NaN");if(m===null)throw new Error("writeInt: value is null");if(m===void 0)throw new Error("writeInt: value is undefined");if(!b)throw new Error("writeInt: no bitLength");if(m=new v(m),b==1){if(m==-1){this.writeBit(!0);return}if(m==0){this.writeBit(!1);return}throw Error("Bitlength is too small for number")}else if(m.isNeg()){this.writeBit(!0);const w=new v(2).pow(new v(b-1));this.writeUint(w.add(m),b-1)}else this.writeBit(!1),this.writeUint(m,b-1)}writeUint8(m){this.writeUint(m,8)}writeBytes(m){for(let b=0;b<m.length;b++)this.writeUint8(m[b])}writeString(m){this.writeBytes(new TextEncoder().encode(m))}writeGrams(m){if(m==0)this.writeUint(0,4);else{m=new v(m);const b=Math.ceil(m.toString(16).length/2);this.writeUint(b,4),this.writeUint(m,b*8)}}writeCoins(m){this.writeGrams(m)}writeAddress(m){m==null?this.writeUint(0,2):(this.writeUint(2,2),this.writeUint(0,1),this.writeInt(m.wc,8),this.writeBytes(m.hashPart))}writeBitString(m){m.forEach(b=>{this.writeBit(b)})}clone(){const m=new C(0);return m.array=this.array.slice(0),m.length=this.length,m.cursor=this.cursor,m}toString(){return this.toHex()}getTopUppedArray(){const m=this.clone();let b=Math.ceil(m.cursor/8)*8-m.cursor;if(b>0)for(b=b-1,m.writeBit(!0);b>0;)b=b-1,m.writeBit(!1);return m.array=m.array.slice(0,Math.ceil(m.cursor/8)),m.array}toHex(){if(this.cursor%4===0){const m=T(this.array.slice(0,Math.ceil(this.cursor/8))).toUpperCase();return this.cursor%8===0?m:m.substr(0,m.length-1)}else{const m=this.clone();for(m.writeBit(1);m.cursor%4!==0;)m.writeBit(0);return m.toHex().toUpperCase()+"_"}}setTopUppedArray(m,b=!0){if(this.length=m.length*8,this.array=m,this.cursor=this.length,!(b||!this.length)){let g=!1;for(let w=0;w<7;w++)if(this.cursor-=1,this.get(this.cursor)){g=!0,this.off(this.cursor);break}if(!g)throw console.log(m,b),new Error("Incorrect TopUppedArray")}}}fe.exports={BitString:C}},15155:function(fe,p,x){const{BitString:v}=x(88841),{bytesToBase64:T,compareBytes:C,concatBytes:I,crc32c:m,hexToBytes:b,readNBytesUIntFromArray:g,sha256:w,bytesToHex:_}=x(12386),{Slice:A}=x(20757),S=b("B5EE9C72"),k=b("68ff65f3"),B=b("acc3a728");class O{constructor(){this.bits=new v(1023),this.refs=[],this.isExotic=!1}static fromBoc(Q){return G(Q)}static oneFromBoc(Q){const ie=G(Q);if(ie.length!==1)throw new Error("expected 1 root cell but have "+ie.length);return ie[0]}writeCell(Q){this.bits.writeBitString(Q.bits),this.refs=this.refs.concat(Q.refs)}getMaxLevel(){let Q=0;for(let ie in this.refs){const le=this.refs[ie];le.getMaxLevel()>Q&&(Q=le.getMaxLevel())}return Q}isExplicitlyStoredHashes(){return 0}getMaxDepth(){let Q=0;if(this.refs.length>0){for(let ie=0;ie<this.refs.length;ie++){let be=this.refs[ie].getMaxDepth();be>Q&&(Q=be)}Q=Q+1}return Q}getMaxDepthAsArray(){const Q=this.getMaxDepth(),ie=Uint8Array.from({length:2},()=>0);return ie[1]=Q%256,ie[0]=Math.floor(Q/256),ie}getRefsDescriptor(){const Q=Uint8Array.from({length:1},()=>0);return Q[0]=this.refs.length+this.isExotic*8+this.getMaxLevel()*32,Q}getBitsDescriptor(){const Q=Uint8Array.from({length:1},()=>0);return Q[0]=Math.ceil(this.bits.cursor/8)+Math.floor(this.bits.cursor/8),Q}getDataWithDescriptors(){const Q=this.getRefsDescriptor(),ie=this.getBitsDescriptor(),le=this.bits.getTopUppedArray();return I(I(Q,ie),le)}async getRepr(){const Q=[];Q.push(this.getDataWithDescriptors());for(let le in this.refs){const be=this.refs[le];Q.push(be.getMaxDepthAsArray())}for(let le in this.refs){const be=this.refs[le];Q.push(await be.hash())}let ie=new Uint8Array;for(let le in Q){const be=Q[le];ie=I(ie,be)}return ie}async hash(){return new Uint8Array(await w(await this.getRepr()))}beginParse(){const Q=this.refs.map(ie=>ie.beginParse());return new A(this.bits.array.slice(),this.bits.length,Q)}print(Q){Q=Q||"";let ie=Q+"x{"+this.bits.toHex()+`}
|
||
`;for(let le in this.refs){const be=this.refs[le];ie+=be.print(Q+" ")}return ie}async toBoc(Q=!0,ie=!0,le=!1,be=0){const Ae=await this.treeWalk(),re=Ae[0],N=Ae[1],z=re.length,V=z.toString(2).length,U=Math.min(Math.ceil(V/8),1);let j=0,$=[];for(let de of re)$.push(j),j=j+await de[1].bocSerializationSize(N,U);const ee=j.toString(2).length,J=Math.max(Math.ceil(ee/8),1),F=new v((1023+32*4+32*3)*re.length);F.writeBytes(S),F.writeBitArray([Q,ie,le]),F.writeUint(be,2),F.writeUint(U,3),F.writeUint8(J),F.writeUint(z,U*8),F.writeUint(1,U*8),F.writeUint(0,U*8),F.writeUint(j,J*8),F.writeUint(0,U*8),Q&&re.forEach((de,Y)=>F.writeUint($[Y],J*8));for(let de of re){const Y=await de[1].serializeForBoc(N,U);F.writeBytes(Y)}let X=F.getTopUppedArray();return ie&&(X=I(X,m(X))),X}async serializeForBoc(Q,ie){const le=[];if(le.push(this.getDataWithDescriptors()),this.isExplicitlyStoredHashes())throw new Error("Cell hashes explicit storing is not implemented");for(let we in this.refs){const re=await this.refs[we].hash();let z=Q[re].toString(16);z.length%2&&(z="0"+z);const V=b(z);le.push(V)}let be=new Uint8Array;for(let we in le){const Ae=le[we];be=I(be,Ae)}return be}async bocSerializationSize(Q,ie){return(await this.serializeForBoc(Q,ie)).length}async treeWalk(){return D(this,[],{})}}async function L(Z,Q,ie){const le=Z[ie];for(let we in Z)Z[we]>le&&(Z[we]=Z[we]-1);Z[ie]=Q.length-1;const be=Q.splice(le,1)[0];Q.push(be);for(let we of be[1].refs)await L(Z,Q,await we.hash())}async function D(Z,Q,ie,le=null){const be=await Z.hash();if(be in ie)return le&&ie[le]>ie[be]&&await L(ie,Q,be),[Q,ie];ie[be]=Q.length,Q.push([be,Z]);for(let we of Z.refs){const Ae=await D(we,Q,ie,be);Q=Ae[0],ie=Ae[1]}return[Q,ie]}function W(Z){if(Z.length<5)throw"Not enough bytes for magic prefix";const Q=Z,ie=Z.slice(0,4);Z=Z.slice(4);let le,be,we,Ae,re;if(C(ie,S)){const F=Z[0];le=F&128,be=F&64,we=F&32,Ae=(F&16)*2+(F&8),re=F%8}if(C(ie,k)&&(le=1,be=0,we=0,Ae=0,re=Z[0]),C(ie,B)&&(le=1,be=1,we=0,Ae=0,re=Z[0]),Z=Z.slice(1),Z.length<1+5*re)throw"Not enough bytes for encoding cells counters";const N=Z[0];Z=Z.slice(1);const z=g(re,Z);Z=Z.slice(re);const V=g(re,Z);Z=Z.slice(re);const U=g(re,Z);Z=Z.slice(re);const j=g(N,Z);if(Z=Z.slice(N),Z.length<V*re)throw"Not enough bytes for encoding root cells hashes";let $=[];for(let F=0;F<V;F++)$.push(g(re,Z)),Z=Z.slice(re);let ee=!1;if(le){if(ee=[],Z.length<N*z)throw"Not enough bytes for index encoding";for(let F=0;F<z;F++)ee.push(g(N,Z)),Z=Z.slice(N)}if(Z.length<j)throw"Not enough bytes for cells data";const J=Z.slice(0,j);if(Z=Z.slice(j),be){if(Z.length<4)throw"Not enough bytes for crc32c hashsum";const F=Q.length;if(!C(m(Q.slice(0,F-4)),Z.slice(0,4)))throw"Crc32c hashsum mismatch";Z=Z.slice(4)}if(Z.length)throw"Too much bytes in BoC serialization";return{has_idx:le,hash_crc32:be,has_cache_bits:we,flags:Ae,size_bytes:re,off_bytes:N,cells_num:z,roots_num:V,absent_num:U,tot_cells_size:j,root_list:$,index:ee,cells_data:J}}function H(Z,Q){if(Z.length<2)throw"Not enough bytes to encode cell descriptors";const ie=Z[0],le=Z[1];Z=Z.slice(2);const be=Math.floor(ie/32),we=ie&8,Ae=ie%8,re=Math.ceil(le/2),N=!(le%2);let z=new O;if(z.isExotic=we,Z.length<re+Q*Ae)throw"Not enough bytes to encode cell data";z.bits.setTopUppedArray(Z.slice(0,re),N),Z=Z.slice(re);for(let V=0;V<Ae;V++)z.refs.push(g(Q,Z)),Z=Z.slice(Q);return{cell:z,residue:Z}}function G(Z){typeof Z=="string"&&(Z=b(Z));const Q=W(Z);let ie=Q.cells_data,le=[];for(let we=0;we<Q.cells_num;we++){let Ae=H(ie,Q.size_bytes);ie=Ae.residue,le.push(Ae.cell)}for(let we=Q.cells_num-1;we>=0;we--){let Ae=le[we];for(let re=0;re<Ae.refs.length;re++){const N=Ae.refs[re];if(N<we)throw"Topological order is broken";Ae.refs[re]=le[N]}}let be=[];for(let we of Q.root_list)be.push(le[we]);return be}fe.exports={Cell:O}},20757:function(fe,p,x){const{BN:v,Address:T,bytesToHex:C}=x(12386),{BitString:I}=x(88841);class m{constructor(g,w,_){this.array=g,this.length=w,this.readCursor=0,this.refs=_,this.refCursor=0}getFreeBits(){return this.length-this.readCursor}checkRange(g){if(g>this.length)throw Error("BitString overflow")}get(g){return this.checkRange(g),(this.array[g/8|0]&1<<7-g%8)>0}loadBit(){const g=this.get(this.readCursor);return this.readCursor++,g}loadBits(g){const w=new I(g);for(let _=0;_<g;_++)w.writeBit(this.loadBit());return w.array}loadUint(g){if(g<1)throw"Incorrect bitLength";let w="";for(let _=0;_<g;_++)w+=this.loadBit()?"1":"0";return new v(w,2)}loadInt(g){if(g<1)throw"Incorrect bitLength";const w=this.loadBit();if(g===1)return w?new v(-1):new v(0);let _=this.loadUint(g-1);if(w){const S=new v(2).pow(new v(g-1));_=_.sub(S)}return _}loadVarUint(g){const w=this.loadUint(new v(g).toString(2).length-1);return w.toNumber()===0?new v(0):this.loadUint(w*8)}loadCoins(){return this.loadVarUint(16)}loadAddress(){const g=this.loadUint(2);if(g.toNumber()===0)return null;if(g.toNumber()!==2)throw new Error("unsupported address type");if(this.loadBit())throw new Error("unsupported address type");const w=this.loadInt(8).toNumber(),_=this.loadBits(256);return new T(w+":"+C(_))}loadRef(){if(this.refCursor>=4)throw new Error("refs overflow");const g=this.refs[this.refCursor];return this.refCursor++,g}}fe.exports={Slice:m}},43483:function(fe,p,x){const{BitString:v}=x(88841),{Cell:T}=x(15155),{Slice:C}=x(20757);fe.exports={BitString:v,Cell:T,Slice:C}},70040:function(fe,p,x){const{Cell:v}=x(43483),{Address:T,bytesToHex:C}=x(12386),{DNS_CATEGORY_NEXT_RESOLVER:I,DNS_CATEGORY_SITE:m,DNS_CATEGORY_WALLET:b,DNS_CATEGORY_STORAGE:g,createSmartContractAddressRecord:w,createAdnlAddressRecord:_,createStorageBagIdRecord:A,createNextResolverRecord:S,parseSmartContractAddressRecord:k,parseAdnlAddressRecord:B,parseStorageBagIdRecord:O,parseSiteRecord:L,parseNextResolverRecord:D,dnsResolve:W}=x(88195);class H{constructor(Z){this.provider=Z}async getRootDnsAddress(){const Q=(await this.provider.getConfigParam(4)).bits.array;if(Q.length!==32)throw new Error("Invalid ConfigParam 4 length "+Q.length);const ie=C(Q);return new T("-1:"+ie)}async resolve(Z,Q,ie){const le=await this.getRootDnsAddress();return W(this.provider,le.toString(),Z,Q,ie)}getWalletAddress(Z){return this.resolve(Z,b)}getSiteAddress(Z){return this.resolve(Z,m)}}H.resolve=W,H.createSmartContractAddressRecord=w,H.createAdnlAddressRecord=_,H.createStorageBagIdRecord=A,H.createNextResolverRecord=S,H.parseNextResolverRecord=D,H.parseAdnlAddressRecord=B,H.parseStorageBagIdRecord=O,H.parseSiteRecord=L,H.parseSmartContractAddressRecord=k,H.DNS_CATEGORY_NEXT_RESOLVER=I,H.DNS_CATEGORY_WALLET=b,H.DNS_CATEGORY_SITE=m,H.DNS_CATEGORY_STORAGE=g,fe.exports.default=H},39640:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{Address:C}=x(12386),{parseAddress:I}=x(79361),{dnsResolve:m}=x(88195),{parseOffchainUriCell:b}=x(79361);class g extends v{constructor(_,A){if(A.wc=0,A.code=A.code,super(_,A),!A.collectionContent&&!A.address)throw new Error("required collectionContent cell");this.methods.getCollectionData=this.getCollectionData.bind(this),this.methods.getNftItemAddressByIndex=this.getNftItemAddressByIndex.bind(this),this.methods.getNftItemContent=this.getNftItemContent.bind(this),this.methods.resolve=this.resolve.bind(this)}createDataCell(){const _=new T;return _.refs[0]=this.options.collectionContent,_.refs[1]=T.oneFromBoc(this.options.dnsItemCodeHex),_}async getCollectionData(){const _=await this.getAddress(),A=await this.provider.call2(_.toString(),"get_collection_data"),S=A[0].toNumber(),k=A[1];return{collectionContentUri:b(k),collectionContent:k,ownerAddress:null,nextItemIndex:S}}async getNftItemContent(_){return await _.getData()}async getNftItemAddressByIndex(_){const A=await this.getAddress(),S=await this.provider.call2(A.toString(),"get_nft_address_by_index",[["num",_.toString()]]);return I(S)}async resolve(_,A,S){const k=await this.getAddress();return m(this.provider,k.toString(),_,A,S)}}fe.exports={DnsCollection:g}},20515:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{Address:C,BN:I}=x(12386),{parseAddress:m}=x(79361),{dnsResolve:b,categoryToBN:g}=x(88195);class w extends v{constructor(A,S){S.wc=0,S.code=S.code,super(A,S),this.methods.getData=this.getData.bind(this),this.methods.getDomain=this.getDomain.bind(this),this.methods.getAuctionInfo=this.getAuctionInfo.bind(this),this.methods.getLastFillUpTime=this.getLastFillUpTime.bind(this),this.methods.resolve=this.resolve.bind(this)}createDataCell(){const A=new T;return A.bits.writeUint(this.options.index,256),A.bits.writeAddress(this.options.collectionAddress),A}async getData(){const A=await this.getAddress(),S=await this.provider.call2(A.toString(),"get_nft_data"),k=S[0].toNumber()===-1,B=S[1],O=m(S[2]),L=k?m(S[3]):null,D=S[4];return{isInitialized:k,index:B,collectionAddress:O,ownerAddress:L,contentCell:D}}async createTransferBody(A){const S=new T;return S.bits.writeUint(1607220500,32),S.bits.writeUint(A.queryId||0,64),S.bits.writeAddress(A.newOwnerAddress),S.bits.writeAddress(A.responseAddress),S.bits.writeBit(!1),S.bits.writeCoins(A.forwardAmount||new I(0)),S.bits.writeBit(!1),A.forwardPayload&&S.bits.writeBytes(A.forwardPayload),S}createGetStaticDataBody(A){const S=new T;return S.bits.writeUint(801842850,32),S.bits.writeUint(A.queryId||0,64),S}async getDomain(){const A=await this.getAddress(),S=await this.provider.call2(A.toString(),"get_domain");return new TextDecoder().decode(S.bits.array.buffer)}async getAuctionInfo(){const A=await this.getAddress(),S=await this.provider.call2(A.toString(),"get_auction_info"),k=m(S[0]),B=S[1],O=S[2].toNumber();return{maxBidAddress:k,maxBidAmount:B,auctionEndTime:O}}async getLastFillUpTime(){const A=await this.getAddress();return(await this.provider.call2(A.toString(),"get_last_fill_up_time")).toNumber()}async resolve(A,S,k){const B=await this.getAddress();return b(this.provider,B.toString(),A,S,k)}}w.createChangeContentEntryBody=async _=>{const A=new T;return A.bits.writeUint(1320284409,32),A.bits.writeUint(_.queryId||0,64),A.bits.writeUint(await g(_.category),256),_.value&&(A.refs[0]=_.value),A},fe.exports={DnsItem:w}},88195:function(fe,p,x){const{parseAddress:v}=x(79361),{AdnlAddress:T,StorageBagId:C,BN:I,sha256:m,bytesToHex:b,bytesToBase64:g}=x(12386),{Cell:w}=x(43483),_="dns_next_resolver",A="wallet",S="site",k="storage",B=async re=>{if(!re)return new I(0);const N=new TextEncoder().encode(re),z=new Uint8Array(await m(N));return new I(b(z),16)},O=re=>{const N=new w;return N.bits.writeUint(40915,16),N.bits.writeAddress(re),N.bits.writeUint(0,8),N},L=re=>{const N=new w;return N.bits.writeUint(44289,16),N.bits.writeBytes(re.bytes),N.bits.writeUint(0,8),N},D=re=>{const N=new w;return N.bits.writeUint(29811,16),N.bits.writeBytes(re.bytes),N},W=re=>{const N=new w;return N.bits.writeUint(47763,16),N.bits.writeAddress(re),N},H=(re,N,z)=>{if(re.bits.array[0]!==N||re.bits.array[1]!==z)throw new Error("Invalid dns record value prefix");return re.bits.array=re.bits.array.slice(2),v(re)},G=re=>H(re,159,211),Z=re=>H(re,186,147),Q=re=>{if(re.bits.array[0]!==173||re.bits.array[1]!==1)throw new Error("Invalid dns record value prefix");const N=re.bits.array.slice(2,34);return new T(N)},ie=re=>{if(re.bits.array[0]!==116||re.bits.array[1]!==115)throw new Error("Invalid dns record value prefix");const N=re.bits.array.slice(2,34);return new C(N)},le=re=>re?re.bits.array[0]===173||re.bits.array[1]===1?Q(re):ie(re):null,be=async(re,N,z,V,U)=>{const j=z.length*8,$=new w;$.bits.writeBytes(z);const ee=await B(V),J=await re.call2(N,"dnsresolve",[["tvm.Slice",g(await $.toBoc(!1))],["num",ee.toString()]]);if(J.length!==2)throw new Error("Invalid dnsresolve response");const F=J[0].toNumber();let X=J[1];if(X instanceof Array&&X.length===0&&(X=null),X&&!X.bits)throw new Error("Invalid dnsresolve response");if(F===0)return null;if(F%8!==0)throw new Error("domain split not at a component boundary");if(F>j)throw new Error("invalid response "+F+"/"+j);if(F===j)return V===_?X?Z(X):null:V===A?X?G(X):null:V===S?X?le(X):null:V===k?X?ie(X):null:X;if(X){const de=Z(X);return U?V===_?de:null:await be(re,de.toString(),z.slice(F/8),V,!1)}else return null},we=re=>{if(!re||!re.length)throw new Error("empty domain");if(re===".")return new Uint8Array([0]);re=re.toLowerCase();for(let V=0;V<re.length;V++)if(re.charCodeAt(V)<=32)throw new Error("bytes in range 0..32 are not allowed in domain names");for(let V=0;V<re.length;V++){const U=re.substring(V,V+1);for(let j=127;j<=159;j++)if(U===String.fromCharCode(j))throw new Error("bytes in range 127..159 are not allowed in domain names")}const N=re.split(".");N.forEach(V=>{if(!V.length)throw new Error("domain name cannot have an empty component")});let z=N.reverse().join("\0")+"\0";return z.length<126&&(z="\0"+z),new TextEncoder().encode(z)},Ae=async(re,N,z,V,U)=>{const j=we(z);return be(re,N,j,V,U)};fe.exports={DNS_CATEGORY_NEXT_RESOLVER:_,DNS_CATEGORY_SITE:S,DNS_CATEGORY_WALLET:A,DNS_CATEGORY_STORAGE:k,categoryToBN:B,domainToBytes:we,createSmartContractAddressRecord:O,createAdnlAddressRecord:L,createNextResolverRecord:W,parseSmartContractAddressRecord:G,parseAdnlAddressRecord:Q,parseStorageBagIdRecord:ie,parseSiteRecord:le,parseNextResolverRecord:Z,createStorageBagIdRecord:D,dnsResolve:Ae}},95503:function(fe,p,x){const v=x(70040).default,{DnsCollection:T}=x(39640),{DnsItem:C}=x(20515);fe.exports.default={Dns:v,DnsCollection:T,DnsItem:C}},70360:function(fe){const p=10n,x=13n,v=1022n,T=8191n;class C{constructor(){this.shift=0n,this.bitnumber=0n}static fromShiftAndBitNumber(m,b){const g=new C;if(g.shift=m,g.shift<0)throw new Error("invalid shift");if(g.shift>T)throw new Error("invalid shift");if(g.bitnumber=b,g.bitnumber<0)throw new Error("invalid bitnumber");if(g.bitnumber>v)throw new Error("invalid bitnumber");return g}getNext(){let m=this.bitnumber+1n,b=this.shift;if(b===T&&m>v-1n)throw new Error("Overload");if(m>v&&(m=0n,b+=1n,b>T))throw new Error("Overload");return C.fromShiftAndBitNumber(b,m)}hasNext(){return!(this.bitnumber>=v-1n&&this.shift===T)}getShift(){return this.shift}getBitNumber(){return this.bitnumber}getQueryId(){return(this.shift<<p)+this.bitnumber}static fromQueryId(m){const b=m>>p,g=m&1023n;return this.fromShiftAndBitNumber(b,g)}static fromSeqno(m){const b=m/1023n,g=m%1023n;return this.fromShiftAndBitNumber(b,g)}toSeqno(){return this.bitnumber+this.shift*1023n}}fe.exports={HighloadQueryId:C}},697:function(fe,p,x){const{Cell:v}=x(43483),{Contract:T}=x(54351),{Address:C,BN:I,nacl:m}=x(12386),b="b5ee9c7241021001000228000114ff00f4a413f4bcf2c80b01020120020d02014803040078d020d74bc00101c060b0915be101d0d3030171b0915be0fa4030f828c705b39130e0d31f018210ae42e5a4ba9d8040d721d74cf82a01ed55fb04e030020120050a02027306070011adce76a2686b85ffc00201200809001aabb6ed44d0810122d721d70b3f0018aa3bed44d08307d721d70b1f0201200b0c001bb9a6eed44d0810162d721d70b15800e5b8bf2eda2edfb21ab09028409b0ed44d0810120d721f404f404d33fd315d1058e1bf82325a15210b99f326df82305aa0015a112b992306dde923033e2923033e25230800df40f6fa19ed021d721d70a00955f037fdb31e09130e259800df40f6fa19cd001d721d70a00937fdb31e0915be270801f6f2d48308d718d121f900ed44d0d3ffd31ff404f404d33fd315d1f82321a15220b98e12336df82324aa00a112b9926d32de58f82301de541675f910f2a106d0d31fd4d307d30cd309d33fd315d15168baf2a2515abaf2a6f8232aa15250bcf2a304f823bbf2a35304800df40f6fa199d024d721d70a00f2649130e20e01fe5309800df40f6fa18e13d05004d718d20001f264c858cf16cf8301cf168e1030c824cf40cf8384095005a1a514cf40e2f800c94039800df41704c8cbff13cb1ff40012f40012cb3f12cb15c9ed54f80f21d0d30001f265d3020171b0925f03e0fa4001d70b01c000f2a5fa4031fa0031f401fa0031fa00318060d721d300010f0020f265d2000193d431d19130e272b1fb00b585bf03",g=4269,w=A=>{if(!A)throw new Error("invalid timeout");if(A<60*10)throw new Error("minimum timeout 10 minute");if(A>60*60*24*30)throw new Error("maximum timeout 30 days")};class _ extends T{constructor(S,k){if(k.wc)throw new Error("only basechain (wc = 0) supported");if(k.wc=0,!k.address){if(!k.publicKey)throw new Error("no publicKey");if(!(k.publicKey instanceof Uint8Array))throw new Error("publicKey not Uint8Array");w(k.timeout)}k.code=v.oneFromBoc(b),super(S,k),this.options.walletId||(this.options.walletId=g),this.methods={transfer:B=>T.createMethod(S,this.createTransferMessage(B.secretKey,B.toAddress,B.amount,B.queryId,B.payload,B.sendMode,B.createdAt,B.needDeploy))},this.methods.getPublicKey=this.getPublicKey.bind(this),this.methods.getWalletId=this.getWalletId.bind(this),this.methods.getLastCleanTime=this.getLastCleanTime.bind(this),this.methods.getTimeout=this.getTimeout.bind(this),this.methods.isProcessed=this.isProcessed.bind(this)}getName(){return"highload-3"}createDataCell(){if(this.options.walletId!==0&&!this.options.walletId)throw new Error("no walletId");if(!this.options.publicKey)throw new Error("no publicKey");if(!(this.options.publicKey instanceof Uint8Array))throw new Error("publicKey not Uint8Array");w(this.options.timeout);const S=new v;return S.bits.writeBytes(this.options.publicKey),S.bits.writeUint(this.options.walletId,32),S.bits.writeUint(0,1),S.bits.writeUint(0,1),S.bits.writeUint(0,64),S.bits.writeUint(this.options.timeout,22),S}createSigningMessage(S,k,B,O){if(isNaN(B)||B===void 0||B===null)throw new Error("invalid sendMode");if(isNaN(k)||k===void 0||k===null)throw new Error("invalid createdAt");w(this.options.timeout);const L=new v;return L.bits.writeUint(this.options.walletId,32),L.refs.push(O),L.bits.writeUint(B,8),L.bits.writeUint(Number(S.getShift()),13),L.bits.writeUint(Number(S.getBitNumber()),10),L.bits.writeUint(k,64),L.bits.writeUint(this.options.timeout,22),L}async createTransferMessage(S,k,B,O,L="",D=3,W,H=!1){if(O==null)throw new Error("queryId must be number >= 0");if(W==null||W<0)throw new Error("createAt must be number >= 0");D==null&&(D=3);const G=T.createOutMsg(k,B,L),Z=this.createSigningMessage(O,W,D,G);return this.createExternalMessage(Z,S,H)}async createExternalMessage(S,k,B){const O=m.sign.detached(await S.hash(),k),L=new v;L.bits.writeBytes(O),L.refs.push(S);let D=null,W=null,H=null;if(B){if(!this.options.publicKey){const le=m.sign.keyPair.fromSecretKey(k);this.options.publicKey=le.publicKey}const ie=await this.createStateInit();D=ie.stateInit,W=ie.code,H=ie.data}const G=await this.getAddress(),Z=T.createExternalMessageHeader(G),Q=T.createCommonMsgInfo(Z,D,L);return{address:G,message:Q,body:L,signature:O,signingMessage:S,stateInit:D,code:W,data:H}}async getWalletId(){const S=await this.getAddress();return(await this.provider.call2(S.toString(),"get_subwallet_id")).toNumber()}async getPublicKey(){const S=await this.getAddress();return this.provider.call2(S.toString(),"get_public_key")}async getLastCleanTime(){const S=await this.getAddress();return(await this.provider.call2(S.toString(),"get_last_clean_time")).toNumber()}async getTimeout(){const S=await this.getAddress();return(await this.provider.call2(S.toString(),"get_timeout")).toNumber()}async isProcessed(S,k){const B=await this.getAddress();return!(await this.provider.call2(B.toString(),"processed?",[["num",S.getQueryId().toString()],["num",k?"-1":"0"]])).isZero()}}_.WALLET_ID_BASE=g,_.codeHex=b,fe.exports={HighloadWalletContractV3:_}},64433:function(fe,p,x){const{HighloadWalletContractV3:v}=x(697),{HighloadQueryId:T}=x(70360);fe.exports.default={HighloadQueryId:T,HighloadWalletContractV3:v,all:{"highload-3":v},list:[v]}},54351:function(fe,p,x){const{Cell:v}=x(43483),{Address:T,bytesToBase64:C,bytesToHex:I,BN:m}=x(12386);class b{constructor(w,_){this.provider=w,this.options=_,this.address=_.address?new T(_.address):null,_.wc||(_.wc=this.address?this.address.wc:0),this.methods={}}async getAddress(){return this.address||(this.address=(await this.createStateInit()).address),this.address}createCodeCell(){if(!this.options.code)throw new Error("Contract: options.code is not defined");return this.options.code}createDataCell(){return new v}async createStateInit(){const w=this.createCodeCell(),_=this.createDataCell(),A=b.createStateInit(w,_),S=await A.hash(),k=new T(this.options.wc+":"+I(S));return{stateInit:A,address:k,code:w,data:_}}static createStateInit(w,_,A=null,S=null,k=null){if(A)throw"Library in state init is not implemented";if(S)throw"Split depth in state init is not implemented";if(k)throw"Ticktock in state init is not implemented";const B=new v;return B.bits.writeBitArray([!!S,!!k,!!w,!!_,!!A]),w&&B.refs.push(w),_&&B.refs.push(_),A&&B.refs.push(A),B}static createInternalMessageHeader(w,_=0,A=!0,S=null,k=!1,B=null,O=null,L=0,D=0,W=0,H=0){const G=new v;if(G.bits.writeBit(!1),G.bits.writeBit(A),S!==null?G.bits.writeBit(S):G.bits.writeBit(new T(w).isBounceable),G.bits.writeBit(k),G.bits.writeAddress(B?new T(B):null),G.bits.writeAddress(new T(w)),G.bits.writeGrams(_),O)throw"Currency collections are not implemented yet";return G.bits.writeBit(!!O),G.bits.writeGrams(L),G.bits.writeGrams(D),G.bits.writeUint(W,64),G.bits.writeUint(H,32),G}static createExternalMessageHeader(w,_=null,A=0){const S=new v;return S.bits.writeUint(2,2),S.bits.writeAddress(_?new T(_):null),S.bits.writeAddress(new T(w)),S.bits.writeGrams(A),S}static createOutMsg(w,_,A,S=null){let k=new v;A&&(A.refs?k=A:typeof A=="string"?A.length>0&&(k.bits.writeUint(0,32),k.bits.writeString(A)):k.bits.writeBytes(A));const B=b.createInternalMessageHeader(new T(w),new m(_));return b.createCommonMsgInfo(B,S,k)}static createCommonMsgInfo(w,_=null,A=null){const S=new v;return S.writeCell(w),_?(S.bits.writeBit(!0),S.bits.writeBit(!0),S.refs.push(_)):S.bits.writeBit(!1),A?S.bits.getFreeBits()>=A.bits.getUsedBits()&&S.refs.length+A.refs.length<=4?(S.bits.writeBit(!1),S.writeCell(A)):(S.bits.writeBit(!0),S.refs.push(A)):S.bits.writeBit(!1),S}static createMethod(w,_){return{getBody:async()=>(await _).body,getQuery:async()=>(await _).message,send:async()=>{const A=await _,S=C(await A.message.toBoc(!1));return w.sendBoc(S)},estimateFee:async()=>{const A=await _,S=A.code?{address:A.address.toString(!0,!0,!1),body:C(await A.body.toBoc(!1)),init_code:C(await A.code.toBoc(!1)),init_data:C(await A.data.toBoc(!1))}:{address:A.address.toString(!0,!0,!0),body:C(await A.body.toBoc(!1))};return w.getEstimateFee(S)}}}}fe.exports={Contract:b}},94034:function(fe,p,x){const{Cell:v}=x(43483),{Address:T,BN:C,base64ToBytes:I}=x(12386),{WalletContract:m}=x(75310),b=698983191;class g extends m{constructor(_,A){A.code=v.oneFromBoc("B5EE9C7241021E01000261000114FF00F4A413F4BCF2C80B010201200203020148040501F2F28308D71820D31FD31FD31F802403F823BB13F2F2F003802251A9BA1AF2F4802351B7BA1BF2F4801F0BF9015410C5F9101AF2F4F8005057F823F0065098F823F0062071289320D74A8E8BD30731D4511BDB3C12B001E8309229A0DF72FB02069320D74A96D307D402FB00E8D103A4476814154330F004ED541D0202CD0607020120131402012008090201200F100201200A0B002D5ED44D0D31FD31FD3FFD3FFF404FA00F404FA00F404D1803F7007434C0C05C6C2497C0F83E900C0871C02497C0F80074C7C87040A497C1383C00D46D3C00608420BABE7114AC2F6C2497C338200A208420BABE7106EE86BCBD20084AE0840EE6B2802FBCBD01E0C235C62008087E4055040DBE4404BCBD34C7E00A60840DCEAA7D04EE84BCBD34C034C7CC0078C3C412040DD78CA00C0D0E00130875D27D2A1BE95B0C60000C1039480AF00500161037410AF0050810575056001010244300F004ED540201201112004548E1E228020F4966FA520933023BB9131E2209835FA00D113A14013926C21E2B3E6308003502323287C5F287C572FFC4F2FFFD00007E80BD00007E80BD00326000431448A814C4E0083D039BE865BE803444E800A44C38B21400FE809004E0083D10C06002012015160015BDE9F780188242F847800C02012017180201481B1C002DB5187E006D88868A82609E00C6207E00C63F04EDE20B30020158191A0017ADCE76A268699F98EB85FFC00017AC78F6A268698F98EB858FC00011B325FB513435C2C7E00017B1D1BE08E0804230FB50F620002801D0D3030178B0925B7FE0FA4031FA403001F001A80EDAA4"),super(_,A),this.options.walletId||(this.options.walletId=b+this.options.wc),this.methods.getPublicKey=this.getPublicKey.bind(this),this.methods.getWalletId=this.getWalletId.bind(this),this.methods.getLiquidBalance=this.getLiquidBalance.bind(this),this.methods.getNominalRestrictedBalance=this.getNominalRestrictedBalance.bind(this),this.methods.getNominalLockedBalance=this.getNominalLockedBalance.bind(this)}getName(){return"lockup-0.1"}createSigningMessage(_,A,S){_=_||0,A=A||Math.floor(Date.now()/1e3)+60;const k=new v;if(k.bits.writeUint(this.options.walletId,32),_===0)for(let B=0;B<32;B++)k.bits.writeBit(1);else k.bits.writeUint(A,32);return k.bits.writeUint(_,32),k}createDataCell(){const _=new v;return _.bits.writeUint(0,32),_.bits.writeUint(this.options.walletId,32),_.bits.writeBytes(this.options.publicKey),_.bits.writeBytes(I(this.options.config.config_public_key)),this.options.config.allowed_destinations?(_.bits.writeUint(1,1),_.refs.push(v.oneFromBoc(I(this.options.config.allowed_destinations)))):_.bits.writeUint(0,1),_.bits.writeGrams(0),_.bits.writeUint(0,1),_.bits.writeGrams(0),_.bits.writeUint(0,1),_}async getWalletId(){const _=await this.getAddress();return(await this.provider.call2(_.toString(),"get_subwallet_id")).toNumber()}async getPublicKey(){const _=await this.getAddress();return this.provider.call2(_.toString(),"get_public_key")}async getLiquidBalance(){const _=await this.getBalances();return _[0]-_[1]-_[2]}async getNominalRestrictedBalance(){return await this.getBalances()[1]}async getNominalLockedBalance(){return await this.getBalances()[2]}async getBalances(){const _=await this.getAddress();return this.provider.call2(_.toString(),"get_balances")}}g.WALLET_ID_BASE=b,fe.exports={LockupWalletV1:g}},68476:function(fe,p,x){const{Cell:v}=x(43483),{Address:T,BN:C,bytesToHex:I}=x(12386),{WalletContract:m}=x(75310),{parseAddress:b}=x(79361),{Contract:g}=x(54351),w=268,_="b5ee9c7241021c010003fb000114ff00f4a413f4bcf2c80b01020120030203b8f28308d71820d31fd31fd31f02f823bbf264ed44d0d31fd31fd3ff305abaf2a15033baf2a202f9014033f910f2a3f800db3c20d74ac0018e99ed44ed45ed47915bed67ed65ed648e82db3ced41edf101f2ff9130e2f841a4f861db3c1b1413020148110402012008050201200706020db9846db3cdb3c81b1a0129ba462db3cf845f846f847f848f849f84af84bf84481b0201200e090201620d0a02016a0c0b012fa2c76cf3e9100723281f2fff2743e112040423d029be84c61b000fa25fb513435c2c7e014bad346d9e36fc22470d4080847a4937d29910ce6903e9ff9837812801b7810148987159f318401b02016e100f0019af1df6a26840106b90eb858fc00019adce76a26840206b90eb85ffc003acd06c2220d749c160915be001d0d3030171b0915be0fa4030db3c01d31fd33ff84b5240c705238210a7733acdbab08ea46c12db3c8210f7733acd01708018c8cb055004cf1623fa0213cb6acb1fcb3fc98040fb00e30e1b141201cef84a5240c7050382107258a69bba13b08ed18e2c01fa407fc8ca0002fa4401c8ca07cbffc9d0f8441023810108f441f86420d74ac200209501d430d001deb312e68210f258a69b32708018c8cb055004cf1623fa0213cb6acb1fcb3fc98040fb00db3c925f03e2130066f848f847f846f845c8cb3fcb1fcb1fcb1ff849fa02f84acf16f84bcf16c9f844f843f842f841c8cb1fcb1fcbfff400ccc9ed54025cd307d4d1f823db3c20c2008e9b22c003f2e06421d0d303fa4031fa40f84a5220c705b3925f04e30d9130e201fb001a1503fa21fa4401c8ca07cbffc9d0f844810108f40a6fa1318f5f330172b0c002f2e06501fa003171d721fa0031fa0031d33f31d31f31d30001c000f2e066d3000193d430d0de2171db3c8e2a31d31f302082104e73744bba21821047657424bab121821056744370bab1018210566f7465bab1f2e067e30e70925f03e220c200191716000e9372fb029130e202ea0170db3c8e6d20d749c2008e63d31f21c00022830bbab122811001bab122821047d54391bab1228210595f07bcbab122821069fb306cbab1228210566f7465bab122821056744370bab1f2e06701c00021d749c200b08e15d3073020c06421c077b121c044b101c057b1f2e0689130e29130e2e30d1918001ad31f308210566f7465baf2e067004401fa4401c3ff925b70e001f833206e925b70e0d020d7498307b9925b70e0d70bffba0060f845f846a05210bc923070e0f845f848a05210b99330f849e0f849f849f84513a1f847a904f846f847a9041023a984a1007eed44d0d31f01f861d31f01f862d3ff01f863f40401f864d401d0d33f01f865d31f01f866d31f01f867d31f01f868fa0001f869fa4001f86afa4001f86bd1d10a20c6a7";class A extends m{constructor(k,B){B.code=v.oneFromBoc(_),super(k,B),this.options.walletId||(this.options.walletId=w+this.options.wc),this.methods.getPublicKey=this.getPublicKey.bind(this),this.methods.getWalletId=this.getWalletId.bind(this),this.methods.getLockedAmount=this.getLockedAmount.bind(this),this.methods.getVestingData=this.getVestingData.bind(this),this.methods.getWhitelist=this.getWhitelist.bind(this)}getName(){return"vesting-1"}createSigningMessage(k,B,O){k=k||0,B=B||Math.floor(Date.now()/1e3)+60;const L=new v;if(L.bits.writeUint(this.options.walletId,32),k===0)for(let D=0;D<32;D++)L.bits.writeBit(1);else L.bits.writeUint(B,32);return L.bits.writeUint(k,32),L}createDataCell(){if(this.options.walletId!==0&&!this.options.walletId)throw new Error("no walletId");if(!this.options.publicKey)throw new Error("no publicKey");if(!(this.options.publicKey instanceof Uint8Array))throw new Error("publicKey not Uint8Array");if(this.options.vestingStartTime!==0&&!this.options.vestingStartTime)throw new Error("no vestingStartTime");if(this.options.vestingTotalDuration<=0)throw new Error("vestingTotalDuration cant be zero or negative");if(!this.options.vestingTotalDuration)throw new Error("no vestingTotalDuration");if(this.options.vestingTotalDuration>4294967295)throw new Error("vestingTotalDuration > 2^32 - 1");if(this.options.unlockPeriod<=0)throw new Error("unlockPeriod cant be zero or negative");if(!this.options.unlockPeriod)throw new Error("no unlockPeriod");if(this.options.unlockPeriod>this.options.vestingTotalDuration)throw new Error("unlockPeriod > vestingTotalDuration");if(this.options.cliffDuration!==0&&!this.options.cliffDuration)throw new Error("no cliffDuration");if(this.options.cliffDuration<0)throw new Error("cliffDuration cant be negative");if(this.options.cliffDuration>=this.options.vestingTotalDuration)throw new Error("cliffDuration >= vestingTotalDuration");if(!new C(this.options.vestingTotalDuration).div(new C(this.options.unlockPeriod)).mul(new C(this.options.unlockPeriod)).eq(new C(this.options.vestingTotalDuration)))throw new Error("vestingTotalDuration mod unlockPeriod != 0");if(!new C(this.options.cliffDuration).div(new C(this.options.unlockPeriod)).mul(new C(this.options.unlockPeriod)).eq(new C(this.options.cliffDuration)))throw new Error("cliffDuration mod unlockPeriod != 0");if(!this.options.vestingTotalAmount)throw new Error("no vestingTotalAmount");if(!this.options.vestingTotalAmount.gt(new C(0)))throw new Error("vestingTotalAmount cant be zero");if(!this.options.vestingSenderAddress)throw new Error("no vestingSenderAddress");if(!(this.options.vestingSenderAddress instanceof T))throw new Error("vestingSenderAddress not Address");if(!this.options.ownerAddress)throw new Error("no ownerAddress");if(!(this.options.ownerAddress instanceof T))throw new Error("ownerAddress not Address");const O=new v;O.bits.writeUint(0,32),O.bits.writeUint(this.options.walletId,32),O.bits.writeUint(new C(I(this.options.publicKey),16),256),O.bits.writeBit(!1);const L=new v;return L.bits.writeUint(this.options.vestingStartTime,64),L.bits.writeUint(this.options.vestingTotalDuration,32),L.bits.writeUint(this.options.unlockPeriod,32),L.bits.writeUint(this.options.cliffDuration,32),L.bits.writeCoins(this.options.vestingTotalAmount),L.bits.writeAddress(new T(this.options.vestingSenderAddress)),L.bits.writeAddress(new T(this.options.ownerAddress)),O.refs[0]=L,O}createAddWhitelistBody(k){const{addresses:B,queryId:O}=k,L=new v;L.bits.writeUint(1918412443,32),L.bits.writeUint(O||0,64),L.bits.writeAddress(B[0]);let D=null;for(let W=B.length-1;W>=1;W--){const H=new v;H.bits.writeAddress(B[W]),D&&(H.refs[0]=D),D=H}return D&&(L.refs[0]=D),L}createInternalTransfer(k){const B=new v;return B.bits.writeUint(2809346765,32),B.bits.writeUint(k.queryId||0,64),B.bits.writeUint8(k.sendMode||3),B.refs.push(g.createOutMsg(k.address,k.amount,k.payload)),B}async getPublicKey(){const k=await this.getAddress();return this.provider.call2(k.toString(),"get_public_key")}async getWalletId(){const k=await this.getAddress();return this.provider.call2(k.toString(),"get_subwallet_id")}async getLockedAmount(k){const B=await this.getAddress();return this.provider.call2(B.toString(),"get_locked_amount",[["num",k]])}async getVestingData(){const k=await this.getAddress(),B=await this.provider.call2(k.toString(),"get_vesting_data"),O=B[0].toNumber(),L=B[1].toNumber(),D=B[2].toNumber(),W=B[3].toNumber(),H=B[4],G=b(B[5]),Z=b(B[6]),Q=B[7];return{vestingStartTime:O,vestingTotalDuration:L,unlockPeriod:D,cliffDuration:W,vestingTotalAmount:H,vestingSenderAddress:G,ownerAddress:Z,whitelistCell:Q}}async getWhitelist(){const k=await this.getAddress(),B=await this.provider.call2(k.toString(),"get_whitelist"),O=[];for(const L of B){if(L.length!==2)throw new Error("invalid whitelist result");const D=L[0],W=L[1],H=new T(D.toString(10)+":"+W.toString(16).padStart(64,"0"));O.push(H)}return O}}A.WALLET_ID_BASE=w,A.codeHex=_,fe.exports={VestingWalletV1:A}},44730:function(fe,p,x){const{LockupWalletV1:v}=x(94034),{VestingWalletV1:T}=x(68476);fe.exports.default={LockupWalletV1:v,VestingWalletV1:T,all:{"lockup-0.1":v,"vesting-1":T},list:[v,T]}},60774:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{nacl:C,hexToBytes:I,BN:m}=x(12386),{parseAddress:b}=x(79361),{writePublicKey:g,writeSignature:w,createSignatureCell:_,tag_init:A,tag_cooperative_close:S,tag_cooperative_commit:k,tag_start_uncooperative_close:B,tag_challenge_state:O,tag_settle_conditionals:L,tag_state:D,op_top_up_balance:W,op_init_channel:H,op_cooperative_close:G,op_cooperative_commit:Z,op_start_uncooperative_close:Q,op_challenge_quarantined_state:ie,op_settle_conditionals:le,op_finish_uncooperative_close:be,op_channel_closed:we,createTopUpBalance:Ae,createInitChannelBody:re,createCooperativeCloseChannelBody:N,createCooperativeCommitBody:z,createConditionalPayment:V,createSemiChannelBody:U,createSemiChannelState:j,createSignedSemiChannelState:$,createStartUncooperativeCloseBody:ee,createChallengeQuarantinedStateBody:J,createSettleConditionalsBody:F,createFinishUncooperativeClose:X,createOneSignature:de,createTwoSignature:Y}=x(83956),ce="B5EE9C72410230010007FB000114FF00F4A413F4BCF2C80B0102012002030201480405000AF26C21F0190202CB06070201202E2F020120080902012016170201200A0B0201200C0D0009D3610F80CC001D6B5007434C7FE8034C7CC1BC0FE19E0201580E0F0201201011002D3E11DBC4BE11DBC43232C7FE11DBC47E80B2C7F2407320008B083E1B7B51343480007E187E80007E18BE80007E18F4FFC07E1934FFC07E1974DFC07E19BC01887080A7F4C7C07E1A34C7C07E1A7D01007E1AB7807080E535007E1AF7BE1B2002012012130201201415008D3E13723E11BE117E113E10540132803E10BE80BE10FE8084F2FFC4B2FFF2DFFC02887080A7FE12BE127E121400F2C7C4B2C7FD0037807080E53E12C073253E1333C5B8B27B5520004D1C3C02FE106CFCB8193E803E800C3E1096283E18BE10C0683E18FE10BE10E8006EFCB819BC032000CF1D3C02FE106CFCB819348020C235C6083E4040E4BE1124BE117890CC3E443CB81974C7C060841A5B9A5D2EBCB81A3E118074DFD66EBCB81CBE803E800C3E1094882FBE10D4882FAC3CB819807E18BE18FE12F43E800C3E10BE10E80068006E7CB8199FFE187C0320004120843777222E9C20043232C15401B3C594013E808532DA84B2C7F2DFF2407EC02002012018190201D42B2C0201201A1B0201201E1F0201201C1D00E5473F00BD401D001D401D021F90102D31F01821043436D74BAF2E068F84601D37F59BAF2E072F844544355F910F8454330F910B0F2E065D33FD33F30F84822B9F84922B9B0F2E06C21F86820F869F84A6E915B8E19F84AD0D33FFA003171D721D33F305033BC02BCB1936DF86ADEE2F800F00C8006F3E12F43E800C7E903E900C3E09DBC41CBE10D62F24CC20C1B7BE10FE11963C03FE10BE11A04020BC03DC3E185C3E189C3E18DB7E1ABC032000B51D3C02F5007400750074087E4040B4C7C0608410DB1BDCEEBCB81A3E118074DFD66EBCB81CBE111510D57E443E1150CC3E442C3CB8197E80007E18BE80007E18F4CFF4CFCC3E1208AE7E1248AE6C3CB81B007E1A3E1A7E003C042001C1573F00BF84A6EF2E06AD2008308D71820F9012392F84492F845E24130F910F2E065D31F018210556E436CBAF2E068F84601D37F59BAF2E072D401D08308D71820F901F8444130F910F2E06501D430D08308D71820F901F8454130F910F2E06501820020120222301FED31F01821043685374BAF2E068F84601D37F59BAF2E072D33FFA00F404552003D200019AD401D0D33FFA00F40430937F206DE2303205D31F01821043685374BAF2E068F84601D37F59BAF2E072D33FFA00F404552003D200019AD401D0D33FFA00F40430937F206DE23032F8485280BEF8495250BEB0524BBE1AB0527ABE19210064B05215BE14B05248BE17B0F2E06970F82305C8CB3F5004FA0215F40015CB3F5004FA0212F400CB1F12CA00CA00C9F86AF00C01C31CFC02FE129BACFCB81AF48020C235C6083E4048E4BE1124BE1178904C3E443CB81974C7C0608410DA19D46EBCB81A3E118074DFD66EBCB81CB5007420C235C6083E407E11104C3E443CB81940750C3420C235C6083E407E11504C3E443CB81940602403F71CFC02FE129BACFCB81AF48020C235C6083E4048E4BE1124BE1178904C3E443CB81974C7C0608410DB10DBAEBCB81A3E118074DFD66EBCB81CBD010C3E12B434CFFE803D0134CFFE803D0134C7FE11DBC4148828083E08EE7CB81BBE11DBC4A83E08EF3CB81C34800C151D5A64D6D4C8F7A2B98E82A49B08B8C3816028292A01FCD31F01821043685374BAF2E068F84601D37F59BAF2E072D33FFA00F404552003D200019AD401D0D33FFA00F40430937F206DE2303205D31F01821043685374BAF2E068F84601D37F59BAF2E072D33FFA00F404552003D200019AD401D0D33FFA00F40430937F206DE230325339BE5381BEB0F8495250BEB0F8485290BEB02502FE5237BE16B05262BEB0F2E06927C20097F84918BEF2E0699137E222C20097F84813BEF2E0699132E2F84AD0D33FFA00F404D33FFA00F404D31FF8476F105220A0F823BCF2E06FD200D20030B3F2E073209C3537373A5274BC5263BC12B18E11323939395250BC5299BC18B14650134440E25319BAB3F2E06D9130E30D7F05C82627002496F8476F1114A098F8476F1117A00603E203003ECB3F5004FA0215F40012CB3F5004FA0213F400CB1F12CA00CA00C9F86AF00C00620A8020F4966FA5208E213050038020F4666FA1208E1001FA00ED1E15DA119450C3A00B9133E2923430E202926C21E2B31B000C3535075063140038C8CB3F5004FA0212F400CB3F5003FA0213F400CB1FCA00C9F86AF00C00D51D3C02FE129BACFCB81AFE12B434CFFE803D010C74CFFE803D010C74C7CC3E11DBC4283E11DBC4A83E08EE7CB81C7E003E10886808E87E18BE10D400E816287E18FE10F04026BE10BE10E83E189C3E18F7BE10B04026BE10FE10A83E18DC3E18F780693E1A293E1A7C042001F53B7EF4C7C8608419F1F4A06EA4CC7C037808608403818830AEA54C7C03B6CC780C882084155DD61FAEA54C3C0476CC780820841E6849BBEEA54C3C04B6CC7808208407C546B3EEA54C3C0576CC780820840223AA8CAEA54C3C05B6CC7808208419BDBC1A6EA54C3C05F6CC780C60840950CAA46EA53C0636CC78202D0008840FF2F00075BC7FE3A7805FC25E87D007D207D20184100D0CAF6A1EC7C217C21B7817C227C22B7817C237C23FC247C24B7817C2524C3B7818823881B22A021984008DBD0CABA7805FC20C8B870FC253748B8F07C256840206B90FD0018C020EB90FD0018B8EB90E98F987C23B7882908507C11DE491839707C23B788507C23B789507C11DE48B9F03A4331C4966";class he extends v{constructor(ke,ut){ut.publicKeyA=ut.isA?ut.myKeyPair.publicKey:ut.hisPublicKey,ut.publicKeyB=ut.isA?ut.hisPublicKey:ut.myKeyPair.publicKey,ut.wc=ut.wc||0,ut.code=ut.code||T.oneFromBoc(ce),super(ke,ut)}createDataCell(){const ke=new T;ke.bits.writeBit(0),ke.bits.writeCoins(0),ke.bits.writeCoins(0),g(ke,this.options.publicKeyA),g(ke,this.options.publicKeyB),ke.bits.writeUint(this.options.channelId,128);const ut=new T;ut.bits.writeUint(this.options.closingConfig?.quarantineDuration||0,32),ut.bits.writeCoins(this.options.closingConfig?.misbehaviorFine||new m(0)),ut.bits.writeUint(this.options.closingConfig?.conditionalCloseDuration||0,32),ke.refs[0]=ut,ke.bits.writeUint(0,32),ke.bits.writeUint(0,32),ke.bits.writeBit(!1);const Re=new T;return Re.bits.writeCoins(this.options.excessFee||new m(0)),Re.bits.writeAddress(this.options.addressA),Re.bits.writeAddress(this.options.addressB),ke.refs[1]=Re,ke}async createOneSignature(ke,ut){const Re=C.sign.detached(await ut.hash(),this.options.myKeyPair.secretKey);return{cell:de({op:ke,isA:this.options.isA,signature:Re,cell:ut}),signature:Re}}async createTwoSignature(ke,ut,Re){const ze=C.sign.detached(await Re.hash(),this.options.myKeyPair.secretKey),_t=this.options.isA?ze:ut,Ct=this.options.isA?ut:ze;return{cell:Y({op:ke,signatureA:_t,signatureB:Ct,cell:Re}),signature:ze}}async createTopUpBalance(ke){return Ae(ke)}async createInitChannel(ke){return this.createOneSignature(H,re({...ke,channelId:this.options.channelId}))}async createCooperativeCloseChannel(ke){return ke.hisSignature||(ke.hisSignature=new Uint8Array(64)),this.createTwoSignature(G,ke.hisSignature,N({...ke,channelId:this.options.channelId}))}async createCooperativeCommit(ke){return ke.hisSignature||(ke.hisSignature=new Uint8Array(64)),this.createTwoSignature(Z,ke.hisSignature,z({...ke,channelId:this.options.channelId}))}async createSignedSemiChannelState(ke){const ut=j({channelId:this.options.channelId,semiChannelBody:U({seqno:ke.mySeqno,sentCoins:ke.mySentCoins,conditionals:null}),counterpartySemiChannelBody:ke.hisSeqno===void 0?null:U({seqno:ke.hisSeqno,sentCoins:ke.hisSentCoins,conditionals:null})}),Re=C.sign.detached(await ut.hash(),this.options.myKeyPair.secretKey);return{cell:$({signature:Re,state:ut}),signature:Re}}async signState(ke){const ut=this.options.isA?ke.seqnoA:ke.seqnoB,Re=this.options.isA?ke.seqnoB:ke.seqnoA,ze=this.options.initBalanceA.gt(ke.balanceA)?this.options.initBalanceA.sub(ke.balanceA):new m(0),_t=this.options.initBalanceB.gt(ke.balanceB)?this.options.initBalanceB.sub(ke.balanceB):new m(0),Ct=this.options.isA?ze:_t,$t=this.options.isA?_t:ze,{cell:ft,signature:Xe}=await this.createSignedSemiChannelState({mySeqno:ut,mySentCoins:Ct,hisSeqno:Re,hisSentCoins:$t});return Xe}async verifyState(ke,ut){const Re=this.options.isA?ke.seqnoB:ke.seqnoA,ze=this.options.isA?ke.seqnoA:ke.seqnoB,_t=this.options.initBalanceA.gt(ke.balanceA)?this.options.initBalanceA.sub(ke.balanceA):new m(0),Ct=this.options.initBalanceB.gt(ke.balanceB)?this.options.initBalanceB.sub(ke.balanceB):new m(0),$t=this.options.isA?Ct:_t,ft=this.options.isA?_t:Ct,ct=await j({channelId:this.options.channelId,semiChannelBody:U({seqno:Re,sentCoins:$t,conditionals:null}),counterpartySemiChannelBody:ze===void 0?null:U({seqno:ze,sentCoins:ft,conditionals:null})}).hash();return C.sign.detached.verify(ct,ut,this.options.isA?this.options.publicKeyB:this.options.publicKeyA)}async signClose(ke){const{cell:ut,signature:Re}=await this.createCooperativeCloseChannel(ke);return Re}async verifyClose(ke,ut){const ze=await(await N({...ke,channelId:this.options.channelId})).hash();return C.sign.detached.verify(ze,ut,this.options.isA?this.options.publicKeyB:this.options.publicKeyA)}async createStartUncooperativeClose(ke){return this.createOneSignature(Q,ee({...ke,channelId:this.options.channelId}))}async createChallengeQuarantinedState(ke){return this.createOneSignature(ie,J({...ke,channelId:this.options.channelId}))}async createSettleConditionals(ke){return this.createOneSignature(le,F({...ke,channelId:this.options.channelId}))}async createFinishUncooperativeClose(){return X()}static STATE_UNINITED=0;static STATE_OPEN=1;static STATE_CLOSURE_STARTED=2;static STATE_SETTLING_CONDITIONALS=3;static STATE_AWAITING_FINALIZATION=4;async getChannelState(){const ke=await this.getAddress();return(await this.provider.call2(ke.toString(),"get_channel_state",[])).toNumber()}async getData(){const ke=De=>{let He=De.toString(16);return He.length%2!==0&&(He="0"+He),I(He)},ut=await this.getAddress(),Re=await this.provider.call2(ut.toString(),"get_channel_data",[]),ze=Re[0].toNumber(),_t=Re[1][0],Ct=Re[1][1],$t=ke(Re[2][0]),ft=ke(Re[2][1]),Xe=Re[3],ct=Re[4][0].toNumber(),wt=Re[4][1],Rt=Re[4][2].toNumber(),Ge=Re[5][0],zt=Re[5][1],Ft=Re[6],tt=Re[7][0],qe=b(Re[7][1]),dt=b(Re[7][2]);return{state:ze,balanceA:_t,balanceB:Ct,publicKeyA:$t,publicKeyB:ft,channelId:Xe,quarantineDuration:ct,misbehaviorFine:wt,conditionalCloseDuration:Rt,seqnoA:Ge,seqnoB:zt,quarantine:Ft,excessFee:tt,addressA:qe,addressB:dt}}fromWallet(ke){const{wallet:ut,secretKey:Re}=ke,ze=(_t,Ct)=>{const $t=async ft=>{const Xe=Ct?(await this.createStateInit()).stateInit:null,ct=await this.getAddress(),wt=await ut.methods.seqno().call()||0,Rt=await _t;return ut.methods.transfer({secretKey:Re,toAddress:ct.toString(!0,!0,!0),amount:ft,seqno:wt,payload:Rt,stateInit:Xe,sendMode:3})};return{send:ft=>$t(ft).then(Xe=>Xe.send()),estimateFee:ft=>$t(ft).then(Xe=>Xe.estimateFee())}};return{deploy:()=>ze(null,!0),init:_t=>ze(this.createInitChannel(_t).then(Ct=>Ct.cell)),topUp:_t=>ze(this.createTopUpBalance(_t)),close:_t=>ze(this.createCooperativeCloseChannel(_t).then(Ct=>Ct.cell)),commit:_t=>ze(this.createCooperativeCommit(_t).then(Ct=>Ct.cell)),startUncooperativeClose:_t=>ze(this.createStartUncooperativeClose(_t).then(Ct=>Ct.cell)),challengeQuarantinedState:_t=>ze(this.createChallengeQuarantinedState(_t).then(Ct=>Ct.cell)),settleConditionals:_t=>ze(this.createSettleConditionals(_t).then(Ct=>Ct.cell)),finishUncooperativeClose:()=>ze(this.createFinishUncooperativeClose())}}}he.codeHex=ce,fe.exports={PaymentChannel:he}},83956:function(fe,p,x){const{Cell:v}=x(43483),T=(X,de)=>{if(de.length!==256/8)throw new Error("invalid publicKey length");X.bits.writeBytes(de)},C=(X,de)=>{if(de.length!==512/8)throw new Error("invalid signature length");X.bits.writeBytes(de)},I=X=>{const de=new v;return C(de,X),de},m=(X,de)=>{if(de){if(X.bits.writeBit(1),X.refs.length>=4)throw new Error("refs overflow");X.refs.push(de)}else X.bits.writeBit(0)},b=m,g=1768843636,w=1131179891,_=1128492404,A=1433289580,S=1130915665,k=1131168622,B=1130910580,O=1741148801,L=235282626,D=1433884798,W=2040604399,H=521476815,G=143567410,Z=1727459433,Q=625158801,ie=-572749638,le=X=>{const de=new v;return de.bits.writeUint(O,32),de.bits.writeCoins(X.coinsA),de.bits.writeCoins(X.coinsB),de},be=X=>{const de=new v;return de.bits.writeUint(g,32),de.bits.writeUint(X.channelId,128),de.bits.writeCoins(X.balanceA),de.bits.writeCoins(X.balanceB),de},we=X=>{const de=new v;return de.bits.writeUint(w,32),de.bits.writeUint(X.channelId,128),de.bits.writeCoins(X.balanceA),de.bits.writeCoins(X.balanceB),de.bits.writeUint(X.seqnoA,64),de.bits.writeUint(X.seqnoB,64),de},Ae=X=>{const de=new v;return de.bits.writeUint(_,32),de.bits.writeUint(X.channelId,128),de.bits.writeUint(X.seqnoA,64),de.bits.writeUint(X.seqnoB,64),de},re=X=>{const de=new v;return de.bits.writeCoins(X.amount),de.writeCell(X.condition),de},N=X=>{const de=new v;return de.bits.writeUint(X.seqno,64),de.bits.writeCoins(X.sentCoins),b(de,X.conditionals),de},z=X=>{const de=new v;return de.bits.writeUint(B,32),de.bits.writeUint(X.channelId,128),de.writeCell(X.semiChannelBody),m(de,X.counterpartySemiChannelBody),de},V=X=>{const de=new v;return C(de,X.signature),de.writeCell(X.state),de},U=X=>{const de=new v;return de.bits.writeUint(A,32),de.bits.writeUint(X.channelId,128),de.refs[0]=X.signedSemiChannelStateA,de.refs[1]=X.signedSemiChannelStateB,de},j=X=>{const de=new v;return de.bits.writeUint(S,32),de.bits.writeUint(X.channelId,128),de.refs[0]=X.signedSemiChannelStateA,de.refs[1]=X.signedSemiChannelStateB,de},$=X=>{const de=new v;return de.bits.writeUint(k,32),de.bits.writeUint(X.channelId,128),b(de,X.conditionalsToSettle),de},ee=()=>{const X=new v;return X.bits.writeUint(Q,32),X},J=X=>{const de=new v;return de.bits.writeUint(X.op,32),de.bits.writeBit(X.isA),C(de,X.signature),de.writeCell(X.cell),de},F=X=>{const de=new v;return de.bits.writeUint(X.op,32),de.refs[0]=I(X.signatureA),de.refs[1]=I(X.signatureB),de.writeCell(X.cell),de};fe.exports={writePublicKey:T,writeSignature:C,createSignatureCell:I,tag_init:g,tag_cooperative_close:w,tag_cooperative_commit:_,tag_start_uncooperative_close:A,tag_challenge_state:S,tag_settle_conditionals:k,tag_state:B,op_top_up_balance:O,op_init_channel:L,op_cooperative_close:D,op_cooperative_commit:W,op_start_uncooperative_close:H,op_challenge_quarantined_state:G,op_settle_conditionals:Z,op_finish_uncooperative_close:Q,op_channel_closed:ie,createTopUpBalance:le,createInitChannelBody:be,createCooperativeCloseChannelBody:we,createCooperativeCommitBody:Ae,createConditionalPayment:re,createSemiChannelBody:N,createSemiChannelState:z,createSignedSemiChannelState:V,createStartUncooperativeCloseBody:U,createChallengeQuarantinedStateBody:j,createSettleConditionalsBody:$,createFinishUncooperativeClose:ee,createOneSignature:J,createTwoSignature:F}},32647:function(fe,p,x){const{PaymentChannel:v}=x(60774);class T{constructor(I){this.provider=I}createChannel(I){return new v(this.provider,I)}}fe.exports={Payments:T,PaymentChannel:v}},84445:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{hexToBytes:C,BN:I,nacl:m,bytesToBase64:b}=x(12386);class g extends v{constructor(_,A){A.code=T.oneFromBoc("B5EE9C7241020F01000262000114FF00F4A413F4BCF2C80B0102012002030201480405036AF230DB3C5335A127A904F82327A128A90401BC5135A0F823B913B0F29EF800725210BE945387F0078E855386DB3CA4E2F82302DB3C0B0C0D0202CD06070121A0D0C9B67813F488DE0411F488DE0410130B048FD6D9E05E8698198FD201829846382C74E2F841999E98F9841083239BA395D497803F018B841083AB735BBED9E702984E382D9C74688462F863841083AB735BBED9E70156BA4E09040B0A0A080269F10FD22184093886D9E7C12C1083239BA39384008646582A803678B2801FD010A65B5658F89659FE4B9FD803FC1083239BA396D9E40E0A04F08E8D108C5F0C708210756E6B77DB3CE00AD31F308210706C7567831EB15210BA8F48305324A126A904F82326A127A904BEF27109FA4430A619F833D078D721D70B3F5260A11BBE8E923036F82370708210737562732759DB3C5077DE106910581047103645135042DB3CE0395F076C2232821064737472BA0A0A0D09011A8E897F821064737472DB3CE0300A006821B39982100400000072FB02DE70F8276F118010C8CB055005CF1621FA0214F40013CB6912CB1F830602948100A032DEC901FB000030ED44D0FA40FA40FA00D31FD31FD31FD31FD31FD307D31F30018021FA443020813A98DB3C01A619F833D078D721D70B3FA070F8258210706C7567228018C8CB055007CF165004FA0215CB6A12CB1F13CB3F01FA02CB00C973FB000E0040C8500ACF165008CF165006FA0214CB1F12CB1FCB1FCB1FCB1FCB07CB1FC9ED54005801A615F833D020D70B078100D1BA95810088D721DED307218100DDBA028100DEBA12B1F2E047D33F30A8AB0FE5855AB4"),super(_,A),this.methods.pay=()=>v.createMethod(_,this.createPayExternalMessage()),this.methods.getSubscriptionData=this.getSubscriptionData.bind(this)}createDataCell(){const _=new T;return _.bits.writeAddress(this.options.wallet),_.bits.writeAddress(this.options.beneficiary),_.bits.writeGrams(this.options.amount),_.bits.writeUint(this.options.period,32),_.bits.writeUint(this.options.startAt,32),_.bits.writeUint(this.options.timeout,32),_.bits.writeUint(0,32),_.bits.writeUint(0,32),_.bits.writeUint(0,8),_.bits.writeUint(this.options.subscriptionId,32),_}createBody(){const _=new T;return _.bits.writeUint(new I(1886156135).add(new I(2147483648)),32),_}createSelfDestructBody(){const _=new T;return _.bits.writeUint(1685288050,32),_}async getSubscriptionData(){const _=ie=>ie[0].toNumber()+":"+ie[1].toString(16),A=await this.getAddress(),S=await this.provider.call2(A.toString(),"get_subscription_data"),k=_(S[0]),B=_(S[1]),O=S[2],L=S[3].toNumber(),D=S[4].toNumber(),W=S[5].toNumber(),H=S[6].toNumber(),G=S[7].toNumber(),Z=S[8].toNumber(),Q=S[9].toNumber();return{wallet:k,beneficiary:B,amount:O,period:L,startAt:D,timeout:W,lastPayment:H,lastRequest:G,failedAttempts:Z,subscriptionId:Q}}async createPayExternalMessage(){const _=await this.getAddress(),A=v.createExternalMessageHeader(_),S=v.createCommonMsgInfo(A,null,null),k=new T;return k.bits.writeUint(Math.floor(Date.now()/1e3),64),{address:_,message:S,body:k}}}fe.exports={SubscriptionContract:g}},21673:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{createOffchainUriCell:C,parseOffchainUriCell:I,parseAddress:m}=x(79361),{Address:b,BN:g,bytesToBase64:w}=x(12386);class _ extends v{constructor(S,k){k.wc=0,k.code=k.code||T.oneFromBoc("B5EE9C7241020B010001ED000114FF00F4A413F4BCF2C80B0102016202030202CC040502037A60090A03EFD9910E38048ADF068698180B8D848ADF07D201800E98FE99FF6A2687D007D206A6A18400AA9385D47181A9AA8AAE382F9702480FD207D006A18106840306B90FD001812881A28217804502A906428027D012C678B666664F6AA7041083DEECBEF29385D71811A92E001F1811802600271812F82C207F97840607080093DFC142201B82A1009AA0A01E428027D012C678B00E78B666491646580897A007A00658064907C80383A6465816503E5FFE4E83BC00C646582AC678B28027D0109E5B589666664B8FD80400FE3603FA00FA40F82854120870542013541403C85004FA0258CF1601CF16CCC922C8CB0112F400F400CB00C9F9007074C8CB02CA07CBFFC9D05008C705F2E04A12A1035024C85004FA0258CF16CCCCC9ED5401FA403020D70B01C3008E1F8210D53276DB708010C8CB055003CF1622FA0212CB6ACB1FCB3FC98042FB00915BE200303515C705F2E049FA403059C85004FA0258CF16CCCCC9ED54002E5143C705F2E049D43001C85004FA0258CF16CCCCC9ED54007DADBCF6A2687D007D206A6A183618FC1400B82A1009AA0A01E428027D012C678B00E78B666491646580897A007A00658064FC80383A6465816503E5FFE4E840001FAF16F6A2687D007D206A6A183FAA904051007F09"),super(S,k)}createDataCell(){const S=new T;return S.bits.writeCoins(0),S.bits.writeAddress(this.options.adminAddress),S.refs[0]=C(this.options.jettonContentUri),S.refs[1]=T.oneFromBoc(this.options.jettonWalletCodeHex),S}createMintBody(S){const k=new T;k.bits.writeUint(21,32),k.bits.writeUint(S.queryId||0,64),k.bits.writeAddress(S.destination),k.bits.writeCoins(S.amount);const B=new T;return B.bits.writeUint(395134233,32),B.bits.writeUint(S.queryId||0,64),B.bits.writeCoins(S.jettonAmount),B.bits.writeAddress(null),B.bits.writeAddress(null),B.bits.writeCoins(new g(0)),B.bits.writeBit(!1),k.refs[0]=B,k}createChangeAdminBody(S){if(S.newAdminAddress===void 0)throw new Error("Specify newAdminAddress");const k=new T;return k.bits.writeUint(3,32),k.bits.writeUint(S.queryId||0,64),k.bits.writeAddress(S.newAdminAddress),k}createEditContentBody(S){const k=new T;return k.bits.writeUint(4,32),k.bits.writeUint(S.queryId||0,64),k.refs[0]=C(S.jettonContentUri),k}async getJettonData(){const S=await this.getAddress(),k=await this.provider.call2(S.toString(),"get_jetton_data"),B=k[0],O=k[1].toNumber()===-1,L=m(k[2]),D=k[3];let W=null;try{W=I(D)}catch{}const H=k[4];return{totalSupply:B,isMutable:O,adminAddress:L,jettonContentCell:D,jettonContentUri:W,jettonWalletCode:H}}async getJettonWalletAddress(S){const k=await this.getAddress(),B=new T;B.bits.writeAddress(S);const O=await this.provider.call2(k.toString(),"get_wallet_address",[["tvm.Slice",w(await B.toBoc(!1))]]);return m(O)}}fe.exports={JettonMinter:_}},2359:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{parseAddress:C}=x(79361),{BN:I}=x(12386),m="B5EE9C7241021201000328000114FF00F4A413F4BCF2C80B0102016202030202CC0405001BA0F605DA89A1F401F481F481A8610201D40607020148080900BB0831C02497C138007434C0C05C6C2544D7C0FC02F83E903E900C7E800C5C75C87E800C7E800C00B4C7E08403E29FA954882EA54C4D167C0238208405E3514654882EA58C511100FC02780D60841657C1EF2EA4D67C02B817C12103FCBC2000113E910C1C2EBCB853600201200A0B020120101101F500F4CFFE803E90087C007B51343E803E903E90350C144DA8548AB1C17CB8B04A30BFFCB8B0950D109C150804D50500F214013E809633C58073C5B33248B232C044BD003D0032C032483E401C1D3232C0B281F2FFF274013E903D010C7E801DE0063232C1540233C59C3E8085F2DAC4F3208405E351467232C7C6600C03F73B51343E803E903E90350C0234CFFE80145468017E903E9014D6F1C1551CDB5C150804D50500F214013E809633C58073C5B33248B232C044BD003D0032C0327E401C1D3232C0B281F2FFF274140371C1472C7CB8B0C2BE80146A2860822625A020822625A004AD822860822625A028062849F8C3C975C2C070C008E00D0E0F009ACB3F5007FA0222CF165006CF1625FA025003CF16C95005CC2391729171E25008A813A08208989680AA008208989680A0A014BCF2E2C504C98040FB001023C85004FA0258CF1601CF16CCC9ED5400705279A018A182107362D09CC8CB1F5230CB3F58FA025007CF165007CF16C9718018C8CB0524CF165006FA0215CB6A14CCC971FB0010241023000E10491038375F040076C200B08E218210D53276DB708010C8CB055008CF165004FA0216CB6A12CB1F12CB3FC972FB0093356C21E203C85004FA0258CF1601CF16CCC9ED5400DB3B51343E803E903E90350C01F4CFFE803E900C145468549271C17CB8B049F0BFFCB8B0A0822625A02A8005A805AF3CB8B0E0841EF765F7B232C7C572CFD400FE8088B3C58073C5B25C60063232C14933C59C3E80B2DAB33260103EC01004F214013E809633C58073C5B3327B55200083200835C87B51343E803E903E90350C0134C7E08405E3514654882EA0841EF765F784EE84AC7CB8B174CFCC7E800C04E81408F214013E809633C58073C5B3327B55205ECCF23D";class b extends v{constructor(w,_){_.wc=0,_.code=_.code||T.oneFromBoc(m),super(w,_)}async createTransferBody(w){const _=new T;return _.bits.writeUint(260734629,32),_.bits.writeUint(w.queryId||0,64),_.bits.writeCoins(w.jettonAmount),_.bits.writeAddress(w.toAddress),_.bits.writeAddress(w.responseAddress),_.bits.writeBit(!1),_.bits.writeCoins(w.forwardAmount||new I(0)),w.forwardPayload?w.forwardPayload.refs?(_.bits.writeBit(!0),_.refs.push(w.forwardPayload)):(_.bits.writeBit(!1),_.bits.writeBytes(w.forwardPayload)):_.bits.writeBit(!1),_}async createBurnBody(w){const _=new T;return _.bits.writeUint(1499400124,32),_.bits.writeUint(w.queryId||0,64),_.bits.writeCoins(w.jettonAmount),_.bits.writeAddress(w.responseAddress),_}async getData(){const w=await this.getAddress(),_=await this.provider.call2(w.toString(),"get_wallet_data"),A=_[0],S=C(_[1]),k=C(_[2]),B=_[3];return{balance:A,ownerAddress:S,jettonMinterAddress:k,jettonWalletCode:B}}}b.codeHex=m,fe.exports={JettonWallet:b}},70128:function(fe,p,x){const{JettonMinter:v}=x(21673),{JettonWallet:T}=x(2359);fe.exports.default={JettonMinter:v,JettonWallet:T}},19834:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{Address:C,bytesToBase64:I,BN:m}=x(12386),{parseAddress:b}=x(79361),{createOffchainUriCell:g,serializeUri:w,parseOffchainUriCell:_,getRoyaltyParams:A}=x(79361);class S extends v{constructor(B,O){if(O.wc=0,O.code=O.code||T.oneFromBoc("B5EE9C724102140100021F000114FF00F4A413F4BCF2C80B0102016202030202CD04050201200E0F04E7D10638048ADF000E8698180B8D848ADF07D201800E98FE99FF6A2687D20699FEA6A6A184108349E9CA829405D47141BAF8280E8410854658056B84008646582A802E78B127D010A65B509E58FE59F80E78B64C0207D80701B28B9E382F970C892E000F18112E001718112E001F181181981E0024060708090201200A0B00603502D33F5313BBF2E1925313BA01FA00D43028103459F0068E1201A44343C85005CF1613CB3FCCCCCCC9ED54925F05E200A6357003D4308E378040F4966FA5208E2906A4208100FABE93F2C18FDE81019321A05325BBF2F402FA00D43022544B30F00623BA9302A402DE04926C21E2B3E6303250444313C85005CF1613CB3FCCCCCCC9ED54002C323401FA40304144C85005CF1613CB3FCCCCCCC9ED54003C8E15D4D43010344130C85005CF1613CB3FCCCCCCC9ED54E05F04840FF2F00201200C0D003D45AF0047021F005778018C8CB0558CF165004FA0213CB6B12CCCCC971FB008002D007232CFFE0A33C5B25C083232C044FD003D0032C03260001B3E401D3232C084B281F2FFF2742002012010110025BC82DF6A2687D20699FEA6A6A182DE86A182C40043B8B5D31ED44D0FA40D33FD4D4D43010245F04D0D431D430D071C8CB0701CF16CCC980201201213002FB5DAFDA89A1F481A67FA9A9A860D883A1A61FA61FF480610002DB4F47DA89A1F481A67FA9A9A86028BE09E008E003E00B01A500C6E"),O.royalty>1)throw new Error("royalty > 1");O.royaltyBase=1e3,O.royaltyFactor=Math.floor(O.royalty*O.royaltyBase),super(B,O),this.methods.getCollectionData=this.getCollectionData.bind(this),this.methods.getNftItemAddressByIndex=this.getNftItemAddressByIndex.bind(this),this.methods.getNftItemContent=this.getNftItemContent.bind(this),this.methods.getRoyaltyParams=this.getRoyaltyParams.bind(this)}createContentCell(B){const O=g(B.collectionContentUri),L=new T;L.bits.writeBytes(w(B.nftItemContentBaseUri));const D=new T;return D.refs[0]=O,D.refs[1]=L,D}createRoyaltyCell(B){const O=new T;return O.bits.writeUint(B.royaltyFactor,16),O.bits.writeUint(B.royaltyBase,16),O.bits.writeAddress(B.royaltyAddress),O}createDataCell(){const B=new T;return B.bits.writeAddress(this.options.ownerAddress),B.bits.writeUint(0,64),B.refs[0]=this.createContentCell(this.options),B.refs[1]=T.oneFromBoc(this.options.nftItemCodeHex),B.refs[2]=this.createRoyaltyCell(this.options),B}createMintBody(B){const O=new T;O.bits.writeUint(1,32),O.bits.writeUint(B.queryId||0,64),O.bits.writeUint(B.itemIndex,64),O.bits.writeCoins(B.amount);const L=new T;L.bits.writeAddress(B.itemOwnerAddress);const D=new T;return D.bits.writeBytes(w(B.itemContentUri)),L.refs[0]=D,O.refs[0]=L,O}createGetRoyaltyParamsBody(B){const O=new T;return O.bits.writeUint(1765620048,32),O.bits.writeUint(B.queryId||0,64),O}createChangeOwnerBody(B){if(B.newOwnerAddress===void 0)throw new Error("Specify newOwnerAddress");const O=new T;return O.bits.writeUint(3,32),O.bits.writeUint(B.queryId||0,64),O.bits.writeAddress(B.newOwnerAddress),O}createEditContentBody(B){if(B.royalty>1)throw new Error("royalty > 1");B.royaltyBase=1e3,B.royaltyFactor=Math.floor(B.royalty*B.royaltyBase);const O=new T;return O.bits.writeUint(4,32),O.bits.writeUint(B.queryId||0,64),O.refs[0]=this.createContentCell(B),O.refs[1]=this.createRoyaltyCell(B),O}async getCollectionData(){const B=await this.getAddress(),O=await this.provider.call2(B.toString(),"get_collection_data"),L=O[0];let D=NaN;try{D=L.toNumber()}catch{}const W=O[1];let H=null;try{H=_(W)}catch{}const G=b(O[2]);return{nextItemIndex:D,itemsCount:L,ownerAddress:G,collectionContentCell:W,collectionContentUri:H}}async getNftItemContent(B){const O=await this.getAddress(),L=await B.getData();if(L.isInitialized){const D=await this.provider.call2(O.toString(),"get_nft_content",[["num",L.itemIndex.toString(10)],["tvm.Cell",I(await L.contentCell.toBoc(!1))]]);L.contentUri=null;try{L.contentUri=_(D)}catch{}}return L}async getNftItemAddressByIndex(B){B=new m(B);const O=await this.getAddress(),L=await this.provider.call2(O.toString(),"get_nft_address_by_index",[["num",B.toString(10)]]);return b(L)}async getRoyaltyParams(){const B=await this.getAddress();return A(this.provider,B.toString())}}fe.exports={NftCollection:S}},8225:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{Address:C,BN:I}=x(12386),{parseAddress:m,getRoyaltyParams:b}=x(79361),{parseOffchainUriCell:g}=x(79361),w="B5EE9C7241020D010001D0000114FF00F4A413F4BCF2C80B0102016202030202CE04050009A11F9FE00502012006070201200B0C02D70C8871C02497C0F83434C0C05C6C2497C0F83E903E900C7E800C5C75C87E800C7E800C3C00812CE3850C1B088D148CB1C17CB865407E90350C0408FC00F801B4C7F4CFE08417F30F45148C2EA3A1CC840DD78C9004F80C0D0D0D4D60840BF2C9A884AEB8C097C12103FCBC20080900113E910C1C2EBCB8536001F65135C705F2E191FA4021F001FA40D20031FA00820AFAF0801BA121945315A0A1DE22D70B01C300209206A19136E220C2FFF2E192218E3E821005138D91C85009CF16500BCF16712449145446A0708010C8CB055007CF165005FA0215CB6A12CB1FCB3F226EB39458CF17019132E201C901FB00104794102A375BE20A00727082108B77173505C8CBFF5004CF1610248040708010C8CB055007CF165005FA0215CB6A12CB1FCB3F226EB39458CF17019132E201C901FB000082028E3526F0018210D53276DB103744006D71708010C8CB055007CF165005FA0215CB6A12CB1FCB3F226EB39458CF17019132E201C901FB0093303234E25502F003003B3B513434CFFE900835D27080269FC07E90350C04090408F80C1C165B5B60001D00F232CFD633C58073C5B3327B5520BF75041B";class _ extends v{constructor(S,k){k.wc=0,k.code=k.code||T.oneFromBoc(w),super(S,k),this.methods.getData=this.getData.bind(this)}createDataCell(){const S=new T;return S.bits.writeUint(this.options.index,64),S.bits.writeAddress(this.options.collectionAddress),S}async getData(){const S=await this.getAddress(),k=await this.provider.call2(S.toString(),"get_nft_data"),B=k[0].toNumber()===-1,O=k[1];let L=NaN;try{L=O.toNumber()}catch{}const D=m(k[2]),W=B?m(k[3]):null,H=k[4];let G=null;try{G=B&&D===null?g(H):null}catch{}return{isInitialized:B,index:L,itemIndex:O,collectionAddress:D,ownerAddress:W,contentCell:H,contentUri:G}}async createTransferBody(S){const k=new T;return k.bits.writeUint(1607220500,32),k.bits.writeUint(S.queryId||0,64),k.bits.writeAddress(S.newOwnerAddress),k.bits.writeAddress(S.responseAddress),k.bits.writeBit(!1),k.bits.writeCoins(S.forwardAmount||new I(0)),S.forwardPayload?S.forwardPayload.refs?(k.bits.writeBit(!0),k.refs.push(S.forwardPayload)):(k.bits.writeBit(!1),k.bits.writeBytes(S.forwardPayload)):k.bits.writeBit(!1),k}createGetStaticDataBody(S){const k=new T;return k.bits.writeUint(801842850,32),k.bits.writeUint(S.queryId||0,64),k}async getRoyaltyParams(){const S=await this.getAddress();return b(this.provider,S.toString())}}_.codeHex=w,fe.exports={NftItem:_}},26583:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{Address:C}=x(12386),{parseAddress:I}=x(79361);class m extends v{constructor(g,w){w.wc=0,w.code=w.code||T.oneFromBoc("B5EE9C7241010401006D000114FF00F4A413F4BCF2C80B01020120020300AAD23221C700915BE0D0D3030171B0915BE0FA40ED44D0FA403012C705F2E19101D31F01C0018E2BFA003001D4D43021F90070C8CA07CBFFC9D077748018C8CB05CB0258CF165004FA0213CB6BCCCCC971FB00915BE20004F2308EF7CCE7"),super(g,w)}createDataCell(){const g=new T;return g.bits.writeAddress(this.options.ownerAddress),g}}fe.exports={NftMarketplace:m}},30353:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{parseAddress:C}=x(79361),{BN:I}=x(12386),m="B5EE9C7241020A010001B4000114FF00F4A413F4BCF2C80B01020120020302014804050004F2300202CD0607002FA03859DA89A1F481F481F481F401A861A1F401F481F4006101F7D00E8698180B8D8492F82707D201876A2687D207D207D207D006A18116BA4E10159C71D991B1B2990E382C92F837028916382F970FA01698FC1080289C6C8895D7970FAE99F98FD2018201A642802E78B2801E78B00E78B00FD016664F6AA701363804C9B081B2299823878027003698FE99F9810E000C92F857010C0801F5D41081DCD650029285029185F7970E101E87D007D207D0018384008646582A804E78B28B9D090D0A85AD08A500AFD010AE5B564B8FD80384008646582AC678B2803FD010B65B564B8FD80384008646582A802E78B00FD0109E5B564B8FD80381041082FE61E8A10C00C646582A802E78B117D010A65B509E58F8A40900C8C0029A3110471036454012F004E032363704C0038E4782103B9ACA0015BEF2E1C95312C70559C705B1F2E1CA702082105FCC3D14218010C8CB055006CF1622FA0215CB6A14CB1F14CB3F21CF1601CF16CA0021FA02CA00C98100A0FB00E05F06840FF2F0002ACB3F22CF1658CF16CA0021FA02CA00C98100A0FB00AECABAD1";class b extends v{constructor(w,_){_.wc=0,_.code=_.code||T.oneFromBoc(m),super(w,_),this.methods.getData=this.getData.bind(this)}createDataCell(){const w=new T;w.bits.writeAddress(this.options.marketplaceAddress),w.bits.writeAddress(this.options.nftAddress),w.bits.writeAddress(null),w.bits.writeCoins(this.options.fullPrice);const _=new T;return _.bits.writeCoins(this.options.marketplaceFee),_.bits.writeAddress(this.options.royaltyAddress),_.bits.writeCoins(this.options.royaltyAmount),w.refs[0]=_,w}async getData(){const w=await this.getAddress(),_=await this.provider.call2(w.toString(),"get_sale_data"),A=C(_[0]),S=C(_[1]),k=C(_[2]),B=_[3],O=_[4],L=C(_[5]),D=_[6];return{marketplaceAddress:A,nftAddress:S,nftOwnerAddress:k,fullPrice:B,marketplaceFee:O,royaltyAddress:L,royaltyAmount:D}}async createCancelBody(w){const _=new T;return _.bits.writeUint(3,32),_.bits.writeUint(w.queryId||0,64),_}}b.codeHex=m,fe.exports={NftSale:b}},79361:function(fe,p,x){const{Address:v}=x(12386),{Cell:T}=x(43483),C=0,I=1,m=0,b=1,g=O=>new TextEncoder().encode(encodeURI(O)),w=O=>new TextDecoder().decode(O),_=O=>{const L=new T;return L.bits.writeUint(b,8),L.bits.writeBytes(g(O)),L},A=O=>{if(O.bits.array[0]!==b)throw new Error("no OFFCHAIN_CONTENT_PREFIX");let L=0,D=O;for(;D;)L+=D.bits.array.length,D=D.refs[0];const W=new Uint8Array(L);for(L=0,D=O;D;)W.set(D.bits.array,L),L+=D.bits.array.length,D=D.refs[0];return w(W.slice(1))},S=(O,L,D)=>{let W=BigInt(0);for(let H=0;H<D;H++)W*=BigInt(2),W+=BigInt(O.get(L+H));return W},k=O=>{let L=S(O.bits,3,8);L>BigInt(127)&&(L=L-BigInt(256));const D=S(O.bits,11,256);if(L.toString(10)+":"+D.toString(16)=="0:0")return null;const W=L.toString(10)+":"+D.toString(16).padStart(64,"0");return new v(W)},B=async(O,L)=>{const D=await O.call2(L,"royalty_params"),W=D[0].toNumber(),H=D[1].toNumber(),G=W/H,Z=k(D[2]);return{royalty:G,royaltyBase:H,royaltyFactor:W,royaltyAddress:Z}};fe.exports={SNAKE_DATA_PREFIX:C,CHUNK_DATA_PREFIX:I,ONCHAIN_CONTENT_PREFIX:m,OFFCHAIN_CONTENT_PREFIX:b,parseAddress:k,serializeUri:g,parseUri:w,createOffchainUriCell:_,parseOffchainUriCell:A,getRoyaltyParams:B}},4986:function(fe,p,x){const{NftCollection:v}=x(19834),{NftItem:T}=x(8225),{NftMarketplace:C}=x(26583),{NftSale:I}=x(30353);fe.exports.default={NftCollection:v,NftItem:T,NftMarketplace:C,NftSale:I}},75310:function(fe,p,x){const{Contract:v}=x(54351),{Cell:T}=x(43483),{nacl:C,stringToBytes:I,Address:m,BN:b}=x(12386);class g extends v{constructor(_,A){if(!A.publicKey&&!A.address)throw new Error("WalletContract required publicKey or address in options");super(_,A),this.methods={transfer:S=>v.createMethod(_,this.createTransferMessage(S.secretKey,S.toAddress,S.amount,S.seqno,S.payload,S.sendMode,!S.secretKey,S.stateInit,S.expireAt)),transfers:S=>v.createMethod(_,this.createTransferMessages(S.secretKey,S.seqno,S.messages,!S.secretKey,S.expireAt)),seqno:()=>({call:async()=>{const S=await this.getAddress();let k=null;try{k=(await _.call2(S.toString(),"seqno")).toNumber()}catch{}return k}})},this.deploy=S=>v.createMethod(_,this.createInitExternalMessage(S))}getName(){throw new Error("override me")}createDataCell(){const _=new T;return _.bits.writeUint(0,32),_.bits.writeBytes(this.options.publicKey),_}createSigningMessage(_){_=_||0;const A=new T;return A.bits.writeUint(_,32),A}async createInitExternalMessage(_){if(!this.options.publicKey){const G=C.sign.keyPair.fromSecretKey(_);this.options.publicKey=G.publicKey}const{stateInit:A,address:S,code:k,data:B}=await this.createStateInit(),O=this.createSigningMessage(),L=C.sign.detached(await O.hash(),_),D=new T;D.bits.writeBytes(L),D.writeCell(O);const W=v.createExternalMessageHeader(S),H=v.createCommonMsgInfo(W,A,D);return{address:S,message:H,body:D,signingMessage:O,stateInit:A,code:k,data:B}}async createExternalMessage(_,A,S,k=!1){const B=k?new Uint8Array(64):C.sign.detached(await _.hash(),A),O=new T;O.bits.writeBytes(B),O.writeCell(_);let L=null,D=null,W=null;if(S===0){if(!this.options.publicKey){const ie=C.sign.keyPair.fromSecretKey(A);this.options.publicKey=ie.publicKey}const Q=await this.createStateInit();L=Q.stateInit,D=Q.code,W=Q.data}const H=await this.getAddress(),G=v.createExternalMessageHeader(H),Z=v.createCommonMsgInfo(G,L,O);return{address:H,message:Z,body:O,signature:B,signingMessage:_,stateInit:L,code:D,data:W}}async createTransferMessage(_,A,S,k,B="",O=3,L=!1,D=null,W=void 0){if(k==null||k<0)throw new Error("seqno must be number >= 0");const H=this.createSigningMessage(k,W);return O==null&&(O=3),H.bits.writeUint8(O),H.refs.push(v.createOutMsg(A,S,B,D)),this.createExternalMessage(H,_,k,L)}async createTransferMessages(_,A,S,k=!1,B=void 0){if(A==null||A<0)throw new Error("seqno must be number >= 0");const O=this.createSigningMessage(A,B);if(S.length<1||S.length>4)throw new Error("put 1-4 messages");for(const L of S){let D=L.sendMode;D==null&&(D=3),O.bits.writeUint8(D),O.refs.push(v.createOutMsg(L.toAddress,L.amount,L.payload,L.stateInit))}return this.createExternalMessage(O,_,A,k)}}fe.exports={WalletContract:g}},7612:function(fe,p,x){const{Cell:v}=x(43483),{WalletContract:T}=x(75310);class C extends T{constructor(g,w){w.code=v.oneFromBoc("B5EE9C72410101010044000084FF0020DDA4F260810200D71820D70B1FED44D0D31FD3FFD15112BAF2A122F901541044F910F2A2F80001D31F3120D74A96D307D402FB00DED1A4C8CB1FCBFFC9ED5441FDF089"),super(g,w)}getName(){return"simpleR1"}}class I extends T{constructor(g,w){w.code=v.oneFromBoc("B5EE9C724101010100530000A2FF0020DD2082014C97BA9730ED44D0D70B1FE0A4F260810200D71820D70B1FED44D0D31FD3FFD15112BAF2A122F901541044F910F2A2F80001D31F3120D74A96D307D402FB00DED1A4C8CB1FCBFFC9ED54D0E2786F"),super(g,w)}getName(){return"simpleR2"}}class m extends T{constructor(g,w){w.code=v.oneFromBoc("B5EE9C7241010101005F0000BAFF0020DD2082014C97BA218201339CBAB19C71B0ED44D0D31FD70BFFE304E0A4F260810200D71820D70B1FED44D0D31FD3FFD15112BAF2A122F901541044F910F2A2F80001D31F3120D74A96D307D402FB00DED1A4C8CB1FCBFFC9ED54B5B86E42"),super(g,w)}getName(){return"simpleR3"}}fe.exports={SimpleWalletContractR1:C,SimpleWalletContractR2:I,SimpleWalletContractR3:m}},72154:function(fe,p,x){const{Cell:v}=x(43483),{WalletContract:T}=x(75310);class C extends T{createSigningMessage(g,w){g=g||0,w=w||Math.floor(Date.now()/1e3)+60;const _=new v;if(_.bits.writeUint(g,32),g===0)for(let A=0;A<32;A++)_.bits.writeBit(1);else _.bits.writeUint(w,32);return _}}class I extends C{constructor(g,w){w.code=v.oneFromBoc("B5EE9C724101010100570000AAFF0020DD2082014C97BA9730ED44D0D70B1FE0A4F2608308D71820D31FD31F01F823BBF263ED44D0D31FD3FFD15131BAF2A103F901541042F910F2A2F800029320D74A96D307D402FB00E8D1A4C8CB1FCBFFC9ED54A1370BB6"),super(g,w)}getName(){return"v2R1"}}class m extends C{constructor(g,w){w.code=v.oneFromBoc("B5EE9C724101010100630000C2FF0020DD2082014C97BA218201339CBAB19C71B0ED44D0D31FD70BFFE304E0A4F2608308D71820D31FD31F01F823BBF263ED44D0D31FD3FFD15131BAF2A103F901541042F910F2A2F800029320D74A96D307D402FB00E8D1A4C8CB1FCBFFC9ED54044CD7A1"),super(g,w)}getName(){return"v2R2"}}fe.exports={WalletV2ContractR1:I,WalletV2ContractR2:m}},19369:function(fe,p,x){const{Cell:v}=x(43483),{WalletContract:T}=x(75310),{parseWalletV3TransferQuery:C,parseWalletV3TransferBody:I}=x(24473);class m extends T{createSigningMessage(_,A){_=_||0,A=A||Math.floor(Date.now()/1e3)+60;const S=new v;if(S.bits.writeUint(this.options.walletId,32),_===0)for(let k=0;k<32;k++)S.bits.writeBit(1);else S.bits.writeUint(A,32);return S.bits.writeUint(_,32),S}createDataCell(){const _=new v;return _.bits.writeUint(0,32),_.bits.writeUint(this.options.walletId,32),_.bits.writeBytes(this.options.publicKey),_}}class b extends m{constructor(_,A){A.code=v.oneFromBoc("B5EE9C724101010100620000C0FF0020DD2082014C97BA9730ED44D0D70B1FE0A4F2608308D71820D31FD31FD31FF82313BBF263ED44D0D31FD31FD3FFD15132BAF2A15144BAF2A204F901541055F910F2A3F8009320D74A96D307D402FB00E8D101A4C8CB1FCB1FCBFFC9ED543FBE6EE0"),super(_,A),this.options.walletId||(this.options.walletId=698983191+this.options.wc)}getName(){return"v3R1"}}b.parseTransferQuery=C,b.parseTransferBody=I;class g extends m{constructor(_,A){A.code=v.oneFromBoc("B5EE9C724101010100710000DEFF0020DD2082014C97BA218201339CBAB19F71B0ED44D0D31FD31F31D70BFFE304E0A4F2608308D71820D31FD31FD31FF82313BBF263ED44D0D31FD31FD3FFD15132BAF2A15144BAF2A204F901541055F910F2A3F8009320D74A96D307D402FB00E8D101A4C8CB1FCB1FCBFFC9ED5410BD6DAD"),super(_,A),this.options.walletId||(this.options.walletId=698983191+this.options.wc)}getName(){return"v3R2"}}g.parseTransferQuery=C,g.parseTransferBody=I,fe.exports={WalletV3ContractR1:b,WalletV3ContractR2:g}},70908:function(fe,p,x){const{Cell:v}=x(43483),{Contract:T}=x(54351),{Address:C,bytesToHex:I,BN:m}=x(12386),{WalletContract:b}=x(75310),{parseWalletV3TransferQuery:g,parseWalletV3TransferBody:w}=x(24473);class _ extends b{constructor(S,k){k.code=v.oneFromBoc("B5EE9C72410215010002F5000114FF00F4A413F4BCF2C80B010201200203020148040504F8F28308D71820D31FD31FD31F02F823BBF263ED44D0D31FD31FD3FFF404D15143BAF2A15151BAF2A205F901541064F910F2A3F80024A4C8CB1F5240CB1F5230CBFF5210F400C9ED54F80F01D30721C0009F6C519320D74A96D307D402FB00E830E021C001E30021C002E30001C0039130E30D03A4C8CB1F12CB1FCBFF1112131403EED001D0D3030171B0915BE021D749C120915BE001D31F218210706C7567BD228210626C6E63BDB022821064737472BDB0925F03E002FA403020FA4401C8CA07CBFFC9D0ED44D0810140D721F404305C810108F40A6FA131B3925F05E004D33FC8258210706C7567BA9131E30D248210626C6E63BAE30004060708020120090A005001FA00F404308210706C7567831EB17080185005CB0527CF165003FA02F40012CB69CB1F5210CB3F0052F8276F228210626C6E63831EB17080185005CB0527CF1624FA0214CB6A13CB1F5230CB3F01FA02F4000092821064737472BA8E3504810108F45930ED44D0810140D720C801CF16F400C9ED54821064737472831EB17080185004CB0558CF1622FA0212CB6ACB1FCB3F9410345F04E2C98040FB000201200B0C0059BD242B6F6A2684080A06B90FA0218470D4080847A4937D29910CE6903E9FF9837812801B7810148987159F31840201580D0E0011B8C97ED44D0D70B1F8003DB29DFB513420405035C87D010C00B23281F2FFF274006040423D029BE84C600201200F100019ADCE76A26840206B90EB85FFC00019AF1DF6A26840106B90EB858FC0006ED207FA00D4D422F90005C8CA0715CBFFC9D077748018C8CB05CB0222CF165005FA0214CB6B12CCCCC971FB00C84014810108F451F2A702006C810108D718C8542025810108F451F2A782106E6F746570748018C8CB05CB025004CF16821005F5E100FA0213CB6A12CB1FC971FB00020072810108D718305202810108F459F2A7F82582106473747270748018C8CB05CB025005CF16821005F5E100FA0214CB6A13CB1F12CB3FC973FB00000AF400C9ED5446A9F34F"),super(S,k),this.options.walletId||(this.options.walletId=698983191+this.options.wc),this.methods.getPublicKey=this.getPublicKey.bind(this)}getName(){return"v4R1"}createSigningMessage(S,k,B){S=S||0,k=k||Math.floor(Date.now()/1e3)+60;const O=new v;if(O.bits.writeUint(this.options.walletId,32),S===0)for(let L=0;L<32;L++)O.bits.writeBit(1);else O.bits.writeUint(k,32);return O.bits.writeUint(S,32),B||O.bits.writeUint(0,8),O}createDataCell(){const S=new v;return S.bits.writeUint(0,32),S.bits.writeUint(this.options.walletId,32),S.bits.writeBytes(this.options.publicKey),S.bits.writeUint(0,1),S}async getPublicKey(){const S=await this.getAddress();return this.provider.call2(S.toString(),"get_public_key")}}_.parseTransferQuery=g,_.parseTransferBody=w,fe.exports={WalletV4ContractR1:_}},82204:function(fe,p,x){const{Cell:v}=x(43483),{Contract:T}=x(54351),{Address:C,bytesToHex:I,BN:m,toNano:b}=x(12386),{WalletContract:g}=x(75310),{parseWalletV3TransferQuery:w,parseWalletV3TransferBody:_}=x(24473);class A extends g{constructor(k,B){B.code=v.oneFromBoc("B5EE9C72410214010002D4000114FF00F4A413F4BCF2C80B010201200203020148040504F8F28308D71820D31FD31FD31F02F823BBF264ED44D0D31FD31FD3FFF404D15143BAF2A15151BAF2A205F901541064F910F2A3F80024A4C8CB1F5240CB1F5230CBFF5210F400C9ED54F80F01D30721C0009F6C519320D74A96D307D402FB00E830E021C001E30021C002E30001C0039130E30D03A4C8CB1F12CB1FCBFF1011121302E6D001D0D3032171B0925F04E022D749C120925F04E002D31F218210706C7567BD22821064737472BDB0925F05E003FA403020FA4401C8CA07CBFFC9D0ED44D0810140D721F404305C810108F40A6FA131B3925F07E005D33FC8258210706C7567BA923830E30D03821064737472BA925F06E30D06070201200809007801FA00F40430F8276F2230500AA121BEF2E0508210706C7567831EB17080185004CB0526CF1658FA0219F400CB6917CB1F5260CB3F20C98040FB0006008A5004810108F45930ED44D0810140D720C801CF16F400C9ED540172B08E23821064737472831EB17080185005CB055003CF1623FA0213CB6ACB1FCB3FC98040FB00925F03E20201200A0B0059BD242B6F6A2684080A06B90FA0218470D4080847A4937D29910CE6903E9FF9837812801B7810148987159F31840201580C0D0011B8C97ED44D0D70B1F8003DB29DFB513420405035C87D010C00B23281F2FFF274006040423D029BE84C600201200E0F0019ADCE76A26840206B90EB85FFC00019AF1DF6A26840106B90EB858FC0006ED207FA00D4D422F90005C8CA0715CBFFC9D077748018C8CB05CB0222CF165005FA0214CB6B12CCCCC973FB00C84014810108F451F2A7020070810108D718FA00D33FC8542047810108F451F2A782106E6F746570748018C8CB05CB025006CF165004FA0214CB6A12CB1FCB3FC973FB0002006C810108D718FA00D33F305224810108F459F2A782106473747270748018C8CB05CB025005CF165003FA0213CB6ACB1F12CB3FC973FB00000AF400C9ED54696225E5"),super(k,B),this.options.walletId||(this.options.walletId=698983191+this.options.wc),this.methods.deployAndInstallPlugin=O=>T.createMethod(k,this.deployAndInstallPlugin(O)),this.methods.installPlugin=O=>T.createMethod(k,this.installPlugin(O)),this.methods.removePlugin=O=>T.createMethod(k,this.removePlugin(O)),this.methods.getPublicKey=this.getPublicKey.bind(this),this.methods.getWalletId=this.getWalletId.bind(this),this.methods.isPluginInstalled=this.isPluginInstalled.bind(this),this.methods.getPluginsList=this.getPluginsList.bind(this)}getName(){return"v4R2"}createSigningMessage(k,B,O){k=k||0,B=B||Math.floor(Date.now()/1e3)+60;const L=new v;if(L.bits.writeUint(this.options.walletId,32),k===0)for(let D=0;D<32;D++)L.bits.writeBit(1);else L.bits.writeUint(B,32);return L.bits.writeUint(k,32),O||L.bits.writeUint(0,8),L}createDataCell(){const k=new v;return k.bits.writeUint(0,32),k.bits.writeUint(this.options.walletId,32),k.bits.writeBytes(this.options.publicKey),k.bits.writeUint(0,1),k}async deployAndInstallPlugin(k){const{secretKey:B,seqno:O,pluginWc:L,amount:D,stateInit:W,body:H,expireAt:G}=k,Z=this.createSigningMessage(O,G,!0);return Z.bits.writeUint(1,8),Z.bits.writeInt(L,8),Z.bits.writeGrams(D),Z.refs.push(W),Z.refs.push(H),this.createExternalMessage(Z,B,O,!1)}async _setPlugin(k,B){const{secretKey:O,seqno:L,amount:D,queryId:W,expireAt:H}=k,G=new C(k.pluginAddress),Z=this.createSigningMessage(L,H,!0);return Z.bits.writeUint(B?2:3,8),Z.bits.writeInt(G.wc,8),Z.bits.writeBytes(G.hashPart),Z.bits.writeGrams(D||b("0.1")),Z.bits.writeUint(W||0,64),this.createExternalMessage(Z,O,L,!1)}async installPlugin(k){return this._setPlugin(k,!0)}async removePlugin(k){return this._setPlugin(k,!1)}async getWalletId(){const k=await this.getAddress();return(await this.provider.call2(k.toString(),"get_subwallet_id")).toNumber()}async getPublicKey(){const k=await this.getAddress();return this.provider.call2(k.toString(),"get_public_key")}async isPluginInstalled(k){k=new C(k);const B="0x"+I(k.hashPart),O=await this.getAddress();return!(await this.provider.call2(O.toString(),"is_plugin_installed",[["num",k.wc],["num",B]])).isZero()}async getPluginsList(){const k=L=>L[0].toNumber()+":"+L[1].toString(16),B=await this.getAddress();return(await this.provider.call2(B.toString(),"get_plugin_list")).map(k)}}A.parseTransferQuery=w,A.parseTransferBody=_,fe.exports={WalletV4ContractR2:A}},24473:function(fe,p,x){const{BN:v}=x(12386);function T(I){const m=I.loadBits(512);if(I.loadUint(32).toNumber()!==698983191)throw new Error("invalid walletId");const g=I.loadUint(32).toNumber(),w=I.loadUint(32).toNumber();if(I.loadUint(8).toNumber()!==3)throw new Error("invalid sendMode");let A=I.loadRef();if(A.loadBit())throw Error("invalid internal header");if(!A.loadBit())throw Error("invalid ihrDisabled");const S=A.loadBit();if(A.loadBit())throw Error("invalid bounced");if(A.loadAddress()!==null)throw Error("invalid externalSourceAddress");const B=A.loadAddress(),O=A.loadCoins();if(A.loadBit())throw Error("invalid currencyCollection");if(!A.loadCoins().eq(new v(0)))throw new Error("invalid ihrFees");if(!A.loadCoins().eq(new v(0)))throw new Error("invalid fwdFees");if(!A.loadUint(64).eq(new v(0)))throw new Error("invalid createdLt");if(!A.loadUint(32).eq(new v(0)))throw new Error("invalid createdAt");A.loadBit()&&A.loadRef();let G=null;if(A.getFreeBits()>0&&(A.loadBit()&&(A=A.loadRef()),A.getFreeBits()>32)){const Z=A.loadUint(32),Q=A.loadBits(A.getFreeBits());G=Z.eq(new v(0))?new TextDecoder().decode(Q):""}return{toAddress:B,value:O,bounce:S,seqno:w,expireAt:g,payload:G}}function C(I){const m=I.beginParse();if(m.loadUint(2).toNumber()!==2)throw Error("invalid header");if(m.loadAddress()!==null)throw Error("invalid externalSourceAddress");const g=m.loadAddress();if(!m.loadCoins().eq(new v(0)))throw new Error("invalid externalImportFee");m.loadBit()&&m.loadBit()&&m.loadRef();const _=m.loadBit()?m.loadRef():m;return{fromAddress:g,...T(_)}}fe.exports={parseWalletV3TransferQuery:C,parseWalletV3TransferBody:T}},89089:function(fe,p,x){const{Cell:v}=x(43483),{Address:T,BN:C,toNano:I,bytesToHex:m,hexToBytes:b,nacl:g,stringToBytes:w,bytesToBase64:_}=x(12386),{Contract:A}=x(54351),{SimpleWalletContractR1:S,SimpleWalletContractR2:k,SimpleWalletContractR3:B}=x(7612),{WalletV2ContractR1:O,WalletV2ContractR2:L}=x(72154),{WalletV3ContractR1:D,WalletV3ContractR2:W}=x(19369),{WalletV4ContractR1:H}=x(70908),{WalletV4ContractR2:G}=x(82204),Z={simpleR1:S,simpleR2:k,simpleR3:B,v2R1:O,v2R2:L,v3R1:D,v3R2:W,v4R1:H,v4R2:G},Q=[S,k,B,O,L,D,W,H,G];class ie{constructor(be){this.provider=be,this.all=Z,this.list=Q,this.defaultVersion="v3R1",this.default=this.all[this.defaultVersion]}create(be){return new this.default(this.provider,be)}}ie.all=Z,ie.list=Q,fe.exports.default=ie},2928:function(fe,p,x){const v=x(12386),T=v.Address,C=x(43483),I=x(85662),m=x(79973).default,{Contract:b}=x(54351),g=x(89089).default,w=x(44730).default,_=x(64433).default,A=x(4986).default,S=x(70128).default,{BlockSubscription:k,InMemoryBlockStorage:B}=x(59722),{SubscriptionContract:O}=x(84445),{Payments:L,PaymentChannel:D}=x(32647),W=x(86265).A,H=x(83318).A,G=x(94966).A,{Dns:Z,DnsCollection:Q,DnsItem:ie}=x(95503).default,le="0.0.66";class be{constructor(Ae){this.version=le,this.utils=v,this.Address=T,this.boc=C,this.Contract=b,this.BlockSubscription=k,this.InMemoryBlockStorage=B,this.provider=Ae||new m,this.dns=new Z(this.provider),this.wallet=new g(this.provider),this.payments=new L(this.provider),this.lockupWallet=w}async getTransactions(Ae,re=20,N=void 0,z=void 0,V=void 0){return this.provider.getTransactions(Ae.toString(),re,N,z,V)}async getBalance(Ae){return this.provider.getBalance(Ae.toString())}async sendBoc(Ae){return this.provider.sendBoc(v.bytesToBase64(Ae))}async call(Ae,re,N=[]){return this.provider.call(Ae.toString(),re,N)}}be.version=le,be.utils=v,be.Address=T,be.boc=C,be.HttpProvider=m,be.Contract=b,be.Wallets=g,be.LockupWallets=w,be.SubscriptionContract=O,be.BlockSubscription=k,be.InMemoryBlockStorage=B,be.ledger={TransportWebUSB:W,TransportWebHID:H,BluetoothTransport:G,AppTon:I},be.token={nft:A,ft:S,jetton:S},be.HighloadWallets=_,be.dns=Z,be.dns.DnsCollection=Q,be.dns.DnsItem=ie,be.payments=L,be.payments.PaymentChannel=D,fe.exports=be},85662:function(fe,p,x){var v=x(36533).Buffer;const{Cell:T}=x(43483),{Address:C,BN:I,bytesToHex:m}=x(12386),{Contract:b}=x(54351);class g{constructor(_,A){this.transport=_,this.ton=A,this.ADDRESS_FORMAT_HEX=0,this.ADDRESS_FORMAT_USER_FRIENDLY=1,this.ADDRESS_FORMAT_URL_SAFE=2,this.ADDRESS_FORMAT_BOUNCEABLE=4,this.ADDRESS_FORMAT_TEST_ONLY=8}async getAppConfiguration(){const _=await this.transport.send(224,1,0,0);return{version:""+_[0]+"."+_[1]+"."+_[2]}}async getPublicKey(_,A){const S=v.alloc(4);S.writeInt32BE(_);const k=await this.transport.send(224,2,A?1:0,0,S),B=k[0];return{publicKey:new Uint8Array(k.slice(1,1+B))}}async getAddress(_,A,S){const k=v.alloc(4);k.writeInt32BE(_);const B=await this.transport.send(224,5,A?1:0,S,k),O=B[0],L=new Uint8Array(B.slice(1,1+O));return{address:new C("0:"+m(L))}}async sign(_,A){const S=v.alloc(4);S.writeInt32BE(_);const k=v.concat([S,v.from(A)]),B=await this.transport.send(224,3,0,0,k),O=B[0];return{signature:B.slice(1,1+O)}}async transfer(_,A,S,k,B,O){const D=await A.createTransferMessage(null,S,k,B,null,3,!0),W=v.alloc(4);W.writeInt32BE(_);const H=v.concat([W,v.from(await D.signingMessage.toBoc())]),G=await this.transport.send(224,4,O,0,H),Z=G[0],Q=G.slice(1,1+Z),ie=new Uint8Array(Q),le=new T;le.bits.writeBytes(ie),le.writeCell(D.signingMessage);let be=null,we=null,Ae=null;if(B===0){const U=await A.createStateInit();be=U.stateInit,we=U.code,Ae=U.data}const re=await A.getAddress(),N=b.createExternalMessageHeader(re),z=b.createCommonMsgInfo(N,be,le),V=new Promise(U=>{U({address:re,message:z,body:le,signature:ie,signingMessage:D.signingMessage,stateInit:be,code:we,data:Ae})});return b.createMethod(this.ton.provider,V)}}fe.exports=g},15363:function(fe,p,x){const{BN:v,base64ToBytes:T}=x(12386),{Cell:C}=x(43483);class I{static parseObject(b){const g=b["@type"];switch(g){case"tvm.list":case"tvm.tuple":return b.elements.map(I.parseObject);case"tvm.cell":return C.oneFromBoc(T(b.bytes));case"tvm.stackEntryCell":return I.parseObject(b.cell);case"tvm.stackEntryTuple":return I.parseObject(b.tuple);case"tvm.stackEntryNumber":return I.parseObject(b.number);case"tvm.numberDecimal":return new v(b.number,10);default:throw new Error("unknown type "+g)}}static parseResponseStack(b){const g=b[0],w=b[1];switch(g){case"num":return new v(w.replace(/0x/,""),16);case"list":case"tuple":return I.parseObject(w);case"cell":const _=T(w.bytes);return C.oneFromBoc(_);default:throw new Error("unknown type "+g)}}static parseResponse(b){if(b.exit_code!==0){const w=new Error("http provider parse response error");throw w.result=b,w}const g=b.stack.map(I.parseResponseStack);return g.length===1?g[0]:g}static makeArg(b){if(b instanceof v||b instanceof Number)return["num",b];throw new Error("unknown arg type "+b)}static makeArgs(b){return b.map(this.makeArg)}}fe.exports.default=I},82710:function(fe){const v=C=>({workchain:C.workchain,shardId:C.shard,shardBlockNumber:C.seqno});class T{constructor(I,m,b,g){this.provider=I,this.storage=m,this.onBlock=b,this.startMcBlockNumber=g?g.startMcBlockNumber:void 0,this.mcInterval=(g?g.mcInterval:void 0)||1e4,this.shardsInterval=(g?g.shardsInterval:void 0)||1e3}async start(){if(this.stop(),!this.startMcBlockNumber&&(this.startMcBlockNumber=(await this.provider.getMasterchainInfo()).last.seqno,!this.startMcBlockNumber))throw new Error("Cannot get start mc block number from provider");const I=await this.provider.getMasterchainBlockHeader(this.startMcBlockNumber);if(this.startLT=I.end_lt,!this.startLT)throw new Error("Cannot get startLT from provider");let m=!1;const b=async()=>{if(!m){m=!0;try{const _=await this.storage.getLastMasterchainBlockNumber()||this.startMcBlockNumber;if(!_)throw new Error("no init masterchain block in storage");const A=(await this.provider.getMasterchainInfo()).last.seqno;if(!A)throw new Error("invalid last masterchain block from provider");for(let S=_+1;S<A;S++){const k=await this.provider.getBlockShards(S),B=await this.provider.getMasterchainBlockHeader(S);await this.onBlock(B,k),await this.storage.insertBlocks(S,k.shards.map(v))}}catch(_){console.error(_)}m=!1}};this.mcIntervalId=setInterval(()=>b(),this.mcInterval),b();let g=!1;const w=async()=>{if(!g){g=!0;try{const _=await this.storage.getUnprocessedShardBlock();if(_){const{workchain:A,shardId:S,shardBlockNumber:k}=_,B=await this.provider.getBlockHeader(A,S,k);if(B.end_lt<this.startLT)await this.storage.setBlockProcessed(A,S,k,[]);else{await this.onBlock(B);const O=B.prev_blocks.map(v);await this.storage.setBlockProcessed(A,S,k,O)}}}catch(_){console.log(_)}g=!1}};this.shardsIntervalId=setInterval(()=>w(),this.shardsInterval)}stop(){clearInterval(this.mcIntervalId),clearInterval(this.shardsIntervalId)}}fe.exports={BlockSubscription:T}},54070:function(fe){class p{constructor(v){this.masterchainBlocks={},this.shardchainBlocks={},this.logFunction=v}async insertShardBlocks(v){for(const{workchain:T,shardId:C,shardBlockNumber:I}of v)this.shardchainBlocks[T+"_"+C+"_"+I]===void 0&&(this.logFunction&&this.logFunction("insert shard "+T+" "+C+" "+I),this.shardchainBlocks[T+"_"+C+"_"+I]=!1)}async insertBlocks(v,T){if(this.logFunction&&this.logFunction("mc processed "+v),this.masterchainBlocks[v]!==void 0)throw new Error("mc already exists "+v);this.masterchainBlocks[v]=!0,await this.insertShardBlocks(T)}async getLastMasterchainBlockNumber(){return Object.keys(this.masterchainBlocks).map(T=>Number(T)).sort((T,C)=>C-T)[0]}async setBlockProcessed(v,T,C,I){if(this.logFunction&&this.logFunction("shard processed "+v+" "+T+" "+C),this.shardchainBlocks[v+"_"+T+"_"+C]===void 0)throw new Error("shard not exists "+v+"_"+T+"_"+C);this.shardchainBlocks[v+"_"+T+"_"+C]=!0,await this.insertShardBlocks(I)}async getUnprocessedShardBlock(){for(let v in this.shardchainBlocks)if(this.shardchainBlocks[v]===!1){const T=v.split("_");return{workchain:Number(T[0]),shardId:T[1],shardBlockNumber:Number(T[2])}}}}fe.exports={InMemoryBlockStorage:p}},59722:function(fe,p,x){const{BlockSubscription:v}=x(82710),{InMemoryBlockStorage:T}=x(54070);fe.exports={BlockSubscription:v,InMemoryBlockStorage:T}},79973:function(fe,p,x){const{Cell:v}=x(43483),{base64ToBytes:T}=x(12386),C=x(15363).default;typeof fetch>"u"&&(fetch=x(42557));const I="-9223372036854775808";class m{constructor(g,w){this.host=g||"https://toncenter.com/api/v2/jsonRPC",this.options=w||{}}sendImpl(g,w){const _={"Content-Type":"application/json"};return this.options.apiKey&&(_["X-API-Key"]=this.options.apiKey),fetch(g,{method:"POST",headers:_,body:JSON.stringify(w)}).then(A=>A.json()).then(({result:A,error:S})=>A||Promise.reject(S))}send(g,w){return this.sendImpl(this.host,{id:1,jsonrpc:"2.0",method:g,params:w})}async getAddressInfo(g){return this.send("getAddressInformation",{address:g})}async getExtendedAddressInfo(g){return this.send("getExtendedAddressInformation",{address:g})}async getWalletInfo(g){return this.send("getWalletInformation",{address:g})}async getTransactions(g,w=20,_=void 0,A=void 0,S=void 0,k=void 0){return this.send("getTransactions",{address:g,limit:w,lt:_,hash:A,to_lt:S,archival:k})}async getBalance(g){return this.send("getAddressBalance",{address:g})}async sendBoc(g){return this.send("sendBoc",{boc:g})}async sendQuery(g){return this.send("sendQuerySimple",g)}async getEstimateFee(g){return this.send("estimateFee",g)}async call(g,w,_=[]){return this.send("runGetMethod",{address:g,method:w,stack:_})}async call2(g,w,_=[]){const A=await this.send("runGetMethod",{address:g,method:w,stack:_});return C.parseResponse(A)}async getConfigParam(g){const w=await this.send("getConfigParam",{config_id:g});if(w["@type"]!=="configInfo")throw new Error("getConfigParam expected type configInfo");if(!w.config)throw new Error("getConfigParam expected config");if(w.config["@type"]!=="tvm.cell")throw new Error("getConfigParam expected type tvm.cell");if(!w.config.bytes)throw new Error("getConfigParam expected bytes");return v.oneFromBoc(T(w.config.bytes))}async getMasterchainInfo(){return this.send("getMasterchainInfo",{})}async getBlockShards(g){return this.send("shards",{seqno:g})}async getBlockTransactions(g,w,_,A,S,k){return this.send("getBlockTransactions",{workchain:g,shard:w,seqno:_,count:A,after_lt:S,after_hash:k})}async getMasterchainBlockTransactions(g,w,_,A){return this.getBlockTransactions(-1,I,g,w,_,A)}async getBlockHeader(g,w,_){return this.send("getBlockHeader",{workchain:g,shard:w,seqno:_})}async getMasterchainBlockHeader(g){return this.getBlockHeader(-1,I,g)}}m.SHARD_ID_ALL=I,fe.exports.default=m},57114:function(fe,p,x){const{crc16:v,hexToBytes:T,bytesToHex:C,stringToBytes:I,base64toString:m,stringToBase64:b}=x(85699),g=17,w=81,_=128;function A(k){if(k.length!==48)throw new Error("User-friendly address should contain strictly 48 characters");const B=I(m(k));if(B.length!==36)throw"Unknown address type: byte length is not equal to 36";const O=B.slice(0,34),L=B.slice(34,36),D=v(O);if(!(D[0]===L[0]&&D[1]===L[1]))throw"Wrong crc16 hashsum";let W=O[0],H=!1,G=!1;if(W&_&&(H=!0,W=W^_),W!==g&&W!==w)throw"Unknown address tag";G=W===g;let Z=null;if(O[1]===255?Z=-1:Z=O[1],Z!==0&&Z!==-1)throw new Error("Invalid address wc "+Z);const Q=O.slice(2,34);return{isTestOnly:H,isBounceable:G,workchain:Z,hashPart:Q}}class S{static isValid(B){try{return new S(B),!0}catch{return!1}}constructor(B){if(B==null)throw"Invalid address";if(B instanceof S){this.wc=B.wc,this.hashPart=B.hashPart,this.isTestOnly=B.isTestOnly,this.isUserFriendly=B.isUserFriendly,this.isBounceable=B.isBounceable,this.isUrlSafe=B.isUrlSafe;return}if(this.isUrlSafe=!0,B.search(/\-/)>0||B.search(/_/)>0?B=B.replace(/\-/g,"+").replace(/_/g,"/"):this.isUrlSafe=!1,B.indexOf(":")>-1){const O=B.split(":");if(O.length!==2)throw new Error("Invalid address "+B);const L=parseInt(O[0]);if(L!==0&&L!==-1)throw new Error("Invalid address wc "+B);const D=O[1];if(D.length!==64)throw new Error("Invalid address hex "+B);this.isUserFriendly=!1,this.wc=L,this.hashPart=T(D),this.isTestOnly=!1,this.isBounceable=!1}else{this.isUserFriendly=!0;const O=A(B);this.wc=O.workchain,this.hashPart=O.hashPart,this.isTestOnly=O.isTestOnly,this.isBounceable=O.isBounceable}}toString(B,O,L,D){if(B===void 0&&(B=this.isUserFriendly),O===void 0&&(O=this.isUrlSafe),L===void 0&&(L=this.isBounceable),D===void 0&&(D=this.isTestOnly),B){let W=L?g:w;D&&(W|=_);const H=new Int8Array(34);H[0]=W,H[1]=this.wc,H.set(this.hashPart,2);const G=new Uint8Array(36);G.set(H),G.set(v(H),34);let Z=b(String.fromCharCode.apply(null,new Uint8Array(G)));return O&&(Z=Z.replace(/\+/g,"-").replace(/\//g,"_")),Z}else return this.wc+":"+C(this.hashPart)}}fe.exports.default=S},48603:function(fe,p,x){const{hexToBytes:v,bytesToHex:T}=x(85699);class C{static isValid(m){try{return new C(m),!0}catch{return!1}}constructor(m){if(m==null)throw"Invalid address";if(m instanceof C)this.bytes=m.bytes;else if(m instanceof Uint8Array){if(m.length!==32)throw new Error("invalid adnl bytes length");this.bytes=m}else if(typeof m=="string"){if(m.length!==64)throw new Error("invalid adnl hex length");this.bytes=v(m)}else throw new Error("unsupported type")}toHex(){let m=T(this.bytes);for(;m.length<64;)m="0"+m;return m}}fe.exports.default=C},85648:function(fe,p,x){const{hexToBytes:v,bytesToHex:T}=x(85699);class C{static isValid(m){try{return new C(m),!0}catch{return!1}}constructor(m){if(m==null)throw"Invalid address";if(m instanceof C)this.bytes=m.bytes;else if(m instanceof Uint8Array){if(m.length!==32)throw new Error("invalid bag id bytes length");this.bytes=m}else if(typeof m=="string"){if(m.length!==64)throw new Error("invalid bag id hex length");this.bytes=v(m)}else throw new Error("unsupported type")}toHex(){let m=T(this.bytes);for(;m.length<64;)m="0"+m;return m}}fe.exports.default=C},85699:function(fe,p,x){var v=x(36533).Buffer;const T=x(83900),C=x(18861),I=x(98163),m=!0;let b=null;function g(z){return m?crypto.subtle.digest("SHA-256",z):b.subtle.digest({name:"SHA-256"},z)}function w(z){if(!T.isBN(z)&&typeof z!="string")throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return I.toWei(z,"gwei")}function _(z){if(!T.isBN(z)&&typeof z!="string")throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return I.fromWei(z,"gwei")}const A=[],S={};for(let z=0;z<=255;z++){let V=z.toString(16);V.length<2&&(V="0"+V),A.push(V),S[V]=z}function k(z){const V=[];for(let U=0;U<z.byteLength;U++)V.push(A[z[U]]);return V.join("")}function B(z){z=z.toLowerCase();const V=z.length;if(V%2!==0)throw"hex string must have length a multiple of 2";const U=V/2,j=new Uint8Array(U);for(let $=0;$<U;$++){const ee=$*2,J=z.substring(ee,ee+2);if(!S.hasOwnProperty(J))throw new Error("invalid hex character "+J);j[$]=S[J]}return j}function O(z,V=1){let U,j;V===1&&(U=new ArrayBuffer(z.length),j=new Uint8Array(U)),V===2&&(U=new ArrayBuffer(z.length*2),j=new Uint16Array(U)),V===4&&(U=new ArrayBuffer(z.length*4),j=new Uint32Array(U));for(let $=0,ee=z.length;$<ee;$++)j[$]=z.charCodeAt($);return new Uint8Array(j.buffer)}function L(z,V){z^=4294967295;for(let j=0;j<V.length;j++)z^=V[j],z=z&1?z>>>1^2197175160:z>>>1,z=z&1?z>>>1^2197175160:z>>>1,z=z&1?z>>>1^2197175160:z>>>1,z=z&1?z>>>1^2197175160:z>>>1,z=z&1?z>>>1^2197175160:z>>>1,z=z&1?z>>>1^2197175160:z>>>1,z=z&1?z>>>1^2197175160:z>>>1,z=z&1?z>>>1^2197175160:z>>>1;return z^4294967295}function D(z){const V=L(0,z),U=new ArrayBuffer(4);return new DataView(U).setUint32(0,V,!1),new Uint8Array(U).reverse()}function W(z){let U=0;const j=new Uint8Array(z.length+2);j.set(z);for(let $ of j){let ee=128;for(;ee>0;)U<<=1,$&ee&&(U+=1),ee>>=1,U>65535&&(U&=65535,U^=4129)}return new Uint8Array([Math.floor(U/256),U%256])}function H(z,V){const U=new Uint8Array(z.length+V.length);return U.set(z),U.set(V,z.length),U}function G(z,V){return z.toString()===V.toString()}const Z=(()=>{const z=[];for(let $=0;$<26;++$)z.push(String.fromCharCode(65+$));for(let $=0;$<26;++$)z.push(String.fromCharCode(97+$));for(let $=0;$<10;++$)z.push(String.fromCharCode(48+$));return z.push("+"),z.push("/"),z})();function Q(z){let V="",U;const j=z.length;for(U=2;U<j;U+=3)V+=Z[z[U-2]>>2],V+=Z[(z[U-2]&3)<<4|z[U-1]>>4],V+=Z[(z[U-1]&15)<<2|z[U]>>6],V+=Z[z[U]&63];return U===j+1&&(V+=Z[z[U-2]>>2],V+=Z[(z[U-2]&3)<<4],V+="=="),U===j&&(V+=Z[z[U-2]>>2],V+=Z[(z[U-2]&3)<<4|z[U-1]>>4],V+=Z[(z[U-1]&15)<<2],V+="="),V}function ie(z){return typeof self>"u"?v.from(z,"base64").toString("binary"):atob(z)}function le(z){return typeof self>"u"?v.from(z,"binary").toString("base64"):btoa(z)}function be(z){const V=ie(z),U=V.length,j=new Uint8Array(U);for(let $=0;$<U;$++)j[$]=V.charCodeAt($);return j}function we(z,V){let U=0;for(let j=0;j<z;j++)U*=256,U+=V[j];return U}function Ae(z){return C.sign.keyPair.fromSeed(z)}function re(){return C.sign.keyPair()}function N(){return C.sign.keyPair().secretKey.slice(0,32)}fe.exports={BN:T,nacl:C,sha256:g,fromNano:_,toNano:w,bytesToHex:k,hexToBytes:B,stringToBytes:O,crc32c:D,crc16:W,concatBytes:H,bytesToBase64:Q,base64ToBytes:be,base64toString:ie,stringToBase64:le,compareBytes:G,readNBytesUIntFromArray:we,keyPairFromSeed:Ae,newKeyPair:re,newSeed:N}},12386:function(fe,p,x){const{BN:v,nacl:T,sha256:C,fromNano:I,toNano:m,bytesToHex:b,hexToBytes:g,stringToBytes:w,crc32c:_,crc16:A,concatBytes:S,bytesToBase64:k,base64ToBytes:B,base64toString:O,stringToBase64:L,compareBytes:D,readNBytesUIntFromArray:W,keyPairFromSeed:H,newKeyPair:G,newSeed:Z}=x(85699),Q=x(57114).default,ie=x(48603).default,le=x(85648).default;function be(Ae){const re="ton://transfer/";if(!Ae.startsWith(re))throw new Error("must starts with "+re);const N=Ae.substring(re.length).split("?");if(N.length>2)throw new Error('multiple "?"');const z=N[0];if(!Q.isValid(z))throw new Error("invalid address format "+z);const V={address:z},U=N[1];if(U&&U.length){const j=U.split("&").map($=>$.split("="));for(const $ of j){if($.length!==2)throw new Error("invalid url pair");const ee=$[0],J=$[1];if(ee==="amount"){if(V.amount)throw new Error("amount already set");if(new v(J).isNeg())throw new Error("negative amount");V.amount=J}else if(ee==="text"){if(V.text)throw new Error("text already set");V.text=decodeURIComponent(J)}else throw new Error("unknown url var "+ee)}}return V}function we(Ae,re,N){let z="ton://transfer/"+Ae;const V=[];return re&&V.push("amount="+re),N&&V.push("text="+encodeURIComponent(N)),V.length===0?z:z+"?"+V.join("&")}fe.exports={Address:Q,AdnlAddress:ie,StorageBagId:le,BN:v,nacl:T,sha256:C,fromNano:I,toNano:m,bytesToHex:b,hexToBytes:g,stringToBytes:w,crc32c:_,crc16:A,concatBytes:S,bytesToBase64:k,base64ToBytes:B,base64toString:O,stringToBase64:L,compareBytes:D,readNBytesUIntFromArray:W,parseTransferUrl:be,formatTransferUrl:we,keyPairFromSeed:H,newKeyPair:G,newSeed:Z}},65927:function(fe,p,x){"use strict";x.d(p,{C6:()=>T});/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation.
|
||
|
||
Permission to use, copy, modify, and/or distribute this software for any
|
||
purpose with or without fee is hereby granted.
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
PERFORMANCE OF THIS SOFTWARE.
|
||
***************************************************************************** */var v=function(we,Ae){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(re,N){re.__proto__=N}||function(re,N){for(var z in N)N.hasOwnProperty(z)&&(re[z]=N[z])},v(we,Ae)};function T(we,Ae){v(we,Ae);function re(){this.constructor=we}we.prototype=Ae===null?Object.create(Ae):(re.prototype=Ae.prototype,new re)}var C=function(){return C=Object.assign||function(Ae){for(var re,N=1,z=arguments.length;N<z;N++){re=arguments[N];for(var V in re)Object.prototype.hasOwnProperty.call(re,V)&&(Ae[V]=re[V])}return Ae},C.apply(this,arguments)};function I(we,Ae){var re={};for(var N in we)Object.prototype.hasOwnProperty.call(we,N)&&Ae.indexOf(N)<0&&(re[N]=we[N]);if(we!=null&&typeof Object.getOwnPropertySymbols=="function")for(var z=0,N=Object.getOwnPropertySymbols(we);z<N.length;z++)Ae.indexOf(N[z])<0&&Object.prototype.propertyIsEnumerable.call(we,N[z])&&(re[N[z]]=we[N[z]]);return re}function m(we,Ae,re,N){var z=arguments.length,V=z<3?Ae:N===null?N=Object.getOwnPropertyDescriptor(Ae,re):N,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(we,Ae,re,N);else for(var j=we.length-1;j>=0;j--)(U=we[j])&&(V=(z<3?U(V):z>3?U(Ae,re,V):U(Ae,re))||V);return z>3&&V&&Object.defineProperty(Ae,re,V),V}function b(we,Ae){return function(re,N){Ae(re,N,we)}}function g(we,Ae){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(we,Ae)}function w(we,Ae,re,N){function z(V){return V instanceof re?V:new re(function(U){U(V)})}return new(re||(re=Promise))(function(V,U){function j(J){try{ee(N.next(J))}catch(F){U(F)}}function $(J){try{ee(N.throw(J))}catch(F){U(F)}}function ee(J){J.done?V(J.value):z(J.value).then(j,$)}ee((N=N.apply(we,Ae||[])).next())})}function _(we,Ae){var re={label:0,sent:function(){if(V[0]&1)throw V[1];return V[1]},trys:[],ops:[]},N,z,V,U;return U={next:j(0),throw:j(1),return:j(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function j(ee){return function(J){return $([ee,J])}}function $(ee){if(N)throw new TypeError("Generator is already executing.");for(;re;)try{if(N=1,z&&(V=ee[0]&2?z.return:ee[0]?z.throw||((V=z.return)&&V.call(z),0):z.next)&&!(V=V.call(z,ee[1])).done)return V;switch(z=0,V&&(ee=[ee[0]&2,V.value]),ee[0]){case 0:case 1:V=ee;break;case 4:return re.label++,{value:ee[1],done:!1};case 5:re.label++,z=ee[1],ee=[0];continue;case 7:ee=re.ops.pop(),re.trys.pop();continue;default:if(V=re.trys,!(V=V.length>0&&V[V.length-1])&&(ee[0]===6||ee[0]===2)){re=0;continue}if(ee[0]===3&&(!V||ee[1]>V[0]&&ee[1]<V[3])){re.label=ee[1];break}if(ee[0]===6&&re.label<V[1]){re.label=V[1],V=ee;break}if(V&&re.label<V[2]){re.label=V[2],re.ops.push(ee);break}V[2]&&re.ops.pop(),re.trys.pop();continue}ee=Ae.call(we,re)}catch(J){ee=[6,J],z=0}finally{N=V=0}if(ee[0]&5)throw ee[1];return{value:ee[0]?ee[1]:void 0,done:!0}}}function A(we,Ae,re,N){N===void 0&&(N=re),we[N]=Ae[re]}function S(we,Ae){for(var re in we)re!=="default"&&!Ae.hasOwnProperty(re)&&(Ae[re]=we[re])}function k(we){var Ae=typeof Symbol=="function"&&Symbol.iterator,re=Ae&&we[Ae],N=0;if(re)return re.call(we);if(we&&typeof we.length=="number")return{next:function(){return we&&N>=we.length&&(we=void 0),{value:we&&we[N++],done:!we}}};throw new TypeError(Ae?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(we,Ae){var re=typeof Symbol=="function"&&we[Symbol.iterator];if(!re)return we;var N=re.call(we),z,V=[],U;try{for(;(Ae===void 0||Ae-- >0)&&!(z=N.next()).done;)V.push(z.value)}catch(j){U={error:j}}finally{try{z&&!z.done&&(re=N.return)&&re.call(N)}finally{if(U)throw U.error}}return V}function O(){for(var we=[],Ae=0;Ae<arguments.length;Ae++)we=we.concat(B(arguments[Ae]));return we}function L(){for(var we=0,Ae=0,re=arguments.length;Ae<re;Ae++)we+=arguments[Ae].length;for(var N=Array(we),z=0,Ae=0;Ae<re;Ae++)for(var V=arguments[Ae],U=0,j=V.length;U<j;U++,z++)N[z]=V[U];return N}function D(we){return this instanceof D?(this.v=we,this):new D(we)}function W(we,Ae,re){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var N=re.apply(we,Ae||[]),z,V=[];return z={},U("next"),U("throw"),U("return"),z[Symbol.asyncIterator]=function(){return this},z;function U(X){N[X]&&(z[X]=function(de){return new Promise(function(Y,ce){V.push([X,de,Y,ce])>1||j(X,de)})})}function j(X,de){try{$(N[X](de))}catch(Y){F(V[0][3],Y)}}function $(X){X.value instanceof D?Promise.resolve(X.value.v).then(ee,J):F(V[0][2],X)}function ee(X){j("next",X)}function J(X){j("throw",X)}function F(X,de){X(de),V.shift(),V.length&&j(V[0][0],V[0][1])}}function H(we){var Ae,re;return Ae={},N("next"),N("throw",function(z){throw z}),N("return"),Ae[Symbol.iterator]=function(){return this},Ae;function N(z,V){Ae[z]=we[z]?function(U){return(re=!re)?{value:D(we[z](U)),done:z==="return"}:V?V(U):U}:V}}function G(we){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Ae=we[Symbol.asyncIterator],re;return Ae?Ae.call(we):(we=typeof k=="function"?k(we):we[Symbol.iterator](),re={},N("next"),N("throw"),N("return"),re[Symbol.asyncIterator]=function(){return this},re);function N(V){re[V]=we[V]&&function(U){return new Promise(function(j,$){U=we[V](U),z(j,$,U.done,U.value)})}}function z(V,U,j,$){Promise.resolve($).then(function(ee){V({value:ee,done:j})},U)}}function Z(we,Ae){return Object.defineProperty?Object.defineProperty(we,"raw",{value:Ae}):we.raw=Ae,we}function Q(we){if(we&&we.__esModule)return we;var Ae={};if(we!=null)for(var re in we)Object.hasOwnProperty.call(we,re)&&(Ae[re]=we[re]);return Ae.default=we,Ae}function ie(we){return we&&we.__esModule?we:{default:we}}function le(we,Ae){if(!Ae.has(we))throw new TypeError("attempted to get private field on non-instance");return Ae.get(we)}function be(we,Ae,re){if(!Ae.has(we))throw new TypeError("attempted to set private field on non-instance");return Ae.set(we,re),re}},95858:function(fe,p,x){var v=x(69358).Buffer;(function(T,C){"use strict";fe.exports?fe.exports=C():(T.nacl||(T.nacl={}),T.nacl.util=C())})(this,function(){"use strict";var T={};function C(I){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(I))throw new TypeError("invalid encoding")}return T.decodeUTF8=function(I){if(typeof I!="string")throw new TypeError("expected string");var m,b=unescape(encodeURIComponent(I)),g=new Uint8Array(b.length);for(m=0;m<b.length;m++)g[m]=b.charCodeAt(m);return g},T.encodeUTF8=function(I){var m,b=[];for(m=0;m<I.length;m++)b.push(String.fromCharCode(I[m]));return decodeURIComponent(escape(b.join("")))},typeof atob>"u"?typeof v.from<"u"?(T.encodeBase64=function(I){return v.from(I).toString("base64")},T.decodeBase64=function(I){return C(I),new Uint8Array(Array.prototype.slice.call(v.from(I,"base64"),0))}):(T.encodeBase64=function(I){return new v(I).toString("base64")},T.decodeBase64=function(I){return C(I),new Uint8Array(Array.prototype.slice.call(new v(I,"base64"),0))}):(T.encodeBase64=function(I){var m,b=[],g=I.length;for(m=0;m<g;m++)b.push(String.fromCharCode(I[m]));return btoa(b.join(""))},T.decodeBase64=function(I){C(I);var m,b=atob(I),g=new Uint8Array(b.length);for(m=0;m<b.length;m++)g[m]=b.charCodeAt(m);return g}),T})},18861:function(fe,p,x){(function(v){"use strict";var T=function(Pe){var Ue,Le=new Float64Array(16);if(Pe)for(Ue=0;Ue<Pe.length;Ue++)Le[Ue]=Pe[Ue];return Le},C=function(){throw new Error("no PRNG")},I=new Uint8Array(16),m=new Uint8Array(32);m[0]=9;var b=T(),g=T([1]),w=T([56129,1]),_=T([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),A=T([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),S=T([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),k=T([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),B=T([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function O(Pe,Ue,Le,_e){Pe[Ue]=Le>>24&255,Pe[Ue+1]=Le>>16&255,Pe[Ue+2]=Le>>8&255,Pe[Ue+3]=Le&255,Pe[Ue+4]=_e>>24&255,Pe[Ue+5]=_e>>16&255,Pe[Ue+6]=_e>>8&255,Pe[Ue+7]=_e&255}function L(Pe,Ue,Le,_e,Ze){var Ot,Yt=0;for(Ot=0;Ot<Ze;Ot++)Yt|=Pe[Ue+Ot]^Le[_e+Ot];return(1&Yt-1>>>8)-1}function D(Pe,Ue,Le,_e){return L(Pe,Ue,Le,_e,16)}function W(Pe,Ue,Le,_e){return L(Pe,Ue,Le,_e,32)}function H(Pe,Ue,Le,_e){for(var Ze=_e[0]&255|(_e[1]&255)<<8|(_e[2]&255)<<16|(_e[3]&255)<<24,Ot=Le[0]&255|(Le[1]&255)<<8|(Le[2]&255)<<16|(Le[3]&255)<<24,Yt=Le[4]&255|(Le[5]&255)<<8|(Le[6]&255)<<16|(Le[7]&255)<<24,Jt=Le[8]&255|(Le[9]&255)<<8|(Le[10]&255)<<16|(Le[11]&255)<<24,en=Le[12]&255|(Le[13]&255)<<8|(Le[14]&255)<<16|(Le[15]&255)<<24,Vn=_e[4]&255|(_e[5]&255)<<8|(_e[6]&255)<<16|(_e[7]&255)<<24,kn=Ue[0]&255|(Ue[1]&255)<<8|(Ue[2]&255)<<16|(Ue[3]&255)<<24,ir=Ue[4]&255|(Ue[5]&255)<<8|(Ue[6]&255)<<16|(Ue[7]&255)<<24,Hn=Ue[8]&255|(Ue[9]&255)<<8|(Ue[10]&255)<<16|(Ue[11]&255)<<24,tr=Ue[12]&255|(Ue[13]&255)<<8|(Ue[14]&255)<<16|(Ue[15]&255)<<24,gr=_e[8]&255|(_e[9]&255)<<8|(_e[10]&255)<<16|(_e[11]&255)<<24,br=Le[16]&255|(Le[17]&255)<<8|(Le[18]&255)<<16|(Le[19]&255)<<24,pr=Le[20]&255|(Le[21]&255)<<8|(Le[22]&255)<<16|(Le[23]&255)<<24,_n=Le[24]&255|(Le[25]&255)<<8|(Le[26]&255)<<16|(Le[27]&255)<<24,Qn=Le[28]&255|(Le[29]&255)<<8|(Le[30]&255)<<16|(Le[31]&255)<<24,Zn=_e[12]&255|(_e[13]&255)<<8|(_e[14]&255)<<16|(_e[15]&255)<<24,Mn=Ze,Ln=Ot,Rn=Yt,In=Jt,Xn=en,$n=Vn,hn=kn,an=ir,Tn=Hn,Sn=tr,Bn=gr,Fn=br,bt=pr,ve=_n,je=Qn,at=Zn,Ne,Et=0;Et<20;Et+=2)Ne=Mn+bt|0,Xn^=Ne<<7|Ne>>>25,Ne=Xn+Mn|0,Tn^=Ne<<9|Ne>>>23,Ne=Tn+Xn|0,bt^=Ne<<13|Ne>>>19,Ne=bt+Tn|0,Mn^=Ne<<18|Ne>>>14,Ne=$n+Ln|0,Sn^=Ne<<7|Ne>>>25,Ne=Sn+$n|0,ve^=Ne<<9|Ne>>>23,Ne=ve+Sn|0,Ln^=Ne<<13|Ne>>>19,Ne=Ln+ve|0,$n^=Ne<<18|Ne>>>14,Ne=Bn+hn|0,je^=Ne<<7|Ne>>>25,Ne=je+Bn|0,Rn^=Ne<<9|Ne>>>23,Ne=Rn+je|0,hn^=Ne<<13|Ne>>>19,Ne=hn+Rn|0,Bn^=Ne<<18|Ne>>>14,Ne=at+Fn|0,In^=Ne<<7|Ne>>>25,Ne=In+at|0,an^=Ne<<9|Ne>>>23,Ne=an+In|0,Fn^=Ne<<13|Ne>>>19,Ne=Fn+an|0,at^=Ne<<18|Ne>>>14,Ne=Mn+In|0,Ln^=Ne<<7|Ne>>>25,Ne=Ln+Mn|0,Rn^=Ne<<9|Ne>>>23,Ne=Rn+Ln|0,In^=Ne<<13|Ne>>>19,Ne=In+Rn|0,Mn^=Ne<<18|Ne>>>14,Ne=$n+Xn|0,hn^=Ne<<7|Ne>>>25,Ne=hn+$n|0,an^=Ne<<9|Ne>>>23,Ne=an+hn|0,Xn^=Ne<<13|Ne>>>19,Ne=Xn+an|0,$n^=Ne<<18|Ne>>>14,Ne=Bn+Sn|0,Fn^=Ne<<7|Ne>>>25,Ne=Fn+Bn|0,Tn^=Ne<<9|Ne>>>23,Ne=Tn+Fn|0,Sn^=Ne<<13|Ne>>>19,Ne=Sn+Tn|0,Bn^=Ne<<18|Ne>>>14,Ne=at+je|0,bt^=Ne<<7|Ne>>>25,Ne=bt+at|0,ve^=Ne<<9|Ne>>>23,Ne=ve+bt|0,je^=Ne<<13|Ne>>>19,Ne=je+ve|0,at^=Ne<<18|Ne>>>14;Mn=Mn+Ze|0,Ln=Ln+Ot|0,Rn=Rn+Yt|0,In=In+Jt|0,Xn=Xn+en|0,$n=$n+Vn|0,hn=hn+kn|0,an=an+ir|0,Tn=Tn+Hn|0,Sn=Sn+tr|0,Bn=Bn+gr|0,Fn=Fn+br|0,bt=bt+pr|0,ve=ve+_n|0,je=je+Qn|0,at=at+Zn|0,Pe[0]=Mn>>>0&255,Pe[1]=Mn>>>8&255,Pe[2]=Mn>>>16&255,Pe[3]=Mn>>>24&255,Pe[4]=Ln>>>0&255,Pe[5]=Ln>>>8&255,Pe[6]=Ln>>>16&255,Pe[7]=Ln>>>24&255,Pe[8]=Rn>>>0&255,Pe[9]=Rn>>>8&255,Pe[10]=Rn>>>16&255,Pe[11]=Rn>>>24&255,Pe[12]=In>>>0&255,Pe[13]=In>>>8&255,Pe[14]=In>>>16&255,Pe[15]=In>>>24&255,Pe[16]=Xn>>>0&255,Pe[17]=Xn>>>8&255,Pe[18]=Xn>>>16&255,Pe[19]=Xn>>>24&255,Pe[20]=$n>>>0&255,Pe[21]=$n>>>8&255,Pe[22]=$n>>>16&255,Pe[23]=$n>>>24&255,Pe[24]=hn>>>0&255,Pe[25]=hn>>>8&255,Pe[26]=hn>>>16&255,Pe[27]=hn>>>24&255,Pe[28]=an>>>0&255,Pe[29]=an>>>8&255,Pe[30]=an>>>16&255,Pe[31]=an>>>24&255,Pe[32]=Tn>>>0&255,Pe[33]=Tn>>>8&255,Pe[34]=Tn>>>16&255,Pe[35]=Tn>>>24&255,Pe[36]=Sn>>>0&255,Pe[37]=Sn>>>8&255,Pe[38]=Sn>>>16&255,Pe[39]=Sn>>>24&255,Pe[40]=Bn>>>0&255,Pe[41]=Bn>>>8&255,Pe[42]=Bn>>>16&255,Pe[43]=Bn>>>24&255,Pe[44]=Fn>>>0&255,Pe[45]=Fn>>>8&255,Pe[46]=Fn>>>16&255,Pe[47]=Fn>>>24&255,Pe[48]=bt>>>0&255,Pe[49]=bt>>>8&255,Pe[50]=bt>>>16&255,Pe[51]=bt>>>24&255,Pe[52]=ve>>>0&255,Pe[53]=ve>>>8&255,Pe[54]=ve>>>16&255,Pe[55]=ve>>>24&255,Pe[56]=je>>>0&255,Pe[57]=je>>>8&255,Pe[58]=je>>>16&255,Pe[59]=je>>>24&255,Pe[60]=at>>>0&255,Pe[61]=at>>>8&255,Pe[62]=at>>>16&255,Pe[63]=at>>>24&255}function G(Pe,Ue,Le,_e){for(var Ze=_e[0]&255|(_e[1]&255)<<8|(_e[2]&255)<<16|(_e[3]&255)<<24,Ot=Le[0]&255|(Le[1]&255)<<8|(Le[2]&255)<<16|(Le[3]&255)<<24,Yt=Le[4]&255|(Le[5]&255)<<8|(Le[6]&255)<<16|(Le[7]&255)<<24,Jt=Le[8]&255|(Le[9]&255)<<8|(Le[10]&255)<<16|(Le[11]&255)<<24,en=Le[12]&255|(Le[13]&255)<<8|(Le[14]&255)<<16|(Le[15]&255)<<24,Vn=_e[4]&255|(_e[5]&255)<<8|(_e[6]&255)<<16|(_e[7]&255)<<24,kn=Ue[0]&255|(Ue[1]&255)<<8|(Ue[2]&255)<<16|(Ue[3]&255)<<24,ir=Ue[4]&255|(Ue[5]&255)<<8|(Ue[6]&255)<<16|(Ue[7]&255)<<24,Hn=Ue[8]&255|(Ue[9]&255)<<8|(Ue[10]&255)<<16|(Ue[11]&255)<<24,tr=Ue[12]&255|(Ue[13]&255)<<8|(Ue[14]&255)<<16|(Ue[15]&255)<<24,gr=_e[8]&255|(_e[9]&255)<<8|(_e[10]&255)<<16|(_e[11]&255)<<24,br=Le[16]&255|(Le[17]&255)<<8|(Le[18]&255)<<16|(Le[19]&255)<<24,pr=Le[20]&255|(Le[21]&255)<<8|(Le[22]&255)<<16|(Le[23]&255)<<24,_n=Le[24]&255|(Le[25]&255)<<8|(Le[26]&255)<<16|(Le[27]&255)<<24,Qn=Le[28]&255|(Le[29]&255)<<8|(Le[30]&255)<<16|(Le[31]&255)<<24,Zn=_e[12]&255|(_e[13]&255)<<8|(_e[14]&255)<<16|(_e[15]&255)<<24,Mn=Ze,Ln=Ot,Rn=Yt,In=Jt,Xn=en,$n=Vn,hn=kn,an=ir,Tn=Hn,Sn=tr,Bn=gr,Fn=br,bt=pr,ve=_n,je=Qn,at=Zn,Ne,Et=0;Et<20;Et+=2)Ne=Mn+bt|0,Xn^=Ne<<7|Ne>>>25,Ne=Xn+Mn|0,Tn^=Ne<<9|Ne>>>23,Ne=Tn+Xn|0,bt^=Ne<<13|Ne>>>19,Ne=bt+Tn|0,Mn^=Ne<<18|Ne>>>14,Ne=$n+Ln|0,Sn^=Ne<<7|Ne>>>25,Ne=Sn+$n|0,ve^=Ne<<9|Ne>>>23,Ne=ve+Sn|0,Ln^=Ne<<13|Ne>>>19,Ne=Ln+ve|0,$n^=Ne<<18|Ne>>>14,Ne=Bn+hn|0,je^=Ne<<7|Ne>>>25,Ne=je+Bn|0,Rn^=Ne<<9|Ne>>>23,Ne=Rn+je|0,hn^=Ne<<13|Ne>>>19,Ne=hn+Rn|0,Bn^=Ne<<18|Ne>>>14,Ne=at+Fn|0,In^=Ne<<7|Ne>>>25,Ne=In+at|0,an^=Ne<<9|Ne>>>23,Ne=an+In|0,Fn^=Ne<<13|Ne>>>19,Ne=Fn+an|0,at^=Ne<<18|Ne>>>14,Ne=Mn+In|0,Ln^=Ne<<7|Ne>>>25,Ne=Ln+Mn|0,Rn^=Ne<<9|Ne>>>23,Ne=Rn+Ln|0,In^=Ne<<13|Ne>>>19,Ne=In+Rn|0,Mn^=Ne<<18|Ne>>>14,Ne=$n+Xn|0,hn^=Ne<<7|Ne>>>25,Ne=hn+$n|0,an^=Ne<<9|Ne>>>23,Ne=an+hn|0,Xn^=Ne<<13|Ne>>>19,Ne=Xn+an|0,$n^=Ne<<18|Ne>>>14,Ne=Bn+Sn|0,Fn^=Ne<<7|Ne>>>25,Ne=Fn+Bn|0,Tn^=Ne<<9|Ne>>>23,Ne=Tn+Fn|0,Sn^=Ne<<13|Ne>>>19,Ne=Sn+Tn|0,Bn^=Ne<<18|Ne>>>14,Ne=at+je|0,bt^=Ne<<7|Ne>>>25,Ne=bt+at|0,ve^=Ne<<9|Ne>>>23,Ne=ve+bt|0,je^=Ne<<13|Ne>>>19,Ne=je+ve|0,at^=Ne<<18|Ne>>>14;Pe[0]=Mn>>>0&255,Pe[1]=Mn>>>8&255,Pe[2]=Mn>>>16&255,Pe[3]=Mn>>>24&255,Pe[4]=$n>>>0&255,Pe[5]=$n>>>8&255,Pe[6]=$n>>>16&255,Pe[7]=$n>>>24&255,Pe[8]=Bn>>>0&255,Pe[9]=Bn>>>8&255,Pe[10]=Bn>>>16&255,Pe[11]=Bn>>>24&255,Pe[12]=at>>>0&255,Pe[13]=at>>>8&255,Pe[14]=at>>>16&255,Pe[15]=at>>>24&255,Pe[16]=hn>>>0&255,Pe[17]=hn>>>8&255,Pe[18]=hn>>>16&255,Pe[19]=hn>>>24&255,Pe[20]=an>>>0&255,Pe[21]=an>>>8&255,Pe[22]=an>>>16&255,Pe[23]=an>>>24&255,Pe[24]=Tn>>>0&255,Pe[25]=Tn>>>8&255,Pe[26]=Tn>>>16&255,Pe[27]=Tn>>>24&255,Pe[28]=Sn>>>0&255,Pe[29]=Sn>>>8&255,Pe[30]=Sn>>>16&255,Pe[31]=Sn>>>24&255}function Z(Pe,Ue,Le,_e){H(Pe,Ue,Le,_e)}function Q(Pe,Ue,Le,_e){G(Pe,Ue,Le,_e)}var ie=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function le(Pe,Ue,Le,_e,Ze,Ot,Yt){var Jt=new Uint8Array(16),en=new Uint8Array(64),Vn,kn;for(kn=0;kn<16;kn++)Jt[kn]=0;for(kn=0;kn<8;kn++)Jt[kn]=Ot[kn];for(;Ze>=64;){for(Z(en,Jt,Yt,ie),kn=0;kn<64;kn++)Pe[Ue+kn]=Le[_e+kn]^en[kn];for(Vn=1,kn=8;kn<16;kn++)Vn=Vn+(Jt[kn]&255)|0,Jt[kn]=Vn&255,Vn>>>=8;Ze-=64,Ue+=64,_e+=64}if(Ze>0)for(Z(en,Jt,Yt,ie),kn=0;kn<Ze;kn++)Pe[Ue+kn]=Le[_e+kn]^en[kn];return 0}function be(Pe,Ue,Le,_e,Ze){var Ot=new Uint8Array(16),Yt=new Uint8Array(64),Jt,en;for(en=0;en<16;en++)Ot[en]=0;for(en=0;en<8;en++)Ot[en]=_e[en];for(;Le>=64;){for(Z(Yt,Ot,Ze,ie),en=0;en<64;en++)Pe[Ue+en]=Yt[en];for(Jt=1,en=8;en<16;en++)Jt=Jt+(Ot[en]&255)|0,Ot[en]=Jt&255,Jt>>>=8;Le-=64,Ue+=64}if(Le>0)for(Z(Yt,Ot,Ze,ie),en=0;en<Le;en++)Pe[Ue+en]=Yt[en];return 0}function we(Pe,Ue,Le,_e,Ze){var Ot=new Uint8Array(32);Q(Ot,_e,Ze,ie);for(var Yt=new Uint8Array(8),Jt=0;Jt<8;Jt++)Yt[Jt]=_e[Jt+16];return be(Pe,Ue,Le,Yt,Ot)}function Ae(Pe,Ue,Le,_e,Ze,Ot,Yt){var Jt=new Uint8Array(32);Q(Jt,Ot,Yt,ie);for(var en=new Uint8Array(8),Vn=0;Vn<8;Vn++)en[Vn]=Ot[Vn+16];return le(Pe,Ue,Le,_e,Ze,en,Jt)}var re=function(Pe){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var Ue,Le,_e,Ze,Ot,Yt,Jt,en;Ue=Pe[0]&255|(Pe[1]&255)<<8,this.r[0]=Ue&8191,Le=Pe[2]&255|(Pe[3]&255)<<8,this.r[1]=(Ue>>>13|Le<<3)&8191,_e=Pe[4]&255|(Pe[5]&255)<<8,this.r[2]=(Le>>>10|_e<<6)&7939,Ze=Pe[6]&255|(Pe[7]&255)<<8,this.r[3]=(_e>>>7|Ze<<9)&8191,Ot=Pe[8]&255|(Pe[9]&255)<<8,this.r[4]=(Ze>>>4|Ot<<12)&255,this.r[5]=Ot>>>1&8190,Yt=Pe[10]&255|(Pe[11]&255)<<8,this.r[6]=(Ot>>>14|Yt<<2)&8191,Jt=Pe[12]&255|(Pe[13]&255)<<8,this.r[7]=(Yt>>>11|Jt<<5)&8065,en=Pe[14]&255|(Pe[15]&255)<<8,this.r[8]=(Jt>>>8|en<<8)&8191,this.r[9]=en>>>5&127,this.pad[0]=Pe[16]&255|(Pe[17]&255)<<8,this.pad[1]=Pe[18]&255|(Pe[19]&255)<<8,this.pad[2]=Pe[20]&255|(Pe[21]&255)<<8,this.pad[3]=Pe[22]&255|(Pe[23]&255)<<8,this.pad[4]=Pe[24]&255|(Pe[25]&255)<<8,this.pad[5]=Pe[26]&255|(Pe[27]&255)<<8,this.pad[6]=Pe[28]&255|(Pe[29]&255)<<8,this.pad[7]=Pe[30]&255|(Pe[31]&255)<<8};re.prototype.blocks=function(Pe,Ue,Le){for(var _e=this.fin?0:2048,Ze,Ot,Yt,Jt,en,Vn,kn,ir,Hn,tr,gr,br,pr,_n,Qn,Zn,Mn,Ln,Rn,In=this.h[0],Xn=this.h[1],$n=this.h[2],hn=this.h[3],an=this.h[4],Tn=this.h[5],Sn=this.h[6],Bn=this.h[7],Fn=this.h[8],bt=this.h[9],ve=this.r[0],je=this.r[1],at=this.r[2],Ne=this.r[3],Et=this.r[4],vn=this.r[5],mn=this.r[6],Nn=this.r[7],Dn=this.r[8],Gn=this.r[9];Le>=16;)Ze=Pe[Ue+0]&255|(Pe[Ue+1]&255)<<8,In+=Ze&8191,Ot=Pe[Ue+2]&255|(Pe[Ue+3]&255)<<8,Xn+=(Ze>>>13|Ot<<3)&8191,Yt=Pe[Ue+4]&255|(Pe[Ue+5]&255)<<8,$n+=(Ot>>>10|Yt<<6)&8191,Jt=Pe[Ue+6]&255|(Pe[Ue+7]&255)<<8,hn+=(Yt>>>7|Jt<<9)&8191,en=Pe[Ue+8]&255|(Pe[Ue+9]&255)<<8,an+=(Jt>>>4|en<<12)&8191,Tn+=en>>>1&8191,Vn=Pe[Ue+10]&255|(Pe[Ue+11]&255)<<8,Sn+=(en>>>14|Vn<<2)&8191,kn=Pe[Ue+12]&255|(Pe[Ue+13]&255)<<8,Bn+=(Vn>>>11|kn<<5)&8191,ir=Pe[Ue+14]&255|(Pe[Ue+15]&255)<<8,Fn+=(kn>>>8|ir<<8)&8191,bt+=ir>>>5|_e,Hn=0,tr=Hn,tr+=In*ve,tr+=Xn*(5*Gn),tr+=$n*(5*Dn),tr+=hn*(5*Nn),tr+=an*(5*mn),Hn=tr>>>13,tr&=8191,tr+=Tn*(5*vn),tr+=Sn*(5*Et),tr+=Bn*(5*Ne),tr+=Fn*(5*at),tr+=bt*(5*je),Hn+=tr>>>13,tr&=8191,gr=Hn,gr+=In*je,gr+=Xn*ve,gr+=$n*(5*Gn),gr+=hn*(5*Dn),gr+=an*(5*Nn),Hn=gr>>>13,gr&=8191,gr+=Tn*(5*mn),gr+=Sn*(5*vn),gr+=Bn*(5*Et),gr+=Fn*(5*Ne),gr+=bt*(5*at),Hn+=gr>>>13,gr&=8191,br=Hn,br+=In*at,br+=Xn*je,br+=$n*ve,br+=hn*(5*Gn),br+=an*(5*Dn),Hn=br>>>13,br&=8191,br+=Tn*(5*Nn),br+=Sn*(5*mn),br+=Bn*(5*vn),br+=Fn*(5*Et),br+=bt*(5*Ne),Hn+=br>>>13,br&=8191,pr=Hn,pr+=In*Ne,pr+=Xn*at,pr+=$n*je,pr+=hn*ve,pr+=an*(5*Gn),Hn=pr>>>13,pr&=8191,pr+=Tn*(5*Dn),pr+=Sn*(5*Nn),pr+=Bn*(5*mn),pr+=Fn*(5*vn),pr+=bt*(5*Et),Hn+=pr>>>13,pr&=8191,_n=Hn,_n+=In*Et,_n+=Xn*Ne,_n+=$n*at,_n+=hn*je,_n+=an*ve,Hn=_n>>>13,_n&=8191,_n+=Tn*(5*Gn),_n+=Sn*(5*Dn),_n+=Bn*(5*Nn),_n+=Fn*(5*mn),_n+=bt*(5*vn),Hn+=_n>>>13,_n&=8191,Qn=Hn,Qn+=In*vn,Qn+=Xn*Et,Qn+=$n*Ne,Qn+=hn*at,Qn+=an*je,Hn=Qn>>>13,Qn&=8191,Qn+=Tn*ve,Qn+=Sn*(5*Gn),Qn+=Bn*(5*Dn),Qn+=Fn*(5*Nn),Qn+=bt*(5*mn),Hn+=Qn>>>13,Qn&=8191,Zn=Hn,Zn+=In*mn,Zn+=Xn*vn,Zn+=$n*Et,Zn+=hn*Ne,Zn+=an*at,Hn=Zn>>>13,Zn&=8191,Zn+=Tn*je,Zn+=Sn*ve,Zn+=Bn*(5*Gn),Zn+=Fn*(5*Dn),Zn+=bt*(5*Nn),Hn+=Zn>>>13,Zn&=8191,Mn=Hn,Mn+=In*Nn,Mn+=Xn*mn,Mn+=$n*vn,Mn+=hn*Et,Mn+=an*Ne,Hn=Mn>>>13,Mn&=8191,Mn+=Tn*at,Mn+=Sn*je,Mn+=Bn*ve,Mn+=Fn*(5*Gn),Mn+=bt*(5*Dn),Hn+=Mn>>>13,Mn&=8191,Ln=Hn,Ln+=In*Dn,Ln+=Xn*Nn,Ln+=$n*mn,Ln+=hn*vn,Ln+=an*Et,Hn=Ln>>>13,Ln&=8191,Ln+=Tn*Ne,Ln+=Sn*at,Ln+=Bn*je,Ln+=Fn*ve,Ln+=bt*(5*Gn),Hn+=Ln>>>13,Ln&=8191,Rn=Hn,Rn+=In*Gn,Rn+=Xn*Dn,Rn+=$n*Nn,Rn+=hn*mn,Rn+=an*vn,Hn=Rn>>>13,Rn&=8191,Rn+=Tn*Et,Rn+=Sn*Ne,Rn+=Bn*at,Rn+=Fn*je,Rn+=bt*ve,Hn+=Rn>>>13,Rn&=8191,Hn=(Hn<<2)+Hn|0,Hn=Hn+tr|0,tr=Hn&8191,Hn=Hn>>>13,gr+=Hn,In=tr,Xn=gr,$n=br,hn=pr,an=_n,Tn=Qn,Sn=Zn,Bn=Mn,Fn=Ln,bt=Rn,Ue+=16,Le-=16;this.h[0]=In,this.h[1]=Xn,this.h[2]=$n,this.h[3]=hn,this.h[4]=an,this.h[5]=Tn,this.h[6]=Sn,this.h[7]=Bn,this.h[8]=Fn,this.h[9]=bt},re.prototype.finish=function(Pe,Ue){var Le=new Uint16Array(10),_e,Ze,Ot,Yt;if(this.leftover){for(Yt=this.leftover,this.buffer[Yt++]=1;Yt<16;Yt++)this.buffer[Yt]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(_e=this.h[1]>>>13,this.h[1]&=8191,Yt=2;Yt<10;Yt++)this.h[Yt]+=_e,_e=this.h[Yt]>>>13,this.h[Yt]&=8191;for(this.h[0]+=_e*5,_e=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=_e,_e=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=_e,Le[0]=this.h[0]+5,_e=Le[0]>>>13,Le[0]&=8191,Yt=1;Yt<10;Yt++)Le[Yt]=this.h[Yt]+_e,_e=Le[Yt]>>>13,Le[Yt]&=8191;for(Le[9]-=8192,Ze=(_e^1)-1,Yt=0;Yt<10;Yt++)Le[Yt]&=Ze;for(Ze=~Ze,Yt=0;Yt<10;Yt++)this.h[Yt]=this.h[Yt]&Ze|Le[Yt];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,Ot=this.h[0]+this.pad[0],this.h[0]=Ot&65535,Yt=1;Yt<8;Yt++)Ot=(this.h[Yt]+this.pad[Yt]|0)+(Ot>>>16)|0,this.h[Yt]=Ot&65535;Pe[Ue+0]=this.h[0]>>>0&255,Pe[Ue+1]=this.h[0]>>>8&255,Pe[Ue+2]=this.h[1]>>>0&255,Pe[Ue+3]=this.h[1]>>>8&255,Pe[Ue+4]=this.h[2]>>>0&255,Pe[Ue+5]=this.h[2]>>>8&255,Pe[Ue+6]=this.h[3]>>>0&255,Pe[Ue+7]=this.h[3]>>>8&255,Pe[Ue+8]=this.h[4]>>>0&255,Pe[Ue+9]=this.h[4]>>>8&255,Pe[Ue+10]=this.h[5]>>>0&255,Pe[Ue+11]=this.h[5]>>>8&255,Pe[Ue+12]=this.h[6]>>>0&255,Pe[Ue+13]=this.h[6]>>>8&255,Pe[Ue+14]=this.h[7]>>>0&255,Pe[Ue+15]=this.h[7]>>>8&255},re.prototype.update=function(Pe,Ue,Le){var _e,Ze;if(this.leftover){for(Ze=16-this.leftover,Ze>Le&&(Ze=Le),_e=0;_e<Ze;_e++)this.buffer[this.leftover+_e]=Pe[Ue+_e];if(Le-=Ze,Ue+=Ze,this.leftover+=Ze,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(Le>=16&&(Ze=Le-Le%16,this.blocks(Pe,Ue,Ze),Ue+=Ze,Le-=Ze),Le){for(_e=0;_e<Le;_e++)this.buffer[this.leftover+_e]=Pe[Ue+_e];this.leftover+=Le}};function N(Pe,Ue,Le,_e,Ze,Ot){var Yt=new re(Ot);return Yt.update(Le,_e,Ze),Yt.finish(Pe,Ue),0}function z(Pe,Ue,Le,_e,Ze,Ot){var Yt=new Uint8Array(16);return N(Yt,0,Le,_e,Ze,Ot),D(Pe,Ue,Yt,0)}function V(Pe,Ue,Le,_e,Ze){var Ot;if(Le<32)return-1;for(Ae(Pe,0,Ue,0,Le,_e,Ze),N(Pe,16,Pe,32,Le-32,Pe),Ot=0;Ot<16;Ot++)Pe[Ot]=0;return 0}function U(Pe,Ue,Le,_e,Ze){var Ot,Yt=new Uint8Array(32);if(Le<32||(we(Yt,0,32,_e,Ze),z(Ue,16,Ue,32,Le-32,Yt)!==0))return-1;for(Ae(Pe,0,Ue,0,Le,_e,Ze),Ot=0;Ot<32;Ot++)Pe[Ot]=0;return 0}function j(Pe,Ue){var Le;for(Le=0;Le<16;Le++)Pe[Le]=Ue[Le]|0}function $(Pe){var Ue,Le,_e=1;for(Ue=0;Ue<16;Ue++)Le=Pe[Ue]+_e+65535,_e=Math.floor(Le/65536),Pe[Ue]=Le-_e*65536;Pe[0]+=_e-1+37*(_e-1)}function ee(Pe,Ue,Le){for(var _e,Ze=~(Le-1),Ot=0;Ot<16;Ot++)_e=Ze&(Pe[Ot]^Ue[Ot]),Pe[Ot]^=_e,Ue[Ot]^=_e}function J(Pe,Ue){var Le,_e,Ze,Ot=T(),Yt=T();for(Le=0;Le<16;Le++)Yt[Le]=Ue[Le];for($(Yt),$(Yt),$(Yt),_e=0;_e<2;_e++){for(Ot[0]=Yt[0]-65517,Le=1;Le<15;Le++)Ot[Le]=Yt[Le]-65535-(Ot[Le-1]>>16&1),Ot[Le-1]&=65535;Ot[15]=Yt[15]-32767-(Ot[14]>>16&1),Ze=Ot[15]>>16&1,Ot[14]&=65535,ee(Yt,Ot,1-Ze)}for(Le=0;Le<16;Le++)Pe[2*Le]=Yt[Le]&255,Pe[2*Le+1]=Yt[Le]>>8}function F(Pe,Ue){var Le=new Uint8Array(32),_e=new Uint8Array(32);return J(Le,Pe),J(_e,Ue),W(Le,0,_e,0)}function X(Pe){var Ue=new Uint8Array(32);return J(Ue,Pe),Ue[0]&1}function de(Pe,Ue){var Le;for(Le=0;Le<16;Le++)Pe[Le]=Ue[2*Le]+(Ue[2*Le+1]<<8);Pe[15]&=32767}function Y(Pe,Ue,Le){for(var _e=0;_e<16;_e++)Pe[_e]=Ue[_e]+Le[_e]}function ce(Pe,Ue,Le){for(var _e=0;_e<16;_e++)Pe[_e]=Ue[_e]-Le[_e]}function he(Pe,Ue,Le){var _e,Ze,Ot=0,Yt=0,Jt=0,en=0,Vn=0,kn=0,ir=0,Hn=0,tr=0,gr=0,br=0,pr=0,_n=0,Qn=0,Zn=0,Mn=0,Ln=0,Rn=0,In=0,Xn=0,$n=0,hn=0,an=0,Tn=0,Sn=0,Bn=0,Fn=0,bt=0,ve=0,je=0,at=0,Ne=Le[0],Et=Le[1],vn=Le[2],mn=Le[3],Nn=Le[4],Dn=Le[5],Gn=Le[6],$r=Le[7],Vr=Le[8],vi=Le[9],Pi=Le[10],et=Le[11],it=Le[12],$e=Le[13],mt=Le[14],It=Le[15];_e=Ue[0],Ot+=_e*Ne,Yt+=_e*Et,Jt+=_e*vn,en+=_e*mn,Vn+=_e*Nn,kn+=_e*Dn,ir+=_e*Gn,Hn+=_e*$r,tr+=_e*Vr,gr+=_e*vi,br+=_e*Pi,pr+=_e*et,_n+=_e*it,Qn+=_e*$e,Zn+=_e*mt,Mn+=_e*It,_e=Ue[1],Yt+=_e*Ne,Jt+=_e*Et,en+=_e*vn,Vn+=_e*mn,kn+=_e*Nn,ir+=_e*Dn,Hn+=_e*Gn,tr+=_e*$r,gr+=_e*Vr,br+=_e*vi,pr+=_e*Pi,_n+=_e*et,Qn+=_e*it,Zn+=_e*$e,Mn+=_e*mt,Ln+=_e*It,_e=Ue[2],Jt+=_e*Ne,en+=_e*Et,Vn+=_e*vn,kn+=_e*mn,ir+=_e*Nn,Hn+=_e*Dn,tr+=_e*Gn,gr+=_e*$r,br+=_e*Vr,pr+=_e*vi,_n+=_e*Pi,Qn+=_e*et,Zn+=_e*it,Mn+=_e*$e,Ln+=_e*mt,Rn+=_e*It,_e=Ue[3],en+=_e*Ne,Vn+=_e*Et,kn+=_e*vn,ir+=_e*mn,Hn+=_e*Nn,tr+=_e*Dn,gr+=_e*Gn,br+=_e*$r,pr+=_e*Vr,_n+=_e*vi,Qn+=_e*Pi,Zn+=_e*et,Mn+=_e*it,Ln+=_e*$e,Rn+=_e*mt,In+=_e*It,_e=Ue[4],Vn+=_e*Ne,kn+=_e*Et,ir+=_e*vn,Hn+=_e*mn,tr+=_e*Nn,gr+=_e*Dn,br+=_e*Gn,pr+=_e*$r,_n+=_e*Vr,Qn+=_e*vi,Zn+=_e*Pi,Mn+=_e*et,Ln+=_e*it,Rn+=_e*$e,In+=_e*mt,Xn+=_e*It,_e=Ue[5],kn+=_e*Ne,ir+=_e*Et,Hn+=_e*vn,tr+=_e*mn,gr+=_e*Nn,br+=_e*Dn,pr+=_e*Gn,_n+=_e*$r,Qn+=_e*Vr,Zn+=_e*vi,Mn+=_e*Pi,Ln+=_e*et,Rn+=_e*it,In+=_e*$e,Xn+=_e*mt,$n+=_e*It,_e=Ue[6],ir+=_e*Ne,Hn+=_e*Et,tr+=_e*vn,gr+=_e*mn,br+=_e*Nn,pr+=_e*Dn,_n+=_e*Gn,Qn+=_e*$r,Zn+=_e*Vr,Mn+=_e*vi,Ln+=_e*Pi,Rn+=_e*et,In+=_e*it,Xn+=_e*$e,$n+=_e*mt,hn+=_e*It,_e=Ue[7],Hn+=_e*Ne,tr+=_e*Et,gr+=_e*vn,br+=_e*mn,pr+=_e*Nn,_n+=_e*Dn,Qn+=_e*Gn,Zn+=_e*$r,Mn+=_e*Vr,Ln+=_e*vi,Rn+=_e*Pi,In+=_e*et,Xn+=_e*it,$n+=_e*$e,hn+=_e*mt,an+=_e*It,_e=Ue[8],tr+=_e*Ne,gr+=_e*Et,br+=_e*vn,pr+=_e*mn,_n+=_e*Nn,Qn+=_e*Dn,Zn+=_e*Gn,Mn+=_e*$r,Ln+=_e*Vr,Rn+=_e*vi,In+=_e*Pi,Xn+=_e*et,$n+=_e*it,hn+=_e*$e,an+=_e*mt,Tn+=_e*It,_e=Ue[9],gr+=_e*Ne,br+=_e*Et,pr+=_e*vn,_n+=_e*mn,Qn+=_e*Nn,Zn+=_e*Dn,Mn+=_e*Gn,Ln+=_e*$r,Rn+=_e*Vr,In+=_e*vi,Xn+=_e*Pi,$n+=_e*et,hn+=_e*it,an+=_e*$e,Tn+=_e*mt,Sn+=_e*It,_e=Ue[10],br+=_e*Ne,pr+=_e*Et,_n+=_e*vn,Qn+=_e*mn,Zn+=_e*Nn,Mn+=_e*Dn,Ln+=_e*Gn,Rn+=_e*$r,In+=_e*Vr,Xn+=_e*vi,$n+=_e*Pi,hn+=_e*et,an+=_e*it,Tn+=_e*$e,Sn+=_e*mt,Bn+=_e*It,_e=Ue[11],pr+=_e*Ne,_n+=_e*Et,Qn+=_e*vn,Zn+=_e*mn,Mn+=_e*Nn,Ln+=_e*Dn,Rn+=_e*Gn,In+=_e*$r,Xn+=_e*Vr,$n+=_e*vi,hn+=_e*Pi,an+=_e*et,Tn+=_e*it,Sn+=_e*$e,Bn+=_e*mt,Fn+=_e*It,_e=Ue[12],_n+=_e*Ne,Qn+=_e*Et,Zn+=_e*vn,Mn+=_e*mn,Ln+=_e*Nn,Rn+=_e*Dn,In+=_e*Gn,Xn+=_e*$r,$n+=_e*Vr,hn+=_e*vi,an+=_e*Pi,Tn+=_e*et,Sn+=_e*it,Bn+=_e*$e,Fn+=_e*mt,bt+=_e*It,_e=Ue[13],Qn+=_e*Ne,Zn+=_e*Et,Mn+=_e*vn,Ln+=_e*mn,Rn+=_e*Nn,In+=_e*Dn,Xn+=_e*Gn,$n+=_e*$r,hn+=_e*Vr,an+=_e*vi,Tn+=_e*Pi,Sn+=_e*et,Bn+=_e*it,Fn+=_e*$e,bt+=_e*mt,ve+=_e*It,_e=Ue[14],Zn+=_e*Ne,Mn+=_e*Et,Ln+=_e*vn,Rn+=_e*mn,In+=_e*Nn,Xn+=_e*Dn,$n+=_e*Gn,hn+=_e*$r,an+=_e*Vr,Tn+=_e*vi,Sn+=_e*Pi,Bn+=_e*et,Fn+=_e*it,bt+=_e*$e,ve+=_e*mt,je+=_e*It,_e=Ue[15],Mn+=_e*Ne,Ln+=_e*Et,Rn+=_e*vn,In+=_e*mn,Xn+=_e*Nn,$n+=_e*Dn,hn+=_e*Gn,an+=_e*$r,Tn+=_e*Vr,Sn+=_e*vi,Bn+=_e*Pi,Fn+=_e*et,bt+=_e*it,ve+=_e*$e,je+=_e*mt,at+=_e*It,Ot+=38*Ln,Yt+=38*Rn,Jt+=38*In,en+=38*Xn,Vn+=38*$n,kn+=38*hn,ir+=38*an,Hn+=38*Tn,tr+=38*Sn,gr+=38*Bn,br+=38*Fn,pr+=38*bt,_n+=38*ve,Qn+=38*je,Zn+=38*at,Ze=1,_e=Ot+Ze+65535,Ze=Math.floor(_e/65536),Ot=_e-Ze*65536,_e=Yt+Ze+65535,Ze=Math.floor(_e/65536),Yt=_e-Ze*65536,_e=Jt+Ze+65535,Ze=Math.floor(_e/65536),Jt=_e-Ze*65536,_e=en+Ze+65535,Ze=Math.floor(_e/65536),en=_e-Ze*65536,_e=Vn+Ze+65535,Ze=Math.floor(_e/65536),Vn=_e-Ze*65536,_e=kn+Ze+65535,Ze=Math.floor(_e/65536),kn=_e-Ze*65536,_e=ir+Ze+65535,Ze=Math.floor(_e/65536),ir=_e-Ze*65536,_e=Hn+Ze+65535,Ze=Math.floor(_e/65536),Hn=_e-Ze*65536,_e=tr+Ze+65535,Ze=Math.floor(_e/65536),tr=_e-Ze*65536,_e=gr+Ze+65535,Ze=Math.floor(_e/65536),gr=_e-Ze*65536,_e=br+Ze+65535,Ze=Math.floor(_e/65536),br=_e-Ze*65536,_e=pr+Ze+65535,Ze=Math.floor(_e/65536),pr=_e-Ze*65536,_e=_n+Ze+65535,Ze=Math.floor(_e/65536),_n=_e-Ze*65536,_e=Qn+Ze+65535,Ze=Math.floor(_e/65536),Qn=_e-Ze*65536,_e=Zn+Ze+65535,Ze=Math.floor(_e/65536),Zn=_e-Ze*65536,_e=Mn+Ze+65535,Ze=Math.floor(_e/65536),Mn=_e-Ze*65536,Ot+=Ze-1+37*(Ze-1),Ze=1,_e=Ot+Ze+65535,Ze=Math.floor(_e/65536),Ot=_e-Ze*65536,_e=Yt+Ze+65535,Ze=Math.floor(_e/65536),Yt=_e-Ze*65536,_e=Jt+Ze+65535,Ze=Math.floor(_e/65536),Jt=_e-Ze*65536,_e=en+Ze+65535,Ze=Math.floor(_e/65536),en=_e-Ze*65536,_e=Vn+Ze+65535,Ze=Math.floor(_e/65536),Vn=_e-Ze*65536,_e=kn+Ze+65535,Ze=Math.floor(_e/65536),kn=_e-Ze*65536,_e=ir+Ze+65535,Ze=Math.floor(_e/65536),ir=_e-Ze*65536,_e=Hn+Ze+65535,Ze=Math.floor(_e/65536),Hn=_e-Ze*65536,_e=tr+Ze+65535,Ze=Math.floor(_e/65536),tr=_e-Ze*65536,_e=gr+Ze+65535,Ze=Math.floor(_e/65536),gr=_e-Ze*65536,_e=br+Ze+65535,Ze=Math.floor(_e/65536),br=_e-Ze*65536,_e=pr+Ze+65535,Ze=Math.floor(_e/65536),pr=_e-Ze*65536,_e=_n+Ze+65535,Ze=Math.floor(_e/65536),_n=_e-Ze*65536,_e=Qn+Ze+65535,Ze=Math.floor(_e/65536),Qn=_e-Ze*65536,_e=Zn+Ze+65535,Ze=Math.floor(_e/65536),Zn=_e-Ze*65536,_e=Mn+Ze+65535,Ze=Math.floor(_e/65536),Mn=_e-Ze*65536,Ot+=Ze-1+37*(Ze-1),Pe[0]=Ot,Pe[1]=Yt,Pe[2]=Jt,Pe[3]=en,Pe[4]=Vn,Pe[5]=kn,Pe[6]=ir,Pe[7]=Hn,Pe[8]=tr,Pe[9]=gr,Pe[10]=br,Pe[11]=pr,Pe[12]=_n,Pe[13]=Qn,Pe[14]=Zn,Pe[15]=Mn}function Ie(Pe,Ue){he(Pe,Ue,Ue)}function ke(Pe,Ue){var Le=T(),_e;for(_e=0;_e<16;_e++)Le[_e]=Ue[_e];for(_e=253;_e>=0;_e--)Ie(Le,Le),_e!==2&&_e!==4&&he(Le,Le,Ue);for(_e=0;_e<16;_e++)Pe[_e]=Le[_e]}function ut(Pe,Ue){var Le=T(),_e;for(_e=0;_e<16;_e++)Le[_e]=Ue[_e];for(_e=250;_e>=0;_e--)Ie(Le,Le),_e!==1&&he(Le,Le,Ue);for(_e=0;_e<16;_e++)Pe[_e]=Le[_e]}function Re(Pe,Ue,Le){var _e=new Uint8Array(32),Ze=new Float64Array(80),Ot,Yt,Jt=T(),en=T(),Vn=T(),kn=T(),ir=T(),Hn=T();for(Yt=0;Yt<31;Yt++)_e[Yt]=Ue[Yt];for(_e[31]=Ue[31]&127|64,_e[0]&=248,de(Ze,Le),Yt=0;Yt<16;Yt++)en[Yt]=Ze[Yt],kn[Yt]=Jt[Yt]=Vn[Yt]=0;for(Jt[0]=kn[0]=1,Yt=254;Yt>=0;--Yt)Ot=_e[Yt>>>3]>>>(Yt&7)&1,ee(Jt,en,Ot),ee(Vn,kn,Ot),Y(ir,Jt,Vn),ce(Jt,Jt,Vn),Y(Vn,en,kn),ce(en,en,kn),Ie(kn,ir),Ie(Hn,Jt),he(Jt,Vn,Jt),he(Vn,en,ir),Y(ir,Jt,Vn),ce(Jt,Jt,Vn),Ie(en,Jt),ce(Vn,kn,Hn),he(Jt,Vn,w),Y(Jt,Jt,kn),he(Vn,Vn,Jt),he(Jt,kn,Hn),he(kn,en,Ze),Ie(en,ir),ee(Jt,en,Ot),ee(Vn,kn,Ot);for(Yt=0;Yt<16;Yt++)Ze[Yt+16]=Jt[Yt],Ze[Yt+32]=Vn[Yt],Ze[Yt+48]=en[Yt],Ze[Yt+64]=kn[Yt];var tr=Ze.subarray(32),gr=Ze.subarray(16);return ke(tr,tr),he(gr,gr,tr),J(Pe,gr),0}function ze(Pe,Ue){return Re(Pe,Ue,m)}function _t(Pe,Ue){return C(Ue,32),ze(Pe,Ue)}function Ct(Pe,Ue,Le){var _e=new Uint8Array(32);return Re(_e,Le,Ue),Q(Pe,I,_e,ie)}var $t=V,ft=U;function Xe(Pe,Ue,Le,_e,Ze,Ot){var Yt=new Uint8Array(32);return Ct(Yt,Ze,Ot),$t(Pe,Ue,Le,_e,Yt)}function ct(Pe,Ue,Le,_e,Ze,Ot){var Yt=new Uint8Array(32);return Ct(Yt,Ze,Ot),ft(Pe,Ue,Le,_e,Yt)}var wt=[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 Rt(Pe,Ue,Le,_e){for(var Ze=new Int32Array(16),Ot=new Int32Array(16),Yt,Jt,en,Vn,kn,ir,Hn,tr,gr,br,pr,_n,Qn,Zn,Mn,Ln,Rn,In,Xn,$n,hn,an,Tn,Sn,Bn,Fn,bt=Pe[0],ve=Pe[1],je=Pe[2],at=Pe[3],Ne=Pe[4],Et=Pe[5],vn=Pe[6],mn=Pe[7],Nn=Ue[0],Dn=Ue[1],Gn=Ue[2],$r=Ue[3],Vr=Ue[4],vi=Ue[5],Pi=Ue[6],et=Ue[7],it=0;_e>=128;){for(Xn=0;Xn<16;Xn++)$n=8*Xn+it,Ze[Xn]=Le[$n+0]<<24|Le[$n+1]<<16|Le[$n+2]<<8|Le[$n+3],Ot[Xn]=Le[$n+4]<<24|Le[$n+5]<<16|Le[$n+6]<<8|Le[$n+7];for(Xn=0;Xn<80;Xn++)if(Yt=bt,Jt=ve,en=je,Vn=at,kn=Ne,ir=Et,Hn=vn,tr=mn,gr=Nn,br=Dn,pr=Gn,_n=$r,Qn=Vr,Zn=vi,Mn=Pi,Ln=et,hn=mn,an=et,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=(Ne>>>14|Vr<<18)^(Ne>>>18|Vr<<14)^(Vr>>>9|Ne<<23),an=(Vr>>>14|Ne<<18)^(Vr>>>18|Ne<<14)^(Ne>>>9|Vr<<23),Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,hn=Ne&Et^~Ne&vn,an=Vr&vi^~Vr&Pi,Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,hn=wt[Xn*2],an=wt[Xn*2+1],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,hn=Ze[Xn%16],an=Ot[Xn%16],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Rn=Bn&65535|Fn<<16,In=Tn&65535|Sn<<16,hn=Rn,an=In,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=(bt>>>28|Nn<<4)^(Nn>>>2|bt<<30)^(Nn>>>7|bt<<25),an=(Nn>>>28|bt<<4)^(bt>>>2|Nn<<30)^(bt>>>7|Nn<<25),Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,hn=bt&ve^bt&je^ve&je,an=Nn&Dn^Nn&Gn^Dn&Gn,Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,tr=Bn&65535|Fn<<16,Ln=Tn&65535|Sn<<16,hn=Vn,an=_n,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=Rn,an=In,Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Vn=Bn&65535|Fn<<16,_n=Tn&65535|Sn<<16,ve=Yt,je=Jt,at=en,Ne=Vn,Et=kn,vn=ir,mn=Hn,bt=tr,Dn=gr,Gn=br,$r=pr,Vr=_n,vi=Qn,Pi=Zn,et=Mn,Nn=Ln,Xn%16===15)for($n=0;$n<16;$n++)hn=Ze[$n],an=Ot[$n],Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=Ze[($n+9)%16],an=Ot[($n+9)%16],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Rn=Ze[($n+1)%16],In=Ot[($n+1)%16],hn=(Rn>>>1|In<<31)^(Rn>>>8|In<<24)^Rn>>>7,an=(In>>>1|Rn<<31)^(In>>>8|Rn<<24)^(In>>>7|Rn<<25),Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Rn=Ze[($n+14)%16],In=Ot[($n+14)%16],hn=(Rn>>>19|In<<13)^(In>>>29|Rn<<3)^Rn>>>6,an=(In>>>19|Rn<<13)^(Rn>>>29|In<<3)^(In>>>6|Rn<<26),Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Ze[$n]=Bn&65535|Fn<<16,Ot[$n]=Tn&65535|Sn<<16;hn=bt,an=Nn,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=Pe[0],an=Ue[0],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Pe[0]=bt=Bn&65535|Fn<<16,Ue[0]=Nn=Tn&65535|Sn<<16,hn=ve,an=Dn,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=Pe[1],an=Ue[1],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Pe[1]=ve=Bn&65535|Fn<<16,Ue[1]=Dn=Tn&65535|Sn<<16,hn=je,an=Gn,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=Pe[2],an=Ue[2],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Pe[2]=je=Bn&65535|Fn<<16,Ue[2]=Gn=Tn&65535|Sn<<16,hn=at,an=$r,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=Pe[3],an=Ue[3],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Pe[3]=at=Bn&65535|Fn<<16,Ue[3]=$r=Tn&65535|Sn<<16,hn=Ne,an=Vr,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=Pe[4],an=Ue[4],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Pe[4]=Ne=Bn&65535|Fn<<16,Ue[4]=Vr=Tn&65535|Sn<<16,hn=Et,an=vi,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=Pe[5],an=Ue[5],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Pe[5]=Et=Bn&65535|Fn<<16,Ue[5]=vi=Tn&65535|Sn<<16,hn=vn,an=Pi,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=Pe[6],an=Ue[6],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Pe[6]=vn=Bn&65535|Fn<<16,Ue[6]=Pi=Tn&65535|Sn<<16,hn=mn,an=et,Tn=an&65535,Sn=an>>>16,Bn=hn&65535,Fn=hn>>>16,hn=Pe[7],an=Ue[7],Tn+=an&65535,Sn+=an>>>16,Bn+=hn&65535,Fn+=hn>>>16,Sn+=Tn>>>16,Bn+=Sn>>>16,Fn+=Bn>>>16,Pe[7]=mn=Bn&65535|Fn<<16,Ue[7]=et=Tn&65535|Sn<<16,it+=128,_e-=128}return _e}function Ge(Pe,Ue,Le){var _e=new Int32Array(8),Ze=new Int32Array(8),Ot=new Uint8Array(256),Yt,Jt=Le;for(_e[0]=1779033703,_e[1]=3144134277,_e[2]=1013904242,_e[3]=2773480762,_e[4]=1359893119,_e[5]=2600822924,_e[6]=528734635,_e[7]=1541459225,Ze[0]=4089235720,Ze[1]=2227873595,Ze[2]=4271175723,Ze[3]=1595750129,Ze[4]=2917565137,Ze[5]=725511199,Ze[6]=4215389547,Ze[7]=327033209,Rt(_e,Ze,Ue,Le),Le%=128,Yt=0;Yt<Le;Yt++)Ot[Yt]=Ue[Jt-Le+Yt];for(Ot[Le]=128,Le=256-128*(Le<112?1:0),Ot[Le-9]=0,O(Ot,Le-8,Jt/536870912|0,Jt<<3),Rt(_e,Ze,Ot,Le),Yt=0;Yt<8;Yt++)O(Pe,8*Yt,_e[Yt],Ze[Yt]);return 0}function zt(Pe,Ue){var Le=T(),_e=T(),Ze=T(),Ot=T(),Yt=T(),Jt=T(),en=T(),Vn=T(),kn=T();ce(Le,Pe[1],Pe[0]),ce(kn,Ue[1],Ue[0]),he(Le,Le,kn),Y(_e,Pe[0],Pe[1]),Y(kn,Ue[0],Ue[1]),he(_e,_e,kn),he(Ze,Pe[3],Ue[3]),he(Ze,Ze,A),he(Ot,Pe[2],Ue[2]),Y(Ot,Ot,Ot),ce(Yt,_e,Le),ce(Jt,Ot,Ze),Y(en,Ot,Ze),Y(Vn,_e,Le),he(Pe[0],Yt,Jt),he(Pe[1],Vn,en),he(Pe[2],en,Jt),he(Pe[3],Yt,Vn)}function Ft(Pe,Ue,Le){var _e;for(_e=0;_e<4;_e++)ee(Pe[_e],Ue[_e],Le)}function tt(Pe,Ue){var Le=T(),_e=T(),Ze=T();ke(Ze,Ue[2]),he(Le,Ue[0],Ze),he(_e,Ue[1],Ze),J(Pe,_e),Pe[31]^=X(Le)<<7}function qe(Pe,Ue,Le){var _e,Ze;for(j(Pe[0],b),j(Pe[1],g),j(Pe[2],g),j(Pe[3],b),Ze=255;Ze>=0;--Ze)_e=Le[Ze/8|0]>>(Ze&7)&1,Ft(Pe,Ue,_e),zt(Ue,Pe),zt(Pe,Pe),Ft(Pe,Ue,_e)}function dt(Pe,Ue){var Le=[T(),T(),T(),T()];j(Le[0],S),j(Le[1],k),j(Le[2],g),he(Le[3],S,k),qe(Pe,Le,Ue)}function De(Pe,Ue,Le){var _e=new Uint8Array(64),Ze=[T(),T(),T(),T()],Ot;for(Le||C(Ue,32),Ge(_e,Ue,32),_e[0]&=248,_e[31]&=127,_e[31]|=64,dt(Ze,_e),tt(Pe,Ze),Ot=0;Ot<32;Ot++)Ue[Ot+32]=Pe[Ot];return 0}var He=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function se(Pe,Ue){var Le,_e,Ze,Ot;for(_e=63;_e>=32;--_e){for(Le=0,Ze=_e-32,Ot=_e-12;Ze<Ot;++Ze)Ue[Ze]+=Le-16*Ue[_e]*He[Ze-(_e-32)],Le=Math.floor((Ue[Ze]+128)/256),Ue[Ze]-=Le*256;Ue[Ze]+=Le,Ue[_e]=0}for(Le=0,Ze=0;Ze<32;Ze++)Ue[Ze]+=Le-(Ue[31]>>4)*He[Ze],Le=Ue[Ze]>>8,Ue[Ze]&=255;for(Ze=0;Ze<32;Ze++)Ue[Ze]-=Le*He[Ze];for(_e=0;_e<32;_e++)Ue[_e+1]+=Ue[_e]>>8,Pe[_e]=Ue[_e]&255}function oe(Pe){var Ue=new Float64Array(64),Le;for(Le=0;Le<64;Le++)Ue[Le]=Pe[Le];for(Le=0;Le<64;Le++)Pe[Le]=0;se(Pe,Ue)}function ye(Pe,Ue,Le,_e){var Ze=new Uint8Array(64),Ot=new Uint8Array(64),Yt=new Uint8Array(64),Jt,en,Vn=new Float64Array(64),kn=[T(),T(),T(),T()];Ge(Ze,_e,32),Ze[0]&=248,Ze[31]&=127,Ze[31]|=64;var ir=Le+64;for(Jt=0;Jt<Le;Jt++)Pe[64+Jt]=Ue[Jt];for(Jt=0;Jt<32;Jt++)Pe[32+Jt]=Ze[32+Jt];for(Ge(Yt,Pe.subarray(32),Le+32),oe(Yt),dt(kn,Yt),tt(Pe,kn),Jt=32;Jt<64;Jt++)Pe[Jt]=_e[Jt];for(Ge(Ot,Pe,Le+64),oe(Ot),Jt=0;Jt<64;Jt++)Vn[Jt]=0;for(Jt=0;Jt<32;Jt++)Vn[Jt]=Yt[Jt];for(Jt=0;Jt<32;Jt++)for(en=0;en<32;en++)Vn[Jt+en]+=Ot[Jt]*Ze[en];return se(Pe.subarray(32),Vn),ir}function Ee(Pe,Ue){var Le=T(),_e=T(),Ze=T(),Ot=T(),Yt=T(),Jt=T(),en=T();return j(Pe[2],g),de(Pe[1],Ue),Ie(Ze,Pe[1]),he(Ot,Ze,_),ce(Ze,Ze,Pe[2]),Y(Ot,Pe[2],Ot),Ie(Yt,Ot),Ie(Jt,Yt),he(en,Jt,Yt),he(Le,en,Ze),he(Le,Le,Ot),ut(Le,Le),he(Le,Le,Ze),he(Le,Le,Ot),he(Le,Le,Ot),he(Pe[0],Le,Ot),Ie(_e,Pe[0]),he(_e,_e,Ot),F(_e,Ze)&&he(Pe[0],Pe[0],B),Ie(_e,Pe[0]),he(_e,_e,Ot),F(_e,Ze)?-1:(X(Pe[0])===Ue[31]>>7&&ce(Pe[0],b,Pe[0]),he(Pe[3],Pe[0],Pe[1]),0)}function me(Pe,Ue,Le,_e){var Ze,Ot=new Uint8Array(32),Yt=new Uint8Array(64),Jt=[T(),T(),T(),T()],en=[T(),T(),T(),T()];if(Le<64||Ee(en,_e))return-1;for(Ze=0;Ze<Le;Ze++)Pe[Ze]=Ue[Ze];for(Ze=0;Ze<32;Ze++)Pe[Ze+32]=_e[Ze];if(Ge(Yt,Pe,Le),oe(Yt),qe(Jt,en,Yt),dt(en,Ue.subarray(32)),zt(Jt,en),tt(Ot,Jt),Le-=64,W(Ue,0,Ot,0)){for(Ze=0;Ze<Le;Ze++)Pe[Ze]=0;return-1}for(Ze=0;Ze<Le;Ze++)Pe[Ze]=Ue[Ze+64];return Le}var Te=32,Oe=24,Qe=32,Vt=16,vt=32,Zt=32,dn=32,ln=32,yn=32,or=Oe,An=Qe,Un=Vt,Er=64,ht=32,st=64,Dt=32,Lt=64;v.lowlevel={crypto_core_hsalsa20:Q,crypto_stream_xor:Ae,crypto_stream:we,crypto_stream_salsa20_xor:le,crypto_stream_salsa20:be,crypto_onetimeauth:N,crypto_onetimeauth_verify:z,crypto_verify_16:D,crypto_verify_32:W,crypto_secretbox:V,crypto_secretbox_open:U,crypto_scalarmult:Re,crypto_scalarmult_base:ze,crypto_box_beforenm:Ct,crypto_box_afternm:$t,crypto_box:Xe,crypto_box_open:ct,crypto_box_keypair:_t,crypto_hash:Ge,crypto_sign:ye,crypto_sign_keypair:De,crypto_sign_open:me,crypto_secretbox_KEYBYTES:Te,crypto_secretbox_NONCEBYTES:Oe,crypto_secretbox_ZEROBYTES:Qe,crypto_secretbox_BOXZEROBYTES:Vt,crypto_scalarmult_BYTES:vt,crypto_scalarmult_SCALARBYTES:Zt,crypto_box_PUBLICKEYBYTES:dn,crypto_box_SECRETKEYBYTES:ln,crypto_box_BEFORENMBYTES:yn,crypto_box_NONCEBYTES:or,crypto_box_ZEROBYTES:An,crypto_box_BOXZEROBYTES:Un,crypto_sign_BYTES:Er,crypto_sign_PUBLICKEYBYTES:ht,crypto_sign_SECRETKEYBYTES:st,crypto_sign_SEEDBYTES:Dt,crypto_hash_BYTES:Lt,gf:T,D:_,L:He,pack25519:J,unpack25519:de,M:he,A:Y,S:Ie,Z:ce,pow2523:ut,add:zt,set25519:j,modL:se,scalarmult:qe,scalarbase:dt};function Gt(Pe,Ue){if(Pe.length!==Te)throw new Error("bad key size");if(Ue.length!==Oe)throw new Error("bad nonce size")}function xn(Pe,Ue){if(Pe.length!==dn)throw new Error("bad public key size");if(Ue.length!==ln)throw new Error("bad secret key size")}function un(){for(var Pe=0;Pe<arguments.length;Pe++)if(!(arguments[Pe]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function fn(Pe){for(var Ue=0;Ue<Pe.length;Ue++)Pe[Ue]=0}v.randomBytes=function(Pe){var Ue=new Uint8Array(Pe);return C(Ue,Pe),Ue},v.secretbox=function(Pe,Ue,Le){un(Pe,Ue,Le),Gt(Le,Ue);for(var _e=new Uint8Array(Qe+Pe.length),Ze=new Uint8Array(_e.length),Ot=0;Ot<Pe.length;Ot++)_e[Ot+Qe]=Pe[Ot];return V(Ze,_e,_e.length,Ue,Le),Ze.subarray(Vt)},v.secretbox.open=function(Pe,Ue,Le){un(Pe,Ue,Le),Gt(Le,Ue);for(var _e=new Uint8Array(Vt+Pe.length),Ze=new Uint8Array(_e.length),Ot=0;Ot<Pe.length;Ot++)_e[Ot+Vt]=Pe[Ot];return _e.length<32||U(Ze,_e,_e.length,Ue,Le)!==0?null:Ze.subarray(Qe)},v.secretbox.keyLength=Te,v.secretbox.nonceLength=Oe,v.secretbox.overheadLength=Vt,v.scalarMult=function(Pe,Ue){if(un(Pe,Ue),Pe.length!==Zt)throw new Error("bad n size");if(Ue.length!==vt)throw new Error("bad p size");var Le=new Uint8Array(vt);return Re(Le,Pe,Ue),Le},v.scalarMult.base=function(Pe){if(un(Pe),Pe.length!==Zt)throw new Error("bad n size");var Ue=new Uint8Array(vt);return ze(Ue,Pe),Ue},v.scalarMult.scalarLength=Zt,v.scalarMult.groupElementLength=vt,v.box=function(Pe,Ue,Le,_e){var Ze=v.box.before(Le,_e);return v.secretbox(Pe,Ue,Ze)},v.box.before=function(Pe,Ue){un(Pe,Ue),xn(Pe,Ue);var Le=new Uint8Array(yn);return Ct(Le,Pe,Ue),Le},v.box.after=v.secretbox,v.box.open=function(Pe,Ue,Le,_e){var Ze=v.box.before(Le,_e);return v.secretbox.open(Pe,Ue,Ze)},v.box.open.after=v.secretbox.open,v.box.keyPair=function(){var Pe=new Uint8Array(dn),Ue=new Uint8Array(ln);return _t(Pe,Ue),{publicKey:Pe,secretKey:Ue}},v.box.keyPair.fromSecretKey=function(Pe){if(un(Pe),Pe.length!==ln)throw new Error("bad secret key size");var Ue=new Uint8Array(dn);return ze(Ue,Pe),{publicKey:Ue,secretKey:new Uint8Array(Pe)}},v.box.publicKeyLength=dn,v.box.secretKeyLength=ln,v.box.sharedKeyLength=yn,v.box.nonceLength=or,v.box.overheadLength=v.secretbox.overheadLength,v.sign=function(Pe,Ue){if(un(Pe,Ue),Ue.length!==st)throw new Error("bad secret key size");var Le=new Uint8Array(Er+Pe.length);return ye(Le,Pe,Pe.length,Ue),Le},v.sign.open=function(Pe,Ue){if(un(Pe,Ue),Ue.length!==ht)throw new Error("bad public key size");var Le=new Uint8Array(Pe.length),_e=me(Le,Pe,Pe.length,Ue);if(_e<0)return null;for(var Ze=new Uint8Array(_e),Ot=0;Ot<Ze.length;Ot++)Ze[Ot]=Le[Ot];return Ze},v.sign.detached=function(Pe,Ue){for(var Le=v.sign(Pe,Ue),_e=new Uint8Array(Er),Ze=0;Ze<_e.length;Ze++)_e[Ze]=Le[Ze];return _e},v.sign.detached.verify=function(Pe,Ue,Le){if(un(Pe,Ue,Le),Ue.length!==Er)throw new Error("bad signature size");if(Le.length!==ht)throw new Error("bad public key size");var _e=new Uint8Array(Er+Pe.length),Ze=new Uint8Array(Er+Pe.length),Ot;for(Ot=0;Ot<Er;Ot++)_e[Ot]=Ue[Ot];for(Ot=0;Ot<Pe.length;Ot++)_e[Ot+Er]=Pe[Ot];return me(Ze,_e,_e.length,Le)>=0},v.sign.keyPair=function(){var Pe=new Uint8Array(ht),Ue=new Uint8Array(st);return De(Pe,Ue),{publicKey:Pe,secretKey:Ue}},v.sign.keyPair.fromSecretKey=function(Pe){if(un(Pe),Pe.length!==st)throw new Error("bad secret key size");for(var Ue=new Uint8Array(ht),Le=0;Le<Ue.length;Le++)Ue[Le]=Pe[32+Le];return{publicKey:Ue,secretKey:new Uint8Array(Pe)}},v.sign.keyPair.fromSeed=function(Pe){if(un(Pe),Pe.length!==Dt)throw new Error("bad seed size");for(var Ue=new Uint8Array(ht),Le=new Uint8Array(st),_e=0;_e<32;_e++)Le[_e]=Pe[_e];return De(Ue,Le,!0),{publicKey:Ue,secretKey:Le}},v.sign.publicKeyLength=ht,v.sign.secretKeyLength=st,v.sign.seedLength=Dt,v.sign.signatureLength=Er,v.hash=function(Pe){un(Pe);var Ue=new Uint8Array(Lt);return Ge(Ue,Pe,Pe.length),Ue},v.hash.hashLength=Lt,v.verify=function(Pe,Ue){return un(Pe,Ue),Pe.length===0||Ue.length===0||Pe.length!==Ue.length?!1:L(Pe,0,Ue,0,Pe.length)===0},v.setPRNG=function(Pe){C=Pe},function(){var Pe=typeof self<"u"?self.crypto||self.msCrypto:null;if(Pe&&Pe.getRandomValues){var Ue=65536;v.setPRNG(function(Le,_e){var Ze,Ot=new Uint8Array(_e);for(Ze=0;Ze<_e;Ze+=Ue)Pe.getRandomValues(Ot.subarray(Ze,Ze+Math.min(_e-Ze,Ue)));for(Ze=0;Ze<_e;Ze++)Le[Ze]=Ot[Ze];fn(Ot)})}else Pe=x(16206),Pe&&Pe.randomBytes&&v.setPRNG(function(Le,_e){var Ze,Ot=Pe.randomBytes(_e);for(Ze=0;Ze<_e;Ze++)Le[Ze]=Ot[Ze];fn(Ot)})}()})(fe.exports?fe.exports:self.nacl=self.nacl||{})},50599:function(fe,p,x){var v=x(82911);function T(B){return B.name||B.toString().match(/function (.*?)\s*\(/)[1]}function C(B){return v.Nil(B)?"":T(B.constructor)}function I(B){return v.Function(B)?"":v.String(B)?JSON.stringify(B):B&&v.Object(B)?"":B}function m(B,O){Error.captureStackTrace&&Error.captureStackTrace(B,O)}function b(B){return v.Function(B)?B.toJSON?B.toJSON():T(B):v.Array(B)?"Array":B&&v.Object(B)?"Object":B!==void 0?B:""}function g(B,O,L){var D=I(O);return"Expected "+b(B)+", got"+(L!==""?" "+L:"")+(D!==""?" "+D:"")}function w(B,O,L){L=L||C(O),this.message=g(B,O,L),m(this,w),this.__type=B,this.__value=O,this.__valueTypeName=L}w.prototype=Object.create(Error.prototype),w.prototype.constructor=w;function _(B,O,L,D,W){var H='" of type ';return O==="key"&&(H='" with key type '),g('property "'+b(L)+H+b(B),D,W)}function A(B,O,L,D,W){B?(W=W||C(D),this.message=_(B,L,O,D,W)):this.message='Unexpected property "'+O+'"',m(this,w),this.__label=L,this.__property=O,this.__type=B,this.__value=D,this.__valueTypeName=W}A.prototype=Object.create(Error.prototype),A.prototype.constructor=w;function S(B,O){return new w(B,{},O)}function k(B,O,L){return B instanceof A?(O=O+"."+B.__property,B=new A(B.__type,O,B.__label,B.__value,B.__valueTypeName)):B instanceof w&&(B=new A(B.__type,O,L,B.__value,B.__valueTypeName)),m(B),B}fe.exports={TfTypeError:w,TfPropertyTypeError:A,tfCustomError:S,tfSubError:k,tfJSON:b,getValueTypeName:C}},13252:function(fe,p,x){var v=x(36533).Buffer,T=x(82911),C=x(50599);function I(be){return v.isBuffer(be)}function m(be){return typeof be=="string"&&/^([0-9a-f]{2})+$/i.test(be)}function b(be,we){var Ae=be.toJSON();function re(N){if(!be(N))return!1;if(N.length===we)return!0;throw C.tfCustomError(Ae+"(Length: "+we+")",Ae+"(Length: "+N.length+")")}return re.toJSON=function(){return Ae},re}var g=b.bind(null,T.Array),w=b.bind(null,I),_=b.bind(null,m),A=b.bind(null,T.String);function S(be,we,Ae){Ae=Ae||T.Number;function re(N,z){return Ae(N,z)&&N>be&&N<we}return re.toJSON=function(){return`${Ae.toJSON()} between [${be}, ${we}]`},re}var k=Math.pow(2,53)-1;function B(be){return typeof be=="number"&&isFinite(be)}function O(be){return be<<24>>24===be}function L(be){return be<<16>>16===be}function D(be){return(be|0)===be}function W(be){return typeof be=="number"&&be>=-k&&be<=k&&Math.floor(be)===be}function H(be){return(be&255)===be}function G(be){return(be&65535)===be}function Z(be){return be>>>0===be}function Q(be){return typeof be=="number"&&be>=0&&be<=k&&Math.floor(be)===be}var ie={ArrayN:g,Buffer:I,BufferN:w,Finite:B,Hex:m,HexN:_,Int8:O,Int16:L,Int32:D,Int53:W,Range:S,StringN:A,UInt8:H,UInt16:G,UInt32:Z,UInt53:Q};for(var le in ie)ie[le].toJSON=function(be){return be}.bind(null,le);fe.exports=ie},41042:function(fe,p,x){var v=x(50599),T=x(82911),C=v.tfJSON,I=v.TfTypeError,m=v.TfPropertyTypeError,b=v.tfSubError,g=v.getValueTypeName,w={arrayOf:function(O,L){O=_(O),L=L||{};function D(W,H){return!T.Array(W)||T.Nil(W)||L.minLength!==void 0&&W.length<L.minLength||L.maxLength!==void 0&&W.length>L.maxLength||L.length!==void 0&&W.length!==L.length?!1:W.every(function(G,Z){try{return A(O,G,H)}catch(Q){throw b(Q,Z)}})}return D.toJSON=function(){var W="["+C(O)+"]";return L.length!==void 0?W+="{"+L.length+"}":(L.minLength!==void 0||L.maxLength!==void 0)&&(W+="{"+(L.minLength===void 0?0:L.minLength)+","+(L.maxLength===void 0?1/0:L.maxLength)+"}"),W},D},maybe:function B(O){O=_(O);function L(D,W){return T.Nil(D)||O(D,W,B)}return L.toJSON=function(){return"?"+C(O)},L},map:function(O,L){O=_(O),L&&(L=_(L));function D(W,H){if(!T.Object(W)||T.Nil(W))return!1;for(var G in W){try{L&&A(L,G,H)}catch(Q){throw b(Q,G,"key")}try{var Z=W[G];A(O,Z,H)}catch(Q){throw b(Q,G)}}return!0}return L?D.toJSON=function(){return"{"+C(L)+": "+C(O)+"}"}:D.toJSON=function(){return"{"+C(O)+"}"},D},object:function(O){var L={};for(var D in O)L[D]=_(O[D]);function W(H,G){if(!T.Object(H)||T.Nil(H))return!1;var Z;try{for(Z in L){var Q=L[Z],ie=H[Z];A(Q,ie,G)}}catch(le){throw b(le,Z)}if(G){for(Z in H)if(!L[Z])throw new m(void 0,Z)}return!0}return W.toJSON=function(){return C(L)},W},anyOf:function(){var O=[].slice.call(arguments).map(_);function L(D,W){return O.some(function(H){try{return A(H,D,W)}catch{return!1}})}return L.toJSON=function(){return O.map(C).join("|")},L},allOf:function(){var O=[].slice.call(arguments).map(_);function L(D,W){return O.every(function(H){try{return A(H,D,W)}catch{return!1}})}return L.toJSON=function(){return O.map(C).join(" & ")},L},quacksLike:function(O){function L(D){return O===g(D)}return L.toJSON=function(){return O},L},tuple:function(){var O=[].slice.call(arguments).map(_);function L(D,W){return T.Nil(D)||T.Nil(D.length)||W&&D.length!==O.length?!1:O.every(function(H,G){try{return A(H,D[G],W)}catch(Z){throw b(Z,G)}})}return L.toJSON=function(){return"("+O.map(C).join(", ")+")"},L},value:function(O){function L(D){return D===O}return L.toJSON=function(){return O},L}};w.oneOf=w.anyOf;function _(B){if(T.String(B))return B[0]==="?"?w.maybe(B.slice(1)):T[B]||w.quacksLike(B);if(B&&T.Object(B)){if(T.Array(B)){if(B.length!==1)throw new TypeError("Expected compile() parameter of type Array of length 1");return w.arrayOf(B[0])}return w.object(B)}else if(T.Function(B))return B;return w.value(B)}function A(B,O,L,D){if(T.Function(B)){if(B(O,L))return!0;throw new I(D||B,O)}return A(_(B),O,L)}for(var S in T)A[S]=T[S];for(S in w)A[S]=w[S];var k=x(13252);for(S in k)A[S]=k[S];A.compile=_,A.TfTypeError=I,A.TfPropertyTypeError=m,fe.exports=A},82911:function(fe){var p={Array:function(v){return v!=null&&v.constructor===Array},Boolean:function(v){return typeof v=="boolean"},Function:function(v){return typeof v=="function"},Nil:function(v){return v==null},Number:function(v){return typeof v=="number"},Object:function(v){return typeof v=="object"},String:function(v){return typeof v=="string"},"":function(){return!0}};p.Null=p.Nil;for(var x in p)p[x].toJSON=function(v){return v}.bind(null,x);fe.exports=p},91947:function(fe,p,x){fe.exports=v;function v(C,I){if(T("noDeprecation"))return C;var m=!1;function b(){if(!m){if(T("throwDeprecation"))throw new Error(I);T("traceDeprecation")?console.trace(I):console.warn(I),m=!0}return C.apply(this,arguments)}return b}function T(C){try{if(!x.g.localStorage)return!1}catch{return!1}var I=x.g.localStorage[C];return I==null?!1:String(I).toLowerCase()==="true"}},56640:function(fe){fe.exports=function(x){return x&&typeof x=="object"&&typeof x.copy=="function"&&typeof x.fill=="function"&&typeof x.readUInt8=="function"}},90515:function(fe,p,x){"use strict";var v=x(5117),T=x(94204),C=x(1728),I=x(40006);function m(Ge){return Ge.call.bind(Ge)}var b=typeof BigInt<"u",g=typeof Symbol<"u",w=m(Object.prototype.toString),_=m(Number.prototype.valueOf),A=m(String.prototype.valueOf),S=m(Boolean.prototype.valueOf);if(b)var k=m(BigInt.prototype.valueOf);if(g)var B=m(Symbol.prototype.valueOf);function O(Ge,zt){if(typeof Ge!="object")return!1;try{return zt(Ge),!0}catch{return!1}}p.isArgumentsObject=v,p.isGeneratorFunction=T,p.isTypedArray=I;function L(Ge){return typeof Promise<"u"&&Ge instanceof Promise||Ge!==null&&typeof Ge=="object"&&typeof Ge.then=="function"&&typeof Ge.catch=="function"}p.isPromise=L;function D(Ge){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ge):I(Ge)||Y(Ge)}p.isArrayBufferView=D;function W(Ge){return C(Ge)==="Uint8Array"}p.isUint8Array=W;function H(Ge){return C(Ge)==="Uint8ClampedArray"}p.isUint8ClampedArray=H;function G(Ge){return C(Ge)==="Uint16Array"}p.isUint16Array=G;function Z(Ge){return C(Ge)==="Uint32Array"}p.isUint32Array=Z;function Q(Ge){return C(Ge)==="Int8Array"}p.isInt8Array=Q;function ie(Ge){return C(Ge)==="Int16Array"}p.isInt16Array=ie;function le(Ge){return C(Ge)==="Int32Array"}p.isInt32Array=le;function be(Ge){return C(Ge)==="Float32Array"}p.isFloat32Array=be;function we(Ge){return C(Ge)==="Float64Array"}p.isFloat64Array=we;function Ae(Ge){return C(Ge)==="BigInt64Array"}p.isBigInt64Array=Ae;function re(Ge){return C(Ge)==="BigUint64Array"}p.isBigUint64Array=re;function N(Ge){return w(Ge)==="[object Map]"}N.working=typeof Map<"u"&&N(new Map);function z(Ge){return typeof Map>"u"?!1:N.working?N(Ge):Ge instanceof Map}p.isMap=z;function V(Ge){return w(Ge)==="[object Set]"}V.working=typeof Set<"u"&&V(new Set);function U(Ge){return typeof Set>"u"?!1:V.working?V(Ge):Ge instanceof Set}p.isSet=U;function j(Ge){return w(Ge)==="[object WeakMap]"}j.working=typeof WeakMap<"u"&&j(new WeakMap);function $(Ge){return typeof WeakMap>"u"?!1:j.working?j(Ge):Ge instanceof WeakMap}p.isWeakMap=$;function ee(Ge){return w(Ge)==="[object WeakSet]"}ee.working=typeof WeakSet<"u"&&ee(new WeakSet);function J(Ge){return ee(Ge)}p.isWeakSet=J;function F(Ge){return w(Ge)==="[object ArrayBuffer]"}F.working=typeof ArrayBuffer<"u"&&F(new ArrayBuffer);function X(Ge){return typeof ArrayBuffer>"u"?!1:F.working?F(Ge):Ge instanceof ArrayBuffer}p.isArrayBuffer=X;function de(Ge){return w(Ge)==="[object DataView]"}de.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&de(new DataView(new ArrayBuffer(1),0,1));function Y(Ge){return typeof DataView>"u"?!1:de.working?de(Ge):Ge instanceof DataView}p.isDataView=Y;var ce=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function he(Ge){return w(Ge)==="[object SharedArrayBuffer]"}function Ie(Ge){return typeof ce>"u"?!1:(typeof he.working>"u"&&(he.working=he(new ce)),he.working?he(Ge):Ge instanceof ce)}p.isSharedArrayBuffer=Ie;function ke(Ge){return w(Ge)==="[object AsyncFunction]"}p.isAsyncFunction=ke;function ut(Ge){return w(Ge)==="[object Map Iterator]"}p.isMapIterator=ut;function Re(Ge){return w(Ge)==="[object Set Iterator]"}p.isSetIterator=Re;function ze(Ge){return w(Ge)==="[object Generator]"}p.isGeneratorObject=ze;function _t(Ge){return w(Ge)==="[object WebAssembly.Module]"}p.isWebAssemblyCompiledModule=_t;function Ct(Ge){return O(Ge,_)}p.isNumberObject=Ct;function $t(Ge){return O(Ge,A)}p.isStringObject=$t;function ft(Ge){return O(Ge,S)}p.isBooleanObject=ft;function Xe(Ge){return b&&O(Ge,k)}p.isBigIntObject=Xe;function ct(Ge){return g&&O(Ge,B)}p.isSymbolObject=ct;function wt(Ge){return Ct(Ge)||$t(Ge)||ft(Ge)||Xe(Ge)||ct(Ge)}p.isBoxedPrimitive=wt;function Rt(Ge){return typeof Uint8Array<"u"&&(X(Ge)||Ie(Ge))}p.isAnyArrayBuffer=Rt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Ge){Object.defineProperty(p,Ge,{enumerable:!1,value:function(){throw new Error(Ge+" is not supported in userland")}})})},1344:function(fe,p,x){var v=x(85409),T=Object.getOwnPropertyDescriptors||function(ce){for(var he=Object.keys(ce),Ie={},ke=0;ke<he.length;ke++)Ie[he[ke]]=Object.getOwnPropertyDescriptor(ce,he[ke]);return Ie},C=/%[sdj%]/g;p.format=function(Y){if(!ie(Y)){for(var ce=[],he=0;he<arguments.length;he++)ce.push(g(arguments[he]));return ce.join(" ")}for(var he=1,Ie=arguments,ke=Ie.length,ut=String(Y).replace(C,function(ze){if(ze==="%%")return"%";if(he>=ke)return ze;switch(ze){case"%s":return String(Ie[he++]);case"%d":return Number(Ie[he++]);case"%j":try{return JSON.stringify(Ie[he++])}catch{return"[Circular]"}default:return ze}}),Re=Ie[he];he<ke;Re=Ie[++he])G(Re)||!Ae(Re)?ut+=" "+Re:ut+=" "+g(Re);return ut},p.deprecate=function(Y,ce){if(typeof v<"u"&&v.noDeprecation===!0)return Y;if(typeof v>"u")return function(){return p.deprecate(Y,ce).apply(this,arguments)};var he=!1;function Ie(){if(!he){if(v.throwDeprecation)throw new Error(ce);v.traceDeprecation?console.trace(ce):console.error(ce),he=!0}return Y.apply(this,arguments)}return Ie};var I={},m=/^$/;if("{}".NODE_DEBUG){var b="{}".NODE_DEBUG;b=b.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),m=new RegExp("^"+b+"$","i")}p.debuglog=function(Y){if(Y=Y.toUpperCase(),!I[Y])if(m.test(Y)){var ce=v.pid;I[Y]=function(){var he=p.format.apply(p,arguments);console.error("%s %d: %s",Y,ce,he)}}else I[Y]=function(){};return I[Y]};function g(Y,ce){var he={seen:[],stylize:_};return arguments.length>=3&&(he.depth=arguments[2]),arguments.length>=4&&(he.colors=arguments[3]),H(ce)?he.showHidden=ce:ce&&p._extend(he,ce),be(he.showHidden)&&(he.showHidden=!1),be(he.depth)&&(he.depth=2),be(he.colors)&&(he.colors=!1),be(he.customInspect)&&(he.customInspect=!0),he.colors&&(he.stylize=w),S(he,Y,he.depth)}p.inspect=g,g.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},g.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function w(Y,ce){var he=g.styles[ce];return he?"\x1B["+g.colors[he][0]+"m"+Y+"\x1B["+g.colors[he][1]+"m":Y}function _(Y,ce){return Y}function A(Y){var ce={};return Y.forEach(function(he,Ie){ce[he]=!0}),ce}function S(Y,ce,he){if(Y.customInspect&&ce&&z(ce.inspect)&&ce.inspect!==p.inspect&&!(ce.constructor&&ce.constructor.prototype===ce)){var Ie=ce.inspect(he,Y);return ie(Ie)||(Ie=S(Y,Ie,he)),Ie}var ke=k(Y,ce);if(ke)return ke;var ut=Object.keys(ce),Re=A(ut);if(Y.showHidden&&(ut=Object.getOwnPropertyNames(ce)),N(ce)&&(ut.indexOf("message")>=0||ut.indexOf("description")>=0))return B(ce);if(ut.length===0){if(z(ce)){var ze=ce.name?": "+ce.name:"";return Y.stylize("[Function"+ze+"]","special")}if(we(ce))return Y.stylize(RegExp.prototype.toString.call(ce),"regexp");if(re(ce))return Y.stylize(Date.prototype.toString.call(ce),"date");if(N(ce))return B(ce)}var _t="",Ct=!1,$t=["{","}"];if(W(ce)&&(Ct=!0,$t=["[","]"]),z(ce)){var ft=ce.name?": "+ce.name:"";_t=" [Function"+ft+"]"}if(we(ce)&&(_t=" "+RegExp.prototype.toString.call(ce)),re(ce)&&(_t=" "+Date.prototype.toUTCString.call(ce)),N(ce)&&(_t=" "+B(ce)),ut.length===0&&(!Ct||ce.length==0))return $t[0]+_t+$t[1];if(he<0)return we(ce)?Y.stylize(RegExp.prototype.toString.call(ce),"regexp"):Y.stylize("[Object]","special");Y.seen.push(ce);var Xe;return Ct?Xe=O(Y,ce,he,Re,ut):Xe=ut.map(function(ct){return L(Y,ce,he,Re,ct,Ct)}),Y.seen.pop(),D(Xe,_t,$t)}function k(Y,ce){if(be(ce))return Y.stylize("undefined","undefined");if(ie(ce)){var he="'"+JSON.stringify(ce).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Y.stylize(he,"string")}if(Q(ce))return Y.stylize(""+ce,"number");if(H(ce))return Y.stylize(""+ce,"boolean");if(G(ce))return Y.stylize("null","null")}function B(Y){return"["+Error.prototype.toString.call(Y)+"]"}function O(Y,ce,he,Ie,ke){for(var ut=[],Re=0,ze=ce.length;Re<ze;++Re)J(ce,String(Re))?ut.push(L(Y,ce,he,Ie,String(Re),!0)):ut.push("");return ke.forEach(function(_t){_t.match(/^\d+$/)||ut.push(L(Y,ce,he,Ie,_t,!0))}),ut}function L(Y,ce,he,Ie,ke,ut){var Re,ze,_t;if(_t=Object.getOwnPropertyDescriptor(ce,ke)||{value:ce[ke]},_t.get?_t.set?ze=Y.stylize("[Getter/Setter]","special"):ze=Y.stylize("[Getter]","special"):_t.set&&(ze=Y.stylize("[Setter]","special")),J(Ie,ke)||(Re="["+ke+"]"),ze||(Y.seen.indexOf(_t.value)<0?(G(he)?ze=S(Y,_t.value,null):ze=S(Y,_t.value,he-1),ze.indexOf(`
|
||
`)>-1&&(ut?ze=ze.split(`
|
||
`).map(function(Ct){return" "+Ct}).join(`
|
||
`).slice(2):ze=`
|
||
`+ze.split(`
|
||
`).map(function(Ct){return" "+Ct}).join(`
|
||
`))):ze=Y.stylize("[Circular]","special")),be(Re)){if(ut&&ke.match(/^\d+$/))return ze;Re=JSON.stringify(""+ke),Re.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Re=Re.slice(1,-1),Re=Y.stylize(Re,"name")):(Re=Re.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Re=Y.stylize(Re,"string"))}return Re+": "+ze}function D(Y,ce,he){var Ie=0,ke=Y.reduce(function(ut,Re){return Ie++,Re.indexOf(`
|
||
`)>=0&&Ie++,ut+Re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ke>60?he[0]+(ce===""?"":ce+`
|
||
`)+" "+Y.join(`,
|
||
`)+" "+he[1]:he[0]+ce+" "+Y.join(", ")+" "+he[1]}p.types=x(90515);function W(Y){return Array.isArray(Y)}p.isArray=W;function H(Y){return typeof Y=="boolean"}p.isBoolean=H;function G(Y){return Y===null}p.isNull=G;function Z(Y){return Y==null}p.isNullOrUndefined=Z;function Q(Y){return typeof Y=="number"}p.isNumber=Q;function ie(Y){return typeof Y=="string"}p.isString=ie;function le(Y){return typeof Y=="symbol"}p.isSymbol=le;function be(Y){return Y===void 0}p.isUndefined=be;function we(Y){return Ae(Y)&&U(Y)==="[object RegExp]"}p.isRegExp=we,p.types.isRegExp=we;function Ae(Y){return typeof Y=="object"&&Y!==null}p.isObject=Ae;function re(Y){return Ae(Y)&&U(Y)==="[object Date]"}p.isDate=re,p.types.isDate=re;function N(Y){return Ae(Y)&&(U(Y)==="[object Error]"||Y instanceof Error)}p.isError=N,p.types.isNativeError=N;function z(Y){return typeof Y=="function"}p.isFunction=z;function V(Y){return Y===null||typeof Y=="boolean"||typeof Y=="number"||typeof Y=="string"||typeof Y=="symbol"||typeof Y>"u"}p.isPrimitive=V,p.isBuffer=x(56640);function U(Y){return Object.prototype.toString.call(Y)}function j(Y){return Y<10?"0"+Y.toString(10):Y.toString(10)}var $=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ee(){var Y=new Date,ce=[j(Y.getHours()),j(Y.getMinutes()),j(Y.getSeconds())].join(":");return[Y.getDate(),$[Y.getMonth()],ce].join(" ")}p.log=function(){console.log("%s - %s",ee(),p.format.apply(p,arguments))},p.inherits=x(91193),p._extend=function(Y,ce){if(!ce||!Ae(ce))return Y;for(var he=Object.keys(ce),Ie=he.length;Ie--;)Y[he[Ie]]=ce[he[Ie]];return Y};function J(Y,ce){return Object.prototype.hasOwnProperty.call(Y,ce)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;p.promisify=function(ce){if(typeof ce!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&ce[F]){var he=ce[F];if(typeof he!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(he,F,{value:he,enumerable:!1,writable:!1,configurable:!0}),he}function he(){for(var Ie,ke,ut=new Promise(function(_t,Ct){Ie=_t,ke=Ct}),Re=[],ze=0;ze<arguments.length;ze++)Re.push(arguments[ze]);Re.push(function(_t,Ct){_t?ke(_t):Ie(Ct)});try{ce.apply(this,Re)}catch(_t){ke(_t)}return ut}return Object.setPrototypeOf(he,Object.getPrototypeOf(ce)),F&&Object.defineProperty(he,F,{value:he,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(he,T(ce))},p.promisify.custom=F;function X(Y,ce){if(!Y){var he=new Error("Promise was rejected with a falsy value");he.reason=Y,Y=he}return ce(Y)}function de(Y){if(typeof Y!="function")throw new TypeError('The "original" argument must be of type Function');function ce(){for(var he=[],Ie=0;Ie<arguments.length;Ie++)he.push(arguments[Ie]);var ke=he.pop();if(typeof ke!="function")throw new TypeError("The last argument must be of type Function");var ut=this,Re=function(){return ke.apply(ut,arguments)};Y.apply(this,he).then(function(ze){v.nextTick(Re.bind(null,null,ze))},function(ze){v.nextTick(X.bind(null,ze,Re))})}return Object.setPrototypeOf(ce,Object.getPrototypeOf(Y)),Object.defineProperties(ce,T(Y)),ce}p.callbackify=de},33357:function(fe,p,x){"use strict";x.d(p,{v4:()=>k});var v,T=new Uint8Array(16);function C(){if(!v&&(v=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!v))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return v(T)}const I=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function m(B){return typeof B=="string"&&I.test(B)}const b=m;for(var g=[],w=0;w<256;++w)g.push((w+256).toString(16).substr(1));function _(B){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=(g[B[O+0]]+g[B[O+1]]+g[B[O+2]]+g[B[O+3]]+"-"+g[B[O+4]]+g[B[O+5]]+"-"+g[B[O+6]]+g[B[O+7]]+"-"+g[B[O+8]]+g[B[O+9]]+"-"+g[B[O+10]]+g[B[O+11]]+g[B[O+12]]+g[B[O+13]]+g[B[O+14]]+g[B[O+15]]).toLowerCase();if(!b(L))throw TypeError("Stringified UUID is invalid");return L}const A=_;function S(B,O,L){B=B||{};var D=B.random||(B.rng||C)();if(D[6]=D[6]&15|64,D[8]=D[8]&63|128,O){L=L||0;for(var W=0;W<16;++W)O[L+W]=D[W];return O}return A(D)}const k=S},60488:function(fe,p,x){"use strict";var v=x(56608).Buffer,T=9007199254740991;function C(g){if(g<0||g>T||g%1!==0)throw new RangeError("value out of range")}function I(g,w,_){if(C(g),w||(w=v.allocUnsafe(b(g))),!v.isBuffer(w))throw new TypeError("buffer must be a Buffer instance");return _||(_=0),g<253?(w.writeUInt8(g,_),I.bytes=1):g<=65535?(w.writeUInt8(253,_),w.writeUInt16LE(g,_+1),I.bytes=3):g<=4294967295?(w.writeUInt8(254,_),w.writeUInt32LE(g,_+1),I.bytes=5):(w.writeUInt8(255,_),w.writeUInt32LE(g>>>0,_+1),w.writeUInt32LE(g/4294967296|0,_+5),I.bytes=9),w}function m(g,w){if(!v.isBuffer(g))throw new TypeError("buffer must be a Buffer instance");w||(w=0);var _=g.readUInt8(w);if(_<253)return m.bytes=1,_;if(_===253)return m.bytes=3,g.readUInt16LE(w+1);if(_===254)return m.bytes=5,g.readUInt32LE(w+1);m.bytes=9;var A=g.readUInt32LE(w+1),S=g.readUInt32LE(w+5),k=S*4294967296+A;return C(k),k}function b(g){return C(g),g<253?1:g<=65535?3:g<=4294967295?5:9}fe.exports={encode:I,decode:m,encodingLength:b}},1728:function(fe,p,x){"use strict";var v=x(87196),T=x(79639),C=x(17695),I=x(98801),m=x(25667),b=x(14252),g=I("Object.prototype.toString"),w=x(77185)(),_=typeof globalThis>"u"?x.g:globalThis,A=T(),S=I("String.prototype.slice"),k=I("Array.prototype.indexOf",!0)||function(W,H){for(var G=0;G<W.length;G+=1)if(W[G]===H)return G;return-1},B={__proto__:null};w&&m&&b?v(A,function(D){var W=new _[D];if(Symbol.toStringTag in W&&b){var H=b(W),G=m(H,Symbol.toStringTag);if(!G&&H){var Z=b(H);G=m(Z,Symbol.toStringTag)}B["$"+D]=C(G.get)}}):v(A,function(D){var W=new _[D],H=W.slice||W.set;H&&(B["$"+D]=C(H))});var O=function(W){var H=!1;return v(B,function(G,Z){if(!H)try{"$"+G(W)===Z&&(H=S(Z,1))}catch{}}),H},L=function(W){var H=!1;return v(B,function(G,Z){if(!H)try{G(W),H=S(Z,1)}catch{}}),H};fe.exports=function(W){if(!W||typeof W!="object")return!1;if(!w){var H=S(g(W),8,-1);return k(A,H)>-1?H:H!=="Object"?!1:L(W)}return m?O(W):null}},5854:function(fe,p,x){var v=x(36533).Buffer,T=x(83295);function C(g,w){if(w!==void 0&&g[0]!==w)throw new Error("Invalid network version");if(g.length===33)return{version:g[0],privateKey:g.slice(1,33),compressed:!1};if(g.length!==34)throw new Error("Invalid WIF length");if(g[33]!==1)throw new Error("Invalid compression flag");return{version:g[0],privateKey:g.slice(1,33),compressed:!0}}function I(g,w,_){var A=new v(_?34:33);return A.writeUInt8(g,0),w.copy(A,1),_&&(A[33]=1),A}function m(g,w){return C(T.decode(g),w)}function b(g,w,_){return typeof g=="number"?T.encode(I(g,w,_)):T.encode(I(g.version,g.privateKey,g.compressed))}fe.exports={decode:m,decodeRaw:C,encode:b,encodeRaw:I}},37498:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.ZodError=p.quotelessJson=p.ZodIssueCode=void 0;const v=x(51721);p.ZodIssueCode=v.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const T=I=>JSON.stringify(I,null,2).replace(/"([^"]+)":/g,"$1:");p.quotelessJson=T;class C extends Error{get errors(){return this.issues}constructor(m){super(),this.issues=[],this.addIssue=g=>{this.issues=[...this.issues,g]},this.addIssues=(g=[])=>{this.issues=[...this.issues,...g]};const b=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,b):this.__proto__=b,this.name="ZodError",this.issues=m}format(m){const b=m||function(_){return _.message},g={_errors:[]},w=_=>{for(const A of _.issues)if(A.code==="invalid_union")A.unionErrors.map(w);else if(A.code==="invalid_return_type")w(A.returnTypeError);else if(A.code==="invalid_arguments")w(A.argumentsError);else if(A.path.length===0)g._errors.push(b(A));else{let S=g,k=0;for(;k<A.path.length;){const B=A.path[k];k===A.path.length-1?(S[B]=S[B]||{_errors:[]},S[B]._errors.push(b(A))):S[B]=S[B]||{_errors:[]},S=S[B],k++}}};return w(this),g}static assert(m){if(!(m instanceof C))throw new Error(`Not a ZodError: ${m}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,v.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(m=b=>b.message){const b={},g=[];for(const w of this.issues)w.path.length>0?(b[w.path[0]]=b[w.path[0]]||[],b[w.path[0]].push(m(w))):g.push(m(w));return{formErrors:g,fieldErrors:b}}get formErrors(){return this.flatten()}}p.ZodError=C,C.create=I=>new C(I)},88652:function(fe,p,x){"use strict";var v=this&&this.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(p,"__esModule",{value:!0}),p.getErrorMap=p.setErrorMap=p.defaultErrorMap=void 0;const T=v(x(10548));p.defaultErrorMap=T.default;let C=T.default;function I(b){C=b}p.setErrorMap=I;function m(){return C}p.getErrorMap=m},75772:function(fe,p,x){"use strict";var v=this&&this.__createBinding||(Object.create?function(C,I,m,b){b===void 0&&(b=m);var g=Object.getOwnPropertyDescriptor(I,m);(!g||("get"in g?!I.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return I[m]}}),Object.defineProperty(C,b,g)}:function(C,I,m,b){b===void 0&&(b=m),C[b]=I[m]}),T=this&&this.__exportStar||function(C,I){for(var m in C)m!=="default"&&!Object.prototype.hasOwnProperty.call(I,m)&&v(I,C,m)};Object.defineProperty(p,"__esModule",{value:!0}),T(x(88652),p),T(x(89082),p),T(x(35209),p),T(x(51721),p),T(x(51554),p),T(x(37498),p)},54439:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.errorUtil=void 0;var x;(function(v){v.errToObj=T=>typeof T=="string"?{message:T}:T||{},v.toString=T=>typeof T=="string"?T:T?.message})(x||(p.errorUtil=x={}))},89082:function(fe,p,x){"use strict";var v=this&&this.__importDefault||function(B){return B&&B.__esModule?B:{default:B}};Object.defineProperty(p,"__esModule",{value:!0}),p.isAsync=p.isValid=p.isDirty=p.isAborted=p.OK=p.DIRTY=p.INVALID=p.ParseStatus=p.addIssueToContext=p.EMPTY_PATH=p.makeIssue=void 0;const T=x(88652),C=v(x(10548)),I=B=>{const{data:O,path:L,errorMaps:D,issueData:W}=B,H=[...L,...W.path||[]],G={...W,path:H};if(W.message!==void 0)return{...W,path:H,message:W.message};let Z="";const Q=D.filter(ie=>!!ie).slice().reverse();for(const ie of Q)Z=ie(G,{data:O,defaultError:Z}).message;return{...W,path:H,message:Z}};p.makeIssue=I,p.EMPTY_PATH=[];function m(B,O){const L=(0,T.getErrorMap)(),D=(0,p.makeIssue)({issueData:O,data:B.data,path:B.path,errorMaps:[B.common.contextualErrorMap,B.schemaErrorMap,L,L===C.default?void 0:C.default].filter(W=>!!W)});B.common.issues.push(D)}p.addIssueToContext=m;class b{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(O,L){const D=[];for(const W of L){if(W.status==="aborted")return p.INVALID;W.status==="dirty"&&O.dirty(),D.push(W.value)}return{status:O.value,value:D}}static async mergeObjectAsync(O,L){const D=[];for(const W of L){const H=await W.key,G=await W.value;D.push({key:H,value:G})}return b.mergeObjectSync(O,D)}static mergeObjectSync(O,L){const D={};for(const W of L){const{key:H,value:G}=W;if(H.status==="aborted"||G.status==="aborted")return p.INVALID;H.status==="dirty"&&O.dirty(),G.status==="dirty"&&O.dirty(),H.value!=="__proto__"&&(typeof G.value<"u"||W.alwaysSet)&&(D[H.value]=G.value)}return{status:O.value,value:D}}}p.ParseStatus=b,p.INVALID=Object.freeze({status:"aborted"});const g=B=>({status:"dirty",value:B});p.DIRTY=g;const w=B=>({status:"valid",value:B});p.OK=w;const _=B=>B.status==="aborted";p.isAborted=_;const A=B=>B.status==="dirty";p.isDirty=A;const S=B=>B.status==="valid";p.isValid=S;const k=B=>typeof Promise<"u"&&B instanceof Promise;p.isAsync=k},35209:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0})},51721:function(fe,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0}),p.getParsedType=p.ZodParsedType=p.objectUtil=p.util=void 0;var x;(function(C){C.assertEqual=g=>g;function I(g){}C.assertIs=I;function m(g){throw new Error}C.assertNever=m,C.arrayToEnum=g=>{const w={};for(const _ of g)w[_]=_;return w},C.getValidEnumValues=g=>{const w=C.objectKeys(g).filter(A=>typeof g[g[A]]!="number"),_={};for(const A of w)_[A]=g[A];return C.objectValues(_)},C.objectValues=g=>C.objectKeys(g).map(function(w){return g[w]}),C.objectKeys=typeof Object.keys=="function"?g=>Object.keys(g):g=>{const w=[];for(const _ in g)Object.prototype.hasOwnProperty.call(g,_)&&w.push(_);return w},C.find=(g,w)=>{for(const _ of g)if(w(_))return _},C.isInteger=typeof Number.isInteger=="function"?g=>Number.isInteger(g):g=>typeof g=="number"&&isFinite(g)&&Math.floor(g)===g;function b(g,w=" | "){return g.map(_=>typeof _=="string"?`'${_}'`:_).join(w)}C.joinValues=b,C.jsonStringifyReplacer=(g,w)=>typeof w=="bigint"?w.toString():w})(x||(p.util=x={}));var v;(function(C){C.mergeShapes=(I,m)=>({...I,...m})})(v||(p.objectUtil=v={})),p.ZodParsedType=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const T=C=>{switch(typeof C){case"undefined":return p.ZodParsedType.undefined;case"string":return p.ZodParsedType.string;case"number":return isNaN(C)?p.ZodParsedType.nan:p.ZodParsedType.number;case"boolean":return p.ZodParsedType.boolean;case"function":return p.ZodParsedType.function;case"bigint":return p.ZodParsedType.bigint;case"symbol":return p.ZodParsedType.symbol;case"object":return Array.isArray(C)?p.ZodParsedType.array:C===null?p.ZodParsedType.null:C.then&&typeof C.then=="function"&&C.catch&&typeof C.catch=="function"?p.ZodParsedType.promise:typeof Map<"u"&&C instanceof Map?p.ZodParsedType.map:typeof Set<"u"&&C instanceof Set?p.ZodParsedType.set:typeof Date<"u"&&C instanceof Date?p.ZodParsedType.date:p.ZodParsedType.object;default:return p.ZodParsedType.unknown}};p.getParsedType=T},78211:function(fe,p,x){"use strict";var v=this&&this.__createBinding||(Object.create?function(b,g,w,_){_===void 0&&(_=w);var A=Object.getOwnPropertyDescriptor(g,w);(!A||("get"in A?!g.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return g[w]}}),Object.defineProperty(b,_,A)}:function(b,g,w,_){_===void 0&&(_=w),b[_]=g[w]}),T=this&&this.__setModuleDefault||(Object.create?function(b,g){Object.defineProperty(b,"default",{enumerable:!0,value:g})}:function(b,g){b.default=g}),C=this&&this.__importStar||function(b){if(b&&b.__esModule)return b;var g={};if(b!=null)for(var w in b)w!=="default"&&Object.prototype.hasOwnProperty.call(b,w)&&v(g,b,w);return T(g,b),g},I=this&&this.__exportStar||function(b,g){for(var w in b)w!=="default"&&!Object.prototype.hasOwnProperty.call(g,w)&&v(g,b,w)};Object.defineProperty(p,"__esModule",{value:!0}),p.z=void 0;const m=C(x(75772));p.z=m,I(x(75772),p),p.default=m},10548:function(fe,p,x){"use strict";Object.defineProperty(p,"__esModule",{value:!0});const v=x(51721),T=x(37498),C=(I,m)=>{let b;switch(I.code){case T.ZodIssueCode.invalid_type:I.received===v.ZodParsedType.undefined?b="Required":b=`Expected ${I.expected}, received ${I.received}`;break;case T.ZodIssueCode.invalid_literal:b=`Invalid literal value, expected ${JSON.stringify(I.expected,v.util.jsonStringifyReplacer)}`;break;case T.ZodIssueCode.unrecognized_keys:b=`Unrecognized key(s) in object: ${v.util.joinValues(I.keys,", ")}`;break;case T.ZodIssueCode.invalid_union:b="Invalid input";break;case T.ZodIssueCode.invalid_union_discriminator:b=`Invalid discriminator value. Expected ${v.util.joinValues(I.options)}`;break;case T.ZodIssueCode.invalid_enum_value:b=`Invalid enum value. Expected ${v.util.joinValues(I.options)}, received '${I.received}'`;break;case T.ZodIssueCode.invalid_arguments:b="Invalid function arguments";break;case T.ZodIssueCode.invalid_return_type:b="Invalid function return type";break;case T.ZodIssueCode.invalid_date:b="Invalid date";break;case T.ZodIssueCode.invalid_string:typeof I.validation=="object"?"includes"in I.validation?(b=`Invalid input: must include "${I.validation.includes}"`,typeof I.validation.position=="number"&&(b=`${b} at one or more positions greater than or equal to ${I.validation.position}`)):"startsWith"in I.validation?b=`Invalid input: must start with "${I.validation.startsWith}"`:"endsWith"in I.validation?b=`Invalid input: must end with "${I.validation.endsWith}"`:v.util.assertNever(I.validation):I.validation!=="regex"?b=`Invalid ${I.validation}`:b="Invalid";break;case T.ZodIssueCode.too_small:I.type==="array"?b=`Array must contain ${I.exact?"exactly":I.inclusive?"at least":"more than"} ${I.minimum} element(s)`:I.type==="string"?b=`String must contain ${I.exact?"exactly":I.inclusive?"at least":"over"} ${I.minimum} character(s)`:I.type==="number"?b=`Number must be ${I.exact?"exactly equal to ":I.inclusive?"greater than or equal to ":"greater than "}${I.minimum}`:I.type==="date"?b=`Date must be ${I.exact?"exactly equal to ":I.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(I.minimum))}`:b="Invalid input";break;case T.ZodIssueCode.too_big:I.type==="array"?b=`Array must contain ${I.exact?"exactly":I.inclusive?"at most":"less than"} ${I.maximum} element(s)`:I.type==="string"?b=`String must contain ${I.exact?"exactly":I.inclusive?"at most":"under"} ${I.maximum} character(s)`:I.type==="number"?b=`Number must be ${I.exact?"exactly":I.inclusive?"less than or equal to":"less than"} ${I.maximum}`:I.type==="bigint"?b=`BigInt must be ${I.exact?"exactly":I.inclusive?"less than or equal to":"less than"} ${I.maximum}`:I.type==="date"?b=`Date must be ${I.exact?"exactly":I.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(I.maximum))}`:b="Invalid input";break;case T.ZodIssueCode.custom:b="Invalid input";break;case T.ZodIssueCode.invalid_intersection_types:b="Intersection results could not be merged";break;case T.ZodIssueCode.not_multiple_of:b=`Number must be a multiple of ${I.multipleOf}`;break;case T.ZodIssueCode.not_finite:b="Number must be finite";break;default:b=m.defaultError,v.util.assertNever(I)}return{message:b}};p.default=C},51554:function(fe,p,x){"use strict";var v=this&&this.__classPrivateFieldGet||function(bt,ve,je,at){if(je==="a"&&!at)throw new TypeError("Private accessor was defined without a getter");if(typeof ve=="function"?bt!==ve||!at:!ve.has(bt))throw new TypeError("Cannot read private member from an object whose class did not declare it");return je==="m"?at:je==="a"?at.call(bt):at?at.value:ve.get(bt)},T=this&&this.__classPrivateFieldSet||function(bt,ve,je,at,Ne){if(at==="m")throw new TypeError("Private method is not writable");if(at==="a"&&!Ne)throw new TypeError("Private accessor was defined without a setter");if(typeof ve=="function"?bt!==ve||!Ne:!ve.has(bt))throw new TypeError("Cannot write private member to an object whose class did not declare it");return at==="a"?Ne.call(bt,je):Ne?Ne.value=je:ve.set(bt,je),je},C,I;Object.defineProperty(p,"__esModule",{value:!0}),p.boolean=p.bigint=p.array=p.any=p.coerce=p.ZodFirstPartyTypeKind=p.late=p.ZodSchema=p.Schema=p.custom=p.ZodReadonly=p.ZodPipeline=p.ZodBranded=p.BRAND=p.ZodNaN=p.ZodCatch=p.ZodDefault=p.ZodNullable=p.ZodOptional=p.ZodTransformer=p.ZodEffects=p.ZodPromise=p.ZodNativeEnum=p.ZodEnum=p.ZodLiteral=p.ZodLazy=p.ZodFunction=p.ZodSet=p.ZodMap=p.ZodRecord=p.ZodTuple=p.ZodIntersection=p.ZodDiscriminatedUnion=p.ZodUnion=p.ZodObject=p.ZodArray=p.ZodVoid=p.ZodNever=p.ZodUnknown=p.ZodAny=p.ZodNull=p.ZodUndefined=p.ZodSymbol=p.ZodDate=p.ZodBoolean=p.ZodBigInt=p.ZodNumber=p.ZodString=p.datetimeRegex=p.ZodType=void 0,p.NEVER=p.void=p.unknown=p.union=p.undefined=p.tuple=p.transformer=p.symbol=p.string=p.strictObject=p.set=p.record=p.promise=p.preprocess=p.pipeline=p.ostring=p.optional=p.onumber=p.oboolean=p.object=p.number=p.nullable=p.null=p.never=p.nativeEnum=p.nan=p.map=p.literal=p.lazy=p.intersection=p.instanceof=p.function=p.enum=p.effect=p.discriminatedUnion=p.date=void 0;const m=x(88652),b=x(54439),g=x(89082),w=x(51721),_=x(37498);class A{constructor(ve,je,at,Ne){this._cachedPath=[],this.parent=ve,this.data=je,this._path=at,this._key=Ne}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const S=(bt,ve)=>{if((0,g.isValid)(ve))return{success:!0,data:ve.value};if(!bt.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const je=new _.ZodError(bt.common.issues);return this._error=je,this._error}}};function k(bt){if(!bt)return{};const{errorMap:ve,invalid_type_error:je,required_error:at,description:Ne}=bt;if(ve&&(je||at))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return ve?{errorMap:ve,description:Ne}:{errorMap:(vn,mn)=>{var Nn,Dn;const{message:Gn}=bt;return vn.code==="invalid_enum_value"?{message:Gn??mn.defaultError}:typeof mn.data>"u"?{message:(Nn=Gn??at)!==null&&Nn!==void 0?Nn:mn.defaultError}:vn.code!=="invalid_type"?{message:mn.defaultError}:{message:(Dn=Gn??je)!==null&&Dn!==void 0?Dn:mn.defaultError}},description:Ne}}class B{get description(){return this._def.description}_getType(ve){return(0,w.getParsedType)(ve.data)}_getOrReturnCtx(ve,je){return je||{common:ve.parent.common,data:ve.data,parsedType:(0,w.getParsedType)(ve.data),schemaErrorMap:this._def.errorMap,path:ve.path,parent:ve.parent}}_processInputParams(ve){return{status:new g.ParseStatus,ctx:{common:ve.parent.common,data:ve.data,parsedType:(0,w.getParsedType)(ve.data),schemaErrorMap:this._def.errorMap,path:ve.path,parent:ve.parent}}}_parseSync(ve){const je=this._parse(ve);if((0,g.isAsync)(je))throw new Error("Synchronous parse encountered promise.");return je}_parseAsync(ve){const je=this._parse(ve);return Promise.resolve(je)}parse(ve,je){const at=this.safeParse(ve,je);if(at.success)return at.data;throw at.error}safeParse(ve,je){var at;const Ne={common:{issues:[],async:(at=je?.async)!==null&&at!==void 0?at:!1,contextualErrorMap:je?.errorMap},path:je?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:ve,parsedType:(0,w.getParsedType)(ve)},Et=this._parseSync({data:ve,path:Ne.path,parent:Ne});return S(Ne,Et)}"~validate"(ve){var je,at;const Ne={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:ve,parsedType:(0,w.getParsedType)(ve)};if(!this["~standard"].async)try{const Et=this._parseSync({data:ve,path:[],parent:Ne});return(0,g.isValid)(Et)?{value:Et.value}:{issues:Ne.common.issues}}catch(Et){!((at=(je=Et?.message)===null||je===void 0?void 0:je.toLowerCase())===null||at===void 0)&&at.includes("encountered")&&(this["~standard"].async=!0),Ne.common={issues:[],async:!0}}return this._parseAsync({data:ve,path:[],parent:Ne}).then(Et=>(0,g.isValid)(Et)?{value:Et.value}:{issues:Ne.common.issues})}async parseAsync(ve,je){const at=await this.safeParseAsync(ve,je);if(at.success)return at.data;throw at.error}async safeParseAsync(ve,je){const at={common:{issues:[],contextualErrorMap:je?.errorMap,async:!0},path:je?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:ve,parsedType:(0,w.getParsedType)(ve)},Ne=this._parse({data:ve,path:at.path,parent:at}),Et=await((0,g.isAsync)(Ne)?Ne:Promise.resolve(Ne));return S(at,Et)}refine(ve,je){const at=Ne=>typeof je=="string"||typeof je>"u"?{message:je}:typeof je=="function"?je(Ne):je;return this._refinement((Ne,Et)=>{const vn=ve(Ne),mn=()=>Et.addIssue({code:_.ZodIssueCode.custom,...at(Ne)});return typeof Promise<"u"&&vn instanceof Promise?vn.then(Nn=>Nn?!0:(mn(),!1)):vn?!0:(mn(),!1)})}refinement(ve,je){return this._refinement((at,Ne)=>ve(at)?!0:(Ne.addIssue(typeof je=="function"?je(at,Ne):je),!1))}_refinement(ve){return new Qe({schema:this,typeName:ht.ZodEffects,effect:{type:"refinement",refinement:ve}})}superRefine(ve){return this._refinement(ve)}constructor(ve){this.spa=this.safeParseAsync,this._def=ve,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:je=>this["~validate"](je)}}optional(){return Vt.create(this,this._def)}nullable(){return vt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xe.create(this)}promise(){return Oe.create(this,this._def)}or(ve){return Rt.create([this,ve],this._def)}and(ve){return tt.create(this,ve,this._def)}transform(ve){return new Qe({...k(this._def),schema:this,typeName:ht.ZodEffects,effect:{type:"transform",transform:ve}})}default(ve){const je=typeof ve=="function"?ve:()=>ve;return new Zt({...k(this._def),innerType:this,defaultValue:je,typeName:ht.ZodDefault})}brand(){return new yn({typeName:ht.ZodBranded,type:this,...k(this._def)})}catch(ve){const je=typeof ve=="function"?ve:()=>ve;return new dn({...k(this._def),innerType:this,catchValue:je,typeName:ht.ZodCatch})}describe(ve){const je=this.constructor;return new je({...this._def,description:ve})}pipe(ve){return or.create(this,ve)}readonly(){return An.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}p.ZodType=B,p.Schema=B,p.ZodSchema=B;const O=/^c[^\s-]{8,}$/i,L=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Z]{26}$/i,W=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,H=/^[a-z0-9_-]{21}$/i,G=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Z=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Q=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ie="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let le;const be=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,we=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ae=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,re=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,N=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,V="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",U=new RegExp(`^${V}$`);function j(bt){let ve="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return bt.precision?ve=`${ve}\\.\\d{${bt.precision}}`:bt.precision==null&&(ve=`${ve}(\\.\\d+)?`),ve}function $(bt){return new RegExp(`^${j(bt)}$`)}function ee(bt){let ve=`${V}T${j(bt)}`;const je=[];return je.push(bt.local?"Z?":"Z"),bt.offset&&je.push("([+-]\\d{2}:?\\d{2})"),ve=`${ve}(${je.join("|")})`,new RegExp(`^${ve}$`)}p.datetimeRegex=ee;function J(bt,ve){return!!((ve==="v4"||!ve)&&be.test(bt)||(ve==="v6"||!ve)&&Ae.test(bt))}function F(bt,ve){if(!G.test(bt))return!1;try{const[je]=bt.split("."),at=je.replace(/-/g,"+").replace(/_/g,"/").padEnd(je.length+(4-je.length%4)%4,"="),Ne=JSON.parse(atob(at));return!(typeof Ne!="object"||Ne===null||!Ne.typ||!Ne.alg||ve&&Ne.alg!==ve)}catch{return!1}}function X(bt,ve){return!!((ve==="v4"||!ve)&&we.test(bt)||(ve==="v6"||!ve)&&re.test(bt))}class de extends B{_parse(ve){if(this._def.coerce&&(ve.data=String(ve.data)),this._getType(ve)!==w.ZodParsedType.string){const Et=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(Et,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.string,received:Et.parsedType}),g.INVALID}const at=new g.ParseStatus;let Ne;for(const Et of this._def.checks)if(Et.kind==="min")ve.data.length<Et.value&&(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.too_small,minimum:Et.value,type:"string",inclusive:!0,exact:!1,message:Et.message}),at.dirty());else if(Et.kind==="max")ve.data.length>Et.value&&(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.too_big,maximum:Et.value,type:"string",inclusive:!0,exact:!1,message:Et.message}),at.dirty());else if(Et.kind==="length"){const vn=ve.data.length>Et.value,mn=ve.data.length<Et.value;(vn||mn)&&(Ne=this._getOrReturnCtx(ve,Ne),vn?(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.too_big,maximum:Et.value,type:"string",inclusive:!0,exact:!0,message:Et.message}):mn&&(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.too_small,minimum:Et.value,type:"string",inclusive:!0,exact:!0,message:Et.message}),at.dirty())}else if(Et.kind==="email")Q.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"email",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty());else if(Et.kind==="emoji")le||(le=new RegExp(ie,"u")),le.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"emoji",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty());else if(Et.kind==="uuid")W.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"uuid",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty());else if(Et.kind==="nanoid")H.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"nanoid",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty());else if(Et.kind==="cuid")O.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"cuid",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty());else if(Et.kind==="cuid2")L.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"cuid2",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty());else if(Et.kind==="ulid")D.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"ulid",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty());else if(Et.kind==="url")try{new URL(ve.data)}catch{Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"url",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty()}else Et.kind==="regex"?(Et.regex.lastIndex=0,Et.regex.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"regex",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty())):Et.kind==="trim"?ve.data=ve.data.trim():Et.kind==="includes"?ve.data.includes(Et.value,Et.position)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.invalid_string,validation:{includes:Et.value,position:Et.position},message:Et.message}),at.dirty()):Et.kind==="toLowerCase"?ve.data=ve.data.toLowerCase():Et.kind==="toUpperCase"?ve.data=ve.data.toUpperCase():Et.kind==="startsWith"?ve.data.startsWith(Et.value)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.invalid_string,validation:{startsWith:Et.value},message:Et.message}),at.dirty()):Et.kind==="endsWith"?ve.data.endsWith(Et.value)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.invalid_string,validation:{endsWith:Et.value},message:Et.message}),at.dirty()):Et.kind==="datetime"?ee(Et).test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.invalid_string,validation:"datetime",message:Et.message}),at.dirty()):Et.kind==="date"?U.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.invalid_string,validation:"date",message:Et.message}),at.dirty()):Et.kind==="time"?$(Et).test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.invalid_string,validation:"time",message:Et.message}),at.dirty()):Et.kind==="duration"?Z.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"duration",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty()):Et.kind==="ip"?J(ve.data,Et.version)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"ip",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty()):Et.kind==="jwt"?F(ve.data,Et.alg)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"jwt",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty()):Et.kind==="cidr"?X(ve.data,Et.version)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"cidr",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty()):Et.kind==="base64"?N.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"base64",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty()):Et.kind==="base64url"?z.test(ve.data)||(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{validation:"base64url",code:_.ZodIssueCode.invalid_string,message:Et.message}),at.dirty()):w.util.assertNever(Et);return{status:at.value,value:ve.data}}_regex(ve,je,at){return this.refinement(Ne=>ve.test(Ne),{validation:je,code:_.ZodIssueCode.invalid_string,...b.errorUtil.errToObj(at)})}_addCheck(ve){return new de({...this._def,checks:[...this._def.checks,ve]})}email(ve){return this._addCheck({kind:"email",...b.errorUtil.errToObj(ve)})}url(ve){return this._addCheck({kind:"url",...b.errorUtil.errToObj(ve)})}emoji(ve){return this._addCheck({kind:"emoji",...b.errorUtil.errToObj(ve)})}uuid(ve){return this._addCheck({kind:"uuid",...b.errorUtil.errToObj(ve)})}nanoid(ve){return this._addCheck({kind:"nanoid",...b.errorUtil.errToObj(ve)})}cuid(ve){return this._addCheck({kind:"cuid",...b.errorUtil.errToObj(ve)})}cuid2(ve){return this._addCheck({kind:"cuid2",...b.errorUtil.errToObj(ve)})}ulid(ve){return this._addCheck({kind:"ulid",...b.errorUtil.errToObj(ve)})}base64(ve){return this._addCheck({kind:"base64",...b.errorUtil.errToObj(ve)})}base64url(ve){return this._addCheck({kind:"base64url",...b.errorUtil.errToObj(ve)})}jwt(ve){return this._addCheck({kind:"jwt",...b.errorUtil.errToObj(ve)})}ip(ve){return this._addCheck({kind:"ip",...b.errorUtil.errToObj(ve)})}cidr(ve){return this._addCheck({kind:"cidr",...b.errorUtil.errToObj(ve)})}datetime(ve){var je,at;return typeof ve=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:ve}):this._addCheck({kind:"datetime",precision:typeof ve?.precision>"u"?null:ve?.precision,offset:(je=ve?.offset)!==null&&je!==void 0?je:!1,local:(at=ve?.local)!==null&&at!==void 0?at:!1,...b.errorUtil.errToObj(ve?.message)})}date(ve){return this._addCheck({kind:"date",message:ve})}time(ve){return typeof ve=="string"?this._addCheck({kind:"time",precision:null,message:ve}):this._addCheck({kind:"time",precision:typeof ve?.precision>"u"?null:ve?.precision,...b.errorUtil.errToObj(ve?.message)})}duration(ve){return this._addCheck({kind:"duration",...b.errorUtil.errToObj(ve)})}regex(ve,je){return this._addCheck({kind:"regex",regex:ve,...b.errorUtil.errToObj(je)})}includes(ve,je){return this._addCheck({kind:"includes",value:ve,position:je?.position,...b.errorUtil.errToObj(je?.message)})}startsWith(ve,je){return this._addCheck({kind:"startsWith",value:ve,...b.errorUtil.errToObj(je)})}endsWith(ve,je){return this._addCheck({kind:"endsWith",value:ve,...b.errorUtil.errToObj(je)})}min(ve,je){return this._addCheck({kind:"min",value:ve,...b.errorUtil.errToObj(je)})}max(ve,je){return this._addCheck({kind:"max",value:ve,...b.errorUtil.errToObj(je)})}length(ve,je){return this._addCheck({kind:"length",value:ve,...b.errorUtil.errToObj(je)})}nonempty(ve){return this.min(1,b.errorUtil.errToObj(ve))}trim(){return new de({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new de({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new de({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(ve=>ve.kind==="datetime")}get isDate(){return!!this._def.checks.find(ve=>ve.kind==="date")}get isTime(){return!!this._def.checks.find(ve=>ve.kind==="time")}get isDuration(){return!!this._def.checks.find(ve=>ve.kind==="duration")}get isEmail(){return!!this._def.checks.find(ve=>ve.kind==="email")}get isURL(){return!!this._def.checks.find(ve=>ve.kind==="url")}get isEmoji(){return!!this._def.checks.find(ve=>ve.kind==="emoji")}get isUUID(){return!!this._def.checks.find(ve=>ve.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(ve=>ve.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(ve=>ve.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(ve=>ve.kind==="cuid2")}get isULID(){return!!this._def.checks.find(ve=>ve.kind==="ulid")}get isIP(){return!!this._def.checks.find(ve=>ve.kind==="ip")}get isCIDR(){return!!this._def.checks.find(ve=>ve.kind==="cidr")}get isBase64(){return!!this._def.checks.find(ve=>ve.kind==="base64")}get isBase64url(){return!!this._def.checks.find(ve=>ve.kind==="base64url")}get minLength(){let ve=null;for(const je of this._def.checks)je.kind==="min"&&(ve===null||je.value>ve)&&(ve=je.value);return ve}get maxLength(){let ve=null;for(const je of this._def.checks)je.kind==="max"&&(ve===null||je.value<ve)&&(ve=je.value);return ve}}p.ZodString=de,de.create=bt=>{var ve;return new de({checks:[],typeName:ht.ZodString,coerce:(ve=bt?.coerce)!==null&&ve!==void 0?ve:!1,...k(bt)})};function Y(bt,ve){const je=(bt.toString().split(".")[1]||"").length,at=(ve.toString().split(".")[1]||"").length,Ne=je>at?je:at,Et=parseInt(bt.toFixed(Ne).replace(".","")),vn=parseInt(ve.toFixed(Ne).replace(".",""));return Et%vn/Math.pow(10,Ne)}class ce extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(ve){if(this._def.coerce&&(ve.data=Number(ve.data)),this._getType(ve)!==w.ZodParsedType.number){const Et=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(Et,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.number,received:Et.parsedType}),g.INVALID}let at;const Ne=new g.ParseStatus;for(const Et of this._def.checks)Et.kind==="int"?w.util.isInteger(ve.data)||(at=this._getOrReturnCtx(ve,at),(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:Et.message}),Ne.dirty()):Et.kind==="min"?(Et.inclusive?ve.data<Et.value:ve.data<=Et.value)&&(at=this._getOrReturnCtx(ve,at),(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.too_small,minimum:Et.value,type:"number",inclusive:Et.inclusive,exact:!1,message:Et.message}),Ne.dirty()):Et.kind==="max"?(Et.inclusive?ve.data>Et.value:ve.data>=Et.value)&&(at=this._getOrReturnCtx(ve,at),(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.too_big,maximum:Et.value,type:"number",inclusive:Et.inclusive,exact:!1,message:Et.message}),Ne.dirty()):Et.kind==="multipleOf"?Y(ve.data,Et.value)!==0&&(at=this._getOrReturnCtx(ve,at),(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.not_multiple_of,multipleOf:Et.value,message:Et.message}),Ne.dirty()):Et.kind==="finite"?Number.isFinite(ve.data)||(at=this._getOrReturnCtx(ve,at),(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.not_finite,message:Et.message}),Ne.dirty()):w.util.assertNever(Et);return{status:Ne.value,value:ve.data}}gte(ve,je){return this.setLimit("min",ve,!0,b.errorUtil.toString(je))}gt(ve,je){return this.setLimit("min",ve,!1,b.errorUtil.toString(je))}lte(ve,je){return this.setLimit("max",ve,!0,b.errorUtil.toString(je))}lt(ve,je){return this.setLimit("max",ve,!1,b.errorUtil.toString(je))}setLimit(ve,je,at,Ne){return new ce({...this._def,checks:[...this._def.checks,{kind:ve,value:je,inclusive:at,message:b.errorUtil.toString(Ne)}]})}_addCheck(ve){return new ce({...this._def,checks:[...this._def.checks,ve]})}int(ve){return this._addCheck({kind:"int",message:b.errorUtil.toString(ve)})}positive(ve){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.errorUtil.toString(ve)})}negative(ve){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.errorUtil.toString(ve)})}nonpositive(ve){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.errorUtil.toString(ve)})}nonnegative(ve){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.errorUtil.toString(ve)})}multipleOf(ve,je){return this._addCheck({kind:"multipleOf",value:ve,message:b.errorUtil.toString(je)})}finite(ve){return this._addCheck({kind:"finite",message:b.errorUtil.toString(ve)})}safe(ve){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.errorUtil.toString(ve)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.errorUtil.toString(ve)})}get minValue(){let ve=null;for(const je of this._def.checks)je.kind==="min"&&(ve===null||je.value>ve)&&(ve=je.value);return ve}get maxValue(){let ve=null;for(const je of this._def.checks)je.kind==="max"&&(ve===null||je.value<ve)&&(ve=je.value);return ve}get isInt(){return!!this._def.checks.find(ve=>ve.kind==="int"||ve.kind==="multipleOf"&&w.util.isInteger(ve.value))}get isFinite(){let ve=null,je=null;for(const at of this._def.checks){if(at.kind==="finite"||at.kind==="int"||at.kind==="multipleOf")return!0;at.kind==="min"?(je===null||at.value>je)&&(je=at.value):at.kind==="max"&&(ve===null||at.value<ve)&&(ve=at.value)}return Number.isFinite(je)&&Number.isFinite(ve)}}p.ZodNumber=ce,ce.create=bt=>new ce({checks:[],typeName:ht.ZodNumber,coerce:bt?.coerce||!1,...k(bt)});class he extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(ve){if(this._def.coerce)try{ve.data=BigInt(ve.data)}catch{return this._getInvalidInput(ve)}if(this._getType(ve)!==w.ZodParsedType.bigint)return this._getInvalidInput(ve);let at;const Ne=new g.ParseStatus;for(const Et of this._def.checks)Et.kind==="min"?(Et.inclusive?ve.data<Et.value:ve.data<=Et.value)&&(at=this._getOrReturnCtx(ve,at),(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.too_small,type:"bigint",minimum:Et.value,inclusive:Et.inclusive,message:Et.message}),Ne.dirty()):Et.kind==="max"?(Et.inclusive?ve.data>Et.value:ve.data>=Et.value)&&(at=this._getOrReturnCtx(ve,at),(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.too_big,type:"bigint",maximum:Et.value,inclusive:Et.inclusive,message:Et.message}),Ne.dirty()):Et.kind==="multipleOf"?ve.data%Et.value!==BigInt(0)&&(at=this._getOrReturnCtx(ve,at),(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.not_multiple_of,multipleOf:Et.value,message:Et.message}),Ne.dirty()):w.util.assertNever(Et);return{status:Ne.value,value:ve.data}}_getInvalidInput(ve){const je=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(je,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.bigint,received:je.parsedType}),g.INVALID}gte(ve,je){return this.setLimit("min",ve,!0,b.errorUtil.toString(je))}gt(ve,je){return this.setLimit("min",ve,!1,b.errorUtil.toString(je))}lte(ve,je){return this.setLimit("max",ve,!0,b.errorUtil.toString(je))}lt(ve,je){return this.setLimit("max",ve,!1,b.errorUtil.toString(je))}setLimit(ve,je,at,Ne){return new he({...this._def,checks:[...this._def.checks,{kind:ve,value:je,inclusive:at,message:b.errorUtil.toString(Ne)}]})}_addCheck(ve){return new he({...this._def,checks:[...this._def.checks,ve]})}positive(ve){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.errorUtil.toString(ve)})}negative(ve){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.errorUtil.toString(ve)})}nonpositive(ve){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.errorUtil.toString(ve)})}nonnegative(ve){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.errorUtil.toString(ve)})}multipleOf(ve,je){return this._addCheck({kind:"multipleOf",value:ve,message:b.errorUtil.toString(je)})}get minValue(){let ve=null;for(const je of this._def.checks)je.kind==="min"&&(ve===null||je.value>ve)&&(ve=je.value);return ve}get maxValue(){let ve=null;for(const je of this._def.checks)je.kind==="max"&&(ve===null||je.value<ve)&&(ve=je.value);return ve}}p.ZodBigInt=he,he.create=bt=>{var ve;return new he({checks:[],typeName:ht.ZodBigInt,coerce:(ve=bt?.coerce)!==null&&ve!==void 0?ve:!1,...k(bt)})};class Ie extends B{_parse(ve){if(this._def.coerce&&(ve.data=!!ve.data),this._getType(ve)!==w.ZodParsedType.boolean){const at=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.boolean,received:at.parsedType}),g.INVALID}return(0,g.OK)(ve.data)}}p.ZodBoolean=Ie,Ie.create=bt=>new Ie({typeName:ht.ZodBoolean,coerce:bt?.coerce||!1,...k(bt)});class ke extends B{_parse(ve){if(this._def.coerce&&(ve.data=new Date(ve.data)),this._getType(ve)!==w.ZodParsedType.date){const Et=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(Et,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.date,received:Et.parsedType}),g.INVALID}if(isNaN(ve.data.getTime())){const Et=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(Et,{code:_.ZodIssueCode.invalid_date}),g.INVALID}const at=new g.ParseStatus;let Ne;for(const Et of this._def.checks)Et.kind==="min"?ve.data.getTime()<Et.value&&(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.too_small,message:Et.message,inclusive:!0,exact:!1,minimum:Et.value,type:"date"}),at.dirty()):Et.kind==="max"?ve.data.getTime()>Et.value&&(Ne=this._getOrReturnCtx(ve,Ne),(0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.too_big,message:Et.message,inclusive:!0,exact:!1,maximum:Et.value,type:"date"}),at.dirty()):w.util.assertNever(Et);return{status:at.value,value:new Date(ve.data.getTime())}}_addCheck(ve){return new ke({...this._def,checks:[...this._def.checks,ve]})}min(ve,je){return this._addCheck({kind:"min",value:ve.getTime(),message:b.errorUtil.toString(je)})}max(ve,je){return this._addCheck({kind:"max",value:ve.getTime(),message:b.errorUtil.toString(je)})}get minDate(){let ve=null;for(const je of this._def.checks)je.kind==="min"&&(ve===null||je.value>ve)&&(ve=je.value);return ve!=null?new Date(ve):null}get maxDate(){let ve=null;for(const je of this._def.checks)je.kind==="max"&&(ve===null||je.value<ve)&&(ve=je.value);return ve!=null?new Date(ve):null}}p.ZodDate=ke,ke.create=bt=>new ke({checks:[],coerce:bt?.coerce||!1,typeName:ht.ZodDate,...k(bt)});class ut extends B{_parse(ve){if(this._getType(ve)!==w.ZodParsedType.symbol){const at=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.symbol,received:at.parsedType}),g.INVALID}return(0,g.OK)(ve.data)}}p.ZodSymbol=ut,ut.create=bt=>new ut({typeName:ht.ZodSymbol,...k(bt)});class Re extends B{_parse(ve){if(this._getType(ve)!==w.ZodParsedType.undefined){const at=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.undefined,received:at.parsedType}),g.INVALID}return(0,g.OK)(ve.data)}}p.ZodUndefined=Re,Re.create=bt=>new Re({typeName:ht.ZodUndefined,...k(bt)});class ze extends B{_parse(ve){if(this._getType(ve)!==w.ZodParsedType.null){const at=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.null,received:at.parsedType}),g.INVALID}return(0,g.OK)(ve.data)}}p.ZodNull=ze,ze.create=bt=>new ze({typeName:ht.ZodNull,...k(bt)});class _t extends B{constructor(){super(...arguments),this._any=!0}_parse(ve){return(0,g.OK)(ve.data)}}p.ZodAny=_t,_t.create=bt=>new _t({typeName:ht.ZodAny,...k(bt)});class Ct extends B{constructor(){super(...arguments),this._unknown=!0}_parse(ve){return(0,g.OK)(ve.data)}}p.ZodUnknown=Ct,Ct.create=bt=>new Ct({typeName:ht.ZodUnknown,...k(bt)});class $t extends B{_parse(ve){const je=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(je,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.never,received:je.parsedType}),g.INVALID}}p.ZodNever=$t,$t.create=bt=>new $t({typeName:ht.ZodNever,...k(bt)});class ft extends B{_parse(ve){if(this._getType(ve)!==w.ZodParsedType.undefined){const at=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.void,received:at.parsedType}),g.INVALID}return(0,g.OK)(ve.data)}}p.ZodVoid=ft,ft.create=bt=>new ft({typeName:ht.ZodVoid,...k(bt)});class Xe extends B{_parse(ve){const{ctx:je,status:at}=this._processInputParams(ve),Ne=this._def;if(je.parsedType!==w.ZodParsedType.array)return(0,g.addIssueToContext)(je,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.array,received:je.parsedType}),g.INVALID;if(Ne.exactLength!==null){const vn=je.data.length>Ne.exactLength.value,mn=je.data.length<Ne.exactLength.value;(vn||mn)&&((0,g.addIssueToContext)(je,{code:vn?_.ZodIssueCode.too_big:_.ZodIssueCode.too_small,minimum:mn?Ne.exactLength.value:void 0,maximum:vn?Ne.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Ne.exactLength.message}),at.dirty())}if(Ne.minLength!==null&&je.data.length<Ne.minLength.value&&((0,g.addIssueToContext)(je,{code:_.ZodIssueCode.too_small,minimum:Ne.minLength.value,type:"array",inclusive:!0,exact:!1,message:Ne.minLength.message}),at.dirty()),Ne.maxLength!==null&&je.data.length>Ne.maxLength.value&&((0,g.addIssueToContext)(je,{code:_.ZodIssueCode.too_big,maximum:Ne.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Ne.maxLength.message}),at.dirty()),je.common.async)return Promise.all([...je.data].map((vn,mn)=>Ne.type._parseAsync(new A(je,vn,je.path,mn)))).then(vn=>g.ParseStatus.mergeArray(at,vn));const Et=[...je.data].map((vn,mn)=>Ne.type._parseSync(new A(je,vn,je.path,mn)));return g.ParseStatus.mergeArray(at,Et)}get element(){return this._def.type}min(ve,je){return new Xe({...this._def,minLength:{value:ve,message:b.errorUtil.toString(je)}})}max(ve,je){return new Xe({...this._def,maxLength:{value:ve,message:b.errorUtil.toString(je)}})}length(ve,je){return new Xe({...this._def,exactLength:{value:ve,message:b.errorUtil.toString(je)}})}nonempty(ve){return this.min(1,ve)}}p.ZodArray=Xe,Xe.create=(bt,ve)=>new Xe({type:bt,minLength:null,maxLength:null,exactLength:null,typeName:ht.ZodArray,...k(ve)});function ct(bt){if(bt instanceof wt){const ve={};for(const je in bt.shape){const at=bt.shape[je];ve[je]=Vt.create(ct(at))}return new wt({...bt._def,shape:()=>ve})}else return bt instanceof Xe?new Xe({...bt._def,type:ct(bt.element)}):bt instanceof Vt?Vt.create(ct(bt.unwrap())):bt instanceof vt?vt.create(ct(bt.unwrap())):bt instanceof qe?qe.create(bt.items.map(ve=>ct(ve))):bt}class wt extends B{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const ve=this._def.shape(),je=w.util.objectKeys(ve);return this._cached={shape:ve,keys:je}}_parse(ve){if(this._getType(ve)!==w.ZodParsedType.object){const Dn=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(Dn,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.object,received:Dn.parsedType}),g.INVALID}const{status:at,ctx:Ne}=this._processInputParams(ve),{shape:Et,keys:vn}=this._getCached(),mn=[];if(!(this._def.catchall instanceof $t&&this._def.unknownKeys==="strip"))for(const Dn in Ne.data)vn.includes(Dn)||mn.push(Dn);const Nn=[];for(const Dn of vn){const Gn=Et[Dn],$r=Ne.data[Dn];Nn.push({key:{status:"valid",value:Dn},value:Gn._parse(new A(Ne,$r,Ne.path,Dn)),alwaysSet:Dn in Ne.data})}if(this._def.catchall instanceof $t){const Dn=this._def.unknownKeys;if(Dn==="passthrough")for(const Gn of mn)Nn.push({key:{status:"valid",value:Gn},value:{status:"valid",value:Ne.data[Gn]}});else if(Dn==="strict")mn.length>0&&((0,g.addIssueToContext)(Ne,{code:_.ZodIssueCode.unrecognized_keys,keys:mn}),at.dirty());else if(Dn!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Dn=this._def.catchall;for(const Gn of mn){const $r=Ne.data[Gn];Nn.push({key:{status:"valid",value:Gn},value:Dn._parse(new A(Ne,$r,Ne.path,Gn)),alwaysSet:Gn in Ne.data})}}return Ne.common.async?Promise.resolve().then(async()=>{const Dn=[];for(const Gn of Nn){const $r=await Gn.key,Vr=await Gn.value;Dn.push({key:$r,value:Vr,alwaysSet:Gn.alwaysSet})}return Dn}).then(Dn=>g.ParseStatus.mergeObjectSync(at,Dn)):g.ParseStatus.mergeObjectSync(at,Nn)}get shape(){return this._def.shape()}strict(ve){return b.errorUtil.errToObj,new wt({...this._def,unknownKeys:"strict",...ve!==void 0?{errorMap:(je,at)=>{var Ne,Et,vn,mn;const Nn=(vn=(Et=(Ne=this._def).errorMap)===null||Et===void 0?void 0:Et.call(Ne,je,at).message)!==null&&vn!==void 0?vn:at.defaultError;return je.code==="unrecognized_keys"?{message:(mn=b.errorUtil.errToObj(ve).message)!==null&&mn!==void 0?mn:Nn}:{message:Nn}}}:{}})}strip(){return new wt({...this._def,unknownKeys:"strip"})}passthrough(){return new wt({...this._def,unknownKeys:"passthrough"})}extend(ve){return new wt({...this._def,shape:()=>({...this._def.shape(),...ve})})}merge(ve){return new wt({unknownKeys:ve._def.unknownKeys,catchall:ve._def.catchall,shape:()=>({...this._def.shape(),...ve._def.shape()}),typeName:ht.ZodObject})}setKey(ve,je){return this.augment({[ve]:je})}catchall(ve){return new wt({...this._def,catchall:ve})}pick(ve){const je={};return w.util.objectKeys(ve).forEach(at=>{ve[at]&&this.shape[at]&&(je[at]=this.shape[at])}),new wt({...this._def,shape:()=>je})}omit(ve){const je={};return w.util.objectKeys(this.shape).forEach(at=>{ve[at]||(je[at]=this.shape[at])}),new wt({...this._def,shape:()=>je})}deepPartial(){return ct(this)}partial(ve){const je={};return w.util.objectKeys(this.shape).forEach(at=>{const Ne=this.shape[at];ve&&!ve[at]?je[at]=Ne:je[at]=Ne.optional()}),new wt({...this._def,shape:()=>je})}required(ve){const je={};return w.util.objectKeys(this.shape).forEach(at=>{if(ve&&!ve[at])je[at]=this.shape[at];else{let Et=this.shape[at];for(;Et instanceof Vt;)Et=Et._def.innerType;je[at]=Et}}),new wt({...this._def,shape:()=>je})}keyof(){return Ee(w.util.objectKeys(this.shape))}}p.ZodObject=wt,wt.create=(bt,ve)=>new wt({shape:()=>bt,unknownKeys:"strip",catchall:$t.create(),typeName:ht.ZodObject,...k(ve)}),wt.strictCreate=(bt,ve)=>new wt({shape:()=>bt,unknownKeys:"strict",catchall:$t.create(),typeName:ht.ZodObject,...k(ve)}),wt.lazycreate=(bt,ve)=>new wt({shape:bt,unknownKeys:"strip",catchall:$t.create(),typeName:ht.ZodObject,...k(ve)});class Rt extends B{_parse(ve){const{ctx:je}=this._processInputParams(ve),at=this._def.options;function Ne(Et){for(const mn of Et)if(mn.result.status==="valid")return mn.result;for(const mn of Et)if(mn.result.status==="dirty")return je.common.issues.push(...mn.ctx.common.issues),mn.result;const vn=Et.map(mn=>new _.ZodError(mn.ctx.common.issues));return(0,g.addIssueToContext)(je,{code:_.ZodIssueCode.invalid_union,unionErrors:vn}),g.INVALID}if(je.common.async)return Promise.all(at.map(async Et=>{const vn={...je,common:{...je.common,issues:[]},parent:null};return{result:await Et._parseAsync({data:je.data,path:je.path,parent:vn}),ctx:vn}})).then(Ne);{let Et;const vn=[];for(const Nn of at){const Dn={...je,common:{...je.common,issues:[]},parent:null},Gn=Nn._parseSync({data:je.data,path:je.path,parent:Dn});if(Gn.status==="valid")return Gn;Gn.status==="dirty"&&!Et&&(Et={result:Gn,ctx:Dn}),Dn.common.issues.length&&vn.push(Dn.common.issues)}if(Et)return je.common.issues.push(...Et.ctx.common.issues),Et.result;const mn=vn.map(Nn=>new _.ZodError(Nn));return(0,g.addIssueToContext)(je,{code:_.ZodIssueCode.invalid_union,unionErrors:mn}),g.INVALID}}get options(){return this._def.options}}p.ZodUnion=Rt,Rt.create=(bt,ve)=>new Rt({options:bt,typeName:ht.ZodUnion,...k(ve)});const Ge=bt=>bt instanceof oe?Ge(bt.schema):bt instanceof Qe?Ge(bt.innerType()):bt instanceof ye?[bt.value]:bt instanceof me?bt.options:bt instanceof Te?w.util.objectValues(bt.enum):bt instanceof Zt?Ge(bt._def.innerType):bt instanceof Re?[void 0]:bt instanceof ze?[null]:bt instanceof Vt?[void 0,...Ge(bt.unwrap())]:bt instanceof vt?[null,...Ge(bt.unwrap())]:bt instanceof yn||bt instanceof An?Ge(bt.unwrap()):bt instanceof dn?Ge(bt._def.innerType):[];class zt extends B{_parse(ve){const{ctx:je}=this._processInputParams(ve);if(je.parsedType!==w.ZodParsedType.object)return(0,g.addIssueToContext)(je,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.object,received:je.parsedType}),g.INVALID;const at=this.discriminator,Ne=je.data[at],Et=this.optionsMap.get(Ne);return Et?je.common.async?Et._parseAsync({data:je.data,path:je.path,parent:je}):Et._parseSync({data:je.data,path:je.path,parent:je}):((0,g.addIssueToContext)(je,{code:_.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[at]}),g.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(ve,je,at){const Ne=new Map;for(const Et of je){const vn=Ge(Et.shape[ve]);if(!vn.length)throw new Error(`A discriminator value for key \`${ve}\` could not be extracted from all schema options`);for(const mn of vn){if(Ne.has(mn))throw new Error(`Discriminator property ${String(ve)} has duplicate value ${String(mn)}`);Ne.set(mn,Et)}}return new zt({typeName:ht.ZodDiscriminatedUnion,discriminator:ve,options:je,optionsMap:Ne,...k(at)})}}p.ZodDiscriminatedUnion=zt;function Ft(bt,ve){const je=(0,w.getParsedType)(bt),at=(0,w.getParsedType)(ve);if(bt===ve)return{valid:!0,data:bt};if(je===w.ZodParsedType.object&&at===w.ZodParsedType.object){const Ne=w.util.objectKeys(ve),Et=w.util.objectKeys(bt).filter(mn=>Ne.indexOf(mn)!==-1),vn={...bt,...ve};for(const mn of Et){const Nn=Ft(bt[mn],ve[mn]);if(!Nn.valid)return{valid:!1};vn[mn]=Nn.data}return{valid:!0,data:vn}}else if(je===w.ZodParsedType.array&&at===w.ZodParsedType.array){if(bt.length!==ve.length)return{valid:!1};const Ne=[];for(let Et=0;Et<bt.length;Et++){const vn=bt[Et],mn=ve[Et],Nn=Ft(vn,mn);if(!Nn.valid)return{valid:!1};Ne.push(Nn.data)}return{valid:!0,data:Ne}}else return je===w.ZodParsedType.date&&at===w.ZodParsedType.date&&+bt==+ve?{valid:!0,data:bt}:{valid:!1}}class tt extends B{_parse(ve){const{status:je,ctx:at}=this._processInputParams(ve),Ne=(Et,vn)=>{if((0,g.isAborted)(Et)||(0,g.isAborted)(vn))return g.INVALID;const mn=Ft(Et.value,vn.value);return mn.valid?(((0,g.isDirty)(Et)||(0,g.isDirty)(vn))&&je.dirty(),{status:je.value,value:mn.data}):((0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_intersection_types}),g.INVALID)};return at.common.async?Promise.all([this._def.left._parseAsync({data:at.data,path:at.path,parent:at}),this._def.right._parseAsync({data:at.data,path:at.path,parent:at})]).then(([Et,vn])=>Ne(Et,vn)):Ne(this._def.left._parseSync({data:at.data,path:at.path,parent:at}),this._def.right._parseSync({data:at.data,path:at.path,parent:at}))}}p.ZodIntersection=tt,tt.create=(bt,ve,je)=>new tt({left:bt,right:ve,typeName:ht.ZodIntersection,...k(je)});class qe extends B{_parse(ve){const{status:je,ctx:at}=this._processInputParams(ve);if(at.parsedType!==w.ZodParsedType.array)return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.array,received:at.parsedType}),g.INVALID;if(at.data.length<this._def.items.length)return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g.INVALID;!this._def.rest&&at.data.length>this._def.items.length&&((0,g.addIssueToContext)(at,{code:_.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),je.dirty());const Et=[...at.data].map((vn,mn)=>{const Nn=this._def.items[mn]||this._def.rest;return Nn?Nn._parse(new A(at,vn,at.path,mn)):null}).filter(vn=>!!vn);return at.common.async?Promise.all(Et).then(vn=>g.ParseStatus.mergeArray(je,vn)):g.ParseStatus.mergeArray(je,Et)}get items(){return this._def.items}rest(ve){return new qe({...this._def,rest:ve})}}p.ZodTuple=qe,qe.create=(bt,ve)=>{if(!Array.isArray(bt))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qe({items:bt,typeName:ht.ZodTuple,rest:null,...k(ve)})};class dt extends B{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(ve){const{status:je,ctx:at}=this._processInputParams(ve);if(at.parsedType!==w.ZodParsedType.object)return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.object,received:at.parsedType}),g.INVALID;const Ne=[],Et=this._def.keyType,vn=this._def.valueType;for(const mn in at.data)Ne.push({key:Et._parse(new A(at,mn,at.path,mn)),value:vn._parse(new A(at,at.data[mn],at.path,mn)),alwaysSet:mn in at.data});return at.common.async?g.ParseStatus.mergeObjectAsync(je,Ne):g.ParseStatus.mergeObjectSync(je,Ne)}get element(){return this._def.valueType}static create(ve,je,at){return je instanceof B?new dt({keyType:ve,valueType:je,typeName:ht.ZodRecord,...k(at)}):new dt({keyType:de.create(),valueType:ve,typeName:ht.ZodRecord,...k(je)})}}p.ZodRecord=dt;class De extends B{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(ve){const{status:je,ctx:at}=this._processInputParams(ve);if(at.parsedType!==w.ZodParsedType.map)return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.map,received:at.parsedType}),g.INVALID;const Ne=this._def.keyType,Et=this._def.valueType,vn=[...at.data.entries()].map(([mn,Nn],Dn)=>({key:Ne._parse(new A(at,mn,at.path,[Dn,"key"])),value:Et._parse(new A(at,Nn,at.path,[Dn,"value"]))}));if(at.common.async){const mn=new Map;return Promise.resolve().then(async()=>{for(const Nn of vn){const Dn=await Nn.key,Gn=await Nn.value;if(Dn.status==="aborted"||Gn.status==="aborted")return g.INVALID;(Dn.status==="dirty"||Gn.status==="dirty")&&je.dirty(),mn.set(Dn.value,Gn.value)}return{status:je.value,value:mn}})}else{const mn=new Map;for(const Nn of vn){const Dn=Nn.key,Gn=Nn.value;if(Dn.status==="aborted"||Gn.status==="aborted")return g.INVALID;(Dn.status==="dirty"||Gn.status==="dirty")&&je.dirty(),mn.set(Dn.value,Gn.value)}return{status:je.value,value:mn}}}}p.ZodMap=De,De.create=(bt,ve,je)=>new De({valueType:ve,keyType:bt,typeName:ht.ZodMap,...k(je)});class He extends B{_parse(ve){const{status:je,ctx:at}=this._processInputParams(ve);if(at.parsedType!==w.ZodParsedType.set)return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.set,received:at.parsedType}),g.INVALID;const Ne=this._def;Ne.minSize!==null&&at.data.size<Ne.minSize.value&&((0,g.addIssueToContext)(at,{code:_.ZodIssueCode.too_small,minimum:Ne.minSize.value,type:"set",inclusive:!0,exact:!1,message:Ne.minSize.message}),je.dirty()),Ne.maxSize!==null&&at.data.size>Ne.maxSize.value&&((0,g.addIssueToContext)(at,{code:_.ZodIssueCode.too_big,maximum:Ne.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Ne.maxSize.message}),je.dirty());const Et=this._def.valueType;function vn(Nn){const Dn=new Set;for(const Gn of Nn){if(Gn.status==="aborted")return g.INVALID;Gn.status==="dirty"&&je.dirty(),Dn.add(Gn.value)}return{status:je.value,value:Dn}}const mn=[...at.data.values()].map((Nn,Dn)=>Et._parse(new A(at,Nn,at.path,Dn)));return at.common.async?Promise.all(mn).then(Nn=>vn(Nn)):vn(mn)}min(ve,je){return new He({...this._def,minSize:{value:ve,message:b.errorUtil.toString(je)}})}max(ve,je){return new He({...this._def,maxSize:{value:ve,message:b.errorUtil.toString(je)}})}size(ve,je){return this.min(ve,je).max(ve,je)}nonempty(ve){return this.min(1,ve)}}p.ZodSet=He,He.create=(bt,ve)=>new He({valueType:bt,minSize:null,maxSize:null,typeName:ht.ZodSet,...k(ve)});class se extends B{constructor(){super(...arguments),this.validate=this.implement}_parse(ve){const{ctx:je}=this._processInputParams(ve);if(je.parsedType!==w.ZodParsedType.function)return(0,g.addIssueToContext)(je,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.function,received:je.parsedType}),g.INVALID;function at(mn,Nn){return(0,g.makeIssue)({data:mn,path:je.path,errorMaps:[je.common.contextualErrorMap,je.schemaErrorMap,(0,m.getErrorMap)(),m.defaultErrorMap].filter(Dn=>!!Dn),issueData:{code:_.ZodIssueCode.invalid_arguments,argumentsError:Nn}})}function Ne(mn,Nn){return(0,g.makeIssue)({data:mn,path:je.path,errorMaps:[je.common.contextualErrorMap,je.schemaErrorMap,(0,m.getErrorMap)(),m.defaultErrorMap].filter(Dn=>!!Dn),issueData:{code:_.ZodIssueCode.invalid_return_type,returnTypeError:Nn}})}const Et={errorMap:je.common.contextualErrorMap},vn=je.data;if(this._def.returns instanceof Oe){const mn=this;return(0,g.OK)(async function(...Nn){const Dn=new _.ZodError([]),Gn=await mn._def.args.parseAsync(Nn,Et).catch(vi=>{throw Dn.addIssue(at(Nn,vi)),Dn}),$r=await Reflect.apply(vn,this,Gn);return await mn._def.returns._def.type.parseAsync($r,Et).catch(vi=>{throw Dn.addIssue(Ne($r,vi)),Dn})})}else{const mn=this;return(0,g.OK)(function(...Nn){const Dn=mn._def.args.safeParse(Nn,Et);if(!Dn.success)throw new _.ZodError([at(Nn,Dn.error)]);const Gn=Reflect.apply(vn,this,Dn.data),$r=mn._def.returns.safeParse(Gn,Et);if(!$r.success)throw new _.ZodError([Ne(Gn,$r.error)]);return $r.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...ve){return new se({...this._def,args:qe.create(ve).rest(Ct.create())})}returns(ve){return new se({...this._def,returns:ve})}implement(ve){return this.parse(ve)}strictImplement(ve){return this.parse(ve)}static create(ve,je,at){return new se({args:ve||qe.create([]).rest(Ct.create()),returns:je||Ct.create(),typeName:ht.ZodFunction,...k(at)})}}p.ZodFunction=se;class oe extends B{get schema(){return this._def.getter()}_parse(ve){const{ctx:je}=this._processInputParams(ve);return this._def.getter()._parse({data:je.data,path:je.path,parent:je})}}p.ZodLazy=oe,oe.create=(bt,ve)=>new oe({getter:bt,typeName:ht.ZodLazy,...k(ve)});class ye extends B{_parse(ve){if(ve.data!==this._def.value){const je=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(je,{received:je.data,code:_.ZodIssueCode.invalid_literal,expected:this._def.value}),g.INVALID}return{status:"valid",value:ve.data}}get value(){return this._def.value}}p.ZodLiteral=ye,ye.create=(bt,ve)=>new ye({value:bt,typeName:ht.ZodLiteral,...k(ve)});function Ee(bt,ve){return new me({values:bt,typeName:ht.ZodEnum,...k(ve)})}class me extends B{constructor(){super(...arguments),C.set(this,void 0)}_parse(ve){if(typeof ve.data!="string"){const je=this._getOrReturnCtx(ve),at=this._def.values;return(0,g.addIssueToContext)(je,{expected:w.util.joinValues(at),received:je.parsedType,code:_.ZodIssueCode.invalid_type}),g.INVALID}if(v(this,C,"f")||T(this,C,new Set(this._def.values),"f"),!v(this,C,"f").has(ve.data)){const je=this._getOrReturnCtx(ve),at=this._def.values;return(0,g.addIssueToContext)(je,{received:je.data,code:_.ZodIssueCode.invalid_enum_value,options:at}),g.INVALID}return(0,g.OK)(ve.data)}get options(){return this._def.values}get enum(){const ve={};for(const je of this._def.values)ve[je]=je;return ve}get Values(){const ve={};for(const je of this._def.values)ve[je]=je;return ve}get Enum(){const ve={};for(const je of this._def.values)ve[je]=je;return ve}extract(ve,je=this._def){return me.create(ve,{...this._def,...je})}exclude(ve,je=this._def){return me.create(this.options.filter(at=>!ve.includes(at)),{...this._def,...je})}}p.ZodEnum=me,C=new WeakMap,me.create=Ee;class Te extends B{constructor(){super(...arguments),I.set(this,void 0)}_parse(ve){const je=w.util.getValidEnumValues(this._def.values),at=this._getOrReturnCtx(ve);if(at.parsedType!==w.ZodParsedType.string&&at.parsedType!==w.ZodParsedType.number){const Ne=w.util.objectValues(je);return(0,g.addIssueToContext)(at,{expected:w.util.joinValues(Ne),received:at.parsedType,code:_.ZodIssueCode.invalid_type}),g.INVALID}if(v(this,I,"f")||T(this,I,new Set(w.util.getValidEnumValues(this._def.values)),"f"),!v(this,I,"f").has(ve.data)){const Ne=w.util.objectValues(je);return(0,g.addIssueToContext)(at,{received:at.data,code:_.ZodIssueCode.invalid_enum_value,options:Ne}),g.INVALID}return(0,g.OK)(ve.data)}get enum(){return this._def.values}}p.ZodNativeEnum=Te,I=new WeakMap,Te.create=(bt,ve)=>new Te({values:bt,typeName:ht.ZodNativeEnum,...k(ve)});class Oe extends B{unwrap(){return this._def.type}_parse(ve){const{ctx:je}=this._processInputParams(ve);if(je.parsedType!==w.ZodParsedType.promise&&je.common.async===!1)return(0,g.addIssueToContext)(je,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.promise,received:je.parsedType}),g.INVALID;const at=je.parsedType===w.ZodParsedType.promise?je.data:Promise.resolve(je.data);return(0,g.OK)(at.then(Ne=>this._def.type.parseAsync(Ne,{path:je.path,errorMap:je.common.contextualErrorMap})))}}p.ZodPromise=Oe,Oe.create=(bt,ve)=>new Oe({type:bt,typeName:ht.ZodPromise,...k(ve)});class Qe extends B{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ht.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(ve){const{status:je,ctx:at}=this._processInputParams(ve),Ne=this._def.effect||null,Et={addIssue:vn=>{(0,g.addIssueToContext)(at,vn),vn.fatal?je.abort():je.dirty()},get path(){return at.path}};if(Et.addIssue=Et.addIssue.bind(Et),Ne.type==="preprocess"){const vn=Ne.transform(at.data,Et);if(at.common.async)return Promise.resolve(vn).then(async mn=>{if(je.value==="aborted")return g.INVALID;const Nn=await this._def.schema._parseAsync({data:mn,path:at.path,parent:at});return Nn.status==="aborted"?g.INVALID:Nn.status==="dirty"||je.value==="dirty"?(0,g.DIRTY)(Nn.value):Nn});{if(je.value==="aborted")return g.INVALID;const mn=this._def.schema._parseSync({data:vn,path:at.path,parent:at});return mn.status==="aborted"?g.INVALID:mn.status==="dirty"||je.value==="dirty"?(0,g.DIRTY)(mn.value):mn}}if(Ne.type==="refinement"){const vn=mn=>{const Nn=Ne.refinement(mn,Et);if(at.common.async)return Promise.resolve(Nn);if(Nn instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return mn};if(at.common.async===!1){const mn=this._def.schema._parseSync({data:at.data,path:at.path,parent:at});return mn.status==="aborted"?g.INVALID:(mn.status==="dirty"&&je.dirty(),vn(mn.value),{status:je.value,value:mn.value})}else return this._def.schema._parseAsync({data:at.data,path:at.path,parent:at}).then(mn=>mn.status==="aborted"?g.INVALID:(mn.status==="dirty"&&je.dirty(),vn(mn.value).then(()=>({status:je.value,value:mn.value}))))}if(Ne.type==="transform")if(at.common.async===!1){const vn=this._def.schema._parseSync({data:at.data,path:at.path,parent:at});if(!(0,g.isValid)(vn))return vn;const mn=Ne.transform(vn.value,Et);if(mn instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:je.value,value:mn}}else return this._def.schema._parseAsync({data:at.data,path:at.path,parent:at}).then(vn=>(0,g.isValid)(vn)?Promise.resolve(Ne.transform(vn.value,Et)).then(mn=>({status:je.value,value:mn})):vn);w.util.assertNever(Ne)}}p.ZodEffects=Qe,p.ZodTransformer=Qe,Qe.create=(bt,ve,je)=>new Qe({schema:bt,typeName:ht.ZodEffects,effect:ve,...k(je)}),Qe.createWithPreprocess=(bt,ve,je)=>new Qe({schema:ve,effect:{type:"preprocess",transform:bt},typeName:ht.ZodEffects,...k(je)});class Vt extends B{_parse(ve){return this._getType(ve)===w.ZodParsedType.undefined?(0,g.OK)(void 0):this._def.innerType._parse(ve)}unwrap(){return this._def.innerType}}p.ZodOptional=Vt,Vt.create=(bt,ve)=>new Vt({innerType:bt,typeName:ht.ZodOptional,...k(ve)});class vt extends B{_parse(ve){return this._getType(ve)===w.ZodParsedType.null?(0,g.OK)(null):this._def.innerType._parse(ve)}unwrap(){return this._def.innerType}}p.ZodNullable=vt,vt.create=(bt,ve)=>new vt({innerType:bt,typeName:ht.ZodNullable,...k(ve)});class Zt extends B{_parse(ve){const{ctx:je}=this._processInputParams(ve);let at=je.data;return je.parsedType===w.ZodParsedType.undefined&&(at=this._def.defaultValue()),this._def.innerType._parse({data:at,path:je.path,parent:je})}removeDefault(){return this._def.innerType}}p.ZodDefault=Zt,Zt.create=(bt,ve)=>new Zt({innerType:bt,typeName:ht.ZodDefault,defaultValue:typeof ve.default=="function"?ve.default:()=>ve.default,...k(ve)});class dn extends B{_parse(ve){const{ctx:je}=this._processInputParams(ve),at={...je,common:{...je.common,issues:[]}},Ne=this._def.innerType._parse({data:at.data,path:at.path,parent:{...at}});return(0,g.isAsync)(Ne)?Ne.then(Et=>({status:"valid",value:Et.status==="valid"?Et.value:this._def.catchValue({get error(){return new _.ZodError(at.common.issues)},input:at.data})})):{status:"valid",value:Ne.status==="valid"?Ne.value:this._def.catchValue({get error(){return new _.ZodError(at.common.issues)},input:at.data})}}removeCatch(){return this._def.innerType}}p.ZodCatch=dn,dn.create=(bt,ve)=>new dn({innerType:bt,typeName:ht.ZodCatch,catchValue:typeof ve.catch=="function"?ve.catch:()=>ve.catch,...k(ve)});class ln extends B{_parse(ve){if(this._getType(ve)!==w.ZodParsedType.nan){const at=this._getOrReturnCtx(ve);return(0,g.addIssueToContext)(at,{code:_.ZodIssueCode.invalid_type,expected:w.ZodParsedType.nan,received:at.parsedType}),g.INVALID}return{status:"valid",value:ve.data}}}p.ZodNaN=ln,ln.create=bt=>new ln({typeName:ht.ZodNaN,...k(bt)}),p.BRAND=Symbol("zod_brand");class yn extends B{_parse(ve){const{ctx:je}=this._processInputParams(ve),at=je.data;return this._def.type._parse({data:at,path:je.path,parent:je})}unwrap(){return this._def.type}}p.ZodBranded=yn;class or extends B{_parse(ve){const{status:je,ctx:at}=this._processInputParams(ve);if(at.common.async)return(async()=>{const Et=await this._def.in._parseAsync({data:at.data,path:at.path,parent:at});return Et.status==="aborted"?g.INVALID:Et.status==="dirty"?(je.dirty(),(0,g.DIRTY)(Et.value)):this._def.out._parseAsync({data:Et.value,path:at.path,parent:at})})();{const Ne=this._def.in._parseSync({data:at.data,path:at.path,parent:at});return Ne.status==="aborted"?g.INVALID:Ne.status==="dirty"?(je.dirty(),{status:"dirty",value:Ne.value}):this._def.out._parseSync({data:Ne.value,path:at.path,parent:at})}}static create(ve,je){return new or({in:ve,out:je,typeName:ht.ZodPipeline})}}p.ZodPipeline=or;class An extends B{_parse(ve){const je=this._def.innerType._parse(ve),at=Ne=>((0,g.isValid)(Ne)&&(Ne.value=Object.freeze(Ne.value)),Ne);return(0,g.isAsync)(je)?je.then(Ne=>at(Ne)):at(je)}unwrap(){return this._def.innerType}}p.ZodReadonly=An,An.create=(bt,ve)=>new An({innerType:bt,typeName:ht.ZodReadonly,...k(ve)});function Un(bt,ve){const je=typeof bt=="function"?bt(ve):typeof bt=="string"?{message:bt}:bt;return typeof je=="string"?{message:je}:je}function Er(bt,ve={},je){return bt?_t.create().superRefine((at,Ne)=>{var Et,vn;const mn=bt(at);if(mn instanceof Promise)return mn.then(Nn=>{var Dn,Gn;if(!Nn){const $r=Un(ve,at),Vr=(Gn=(Dn=$r.fatal)!==null&&Dn!==void 0?Dn:je)!==null&&Gn!==void 0?Gn:!0;Ne.addIssue({code:"custom",...$r,fatal:Vr})}});if(!mn){const Nn=Un(ve,at),Dn=(vn=(Et=Nn.fatal)!==null&&Et!==void 0?Et:je)!==null&&vn!==void 0?vn:!0;Ne.addIssue({code:"custom",...Nn,fatal:Dn})}}):_t.create()}p.custom=Er,p.late={object:wt.lazycreate};var ht;(function(bt){bt.ZodString="ZodString",bt.ZodNumber="ZodNumber",bt.ZodNaN="ZodNaN",bt.ZodBigInt="ZodBigInt",bt.ZodBoolean="ZodBoolean",bt.ZodDate="ZodDate",bt.ZodSymbol="ZodSymbol",bt.ZodUndefined="ZodUndefined",bt.ZodNull="ZodNull",bt.ZodAny="ZodAny",bt.ZodUnknown="ZodUnknown",bt.ZodNever="ZodNever",bt.ZodVoid="ZodVoid",bt.ZodArray="ZodArray",bt.ZodObject="ZodObject",bt.ZodUnion="ZodUnion",bt.ZodDiscriminatedUnion="ZodDiscriminatedUnion",bt.ZodIntersection="ZodIntersection",bt.ZodTuple="ZodTuple",bt.ZodRecord="ZodRecord",bt.ZodMap="ZodMap",bt.ZodSet="ZodSet",bt.ZodFunction="ZodFunction",bt.ZodLazy="ZodLazy",bt.ZodLiteral="ZodLiteral",bt.ZodEnum="ZodEnum",bt.ZodEffects="ZodEffects",bt.ZodNativeEnum="ZodNativeEnum",bt.ZodOptional="ZodOptional",bt.ZodNullable="ZodNullable",bt.ZodDefault="ZodDefault",bt.ZodCatch="ZodCatch",bt.ZodPromise="ZodPromise",bt.ZodBranded="ZodBranded",bt.ZodPipeline="ZodPipeline",bt.ZodReadonly="ZodReadonly"})(ht||(p.ZodFirstPartyTypeKind=ht={}));class st{constructor(...ve){}}const Dt=(bt,ve={message:`Input not instance of ${bt.name}`})=>Er(je=>je instanceof bt,ve);p.instanceof=Dt;const Lt=de.create;p.string=Lt;const Gt=ce.create;p.number=Gt;const xn=ln.create;p.nan=xn;const un=he.create;p.bigint=un;const fn=Ie.create;p.boolean=fn;const Pe=ke.create;p.date=Pe;const Ue=ut.create;p.symbol=Ue;const Le=Re.create;p.undefined=Le;const _e=ze.create;p.null=_e;const Ze=_t.create;p.any=Ze;const Ot=Ct.create;p.unknown=Ot;const Yt=$t.create;p.never=Yt;const Jt=ft.create;p.void=Jt;const en=Xe.create;p.array=en;const Vn=wt.create;p.object=Vn;const kn=wt.strictCreate;p.strictObject=kn;const ir=Rt.create;p.union=ir;const Hn=zt.create;p.discriminatedUnion=Hn;const tr=tt.create;p.intersection=tr;const gr=qe.create;p.tuple=gr;const br=dt.create;p.record=br;const pr=De.create;p.map=pr;const _n=He.create;p.set=_n;const Qn=se.create;p.function=Qn;const Zn=oe.create;p.lazy=Zn;const Mn=ye.create;p.literal=Mn;const Ln=me.create;p.enum=Ln;const Rn=Te.create;p.nativeEnum=Rn;const In=Oe.create;p.promise=In;const Xn=Qe.create;p.effect=Xn,p.transformer=Xn;const $n=Vt.create;p.optional=$n;const hn=vt.create;p.nullable=hn;const an=Qe.createWithPreprocess;p.preprocess=an;const Tn=or.create;p.pipeline=Tn;const Sn=()=>Lt().optional();p.ostring=Sn;const Bn=()=>Gt().optional();p.onumber=Bn;const Fn=()=>fn().optional();p.oboolean=Fn,p.coerce={string:bt=>de.create({...bt,coerce:!0}),number:bt=>ce.create({...bt,coerce:!0}),boolean:bt=>Ie.create({...bt,coerce:!0}),bigint:bt=>he.create({...bt,coerce:!0}),date:bt=>ke.create({...bt,coerce:!0})},p.NEVER=g.INVALID},91603:function(){"use strict"},36646:function(){"use strict"},65943:function(){"use strict"},53263:function(){"use strict"},26138:function(){"use strict"},20352:function(){"use strict"},49132:function(){"use strict"},42557:function(){"use strict"},69358:function(){"use strict"},16206:function(){"use strict"},79639:function(fe,p,x){"use strict";var v=x(7274),T=typeof globalThis>"u"?x.g:globalThis;fe.exports=function(){for(var I=[],m=0;m<v.length;m++)typeof T[v[m]]=="function"&&(I[I.length]=v[m]);return I}},23966:function(fe,p,x){"use strict";var v=x(85409),T=x(36533).Buffer;/*! Axios v1.8.3 Copyright (c) 2025 Matt Zabriskie and contributors */function C(Ve,Ye){return function(){return Ve.apply(Ye,arguments)}}const{toString:I}=Object.prototype,{getPrototypeOf:m}=Object,b=(Ve=>Ye=>{const St=I.call(Ye);return Ve[St]||(Ve[St]=St.slice(8,-1).toLowerCase())})(Object.create(null)),g=Ve=>(Ve=Ve.toLowerCase(),Ye=>b(Ye)===Ve),w=Ve=>Ye=>typeof Ye===Ve,{isArray:_}=Array,A=w("undefined");function S(Ve){return Ve!==null&&!A(Ve)&&Ve.constructor!==null&&!A(Ve.constructor)&&L(Ve.constructor.isBuffer)&&Ve.constructor.isBuffer(Ve)}const k=g("ArrayBuffer");function B(Ve){let Ye;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?Ye=ArrayBuffer.isView(Ve):Ye=Ve&&Ve.buffer&&k(Ve.buffer),Ye}const O=w("string"),L=w("function"),D=w("number"),W=Ve=>Ve!==null&&typeof Ve=="object",H=Ve=>Ve===!0||Ve===!1,G=Ve=>{if(b(Ve)!=="object")return!1;const Ye=m(Ve);return(Ye===null||Ye===Object.prototype||Object.getPrototypeOf(Ye)===null)&&!(Symbol.toStringTag in Ve)&&!(Symbol.iterator in Ve)},Z=g("Date"),Q=g("File"),ie=g("Blob"),le=g("FileList"),be=Ve=>W(Ve)&&L(Ve.pipe),we=Ve=>{let Ye;return Ve&&(typeof FormData=="function"&&Ve instanceof FormData||L(Ve.append)&&((Ye=b(Ve))==="formdata"||Ye==="object"&&L(Ve.toString)&&Ve.toString()==="[object FormData]"))},Ae=g("URLSearchParams"),[re,N,z,V]=["ReadableStream","Request","Response","Headers"].map(g),U=Ve=>Ve.trim?Ve.trim():Ve.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function j(Ve,Ye,{allOwnKeys:St=!1}={}){if(Ve===null||typeof Ve>"u")return;let At,qt;if(typeof Ve!="object"&&(Ve=[Ve]),_(Ve))for(At=0,qt=Ve.length;At<qt;At++)Ye.call(null,Ve[At],At,Ve);else{const cn=St?Object.getOwnPropertyNames(Ve):Object.keys(Ve),pn=cn.length;let Kn;for(At=0;At<pn;At++)Kn=cn[At],Ye.call(null,Ve[Kn],Kn,Ve)}}function $(Ve,Ye){Ye=Ye.toLowerCase();const St=Object.keys(Ve);let At=St.length,qt;for(;At-- >0;)if(qt=St[At],Ye===qt.toLowerCase())return qt;return null}const ee=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,J=Ve=>!A(Ve)&&Ve!==ee;function F(){const{caseless:Ve}=J(this)&&this||{},Ye={},St=(At,qt)=>{const cn=Ve&&$(Ye,qt)||qt;G(Ye[cn])&&G(At)?Ye[cn]=F(Ye[cn],At):G(At)?Ye[cn]=F({},At):_(At)?Ye[cn]=At.slice():Ye[cn]=At};for(let At=0,qt=arguments.length;At<qt;At++)arguments[At]&&j(arguments[At],St);return Ye}const X=(Ve,Ye,St,{allOwnKeys:At}={})=>(j(Ye,(qt,cn)=>{St&&L(qt)?Ve[cn]=C(qt,St):Ve[cn]=qt},{allOwnKeys:At}),Ve),de=Ve=>(Ve.charCodeAt(0)===65279&&(Ve=Ve.slice(1)),Ve),Y=(Ve,Ye,St,At)=>{Ve.prototype=Object.create(Ye.prototype,At),Ve.prototype.constructor=Ve,Object.defineProperty(Ve,"super",{value:Ye.prototype}),St&&Object.assign(Ve.prototype,St)},ce=(Ve,Ye,St,At)=>{let qt,cn,pn;const Kn={};if(Ye=Ye||{},Ve==null)return Ye;do{for(qt=Object.getOwnPropertyNames(Ve),cn=qt.length;cn-- >0;)pn=qt[cn],(!At||At(pn,Ve,Ye))&&!Kn[pn]&&(Ye[pn]=Ve[pn],Kn[pn]=!0);Ve=St!==!1&&m(Ve)}while(Ve&&(!St||St(Ve,Ye))&&Ve!==Object.prototype);return Ye},he=(Ve,Ye,St)=>{Ve=String(Ve),(St===void 0||St>Ve.length)&&(St=Ve.length),St-=Ye.length;const At=Ve.indexOf(Ye,St);return At!==-1&&At===St},Ie=Ve=>{if(!Ve)return null;if(_(Ve))return Ve;let Ye=Ve.length;if(!D(Ye))return null;const St=new Array(Ye);for(;Ye-- >0;)St[Ye]=Ve[Ye];return St},ke=(Ve=>Ye=>Ve&&Ye instanceof Ve)(typeof Uint8Array<"u"&&m(Uint8Array)),ut=(Ve,Ye)=>{const At=(Ve&&Ve[Symbol.iterator]).call(Ve);let qt;for(;(qt=At.next())&&!qt.done;){const cn=qt.value;Ye.call(Ve,cn[0],cn[1])}},Re=(Ve,Ye)=>{let St;const At=[];for(;(St=Ve.exec(Ye))!==null;)At.push(St);return At},ze=g("HTMLFormElement"),_t=Ve=>Ve.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(St,At,qt){return At.toUpperCase()+qt}),Ct=(({hasOwnProperty:Ve})=>(Ye,St)=>Ve.call(Ye,St))(Object.prototype),$t=g("RegExp"),ft=(Ve,Ye)=>{const St=Object.getOwnPropertyDescriptors(Ve),At={};j(St,(qt,cn)=>{let pn;(pn=Ye(qt,cn,Ve))!==!1&&(At[cn]=pn||qt)}),Object.defineProperties(Ve,At)},Xe=Ve=>{ft(Ve,(Ye,St)=>{if(L(Ve)&&["arguments","caller","callee"].indexOf(St)!==-1)return!1;const At=Ve[St];if(L(At)){if(Ye.enumerable=!1,"writable"in Ye){Ye.writable=!1;return}Ye.set||(Ye.set=()=>{throw Error("Can not rewrite read-only method '"+St+"'")})}})},ct=(Ve,Ye)=>{const St={},At=qt=>{qt.forEach(cn=>{St[cn]=!0})};return _(Ve)?At(Ve):At(String(Ve).split(Ye)),St},wt=()=>{},Rt=(Ve,Ye)=>Ve!=null&&Number.isFinite(Ve=+Ve)?Ve:Ye;function Ge(Ve){return!!(Ve&&L(Ve.append)&&Ve[Symbol.toStringTag]==="FormData"&&Ve[Symbol.iterator])}const zt=Ve=>{const Ye=new Array(10),St=(At,qt)=>{if(W(At)){if(Ye.indexOf(At)>=0)return;if(!("toJSON"in At)){Ye[qt]=At;const cn=_(At)?[]:{};return j(At,(pn,Kn)=>{const yr=St(pn,qt+1);!A(yr)&&(cn[Kn]=yr)}),Ye[qt]=void 0,cn}}return At};return St(Ve,0)},Ft=g("AsyncFunction"),tt=Ve=>Ve&&(W(Ve)||L(Ve))&&L(Ve.then)&&L(Ve.catch),qe=((Ve,Ye)=>Ve?setImmediate:Ye?((St,At)=>(ee.addEventListener("message",({source:qt,data:cn})=>{qt===ee&&cn===St&&At.length&&At.shift()()},!1),qt=>{At.push(qt),ee.postMessage(St,"*")}))(`axios@${Math.random()}`,[]):St=>setTimeout(St))(typeof setImmediate=="function",L(ee.postMessage)),dt=typeof queueMicrotask<"u"?queueMicrotask.bind(ee):typeof v<"u"&&v.nextTick||qe;var De={isArray:_,isArrayBuffer:k,isBuffer:S,isFormData:we,isArrayBufferView:B,isString:O,isNumber:D,isBoolean:H,isObject:W,isPlainObject:G,isReadableStream:re,isRequest:N,isResponse:z,isHeaders:V,isUndefined:A,isDate:Z,isFile:Q,isBlob:ie,isRegExp:$t,isFunction:L,isStream:be,isURLSearchParams:Ae,isTypedArray:ke,isFileList:le,forEach:j,merge:F,extend:X,trim:U,stripBOM:de,inherits:Y,toFlatObject:ce,kindOf:b,kindOfTest:g,endsWith:he,toArray:Ie,forEachEntry:ut,matchAll:Re,isHTMLForm:ze,hasOwnProperty:Ct,hasOwnProp:Ct,reduceDescriptors:ft,freezeMethods:Xe,toObjectSet:ct,toCamelCase:_t,noop:wt,toFiniteNumber:Rt,findKey:$,global:ee,isContextDefined:J,isSpecCompliantForm:Ge,toJSONObject:zt,isAsyncFn:Ft,isThenable:tt,setImmediate:qe,asap:dt};function He(Ve,Ye,St,At,qt){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=Ve,this.name="AxiosError",Ye&&(this.code=Ye),St&&(this.config=St),At&&(this.request=At),qt&&(this.response=qt,this.status=qt.status?qt.status:null)}De.inherits(He,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:De.toJSONObject(this.config),code:this.code,status:this.status}}});const se=He.prototype,oe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(Ve=>{oe[Ve]={value:Ve}}),Object.defineProperties(He,oe),Object.defineProperty(se,"isAxiosError",{value:!0}),He.from=(Ve,Ye,St,At,qt,cn)=>{const pn=Object.create(se);return De.toFlatObject(Ve,pn,function(yr){return yr!==Error.prototype},Kn=>Kn!=="isAxiosError"),He.call(pn,Ve.message,Ye,St,At,qt),pn.cause=Ve,pn.name=Ve.name,cn&&Object.assign(pn,cn),pn};var ye=null;function Ee(Ve){return De.isPlainObject(Ve)||De.isArray(Ve)}function me(Ve){return De.endsWith(Ve,"[]")?Ve.slice(0,-2):Ve}function Te(Ve,Ye,St){return Ve?Ve.concat(Ye).map(function(qt,cn){return qt=me(qt),!St&&cn?"["+qt+"]":qt}).join(St?".":""):Ye}function Oe(Ve){return De.isArray(Ve)&&!Ve.some(Ee)}const Qe=De.toFlatObject(De,{},null,function(Ye){return/^is[A-Z]/.test(Ye)});function Vt(Ve,Ye,St){if(!De.isObject(Ve))throw new TypeError("target must be an object");Ye=Ye||new FormData,St=De.toFlatObject(St,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Hr,ur){return!De.isUndefined(ur[Hr])});const At=St.metaTokens,qt=St.visitor||Yn,cn=St.dots,pn=St.indexes,yr=(St.Blob||typeof Blob<"u"&&Blob)&&De.isSpecCompliantForm(Ye);if(!De.isFunction(qt))throw new TypeError("visitor must be a function");function ar(Tr){if(Tr===null)return"";if(De.isDate(Tr))return Tr.toISOString();if(!yr&&De.isBlob(Tr))throw new He("Blob is not supported. Use a Buffer instead.");return De.isArrayBuffer(Tr)||De.isTypedArray(Tr)?yr&&typeof Blob=="function"?new Blob([Tr]):T.from(Tr):Tr}function Yn(Tr,Hr,ur){let xi=Tr;if(Tr&&!ur&&typeof Tr=="object"){if(De.endsWith(Hr,"{}"))Hr=At?Hr:Hr.slice(0,-2),Tr=JSON.stringify(Tr);else if(De.isArray(Tr)&&Oe(Tr)||(De.isFileList(Tr)||De.endsWith(Hr,"[]"))&&(xi=De.toArray(Tr)))return Hr=me(Hr),xi.forEach(function(xs,Uo){!(De.isUndefined(xs)||xs===null)&&Ye.append(pn===!0?Te([Hr],Uo,cn):pn===null?Hr:Hr+"[]",ar(xs))}),!1}return Ee(Tr)?!0:(Ye.append(Te(ur,Hr,cn),ar(Tr)),!1)}const Cr=[],Oi=Object.assign(Qe,{defaultVisitor:Yn,convertValue:ar,isVisitable:Ee});function Ui(Tr,Hr){if(!De.isUndefined(Tr)){if(Cr.indexOf(Tr)!==-1)throw Error("Circular reference detected in "+Hr.join("."));Cr.push(Tr),De.forEach(Tr,function(xi,es){(!(De.isUndefined(xi)||xi===null)&&qt.call(Ye,xi,De.isString(es)?es.trim():es,Hr,Oi))===!0&&Ui(xi,Hr?Hr.concat(es):[es])}),Cr.pop()}}if(!De.isObject(Ve))throw new TypeError("data must be an object");return Ui(Ve),Ye}function vt(Ve){const Ye={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(Ve).replace(/[!'()~]|%20|%00/g,function(At){return Ye[At]})}function Zt(Ve,Ye){this._pairs=[],Ve&&Vt(Ve,this,Ye)}const dn=Zt.prototype;dn.append=function(Ye,St){this._pairs.push([Ye,St])},dn.toString=function(Ye){const St=Ye?function(At){return Ye.call(this,At,vt)}:vt;return this._pairs.map(function(qt){return St(qt[0])+"="+St(qt[1])},"").join("&")};function ln(Ve){return encodeURIComponent(Ve).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function yn(Ve,Ye,St){if(!Ye)return Ve;const At=St&&St.encode||ln;De.isFunction(St)&&(St={serialize:St});const qt=St&&St.serialize;let cn;if(qt?cn=qt(Ye,St):cn=De.isURLSearchParams(Ye)?Ye.toString():new Zt(Ye,St).toString(At),cn){const pn=Ve.indexOf("#");pn!==-1&&(Ve=Ve.slice(0,pn)),Ve+=(Ve.indexOf("?")===-1?"?":"&")+cn}return Ve}class or{constructor(){this.handlers=[]}use(Ye,St,At){return this.handlers.push({fulfilled:Ye,rejected:St,synchronous:At?At.synchronous:!1,runWhen:At?At.runWhen:null}),this.handlers.length-1}eject(Ye){this.handlers[Ye]&&(this.handlers[Ye]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(Ye){De.forEach(this.handlers,function(At){At!==null&&Ye(At)})}}var An=or,Un={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Er=typeof URLSearchParams<"u"?URLSearchParams:Zt,ht=typeof FormData<"u"?FormData:null,st=typeof Blob<"u"?Blob:null,Dt={isBrowser:!0,classes:{URLSearchParams:Er,FormData:ht,Blob:st},protocols:["http","https","file","blob","url","data"]};const Lt=typeof document<"u",Gt=typeof navigator=="object"&&navigator||void 0,xn=Lt&&(!Gt||["ReactNative","NativeScript","NS"].indexOf(Gt.product)<0),un=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",fn=Lt&&window.location.href||"http://localhost";var Pe=Object.freeze({__proto__:null,hasBrowserEnv:Lt,hasStandardBrowserWebWorkerEnv:un,hasStandardBrowserEnv:xn,navigator:Gt,origin:fn}),Ue={...Pe,...Dt};function Le(Ve,Ye){return Vt(Ve,new Ue.classes.URLSearchParams,Object.assign({visitor:function(St,At,qt,cn){return Ue.isNode&&De.isBuffer(St)?(this.append(At,St.toString("base64")),!1):cn.defaultVisitor.apply(this,arguments)}},Ye))}function _e(Ve){return De.matchAll(/\w+|\[(\w*)]/g,Ve).map(Ye=>Ye[0]==="[]"?"":Ye[1]||Ye[0])}function Ze(Ve){const Ye={},St=Object.keys(Ve);let At;const qt=St.length;let cn;for(At=0;At<qt;At++)cn=St[At],Ye[cn]=Ve[cn];return Ye}function Ot(Ve){function Ye(St,At,qt,cn){let pn=St[cn++];if(pn==="__proto__")return!0;const Kn=Number.isFinite(+pn),yr=cn>=St.length;return pn=!pn&&De.isArray(qt)?qt.length:pn,yr?(De.hasOwnProp(qt,pn)?qt[pn]=[qt[pn],At]:qt[pn]=At,!Kn):((!qt[pn]||!De.isObject(qt[pn]))&&(qt[pn]=[]),Ye(St,At,qt[pn],cn)&&De.isArray(qt[pn])&&(qt[pn]=Ze(qt[pn])),!Kn)}if(De.isFormData(Ve)&&De.isFunction(Ve.entries)){const St={};return De.forEachEntry(Ve,(At,qt)=>{Ye(_e(At),qt,St,0)}),St}return null}function Yt(Ve,Ye,St){if(De.isString(Ve))try{return(Ye||JSON.parse)(Ve),De.trim(Ve)}catch(At){if(At.name!=="SyntaxError")throw At}return(St||JSON.stringify)(Ve)}const Jt={transitional:Un,adapter:["xhr","http","fetch"],transformRequest:[function(Ye,St){const At=St.getContentType()||"",qt=At.indexOf("application/json")>-1,cn=De.isObject(Ye);if(cn&&De.isHTMLForm(Ye)&&(Ye=new FormData(Ye)),De.isFormData(Ye))return qt?JSON.stringify(Ot(Ye)):Ye;if(De.isArrayBuffer(Ye)||De.isBuffer(Ye)||De.isStream(Ye)||De.isFile(Ye)||De.isBlob(Ye)||De.isReadableStream(Ye))return Ye;if(De.isArrayBufferView(Ye))return Ye.buffer;if(De.isURLSearchParams(Ye))return St.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),Ye.toString();let Kn;if(cn){if(At.indexOf("application/x-www-form-urlencoded")>-1)return Le(Ye,this.formSerializer).toString();if((Kn=De.isFileList(Ye))||At.indexOf("multipart/form-data")>-1){const yr=this.env&&this.env.FormData;return Vt(Kn?{"files[]":Ye}:Ye,yr&&new yr,this.formSerializer)}}return cn||qt?(St.setContentType("application/json",!1),Yt(Ye)):Ye}],transformResponse:[function(Ye){const St=this.transitional||Jt.transitional,At=St&&St.forcedJSONParsing,qt=this.responseType==="json";if(De.isResponse(Ye)||De.isReadableStream(Ye))return Ye;if(Ye&&De.isString(Ye)&&(At&&!this.responseType||qt)){const pn=!(St&&St.silentJSONParsing)&&qt;try{return JSON.parse(Ye)}catch(Kn){if(pn)throw Kn.name==="SyntaxError"?He.from(Kn,He.ERR_BAD_RESPONSE,this,null,this.response):Kn}}return Ye}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ue.classes.FormData,Blob:Ue.classes.Blob},validateStatus:function(Ye){return Ye>=200&&Ye<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};De.forEach(["delete","get","head","post","put","patch"],Ve=>{Jt.headers[Ve]={}});var en=Jt;const Vn=De.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var kn=Ve=>{const Ye={};let St,At,qt;return Ve&&Ve.split(`
|
||
`).forEach(function(pn){qt=pn.indexOf(":"),St=pn.substring(0,qt).trim().toLowerCase(),At=pn.substring(qt+1).trim(),!(!St||Ye[St]&&Vn[St])&&(St==="set-cookie"?Ye[St]?Ye[St].push(At):Ye[St]=[At]:Ye[St]=Ye[St]?Ye[St]+", "+At:At)}),Ye};const ir=Symbol("internals");function Hn(Ve){return Ve&&String(Ve).trim().toLowerCase()}function tr(Ve){return Ve===!1||Ve==null?Ve:De.isArray(Ve)?Ve.map(tr):String(Ve)}function gr(Ve){const Ye=Object.create(null),St=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let At;for(;At=St.exec(Ve);)Ye[At[1]]=At[2];return Ye}const br=Ve=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(Ve.trim());function pr(Ve,Ye,St,At,qt){if(De.isFunction(At))return At.call(this,Ye,St);if(qt&&(Ye=St),!!De.isString(Ye)){if(De.isString(At))return Ye.indexOf(At)!==-1;if(De.isRegExp(At))return At.test(Ye)}}function _n(Ve){return Ve.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(Ye,St,At)=>St.toUpperCase()+At)}function Qn(Ve,Ye){const St=De.toCamelCase(" "+Ye);["get","set","has"].forEach(At=>{Object.defineProperty(Ve,At+St,{value:function(qt,cn,pn){return this[At].call(this,Ye,qt,cn,pn)},configurable:!0})})}class Zn{constructor(Ye){Ye&&this.set(Ye)}set(Ye,St,At){const qt=this;function cn(Kn,yr,ar){const Yn=Hn(yr);if(!Yn)throw new Error("header name must be a non-empty string");const Cr=De.findKey(qt,Yn);(!Cr||qt[Cr]===void 0||ar===!0||ar===void 0&&qt[Cr]!==!1)&&(qt[Cr||yr]=tr(Kn))}const pn=(Kn,yr)=>De.forEach(Kn,(ar,Yn)=>cn(ar,Yn,yr));if(De.isPlainObject(Ye)||Ye instanceof this.constructor)pn(Ye,St);else if(De.isString(Ye)&&(Ye=Ye.trim())&&!br(Ye))pn(kn(Ye),St);else if(De.isHeaders(Ye))for(const[Kn,yr]of Ye.entries())cn(yr,Kn,At);else Ye!=null&&cn(St,Ye,At);return this}get(Ye,St){if(Ye=Hn(Ye),Ye){const At=De.findKey(this,Ye);if(At){const qt=this[At];if(!St)return qt;if(St===!0)return gr(qt);if(De.isFunction(St))return St.call(this,qt,At);if(De.isRegExp(St))return St.exec(qt);throw new TypeError("parser must be boolean|regexp|function")}}}has(Ye,St){if(Ye=Hn(Ye),Ye){const At=De.findKey(this,Ye);return!!(At&&this[At]!==void 0&&(!St||pr(this,this[At],At,St)))}return!1}delete(Ye,St){const At=this;let qt=!1;function cn(pn){if(pn=Hn(pn),pn){const Kn=De.findKey(At,pn);Kn&&(!St||pr(At,At[Kn],Kn,St))&&(delete At[Kn],qt=!0)}}return De.isArray(Ye)?Ye.forEach(cn):cn(Ye),qt}clear(Ye){const St=Object.keys(this);let At=St.length,qt=!1;for(;At--;){const cn=St[At];(!Ye||pr(this,this[cn],cn,Ye,!0))&&(delete this[cn],qt=!0)}return qt}normalize(Ye){const St=this,At={};return De.forEach(this,(qt,cn)=>{const pn=De.findKey(At,cn);if(pn){St[pn]=tr(qt),delete St[cn];return}const Kn=Ye?_n(cn):String(cn).trim();Kn!==cn&&delete St[cn],St[Kn]=tr(qt),At[Kn]=!0}),this}concat(...Ye){return this.constructor.concat(this,...Ye)}toJSON(Ye){const St=Object.create(null);return De.forEach(this,(At,qt)=>{At!=null&&At!==!1&&(St[qt]=Ye&&De.isArray(At)?At.join(", "):At)}),St}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([Ye,St])=>Ye+": "+St).join(`
|
||
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(Ye){return Ye instanceof this?Ye:new this(Ye)}static concat(Ye,...St){const At=new this(Ye);return St.forEach(qt=>At.set(qt)),At}static accessor(Ye){const At=(this[ir]=this[ir]={accessors:{}}).accessors,qt=this.prototype;function cn(pn){const Kn=Hn(pn);At[Kn]||(Qn(qt,pn),At[Kn]=!0)}return De.isArray(Ye)?Ye.forEach(cn):cn(Ye),this}}Zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),De.reduceDescriptors(Zn.prototype,({value:Ve},Ye)=>{let St=Ye[0].toUpperCase()+Ye.slice(1);return{get:()=>Ve,set(At){this[St]=At}}}),De.freezeMethods(Zn);var Mn=Zn;function Ln(Ve,Ye){const St=this||en,At=Ye||St,qt=Mn.from(At.headers);let cn=At.data;return De.forEach(Ve,function(Kn){cn=Kn.call(St,cn,qt.normalize(),Ye?Ye.status:void 0)}),qt.normalize(),cn}function Rn(Ve){return!!(Ve&&Ve.__CANCEL__)}function In(Ve,Ye,St){He.call(this,Ve??"canceled",He.ERR_CANCELED,Ye,St),this.name="CanceledError"}De.inherits(In,He,{__CANCEL__:!0});function Xn(Ve,Ye,St){const At=St.config.validateStatus;!St.status||!At||At(St.status)?Ve(St):Ye(new He("Request failed with status code "+St.status,[He.ERR_BAD_REQUEST,He.ERR_BAD_RESPONSE][Math.floor(St.status/100)-4],St.config,St.request,St))}function $n(Ve){const Ye=/^([-+\w]{1,25})(:?\/\/|:)/.exec(Ve);return Ye&&Ye[1]||""}function hn(Ve,Ye){Ve=Ve||10;const St=new Array(Ve),At=new Array(Ve);let qt=0,cn=0,pn;return Ye=Ye!==void 0?Ye:1e3,function(yr){const ar=Date.now(),Yn=At[cn];pn||(pn=ar),St[qt]=yr,At[qt]=ar;let Cr=cn,Oi=0;for(;Cr!==qt;)Oi+=St[Cr++],Cr=Cr%Ve;if(qt=(qt+1)%Ve,qt===cn&&(cn=(cn+1)%Ve),ar-pn<Ye)return;const Ui=Yn&&ar-Yn;return Ui?Math.round(Oi*1e3/Ui):void 0}}function an(Ve,Ye){let St=0,At=1e3/Ye,qt,cn;const pn=(ar,Yn=Date.now())=>{St=Yn,qt=null,cn&&(clearTimeout(cn),cn=null),Ve.apply(null,ar)};return[(...ar)=>{const Yn=Date.now(),Cr=Yn-St;Cr>=At?pn(ar,Yn):(qt=ar,cn||(cn=setTimeout(()=>{cn=null,pn(qt)},At-Cr)))},()=>qt&&pn(qt)]}const Tn=(Ve,Ye,St=3)=>{let At=0;const qt=hn(50,250);return an(cn=>{const pn=cn.loaded,Kn=cn.lengthComputable?cn.total:void 0,yr=pn-At,ar=qt(yr),Yn=pn<=Kn;At=pn;const Cr={loaded:pn,total:Kn,progress:Kn?pn/Kn:void 0,bytes:yr,rate:ar||void 0,estimated:ar&&Kn&&Yn?(Kn-pn)/ar:void 0,event:cn,lengthComputable:Kn!=null,[Ye?"download":"upload"]:!0};Ve(Cr)},St)},Sn=(Ve,Ye)=>{const St=Ve!=null;return[At=>Ye[0]({lengthComputable:St,total:Ve,loaded:At}),Ye[1]]},Bn=Ve=>(...Ye)=>De.asap(()=>Ve(...Ye));var Fn=Ue.hasStandardBrowserEnv?((Ve,Ye)=>St=>(St=new URL(St,Ue.origin),Ve.protocol===St.protocol&&Ve.host===St.host&&(Ye||Ve.port===St.port)))(new URL(Ue.origin),Ue.navigator&&/(msie|trident)/i.test(Ue.navigator.userAgent)):()=>!0,bt=Ue.hasStandardBrowserEnv?{write(Ve,Ye,St,At,qt,cn){const pn=[Ve+"="+encodeURIComponent(Ye)];De.isNumber(St)&&pn.push("expires="+new Date(St).toGMTString()),De.isString(At)&&pn.push("path="+At),De.isString(qt)&&pn.push("domain="+qt),cn===!0&&pn.push("secure"),document.cookie=pn.join("; ")},read(Ve){const Ye=document.cookie.match(new RegExp("(^|;\\s*)("+Ve+")=([^;]*)"));return Ye?decodeURIComponent(Ye[3]):null},remove(Ve){this.write(Ve,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ve(Ve){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(Ve)}function je(Ve,Ye){return Ye?Ve.replace(/\/?\/$/,"")+"/"+Ye.replace(/^\/+/,""):Ve}function at(Ve,Ye,St){let At=!ve(Ye);return Ve&&At||St==!1?je(Ve,Ye):Ye}const Ne=Ve=>Ve instanceof Mn?{...Ve}:Ve;function Et(Ve,Ye){Ye=Ye||{};const St={};function At(ar,Yn,Cr,Oi){return De.isPlainObject(ar)&&De.isPlainObject(Yn)?De.merge.call({caseless:Oi},ar,Yn):De.isPlainObject(Yn)?De.merge({},Yn):De.isArray(Yn)?Yn.slice():Yn}function qt(ar,Yn,Cr,Oi){if(De.isUndefined(Yn)){if(!De.isUndefined(ar))return At(void 0,ar,Cr,Oi)}else return At(ar,Yn,Cr,Oi)}function cn(ar,Yn){if(!De.isUndefined(Yn))return At(void 0,Yn)}function pn(ar,Yn){if(De.isUndefined(Yn)){if(!De.isUndefined(ar))return At(void 0,ar)}else return At(void 0,Yn)}function Kn(ar,Yn,Cr){if(Cr in Ye)return At(ar,Yn);if(Cr in Ve)return At(void 0,ar)}const yr={url:cn,method:cn,data:cn,baseURL:pn,transformRequest:pn,transformResponse:pn,paramsSerializer:pn,timeout:pn,timeoutMessage:pn,withCredentials:pn,withXSRFToken:pn,adapter:pn,responseType:pn,xsrfCookieName:pn,xsrfHeaderName:pn,onUploadProgress:pn,onDownloadProgress:pn,decompress:pn,maxContentLength:pn,maxBodyLength:pn,beforeRedirect:pn,transport:pn,httpAgent:pn,httpsAgent:pn,cancelToken:pn,socketPath:pn,responseEncoding:pn,validateStatus:Kn,headers:(ar,Yn,Cr)=>qt(Ne(ar),Ne(Yn),Cr,!0)};return De.forEach(Object.keys(Object.assign({},Ve,Ye)),function(Yn){const Cr=yr[Yn]||qt,Oi=Cr(Ve[Yn],Ye[Yn],Yn);De.isUndefined(Oi)&&Cr!==Kn||(St[Yn]=Oi)}),St}var vn=Ve=>{const Ye=Et({},Ve);let{data:St,withXSRFToken:At,xsrfHeaderName:qt,xsrfCookieName:cn,headers:pn,auth:Kn}=Ye;Ye.headers=pn=Mn.from(pn),Ye.url=yn(at(Ye.baseURL,Ye.url,Ye.allowAbsoluteUrls),Ve.params,Ve.paramsSerializer),Kn&&pn.set("Authorization","Basic "+btoa((Kn.username||"")+":"+(Kn.password?unescape(encodeURIComponent(Kn.password)):"")));let yr;if(De.isFormData(St)){if(Ue.hasStandardBrowserEnv||Ue.hasStandardBrowserWebWorkerEnv)pn.setContentType(void 0);else if((yr=pn.getContentType())!==!1){const[ar,...Yn]=yr?yr.split(";").map(Cr=>Cr.trim()).filter(Boolean):[];pn.setContentType([ar||"multipart/form-data",...Yn].join("; "))}}if(Ue.hasStandardBrowserEnv&&(At&&De.isFunction(At)&&(At=At(Ye)),At||At!==!1&&Fn(Ye.url))){const ar=qt&&cn&&bt.read(cn);ar&&pn.set(qt,ar)}return Ye},Nn=typeof XMLHttpRequest<"u"&&function(Ve){return new Promise(function(St,At){const qt=vn(Ve);let cn=qt.data;const pn=Mn.from(qt.headers).normalize();let{responseType:Kn,onUploadProgress:yr,onDownloadProgress:ar}=qt,Yn,Cr,Oi,Ui,Tr;function Hr(){Ui&&Ui(),Tr&&Tr(),qt.cancelToken&&qt.cancelToken.unsubscribe(Yn),qt.signal&&qt.signal.removeEventListener("abort",Yn)}let ur=new XMLHttpRequest;ur.open(qt.method.toUpperCase(),qt.url,!0),ur.timeout=qt.timeout;function xi(){if(!ur)return;const xs=Mn.from("getAllResponseHeaders"in ur&&ur.getAllResponseHeaders()),Is={data:!Kn||Kn==="text"||Kn==="json"?ur.responseText:ur.response,status:ur.status,statusText:ur.statusText,headers:xs,config:Ve,request:ur};Xn(function(ya){St(ya),Hr()},function(ya){At(ya),Hr()},Is),ur=null}"onloadend"in ur?ur.onloadend=xi:ur.onreadystatechange=function(){!ur||ur.readyState!==4||ur.status===0&&!(ur.responseURL&&ur.responseURL.indexOf("file:")===0)||setTimeout(xi)},ur.onabort=function(){ur&&(At(new He("Request aborted",He.ECONNABORTED,Ve,ur)),ur=null)},ur.onerror=function(){At(new He("Network Error",He.ERR_NETWORK,Ve,ur)),ur=null},ur.ontimeout=function(){let Uo=qt.timeout?"timeout of "+qt.timeout+"ms exceeded":"timeout exceeded";const Is=qt.transitional||Un;qt.timeoutErrorMessage&&(Uo=qt.timeoutErrorMessage),At(new He(Uo,Is.clarifyTimeoutError?He.ETIMEDOUT:He.ECONNABORTED,Ve,ur)),ur=null},cn===void 0&&pn.setContentType(null),"setRequestHeader"in ur&&De.forEach(pn.toJSON(),function(Uo,Is){ur.setRequestHeader(Is,Uo)}),De.isUndefined(qt.withCredentials)||(ur.withCredentials=!!qt.withCredentials),Kn&&Kn!=="json"&&(ur.responseType=qt.responseType),ar&&([Oi,Tr]=Tn(ar,!0),ur.addEventListener("progress",Oi)),yr&&ur.upload&&([Cr,Ui]=Tn(yr),ur.upload.addEventListener("progress",Cr),ur.upload.addEventListener("loadend",Ui)),(qt.cancelToken||qt.signal)&&(Yn=xs=>{ur&&(At(!xs||xs.type?new In(null,Ve,ur):xs),ur.abort(),ur=null)},qt.cancelToken&&qt.cancelToken.subscribe(Yn),qt.signal&&(qt.signal.aborted?Yn():qt.signal.addEventListener("abort",Yn)));const es=$n(qt.url);if(es&&Ue.protocols.indexOf(es)===-1){At(new He("Unsupported protocol "+es+":",He.ERR_BAD_REQUEST,Ve));return}ur.send(cn||null)})},Gn=(Ve,Ye)=>{const{length:St}=Ve=Ve?Ve.filter(Boolean):[];if(Ye||St){let At=new AbortController,qt;const cn=function(ar){if(!qt){qt=!0,Kn();const Yn=ar instanceof Error?ar:this.reason;At.abort(Yn instanceof He?Yn:new In(Yn instanceof Error?Yn.message:Yn))}};let pn=Ye&&setTimeout(()=>{pn=null,cn(new He(`timeout ${Ye} of ms exceeded`,He.ETIMEDOUT))},Ye);const Kn=()=>{Ve&&(pn&&clearTimeout(pn),pn=null,Ve.forEach(ar=>{ar.unsubscribe?ar.unsubscribe(cn):ar.removeEventListener("abort",cn)}),Ve=null)};Ve.forEach(ar=>ar.addEventListener("abort",cn));const{signal:yr}=At;return yr.unsubscribe=()=>De.asap(Kn),yr}};const $r=function*(Ve,Ye){let St=Ve.byteLength;if(!Ye||St<Ye){yield Ve;return}let At=0,qt;for(;At<St;)qt=At+Ye,yield Ve.slice(At,qt),At=qt},Vr=async function*(Ve,Ye){for await(const St of vi(Ve))yield*$r(St,Ye)},vi=async function*(Ve){if(Ve[Symbol.asyncIterator]){yield*Ve;return}const Ye=Ve.getReader();try{for(;;){const{done:St,value:At}=await Ye.read();if(St)break;yield At}}finally{await Ye.cancel()}},Pi=(Ve,Ye,St,At)=>{const qt=Vr(Ve,Ye);let cn=0,pn,Kn=yr=>{pn||(pn=!0,At&&At(yr))};return new ReadableStream({async pull(yr){try{const{done:ar,value:Yn}=await qt.next();if(ar){Kn(),yr.close();return}let Cr=Yn.byteLength;if(St){let Oi=cn+=Cr;St(Oi)}yr.enqueue(new Uint8Array(Yn))}catch(ar){throw Kn(ar),ar}},cancel(yr){return Kn(yr),qt.return()}},{highWaterMark:2})},et=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",it=et&&typeof ReadableStream=="function",$e=et&&(typeof TextEncoder=="function"?(Ve=>Ye=>Ve.encode(Ye))(new TextEncoder):async Ve=>new Uint8Array(await new Response(Ve).arrayBuffer())),mt=(Ve,...Ye)=>{try{return!!Ve(...Ye)}catch{return!1}},It=it&&mt(()=>{let Ve=!1;const Ye=new Request(Ue.origin,{body:new ReadableStream,method:"POST",get duplex(){return Ve=!0,"half"}}).headers.has("Content-Type");return Ve&&!Ye}),sn=64*1024,Wn=it&&mt(()=>De.isReadableStream(new Response("").body)),Or={stream:Wn&&(Ve=>Ve.body)};et&&(Ve=>{["text","arrayBuffer","blob","formData","stream"].forEach(Ye=>{!Or[Ye]&&(Or[Ye]=De.isFunction(Ve[Ye])?St=>St[Ye]():(St,At)=>{throw new He(`Response type '${Ye}' is not supported`,He.ERR_NOT_SUPPORT,At)})})})(new Response);const Nr=async Ve=>{if(Ve==null)return 0;if(De.isBlob(Ve))return Ve.size;if(De.isSpecCompliantForm(Ve))return(await new Request(Ue.origin,{method:"POST",body:Ve}).arrayBuffer()).byteLength;if(De.isArrayBufferView(Ve)||De.isArrayBuffer(Ve))return Ve.byteLength;if(De.isURLSearchParams(Ve)&&(Ve=Ve+""),De.isString(Ve))return(await $e(Ve)).byteLength},wi=async(Ve,Ye)=>{const St=De.toFiniteNumber(Ve.getContentLength());return St??Nr(Ye)};var Ti=et&&(async Ve=>{let{url:Ye,method:St,data:At,signal:qt,cancelToken:cn,timeout:pn,onDownloadProgress:Kn,onUploadProgress:yr,responseType:ar,headers:Yn,withCredentials:Cr="same-origin",fetchOptions:Oi}=vn(Ve);ar=ar?(ar+"").toLowerCase():"text";let Ui=Gn([qt,cn&&cn.toAbortSignal()],pn),Tr;const Hr=Ui&&Ui.unsubscribe&&(()=>{Ui.unsubscribe()});let ur;try{if(yr&&It&&St!=="get"&&St!=="head"&&(ur=await wi(Yn,At))!==0){let Is=new Request(Ye,{method:"POST",body:At,duplex:"half"}),ga;if(De.isFormData(At)&&(ga=Is.headers.get("content-type"))&&Yn.setContentType(ga),Is.body){const[ya,Ic]=Sn(ur,Tn(Bn(yr)));At=Pi(Is.body,sn,ya,Ic)}}De.isString(Cr)||(Cr=Cr?"include":"omit");const xi="credentials"in Request.prototype;Tr=new Request(Ye,{...Oi,signal:Ui,method:St.toUpperCase(),headers:Yn.normalize().toJSON(),body:At,duplex:"half",credentials:xi?Cr:void 0});let es=await fetch(Tr);const xs=Wn&&(ar==="stream"||ar==="response");if(Wn&&(Kn||xs&&Hr)){const Is={};["status","statusText","headers"].forEach(el=>{Is[el]=es[el]});const ga=De.toFiniteNumber(es.headers.get("content-length")),[ya,Ic]=Kn&&Sn(ga,Tn(Bn(Kn),!0))||[];es=new Response(Pi(es.body,sn,ya,()=>{Ic&&Ic(),Hr&&Hr()}),Is)}ar=ar||"text";let Uo=await Or[De.findKey(Or,ar)||"text"](es,Ve);return!xs&&Hr&&Hr(),await new Promise((Is,ga)=>{Xn(Is,ga,{data:Uo,headers:Mn.from(es.headers),status:es.status,statusText:es.statusText,config:Ve,request:Tr})})}catch(xi){throw Hr&&Hr(),xi&&xi.name==="TypeError"&&/fetch/i.test(xi.message)?Object.assign(new He("Network Error",He.ERR_NETWORK,Ve,Tr),{cause:xi.cause||xi}):He.from(xi,xi&&xi.code,Ve,Tr)}});const di={http:ye,xhr:Nn,fetch:Ti};De.forEach(di,(Ve,Ye)=>{if(Ve){try{Object.defineProperty(Ve,"name",{value:Ye})}catch{}Object.defineProperty(Ve,"adapterName",{value:Ye})}});const mi=Ve=>`- ${Ve}`,So=Ve=>De.isFunction(Ve)||Ve===null||Ve===!1;var Xu={getAdapter:Ve=>{Ve=De.isArray(Ve)?Ve:[Ve];const{length:Ye}=Ve;let St,At;const qt={};for(let cn=0;cn<Ye;cn++){St=Ve[cn];let pn;if(At=St,!So(St)&&(At=di[(pn=String(St)).toLowerCase()],At===void 0))throw new He(`Unknown adapter '${pn}'`);if(At)break;qt[pn||"#"+cn]=At}if(!At){const cn=Object.entries(qt).map(([Kn,yr])=>`adapter ${Kn} `+(yr===!1?"is not supported by the environment":"is not available in the build"));let pn=Ye?cn.length>1?`since :
|
||
`+cn.map(mi).join(`
|
||
`):" "+mi(cn[0]):"as no adapter specified";throw new He("There is no suitable adapter to dispatch the request "+pn,"ERR_NOT_SUPPORT")}return At},adapters:di};function df(Ve){if(Ve.cancelToken&&Ve.cancelToken.throwIfRequested(),Ve.signal&&Ve.signal.aborted)throw new In(null,Ve)}function Yu(Ve){return df(Ve),Ve.headers=Mn.from(Ve.headers),Ve.data=Ln.call(Ve,Ve.transformRequest),["post","put","patch"].indexOf(Ve.method)!==-1&&Ve.headers.setContentType("application/x-www-form-urlencoded",!1),Xu.getAdapter(Ve.adapter||en.adapter)(Ve).then(function(At){return df(Ve),At.data=Ln.call(Ve,Ve.transformResponse,At),At.headers=Mn.from(At.headers),At},function(At){return Rn(At)||(df(Ve),At&&At.response&&(At.response.data=Ln.call(Ve,Ve.transformResponse,At.response),At.response.headers=Mn.from(At.response.headers))),Promise.reject(At)})}const hf="1.8.3",gu={};["object","boolean","number","function","string","symbol"].forEach((Ve,Ye)=>{gu[Ve]=function(At){return typeof At===Ve||"a"+(Ye<1?"n ":" ")+Ve}});const Mi={};gu.transitional=function(Ye,St,At){function qt(cn,pn){return"[Axios v"+hf+"] Transitional option '"+cn+"'"+pn+(At?". "+At:"")}return(cn,pn,Kn)=>{if(Ye===!1)throw new He(qt(pn," has been removed"+(St?" in "+St:"")),He.ERR_DEPRECATED);return St&&!Mi[pn]&&(Mi[pn]=!0,console.warn(qt(pn," has been deprecated since v"+St+" and will be removed in the near future"))),Ye?Ye(cn,pn,Kn):!0}},gu.spelling=function(Ye){return(St,At)=>(console.warn(`${At} is likely a misspelling of ${Ye}`),!0)};function Ni(Ve,Ye,St){if(typeof Ve!="object")throw new He("options must be an object",He.ERR_BAD_OPTION_VALUE);const At=Object.keys(Ve);let qt=At.length;for(;qt-- >0;){const cn=At[qt],pn=Ye[cn];if(pn){const Kn=Ve[cn],yr=Kn===void 0||pn(Kn,cn,Ve);if(yr!==!0)throw new He("option "+cn+" must be "+yr,He.ERR_BAD_OPTION_VALUE);continue}if(St!==!0)throw new He("Unknown option "+cn,He.ERR_BAD_OPTION)}}var pf={assertOptions:Ni,validators:gu};const pa=pf.validators;class Ju{constructor(Ye){this.defaults=Ye,this.interceptors={request:new An,response:new An}}async request(Ye,St){try{return await this._request(Ye,St)}catch(At){if(At instanceof Error){let qt={};Error.captureStackTrace?Error.captureStackTrace(qt):qt=new Error;const cn=qt.stack?qt.stack.replace(/^.+\n/,""):"";try{At.stack?cn&&!String(At.stack).endsWith(cn.replace(/^.+\n.+\n/,""))&&(At.stack+=`
|
||
`+cn):At.stack=cn}catch{}}throw At}}_request(Ye,St){typeof Ye=="string"?(St=St||{},St.url=Ye):St=Ye||{},St=Et(this.defaults,St);const{transitional:At,paramsSerializer:qt,headers:cn}=St;At!==void 0&&pf.assertOptions(At,{silentJSONParsing:pa.transitional(pa.boolean),forcedJSONParsing:pa.transitional(pa.boolean),clarifyTimeoutError:pa.transitional(pa.boolean)},!1),qt!=null&&(De.isFunction(qt)?St.paramsSerializer={serialize:qt}:pf.assertOptions(qt,{encode:pa.function,serialize:pa.function},!0)),St.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?St.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:St.allowAbsoluteUrls=!0),pf.assertOptions(St,{baseUrl:pa.spelling("baseURL"),withXsrfToken:pa.spelling("withXSRFToken")},!0),St.method=(St.method||this.defaults.method||"get").toLowerCase();let pn=cn&&De.merge(cn.common,cn[St.method]);cn&&De.forEach(["delete","get","head","post","put","patch","common"],Tr=>{delete cn[Tr]}),St.headers=Mn.concat(pn,cn);const Kn=[];let yr=!0;this.interceptors.request.forEach(function(Hr){typeof Hr.runWhen=="function"&&Hr.runWhen(St)===!1||(yr=yr&&Hr.synchronous,Kn.unshift(Hr.fulfilled,Hr.rejected))});const ar=[];this.interceptors.response.forEach(function(Hr){ar.push(Hr.fulfilled,Hr.rejected)});let Yn,Cr=0,Oi;if(!yr){const Tr=[Yu.bind(this),void 0];for(Tr.unshift.apply(Tr,Kn),Tr.push.apply(Tr,ar),Oi=Tr.length,Yn=Promise.resolve(St);Cr<Oi;)Yn=Yn.then(Tr[Cr++],Tr[Cr++]);return Yn}Oi=Kn.length;let Ui=St;for(Cr=0;Cr<Oi;){const Tr=Kn[Cr++],Hr=Kn[Cr++];try{Ui=Tr(Ui)}catch(ur){Hr.call(this,ur);break}}try{Yn=Yu.call(this,Ui)}catch(Tr){return Promise.reject(Tr)}for(Cr=0,Oi=ar.length;Cr<Oi;)Yn=Yn.then(ar[Cr++],ar[Cr++]);return Yn}getUri(Ye){Ye=Et(this.defaults,Ye);const St=at(Ye.baseURL,Ye.url,Ye.allowAbsoluteUrls);return yn(St,Ye.params,Ye.paramsSerializer)}}De.forEach(["delete","get","head","options"],function(Ye){Ju.prototype[Ye]=function(St,At){return this.request(Et(At||{},{method:Ye,url:St,data:(At||{}).data}))}}),De.forEach(["post","put","patch"],function(Ye){function St(At){return function(cn,pn,Kn){return this.request(Et(Kn||{},{method:Ye,headers:At?{"Content-Type":"multipart/form-data"}:{},url:cn,data:pn}))}}Ju.prototype[Ye]=St(),Ju.prototype[Ye+"Form"]=St(!0)});var Ns=Ju;class Qu{constructor(Ye){if(typeof Ye!="function")throw new TypeError("executor must be a function.");let St;this.promise=new Promise(function(cn){St=cn});const At=this;this.promise.then(qt=>{if(!At._listeners)return;let cn=At._listeners.length;for(;cn-- >0;)At._listeners[cn](qt);At._listeners=null}),this.promise.then=qt=>{let cn;const pn=new Promise(Kn=>{At.subscribe(Kn),cn=Kn}).then(qt);return pn.cancel=function(){At.unsubscribe(cn)},pn},Ye(function(cn,pn,Kn){At.reason||(At.reason=new In(cn,pn,Kn),St(At.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(Ye){if(this.reason){Ye(this.reason);return}this._listeners?this._listeners.push(Ye):this._listeners=[Ye]}unsubscribe(Ye){if(!this._listeners)return;const St=this._listeners.indexOf(Ye);St!==-1&&this._listeners.splice(St,1)}toAbortSignal(){const Ye=new AbortController,St=At=>{Ye.abort(At)};return this.subscribe(St),Ye.signal.unsubscribe=()=>this.unsubscribe(St),Ye.signal}static source(){let Ye;return{token:new Qu(function(qt){Ye=qt}),cancel:Ye}}}var Yg=Qu;function v0(Ve){return function(St){return Ve.apply(null,St)}}function w0(Ve){return De.isObject(Ve)&&Ve.isAxiosError===!0}const ys={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ys).forEach(([Ve,Ye])=>{ys[Ye]=Ve});var Ad=ys;function Qa(Ve){const Ye=new Ns(Ve),St=C(Ns.prototype.request,Ye);return De.extend(St,Ns.prototype,Ye,{allOwnKeys:!0}),De.extend(St,Ye,null,{allOwnKeys:!0}),St.create=function(qt){return Qa(Et(Ve,qt))},St}const us=Qa(en);us.Axios=Ns,us.CanceledError=In,us.CancelToken=Yg,us.isCancel=Rn,us.VERSION=hf,us.toFormData=Vt,us.AxiosError=He,us.Cancel=us.CanceledError,us.all=function(Ye){return Promise.all(Ye)},us.spread=v0,us.isAxiosError=w0,us.mergeConfig=Et,us.AxiosHeaders=Mn,us.formToJSON=Ve=>Ot(De.isHTMLForm(Ve)?new FormData(Ve):Ve),us.getAdapter=Xu.getAdapter,us.HttpStatusCode=Ad,us.default=us,fe.exports=us},69637:function(fe,p,x){"use strict";x.r(p),x.d(p,{TextDecoder:()=>k,TextEncoder:()=>B});function v(D,W,H){return W<=D&&D<=H}function T(D){if(D===void 0)return{};if(D===Object(D))return D;throw TypeError("Could not convert argument to dictionary")}function C(D){for(var W=String(D),H=W.length,G=0,Z=[];G<H;){var Q=W.charCodeAt(G);if(Q<55296||Q>57343)Z.push(Q);else if(56320<=Q&&Q<=57343)Z.push(65533);else if(55296<=Q&&Q<=56319)if(G===H-1)Z.push(65533);else{var ie=D.charCodeAt(G+1);if(56320<=ie&&ie<=57343){var le=Q&1023,be=ie&1023;Z.push(65536+(le<<10)+be),G+=1}else Z.push(65533)}G+=1}return Z}function I(D){for(var W="",H=0;H<D.length;++H){var G=D[H];G<=65535?W+=String.fromCharCode(G):(G-=65536,W+=String.fromCharCode((G>>10)+55296,(G&1023)+56320))}return W}var m=-1;function b(D){this.tokens=[].slice.call(D)}b.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():m},prepend:function(D){if(Array.isArray(D))for(var W=D;W.length;)this.tokens.unshift(W.pop());else this.tokens.unshift(D)},push:function(D){if(Array.isArray(D))for(var W=D;W.length;)this.tokens.push(W.shift());else this.tokens.push(D)}};var g=-1;function w(D,W){if(D)throw TypeError("Decoder error");return W||65533}function _(){}_.prototype={handler:function(D,W){}};function A(){}A.prototype={handler:function(D,W){}};var S="utf-8";function k(D,W){if(!(this instanceof k))return new k(D,W);if(D=D!==void 0?String(D).toLowerCase():S,D!==S)throw new Error("Encoding not supported. Only utf-8 is supported");W=T(W),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!W.fatal,this._ignoreBOM=!!W.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}k.prototype={decode:function(W,H){var G;typeof W=="object"&&W instanceof ArrayBuffer?G=new Uint8Array(W):typeof W=="object"&&"buffer"in W&&W.buffer instanceof ArrayBuffer?G=new Uint8Array(W.buffer,W.byteOffset,W.byteLength):G=new Uint8Array(0),H=T(H),this._streaming||(this._decoder=new O({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!H.stream;for(var Z=new b(G),Q=[],ie;!Z.endOfStream()&&(ie=this._decoder.handler(Z,Z.read()),ie!==g);)ie!==null&&(Array.isArray(ie)?Q.push.apply(Q,ie):Q.push(ie));if(!this._streaming){do{if(ie=this._decoder.handler(Z,Z.read()),ie===g)break;ie!==null&&(Array.isArray(ie)?Q.push.apply(Q,ie):Q.push(ie))}while(!Z.endOfStream());this._decoder=null}return Q.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(Q[0]===65279?(this._BOMseen=!0,Q.shift()):this._BOMseen=!0),I(Q)}};function B(D,W){if(!(this instanceof B))return new B(D,W);if(D=D!==void 0?String(D).toLowerCase():S,D!==S)throw new Error("Encoding not supported. Only utf-8 is supported");W=T(W),this._streaming=!1,this._encoder=null,this._options={fatal:!!W.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}B.prototype={encode:function(W,H){W=W?String(W):"",H=T(H),this._streaming||(this._encoder=new L(this._options)),this._streaming=!!H.stream;for(var G=[],Z=new b(C(W)),Q;!Z.endOfStream()&&(Q=this._encoder.handler(Z,Z.read()),Q!==g);)Array.isArray(Q)?G.push.apply(G,Q):G.push(Q);if(!this._streaming){for(;Q=this._encoder.handler(Z,Z.read()),Q!==g;)Array.isArray(Q)?G.push.apply(G,Q):G.push(Q);this._encoder=null}return new Uint8Array(G)}};function O(D){var W=D.fatal,H=0,G=0,Z=0,Q=128,ie=191;this.handler=function(le,be){if(be===m&&Z!==0)return Z=0,w(W);if(be===m)return g;if(Z===0){if(v(be,0,127))return be;if(v(be,194,223))Z=1,H=be-192;else if(v(be,224,239))be===224&&(Q=160),be===237&&(ie=159),Z=2,H=be-224;else if(v(be,240,244))be===240&&(Q=144),be===244&&(ie=143),Z=3,H=be-240;else return w(W);return H=H<<6*Z,null}if(!v(be,Q,ie))return H=Z=G=0,Q=128,ie=191,le.prepend(be),w(W);if(Q=128,ie=191,G+=1,H+=be-128<<6*(Z-G),G!==Z)return null;var we=H;return H=Z=G=0,we}}function L(D){var W=D.fatal;this.handler=function(H,G){if(G===m)return g;if(v(G,0,127))return G;var Z,Q;v(G,128,2047)?(Z=1,Q=192):v(G,2048,65535)?(Z=2,Q=224):v(G,65536,1114111)&&(Z=3,Q=240);for(var ie=[(G>>6*Z)+Q];Z>0;){var le=G>>6*(Z-1);ie.push(128|le&63),Z-=1}return ie}}},74553:function(fe){"use strict";fe.exports={rE:"15.0.0"}},54044:function(fe){"use strict";fe.exports={rE:"6.6.1"}}},SS={};function Ar(fe){var p=SS[fe];if(p!==void 0){if(p.error!==void 0)throw p.error;return p.exports}var x=SS[fe]={id:fe,loaded:!1,exports:{}};try{B9[fe].call(x.exports,x,x.exports,Ar)}catch(v){throw x.error=v,v}return x.loaded=!0,x.exports}Ar.n=fe=>{var p=fe&&fe.__esModule?()=>fe.default:()=>fe;return Ar.d(p,{a:p}),p},(()=>{var fe=Object.getPrototypeOf?x=>Object.getPrototypeOf(x):x=>x.__proto__,p;Ar.t=function(x,v){if(v&1&&(x=this(x)),v&8||typeof x=="object"&&x&&(v&4&&x.__esModule||v&16&&typeof x.then=="function"))return x;var T=Object.create(null);Ar.r(T);var C={};p=p||[null,fe({}),fe([]),fe(fe)];for(var I=v&2&&x;typeof I=="object"&&!~p.indexOf(I);I=fe(I))Object.getOwnPropertyNames(I).forEach(m=>{C[m]=()=>x[m]});return C.default=()=>x,Ar.d(T,C),T}})(),Ar.d=(fe,p)=>{for(var x in p)Ar.o(p,x)&&!Ar.o(fe,x)&&Object.defineProperty(fe,x,{enumerable:!0,get:p[x]})},Ar.g=(()=>{if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),Ar.o=(fe,p)=>Object.prototype.hasOwnProperty.call(fe,p),Ar.r=fe=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(fe,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(fe,"__esModule",{value:!0})},Ar.nmd=fe=>(fe.paths=[],fe.children||(fe.children=[]),fe),Ar.rv=()=>"1.5.2",Ar.ruid="bundler=rspack@1.5.2";var LV={};(()=>{"use strict";var fe={};Ar.r(fe),Ar.d(fe,{aK:()=>$a,e8:()=>Du,DO:()=>sg,OG:()=>sE,My:()=>Jf,Ph:()=>Qf,lX:()=>Rh,Id:()=>ed,fg:()=>Nx,qj:()=>eo,aT:()=>Oh,r4:()=>i1,aY:()=>Yf,x:()=>ag,lq:()=>Nh,z:()=>og,Q5:()=>Uh});var p={};Ar.r(p),Ar.d(p,{aK:()=>id,e8:()=>Lh,DO:()=>fg,dJ:()=>rI,OG:()=>AE,My:()=>Fh,Ph:()=>rd,lX:()=>_E,Id:()=>dg,fg:()=>sI,qj:()=>yc,aT:()=>zh,r4:()=>d1,aY:()=>nd,x:()=>IE,lq:()=>Hh,z:()=>EE,zW:()=>jh,Q5:()=>hg});var x={};Ar.r(x),Ar.d(x,{hasBrowserEnv:()=>v6,hasStandardBrowserEnv:()=>bL,hasStandardBrowserWebWorkerEnv:()=>vL,origin:()=>wL});function v(t,e,s,f,d,h,E){try{var P=t[h](E),R=P.value}catch(q){s(q);return}P.done?e(R):Promise.resolve(R).then(f,d)}function T(t){return function(){var e=this,s=arguments;return new Promise(function(f,d){var h=t.apply(e,s);function E(R){v(h,f,d,E,P,"next",R)}function P(R){v(h,f,d,E,P,"throw",R)}E(void 0)})}}var C=Ar(39212),I=Ar.n(C),m="__wallet_sent_from_in_page_msg__",b="__wallet_sent_from_content_script_msg__";function g(){var t,e,s=new Promise(function(f,d){t=f,e=d});return{promise:s,resolve:t,reject:e}}var w=g(),_=w.promise,A=w.resolve,S;(function(t){t.uiFunctionCall="uiFunctionCall",t.contentscriptFunctionCall="contentscriptFunctionCall",t.functionCallResult="functionCallResult",t.updateState="updateState",t.contentScriptEvent="contentScriptEvent"})(S||(S={}));var k;(function(t){t.ui="ui",t.contentScript="contentScript",t.inPage="inPage"})(k||(k={}));function B(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}function L(t,e){return e.get?e.get.call(t):e.value}function D(t,e){var s=O(t,e,"get");return L(t,s)}function W(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function H(t,e,s){W(t,e),e.set(t,s)}var G;(function(t){t.Cosmos="Cosmos",t.Evm="EVM",t.Move="MOVE",t.Near="NEAR",t.Polkadot="Polkadot",t.Sol="SOL",t.TRON="TRON",t.Ton="TON",t.Utxo="UTXO"})(G||(G={}));var Z;(function(t){t[t.evm=G.Evm]="evm",t[t.solana=G.Sol]="solana",t[t.utxo=G.Utxo]="utxo",t[t.tron=G.TRON]="tron",t[t.sui=G.Move]="sui",t[t.ton=G.Ton]="ton"})(Z||(Z={}));var Q=[Z.evm,Z.solana,Z.tron,Z.sui,Z.ton],ie;(function(t){t.disconnect="disconnect",t.connectionChanged="connectionChanged"})(ie||(ie={}));function le(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function be(t){for(var e=1;e<arguments.length;e++){var s=arguments[e]!=null?arguments[e]:{},f=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(s).filter(function(d){return Object.getOwnPropertyDescriptor(s,d).enumerable}))),f.forEach(function(d){le(t,d,s[d])})}return t}function we(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(t);e&&(f=f.filter(function(d){return Object.getOwnPropertyDescriptor(t,d).enumerable})),s.push.apply(s,f)}return s}function Ae(t,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):we(Object(e)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(e,s))}),t}function re(t,e){return re=Object.setPrototypeOf||function(f,d){return f.__proto__=d,f},re(t,e)}function N(t,e){return re(t,e)}function z(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&N(t,e)}function V(t){if(Array.isArray(t))return t}function U(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function j(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $(t,e){(e==null||e>t.length)&&(e=t.length);for(var s=0,f=new Array(e);s<e;s++)f[s]=t[s];return f}function ee(t,e){if(t){if(typeof t=="string")return $(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(s);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return $(t,e)}}function J(t,e){return V(t)||U(t,e)||ee(t,e)||j()}function F(){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 X(t){return X=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},X(t)}function de(t){return X(t)}function Y(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ce(t){"@swc/helpers - typeof";return t&&t.constructor===Symbol?"symbol":typeof t}function he(t,e){return e&&(ce(e)==="object"||typeof e=="function")?e:Y(t)}function Ie(t){var e=F();return function(){var f=de(t),d;if(e){var h=de(this).constructor;d=Reflect.construct(f,arguments,h)}else d=f.apply(this,arguments);return he(this,d)}}const ke="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let ut=t=>crypto.getRandomValues(new Uint8Array(t)),Re=(t,e,s)=>{let f=(2<<Math.log2(t.length-1))-1,d=-~(1.6*f*e/t.length);return(h=e)=>{let E="";for(;;){let P=s(d),R=d|0;for(;R--;)if(E+=t[P[R]&f]||"",E.length>=h)return E}}},ze=(t,e=21)=>Re(t,e|0,ut),_t=(t=21)=>{let e="",s=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=ke[s[t]&63];return e};var Ct=function(){return _t()},$t=function(){return uuidv4()},ft=function(){return Qe(32)},Xe=function(){return Qe(32)},ct=function(){return"a-".concat(Ct())},wt=function(){return"w-".concat(Ct())},Rt=function(t){return"approval-".concat(t||Ct())},Ge=function(t,e){return e?"n-b-".concat(t,"-").concat(e):"n-b-".concat(t)},zt=function(t){return"n-c-".concat(t)},Ft=function(t){if(!t.startsWith("n-b-"))throw new Error("Network ID cannot be converted to Binance Chain ID");return t.split("-")[2]},tt=function(t){return!t||!t.startsWith("n-b-")?null:t.split("-")[2]},qe=function(t){if(!t.startsWith("n-c-"))throw new Error("Network ID cannot be converted to Custom Chain ID");return t.split("-")[2]},dt=function(t){return t?t.startsWith("n-c-"):!1},De=function(t){if(t===null)return null;if(t!==void 0)return Ft(t)},He=function(t){return"t-b-".concat(t)},se=function(t,e){if(isNaN(Number(t)))throw Error("require chain id is number");return"t-c-".concat(t,"-").concat(e.toLowerCase())},oe=function(t,e,s){return"tx-c-".concat(t,"-").concat(e,"-").concat(s).toLowerCase()},ye=function(t,e){return"block-".concat(t,"-").concat(e).toLowerCase()},Ee=function(t){var e=t.split("-");return{chainId:e[2],txHash:e[3],userAddress:e[4]}},me=function(t){return t.startsWith("t-c-")},Te=function(t){if(!t.startsWith("t-b-"))throw new Error("Token ID cannot be converted to Binance Token ID");return t.split("-")[2]},Oe=function(t){if(!t.startsWith("t-c-"))throw new Error("Token ID is not custom chain token");var e=t.split("-");return{chainId:e[2],tokenContract:e[3]}},Qe=function(t){return _to_consumable_array(Array(t)).map(function(){return Math.floor(Math.random()*16).toString(16)}).join("")},Vt=function(t,e){return"sas-id-".concat(t,"-").concat(e)},vt=function(){return"ab-".concat($t())},Zt=function(){"use strict";function t(s){B(this,t),this.postMessage=s,this.messageHandler={}}var e=t.prototype;return e.getFunctionCaller=function(f,d){var h=this;return new Proxy({},{get:function(P,R){return new Proxy({},{get:function(te,ne){if(typeof R!="string"||typeof ne!="string")throw new Error("Invalid function call");return T(I().mark(function ue(){var ge,xe,pe,Se,Ce,Fe,We,xt,kt,Bt,Wt,Me=arguments;return I().wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:for(ge=Me.length,xe=new Array(ge),pe=0;pe<ge;pe++)xe[pe]=Me[pe];return Se=this,Ce=Ct(),Fe={type:f,moduleName:R,funcName:ne,args:xe,callFrom:d,providerCallContext:Se.providerCallContext,messageId:Ce},nt.next=6,h.sendMessageAndWait(Fe);case 6:if(We=nt.sent,!We.error){nt.next=17;break}if(console.debug("[FunctionCallError]",ne,xe,We.error),xt=J(We.error.split(":"),2),kt=xt[0],Bt=xt[1],isNaN(Number(kt))){nt.next=16;break}throw Wt=Error(Bt.trim()),Wt.code=Number(kt),Wt;case 16:throw Error(We.error);case 17:return nt.abrupt("return",We.returnValue);case 18:case"end":return nt.stop()}},ue,this)}))}})}})},e.onReceiveMessage=function(f){var d=this.messageHandler[f.messageId];d?(d(f),delete this.messageHandler[f.messageId]):console.log("No handler for messageId:",f.messageId)},e.sendMessageAndWait=function(f){return this.postMessage(be({},f)),this.waitForMessageId(f.messageId)},e.waitForMessageId=function(f){var d=g(),h=d.promise,E=d.resolve;return this.messageHandler[f]=E,h},t}(),dn=null,ln=function(t){"use strict";z(s,t);var e=Ie(s);function s(){return B(this,s),e.apply(this,arguments)}return s}(Zt);function yn(t){return or.apply(this,arguments)}function or(){return or=T(I().mark(function t(e){return I().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",new Promise(function(d){return setTimeout(d,e)}));case 1:case"end":return f.stop()}},t)})),or.apply(this,arguments)}function An(t){var e,s,f=new Promise(function(h){s=h,e=setTimeout(function(){h()},t)}),d=function(){clearTimeout(e),s()};return{promise:f,cancel:d}}var Un=function(){var t=T(I().mark(function e(s){var f,d;return I().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,_;case 2:console.debug("[postMessageToContentScript]",s),f=s.messageId,d=0;case 5:if(!(d<5)){E.next=16;break}return window.postMessage(Ae(be({},s),le({},m,!0)),window.location.origin),E.next=9,yn(Math.pow(2,d)*500);case 9:if(f){E.next=11;break}return E.abrupt("return");case 11:if(!Hn.has(f)){E.next=13;break}return E.abrupt("return");case 13:++d,E.next=5;break;case 16:case"end":return E.stop()}},e)}));return function(s){return t.apply(this,arguments)}}(),Er=new ln(Un),ht=Er.getFunctionCaller(S.contentscriptFunctionCall,k.inPage),st=function(t){switch(t){case"eip155":return Z.evm;case"solana":return Z.solana;case"tron":return Z.tron;case"sui":return Z.sui;case"ton":return Z.ton;default:throw Error("Unsupported namespace")}},Dt=new WeakMap,Lt=function(){"use strict";function t(){B(this,t),H(this,Dt,{writable:!0,value:new Map})}var e=t.prototype;return e.registerProvider=function(f){var d=f._namespace,h=st(d);f.isBinance=!1,f._postMessageToMp=function(E){var P=E.method,R=E.payload,q=E.id,te=[R],ne=ht.providerAdapter[P],ue={networkType:h};ne.apply({providerCallContext:ue},te).then(function(ge){f.setResponse(q,ge)},function(ge){f.setError(q,ge)})},D(this,Dt).set(h,f)},e.onReceiveContentScriptEventMessage=function(f){var d=f.type,h=f.networkType,E=f.eventType,P=f.args,R=D(this,Dt).get(h);if(!R)throw Error("No provider found");switch(E){case ie.disconnect:R.setConnectedInfo({address:"",chainId:"",pubKey:"",addressList:[]});break;case ie.connectionChanged:{var q=P;R.setConnectedInfo(q);break}default:throw new Error("No method in bn.onMessage, ".concat(E))}},t}(),Gt=new Lt,xn=(t=>(t.EVM="EVM",t.SOL="SOL",t))(xn||{}),un=(t=>(t.privateKey="privateKey",t.seedPhrase="hd",t))(un||{}),fn=(t=>(t.requestConnect="requestConnect",t.checkConnectedWallet="checkConnectedWallet",t.disconnect="disconnect",t.switchChain="switchChain",t.requestAutoSign="requestAutoSign",t.eventWalletLockedChanged="eventWalletLockedChanged",t.eventAutoSignEnabledChanged="eventAutoSignEnabledChanged",t.eventConnectedWalletsChanged="eventConnectedWalletsChanged",t.eventConnectedChainIdChanged="eventConnectedChainIdChanged",t))(fn||{}),Pe=()=>{try{return!!window?.binancew3w?.isExtension}catch{return!1}},Ue=t=>{let e=Le();return e?e.checkSupportFeature(t):!1},Le=()=>Pe()?window.binancew3w?.wallet:null,_e=()=>Le(),Ze=Ar(86296),Ot=Ar.n(Ze);const Yt=Ze;var Jt=[fn.requestConnect,fn.checkConnectedWallet,fn.disconnect,fn.switchChain,fn.requestAutoSign,fn.eventWalletLockedChanged,fn.eventAutoSignEnabledChanged,fn.eventConnectedWalletsChanged,fn.eventConnectedChainIdChanged],en=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=e||{},f=s.onBeforeRequest,d=s.onResponse;return T(I().mark(function h(){var E,P,R,q,te,ne=arguments;return I().wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:for(E=ne.length,P=new Array(E),R=0;R<E;R++)P[R]=ne[R];return q=ht.multichainWallet[t],ge.next=4,q.apply({},P);case 4:if(te=ge.sent,!d){ge.next=8;break}return ge.next=8,Promise.resolve(d());case 8:return ge.abrupt("return",te);case 9:case"end":return ge.stop()}},h)}))},Vn=function(t){"use strict";z(s,t);var e=Ie(s);function s(){B(this,s);var d;return d=e.apply(this,arguments),d.version="",d.autoSignEnabled=!1,d.walletLocked=!1,d.extensionId="",d.requestConnect=en("requestConnect"),d.checkConnectedWallet=en("checkConnectedWallet"),d.getWalletInfo=en("getWalletInfo"),d.disconnect=en("disconnect"),d.switchChain=en("switchChain"),d.requestAutoSign=en("requestAutoSign"),d.signOrder=en("signOrder"),d.requestConnectWithSAS=en("requestConnectWithSAS",{onResponse:function(){return d.getExtInfo()}}),d.requestEnableSAS=en("requestEnableSAS"),d.getSASKeyshare=en("getSASKeyshare"),d.syncSASStatus=en("syncSASStatus"),d.getConnectedWalletAndProofKey=en("getConnectedWalletAndProofKey"),d.getSASProofKeySignature=en("getSASProofKeySignature"),d}var f=s.prototype;return f.init=function(){var h=this;return T(I().mark(function E(){var P;return I().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:h.on("autoSignEnabledChanged",function(te){h.autoSignEnabled=te}),h.on("walletLockedChanged",function(te){h.walletLocked=te}),P=function(){return h.getExtInfo()},setTimeout(P,200);case 4:case"end":return q.stop()}},E)}))()},f.getExtInfo=function(){var h=this;return T(I().mark(function E(){var P,R,q,te,ne;return I().wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return ge.next=2,ht.multichainWallet.getExtensionInfo.call({});case 2:P=ge.sent,R=P.extensionId,q=P.version,te=P.autoSignEnabled,ne=P.walletLocked,h.extensionId=R,h.version=q,h.autoSignEnabled=te,h.walletLocked=ne;case 11:case"end":return ge.stop()}},E)}))()},f.checkSupportFeature=function(h){return Jt.includes(h)},f.onReceiveMessageEvent=function(h){var E=h.eventType,P=h.args;this.emit(E,P)},s}(Yt),kn=new Vn;kn.init();var ir=function(t){t.type===S.functionCallResult?Er.onReceiveMessage(t):t.type===S.contentScriptEvent&&(t.isMultichainEvent?kn.onReceiveMessageEvent(t):Gt.onReceiveContentScriptEventMessage(t))},Hn=new Set,tr=function(){var t=setTimeout(function(){console.debug("[initMessageListener] timeout"),A(!0)},4e3);window.addEventListener("message",function(e){if(e.source===window){var s=e.data;if(!(!s||!s[b])){if(s.contentScriptInitDone){clearTimeout(t),console.debug("[initMessageListener] --- receive contentScriptInitDone ---"),A(!0);return}if(s.ackMessageId){Hn.add(s.ackedMessageIds);return}console.debug("[initMessageListener] --- receive contentscript message ---",s),ir(s)}}})},gr=function(t,e,s,f){if(s==="a"&&!f)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!f:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?f:s==="a"?f.call(t):f?f.value:e.get(t)},br=function(t,e,s,f,d){if(f==="m")throw new TypeError("Private method is not writable");if(f==="a"&&!d)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!d:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return f==="a"?d.call(t,s):d?d.value=s:e.set(t,s),s},pr;function _n(t){const e=({register:s})=>s(t);try{window.dispatchEvent(new Qn(e))}catch(s){console.error(`wallet-standard:register-wallet event could not be dispatched
|
||
`,s)}try{window.addEventListener("wallet-standard:app-ready",({detail:s})=>e(s))}catch(s){console.error(`wallet-standard:app-ready event listener could not be added
|
||
`,s)}}class Qn extends Event{get detail(){return gr(this,pr,"f")}get type(){return"wallet-standard:register-wallet"}constructor(e){super("wallet-standard:register-wallet",{bubbles:!1,cancelable:!1,composed:!1}),pr.set(this,void 0),br(this,pr,e,"f")}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}pr=new WeakMap;function Zn(t){var e;_n(t);try{((e=window.navigator).wallets||(e.wallets=[])).push(({register:s})=>s(t))}catch(s){console.error(`window.navigator.wallets could not be pushed
|
||
`,s)}}function Mn(t,e){for(var s=0;s<e.length;s++){var f=e[s];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(t,f.key,f)}}function Ln(t,e,s){return e&&Mn(t.prototype,e),s&&Mn(t,s),t}function Rn(t,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}var In;(function(t){t.normalConnect="normalConnect",t.multilConnect="multiConnect",t.requestDirectSign="requestDirectSign",t.disconnect="disconnect",t.requestPubKey="requestPubKey",t.changeConnectedChainId="changeConnectedChainId",t.changeConnectedAddress="changeConnectedAddress",t.requestWalletKitSign="requestWalletKitSign",t.requestReportSign="requestReportSign",t.requestReportConnect="requestReportConnect",t.requestRPC="requestRPC",t.requestCommonChainHTTPCall="requestCommonChainHTTPCall",t.previewTransaction="previewTransaction",t.previewMessage="previewMessage",t.reportError="reportError",t.universalSign="universalSign",t.requestIsUniversalSign="requestIsUniversalSign",t.requestIsNewSuiSign="requestIsNewSuiSign",t.requestHasStakedBabylon="requestHasStakedBabylon",t.reportMethodCalled="reportMethodCalled",t.dappLog="dappLog",t.addEvmChain="addEvmChain"})(In||(In={}));var Xn;(function(t){t.setResponse="setResponse",t.setError="setError"})(Xn||(Xn={}));var $n;(function(t){t.setVersion="setVersion",t.updateConnectedInfo="updateConnectedInfo"})($n||($n={}));var hn;(function(t){t.requestSignBip122OnlyAfterPreview="requestSignBip122OnlyAfterPreview",t.requestBinanceChainIdAndNetworkId="requestBinanceChainIdAndNetworkId",t.eip155AddAsset="eip155AddAsset",t.bip122GetBlockHeight="bip122GetBlockHeight",t.bip122PushTx="bip122PushTx",t.bip122PreviewTx="bip122PreviewTx",t.bip122GetUtxos="bip122GetUtxos",t.bip122GetNetworkFees="bip122GetNetworkFees",t.bip122GetBalance="bip122GetBalance",t.requestTonAddressByManifest="requestTonAddressByManifest",t.sign="sign",t.commonTgeSign="commonTgeSign",t.commonTgeVerify="commonTgeVerify"})(hn||(hn={}));var an;(function(t){t.mpChangeConnectedChainId="mpChangeConnectedChainId",t.mpChangeConnectedAddress="mpChangeConnectedAddress",t.mpDisconnect="mpDisconnect"})(an||(an={}));var Tn="Binance Wallet",Sn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMwIiBoZWlnaHQ9IjMwIiBmaWxsPSIjMEIwRTExIi8+CjxwYXRoIGQ9Ik01IDE1TDcuMjU4MDYgMTIuNzQxOUw5LjUxNjEzIDE1TDcuMjU4MDYgMTcuMjU4MUw1IDE1WiIgZmlsbD0iI0YwQjkwQiIvPgo8cGF0aCBkPSJNOC44NzA5NyAxMS4xMjlMMTUgNUwyMS4xMjkgMTEuMTI5TDE4Ljg3MSAxMy4zODcxTDE1IDkuNTE2MTNMMTEuMTI5IDEzLjM4NzFMOC44NzA5NyAxMS4xMjlaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0xMi43NDE5IDE1TDE1IDEyLjc0MTlMMTcuMjU4MSAxNUwxNSAxNy4yNTgxTDEyLjc0MTkgMTVaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0xMS4xMjkgMTYuNjEyOUw4Ljg3MDk3IDE4Ljg3MUwxNSAyNUwyMS4xMjkgMTguODcxTDE4Ljg3MSAxNi42MTI5TDE1IDIwLjQ4MzlMMTEuMTI5IDE2LjYxMjlaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0yMC40ODM5IDE1TDIyLjc0MTkgMTIuNzQxOUwyNSAxNUwyMi43NDE5IDE3LjI1ODFMMjAuNDgzOSAxNVoiIGZpbGw9IiNGMEI5MEIiLz4KPC9zdmc+Cg==",Bn="https://www.binance.com/en/web3wallet",Fn;(function(t){t.MISREPORT="MISREPORT",t.UNREPORT="UNREPORT"})(Fn||(Fn={}));var bt;(function(t){t.NOT_PHISHING_OR_SCAM="NOT_PHISHING_OR_SCAM",t.PHISHING_SITES="PHISHING_SITES",t.FAKE_TOKEN_SALES_AND_AIRDROPS="FAKE_TOKEN_SALES_AND_AIRDROPS",t.FAKE_WALLETS_AND_APPS="FAKE_WALLETS_AND_APPS",t.PONZI_SCHEME="PONZI_SCHEME",t.OTHERS="OTHERS"})(bt||(bt={}));var ve;(function(t){t.disconnectTonInMP="disconnectTonInMP",t.tonHttpBridgeTxFinished="tonHttpBridgeTxFinished",t.tonHttpBridgeConnectFinished="tonHttpBridgeConnectFinished",t.tonJSridgeConnectFinished="tonJSBridgeConnectFinished",t.sseError="sseError",t.sseMessage="sseMessage",t.tonHttpBridgeReportTx="tonHttpBridgeReportTx",t.showToast="showToast"})(ve||(ve={}));var je;(function(t){t.walletBuildTx="wallet_buildTx",t.walletSignTx="wallet_signTx",t.earnSolanaWeb3js="earnSolanaWeb3js",t.earnSolanaSPL="earnSolanaSPL",t.earnSui="earnSui",t.setConnectionInfo="setConnectionInfo",t.setSSEInfo="setSSEInfo",t.setConnectionInfoError="setConnectionInfoError",t.emit="emit",t.tonDisconnectByNative="tonDisconnectByNative"})(je||(je={}));var at;(function(t){t.GET="get",t.POST="post"})(at||(at={}));var Ne="method-",Et;(function(t){t.PAGE_READY="translate_page_ready",t.FETCH_TRANSLATION="fetch_translation",t.FETCH_TRANSLATION_TOO_MANY="translate_fail_too_many",t.TRANSLATE_SUCCESS="translate_success",t.TRANSLATE_FAIL="translate_fail",t.TRANSLATE_PAGE="translate_page",t.REFRESH_TRANSLATE="refresh_translate",t.TANSLATE_SHOW_ORIGINAL="translate_show_original",t[t.REQUEST=Ne+"request"]="REQUEST",t[t.GET_TRANSLATE_SETTINGS=Ne+"get_translate_settings"]="GET_TRANSLATE_SETTINGS",t.CLEAR_CACHE="translate_clear_cache",t.JUMP_TO_MP_PAGE="jump_to_mp_page"})(Et||(Et={}));var vn=null,mn=function(t){var e=vn.find(function(s){return s.key===t});return e?e.text:""},Nn=function(t){var e=vn.find(function(s){var f;return((f=s.alias)===null||f===void 0?void 0:f.includes(t))||s.key===t});return e?e.key:""},Dn="000000000019d6689c085ae165831e93",Gn="000000000933ea01ad0ee984209779ba",$r="00000008819873e925422c1ff0f99f7c",Vr="0f9188f13cb7b2c71f2a335e3a4fc328",vi="1",Pi="apt-1",et="cosmoshub-4",it="sui-1",$e="ton-1",mt="4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ",It="0x2b6653dc",sn="CT_784",Wn="1",Or="56",Nr="CT_0",wi="91b171bb158e2d3848fa23a9f1c25182",Ti="128ea318539862c0a06b745981300d52",di=null;function mi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function So(t,e,s){return mi()?So=Reflect.construct:So=function(d,h,E){var P=[null];P.push.apply(P,h);var R=Function.bind.apply(d,P),q=new R;return E&&N(q,E.prototype),q},So.apply(null,arguments)}function Xu(t,e,s){return So.apply(null,arguments)}function df(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Yu(t){var e=typeof Map=="function"?new Map:void 0;return Yu=function(f){if(f===null||!df(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(f))return e.get(f);e.set(f,d)}function d(){return Xu(f,arguments,de(this).constructor)}return d.prototype=Object.create(f.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),N(d,f)},Yu(t)}function hf(t){return Yu(t)}var gu=function(t){"use strict";z(s,t);var e=Ie(s);function s(d,h){B(this,s);var E;return E=e.call(this),E.code=d,E.message=h,E}var f=s.prototype;return f.toString=function(){return"".concat(this.message," (").concat(this.code,")")},s}(hf(Error)),Mi;(function(t){t[t.USER_REJECTED=4001]="USER_REJECTED",t[t.UNAUTHORIZED=4100]="UNAUTHORIZED",t[t.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",t[t.DISCONNECTED=4900]="DISCONNECTED",t[t.CHAIN_DISCONNECTED=4901]="CHAIN_DISCONNECTED"})(Mi||(Mi={}));const Ni="1.21.3",pf=t=>t,pa=t=>t,Ju=()=>`viem@${Ni}`;class Ns extends Error{constructor(e,s={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:Ju()});const f=s.cause instanceof Ns?s.cause.details:s.cause?.message?s.cause.message:s.details,d=s.cause instanceof Ns&&s.cause.docsPath||s.docsPath;this.message=[e||"An error occurred.","",...s.metaMessages?[...s.metaMessages,""]:[],...d?[`Docs: https://viem.sh${d}.html${s.docsSlug?`#${s.docsSlug}`:""}`]:[],...f?[`Details: ${f}`]:[],`Version: ${this.version}`].join(`
|
||
`),s.cause&&(this.cause=s.cause),this.details=f,this.docsPath=d,this.metaMessages=s.metaMessages,this.shortMessage=e}walk(e){return Qu(this,e)}}function Qu(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t?Qu(t.cause,e):e?null:t}class Yg extends Ns{constructor({consumed:e,length:s}){super(`Consumed bytes (${e}) is shorter than data length (${s-1}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DataLengthTooLongError"})}}class v0 extends Ns{constructor({length:e,dataLength:s}){super(`Data length (${s-1}) is shorter than consumed bytes length (${e-1}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DataLengthTooShortError"})}}class w0 extends Ns{constructor({max:e,min:s,signed:f,size:d,value:h}){super(`Number "${h}" is not in safe ${d?`${d*8}-bit ${f?"signed":"unsigned"} `:""}integer range ${e?`(${s} to ${e})`:`(above ${s})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class ys extends Ns{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class Ad extends Ns{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class Qa extends Ns{constructor(e){super(`Hex value "${e}" is an odd length (${e.length}). It must be an even length.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexValueError"})}}class us extends Ns{constructor({nextOffset:e,offset:s}){super(`Next offset (${e}) is greater than previous offset + consumed bytes (${s})`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffsetOutOfBoundsError"})}}class Ve extends Ns{constructor({givenSize:e,maxSize:s}){super(`Size cannot exceed ${s} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}class Ye extends Ns{constructor({offset:e,position:s,size:f}){super(`Slice ${s==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${f}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class St extends Ns{constructor({size:e,targetSize:s,type:f}){super(`${f.charAt(0).toUpperCase()}${f.slice(1).toLowerCase()} size (${e}) exceeds padding size (${s}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}function At(t,{dir:e,size:s=32}={}){return typeof t=="string"?qt(t,{dir:e,size:s}):cn(t,{dir:e,size:s})}function qt(t,{dir:e,size:s=32}={}){if(s===null)return t;const f=t.replace("0x","");if(f.length>s*2)throw new St({size:Math.ceil(f.length/2),targetSize:s,type:"hex"});return`0x${f[e==="right"?"padEnd":"padStart"](s*2,"0")}`}function cn(t,{dir:e,size:s=32}={}){if(s===null)return t;if(t.length>s)throw new St({size:t.length,targetSize:s,type:"bytes"});const f=new Uint8Array(s);for(let d=0;d<s;d++){const h=e==="right";f[h?d:s-d-1]=t[h?d:t.length-d-1]}return f}function pn(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Kn(t){return pn(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}function yr(t,{size:e}){if(Kn(t)>e)throw new Ve({givenSize:Kn(t),maxSize:e})}function ar(t,e){const s=typeof e=="string"?{to:e}:e,f=s.to;return f==="number"?Oi(t,s):f==="bigint"?Yn(t,s):f==="string"?Ui(t,s):f==="boolean"?Cr(t,s):hexToBytes(t,s)}function Yn(t,e={}){const{signed:s}=e;e.size&&yr(t,{size:e.size});const f=BigInt(t);if(!s)return f;const d=(t.length-2)/2,h=(1n<<BigInt(d)*8n-1n)-1n;return f<=h?f:f-BigInt(`0x${"f".padStart(d*2,"f")}`)-1n}function Cr(t,e={}){let s=t;if(e.size&&(yr(s,{size:e.size}),s=trim(s)),trim(s)==="0x00")return!1;if(trim(s)==="0x01")return!0;throw new InvalidHexBooleanError(s)}function Oi(t,e={}){return Number(Yn(t,e))}function Ui(t,e={}){let s=hexToBytes(t);return e.size&&(yr(s,{size:e.size}),s=trim(s,{dir:"right"})),new TextDecoder().decode(s)}const Tr=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Hr(t,e={}){return typeof t=="number"||typeof t=="bigint"?es(t,e):typeof t=="string"?Uo(t,e):typeof t=="boolean"?ur(t,e):xi(t,e)}function ur(t,e={}){const s=`0x${Number(t)}`;return typeof e.size=="number"?(yr(s,{size:e.size}),At(s,{size:e.size})):s}function xi(t,e={}){let s="";for(let d=0;d<t.length;d++)s+=Tr[t[d]];const f=`0x${s}`;return typeof e.size=="number"?(yr(f,{size:e.size}),At(f,{dir:"right",size:e.size})):f}function es(t,e={}){const{signed:s,size:f}=e,d=BigInt(t);let h;f?s?h=(1n<<BigInt(f)*8n-1n)-1n:h=2n**(BigInt(f)*8n)-1n:typeof t=="number"&&(h=BigInt(Number.MAX_SAFE_INTEGER));const E=typeof h=="bigint"&&s?-h-1n:0;if(h&&d>h||d<E){const R=typeof t=="bigint"?"n":"";throw new w0({max:h?`${h}${R}`:void 0,min:`${E}${R}`,signed:s,size:f,value:`${t}${R}`})}const P=`0x${(s&&d<0?(1n<<BigInt(f*8))+BigInt(d):d).toString(16)}`;return f?At(P,{size:f}):P}const xs=new TextEncoder;function Uo(t,e={}){const s=xs.encode(t);return xi(s,e)}var Is=Ar(10326),ga=Ar(36533).Buffer,ya=function(){return new Date().getTime()+Math.floor(Math.random()*1e3)},Ic=function(t){window.bn.miniProgram.postMessage(t)},el=function(e){return new Proxy(e,{get:function(s,f,d){if(s.hasOwnProperty(f))return Reflect.get(s,f,d);var h=String(f),E=Reflect.get(s,f,d);return typeof E=="function"?new Proxy(E,{apply:function(){var P=_async_to_generator(regeneratorRuntime.mark(function R(q,te,ne){var ue,ge;return regeneratorRuntime.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:if(ue=Reflect.apply(q,te,ne),!(f!=="on"&&!String(f).startsWith("_"))){pe.next=18;break}if(!_instanceof(ue,Promise)){pe.next=17;break}return pe.prev=3,pe.next=6,ue;case 6:return ge=pe.sent,console.log(q._namespace,"\u5F02\u6B65\u51FD\u6570 ".concat(h," \u6210\u529F:"),ge),pe.abrupt("return",ge);case 11:throw pe.prev=11,pe.t0=pe.catch(3),console.error(q._namespace,"\u5F02\u6B65\u51FD\u6570 ".concat(h," \u5931\u8D25:"),pe.t0.message),pe.t0;case 15:pe.next=18;break;case 17:console.log(q._namespace,"\u51FD\u6570 ".concat(h,":"),ne,ue);case 18:return pe.abrupt("return",ue);case 19:case"end":return pe.stop()}},R,null,[[3,11]])}));return function(R,q,te){return P.apply(this,arguments)}}()}):(String(f).startsWith("_")||console.log(s._namespace,"\u5C5E\u6027 ".concat(h,":"),E),E)}})},tl=function(t){if(typeof t=="string")return t.startsWith("0x"),t;if(Rn(t,Uint8Array)||ga.isBuffer(t))return"0x"+ga.from(t).toString("hex");if(typeof t=="object")return JSON.stringify(t);throw new Error("Unsupported message format")},mv=function(t,e){var s=J(t,2),f=s[0],d=s[1],h=typeof f.toLowerCase()=="string"&&e===f.toLowerCase(),E=h?f:d,P=h?d:f;return[E,tl(P)]},Jg=function(t,e,s){var f=J(t,2),d=f[0],h=f[1],E=typeof d.toLowerCase()=="string"&&s===d.toLowerCase(),P=E?d:h,R=E?h:d,q=typeof R=="string"?JSON.parse(R):R,te=e!==Is.SignTypedDataVersion.V1?Is.TypedDataUtils.eip712Hash(q,e):"";return{data:Hr(te),raw:typeof R=="string"?R:JSON.stringify(R),address:P,version:e}},_0=function(t){t.on(an.mpChangeConnectedAddress,function(){t.isBinance&&location.reload()}),t.on(an.mpDisconnect,function(){t.isBinance&&location.reload()})};const E0=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(t=>[t.name,t]),ey=new Map(E0);class S0 extends Error{name="NonError";constructor(e){super(S0._prepareSuperMessage(e))}static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{return String(e)}}}const A0=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],gf=new WeakSet,bv=t=>{gf.add(t);const e=t.toJSON();return gf.delete(t),e},x0=t=>ey.get(t)??Error,uo=({from:t,seen:e,to:s,forceEnumerable:f,maxDepth:d,depth:h,useToJSON:E,serialize:P})=>{if(!s)if(Array.isArray(t))s=[];else if(!P&&B0(t)){const q=x0(t.name);s=new q}else s={};if(e.push(t),h>=d)return s;if(E&&typeof t.toJSON=="function"&&!gf.has(t))return bv(t);const R=q=>uo({from:q,seen:[...e],forceEnumerable:f,maxDepth:d,depth:h,useToJSON:E,serialize:P});for(const[q,te]of Object.entries(t)){if(te&&te instanceof Uint8Array&&te.constructor.name==="Buffer"){s[q]="[object Buffer]";continue}if(te!==null&&typeof te=="object"&&typeof te.pipe=="function"){s[q]="[object Stream]";continue}if(typeof te!="function"){if(!te||typeof te!="object"){try{s[q]=te}catch{}continue}if(!e.includes(t[q])){h++,s[q]=R(t[q]);continue}s[q]="[Circular]"}}for(const{property:q,enumerable:te}of A0)typeof t[q]<"u"&&t[q]!==null&&Object.defineProperty(s,q,{value:B0(t[q])?R(t[q]):t[q],enumerable:f?!0:te,configurable:!0,writable:!0});return s};function I0(t,e={}){const{maxDepth:s=Number.POSITIVE_INFINITY,useToJSON:f=!0}=e;return typeof t=="object"&&t!==null?uo({from:t,seen:[],forceEnumerable:!0,maxDepth:s,depth:0,useToJSON:f,serialize:!0}):typeof t=="function"?`[Function: ${t.name||"anonymous"}]`:t}function xd(t,e={}){const{maxDepth:s=Number.POSITIVE_INFINITY}=e;if(t instanceof Error)return t;if(ty(t)){const f=x0(t.name);return uo({from:t,seen:[],to:new f,maxDepth:s,depth:0,serialize:!1})}return new S0(t)}function B0(t){return!!t&&typeof t=="object"&&"name"in t&&"message"in t&&"stack"in t}function ty(t){return!!t&&typeof t=="object"&&"message"in t&&!Array.isArray(t)}var ny=Ar(67918),yf={url:"",description:"",icon:"",name:""};function nl(){var t,e,s,f=document.title||"",d=((t=document.querySelector('meta[name="description"]'))===null||t===void 0?void 0:t.content)||"",h=((e=document.querySelector('link[rel="shortcut icon"]'))===null||e===void 0?void 0:e.href)||((s=document.querySelector('link[rel="icon"]'))===null||s===void 0?void 0:s.href);if(!h)h=window.location.origin+"/favicon.ico";else if(h&&!h.startsWith("http")){h.startsWith(".")&&(h=h.substring(1));var E=new URL(window.location.href).origin;h=E+h}var P=window.location.origin;yf={name:f,description:d,icon:h,url:P}}nl();var vv=new MutationObserver(function(){yf.url!==window.location.href&&nl()});vv.observe(document,{subtree:!0,childList:!0}),window.addEventListener("popstate",nl);var wv=history.pushState;history.pushState=function(){wv.apply(this,arguments),nl()};var rl=history.replaceState;history.replaceState=function(){rl.apply(this,arguments),nl()};function AS(){nl()}var ry=Ar(36533).Buffer,yu=function(t){"use strict";z(s,t);var e=Ie(s);function s(){B(this,s);var f;return f=e.call(this),le(Y(f),"isBinance",!0),le(Y(f),"_isLocal",!1),le(Y(f),"_callbacks",new Map),le(Y(f),"_namespace",void 0),le(Y(f),"_signMethod",void 0),le(Y(f),"_hiddenEnv",void 0),le(Y(f),"_connectedChainId",""),le(Y(f),"_connectedAddress",""),le(Y(f),"_connectedPubKey",""),le(Y(f),"_connectedAddressList",[]),le(Y(f),"address",""),le(Y(f),"networkVersion",""),le(Y(f),"chainId",""),le(Y(f),"_postMessageToMp",Ic),f._requestNormalConnect=(0,ny.debounce)(f._requestNormalConnect.bind(Y(f)),1e3,{leading:!0,trailing:!1}),f}return Ln(s,[{key:"_persistedKey",get:function(){return"".concat(this._namespace,"_bnAddress")}},{key:"setConnectedInfo",value:function(d){var h=d.chainId,E=d.address,P=d.pubKey,R=d.addressList;console.log("[provider log]: start setConnectedInfo",h,E,P,this._namespace),E&&this._setAddressCache({address:E,chainId:h}),!h&&!E?(console.log("[provider log]: start emit disconnect in base provider"),this.emit(an.mpDisconnect),this._setAddressCache({address:"",chainId:""})):(this._connectedChainId&&h!==this._connectedChainId&&(console.log("[provider log]: start emit mpChangeConnectedChainId in base provider",h),this.emit(an.mpChangeConnectedChainId,h)),this._connectedAddress&&E!==this._connectedAddress&&(console.log("[provider log]: start emit mpChangeConnectedAddress in base provider",E),this.emit(an.mpChangeConnectedAddress,E,R))),this._connectedChainId=h,this._connectedAddress=E,this._connectedPubKey=P,this._connectedAddressList=R||[]}},{key:"_requestNormalConnect",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,h._request(In.normalConnect,{chainId:d});case 2:return R.abrupt("return",R.sent);case 3:case"end":return R.stop()}},E)}))()}},{key:"_getAddressCache",value:function(){var d=localStorage.getItem(this._persistedKey);try{return JSON.parse(d||"")}catch{}}},{key:"_getAddressCacheAndSetConnected",value:function(){var d=this;return T(I().mark(function h(){var E,P;return I().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:if(E=localStorage.getItem(d._persistedKey),!E){q.next=9;break}if(P=JSON.parse(E||"{}"),!P.address){q.next=9;break}return q.next=6,d._requestChangeConnectedChainId();case 6:return q.next=8,d._requestChangeConnectedAddress(P.address);case 8:return q.abrupt("return",P);case 9:case"end":return q.stop()}},h)}))()}},{key:"_setAddressCache",value:function(d){localStorage.setItem(this._persistedKey,JSON.stringify(d||{}))}},{key:"_requestPubKey",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(In.requestPubKey,d));case 1:case"end":return R.stop()}},E)}))()}},{key:"_requestDisconnect",value:function(){var d=this;return T(I().mark(function h(){return I().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.abrupt("return",d._request(In.disconnect));case 1:case"end":return P.stop()}},h)}))()}},{key:"_requestChangeConnectedChainId",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(In.changeConnectedChainId,{chainId:d}));case 1:case"end":return R.stop()}},E)}))()}},{key:"_requestChangeConnectedAddress",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(In.changeConnectedAddress,d));case 1:case"end":return R.stop()}},E)}))()}},{key:"_requestWalletKitSign",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(In.requestWalletKitSign,d));case 1:case"end":return R.stop()}},E)}))()}},{key:"_requestReportSign",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(In.requestReportSign,d));case 1:case"end":return R.stop()}},E)}))()}},{key:"_requestReportConnect",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(In.requestReportConnect,d));case 1:case"end":return R.stop()}},E)}))()}},{key:"_requestSign",value:function(d){var h=d.data,E=d.signMethod,P=this;return T(I().mark(function R(){var q,te;return I().wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:if(P._signMethod){ue.next=2;break}throw new Error("No sign method");case 2:return q=typeof h=="string"?h:ry.from(h).toString("hex"),ue.next=5,P._request(In.requestDirectSign,{address:P._connectedAddress,hex:q,signMethod:P._signMethod||E,chainId:P._connectedChainId});case 5:return te=ue.sent,ue.abrupt("return",ry.from(te,"hex"));case 7:case"end":return ue.stop()}},R)}))()}},{key:"_universalSign",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(In.universalSign,Ae(be({},d),{address:h._connectedAddress,chainId:h._connectedChainId})));case 1:case"end":return R.stop()}},E)}))()}},{key:"_previewMessage",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(In.previewMessage,d));case 1:case"end":return R.stop()}},E)}))()}},{key:"_previewTransaction",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(In.previewTransaction,d));case 1:case"end":return R.stop()}},E)}))()}},{key:"_requestRPC",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(In.requestRPC,d));case 1:case"end":return R.stop()}},E)}))()}},{key:"_request",value:function(d){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=this;return T(I().mark(function P(){return I().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return console.log("_request called",d,h),q.abrupt("return",new Promise(function(te,ne){var ue=ya();console.log("setting id ".concat(ue)),E._callbacks.set(ue,function(ge,xe){ge?ne(ge):te(xe)}),Rn(h.payload,Error)&&(h.payload=I0(h)),E._postMessageToMp({method:d,payload:h,namespace:E._namespace,id:ue,hiddenEnv:E._hiddenEnv,metadata:yf})}));case 2:case"end":return q.stop()}},P)}))()}},{key:"setResponse",value:function(d,h){var E=this._callbacks.get(d);console.log("_setResponse id ".concat(d," result ").concat(h)),E?(E(null,h),this._callbacks.delete(d)):console.log("callback id: ".concat(d," not found"))}},{key:"setError",value:function(d,h){var E=this._callbacks.get(d);E&&(E(Rn(h,Error)?h:new Error(h),null),this._callbacks.delete(d))}},{key:"setConfig",value:function(d){var h=d.isDebug,E=d.address,P=d.chainId;if(h!==void 0&&(this._isLocal=h),E!==void 0){var R=(E||"").toLowerCase();this.address=R}P!==void 0&&(this.networkVersion=""+P,this.chainId="0x"+(Number(P)||1).toString(16))}},{key:"getIsUniversalSign",value:function(){var d=this;return T(I().mark(function h(){return I().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.abrupt("return",d._request(In.requestIsUniversalSign));case 1:case"end":return P.stop()}},h)}))()}},{key:"reportError",value:function(d){var h=ya();return this._postMessageToMp({method:In.reportError,payload:{code:d.code,message:d.message},namespace:this._namespace,id:h})}},{key:"reportMethodCalled",value:function(d){var h=d.method,E=d.params;try{var P=ya();return Ic({metadata:yf,method:In.reportMethodCalled,payload:{method:h,params:E},namespace:this._namespace,id:P})}catch{}}}]),s}(Yt),iy=function(t){"use strict";z(s,t);var e=Ie(s);function s(){B(this,s);var f,d;return f=e.call(this),le(Y(f),"_namespace","eip155"),le(Y(f),"_signMethod","ecdsa"),le(Y(f),"isMetaMask",!0),f.on(an.mpChangeConnectedChainId,function(h){h!==f._connectedChainId&&(f.setConfig({address:f._connectedAddress,chainId:h}),f.emit("chainChanged","0x"+Number(h).toString(16)))}),f.on(an.mpChangeConnectedAddress,function(h,E){h!==f._connectedAddress&&(f.setConfig({address:h,chainId:f._connectedChainId}),E?.length?f.emit("accountsChanged",E):f.emit("accountsChanged",[h]))}),f.on(an.mpDisconnect,function(){f.emit("disconnect"),f.emit("accountsChanged",[])}),f.emit("connect"),!((d=f._getAddressCache())===null||d===void 0)&&d.address&&setTimeout(function(){f.request({method:"eth_requestAccounts",params:[]})},100),f}return Ln(s,[{key:"isConnected",value:function(){return!0}},{key:"_validateChainId",value:function(d){if(!(!this._connectedChainId||!d)){var h=String(d.toString().startsWith("0x")?parseInt(d.toString(),16):Number(d));if(this._connectedChainId&&h!==String(this._connectedChainId))throw new gu(4901,"Chain ID mismatch. Expected: ".concat(this._connectedChainId,", Received: ").concat(h))}}},{key:"enable",value:function(){return console.log("enable() is deprecated, please use window.ethereum.request({method: 'eth_requestAccounts'}) instead."),this.request({method:"eth_requestAccounts",params:[]})}},{key:"disconnect",value:function(){console.log("disconnect called")}},{key:"send",value:function(d){var h={jsonrpc:"2.0",id:d.id,result:""};switch(d.method){case"eth_accounts":case"eth_coinbase":h.result=this._ethAccounts();break;case"net_version":h.result=this._connectedChainId;break;case"eth_chainId":h.result=this._connectedChainId?"0x"+Number(this._connectedChainId).toString(16):"";break;default:throw new gu(4200,"Method not supported: ".concat(d.method))}return h}},{key:"sendAsync",value:function(d,h){var E=this;Array.isArray(d)?Promise.all(d.map(function(P){return E.request(P)})).then(function(P){return h(null,P)}).catch(function(P){return h(P,null)}):this.request(d).then(function(P){return h(null,P)}).catch(function(P){return h(P,null)})}},{key:"_ethAccounts",value:function(){return this._connectedAddress?[this._connectedAddress]:[]}},{key:"_ethAccountsWithCheck",value:function(){var d=this;return T(I().mark(function h(){var E,P,R;return I().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=3,d._request("checkCurrentConnection");case 3:if(P=te.sent,!(P&&P.addressList)){te.next=6;break}return te.abrupt("return",P.addressList);case 6:if(!(!((E=d._connectedAddressList)===null||E===void 0)&&E.length)){te.next=8;break}return te.abrupt("return",d._connectedAddressList);case 8:return R=d._connectedAddress,te.abrupt("return",R?[R]:[]);case 10:case"end":return te.stop()}},h)}))()}},{key:"_ethRequestAccounts",value:function(){var d=this;return T(I().mark(function h(){var E;return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,d._request("multiAddressConnect");case 2:return E=R.sent,d.setConfig({address:E[0],chainId:d._connectedChainId}),R.abrupt("return",E);case 5:case"end":return R.stop()}},h)}))()}},{key:"_ethSign",value:function(d){var h=J(d,2),E=h[0],P=h[1],R=Hr(P),q={message:R,address:E};throw this._requestReportConnect(q),new Error("method not supported")}},{key:"_personalSign",value:function(d){var h=J(mv(d,this._connectedAddress||""),2),E=h[0],P=h[1];return this._requestWalletKitSign({method:"preview_message",params:{data:P,address:E}})}},{key:"_signTypedData",value:function(d,h){var E=Jg(d,h,this._connectedAddress||"");return this._requestWalletKitSign({method:"preview_message",params:E})}},{key:"request",value:function(d){var h=this;return T(I().mark(function E(){var P,R,q,te;return I().wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,h.getIsUniversalSign();case 2:P=ue.sent,R=d.method,q=d.params,console.log("provider called with",d),ue.t0=R,ue.next=ue.t0==="eth_requestAccounts"?8:ue.t0==="eth_accounts"||ue.t0==="eth_coinbase"?9:ue.t0==="net_version"?10:ue.t0==="eth_chainId"?11:ue.t0==="wallet_switchEthereumChain"?12:ue.t0==="eth_sign"?13:ue.t0==="personal_sign"?14:ue.t0==="eth_signTypedData_v3"?19:ue.t0==="eth_signTypedData_v4"?24:ue.t0==="eth_signTypedData"?29:ue.t0==="eth_sendTransaction"?34:ue.t0==="wallet_watchAsset"?41:ue.t0==="wallet_addEthereumChain"?44:ue.t0==="wallet_requestPermissions"?47:ue.t0==="wallet_revokePermissions"?48:ue.t0==="eth_newFilter"||ue.t0==="eth_newBlockFilter"||ue.t0==="eth_newPendingTransactionFilter"||ue.t0==="eth_uninstallFilter"||ue.t0==="eth_subscribe"||ue.t0==="wallet_getCapabilities"?49:52;break;case 8:return ue.abrupt("return",h._ethRequestAccounts());case 9:return ue.abrupt("return",h._ethAccountsWithCheck());case 10:return ue.abrupt("return",h._connectedChainId);case 11:return ue.abrupt("return",h._connectedChainId?"0x"+Number(h._connectedChainId).toString(16):"");case 12:return ue.abrupt("return",h._requestChangeConnectedChainId(String(Number(q[0].chainId))));case 13:return ue.abrupt("return",h._ethSign(q));case 14:if(!P){ue.next=18;break}return ue.next=17,h._universalSign({type:"signMessage",request:d});case 17:return ue.abrupt("return",ue.sent.signature);case 18:return ue.abrupt("return",h._personalSign(q));case 19:if(!P){ue.next=23;break}return ue.next=22,h._universalSign({type:"signMessage",request:d});case 22:return ue.abrupt("return",ue.sent.signature);case 23:return ue.abrupt("return",h._signTypedData(q,Is.SignTypedDataVersion.V3));case 24:if(!P){ue.next=28;break}return ue.next=27,h._universalSign({type:"signMessage",request:d});case 27:return ue.abrupt("return",ue.sent.signature);case 28:return ue.abrupt("return",h._signTypedData(q,Is.SignTypedDataVersion.V4));case 29:if(!P){ue.next=33;break}return ue.next=32,h._universalSign({type:"signMessage",request:d});case 32:return ue.abrupt("return",ue.sent.signature);case 33:return ue.abrupt("return",h._signTypedData(q,Is.SignTypedDataVersion.V1));case 34:if(q[0]&&typeof q[0]=="object"&&q[0].chainId&&h._validateChainId(q[0].chainId),h._requestReportSign(d),!P){ue.next=40;break}return ue.next=39,h._universalSign({type:"sendTransaction",request:d});case 39:return ue.abrupt("return",ue.sent.txHash);case 40:return ue.abrupt("return",h._requestWalletKitSign({method:"preview_smart_contract",params:q[0]}));case 41:return ue.next=43,h._request(hn.eip155AddAsset,q);case 43:return ue.abrupt("return",ue.sent);case 44:return ue.next=46,h._request(In.addEvmChain,q[0]);case 46:return ue.abrupt("return",ue.sent);case 47:throw new Error("Not supported");case 48:return ue.abrupt("return",h._requestDisconnect());case 49:throw te=new Error("not supported"),te.code=4200,te;case 52:return ue.abrupt("return",h._requestRPC({method:R,params:q,chainId:h._connectedChainId}));case 53:case"end":return ue.stop()}},E)}))()}}]),s}(yu),Ir=Ar(36533);const mf=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,sy=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,_v=235;function Ev(t){return t.length>_v?!1:t.includes("@")?mf.test(t):sy.test(t)}function il(t,e="at"){const s=t.toLowerCase();let f;if(s.includes("@")){if(!mf.test(s))throw new Error(`Invalid SuiNS name ${t}`);const[d,h]=s.split("@");f=[...d?d.split("."):[],h]}else{if(!sy.test(s))throw new Error(`Invalid SuiNS name ${t}`);f=s.split(".").slice(0,-1)}return e==="dot"?`${f.join(".")}.sui`:`${f.slice(0,-1).join(".")}@${f[f.length-1]}`}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function qs(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Id(t){if(!qs(t))throw new Error("Uint8Array expected")}function oy(t,e){return Array.isArray(e)?e.length===0?!0:t?e.every(s=>typeof s=="string"):e.every(s=>Number.isSafeInteger(s)):!1}function k0(t){if(typeof t!="function")throw new Error("function expected");return!0}function Bc(t,e){if(typeof e!="string")throw new Error(`${t}: string expected`);return!0}function sl(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function Bd(t){if(!Array.isArray(t))throw new Error("array expected")}function ma(t,e){if(!oy(!0,e))throw new Error(`${t}: array of strings expected`)}function nn(t,e){if(!oy(!1,e))throw new Error(`${t}: array of numbers expected`)}function wn(...t){const e=h=>h,s=(h,E)=>P=>h(E(P)),f=t.map(h=>h.encode).reduceRight(s,e),d=t.map(h=>h.decode).reduce(s,e);return{encode:f,decode:d}}function bn(t){const e=typeof t=="string"?t.split(""):t,s=e.length;ma("alphabet",e);const f=new Map(e.map((d,h)=>[d,h]));return{encode:d=>(Bd(d),d.map(h=>{if(!Number.isSafeInteger(h)||h<0||h>=s)throw new Error(`alphabet.encode: digit index outside alphabet "${h}". Allowed: ${t}`);return e[h]})),decode:d=>(Bd(d),d.map(h=>{Bc("alphabet.decode",h);const E=f.get(h);if(E===void 0)throw new Error(`Unknown letter: "${h}". Allowed: ${t}`);return E}))}}function cr(t=""){return Bc("join",t),{encode:e=>(ma("join.decode",e),e.join(t)),decode:e=>(Bc("join.decode",e),e.split(t))}}function zr(t,e="="){return sl(t),Bc("padding",e),{encode(s){for(ma("padding.encode",s);s.length*t%8;)s.push(e);return s},decode(s){ma("padding.decode",s);let f=s.length;if(f*t%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;f>0&&s[f-1]===e;f--)if((f-1)*t%8===0)throw new Error("padding: invalid, string has too much padding");return s.slice(0,f)}}}function _i(t){return k0(t),{encode:e=>e,decode:e=>t(e)}}function Bs(t,e,s){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(s<2)throw new Error(`convertRadix: invalid to=${s}, base cannot be less than 2`);if(Bd(t),!t.length)return[];let f=0;const d=[],h=Array.from(t,P=>{if(sl(P),P<0||P>=e)throw new Error(`invalid integer: ${P}`);return P}),E=h.length;for(;;){let P=0,R=!0;for(let q=f;q<E;q++){const te=h[q],ne=e*P,ue=ne+te;if(!Number.isSafeInteger(ue)||ne/e!==P||ue-te!==ne)throw new Error("convertRadix: carry overflow");const ge=ue/s;P=ue%s;const xe=Math.floor(ge);if(h[q]=xe,!Number.isSafeInteger(xe)||xe*s+P!==ue)throw new Error("convertRadix: carry overflow");if(R)xe?R=!1:f=q;else continue}if(d.push(P),R)break}for(let P=0;P<t.length-1&&t[P]===0;P++)d.push(0);return d.reverse()}const Di=(t,e)=>e===0?t:Di(e,t%e),ol=(t,e)=>t+(e-Di(t,e)),kd=(()=>{let t=[];for(let e=0;e<40;e++)t.push(2**e);return t})();function Ao(t,e,s,f){if(Bd(t),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(s<=0||s>32)throw new Error(`convertRadix2: wrong to=${s}`);if(ol(e,s)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${s} carryBits=${ol(e,s)}`);let d=0,h=0;const E=kd[e],P=kd[s]-1,R=[];for(const q of t){if(sl(q),q>=E)throw new Error(`convertRadix2: invalid data word=${q} from=${e}`);if(d=d<<e|q,h+e>32)throw new Error(`convertRadix2: carry overflow pos=${h} from=${e}`);for(h+=e;h>=s;h-=s)R.push((d>>h-s&P)>>>0);const te=kd[h];if(te===void 0)throw new Error("invalid carry");d&=te-1}if(d=d<<s-h&P,!f&&h>=e)throw new Error("Excess padding");if(!f&&d>0)throw new Error(`Non-zero padding: ${d}`);return f&&h>0&&R.push(d>>>0),R}function Td(t){sl(t);const e=2**8;return{encode:s=>{if(!qs(s))throw new Error("radix.encode input should be Uint8Array");return Bs(Array.from(s),e,t)},decode:s=>(nn("radix.decode",s),Uint8Array.from(Bs(s,t,e)))}}function Zo(t,e=!1){if(sl(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(ol(8,t)>32||ol(t,8)>32)throw new Error("radix2: carry overflow");return{encode:s=>{if(!qs(s))throw new Error("radix2.encode input should be Uint8Array");return Ao(Array.from(s),8,t,!e)},decode:s=>(nn("radix2.decode",s),Uint8Array.from(Ao(s,t,8,e)))}}function mu(t){return k0(t),function(...e){try{return t.apply(null,e)}catch{}}}function Cd(t,e){return sl(t),k0(e),{encode(s){if(!qs(s))throw new Error("checksum.encode: input should be Uint8Array");const f=e(s).slice(0,t),d=new Uint8Array(s.length+t);return d.set(s),d.set(f,s.length),d},decode(s){if(!qs(s))throw new Error("checksum.decode: input should be Uint8Array");const f=s.slice(0,-t),d=s.slice(-t),h=e(f).slice(0,t);for(let E=0;E<t;E++)if(h[E]!==d[E])throw new Error("Invalid checksum");return f}}}const T0=null,Li=wn(Zo(4),bn("0123456789ABCDEF"),cr("")),xS=wn(Zo(5),bn("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),zr(5),cr("")),Sv=wn(Zo(5),bn("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),cr("")),C0=wn(Zo(5),bn("0123456789ABCDEFGHIJKLMNOPQRSTUV"),zr(5),cr("")),IS=wn(Zo(5),bn("0123456789ABCDEFGHIJKLMNOPQRSTUV"),cr("")),BS=wn(Zo(5),bn("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),cr(""),_i(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),ay=typeof Uint8Array.from([]).toBase64=="function"&&typeof Uint8Array.fromBase64=="function",bf=(t,e)=>{Bc("base64",t);const s=e?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,f=e?"base64url":"base64";if(t.length>0&&!s.test(t))throw new Error("invalid base64");return Uint8Array.fromBase64(t,{alphabet:f,lastChunkHandling:"strict"})},bu=ay?{encode(t){return Id(t),t.toBase64()},decode(t){return bf(t,!1)}}:wn(Zo(6),bn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),zr(6),cr("")),P0=wn(Zo(6),bn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),cr("")),Av=ay?{encode(t){return Id(t),t.toBase64({alphabet:"base64url"})},decode(t){return bf(t,!0)}}:wn(Zo(6),bn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),zr(6),cr("")),M0=wn(Zo(6),bn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),cr("")),Pd=t=>wn(Td(58),bn(t),cr("")),Md=Pd("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),O0=Pd("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),xv=Pd("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),Od=null,al=null,R0=t=>wn(Cd(4,e=>t(t(e))),Md),kS=null,N0=wn(bn("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),cr("")),cy=[996825010,642813549,513874426,1027748829,705979059];function kc(t){const e=t>>25;let s=(t&33554431)<<5;for(let f=0;f<cy.length;f++)(e>>f&1)===1&&(s^=cy[f]);return s}function vf(t,e,s=1){const f=t.length;let d=1;for(let h=0;h<f;h++){const E=t.charCodeAt(h);if(E<33||E>126)throw new Error(`Invalid prefix (${t})`);d=kc(d)^E>>5}d=kc(d);for(let h=0;h<f;h++)d=kc(d)^t.charCodeAt(h)&31;for(let h of e)d=kc(d)^h;for(let h=0;h<6;h++)d=kc(d);return d^=s,N0.encode(Ao([d%kd[30]],30,5,!1))}function Rd(t){const e=t==="bech32"?1:734539939,s=Zo(5),f=s.decode,d=s.encode,h=mu(f);function E(ne,ue,ge=90){Bc("bech32.encode prefix",ne),qs(ue)&&(ue=Array.from(ue)),nn("bech32.encode",ue);const xe=ne.length;if(xe===0)throw new TypeError(`Invalid prefix length ${xe}`);const pe=xe+7+ue.length;if(ge!==!1&&pe>ge)throw new TypeError(`Length ${pe} exceeds limit ${ge}`);const Se=ne.toLowerCase(),Ce=vf(Se,ue,e);return`${Se}1${N0.encode(ue)}${Ce}`}function P(ne,ue=90){Bc("bech32.decode input",ne);const ge=ne.length;if(ge<8||ue!==!1&&ge>ue)throw new TypeError(`invalid string length: ${ge} (${ne}). Expected (8..${ue})`);const xe=ne.toLowerCase();if(ne!==xe&&ne!==ne.toUpperCase())throw new Error("String must be lowercase or uppercase");const pe=xe.lastIndexOf("1");if(pe===0||pe===-1)throw new Error('Letter "1" must be present between prefix and data only');const Se=xe.slice(0,pe),Ce=xe.slice(pe+1);if(Ce.length<6)throw new Error("Data must be at least 6 characters long");const Fe=N0.decode(Ce).slice(0,-6),We=vf(Se,Fe,e);if(!Ce.endsWith(We))throw new Error(`Invalid checksum in ${ne}: expected "${We}"`);return{prefix:Se,words:Fe}}const R=mu(P);function q(ne){const{prefix:ue,words:ge}=P(ne,!1);return{prefix:ue,words:ge,bytes:f(ge)}}function te(ne,ue){return E(ne,d(ue))}return{encode:E,decode:P,encodeFromBytes:te,decodeToBytes:q,decodeUnsafe:R,fromWords:f,fromWordsUnsafe:h,toWords:d}}const Nd=Rd("bech32"),Iv=Rd("bech32m"),TS=null,lo=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function"?{encode(t){return Id(t),t.toHex()},decode(t){return Bc("hex",t),Uint8Array.fromHex(t)}}:wn(Zo(4),bn("0123456789abcdef"),cr(""),_i(t=>{if(typeof t!="string"||t.length%2!==0)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})),Ud=null,uy="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",Bv=(t,e)=>{if(typeof t!="string"||!Ud.hasOwnProperty(t))throw new TypeError(uy);if(!qs(e))throw new TypeError("bytesToString() expects Uint8Array");return Ud[t].encode(e)},PS=null,ly=(t,e)=>{if(!Ud.hasOwnProperty(t))throw new TypeError(uy);if(typeof e!="string")throw new TypeError("stringToBytes() expects string");return Ud[t].decode(e)},Dd=null,cl=t=>Md.encode(t),ba=t=>Md.decode(t);function ls(t){return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}const vu=8192;function Wi(t){if(t.length<vu)return btoa(String.fromCharCode(...t));let e="";for(var s=0;s<t.length;s+=vu){const f=t.slice(s,s+vu);e+=String.fromCharCode(...f)}return btoa(e)}function Tc(t){const e=t.startsWith("0x")?t.slice(2):t,s=e.length%2===0?e:`0${e}`,f=s.match(/[0-9a-fA-F]{2}/g)?.map(d=>parseInt(d,16))??[];if(f.length!==s.length/2)throw new Error(`Invalid hex string ${t}`);return Uint8Array.from(f)}function Cc(t){return t.reduce((e,s)=>e+s.toString(16).padStart(2,"0"),"")}function kv(t,e){switch(e){case"base58":return cl(t);case"base64":return Wi(t);case"hex":return Cc(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function MS(t,e){switch(e){case"base58":return fromBase58(t);case"base64":return fromBase64(t);case"hex":return fromHex(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function fy(t,e=["<",">"]){const[s,f]=e,d=[];let h="",E=0;for(let P=0;P<t.length;P++){const R=t[P];if(R===s&&E++,R===f&&E--,E===0&&R===","){d.push(h.trim()),h="";continue}h+=R}return d.push(h.trim()),d}const Tv=32;function wf(t){try{return ba(t).length===Tv}catch{return!1}}const ec=32;function Do(t){return Cv(t)&&tc(t)===ec}function gt(t){return Do(t)}const ul=/^[a-zA-Z][a-zA-Z0-9_]*$/;function _f(t){return ul.test(t)}const Xo=["bool","u8","u16","u32","u64","u128","u256","address","signer"],hi=/^vector<(.+)>$/;function dy(t){if(Xo.includes(t))return!0;const e=t.match(hi);return e?dy(e[1]):t.includes("::")?py(t):!1}function hy(t){return!Do(t.address)&&!xo(t.address)||!_f(t.module)||!_f(t.name)?!1:t.typeParams.every(e=>typeof e=="string"?dy(e):hy(e))}function py(t){try{return hy(Mc(t))}catch{return!1}}function Pc(t){if(t.startsWith("vector<")){if(!t.endsWith(">"))throw new Error(`Invalid type tag: ${t}`);const e=t.slice(7,-1);if(!e)throw new Error(`Invalid type tag: ${t}`);const s=Pc(e);return typeof s=="string"?`vector<${s}>`:`vector<${fs(s)}>`}return t.includes("::")?Mc(t):t}function Mc(t){const e=t.split("::");if(e.length<3)throw new Error(`Invalid struct tag: ${t}`);const[s,f]=e,d=xo(s),h=t.slice(s.length+f.length+4),E=h.includes("<")?h.slice(0,h.indexOf("<")):h,P=h.includes("<")?fy(h.slice(h.indexOf("<")+1,h.lastIndexOf(">"))).map(R=>Pc(R.trim())):[];return{address:d?s:ni(s),module:f,name:E,typeParams:P}}function fs(t){const{address:e,module:s,name:f,typeParams:d}=typeof t=="string"?Mc(t):t;return`${e}::${s}::${f}${d?.length>0?`<${d.map(h=>typeof h=="string"?h:fs(h)).join(",")}>`:""}`}function ni(t,e=!1){let s=t.toLowerCase();return!e&&s.startsWith("0x")&&(s=s.slice(2)),`0x${s.padStart(ec*2,"0")}`}function wu(t,e=!1){return ni(t,e)}function Cv(t){return/^(0x|0X)?[a-fA-F0-9]+$/.test(t)&&t.length%2===0}function tc(t){return/^(0x|0X)/.test(t)?(t.length-2)/2:t.length/2}const Pv=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,Mv=/^\d+$/,Ov=64,gy="/",xo=t=>{const e=t.split(gy);if(e.length<2||e.length>3)return!1;const[s,f,d]=e;return d!==void 0&&!Mv.test(d)||!Ev(s)?!1:Pv.test(f)&&f.length<Ov},nc=t=>{const e=t.split(/::|<|>|,/);for(const s of e)if(s.includes(gy)&&!xo(s))return!1;return py(t)};var Rv=class PC{#e;#n;constructor({prefix:e,cache:s}={}){this.#e=e??[],this.#n=s??new Map}read(e,s){const f=[this.#e,...e].join(":");if(this.#n.has(f))return this.#n.get(f);const d=s();return this.#n.set(f,d),typeof d=="object"&&d!==null&&"then"in d?Promise.resolve(d).then(h=>(this.#n.set(f,h),h)).catch(h=>{throw this.#n.delete(f),h}):d}readSync(e,s){const f=[this.#e,...e].join(":");if(this.#n.has(f))return this.#n.get(f);const d=s();return this.#n.set(f,d),d}clear(e){const s=[...this.#e,...e??[]].join(":");if(!s){this.#n.clear();return}for(const f of this.#n.keys())f.startsWith(s)&&this.#n.delete(f)}scope(e){return new PC({prefix:[...this.#e,...Array.isArray(e)?e:[e]],cache:this.#n})}},yy=class{constructor({network:t,base:e,cache:s=e?.cache??new Rv}){this.network=t,this.base=e??this,this.cache=s}$extend(...t){const e=Object.fromEntries(t.map(f=>[f.name,f.register(this)])),s=new Map;return new Proxy(this,{get(f,d,h){if(typeof d=="string"&&d in e)return e[d];const E=Reflect.get(f,d,h);return typeof E=="function"?d==="$extend"?E.bind(h):(s.has(d)||s.set(d,E.bind(f)),s.get(d)):E}})}};const my="2.9.1",Nv="1.69.0";var U0=Ar(85409),Oc=class{constructor(t,e){if(typeof t!="function")throw new TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but got: ${t}.`);this._batchLoadFn=t,this._maxBatchSize=Lv(e),this._batchScheduleFn=Fv(e),this._cacheKeyFn=by(e),this._cacheMap=vy(e),this._batch=null,this.name=jv(e)}load(t){if(t==null)throw new TypeError(`The loader.load() function must be called with a value, but got: ${String(t)}.`);const e=va(this),s=this._cacheMap;let f;if(s){f=this._cacheKeyFn(t);const h=s.get(f);if(h){const E=e.cacheHits||(e.cacheHits=[]);return new Promise(P=>{E.push(()=>{P(h)})})}}e.keys.push(t);const d=new Promise((h,E)=>{e.callbacks.push({resolve:h,reject:E})});return s&&s.set(f,d),d}loadMany(t){if(!wy(t))throw new TypeError(`The loader.loadMany() function must be called with Array<key>, but got: ${t}.`);const e=[];for(let s=0;s<t.length;s++)e.push(this.load(t[s]).catch(f=>f));return Promise.all(e)}clear(t){const e=this._cacheMap;if(e){const s=this._cacheKeyFn(t);e.delete(s)}return this}clearAll(){const t=this._cacheMap;return t&&t.clear(),this}prime(t,e){const s=this._cacheMap;if(s){const f=this._cacheKeyFn(t);if(s.get(f)===void 0){let d;e instanceof Error?(d=Promise.reject(e),d.catch(()=>{})):d=Promise.resolve(e),s.set(f,d)}}return this}};const Uv=typeof U0=="object"&&typeof U0.nextTick=="function"?function(t){D0||(D0=Promise.resolve()),D0.then(()=>{U0.nextTick(t)})}:typeof setImmediate=="function"?function(t){setImmediate(t)}:function(t){setTimeout(t)};let D0;function va(t){const e=t._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<t._maxBatchSize)return e;const s={hasDispatched:!1,keys:[],callbacks:[]};return t._batch=s,t._batchScheduleFn(()=>{Dv(t,s)}),s}function Dv(t,e){if(e.hasDispatched=!0,e.keys.length===0){F0(e);return}let s;try{s=t._batchLoadFn(e.keys)}catch(f){return L0(t,e,new TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function errored synchronously: ${String(f)}.`))}if(!s||typeof s.then!="function")return L0(t,e,new TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise: ${String(s)}.`));Promise.resolve(s).then(f=>{if(!wy(f))throw new TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array: ${String(f)}.`);if(f.length!==e.keys.length)throw new TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys.
|
||
|
||
Keys:
|
||
${String(e.keys)}
|
||
|
||
Values:
|
||
${String(f)}`);F0(e);for(let d=0;d<e.callbacks.length;d++){const h=f[d];h instanceof Error?e.callbacks[d].reject(h):e.callbacks[d].resolve(h)}}).catch(f=>{L0(t,e,f)})}function L0(t,e,s){F0(e);for(let f=0;f<e.keys.length;f++)t.clear(e.keys[f]),e.callbacks[f].reject(s)}function F0(t){if(t.cacheHits)for(let e=0;e<t.cacheHits.length;e++)t.cacheHits[e]()}function Lv(t){if(!(!t||t.batch!==!1))return 1;const e=t&&t.maxBatchSize;if(e===void 0)return 1/0;if(typeof e!="number"||e<1)throw new TypeError(`maxBatchSize must be a positive number: ${e}`);return e}function Fv(t){const e=t&&t.batchScheduleFn;if(e===void 0)return Uv;if(typeof e!="function")throw new TypeError(`batchScheduleFn must be a function: ${e}`);return e}function by(t){const e=t&&t.cacheKeyFn;if(e===void 0)return s=>s;if(typeof e!="function")throw new TypeError(`cacheKeyFn must be a function: ${e}`);return e}function vy(t){if(!(!t||t.cache!==!1))return null;const e=t&&t.cacheMap;if(e===void 0)return new Map;if(e!==null){const s=["get","set","delete","clear"].filter(f=>e&&typeof e[f]!="function");if(s.length!==0)throw new TypeError("Custom cacheMap missing methods: "+s.join(", "))}return e}function jv(t){return t&&t.name?t.name:null}function wy(t){return typeof t=="object"&&t!==null&&"length"in t&&typeof t.length=="number"&&(t.length===0||t.length>0&&Object.prototype.hasOwnProperty.call(t,t.length-1))}function ll(t,e){return Array.from({length:Math.ceil(t.length/e)},(s,f)=>t.slice(f*e,(f+1)*e))}const Ef="/",Ld={"Mvr-Source":`@mysten/sui@${my}`};var zv=class{#e;#n;#r;#i;constructor({cache:t,url:e,pageSize:s=50,overrides:f}){this.#e=t,this.#n=e,this.#r=s,this.#i={packages:f?.packages,types:f?.types},_y(this.#i)}get#o(){return this.#e.readSync(["#mvrPackageDataLoader",this.#n??""],()=>{const t=new Oc(async s=>{if(!this.#n)throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const f=await this.#a(s);return s.map(d=>f[d]??new Error(`Failed to resolve package: ${d}`))}),e=this.#i?.packages;if(e)for(const[s,f]of Object.entries(e))t.prime(s,f);return t})}get#s(){return this.#e.readSync(["#mvrTypeDataLoader",this.#n??""],()=>{const t=new Oc(async s=>{if(!this.#n)throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const f=await this.#c(s);return s.map(d=>f[d]??new Error(`Failed to resolve type: ${d}`))}),e=this.#i?.types;if(e)for(const[s,f]of Object.entries(e))t.prime(s,f);return t})}async#a(t){if(t.length===0)return{};const e=ll(t,this.#r),s={};return await Promise.all(e.map(async f=>{const d=await this.#t("/v1/resolution/bulk",{names:f});if(d?.resolution)for(const h of Object.keys(d?.resolution)){const E=d.resolution[h]?.package_id;E&&(s[h]=E)}})),s}async#c(t){if(t.length===0)return{};const e=ll(t,this.#r),s={};return await Promise.all(e.map(async f=>{const d=await this.#t("/v1/struct-definition/bulk",{types:f});if(d?.resolution)for(const h of Object.keys(d?.resolution)){const E=d.resolution[h]?.type_tag;E&&(s[h]=E)}})),s}async#t(t,e){if(!this.#n)throw new Error("MVR Api URL is not set for the current client");const s=await fetch(`${this.#n}${t}`,{method:"POST",headers:{"Content-Type":"application/json",...Ld},body:JSON.stringify(e)});if(!s.ok){const f=await s.json().catch(()=>({}));throw new Error(`Failed to resolve types: ${f?.message}`)}return s.json()}async resolvePackage({package:t}){return Ds(t)?{package:await this.#o.load(t)}:{package:t}}async resolveType({type:t}){if(!Ds(t))return{type:t};const e=[...j0(t)],s=await this.#s.loadMany(e),f={};for(let d=0;d<e.length;d++){const h=s[d];if(h instanceof Error)throw h;f[e[d]]=h}return{type:wa(t,f)}}async resolve({types:t=[],packages:e=[]}){const s=new Set;for(const q of t??[])j0(q,s);const f=[...s],[d,h]=await Promise.all([f.length>0?this.#s.loadMany(f):[],e.length>0?this.#o.loadMany(e):[]]),E={...this.#i?.types};for(const[q,te]of f.entries()){const ne=d[q];if(ne instanceof Error)throw ne;E[te]=ne}const P={};for(const q of t??[])P[q]={type:wa(q,E)};const R={};for(const[q,te]of(e??[]).entries()){const ne=this.#i?.packages?.[te]??h[q];if(ne instanceof Error)throw ne;R[te]={package:ne}}return{types:P,packages:R}}};function _y(t){if(t?.packages)for(const[e,s]of Object.entries(t.packages)){if(!xo(e))throw new Error(`Invalid package name: ${e}`);if(!Do(ni(s)))throw new Error(`Invalid package ID: ${s}`)}if(t?.types)for(const[e,s]of Object.entries(t.types)){if(Mc(e).typeParams.length>0)throw new Error("Type overrides must be first-level only. If you want to supply generic types, just pass each type individually.");if(!Do(Mc(s).address))throw new Error(`Invalid type: ${s}`)}}function j0(t,e=new Set){if(typeof t=="string"&&!Ds(t))return e;const s=Rc(t)?t:Mc(t);Ds(s.address)&&e.add(`${s.address}::${s.module}::${s.name}`);for(const f of s.typeParams)j0(f,e);return e}function wa(t,e){const s=Rc(t)?t:Mc(t),f=e[`${s.address}::${s.module}::${s.name}`];return fs({...s,address:f?f.split("::")[0]:s.address,typeParams:s.typeParams.map(d=>wa(d,e))})}function Ds(t){return t.includes(Ef)||t.includes("@")||t.includes(".sui")}function Rc(t){return typeof t=="object"&&"address"in t&&"module"in t&&"name"in t&&"typeParams"in t}function Yo(t){const e=new Set,s=new Set;for(const f of t.commands)switch(f.$kind){case"MakeMoveVec":f.MakeMoveVec.type&&z0([f.MakeMoveVec.type]).forEach(E=>{s.add(E)});break;case"MoveCall":const d=f.MoveCall,h=d.package.split("::")[0];if(Ds(h)){if(!xo(h))throw new Error(`Invalid package name: ${h}`);e.add(h)}z0(d.typeArguments??[]).forEach(E=>{s.add(E)});break;default:break}return{packages:[...e],types:[...s]}}function Hv(t,e){for(const s of t.commands){if(s.MakeMoveVec?.type){if(!Ds(s.MakeMoveVec.type))continue;if(!e.types[s.MakeMoveVec.type])throw new Error(`No resolution found for type: ${s.MakeMoveVec.type}`);s.MakeMoveVec.type=e.types[s.MakeMoveVec.type].type}const f=s.MoveCall;if(!f)continue;const d=f.package.split("::"),h=d[0];if(Ds(h)&&!e.packages[h])throw new Error(`No address found for package: ${h}`);Ds(h)&&(d[0]=e.packages[h].package,f.package=d.join("::"));const E=f.typeArguments;if(E){for(let P=0;P<E.length;P++)if(Ds(E[P])){if(!e.types[E[P]])throw new Error(`No resolution found for type: ${E[P]}`);E[P]=e.types[E[P]].type}f.typeArguments=E}}}function z0(t){const e=new Set;for(const s of t)if(Ds(s)){if(!nc(s))throw new Error(`Invalid type with names: ${s}`);e.add(s)}return e}const Ey={"-32700":"ParseError","-32701":"OversizedRequest","-32702":"OversizedResponse","-32600":"InvalidRequest","-32601":"MethodNotFound","-32602":"InvalidParams","-32603":"InternalError","-32604":"ServerBusy","-32000":"CallExecutionFailed","-32001":"UnknownError","-32003":"SubscriptionClosed","-32004":"SubscriptionClosedWithError","-32005":"BatchesNotSupported","-32006":"TooManySubscriptions","-32050":"TransientError","-32002":"TransactionExecutionClientError"};var fl=class extends Error{},rc=class extends fl{constructor(t,e){super(t),this.code=e,this.type=Ey[e]??"ServerError"}},Sy=class extends fl{constructor(t,e,s){super(t),this.status=e,this.statusText=s}};function Kv(t){const e=new URL(t);return e.protocol=e.protocol.replace("http","ws"),e.toString()}const Fd={WebSocketConstructor:typeof WebSocket<"u"?WebSocket:void 0,callTimeout:3e4,reconnectTimeout:3e3,maxReconnects:5};var $v=class{#e=0;#n=0;#r=null;#i=null;#o=new Set;#s=new Map;constructor(t,e={}){if(this.endpoint=t,this.options={...Fd,...e},!this.options.WebSocketConstructor)throw new Error("Missing WebSocket constructor");this.endpoint.startsWith("http")&&(this.endpoint=Kv(this.endpoint))}async makeRequest(t,e,s){const f=await this.#a();return new Promise((d,h)=>{this.#e+=1,this.#s.set(this.#e,{resolve:d,reject:h,timeout:setTimeout(()=>{this.#s.delete(this.#e),h(new Error(`Request timeout: ${t}`))},this.options.callTimeout)}),s?.addEventListener("abort",()=>{this.#s.delete(this.#e),h(s.reason)}),f.send(JSON.stringify({jsonrpc:"2.0",id:this.#e,method:t,params:e}))}).then(({error:d,result:h})=>{if(d)throw new rc(d.message,d.code);return h})}#a(){return this.#i?this.#i:(this.#i=new Promise(t=>{this.#r?.close(),this.#r=new this.options.WebSocketConstructor(this.endpoint),this.#r.addEventListener("open",()=>{this.#n=0,t(this.#r)}),this.#r.addEventListener("close",()=>{this.#n++,this.#n<=this.options.maxReconnects&&setTimeout(()=>{this.#c()},this.options.reconnectTimeout)}),this.#r.addEventListener("message",({data:e})=>{let s;try{s=JSON.parse(e)}catch(f){console.error(new Error(`Failed to parse RPC message: ${e}`,{cause:f}));return}if("id"in s&&s.id!=null&&this.#s.has(s.id)){const{resolve:f,timeout:d}=this.#s.get(s.id);clearTimeout(d),f(s)}else if("params"in s){const{params:f}=s;this.#o.forEach(d=>{d.subscriptionId===f.subscription&&f.subscription===d.subscriptionId&&d.onMessage(f.result)})}})}),this.#i)}async#c(){return this.#r?.close(),this.#i=null,Promise.allSettled([...this.#o].map(t=>t.subscribe(this)))}async subscribe(t){const e=new Ay(t);return this.#o.add(e),await e.subscribe(this),()=>e.unsubscribe(this)}},Ay=class{constructor(t){this.subscriptionId=null,this.subscribed=!1,this.input=t}onMessage(t){this.subscribed&&this.input.onMessage(t)}async unsubscribe(t){const{subscriptionId:e}=this;return this.subscribed=!1,e==null?!1:(this.subscriptionId=null,t.makeRequest(this.input.unsubscribe,[e]))}async subscribe(t){this.subscriptionId=null,this.subscribed=!0;const e=await t.makeRequest(this.input.method,this.input.params,this.input.signal);this.subscribed&&(this.subscriptionId=e)}},Zs=class{#e=0;#n;#r;constructor(t){this.#n=t}fetch(t,e){const s=this.#n.fetch??fetch;if(!s)throw new Error("The current environment does not support fetch, you can provide a fetch implementation in the options for SuiHTTPTransport.");return s(t,e)}#i(){if(!this.#r){const t=this.#n.WebSocketConstructor??WebSocket;if(!t)throw new Error("The current environment does not support WebSocket, you can provide a WebSocketConstructor in the options for SuiHTTPTransport.");this.#r=new $v(this.#n.websocket?.url??this.#n.url,{WebSocketConstructor:t,...this.#n.websocket})}return this.#r}async request(t){this.#e+=1;const e=await this.fetch(this.#n.rpc?.url??this.#n.url,{method:"POST",signal:t.signal,headers:{"Content-Type":"application/json","Client-Sdk-Type":"typescript","Client-Sdk-Version":my,"Client-Target-Api-Version":Nv,"Client-Request-Method":t.method,...this.#n.rpc?.headers},body:JSON.stringify({jsonrpc:"2.0",id:this.#e,method:t.method,params:t.params})});if(!e.ok)throw new Sy(`Unexpected status code: ${e.status}`,e.status,e.statusText);const s=await e.json();if("error"in s&&s.error!=null)throw new rc(s.error.message,s.error.code);return s.result}async subscribe(t){const e=await this.#i().subscribe(t);return t.signal&&(t.signal.throwIfAborted(),t.signal.addEventListener("abort",()=>{e()})),async()=>!!await e()}};let Nc;function Vv(t){Nc={...Nc,...t}}function Io(t){return{lang:t?.lang??Nc?.lang,message:t?.message,abortEarly:t?.abortEarly??Nc?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Nc?.abortPipeEarly}}function xy(){Nc=void 0}let Uc;function dl(t,e){Uc||(Uc=new Map),Uc.set(e,t)}function Iy(t){return Uc?.get(t)}function Bo(t){Uc?.delete(t)}let _u;function OS(t,e){_u||(_u=new Map),_u.set(e,t)}function Wv(t){return _u?.get(t)}function RS(t){_u?.delete(t)}let ic;function NS(t,e,s){ic||(ic=new Map),ic.get(t)||ic.set(t,new Map),ic.get(t).set(s,e)}function Sf(t,e){return ic?.get(t)?.get(e)}function Gv(t,e){ic?.get(t)?.delete(e)}function ts(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function on(t,e,s,f,d){const h=d&&"input"in d?d.input:s.value,E=d?.expected??t.expects??null,P=d?.received??ts(h),R={kind:t.kind,type:t.type,input:h,expected:E,received:P,message:`Invalid ${e}: ${E?`Expected ${E} but r`:"R"}eceived ${P}`,requirement:t.requirement,path:d?.path,issues:d?.issues,lang:f.lang,abortEarly:f.abortEarly,abortPipeEarly:f.abortPipeEarly},q=t.kind==="schema",te=d?.message??t.message??Sf(t.reference,R.lang)??(q?Wv(R.lang):null)??f.message??Iy(R.lang);te!==void 0&&(R.message=typeof te=="function"?te(R):te),q&&(s.typed=!1),s.issues?s.issues.push(R):s.issues=[R]}function Eu(t){return{typed:t.typed,value:t.value,issues:t.issues&&[...t.issues]}}let H0;function jd(t){return H0||(H0=new TextEncoder),H0.encode(t).length}let Af;function xf(t){Af||(Af=new Intl.Segmenter);const e=Af.segment(t);let s=0;for(const f of e)s++;return s}function K0(t,e){if("pipe"in t){const s=[];for(let f=t.pipe.length-1;f>=0;f--){const d=t.pipe[f];if(d.kind==="schema"&&"pipe"in d)s.push(d);else if(d.kind==="metadata"&&d.type===e)return d[e]}for(const f of s){const d=K0(f,e);if(d!==void 0)return d}}}function nr(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Io())}}}let If;function Bf(t,e){If||(If=new Map),If.get(t)||If.set(t,new Intl.Segmenter(t,{granularity:"word"}));const s=If.get(t).segment(e);let f=0;for(const d of s)d.isWordLike&&f++;return f}const $0=/\D/gu;function By(t){const e=t.replace($0,"");let s=e.length,f=1,d=0;for(;s;){const h=+e[--s];f^=1,d+=f?[0,2,4,6,8,1,3,5,7,9][h]:h}return d%10===0}function Dc(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Lo(t,e){const s=[...new Set(t)];return s.length>1?`(${s.join(` ${e} `)})`:s[0]??"never"}function qv(t,e){const s={};for(const f of t)s[f]=e;return s}function Zv(t){const e={};for(const s of t)Object.assign(e,s.entries);return e}function kf(t){if(t.path){let e="";for(const s of t.path)if(typeof s.key=="string"||typeof s.key=="number")e?e+=`.${s.key}`:e+=s.key;else return null;return e}return null}function US(t,e){return e.kind===t}function Xv(t,e){return e.type===t}function Yv(t){return t instanceof Lc}var Lc=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function ky(t){return{kind:"transformation",type:"args",reference:ky,async:!1,schema:t,"~run"(e,s){const f=e.value;return e.value=(...d)=>{const h=this.schema["~run"]({value:d},s);if(h.issues)throw new Lc(h.issues);return f(...h.value)},e}}}function Jv(t){return{kind:"transformation",type:"args",reference:Jv,async:!1,schema:t,"~run"(e,s){const f=e.value;return e.value=async(...d)=>{const h=await t["~run"]({value:d},s);if(h.issues)throw new Lc(h.issues);return f(...h.value)},e}}}function V0(){return{kind:"transformation",type:"await",reference:V0,async:!0,async"~run"(t){return t.value=await t.value,t}}}const Ty=/^(?:[\da-z+/]{4})*(?:[\da-z+/]{2}==|[\da-z+/]{3}=)?$/iu,W0=/^[A-Z]{6}(?!00)[\dA-Z]{2}(?:[\dA-Z]{3})?$/u,Qv=/^[a-z][\da-z]*$/u,G0=/^[+-]?(?:\d*\.)?\d+$/u,ri=/^\d+$/u,ew=/^(?=.{1,253}$)(?:(?![Xx][Nn]--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,63}$/u,tw=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu,Tf=/^(?:[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation}))*)+$/u,Cy=/^(?:0[hx])?[\da-fA-F]+$/u,nw=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u,rw=/^\d{15}$|^\d{2}-\d{6}-\d{6}-\d$/u,Jo=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u,iw=/^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,zd=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,q0=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,Py=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3]):[0-5]\d$/u,My=/^(?:0\d|1\d|2[0-3]):[0-5]\d$/u,Fo=/^(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u,Fc=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u,Z0=/^\d{4}-W(?:0[1-9]|[1-4]\d|5[0-3])$/u,Oy=/^(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)\.(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)?\.(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)?$/u,Hd=/^(?:[A-Z]{2}[A-Z\d]{3}\d{7}|[A-Z]{2}-[A-Z\d]{3}-\d{2}-\d{5})$/u,Ry=/^(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){2}[\da-fA-F]{4}$/u,X0=/^(?:[\da-fA-F]{2}:){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){3}[\da-fA-F]{4}$|^(?:[\da-fA-F]{4}:){3}[\da-fA-F]{4}$/u,Ny=/^(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){2}[\da-fA-F]{4}$|^(?:[\da-fA-F]{2}:){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){3}[\da-fA-F]{4}$|^(?:[\da-fA-F]{4}:){3}[\da-fA-F]{4}$/u,Y0=/^[\w-]+$/u,J0=/^(?:0o)?[0-7]+$/u,jc=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,sw=/^[\da-z]+(?:[-_][\da-z]+)*$/u,zc=/^[\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u,Uy=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;function Dy(t){return{kind:"validation",type:"base64",reference:Dy,async:!1,expects:null,requirement:Ty,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"Base64",e,s),e}}}function Q0(t){return{kind:"validation",type:"bic",reference:Q0,async:!1,expects:null,requirement:W0,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"BIC",e,s),e}}}function ow(t){return{kind:"transformation",type:"brand",reference:ow,async:!1,name:t,"~run"(e){return e}}}function aw(t,e){return{kind:"validation",type:"bytes",reference:aw,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,f){if(s.typed){const d=jd(s.value);d!==this.requirement&&on(this,"bytes",s,f,{received:`${d}`})}return s}}}function hl(t,e){return{kind:"validation",type:"check",reference:hl,async:!1,expects:null,requirement:t,message:e,"~run"(s,f){return s.typed&&!this.requirement(s.value)&&on(this,"input",s,f),s}}}function Ly(t,e){return{kind:"validation",type:"check",reference:Ly,async:!0,expects:null,requirement:t,message:e,async"~run"(s,f){return s.typed&&!await this.requirement(s.value)&&on(this,"input",s,f),s}}}function Fy(t,e){return{kind:"validation",type:"check_items",reference:Fy,async:!1,expects:null,requirement:t,message:e,"~run"(s,f){if(s.typed)for(let d=0;d<s.value.length;d++){const h=s.value[d];this.requirement(h,d,s.value)||on(this,"item",s,f,{input:h,path:[{type:"array",origin:"value",input:s.value,key:d,value:h}]})}return s}}}function cw(t,e){return{kind:"validation",type:"check_items",reference:cw,async:!0,expects:null,requirement:t,message:e,async"~run"(s,f){if(s.typed){const d=await Promise.all(s.value.map(this.requirement));for(let h=0;h<s.value.length;h++)if(!d[h]){const E=s.value[h];on(this,"item",s,f,{input:E,path:[{type:"array",origin:"value",input:s.value,key:h,value:E}]})}}return s}}}const jy=/^(?:\d{13,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u,zy=/[- ]/gu,ko=null;function Na(t){return{kind:"validation",type:"credit_card",reference:Na,async:!1,expects:null,requirement(e){let s;return jy.test(e)&&(s=e.replace(zy,""))&&ko.some(f=>f.test(s))&&By(s)},message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&on(this,"credit card",e,s),e}}}function uw(t){return{kind:"validation",type:"cuid2",reference:uw,async:!1,expects:null,requirement:Qv,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"Cuid2",e,s),e}}}function lw(t){return{kind:"validation",type:"decimal",reference:lw,async:!1,expects:null,requirement:G0,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"decimal",e,s),e}}}function Kd(t){return{kind:"metadata",type:"description",reference:Kd,description:t}}function pl(t){return{kind:"validation",type:"digits",reference:pl,async:!1,expects:null,requirement:ri,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"digits",e,s),e}}}function Hy(t){return{kind:"validation",type:"domain",reference:Hy,expects:null,async:!1,requirement:ew,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"domain",e,s),e}}}function Ky(t){return{kind:"validation",type:"email",reference:Ky,expects:null,async:!1,requirement:tw,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"email",e,s),e}}}function fw(t){return{kind:"validation",type:"emoji",reference:fw,async:!1,expects:null,requirement:Tf,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"emoji",e,s),e}}}function $y(t){return{kind:"validation",type:"empty",reference:$y,async:!1,expects:"0",message:t,"~run"(e,s){return e.typed&&e.value.length>0&&on(this,"length",e,s,{received:`${e.value.length}`}),e}}}function gl(t,e){return{kind:"validation",type:"ends_with",reference:gl,async:!1,expects:`"${t}"`,requirement:t,message:e,"~run"(s,f){return s.typed&&!s.value.endsWith(this.requirement)&&on(this,"end",s,f,{received:`"${s.value.slice(-this.requirement.length)}"`}),s}}}function Cf(t,e){return{kind:"validation",type:"entries",reference:Cf,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,f){if(!s.typed)return s;const d=Object.keys(s.value).length;return s.typed&&d!==this.requirement&&on(this,"entries",s,f,{received:`${d}`}),s}}}function dw(t,e){return{kind:"validation",type:"every_item",reference:dw,async:!1,expects:null,requirement:t,message:e,"~run"(s,f){return s.typed&&!s.value.every(this.requirement)&&on(this,"item",s,f),s}}}function Vy(t){return{kind:"metadata",type:"examples",reference:Vy,examples:t}}function Wy(t,e){const s=ts(t);return{kind:"validation",type:"excludes",reference:Wy,async:!1,expects:`!${s}`,requirement:t,message:e,"~run"(f,d){return f.typed&&f.value.includes(this.requirement)&&on(this,"content",f,d,{received:s}),f}}}function $d(t){return{kind:"transformation",type:"filter_items",reference:$d,async:!1,operation:t,"~run"(e){return e.value=e.value.filter(this.operation),e}}}function Gy(t){return{kind:"transformation",type:"find_item",reference:Gy,async:!1,operation:t,"~run"(e){return e.value=e.value.find(this.operation),e}}}function Vd(t){return{kind:"validation",type:"finite",reference:Vd,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&on(this,"finite",e,s),e}}}function ep(t){return{kind:"transformation",type:"flavor",reference:ep,async:!1,name:t,"~run"(e){return e}}}function Wd(t,e){return{kind:"validation",type:"graphemes",reference:Wd,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,f){if(s.typed){const d=xf(s.value);d!==this.requirement&&on(this,"graphemes",s,f,{received:`${d}`})}return s}}}function hw(t,e){return{kind:"validation",type:"gt_value",reference:hw,async:!1,expects:`>${t instanceof Date?t.toJSON():ts(t)}`,requirement:t,message:e,"~run"(s,f){return s.typed&&!(s.value>this.requirement)&&on(this,"value",s,f,{received:s.value instanceof Date?s.value.toJSON():ts(s.value)}),s}}}function qy(t,e){return{kind:"transformation",type:"guard",reference:qy,async:!1,requirement:t,message:e,"~run"(s,f){return s.typed&&!this.requirement(s.value)&&(on(this,"input",s,f),s.typed=!1),s}}}const Gd=null;function Zy(t,e){return{kind:"validation",type:"hash",reference:Zy,expects:null,async:!1,requirement:RegExp(t.map(s=>`^[a-fA-F0-9]{${Gd[s]}}$`).join("|"),"u"),message:e,"~run"(s,f){return s.typed&&!this.requirement.test(s.value)&&on(this,"hash",s,f),s}}}function tp(t){return{kind:"validation",type:"hexadecimal",reference:tp,async:!1,expects:null,requirement:Cy,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"hexadecimal",e,s),e}}}function pw(t){return{kind:"validation",type:"hex_color",reference:pw,async:!1,expects:null,requirement:nw,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"hex color",e,s),e}}}function Xy(t){return{kind:"validation",type:"imei",reference:Xy,async:!1,expects:null,requirement(e){return rw.test(e)&&By(e)},message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&on(this,"IMEI",e,s),e}}}function sc(t,e){const s=ts(t);return{kind:"validation",type:"includes",reference:sc,async:!1,expects:s,requirement:t,message:e,"~run"(f,d){return f.typed&&!f.value.includes(this.requirement)&&on(this,"content",f,d,{received:`!${s}`}),f}}}function ns(t){return{kind:"validation",type:"integer",reference:ns,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&on(this,"integer",e,s),e}}}function Yy(t){return{kind:"validation",type:"ip",reference:Yy,async:!1,expects:null,requirement:zd,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"IP",e,s),e}}}function gw(t){return{kind:"validation",type:"ipv4",reference:gw,async:!1,expects:null,requirement:Jo,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"IPv4",e,s),e}}}function Jy(t){return{kind:"validation",type:"ipv6",reference:Jy,async:!1,expects:null,requirement:iw,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"IPv6",e,s),e}}}function yw(t){const e=t.split("").map(f=>f==="X"?10:parseInt(f));let s=0;for(let f=0;f<10;f++)s+=e[f]*(10-f);return s%11===0}function mw(t){const e=t.split("").map(f=>parseInt(f));let s=0;for(let f=0;f<13;f++)s+=e[f]*(f%2===0?1:3);return s%10===0}const oc=/[- ]/gu,np=/^\d{9}[\dX]$/u,rp=/^\d{13}$/u;function ip(t){return{kind:"validation",type:"isbn",reference:ip,async:!1,expects:null,requirement(e){const s=e.replace(oc,"");return np.test(s)?yw(s):rp.test(s)?mw(s):!1},message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&on(this,"ISBN",e,s),e}}}function qd(t){return{kind:"validation",type:"isrc",reference:qd,async:!1,expects:null,requirement:Hd,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"ISRC",e,s),e}}}function yl(t){return{kind:"validation",type:"iso_date",reference:yl,async:!1,expects:null,requirement:q0,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"date",e,s),e}}}function Ur(t){return{kind:"validation",type:"iso_date_time",reference:Ur,async:!1,expects:null,requirement:Py,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"date-time",e,s),e}}}function Zd(t){return{kind:"validation",type:"iso_time",reference:Zd,async:!1,expects:null,requirement:My,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"time",e,s),e}}}function sp(t){return{kind:"validation",type:"iso_time_second",reference:sp,async:!1,expects:null,requirement:Fo,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"time-second",e,s),e}}}function Su(t){return{kind:"validation",type:"iso_timestamp",reference:Su,async:!1,expects:null,requirement:Fc,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"timestamp",e,s),e}}}function bw(t){return{kind:"validation",type:"iso_week",reference:bw,async:!1,expects:null,requirement:Z0,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"week",e,s),e}}}function op(t){return{kind:"validation",type:"jws_compact",reference:op,async:!1,expects:null,requirement:Oy,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"JWS compact",e,s),e}}}function Qy(t,e){return{kind:"validation",type:"length",reference:Qy,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,f){return s.typed&&s.value.length!==this.requirement&&on(this,"length",s,f,{received:`${s.value.length}`}),s}}}function io(t,e){return{kind:"validation",type:"lt_value",reference:io,async:!1,expects:`<${t instanceof Date?t.toJSON():ts(t)}`,requirement:t,message:e,"~run"(s,f){return s.typed&&!(s.value<this.requirement)&&on(this,"value",s,f,{received:s.value instanceof Date?s.value.toJSON():ts(s.value)}),s}}}function vw(t){return{kind:"validation",type:"mac",reference:vw,async:!1,expects:null,requirement:Ny,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"MAC",e,s),e}}}function ww(t){return{kind:"validation",type:"mac48",reference:ww,async:!1,expects:null,requirement:Ry,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"48-bit MAC",e,s),e}}}function em(t){return{kind:"validation",type:"mac64",reference:em,async:!1,expects:null,requirement:X0,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"64-bit MAC",e,s),e}}}function _w(t){return{kind:"transformation",type:"map_items",reference:_w,async:!1,operation:t,"~run"(e){return e.value=e.value.map(this.operation),e}}}function tm(t,e){return{kind:"validation",type:"max_bytes",reference:tm,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(s,f){if(s.typed){const d=jd(s.value);d>this.requirement&&on(this,"bytes",s,f,{received:`${d}`})}return s}}}function Ew(t,e){return{kind:"validation",type:"max_entries",reference:Ew,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(s,f){if(!s.typed)return s;const d=Object.keys(s.value).length;return s.typed&&d>this.requirement&&on(this,"entries",s,f,{received:`${d}`}),s}}}function Sw(t,e){return{kind:"validation",type:"max_graphemes",reference:Sw,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(s,f){if(s.typed){const d=xf(s.value);d>this.requirement&&on(this,"graphemes",s,f,{received:`${d}`})}return s}}}function Aw(t,e){return{kind:"validation",type:"max_length",reference:Aw,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(s,f){return s.typed&&s.value.length>this.requirement&&on(this,"length",s,f,{received:`${s.value.length}`}),s}}}function ac(t,e){return{kind:"validation",type:"max_size",reference:ac,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(s,f){return s.typed&&s.value.size>this.requirement&&on(this,"size",s,f,{received:`${s.value.size}`}),s}}}function fo(t,e){return{kind:"validation",type:"max_value",reference:fo,async:!1,expects:`<=${t instanceof Date?t.toJSON():ts(t)}`,requirement:t,message:e,"~run"(s,f){return s.typed&&!(s.value<=this.requirement)&&on(this,"value",s,f,{received:s.value instanceof Date?s.value.toJSON():ts(s.value)}),s}}}function ap(t,e,s){return{kind:"validation",type:"max_words",reference:ap,async:!1,expects:`<=${e}`,locales:t,requirement:e,message:s,"~run"(f,d){if(f.typed){const h=Bf(this.locales,f.value);h>this.requirement&&on(this,"words",f,d,{received:`${h}`})}return f}}}function xw(t){return{kind:"metadata",type:"metadata",reference:xw,metadata:t}}function cp(t,e){return{kind:"validation",type:"mime_type",reference:cp,async:!1,expects:Lo(t.map(s=>`"${s}"`),"|"),requirement:t,message:e,"~run"(s,f){return s.typed&&!this.requirement.includes(s.value.type)&&on(this,"MIME type",s,f,{received:`"${s.value.type}"`}),s}}}function Iw(t,e){return{kind:"validation",type:"min_bytes",reference:Iw,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,f){if(s.typed){const d=jd(s.value);d<this.requirement&&on(this,"bytes",s,f,{received:`${d}`})}return s}}}function Bw(t,e){return{kind:"validation",type:"min_entries",reference:Bw,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,f){if(!s.typed)return s;const d=Object.keys(s.value).length;return s.typed&&d<this.requirement&&on(this,"entries",s,f,{received:`${d}`}),s}}}function Pf(t,e){return{kind:"validation",type:"min_graphemes",reference:Pf,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,f){if(s.typed){const d=xf(s.value);d<this.requirement&&on(this,"graphemes",s,f,{received:`${d}`})}return s}}}function nm(t,e){return{kind:"validation",type:"min_length",reference:nm,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,f){return s.typed&&s.value.length<this.requirement&&on(this,"length",s,f,{received:`${s.value.length}`}),s}}}function rm(t,e){return{kind:"validation",type:"min_size",reference:rm,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,f){return s.typed&&s.value.size<this.requirement&&on(this,"size",s,f,{received:`${s.value.size}`}),s}}}function kw(t,e){return{kind:"validation",type:"min_value",reference:kw,async:!1,expects:`>=${t instanceof Date?t.toJSON():ts(t)}`,requirement:t,message:e,"~run"(s,f){return s.typed&&!(s.value>=this.requirement)&&on(this,"value",s,f,{received:s.value instanceof Date?s.value.toJSON():ts(s.value)}),s}}}function Tw(t,e,s){return{kind:"validation",type:"min_words",reference:Tw,async:!1,expects:`>=${e}`,locales:t,requirement:e,message:s,"~run"(f,d){if(f.typed){const h=Bf(this.locales,f.value);h<this.requirement&&on(this,"words",f,d,{received:`${h}`})}return f}}}function Cw(t,e){return{kind:"validation",type:"multiple_of",reference:Cw,async:!1,expects:`%${t}`,requirement:t,message:e,"~run"(s,f){return s.typed&&s.value%this.requirement!=0&&on(this,"multiple",s,f),s}}}function Pw(t){return{kind:"validation",type:"nanoid",reference:Pw,async:!1,expects:null,requirement:Y0,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"Nano ID",e,s),e}}}function im(t){return{kind:"validation",type:"non_empty",reference:im,async:!1,expects:"!0",message:t,"~run"(e,s){return e.typed&&e.value.length===0&&on(this,"length",e,s,{received:"0"}),e}}}function sm(t){return{kind:"transformation",type:"normalize",reference:sm,async:!1,form:t,"~run"(e){return e.value=e.value.normalize(this.form),e}}}function Mw(t,e){return{kind:"validation",type:"not_bytes",reference:Mw,async:!1,expects:`!${t}`,requirement:t,message:e,"~run"(s,f){if(s.typed){const d=jd(s.value);d===this.requirement&&on(this,"bytes",s,f,{received:`${d}`})}return s}}}function up(t,e){return{kind:"validation",type:"not_entries",reference:up,async:!1,expects:`!${t}`,requirement:t,message:e,"~run"(s,f){if(!s.typed)return s;const d=Object.keys(s.value).length;return s.typed&&d===this.requirement&&on(this,"entries",s,f,{received:`${d}`}),s}}}function om(t,e){return{kind:"validation",type:"not_graphemes",reference:om,async:!1,expects:`!${t}`,requirement:t,message:e,"~run"(s,f){if(s.typed){const d=xf(s.value);d===this.requirement&&on(this,"graphemes",s,f,{received:`${d}`})}return s}}}function Mf(t,e){return{kind:"validation",type:"not_length",reference:Mf,async:!1,expects:`!${t}`,requirement:t,message:e,"~run"(s,f){return s.typed&&s.value.length===this.requirement&&on(this,"length",s,f,{received:`${s.value.length}`}),s}}}function lp(t,e){return{kind:"validation",type:"not_size",reference:lp,async:!1,expects:`!${t}`,requirement:t,message:e,"~run"(s,f){return s.typed&&s.value.size===this.requirement&&on(this,"size",s,f,{received:`${s.value.size}`}),s}}}function am(t,e){return{kind:"validation",type:"not_value",reference:am,async:!1,expects:t instanceof Date?`!${t.toJSON()}`:`!${ts(t)}`,requirement:t,message:e,"~run"(s,f){return s.typed&&this.requirement<=s.value&&this.requirement>=s.value&&on(this,"value",s,f,{received:s.value instanceof Date?s.value.toJSON():ts(s.value)}),s}}}function cm(t,e){return{kind:"validation",type:"not_values",reference:cm,async:!1,expects:`!${Lo(t.map(s=>s instanceof Date?s.toJSON():ts(s)),"|")}`,requirement:t,message:e,"~run"(s,f){return s.typed&&this.requirement.some(d=>d<=s.value&&d>=s.value)&&on(this,"value",s,f,{received:s.value instanceof Date?s.value.toJSON():ts(s.value)}),s}}}function Xd(t,e,s){return{kind:"validation",type:"not_words",reference:Xd,async:!1,expects:`!${e}`,locales:t,requirement:e,message:s,"~run"(f,d){if(f.typed){const h=Bf(this.locales,f.value);h===this.requirement&&on(this,"words",f,d,{received:`${h}`})}return f}}}function um(t){return{kind:"validation",type:"octal",reference:um,async:!1,expects:null,requirement:J0,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"octal",e,s),e}}}const _a=null,Hc=null;function Ow(t,e){const s=P=>typeof P=="string"?P.toLowerCase():P,f=t?.truthy??_a,d=t?.falsy??Hc,h=t?.truthy?t.truthy.map(s):_a,E=t?.falsy?t.falsy.map(s):Hc;return{kind:"transformation",type:"parse_boolean",reference:Ow,expects:Lo([...f,...d].map(ts),"|"),config:t,message:e,async:!1,"~run"(P,R){const q=s(P.value);return h.includes(q)?P.value=!0:E.includes(q)?P.value=!1:(on(this,"boolean",P,R),P.typed=!1),P}}}function lm(t,e){return{kind:"transformation",type:"parse_json",reference:lm,config:t,message:e,async:!1,"~run"(s,f){try{s.value=JSON.parse(s.value,this.config?.reviver)}catch(d){if(d instanceof Error)on(this,"JSON",s,f,{received:`"${d.message}"`}),s.typed=!1;else throw d}return s}}}function fm(t,e){if(t.issues)for(const s of e)for(const f of t.issues){let d=!1;const h=Math.min(s.length,f.path?.length??0);for(let E=0;E<h;E++)if(s[E]!==f.path[E].key&&(s[E]!=="$"||f.path[E].type!=="array")){d=!0;break}if(!d)return!1}return!0}function Rw(t,e,s){return{kind:"validation",type:"partial_check",reference:Rw,async:!1,expects:null,paths:t,requirement:e,message:s,"~run"(f,d){return(f.typed||fm(f,t))&&!this.requirement(f.value)&&on(this,"input",f,d),f}}}function Nw(t,e,s){return{kind:"validation",type:"partial_check",reference:Nw,async:!0,expects:null,paths:t,requirement:e,message:s,async"~run"(f,d){return(f.typed||fm(f,t))&&!await this.requirement(f.value)&&on(this,"input",f,d),f}}}function Uw(t){return{kind:"validation",type:"raw_check",reference:Uw,async:!1,expects:null,"~run"(e,s){return t({dataset:e,config:s,addIssue:f=>on(this,f?.label??"input",e,s,f)}),e}}}function Dw(t){return{kind:"validation",type:"raw_check",reference:Dw,async:!0,expects:null,async"~run"(e,s){return await t({dataset:e,config:s,addIssue:f=>on(this,f?.label??"input",e,s,f)}),e}}}function Lw(t){return{kind:"transformation",type:"raw_transform",reference:Lw,async:!1,"~run"(e,s){const f=t({dataset:e,config:s,addIssue:d=>on(this,d?.label??"input",e,s,d),NEVER:null});return e.issues?e.typed=!1:e.value=f,e}}}function Fw(t){return{kind:"transformation",type:"raw_transform",reference:Fw,async:!0,async"~run"(e,s){const f=await t({dataset:e,config:s,addIssue:d=>on(this,d?.label??"input",e,s,d),NEVER:null});return e.issues?e.typed=!1:e.value=f,e}}}function jw(){return{kind:"transformation",type:"readonly",reference:jw,async:!1,"~run"(t){return t}}}function zw(t,e){return{kind:"transformation",type:"reduce_items",reference:zw,async:!1,operation:t,initial:e,"~run"(s){return s.value=s.value.reduce(this.operation,this.initial),s}}}function Hw(t,e){return{kind:"validation",type:"regex",reference:Hw,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,f){return s.typed&&!this.requirement.test(s.value)&&on(this,"format",s,f),s}}}function Kw(t){return{kind:"transformation",type:"returns",reference:Kw,async:!1,schema:t,"~run"(e,s){const f=e.value;return e.value=(...d)=>{const h=this.schema["~run"]({value:f(...d)},s);if(h.issues)throw new Lc(h.issues);return h.value},e}}}function dm(t){return{kind:"transformation",type:"returns",reference:dm,async:!1,schema:t,"~run"(e,s){const f=e.value;return e.value=async(...d)=>{const h=await this.schema["~run"]({value:await f(...d)},s);if(h.issues)throw new Lc(h.issues);return h.value},e}}}function hm(t){return{kind:"validation",type:"rfc_email",reference:hm,expects:null,async:!1,requirement:jc,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"email",e,s),e}}}function pm(t){return{kind:"validation",type:"safe_integer",reference:pm,async:!1,expects:null,requirement:Number.isSafeInteger,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&on(this,"safe integer",e,s),e}}}function $w(t,e){return{kind:"validation",type:"size",reference:$w,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,f){return s.typed&&s.value.size!==this.requirement&&on(this,"size",s,f,{received:`${s.value.size}`}),s}}}function Vw(t){return{kind:"validation",type:"slug",reference:Vw,async:!1,expects:null,requirement:sw,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"slug",e,s),e}}}function Ww(t,e){return{kind:"validation",type:"some_item",reference:Ww,async:!1,expects:null,requirement:t,message:e,"~run"(s,f){return s.typed&&!s.value.some(this.requirement)&&on(this,"item",s,f),s}}}function gm(t){return{kind:"transformation",type:"sort_items",reference:gm,async:!1,operation:t,"~run"(e){return e.value=e.value.sort(this.operation),e}}}function Gw(t,e){return{kind:"validation",type:"starts_with",reference:Gw,async:!1,expects:`"${t}"`,requirement:t,message:e,"~run"(s,f){return s.typed&&!s.value.startsWith(this.requirement)&&on(this,"start",s,f,{received:`"${s.value.slice(0,this.requirement.length)}"`}),s}}}function qw(t,e){return{kind:"transformation",type:"stringify_json",reference:qw,message:e,config:t,async:!1,"~run"(s,f){try{const d=JSON.stringify(s.value,this.config?.replacer,this.config?.space);d===void 0&&(on(this,"JSON",s,f),s.typed=!1),s.value=d}catch(d){if(d instanceof Error)on(this,"JSON",s,f,{received:`"${d.message}"`}),s.typed=!1;else throw d}return s}}}function Zw(t){return{kind:"metadata",type:"title",reference:Zw,title:t}}function Xw(t){return{kind:"transformation",type:"to_bigint",reference:Xw,async:!1,message:t,"~run"(e,s){try{e.value=BigInt(e.value)}catch{on(this,"bigint",e,s),e.typed=!1}return e}}}function Yw(){return{kind:"transformation",type:"to_boolean",reference:Yw,async:!1,"~run"(t){return t.value=!!t.value,t}}}function Jw(t){return{kind:"transformation",type:"to_date",reference:Jw,async:!1,message:t,"~run"(e,s){try{e.value=new Date(e.value),isNaN(e.value)&&(on(this,"date",e,s,{received:'"Invalid Date"'}),e.typed=!1)}catch{on(this,"date",e,s),e.typed=!1}return e}}}function Qo(){return{kind:"transformation",type:"to_lower_case",reference:Qo,async:!1,"~run"(t){return t.value=t.value.toLowerCase(),t}}}function Qw(t){return{kind:"transformation",type:"to_max_value",reference:Qw,async:!1,requirement:t,"~run"(e){return e.value=e.value>this.requirement?this.requirement:e.value,e}}}function e2(t){return{kind:"transformation",type:"to_min_value",reference:e2,async:!1,requirement:t,"~run"(e){return e.value=e.value<this.requirement?this.requirement:e.value,e}}}function t2(t){return{kind:"transformation",type:"to_number",reference:t2,async:!1,message:t,"~run"(e,s){try{e.value=Number(e.value),isNaN(e.value)&&(on(this,"number",e,s),e.typed=!1)}catch{on(this,"number",e,s),e.typed=!1}return e}}}function ym(t){return{kind:"transformation",type:"to_string",reference:ym,async:!1,message:t,"~run"(e,s){try{e.value=String(e.value)}catch{on(this,"string",e,s),e.typed=!1}return e}}}function n2(){return{kind:"transformation",type:"to_upper_case",reference:n2,async:!1,"~run"(t){return t.value=t.value.toUpperCase(),t}}}function fp(t){return{kind:"transformation",type:"transform",reference:fp,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function r2(t){return{kind:"transformation",type:"transform",reference:r2,async:!0,operation:t,async"~run"(e){return e.value=await this.operation(e.value),e}}}function i2(){return{kind:"transformation",type:"trim",reference:i2,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function dp(){return{kind:"transformation",type:"trim_end",reference:dp,async:!1,"~run"(t){return t.value=t.value.trimEnd(),t}}}function s2(){return{kind:"transformation",type:"trim_start",reference:s2,async:!1,"~run"(t){return t.value=t.value.trimStart(),t}}}function o2(t){return{kind:"validation",type:"ulid",reference:o2,async:!1,expects:null,requirement:zc,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"ULID",e,s),e}}}function a2(t){return{kind:"validation",type:"url",reference:a2,async:!1,expects:null,requirement(e){try{return new URL(e),!0}catch{return!1}},message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&on(this,"URL",e,s),e}}}function c2(t){return{kind:"validation",type:"uuid",reference:c2,async:!1,expects:null,requirement:Uy,message:t,"~run"(e,s){return e.typed&&!this.requirement.test(e.value)&&on(this,"UUID",e,s),e}}}function u2(t,e){return{kind:"validation",type:"value",reference:u2,async:!1,expects:t instanceof Date?t.toJSON():ts(t),requirement:t,message:e,"~run"(s,f){return s.typed&&!(this.requirement<=s.value&&this.requirement>=s.value)&&on(this,"value",s,f,{received:s.value instanceof Date?s.value.toJSON():ts(s.value)}),s}}}function l2(t,e){return{kind:"validation",type:"values",reference:l2,async:!1,expects:`${Lo(t.map(s=>s instanceof Date?s.toJSON():ts(s)),"|")}`,requirement:t,message:e,"~run"(s,f){return s.typed&&!this.requirement.some(d=>d<=s.value&&d>=s.value)&&on(this,"value",s,f,{received:s.value instanceof Date?s.value.toJSON():ts(s.value)}),s}}}function f2(t,e,s){return{kind:"validation",type:"words",reference:f2,async:!1,expects:`${e}`,locales:t,requirement:e,message:s,"~run"(f,d){if(f.typed){const h=Bf(this.locales,f.value);h!==this.requirement&&on(this,"words",f,d,{received:`${h}`})}return f}}}function DS(t,e){const s=t["~run"]({value:e},{abortEarly:!0}).issues;if(s)throw new Lc(s)}var mm=class{constructor(t){this.refCount=0,this.maxSize=t?.maxSize??1e3,this.maxAge=t?.maxAge??1/0,this.hasMaxAge=isFinite(this.maxAge)}#e(t){const e=typeof t;if(e==="string")return`"${t}"`;if(e==="number"||e==="boolean")return`${t}`;if(e==="bigint")return`${t}n`;if(e==="object"||e==="function"){if(t){this.refIds??=new WeakMap;let s=this.refIds.get(t);return s||(s=++this.refCount,this.refIds.set(t,s)),`#${s}`}return"null"}return e}key(t,e={}){return`${this.#e(t)}|${this.#e(e.lang)}|${this.#e(e.message)}|${this.#e(e.abortEarly)}|${this.#e(e.abortPipeEarly)}`}get(t){if(!this.store)return;const e=this.store.get(t);if(e){if(this.hasMaxAge&&Date.now()-e[1]>this.maxAge){this.store.delete(t);return}return this.store.delete(t),this.store.set(t,e),e[0]}}set(t,e){this.store??=new Map,this.store.delete(t);const s=this.hasMaxAge?Date.now():0;this.store.set(t,[e,s]),this.store.size>this.maxSize&&this.store.delete(this.store.keys().next().value)}clear(){this.store?.clear()}};function LS(t,e){return{...t,cacheConfig:e,cache:new mm(e),get"~standard"(){return nr(this)},"~run"(s,f){const d=this.cache.key(s.value,f);let h=this.cache.get(d);return h||this.cache.set(d,h=t["~run"](s,f)),Eu(h)}}}function FS(t,e){let s;return{...t,async:!0,cacheConfig:e,cache:new mm(e),get"~standard"(){return nr(this)},async"~run"(f,d){const h=this.cache.key(f.value,d),E=this.cache.get(h);if(E)return Eu(E);let P=s?.get(h);P||(s??=new Map,P=Promise.resolve(t["~run"](f,d)),s.set(h,P));try{const R=await P;return this.cache.set(h,R),Eu(R)}finally{s?.delete(h)}}}}function jS(t,e){return{...t,get"~standard"(){return nr(this)},"~run"(s,f){return t["~run"](s,{...f,...e})}}}function ea(t,e,s){return typeof t.fallback=="function"?t.fallback(e,s):t.fallback}function zS(t,e){return{...t,fallback:e,get"~standard"(){return nr(this)},"~run"(s,f){const d=t["~run"](s,f);return d.issues?{typed:!0,value:ea(this,d,f)}:d}}}function HS(t,e){return{...t,fallback:e,async:!0,get"~standard"(){return nr(this)},async"~run"(s,f){const d=await t["~run"](s,f);return d.issues?{typed:!0,value:await ea(this,d,f)}:d}}}function KS(t){const e={};for(const s of t)if(s.path){const f=kf(s);f?(e.nested||(e.nested={}),e.nested[f]?e.nested[f].push(s.message):e.nested[f]=[s.message]):e.other?e.other.push(s.message):e.other=[s.message]}else e.root?e.root.push(s.message):e.root=[s.message];return e}function $S(t,e){return{...t,"~run"(s,f){const d=s.issues&&[...s.issues];if(s=t["~run"](s,f),s.issues){for(const h of s.issues)if(!d?.includes(h)){let E=s.value;for(const P of e){const R=E[P],q={type:"unknown",origin:"value",input:E,key:P,value:R};if(h.path?h.path.push(q):h.path=[q],!R)break;E=R}}}return s}}}function VS(t,e){return{...t,async:!0,async"~run"(s,f){const d=s.issues&&[...s.issues];if(s=await t["~run"](s,f),s.issues){for(const h of s.issues)if(!d?.includes(h)){let E=s.value;for(const P of e){const R=E[P],q={type:"unknown",origin:"value",input:E,key:P,value:R};if(h.path?h.path.push(q):h.path=[q],!R)break;E=R}}}return s}}}function Ls(t,e,s){return typeof t.default=="function"?t.default(e,s):t.default}function bm(t){if("entries"in t){const e={};for(const s in t.entries)e[s]=bm(t.entries[s]);return e}return"items"in t?t.items.map(bm):Ls(t)}async function Yd(t){return"entries"in t?Object.fromEntries(await Promise.all(Object.entries(t.entries).map(async([e,s])=>[e,await Yd(s)]))):"items"in t?Promise.all(t.items.map(Yd)):Ls(t)}function d2(t){return K0(t,"description")}function WS(t){const e=[];function s(f){if("pipe"in f)for(const d of f.pipe)d.kind==="schema"&&"pipe"in d?s(d):d.kind==="metadata"&&d.type==="examples"&&e.push(...d.examples)}return s(t),e}function vm(t){if("entries"in t){const e={};for(const s in t.entries)e[s]=vm(t.entries[s]);return e}return"items"in t?t.items.map(vm):ea(t)}async function wm(t){return"entries"in t?Object.fromEntries(await Promise.all(Object.entries(t.entries).map(async([e,s])=>[e,await wm(s)]))):"items"in t?Promise.all(t.items.map(wm)):ea(t)}function GS(t){const e={};function s(f){if("pipe"in f)for(const d of f.pipe)d.kind==="schema"&&"pipe"in d?s(d):d.kind==="metadata"&&d.type==="metadata"&&Object.assign(e,d.metadata)}return s(t),e}function qS(t){return K0(t,"title")}function hp(t,e){return!t["~run"]({value:e},{abortEarly:!0}).issues}function h2(){return{kind:"schema",type:"any",reference:h2,expects:"any",async:!1,get"~standard"(){return nr(this)},"~run"(t){return t.typed=!0,t}}}function Fr(t,e){return{kind:"schema",type:"array",reference:Fr,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){const d=s.value;if(Array.isArray(d)){s.typed=!0,s.value=[];for(let h=0;h<d.length;h++){const E=d[h],P=this.item["~run"]({value:E},f);if(P.issues){const R={type:"array",origin:"value",input:d,key:h,value:E};for(const q of P.issues)q.path?q.path.unshift(R):q.path=[R],s.issues?.push(q);if(s.issues||(s.issues=P.issues),f.abortEarly){s.typed=!1;break}}P.typed||(s.typed=!1),s.value.push(P.value)}}else on(this,"type",s,f);return s}}}function _m(t,e){return{kind:"schema",type:"array",reference:_m,expects:"Array",async:!0,item:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){const d=s.value;if(Array.isArray(d)){s.typed=!0,s.value=[];const h=await Promise.all(d.map(E=>this.item["~run"]({value:E},f)));for(let E=0;E<h.length;E++){const P=h[E];if(P.issues){const R={type:"array",origin:"value",input:d,key:E,value:d[E]};for(const q of P.issues)q.path?q.path.unshift(R):q.path=[R],s.issues?.push(q);if(s.issues||(s.issues=P.issues),f.abortEarly){s.typed=!1;break}}P.typed||(s.typed=!1),s.value.push(P.value)}}else on(this,"type",s,f);return s}}}function Jd(t){return{kind:"schema",type:"bigint",reference:Jd,expects:"bigint",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return typeof e.value=="bigint"?e.typed=!0:on(this,"type",e,s),e}}}function Qd(t){return{kind:"schema",type:"blob",reference:Qd,expects:"Blob",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return e.value instanceof Blob?e.typed=!0:on(this,"type",e,s),e}}}function ml(t){return{kind:"schema",type:"boolean",reference:ml,expects:"boolean",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return typeof e.value=="boolean"?e.typed=!0:on(this,"type",e,s),e}}}function p2(t,e){return{kind:"schema",type:"custom",reference:p2,expects:"unknown",async:!1,check:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){return this.check(s.value)?s.typed=!0:on(this,"type",s,f),s}}}function g2(t,e){return{kind:"schema",type:"custom",reference:g2,expects:"unknown",async:!0,check:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){return await this.check(s.value)?s.typed=!0:on(this,"type",s,f),s}}}function y2(t){return{kind:"schema",type:"date",reference:y2,expects:"Date",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return e.value instanceof Date?isNaN(e.value)?on(this,"type",e,s,{received:'"Invalid Date"'}):e.typed=!0:on(this,"type",e,s),e}}}function m2(t,e){const s=[];for(const f in t)(`${+f}`!==f||typeof t[f]!="string"||!Object.is(t[t[f]],+f))&&s.push(t[f]);return{kind:"schema",type:"enum",reference:m2,expects:Lo(s.map(ts),"|"),async:!1,enum:t,options:s,message:e,get"~standard"(){return nr(this)},"~run"(f,d){return this.options.includes(f.value)?f.typed=!0:on(this,"type",f,d),f}}}function b2(t,e){return{kind:"schema",type:"exact_optional",reference:b2,expects:t.expects,async:!1,wrapped:t,default:e,get"~standard"(){return nr(this)},"~run"(s,f){return this.wrapped["~run"](s,f)}}}function v2(t,e){return{kind:"schema",type:"exact_optional",reference:v2,expects:t.expects,async:!0,wrapped:t,default:e,get"~standard"(){return nr(this)},async"~run"(s,f){return this.wrapped["~run"](s,f)}}}function w2(t){return{kind:"schema",type:"file",reference:w2,expects:"File",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return e.value instanceof File?e.typed=!0:on(this,"type",e,s),e}}}function _2(t){return{kind:"schema",type:"function",reference:_2,expects:"Function",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return typeof e.value=="function"?e.typed=!0:on(this,"type",e,s),e}}}function E2(t,e){return{kind:"schema",type:"instance",reference:E2,expects:t.name,async:!1,class:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){return s.value instanceof this.class?s.typed=!0:on(this,"type",s,f),s}}}function eh(t,e){if(typeof t==typeof e){if(t===e||t instanceof Date&&e instanceof Date&&+t==+e)return{value:t};if(t&&e&&t.constructor===Object&&e.constructor===Object){for(const s in e)if(s in t){const f=eh(t[s],e[s]);if(f.issue)return f;t[s]=f.value}else t[s]=e[s];return{value:t}}if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){for(let s=0;s<t.length;s++){const f=eh(t[s],e[s]);if(f.issue)return f;t[s]=f.value}return{value:t}}}return{issue:!0}}function S2(t,e){return{kind:"schema",type:"intersect",reference:S2,expects:Lo(t.map(s=>s.expects),"&"),async:!1,options:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){if(this.options.length){const d=s.value;let h;s.typed=!0;for(const E of this.options){const P=E["~run"]({value:d},f);if(P.issues&&(s.issues?s.issues.push(...P.issues):s.issues=P.issues,f.abortEarly)){s.typed=!1;break}P.typed||(s.typed=!1),s.typed&&(h?h.push(P.value):h=[P.value])}if(s.typed){s.value=h[0];for(let E=1;E<h.length;E++){const P=eh(s.value,h[E]);if(P.issue){on(this,"type",s,f,{received:"unknown"});break}s.value=P.value}}}else on(this,"type",s,f);return s}}}function A2(t,e){return{kind:"schema",type:"intersect",reference:A2,expects:Lo(t.map(s=>s.expects),"&"),async:!0,options:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){if(this.options.length){const d=s.value;let h;s.typed=!0;const E=await Promise.all(this.options.map(P=>P["~run"]({value:d},f)));for(const P of E){if(P.issues&&(s.issues?s.issues.push(...P.issues):s.issues=P.issues,f.abortEarly)){s.typed=!1;break}P.typed||(s.typed=!1),s.typed&&(h?h.push(P.value):h=[P.value])}if(s.typed){s.value=h[0];for(let P=1;P<h.length;P++){const R=eh(s.value,h[P]);if(R.issue){on(this,"type",s,f,{received:"unknown"});break}s.value=R.value}}}else on(this,"type",s,f);return s}}}function Of(t){return{kind:"schema",type:"lazy",reference:Of,expects:"unknown",async:!1,getter:t,get"~standard"(){return nr(this)},"~run"(e,s){return this.getter(e.value)["~run"](e,s)}}}function x2(t){return{kind:"schema",type:"lazy",reference:x2,expects:"unknown",async:!0,getter:t,get"~standard"(){return nr(this)},async"~run"(e,s){return(await this.getter(e.value))["~run"](e,s)}}}function Rr(t,e){return{kind:"schema",type:"literal",reference:Rr,expects:ts(t),async:!1,literal:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){return s.value===this.literal?s.typed=!0:on(this,"type",s,f),s}}}function Em(t,e){return{kind:"schema",type:"loose_object",reference:Em,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){const d=s.value;if(d&&typeof d=="object"){s.typed=!0,s.value={};for(const h in this.entries){const E=this.entries[h];if(h in d||(E.type==="exact_optional"||E.type==="optional"||E.type==="nullish")&&E.default!==void 0){const P=h in d?d[h]:Ls(E),R=E["~run"]({value:P},f);if(R.issues){const q={type:"object",origin:"value",input:d,key:h,value:P};for(const te of R.issues)te.path?te.path.unshift(q):te.path=[q],s.issues?.push(te);if(s.issues||(s.issues=R.issues),f.abortEarly){s.typed=!1;break}}R.typed||(s.typed=!1),s.value[h]=R.value}else if(E.fallback!==void 0)s.value[h]=ea(E);else if(E.type!=="exact_optional"&&E.type!=="optional"&&E.type!=="nullish"&&(on(this,"key",s,f,{input:void 0,expected:`"${h}"`,path:[{type:"object",origin:"key",input:d,key:h,value:d[h]}]}),f.abortEarly))break}if(!s.issues||!f.abortEarly)for(const h in d)Dc(d,h)&&!(h in this.entries)&&(s.value[h]=d[h])}else on(this,"type",s,f);return s}}}function Sm(t,e){return{kind:"schema",type:"loose_object",reference:Sm,expects:"Object",async:!0,entries:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){const d=s.value;if(d&&typeof d=="object"){s.typed=!0,s.value={};const h=await Promise.all(Object.entries(this.entries).map(async([E,P])=>{if(E in d||(P.type==="exact_optional"||P.type==="optional"||P.type==="nullish")&&P.default!==void 0){const R=E in d?d[E]:await Ls(P);return[E,R,P,await P["~run"]({value:R},f)]}return[E,d[E],P,null]}));for(const[E,P,R,q]of h)if(q){if(q.issues){const te={type:"object",origin:"value",input:d,key:E,value:P};for(const ne of q.issues)ne.path?ne.path.unshift(te):ne.path=[te],s.issues?.push(ne);if(s.issues||(s.issues=q.issues),f.abortEarly){s.typed=!1;break}}q.typed||(s.typed=!1),s.value[E]=q.value}else if(R.fallback!==void 0)s.value[E]=await ea(R);else if(R.type!=="exact_optional"&&R.type!=="optional"&&R.type!=="nullish"&&(on(this,"key",s,f,{input:void 0,expected:`"${E}"`,path:[{type:"object",origin:"key",input:d,key:E,value:P}]}),f.abortEarly))break;if(!s.issues||!f.abortEarly)for(const E in d)Dc(d,E)&&!(E in this.entries)&&(s.value[E]=d[E])}else on(this,"type",s,f);return s}}}function I2(t,e){return{kind:"schema",type:"loose_tuple",reference:I2,expects:"Array",async:!1,items:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){const d=s.value;if(Array.isArray(d)){s.typed=!0,s.value=[];for(let h=0;h<this.items.length;h++){const E=d[h],P=this.items[h]["~run"]({value:E},f);if(P.issues){const R={type:"array",origin:"value",input:d,key:h,value:E};for(const q of P.issues)q.path?q.path.unshift(R):q.path=[R],s.issues?.push(q);if(s.issues||(s.issues=P.issues),f.abortEarly){s.typed=!1;break}}P.typed||(s.typed=!1),s.value.push(P.value)}if(!s.issues||!f.abortEarly)for(let h=this.items.length;h<d.length;h++)s.value.push(d[h])}else on(this,"type",s,f);return s}}}function B2(t,e){return{kind:"schema",type:"loose_tuple",reference:B2,expects:"Array",async:!0,items:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){const d=s.value;if(Array.isArray(d)){s.typed=!0,s.value=[];const h=await Promise.all(this.items.map(async(E,P)=>{const R=d[P];return[P,R,await E["~run"]({value:R},f)]}));for(const[E,P,R]of h){if(R.issues){const q={type:"array",origin:"value",input:d,key:E,value:P};for(const te of R.issues)te.path?te.path.unshift(q):te.path=[q],s.issues?.push(te);if(s.issues||(s.issues=R.issues),f.abortEarly){s.typed=!1;break}}R.typed||(s.typed=!1),s.value.push(R.value)}if(!s.issues||!f.abortEarly)for(let E=this.items.length;E<d.length;E++)s.value.push(d[E])}else on(this,"type",s,f);return s}}}function k2(t,e,s){return{kind:"schema",type:"map",reference:k2,expects:"Map",async:!1,key:t,value:e,message:s,get"~standard"(){return nr(this)},"~run"(f,d){const h=f.value;if(h instanceof Map){f.typed=!0,f.value=new Map;for(const[E,P]of h){const R=this.key["~run"]({value:E},d);if(R.issues){const te={type:"map",origin:"key",input:h,key:E,value:P};for(const ne of R.issues)ne.path?ne.path.unshift(te):ne.path=[te],f.issues?.push(ne);if(f.issues||(f.issues=R.issues),d.abortEarly){f.typed=!1;break}}const q=this.value["~run"]({value:P},d);if(q.issues){const te={type:"map",origin:"value",input:h,key:E,value:P};for(const ne of q.issues)ne.path?ne.path.unshift(te):ne.path=[te],f.issues?.push(ne);if(f.issues||(f.issues=q.issues),d.abortEarly){f.typed=!1;break}}(!R.typed||!q.typed)&&(f.typed=!1),f.value.set(R.value,q.value)}}else on(this,"type",f,d);return f}}}function T2(t,e,s){return{kind:"schema",type:"map",reference:T2,expects:"Map",async:!0,key:t,value:e,message:s,get"~standard"(){return nr(this)},async"~run"(f,d){const h=f.value;if(h instanceof Map){f.typed=!0,f.value=new Map;const E=await Promise.all([...h].map(([P,R])=>Promise.all([P,R,this.key["~run"]({value:P},d),this.value["~run"]({value:R},d)])));for(const[P,R,q,te]of E){if(q.issues){const ne={type:"map",origin:"key",input:h,key:P,value:R};for(const ue of q.issues)ue.path?ue.path.unshift(ne):ue.path=[ne],f.issues?.push(ue);if(f.issues||(f.issues=q.issues),d.abortEarly){f.typed=!1;break}}if(te.issues){const ne={type:"map",origin:"value",input:h,key:P,value:R};for(const ue of te.issues)ue.path?ue.path.unshift(ne):ue.path=[ne],f.issues?.push(ue);if(f.issues||(f.issues=te.issues),d.abortEarly){f.typed=!1;break}}(!q.typed||!te.typed)&&(f.typed=!1),f.value.set(q.value,te.value)}}else on(this,"type",f,d);return f}}}function th(t){return{kind:"schema",type:"nan",reference:th,expects:"NaN",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return Number.isNaN(e.value)?e.typed=!0:on(this,"type",e,s),e}}}function C2(t){return{kind:"schema",type:"never",reference:C2,expects:"never",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return on(this,"type",e,s),e}}}function P2(t,e){return{kind:"schema",type:"non_nullable",reference:P2,expects:"!null",async:!1,wrapped:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){return s.value!==null&&(s=this.wrapped["~run"](s,f)),s.value===null&&on(this,"type",s,f),s}}}function M2(t,e){return{kind:"schema",type:"non_nullable",reference:M2,expects:"!null",async:!0,wrapped:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){return s.value!==null&&(s=await this.wrapped["~run"](s,f)),s.value===null&&on(this,"type",s,f),s}}}function O2(t,e){return{kind:"schema",type:"non_nullish",reference:O2,expects:"(!null & !undefined)",async:!1,wrapped:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){return s.value===null||s.value===void 0||(s=this.wrapped["~run"](s,f)),(s.value===null||s.value===void 0)&&on(this,"type",s,f),s}}}function R2(t,e){return{kind:"schema",type:"non_nullish",reference:R2,expects:"(!null & !undefined)",async:!0,wrapped:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){return s.value===null||s.value===void 0||(s=await this.wrapped["~run"](s,f)),(s.value===null||s.value===void 0)&&on(this,"type",s,f),s}}}function Am(t,e){return{kind:"schema",type:"non_optional",reference:Am,expects:"!undefined",async:!1,wrapped:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){return s.value!==void 0&&(s=this.wrapped["~run"](s,f)),s.value===void 0&&on(this,"type",s,f),s}}}function xm(t,e){return{kind:"schema",type:"non_optional",reference:xm,expects:"!undefined",async:!0,wrapped:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){return s.value!==void 0&&(s=await this.wrapped["~run"](s,f)),s.value===void 0&&on(this,"type",s,f),s}}}function N2(t){return{kind:"schema",type:"null",reference:N2,expects:"null",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return e.value===null?e.typed=!0:on(this,"type",e,s),e}}}function fi(t,e){return{kind:"schema",type:"nullable",reference:fi,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,get"~standard"(){return nr(this)},"~run"(s,f){return s.value===null&&(this.default!==void 0&&(s.value=Ls(this,s,f)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,f)}}}function U2(t,e){return{kind:"schema",type:"nullable",reference:U2,expects:`(${t.expects} | null)`,async:!0,wrapped:t,default:e,get"~standard"(){return nr(this)},async"~run"(s,f){return s.value===null&&(this.default!==void 0&&(s.value=await Ls(this,s,f)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,f)}}}function bl(t,e){return{kind:"schema",type:"nullish",reference:bl,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return nr(this)},"~run"(s,f){return(s.value===null||s.value===void 0)&&(this.default!==void 0&&(s.value=Ls(this,s,f)),s.value===null||s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,f)}}}function nh(t,e){return{kind:"schema",type:"nullish",reference:nh,expects:`(${t.expects} | null | undefined)`,async:!0,wrapped:t,default:e,get"~standard"(){return nr(this)},async"~run"(s,f){return(s.value===null||s.value===void 0)&&(this.default!==void 0&&(s.value=await Ls(this,s,f)),s.value===null||s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,f)}}}function rs(t){return{kind:"schema",type:"number",reference:rs,expects:"number",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:on(this,"type",e,s),e}}}function Jn(t,e){return{kind:"schema",type:"object",reference:Jn,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){const d=s.value;if(d&&typeof d=="object"){s.typed=!0,s.value={};for(const h in this.entries){const E=this.entries[h];if(h in d||(E.type==="exact_optional"||E.type==="optional"||E.type==="nullish")&&E.default!==void 0){const P=h in d?d[h]:Ls(E),R=E["~run"]({value:P},f);if(R.issues){const q={type:"object",origin:"value",input:d,key:h,value:P};for(const te of R.issues)te.path?te.path.unshift(q):te.path=[q],s.issues?.push(te);if(s.issues||(s.issues=R.issues),f.abortEarly){s.typed=!1;break}}R.typed||(s.typed=!1),s.value[h]=R.value}else if(E.fallback!==void 0)s.value[h]=ea(E);else if(E.type!=="exact_optional"&&E.type!=="optional"&&E.type!=="nullish"&&(on(this,"key",s,f,{input:void 0,expected:`"${h}"`,path:[{type:"object",origin:"key",input:d,key:h,value:d[h]}]}),f.abortEarly))break}}else on(this,"type",s,f);return s}}}function Im(t,e){return{kind:"schema",type:"object",reference:Im,expects:"Object",async:!0,entries:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){const d=s.value;if(d&&typeof d=="object"){s.typed=!0,s.value={};const h=await Promise.all(Object.entries(this.entries).map(async([E,P])=>{if(E in d||(P.type==="exact_optional"||P.type==="optional"||P.type==="nullish")&&P.default!==void 0){const R=E in d?d[E]:await Ls(P);return[E,R,P,await P["~run"]({value:R},f)]}return[E,d[E],P,null]}));for(const[E,P,R,q]of h)if(q){if(q.issues){const te={type:"object",origin:"value",input:d,key:E,value:P};for(const ne of q.issues)ne.path?ne.path.unshift(te):ne.path=[te],s.issues?.push(ne);if(s.issues||(s.issues=q.issues),f.abortEarly){s.typed=!1;break}}q.typed||(s.typed=!1),s.value[E]=q.value}else if(R.fallback!==void 0)s.value[E]=await ea(R);else if(R.type!=="exact_optional"&&R.type!=="optional"&&R.type!=="nullish"&&(on(this,"key",s,f,{input:void 0,expected:`"${E}"`,path:[{type:"object",origin:"key",input:d,key:E,value:P}]}),f.abortEarly))break}else on(this,"type",s,f);return s}}}function pp(t,e,s){return{kind:"schema",type:"object_with_rest",reference:pp,expects:"Object",async:!1,entries:t,rest:e,message:s,get"~standard"(){return nr(this)},"~run"(f,d){const h=f.value;if(h&&typeof h=="object"){f.typed=!0,f.value={};for(const E in this.entries){const P=this.entries[E];if(E in h||(P.type==="exact_optional"||P.type==="optional"||P.type==="nullish")&&P.default!==void 0){const R=E in h?h[E]:Ls(P),q=P["~run"]({value:R},d);if(q.issues){const te={type:"object",origin:"value",input:h,key:E,value:R};for(const ne of q.issues)ne.path?ne.path.unshift(te):ne.path=[te],f.issues?.push(ne);if(f.issues||(f.issues=q.issues),d.abortEarly){f.typed=!1;break}}q.typed||(f.typed=!1),f.value[E]=q.value}else if(P.fallback!==void 0)f.value[E]=ea(P);else if(P.type!=="exact_optional"&&P.type!=="optional"&&P.type!=="nullish"&&(on(this,"key",f,d,{input:void 0,expected:`"${E}"`,path:[{type:"object",origin:"key",input:h,key:E,value:h[E]}]}),d.abortEarly))break}if(!f.issues||!d.abortEarly){for(const E in h)if(Dc(h,E)&&!(E in this.entries)){const P=this.rest["~run"]({value:h[E]},d);if(P.issues){const R={type:"object",origin:"value",input:h,key:E,value:h[E]};for(const q of P.issues)q.path?q.path.unshift(R):q.path=[R],f.issues?.push(q);if(f.issues||(f.issues=P.issues),d.abortEarly){f.typed=!1;break}}P.typed||(f.typed=!1),f.value[E]=P.value}}}else on(this,"type",f,d);return f}}}function Bm(t,e,s){return{kind:"schema",type:"object_with_rest",reference:Bm,expects:"Object",async:!0,entries:t,rest:e,message:s,get"~standard"(){return nr(this)},async"~run"(f,d){const h=f.value;if(h&&typeof h=="object"){f.typed=!0,f.value={};const[E,P]=await Promise.all([Promise.all(Object.entries(this.entries).map(async([R,q])=>{if(R in h||(q.type==="exact_optional"||q.type==="optional"||q.type==="nullish")&&q.default!==void 0){const te=R in h?h[R]:await Ls(q);return[R,te,q,await q["~run"]({value:te},d)]}return[R,h[R],q,null]})),Promise.all(Object.entries(h).filter(([R])=>Dc(h,R)&&!(R in this.entries)).map(async([R,q])=>[R,q,await this.rest["~run"]({value:q},d)]))]);for(const[R,q,te,ne]of E)if(ne){if(ne.issues){const ue={type:"object",origin:"value",input:h,key:R,value:q};for(const ge of ne.issues)ge.path?ge.path.unshift(ue):ge.path=[ue],f.issues?.push(ge);if(f.issues||(f.issues=ne.issues),d.abortEarly){f.typed=!1;break}}ne.typed||(f.typed=!1),f.value[R]=ne.value}else if(te.fallback!==void 0)f.value[R]=await ea(te);else if(te.type!=="exact_optional"&&te.type!=="optional"&&te.type!=="nullish"&&(on(this,"key",f,d,{input:void 0,expected:`"${R}"`,path:[{type:"object",origin:"key",input:h,key:R,value:q}]}),d.abortEarly))break;if(!f.issues||!d.abortEarly)for(const[R,q,te]of P){if(te.issues){const ne={type:"object",origin:"value",input:h,key:R,value:q};for(const ue of te.issues)ue.path?ue.path.unshift(ne):ue.path=[ne],f.issues?.push(ue);if(f.issues||(f.issues=te.issues),d.abortEarly){f.typed=!1;break}}te.typed||(f.typed=!1),f.value[R]=te.value}}else on(this,"type",f,d);return f}}}function ms(t,e){return{kind:"schema",type:"optional",reference:ms,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return nr(this)},"~run"(s,f){return s.value===void 0&&(this.default!==void 0&&(s.value=Ls(this,s,f)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,f)}}}function gp(t,e){return{kind:"schema",type:"optional",reference:gp,expects:`(${t.expects} | undefined)`,async:!0,wrapped:t,default:e,get"~standard"(){return nr(this)},async"~run"(s,f){return s.value===void 0&&(this.default!==void 0&&(s.value=await Ls(this,s,f)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,f)}}}function yp(t,e){return{kind:"schema",type:"picklist",reference:yp,expects:Lo(t.map(ts),"|"),async:!1,options:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){return this.options.includes(s.value)?s.typed=!0:on(this,"type",s,f),s}}}function D2(t){return{kind:"schema",type:"promise",reference:D2,expects:"Promise",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return e.value instanceof Promise?e.typed=!0:on(this,"type",e,s),e}}}function Rf(t,e,s){return{kind:"schema",type:"record",reference:Rf,expects:"Object",async:!1,key:t,value:e,message:s,get"~standard"(){return nr(this)},"~run"(f,d){const h=f.value;if(h&&typeof h=="object"){f.typed=!0,f.value={};for(const E in h)if(Dc(h,E)){const P=h[E],R=this.key["~run"]({value:E},d);if(R.issues){const te={type:"object",origin:"key",input:h,key:E,value:P};for(const ne of R.issues)ne.path=[te],f.issues?.push(ne);if(f.issues||(f.issues=R.issues),d.abortEarly){f.typed=!1;break}}const q=this.value["~run"]({value:P},d);if(q.issues){const te={type:"object",origin:"value",input:h,key:E,value:P};for(const ne of q.issues)ne.path?ne.path.unshift(te):ne.path=[te],f.issues?.push(ne);if(f.issues||(f.issues=q.issues),d.abortEarly){f.typed=!1;break}}(!R.typed||!q.typed)&&(f.typed=!1),R.typed&&(f.value[R.value]=q.value)}}else on(this,"type",f,d);return f}}}function L2(t,e,s){return{kind:"schema",type:"record",reference:L2,expects:"Object",async:!0,key:t,value:e,message:s,get"~standard"(){return nr(this)},async"~run"(f,d){const h=f.value;if(h&&typeof h=="object"){f.typed=!0,f.value={};const E=await Promise.all(Object.entries(h).filter(([P])=>Dc(h,P)).map(([P,R])=>Promise.all([P,R,this.key["~run"]({value:P},d),this.value["~run"]({value:R},d)])));for(const[P,R,q,te]of E){if(q.issues){const ne={type:"object",origin:"key",input:h,key:P,value:R};for(const ue of q.issues)ue.path=[ne],f.issues?.push(ue);if(f.issues||(f.issues=q.issues),d.abortEarly){f.typed=!1;break}}if(te.issues){const ne={type:"object",origin:"value",input:h,key:P,value:R};for(const ue of te.issues)ue.path?ue.path.unshift(ne):ue.path=[ne],f.issues?.push(ue);if(f.issues||(f.issues=te.issues),d.abortEarly){f.typed=!1;break}}(!q.typed||!te.typed)&&(f.typed=!1),q.typed&&(f.value[q.value]=te.value)}}else on(this,"type",f,d);return f}}}function rh(t,e){return{kind:"schema",type:"set",reference:rh,expects:"Set",async:!1,value:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){const d=s.value;if(d instanceof Set){s.typed=!0,s.value=new Set;for(const h of d){const E=this.value["~run"]({value:h},f);if(E.issues){const P={type:"set",origin:"value",input:d,key:null,value:h};for(const R of E.issues)R.path?R.path.unshift(P):R.path=[P],s.issues?.push(R);if(s.issues||(s.issues=E.issues),f.abortEarly){s.typed=!1;break}}E.typed||(s.typed=!1),s.value.add(E.value)}}else on(this,"type",s,f);return s}}}function ih(t,e){return{kind:"schema",type:"set",reference:ih,expects:"Set",async:!0,value:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){const d=s.value;if(d instanceof Set){s.typed=!0,s.value=new Set;const h=await Promise.all([...d].map(async E=>[E,await this.value["~run"]({value:E},f)]));for(const[E,P]of h){if(P.issues){const R={type:"set",origin:"value",input:d,key:null,value:E};for(const q of P.issues)q.path?q.path.unshift(R):q.path=[R],s.issues?.push(q);if(s.issues||(s.issues=P.issues),f.abortEarly){s.typed=!1;break}}P.typed||(s.typed=!1),s.value.add(P.value)}}else on(this,"type",s,f);return s}}}function F2(t,e){return{kind:"schema",type:"strict_object",reference:F2,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){const d=s.value;if(d&&typeof d=="object"){s.typed=!0,s.value={};for(const h in this.entries){const E=this.entries[h];if(h in d||(E.type==="exact_optional"||E.type==="optional"||E.type==="nullish")&&E.default!==void 0){const P=h in d?d[h]:Ls(E),R=E["~run"]({value:P},f);if(R.issues){const q={type:"object",origin:"value",input:d,key:h,value:P};for(const te of R.issues)te.path?te.path.unshift(q):te.path=[q],s.issues?.push(te);if(s.issues||(s.issues=R.issues),f.abortEarly){s.typed=!1;break}}R.typed||(s.typed=!1),s.value[h]=R.value}else if(E.fallback!==void 0)s.value[h]=ea(E);else if(E.type!=="exact_optional"&&E.type!=="optional"&&E.type!=="nullish"&&(on(this,"key",s,f,{input:void 0,expected:`"${h}"`,path:[{type:"object",origin:"key",input:d,key:h,value:d[h]}]}),f.abortEarly))break}if(!s.issues||!f.abortEarly){for(const h in d)if(!(h in this.entries)){on(this,"key",s,f,{input:h,expected:"never",path:[{type:"object",origin:"key",input:d,key:h,value:d[h]}]});break}}}else on(this,"type",s,f);return s}}}function j2(t,e){return{kind:"schema",type:"strict_object",reference:j2,expects:"Object",async:!0,entries:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){const d=s.value;if(d&&typeof d=="object"){s.typed=!0,s.value={};const h=await Promise.all(Object.entries(this.entries).map(async([E,P])=>{if(E in d||(P.type==="exact_optional"||P.type==="optional"||P.type==="nullish")&&P.default!==void 0){const R=E in d?d[E]:await Ls(P);return[E,R,P,await P["~run"]({value:R},f)]}return[E,d[E],P,null]}));for(const[E,P,R,q]of h)if(q){if(q.issues){const te={type:"object",origin:"value",input:d,key:E,value:P};for(const ne of q.issues)ne.path?ne.path.unshift(te):ne.path=[te],s.issues?.push(ne);if(s.issues||(s.issues=q.issues),f.abortEarly){s.typed=!1;break}}q.typed||(s.typed=!1),s.value[E]=q.value}else if(R.fallback!==void 0)s.value[E]=await ea(R);else if(R.type!=="exact_optional"&&R.type!=="optional"&&R.type!=="nullish"&&(on(this,"key",s,f,{input:void 0,expected:`"${E}"`,path:[{type:"object",origin:"key",input:d,key:E,value:P}]}),f.abortEarly))break;if(!s.issues||!f.abortEarly){for(const E in d)if(!(E in this.entries)){on(this,"key",s,f,{input:E,expected:"never",path:[{type:"object",origin:"key",input:d,key:E,value:d[E]}]});break}}}else on(this,"type",s,f);return s}}}function mp(t,e){return{kind:"schema",type:"strict_tuple",reference:mp,expects:"Array",async:!1,items:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){const d=s.value;if(Array.isArray(d)){s.typed=!0,s.value=[];for(let h=0;h<this.items.length;h++){const E=d[h],P=this.items[h]["~run"]({value:E},f);if(P.issues){const R={type:"array",origin:"value",input:d,key:h,value:E};for(const q of P.issues)q.path?q.path.unshift(R):q.path=[R],s.issues?.push(q);if(s.issues||(s.issues=P.issues),f.abortEarly){s.typed=!1;break}}P.typed||(s.typed=!1),s.value.push(P.value)}!(s.issues&&f.abortEarly)&&this.items.length<d.length&&on(this,"type",s,f,{input:d[this.items.length],expected:"never",path:[{type:"array",origin:"value",input:d,key:this.items.length,value:d[this.items.length]}]})}else on(this,"type",s,f);return s}}}function km(t,e){return{kind:"schema",type:"strict_tuple",reference:km,expects:"Array",async:!0,items:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){const d=s.value;if(Array.isArray(d)){s.typed=!0,s.value=[];const h=await Promise.all(this.items.map(async(E,P)=>{const R=d[P];return[P,R,await E["~run"]({value:R},f)]}));for(const[E,P,R]of h){if(R.issues){const q={type:"array",origin:"value",input:d,key:E,value:P};for(const te of R.issues)te.path?te.path.unshift(q):te.path=[q],s.issues?.push(te);if(s.issues||(s.issues=R.issues),f.abortEarly){s.typed=!1;break}}R.typed||(s.typed=!1),s.value.push(R.value)}!(s.issues&&f.abortEarly)&&this.items.length<d.length&&on(this,"type",s,f,{input:d[this.items.length],expected:"never",path:[{type:"array",origin:"value",input:d,key:this.items.length,value:d[this.items.length]}]})}else on(this,"type",s,f);return s}}}function Gr(t){return{kind:"schema",type:"string",reference:Gr,expects:"string",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return typeof e.value=="string"?e.typed=!0:on(this,"type",e,s),e}}}function z2(t){return{kind:"schema",type:"symbol",reference:z2,expects:"symbol",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return typeof e.value=="symbol"?e.typed=!0:on(this,"type",e,s),e}}}function bp(t,e){return{kind:"schema",type:"tuple",reference:bp,expects:"Array",async:!1,items:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){const d=s.value;if(Array.isArray(d)){s.typed=!0,s.value=[];for(let h=0;h<this.items.length;h++){const E=d[h],P=this.items[h]["~run"]({value:E},f);if(P.issues){const R={type:"array",origin:"value",input:d,key:h,value:E};for(const q of P.issues)q.path?q.path.unshift(R):q.path=[R],s.issues?.push(q);if(s.issues||(s.issues=P.issues),f.abortEarly){s.typed=!1;break}}P.typed||(s.typed=!1),s.value.push(P.value)}}else on(this,"type",s,f);return s}}}function H2(t,e){return{kind:"schema",type:"tuple",reference:H2,expects:"Array",async:!0,items:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){const d=s.value;if(Array.isArray(d)){s.typed=!0,s.value=[];const h=await Promise.all(this.items.map(async(E,P)=>{const R=d[P];return[P,R,await E["~run"]({value:R},f)]}));for(const[E,P,R]of h){if(R.issues){const q={type:"array",origin:"value",input:d,key:E,value:P};for(const te of R.issues)te.path?te.path.unshift(q):te.path=[q],s.issues?.push(te);if(s.issues||(s.issues=R.issues),f.abortEarly){s.typed=!1;break}}R.typed||(s.typed=!1),s.value.push(R.value)}}else on(this,"type",s,f);return s}}}function K2(t,e,s){return{kind:"schema",type:"tuple_with_rest",reference:K2,expects:"Array",async:!1,items:t,rest:e,message:s,get"~standard"(){return nr(this)},"~run"(f,d){const h=f.value;if(Array.isArray(h)){f.typed=!0,f.value=[];for(let E=0;E<this.items.length;E++){const P=h[E],R=this.items[E]["~run"]({value:P},d);if(R.issues){const q={type:"array",origin:"value",input:h,key:E,value:P};for(const te of R.issues)te.path?te.path.unshift(q):te.path=[q],f.issues?.push(te);if(f.issues||(f.issues=R.issues),d.abortEarly){f.typed=!1;break}}R.typed||(f.typed=!1),f.value.push(R.value)}if(!f.issues||!d.abortEarly)for(let E=this.items.length;E<h.length;E++){const P=h[E],R=this.rest["~run"]({value:P},d);if(R.issues){const q={type:"array",origin:"value",input:h,key:E,value:P};for(const te of R.issues)te.path?te.path.unshift(q):te.path=[q],f.issues?.push(te);if(f.issues||(f.issues=R.issues),d.abortEarly){f.typed=!1;break}}R.typed||(f.typed=!1),f.value.push(R.value)}}else on(this,"type",f,d);return f}}}function $2(t,e,s){return{kind:"schema",type:"tuple_with_rest",reference:$2,expects:"Array",async:!0,items:t,rest:e,message:s,get"~standard"(){return nr(this)},async"~run"(f,d){const h=f.value;if(Array.isArray(h)){f.typed=!0,f.value=[];const[E,P]=await Promise.all([Promise.all(this.items.map(async(R,q)=>{const te=h[q];return[q,te,await R["~run"]({value:te},d)]})),Promise.all(h.slice(this.items.length).map(async(R,q)=>[q+this.items.length,R,await this.rest["~run"]({value:R},d)]))]);for(const[R,q,te]of E){if(te.issues){const ne={type:"array",origin:"value",input:h,key:R,value:q};for(const ue of te.issues)ue.path?ue.path.unshift(ne):ue.path=[ne],f.issues?.push(ue);if(f.issues||(f.issues=te.issues),d.abortEarly){f.typed=!1;break}}te.typed||(f.typed=!1),f.value.push(te.value)}if(!f.issues||!d.abortEarly)for(const[R,q,te]of P){if(te.issues){const ne={type:"array",origin:"value",input:h,key:R,value:q};for(const ue of te.issues)ue.path?ue.path.unshift(ne):ue.path=[ne],f.issues?.push(ue);if(f.issues||(f.issues=te.issues),d.abortEarly){f.typed=!1;break}}te.typed||(f.typed=!1),f.value.push(te.value)}}else on(this,"type",f,d);return f}}}function V2(t){return{kind:"schema",type:"undefined",reference:V2,expects:"undefined",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return e.value===void 0?e.typed=!0:on(this,"type",e,s),e}}}function W2(t,e){return{kind:"schema",type:"undefinedable",reference:W2,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return nr(this)},"~run"(s,f){return s.value===void 0&&(this.default!==void 0&&(s.value=Ls(this,s,f)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,f)}}}function G2(t,e){return{kind:"schema",type:"undefinedable",reference:G2,expects:`(${t.expects} | undefined)`,async:!0,wrapped:t,default:e,get"~standard"(){return nr(this)},async"~run"(s,f){return s.value===void 0&&(this.default!==void 0&&(s.value=await Ls(this,s,f)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,f)}}}function sh(t){let e;if(t)for(const s of t)e?e.push(...s.issues):e=s.issues;return e}function Fs(t,e){return{kind:"schema",type:"union",reference:Fs,expects:Lo(t.map(s=>s.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return nr(this)},"~run"(s,f){let d,h,E;for(const P of this.options){const R=P["~run"]({value:s.value},f);if(R.typed)if(R.issues)h?h.push(R):h=[R];else{d=R;break}else E?E.push(R):E=[R]}if(d)return d;if(h){if(h.length===1)return h[0];on(this,"type",s,f,{issues:sh(h)}),s.typed=!0}else{if(E?.length===1)return E[0];on(this,"type",s,f,{issues:sh(E)})}return s}}}function q2(t,e){return{kind:"schema",type:"union",reference:q2,expects:Lo(t.map(s=>s.expects),"|"),async:!0,options:t,message:e,get"~standard"(){return nr(this)},async"~run"(s,f){let d,h,E;for(const P of this.options){const R=await P["~run"]({value:s.value},f);if(R.typed)if(R.issues)h?h.push(R):h=[R];else{d=R;break}else E?E.push(R):E=[R]}if(d)return d;if(h){if(h.length===1)return h[0];on(this,"type",s,f,{issues:sh(h)}),s.typed=!0}else{if(E?.length===1)return E[0];on(this,"type",s,f,{issues:sh(E)})}return s}}}function Xs(){return{kind:"schema",type:"unknown",reference:Xs,expects:"unknown",async:!1,get"~standard"(){return nr(this)},"~run"(t){return t.typed=!0,t}}}function Z2(t,e,s){return{kind:"schema",type:"variant",reference:Z2,expects:"Object",async:!1,key:t,options:e,message:s,get"~standard"(){return nr(this)},"~run"(f,d){const h=f.value;if(h&&typeof h=="object"){let E,P=0,R=this.key,q=[];const te=(ne,ue)=>{for(const ge of ne.options){if(ge.type==="variant")te(ge,new Set(ue).add(ge.key));else{let xe=!0,pe=0;for(const Se of ue){const Ce=ge.entries[Se];if(Se in h?Ce["~run"]({typed:!1,value:h[Se]},{abortEarly:!0}).issues:Ce.type!=="exact_optional"&&Ce.type!=="optional"&&Ce.type!=="nullish"){xe=!1,R!==Se&&(P<pe||P===pe&&Se in h&&!(R in h))&&(P=pe,R=Se,q=[]),R===Se&&q.push(ge.entries[Se].expects);break}pe++}if(xe){const Se=ge["~run"]({value:h},d);(!E||!E.typed&&Se.typed)&&(E=Se)}}if(E&&!E.issues)break}};if(te(this,new Set([this.key])),E)return E;on(this,"type",f,d,{input:h[R],expected:Lo(q,"|"),path:[{type:"object",origin:"value",input:h,key:R,value:h[R]}]})}else on(this,"type",f,d);return f}}}function X2(t,e,s){return{kind:"schema",type:"variant",reference:X2,expects:"Object",async:!0,key:t,options:e,message:s,get"~standard"(){return nr(this)},async"~run"(f,d){const h=f.value;if(h&&typeof h=="object"){let E,P=0,R=this.key,q=[];const te=async(ne,ue)=>{for(const ge of ne.options){if(ge.type==="variant")await te(ge,new Set(ue).add(ge.key));else{let xe=!0,pe=0;for(const Se of ue){const Ce=ge.entries[Se];if(Se in h?(await Ce["~run"]({typed:!1,value:h[Se]},{abortEarly:!0})).issues:Ce.type!=="exact_optional"&&Ce.type!=="optional"&&Ce.type!=="nullish"){xe=!1,R!==Se&&(P<pe||P===pe&&Se in h&&!(R in h))&&(P=pe,R=Se,q=[]),R===Se&&q.push(ge.entries[Se].expects);break}pe++}if(xe){const Se=await ge["~run"]({value:h},d);(!E||!E.typed&&Se.typed)&&(E=Se)}}if(E&&!E.issues)break}};if(await te(this,new Set([this.key])),E)return E;on(this,"type",f,d,{input:h[R],expected:Lo(q,"|"),path:[{type:"object",origin:"value",input:h,key:R,value:h[R]}]})}else on(this,"type",f,d);return f}}}function Au(t){return{kind:"schema",type:"void",reference:Au,expects:"void",async:!1,message:t,get"~standard"(){return nr(this)},"~run"(e,s){return e.value===void 0?e.typed=!0:on(this,"type",e,s),e}}}function Zr(t,e){return yp(Object.keys(t.entries),e)}function ZS(t,e){return{...t,get"~standard"(){return nr(this)},"~run"(s,f){return t["~run"](s,{...f,message:e})}}}function jo(t,e){const s={...t.entries};for(const f of e)delete s[f];return{...t,entries:s,get"~standard"(){return nr(this)}}}function Wr(t,e,s){const f=t["~run"]({value:e},Io(s));if(f.issues)throw new Lc(f.issues);return f.value}async function Y2(t,e,s){const f=await t["~run"]({value:e},Io(s));if(f.issues)throw new Lc(f.issues);return f.value}function xu(t,e){const s=f=>Wr(t,f,e);return s.schema=t,s.config=e,s}function XS(t,e){const s=f=>Y2(t,f,e);return s.schema=t,s.config=e,s}function YS(t,e){const s={};for(const f in t.entries)s[f]=!e||e.includes(f)?ms(t.entries[f]):t.entries[f];return{...t,entries:s,get"~standard"(){return nr(this)}}}function JS(t,e){const s={};for(const f in t.entries)s[f]=!e||e.includes(f)?gp(t.entries[f]):t.entries[f];return{...t,entries:s,get"~standard"(){return nr(this)}}}function QS(t,e){const s={};for(const f of e)s[f]=t.entries[f];return{...t,entries:s,get"~standard"(){return nr(this)}}}function Hi(...t){return{...t[0],pipe:t,get"~standard"(){return nr(this)},"~run"(e,s){for(const f of t)if(f.kind!=="metadata"){if(e.issues&&(f.kind==="schema"||f.kind==="transformation")){e.typed=!1;break}(!e.issues||!s.abortEarly&&!s.abortPipeEarly)&&(e=f["~run"](e,s))}return e}}}function Tm(...t){return{...t[0],pipe:t,async:!0,get"~standard"(){return nr(this)},async"~run"(e,s){for(const f of t)if(f.kind!=="metadata"){if(e.issues&&(f.kind==="schema"||f.kind==="transformation")){e.typed=!1;break}(!e.issues||!s.abortEarly&&!s.abortPipeEarly)&&(e=await f["~run"](e,s))}return e}}}function e8(t,e,s){const f=Array.isArray(e)?e:void 0,d=Array.isArray(e)?s:e,h={};for(const E in t.entries)h[E]=!f||f.includes(E)?Am(t.entries[E],d):t.entries[E];return{...t,entries:h,get"~standard"(){return nr(this)}}}function Kc(t,e,s){const f=Array.isArray(e)?e:void 0,d=Array.isArray(e)?s:e,h={};for(const E in t.entries)h[E]=!f||f.includes(E)?xm(t.entries[E],d):t.entries[E];return{...t,entries:h,get"~standard"(){return nr(this)}}}function Cm(t,e,s){const f=t["~run"]({value:e},Io(s));return{typed:f.typed,success:!f.issues,output:f.value,issues:f.issues}}async function oh(t,e,s){const f=await t["~run"]({value:e},Io(s));return{typed:f.typed,success:!f.issues,output:f.value,issues:f.issues}}function ds(t,e){const s=f=>Cm(t,f,e);return s.schema=t,s.config=e,s}function bs(t,e){const s=f=>oh(t,f,e);return s.schema=t,s.config=e,s}function J2(t){let e="";for(const s of t){e&&(e+=`
|
||
`),e+=`\xD7 ${s.message}`;const f=kf(s);f&&(e+=`
|
||
\u2192 at ${f}`)}return e}function t8(t){return t.wrapped}function Ua(t){return Fs(Object.keys(t).map(e=>Nf(e,Jn({[e]:t[e]}))))}function Nf(t,e){return Hi(Jn({...e.entries,$kind:ms(Rr(t))}),fp(s=>({...s,$kind:t})))}const vl=Hi(Gr(),fp(t=>ni(t)),hl(Do)),zo=vl,Iu=Gr(),ks=Hi(Fs([Gr(),Hi(rs(),ns())]),hl(t=>{try{return BigInt(t),BigInt(t)>=0&&BigInt(t)<=18446744073709551615n}catch{return!1}},"Invalid u64")),Uf=Hi(rs(),ns(),hl(t=>t>=0&&t<2**32,"Invalid u32")),Da=Jn({objectId:vl,version:ks,digest:Gr()}),Gi=Fs([Nf("GasCoin",Jn({GasCoin:Rr(!0)})),Nf("Input",Jn({Input:Hi(rs(),ns()),type:ms(Fs([Rr("pure"),Rr("object"),Rr("withdrawal")]))})),Nf("Result",Jn({Result:Hi(rs(),ns())})),Nf("NestedResult",Jn({NestedResult:bp([Hi(rs(),ns()),Hi(rs(),ns())])}))]),Pm=Jn({budget:fi(ks),price:fi(ks),owner:fi(vl),payment:fi(Fr(Da))}),vp=Jn({address:Gr(),module:Gr(),name:Gr(),typeParams:Fr(Gr())}),ho=Fs([Jn({$kind:Rr("address")}),Jn({$kind:Rr("bool")}),Jn({$kind:Rr("u8")}),Jn({$kind:Rr("u16")}),Jn({$kind:Rr("u32")}),Jn({$kind:Rr("u64")}),Jn({$kind:Rr("u128")}),Jn({$kind:Rr("u256")}),Jn({$kind:Rr("unknown")}),Jn({$kind:Rr("vector"),vector:Of(()=>ho)}),Jn({$kind:Rr("datatype"),datatype:Jn({typeName:Gr(),typeParameters:Fr(Of(()=>ho))})}),Jn({$kind:Rr("typeParameter"),index:Hi(rs(),ns())})]),Q2=Ua({MoveCall:Jn({package:zo,module:Gr(),function:Gr(),typeArguments:Fr(Gr()),arguments:Fr(Gi),_argumentTypes:ms(fi(Fr(Jn({reference:fi(Fs([Rr("mutable"),Rr("immutable"),Rr("unknown")])),body:ho}))))}),TransferObjects:Jn({objects:Fr(Gi),address:Gi}),SplitCoins:Jn({coin:Gi,amounts:Fr(Gi)}),MergeCoins:Jn({destination:Gi,sources:Fr(Gi)}),Publish:Jn({modules:Fr(Iu),dependencies:Fr(zo)}),MakeMoveVec:Jn({type:fi(Gr()),elements:Fr(Gi)}),Upgrade:Jn({modules:Fr(Iu),dependencies:Fr(zo),package:zo,ticket:Gi}),$Intent:Jn({name:Gr(),inputs:Rf(Gr(),Fs([Gi,Fr(Gi)])),data:Rf(Gr(),Xs())})}),Mm=Ua({ImmOrOwnedObject:Da,SharedObject:Jn({objectId:zo,initialSharedVersion:ks,mutable:ml()}),Receiving:Da}),e3=Ua({MaxAmountU64:ks}),Om=Ua({Balance:Gr()}),cc=Ua({Sender:Rr(!0),Sponsor:Rr(!0)}),Xr=Jn({reservation:e3,typeArg:Om,withdrawFrom:cc}),Rm=Ua({Object:Mm,Pure:Jn({bytes:Iu}),UnresolvedPure:Jn({value:Xs()}),UnresolvedObject:Jn({objectId:zo,version:ms(fi(ks)),digest:ms(fi(Gr())),initialSharedVersion:ms(fi(ks)),mutable:ms(fi(ml()))}),FundsWithdrawal:Xr}),Ho=Ua({Object:Mm,Pure:Jn({bytes:Iu})}),wp=Jn({minEpoch:fi(ks),maxEpoch:fi(ks),minTimestamp:fi(ks),maxTimestamp:fi(ks),chain:Gr(),nonce:Uf}),Nm=Ua({None:Rr(!0),Epoch:ks,ValidDuring:wp}),bi=Jn({version:Rr(2),sender:bl(vl),expiration:bl(Nm),gasData:Pm,inputs:Fr(Rm),commands:Fr(Q2)}),t3=/^vector<(.+)>$/,Um=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;var ta=class y0{static parseFromStr(e,s=!1){if(e==="address")return{address:null};if(e==="bool")return{bool:null};if(e==="u8")return{u8:null};if(e==="u16")return{u16:null};if(e==="u32")return{u32:null};if(e==="u64")return{u64:null};if(e==="u128")return{u128:null};if(e==="u256")return{u256:null};if(e==="signer")return{signer:null};const f=e.match(t3);if(f)return{vector:y0.parseFromStr(f[1],s)};const d=e.match(Um);if(d)return{struct:{address:s?ni(d[1]):d[1],module:d[2],name:d[3],typeParams:d[5]===void 0?[]:y0.parseStructTypeArgs(d[5],s)}};throw new Error(`Encountered unexpected token when parsing type args for ${e}`)}static parseStructTypeArgs(e,s=!1){return fy(e).map(f=>y0.parseFromStr(f,s))}static tagToString(e){if("bool"in e)return"bool";if("u8"in e)return"u8";if("u16"in e)return"u16";if("u32"in e)return"u32";if("u64"in e)return"u64";if("u128"in e)return"u128";if("u256"in e)return"u256";if("address"in e)return"address";if("signer"in e)return"signer";if("vector"in e)return`vector<${y0.tagToString(e.vector)}>`;if("struct"in e){const s=e.struct,f=s.typeParams.map(y0.tagToString).join(", ");return`${s.address}::${s.module}::${s.name}${f?`<${f}>`:""}`}throw new Error("Invalid TypeTag")}};function i8(t){return ta.tagToString(ta.parseFromStr(t))}const _p=Jn({digest:Gr(),objectId:Gr(),version:Fs([Hi(rs(),ns()),Gr(),Jd()])}),n3=Ua({ImmOrOwned:_p,Shared:Jn({objectId:zo,initialSharedVersion:ks,mutable:ml()}),Receiving:_p}),Dm=Ua({Object:n3,Pure:Fr(Hi(rs(),ns()))}),Lm=Fs([Jn({kind:Rr("Input"),index:Hi(rs(),ns()),value:Xs(),type:ms(Rr("object"))}),Jn({kind:Rr("Input"),index:Hi(rs(),ns()),value:Xs(),type:Rr("pure")})]),r3=Fs([Jn({Epoch:Hi(rs(),ns())}),Jn({None:fi(Rr(!0))})]),Fm=Hi(Fs([rs(),Gr(),Jd()]),hl(t=>{if(!["string","number","bigint"].includes(typeof t))return!1;try{return BigInt(t),!0}catch{return!1}})),Ep=Fs([Jn({bool:fi(Rr(!0))}),Jn({u8:fi(Rr(!0))}),Jn({u64:fi(Rr(!0))}),Jn({u128:fi(Rr(!0))}),Jn({address:fi(Rr(!0))}),Jn({signer:fi(Rr(!0))}),Jn({vector:Of(()=>Ep)}),Jn({struct:Of(()=>i3)}),Jn({u16:fi(Rr(!0))}),Jn({u32:fi(Rr(!0))}),Jn({u256:fi(Rr(!0))})]),i3=Jn({address:Gr(),module:Gr(),name:Gr(),typeParams:Fr(Ep)}),s3=Jn({budget:ms(Fm),price:ms(Fm),payment:ms(Fr(_p)),owner:ms(Gr())}),uc=Fs([...[Lm,Jn({kind:Rr("GasCoin")}),Jn({kind:Rr("Result"),index:Hi(rs(),ns())}),Jn({kind:Rr("NestedResult"),index:Hi(rs(),ns()),resultIndex:Hi(rs(),ns())})]]),l8=Jn({version:Rr(1),sender:ms(Gr()),expiration:bl(r3),gasConfig:s3,inputs:Fr(Lm),transactions:Fr(Fs([Jn({kind:Rr("MoveCall"),target:Hi(Gr(),hl(t=>t.split("::").length===3)),typeArguments:Fr(Gr()),arguments:Fr(uc)}),Jn({kind:Rr("TransferObjects"),objects:Fr(uc),address:uc}),Jn({kind:Rr("SplitCoins"),coin:uc,amounts:Fr(uc)}),Jn({kind:Rr("MergeCoins"),destination:uc,sources:Fr(uc)}),Jn({kind:Rr("Publish"),modules:Fr(Fr(Hi(rs(),ns()))),dependencies:Fr(Gr())}),Jn({kind:Rr("Upgrade"),modules:Fr(Fr(Hi(rs(),ns()))),dependencies:Fr(Gr()),packageId:Gr(),ticket:uc}),Jn({kind:Rr("MakeMoveVec"),type:Fs([Jn({Some:Ep}),Jn({None:fi(Rr(!0))})]),objects:Fr(uc)})]))});function js(t){const e=t.inputs.map((s,f)=>{if(s.Object)return{kind:"Input",index:f,value:{Object:s.Object.ImmOrOwnedObject?{ImmOrOwned:s.Object.ImmOrOwnedObject}:s.Object.Receiving?{Receiving:{digest:s.Object.Receiving.digest,version:s.Object.Receiving.version,objectId:s.Object.Receiving.objectId}}:{Shared:{mutable:s.Object.SharedObject.mutable,initialSharedVersion:s.Object.SharedObject.initialSharedVersion,objectId:s.Object.SharedObject.objectId}}},type:"object"};if(s.Pure)return{kind:"Input",index:f,value:{Pure:Array.from(ls(s.Pure.bytes))},type:"pure"};if(s.UnresolvedPure)return{kind:"Input",type:"pure",index:f,value:s.UnresolvedPure.value};if(s.UnresolvedObject)return{kind:"Input",type:"object",index:f,value:s.UnresolvedObject.objectId};throw new Error("Invalid input")});return{version:1,sender:t.sender??void 0,expiration:t.expiration?.$kind==="Epoch"?{Epoch:Number(t.expiration.Epoch)}:t.expiration?{None:!0}:null,gasConfig:{owner:t.gasData.owner??void 0,budget:t.gasData.budget??void 0,price:t.gasData.price??void 0,payment:t.gasData.payment??void 0},inputs:e,transactions:t.commands.map(s=>{if(s.MakeMoveVec)return{kind:"MakeMoveVec",type:s.MakeMoveVec.type===null?{None:!0}:{Some:ta.parseFromStr(s.MakeMoveVec.type)},objects:s.MakeMoveVec.elements.map(f=>hs(f,e))};if(s.MergeCoins)return{kind:"MergeCoins",destination:hs(s.MergeCoins.destination,e),sources:s.MergeCoins.sources.map(f=>hs(f,e))};if(s.MoveCall)return{kind:"MoveCall",target:`${s.MoveCall.package}::${s.MoveCall.module}::${s.MoveCall.function}`,typeArguments:s.MoveCall.typeArguments,arguments:s.MoveCall.arguments.map(f=>hs(f,e))};if(s.Publish)return{kind:"Publish",modules:s.Publish.modules.map(f=>Array.from(ls(f))),dependencies:s.Publish.dependencies};if(s.SplitCoins)return{kind:"SplitCoins",coin:hs(s.SplitCoins.coin,e),amounts:s.SplitCoins.amounts.map(f=>hs(f,e))};if(s.TransferObjects)return{kind:"TransferObjects",objects:s.TransferObjects.objects.map(f=>hs(f,e)),address:hs(s.TransferObjects.address,e)};if(s.Upgrade)return{kind:"Upgrade",modules:s.Upgrade.modules.map(f=>Array.from(ls(f))),dependencies:s.Upgrade.dependencies,packageId:s.Upgrade.package,ticket:hs(s.Upgrade.ticket,e)};throw new Error(`Unknown transaction ${Object.keys(s)}`)})}}function hs(t,e){if(t.$kind==="GasCoin")return{kind:"GasCoin"};if(t.$kind==="Result")return{kind:"Result",index:t.Result};if(t.$kind==="NestedResult")return{kind:"NestedResult",index:t.NestedResult[0],resultIndex:t.NestedResult[1]};if(t.$kind==="Input")return e[t.Input];throw new Error(`Invalid argument ${Object.keys(t)}`)}function o3(t){return Wr(bi,{version:2,sender:t.sender??null,expiration:t.expiration?"Epoch"in t.expiration?{Epoch:t.expiration.Epoch}:{None:!0}:null,gasData:{owner:t.gasConfig.owner??null,budget:t.gasConfig.budget?.toString()??null,price:t.gasConfig.price?.toString()??null,payment:t.gasConfig.payment?.map(e=>({digest:e.digest,objectId:e.objectId,version:e.version.toString()}))??null},inputs:t.inputs.map(e=>{if(e.kind==="Input"){if(hp(Dm,e.value)){const s=Wr(Dm,e.value);if(s.Object){if(s.Object.ImmOrOwned)return{Object:{ImmOrOwnedObject:{objectId:s.Object.ImmOrOwned.objectId,version:String(s.Object.ImmOrOwned.version),digest:s.Object.ImmOrOwned.digest}}};if(s.Object.Shared)return{Object:{SharedObject:{mutable:s.Object.Shared.mutable??null,initialSharedVersion:s.Object.Shared.initialSharedVersion,objectId:s.Object.Shared.objectId}}};if(s.Object.Receiving)return{Object:{Receiving:{digest:s.Object.Receiving.digest,version:String(s.Object.Receiving.version),objectId:s.Object.Receiving.objectId}}};throw new Error("Invalid object input")}return{Pure:{bytes:Wi(new Uint8Array(s.Pure))}}}return e.type==="object"?{UnresolvedObject:{objectId:e.value}}:{UnresolvedPure:{value:e.value}}}throw new Error("Invalid input")}),commands:t.transactions.map(e=>{switch(e.kind){case"MakeMoveVec":return{MakeMoveVec:{type:"Some"in e.type?ta.tagToString(e.type.Some):null,elements:e.objects.map(s=>lc(s))}};case"MergeCoins":return{MergeCoins:{destination:lc(e.destination),sources:e.sources.map(s=>lc(s))}};case"MoveCall":{const[s,f,d]=e.target.split("::");return{MoveCall:{package:s,module:f,function:d,typeArguments:e.typeArguments,arguments:e.arguments.map(h=>lc(h))}}}case"Publish":return{Publish:{modules:e.modules.map(s=>Wi(Uint8Array.from(s))),dependencies:e.dependencies}};case"SplitCoins":return{SplitCoins:{coin:lc(e.coin),amounts:e.amounts.map(s=>lc(s))}};case"TransferObjects":return{TransferObjects:{objects:e.objects.map(s=>lc(s)),address:lc(e.address)}};case"Upgrade":return{Upgrade:{modules:e.modules.map(s=>Wi(Uint8Array.from(s))),dependencies:e.dependencies,package:e.packageId,ticket:lc(e.ticket)}}}throw new Error(`Unknown transaction ${Object.keys(e)}`)})})}function lc(t){switch(t.kind){case"GasCoin":return{GasCoin:!0};case"Result":return{Result:t.index};case"NestedResult":return{NestedResult:[t.index,t.resultIndex]};case"Input":return{Input:t.index}}}function ah(t){if(typeof t=="string")return ni(t);if(t.Object)return t.Object.ImmOrOwnedObject?ni(t.Object.ImmOrOwnedObject.objectId):t.Object.Receiving?ni(t.Object.Receiving.objectId):ni(t.Object.SharedObject.objectId);if(t.UnresolvedObject)return ni(t.UnresolvedObject.objectId)}function a3(t){return is(ArgumentSchema,t)}function c3(t,e,s){const f=d=>{switch(d.$kind){case"Input":{const h=e.get(d.Input);if(h===void 0)throw new Error(`Input ${d.Input} not found in input mapping`);return{...d,Input:h}}case"Result":{const h=s.get(d.Result);return h!==void 0?{...d,Result:h}:d}case"NestedResult":{const h=s.get(d.NestedResult[0]);return h!==void 0?{...d,NestedResult:[h,d.NestedResult[1]]}:d}default:return d}};switch(t.$kind){case"MoveCall":t.MoveCall.arguments=t.MoveCall.arguments.map(f);break;case"TransferObjects":t.TransferObjects.objects=t.TransferObjects.objects.map(f),t.TransferObjects.address=f(t.TransferObjects.address);break;case"SplitCoins":t.SplitCoins.coin=f(t.SplitCoins.coin),t.SplitCoins.amounts=t.SplitCoins.amounts.map(f);break;case"MergeCoins":t.MergeCoins.destination=f(t.MergeCoins.destination),t.MergeCoins.sources=t.MergeCoins.sources.map(f);break;case"MakeMoveVec":t.MakeMoveVec.elements=t.MakeMoveVec.elements.map(f);break;case"Upgrade":t.Upgrade.ticket=f(t.Upgrade.ticket);break;case"$Intent":{const d=t.$Intent.inputs;t.$Intent.inputs={};for(const[h,E]of Object.entries(d))t.$Intent.inputs[h]=Array.isArray(E)?E.map(f):f(E);break}case"Publish":break}}function ch(t){let e=BigInt(t);const s=[];let f=0;if(e===0n)return[0];for(;e>0;)s[f]=Number(e&127n),e>>=7n,e>0n&&(s[f]|=128),f+=1;return s}function u3(t){let e=0n,s=0n,f=0;for(;;){if(f>=t.length)throw new Error("ULEB decode error: buffer overflow");const d=t[f];if(f+=1,e+=BigInt(d&127)<<s,!(d&128))break;s+=7n}if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("ULEB decode error: value exceeds MAX_SAFE_INTEGER");return{value:Number(e),length:f}}var Hm=class{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength)}shift(t){return this.bytePosition+=t,this}read8(){const t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){const t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){const t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){const t=this.read32(),e=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+e).toString(10)}read128(){const t=BigInt(this.read64()),e=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+e).toString(10)}read256(){const t=BigInt(this.read128()),e=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+e).toString(10)}readBytes(t){const e=this.bytePosition+this.dataView.byteOffset,s=new Uint8Array(this.dataView.buffer,e,t);return this.shift(t),s}readULEB(){const t=this.bytePosition+this.dataView.byteOffset,{value:e,length:s}=u3(new Uint8Array(this.dataView.buffer,t));return this.shift(s),e}readVec(t){const e=this.readULEB(),s=[];for(let f=0;f<e;f++)s.push(t(this,f,e));return s}},l3=class{constructor({initialSize:t=1024,maxSize:e=1/0,allocateSize:s=1024}={}){this.bytePosition=0,this.size=t,this.maxSize=e,this.allocateSize=s,this.dataView=new DataView(new ArrayBuffer(t))}ensureSizeOrGrow(t){const e=this.bytePosition+t;if(e>this.size){const s=Math.min(this.maxSize,Math.max(this.size+e,this.size+this.allocateSize));if(e>s)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${e}`);this.size=s;const f=new ArrayBuffer(this.size);new Uint8Array(f).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(f)}}shift(t){return this.bytePosition+=t,this}write8(t){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(t)),this.shift(1)}writeBytes(t){this.ensureSizeOrGrow(t.length);for(let e=0;e<t.length;e++)this.dataView.setUint8(this.bytePosition+e,t[e]);return this.shift(t.length)}write16(t){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(t),!0),this.shift(2)}write32(t){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(t),!0),this.shift(4)}write64(t){return Sp(BigInt(t),8).forEach(e=>this.write8(e)),this}write128(t){return Sp(BigInt(t),16).forEach(e=>this.write8(e)),this}write256(t){return Sp(BigInt(t),32).forEach(e=>this.write8(e)),this}writeULEB(t){return ch(t).forEach(e=>this.write8(e)),this}writeVec(t,e){return this.writeULEB(t.length),Array.from(t).forEach((s,f)=>e(this,s,f,t.length)),this}*[Symbol.iterator](){for(let t=0;t<this.bytePosition;t++)yield this.dataView.getUint8(t);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(t){return kv(this.toBytes(),t)}};function Sp(t,e){const s=new Uint8Array(e);let f=0;for(;t>0;)s[f]=Number(t%BigInt(256)),t=t/BigInt(256),f+=1;return s}var Ea=class MC{#e;#n;constructor(e){this.name=e.name,this.read=e.read,this.serializedSize=e.serializedSize??(()=>null),this.#e=e.write,this.#n=e.serialize??((s,f)=>{const d=new l3({initialSize:this.serializedSize(s)??void 0,...f});return this.#e(s,d),d.toBytes()}),this.validate=e.validate??(()=>{})}write(e,s){this.validate(e),this.#e(e,s)}serialize(e,s){return this.validate(e),new f3(this,this.#n(e,s))}parse(e){const s=new Hm(e);return this.read(s)}fromHex(e){return this.parse(Tc(e))}fromBase58(e){return this.parse(ba(e))}fromBase64(e){return this.parse(ls(e))}transform({name:e,input:s,output:f,validate:d}){return new MC({name:e??this.name,read:h=>f?f(this.read(h)):this.read(h),write:(h,E)=>this.#e(s?s(h):h,E),serializedSize:h=>this.serializedSize(s?s(h):h),serialize:(h,E)=>this.#n(s?s(h):h,E),validate:h=>{d?.(h),this.validate(s?s(h):h)}})}};const Ap=Symbol.for("@mysten/serialized-bcs");function uh(t){return!!t&&typeof t=="object"&&t[Ap]===!0}var f3=class{#e;#n;get[Ap](){return!0}constructor(t,e){this.#e=t,this.#n=e}toBytes(){return this.#n}toHex(){return Cc(this.#n)}toBase64(){return Wi(this.#n)}toBase58(){return cl(this.#n)}parse(){return this.#e.parse(this.#n)}};function lh({size:t,...e}){return new Ea({...e,serializedSize:()=>t})}function xp({readMethod:t,writeMethod:e,...s}){return lh({...s,read:f=>f[t](),write:(f,d)=>d[e](f),validate:f=>{if(f<0||f>s.maxValue)throw new TypeError(`Invalid ${s.name} value: ${f}. Expected value in range 0-${s.maxValue}`);s.validate?.(f)}})}function Ip({readMethod:t,writeMethod:e,...s}){return lh({...s,read:f=>f[t](),write:(f,d)=>d[e](BigInt(f)),validate:f=>{const d=BigInt(f);if(d<0||d>s.maxValue)throw new TypeError(`Invalid ${s.name} value: ${d}. Expected value in range 0-${s.maxValue}`);s.validate?.(d)}})}function wl({serialize:t,...e}){const s=new Ea({...e,serialize:t,write:(f,d)=>{for(const h of s.serialize(f).toBytes())d.write8(h)}});return s}function d3({toBytes:t,fromBytes:e,...s}){return new Ea({...s,read:f=>{const d=f.readULEB();return e(f.readBytes(d))},write:(f,d)=>{const h=t(f);d.writeULEB(h.length);for(let E=0;E<h.length;E++)d.write8(h[E])},serialize:f=>{const d=t(f),h=ch(d.length),E=new Uint8Array(h.length+d.length);return E.set(h,0),E.set(d,h.length),E},validate:f=>{if(typeof f!="string")throw new TypeError(`Invalid ${s.name} value: ${f}. Expected string`);s.validate?.(f)}})}function h3(t){let e=null;function s(){return e||(e=t()),e}return new Ea({name:"lazy",read:f=>s().read(f),serializedSize:f=>s().serializedSize(f),write:(f,d)=>s().write(f,d),serialize:(f,d)=>s().serialize(f,d).toBytes()})}var p3=class extends Ea{constructor({name:t,fields:e,...s}){const f=Object.entries(e);super({name:t,serializedSize:d=>{let h=0;for(const[E,P]of f){const R=P.serializedSize(d[E]);if(R==null)return null;h+=R}return h},read:d=>{const h={};for(const[E,P]of f)h[E]=P.read(d);return h},write:(d,h)=>{for(const[E,P]of f)P.write(d[E],h)},...s,validate:d=>{if(s?.validate?.(d),typeof d!="object"||d==null)throw new TypeError(`Expected object, found ${typeof d}`)}})}},g3=class extends Ea{constructor({fields:t,...e}){const s=Object.entries(t);super({read:f=>{const d=f.readULEB(),h=s[d];if(!h)throw new TypeError(`Unknown value ${d} for enum ${e.name}`);const[E,P]=h;return{[E]:P?.read(f)??!0,$kind:E}},write:(f,d)=>{const[h,E]=Object.entries(f).filter(([P])=>Object.hasOwnProperty.call(t,P))[0];for(let P=0;P<s.length;P++){const[R,q]=s[P];if(R===h){d.writeULEB(P),q?.write(E,d);return}}},...e,validate:f=>{if(e?.validate?.(f),typeof f!="object"||f==null)throw new TypeError(`Expected object, found ${typeof f}`);const d=Object.keys(f).filter(E=>f[E]!==void 0&&Object.hasOwnProperty.call(t,E));if(d.length!==1)throw new TypeError(`Expected object with one key, but found ${d.length} for type ${e.name}}`);const[h]=d;if(!Object.hasOwnProperty.call(t,h))throw new TypeError(`Invalid enum variant ${h}`)}})}},y3=class extends Ea{constructor({fields:t,name:e,...s}){super({name:e??`(${t.map(f=>f.name).join(", ")})`,serializedSize:f=>{let d=0;for(let h=0;h<t.length;h++){const E=t[h].serializedSize(f[h]);if(E==null)return null;d+=E}return d},read:f=>{const d=[];for(const h of t)d.push(h.read(f));return d},write:(f,d)=>{for(let h=0;h<t.length;h++)t[h].write(f[h],d)},...s,validate:f=>{if(s?.validate?.(f),!Array.isArray(f))throw new TypeError(`Expected array, found ${typeof f}`);if(f.length!==t.length)throw new TypeError(`Expected array of length ${t.length}, found ${f.length}`)}})}};function Km(t,e,s){return new Ea({read:f=>{const d=new Array(t);for(let h=0;h<t;h++)d[h]=e.read(f);return d},write:(f,d)=>{for(const h of f)e.write(h,d)},...s,name:s?.name??`${e.name}[${t}]`,validate:f=>{if(s?.validate?.(f),!f||typeof f!="object"||!("length"in f))throw new TypeError(`Expected array, found ${typeof f}`);if(f.length!==t)throw new TypeError(`Expected array of length ${t}, found ${f.length}`)}})}function $m(t){return Pt.enum(`Option<${t.name}>`,{None:null,Some:t}).transform({input:e=>e==null?{None:!0}:{Some:e},output:e=>e.$kind==="Some"?e.Some:null})}function m3(t,e){return new Ea({read:s=>{const f=s.readULEB(),d=new Array(f);for(let h=0;h<f;h++)d[h]=t.read(s);return d},write:(s,f)=>{f.writeULEB(s.length);for(const d of s)t.write(d,f)},...e,name:e?.name??`vector<${t.name}>`,validate:s=>{if(e?.validate?.(s),!s||typeof s!="object"||!("length"in s))throw new TypeError(`Expected array, found ${typeof s}`)}})}function b3(t,e){for(let s=0;s<Math.min(t.length,e.length);s++)if(t[s]!==e[s])return t[s]-e[s];return t.length-e.length}function v3(t,e){return new Ea({name:`Map<${t.name}, ${e.name}>`,read:s=>{const f=s.readULEB(),d=new Map;for(let h=0;h<f;h++)d.set(t.read(s),e.read(s));return d},write:(s,f)=>{const d=[...s.entries()].map(([h,E])=>[t.serialize(h).toBytes(),E]);d.sort(([h],[E])=>b3(h,E)),f.writeULEB(d.length);for(const[h,E]of d)f.writeBytes(h),e.write(E,f)}})}const Pt={u8(t){return xp({readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...t,name:t?.name??"u8"})},u16(t){return xp({readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...t,name:t?.name??"u16"})},u32(t){return xp({readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...t,name:t?.name??"u32"})},u64(t){return Ip({readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...t,name:t?.name??"u64"})},u128(t){return Ip({readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...t,name:t?.name??"u128"})},u256(t){return Ip({readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...t,name:t?.name??"u256"})},bool(t){return lh({size:1,read:e=>e.read8()===1,write:(e,s)=>s.write8(e?1:0),...t,name:t?.name??"bool",validate:e=>{if(t?.validate?.(e),typeof e!="boolean")throw new TypeError(`Expected boolean, found ${typeof e}`)}})},uleb128(t){return wl({read:e=>e.readULEB(),serialize:e=>Uint8Array.from(ch(e)),...t,name:t?.name??"uleb128"})},bytes(t,e){return lh({size:t,read:s=>s.readBytes(t),write:(s,f)=>{f.writeBytes(new Uint8Array(s))},...e,name:e?.name??`bytes[${t}]`,validate:s=>{if(e?.validate?.(s),!s||typeof s!="object"||!("length"in s))throw new TypeError(`Expected array, found ${typeof s}`);if(s.length!==t)throw new TypeError(`Expected array of length ${t}, found ${s.length}`)}})},byteVector(t){return new Ea({read:e=>{const s=e.readULEB();return e.readBytes(s)},write:(e,s)=>{const f=new Uint8Array(e);s.writeULEB(f.length),s.writeBytes(f)},...t,name:t?.name??"vector<u8>",serializedSize:e=>{const s="length"in e?e.length:null;return s==null?null:ch(s).length+s},validate:e=>{if(t?.validate?.(e),!e||typeof e!="object"||!("length"in e))throw new TypeError(`Expected array, found ${typeof e}`)}})},string(t){return d3({toBytes:e=>new TextEncoder().encode(e),fromBytes:e=>new TextDecoder().decode(e),...t,name:t?.name??"string"})},fixedArray:Km,option:$m,vector:m3,tuple(t,e){return new y3({fields:t,...e})},struct(t,e,s){return new p3({name:t,fields:e,...s})},enum(t,e,s){return new g3({name:t,fields:e,...s})},map:v3,lazy(t){return h3(t)}};function w3(t){return Pt.u64({name:"unsafe_u64",...t}).transform({input:e=>e,output:e=>Number(e)})}function _3(t){return Pt.enum("Option",{None:null,Some:t})}const Ii=Pt.bytes(ec).transform({validate:t=>{const e=typeof t=="string"?t:Cc(t);if(!e||!Do(ni(e)))throw new Error(`Invalid Sui address ${e}`)},input:t=>typeof t=="string"?Tc(ni(t)):t,output:t=>ni(Cc(t))}),To=Pt.byteVector().transform({name:"ObjectDigest",input:t=>ba(t),output:t=>cl(new Uint8Array(t)),validate:t=>{if(ba(t).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),na=Pt.struct("SuiObjectRef",{objectId:Ii,version:Pt.u64(),digest:To}),Vm=Pt.struct("SharedObjectRef",{objectId:Ii,initialSharedVersion:Pt.u64(),mutable:Pt.bool()}),Wm=Pt.enum("ObjectArg",{ImmOrOwnedObject:na,SharedObject:Vm,Receiving:na}),$c=Pt.enum("Owner",{AddressOwner:Ii,ObjectOwner:Ii,Shared:Pt.struct("Shared",{initialSharedVersion:Pt.u64()}),Immutable:null,ConsensusAddressOwner:Pt.struct("ConsensusAddressOwner",{startVersion:Pt.u64(),owner:Ii})}),E3=Pt.enum("Reservation",{MaxAmountU64:Pt.u64()}),S3=Pt.enum("WithdrawalType",{Balance:Pt.lazy(()=>_l)}),A3=Pt.enum("WithdrawFrom",{Sender:null,Sponsor:null}),x3=Pt.struct("FundsWithdrawal",{reservation:E3,typeArg:S3,withdrawFrom:A3}),Gm=Pt.enum("CallArg",{Pure:Pt.struct("Pure",{bytes:Pt.byteVector().transform({input:t=>typeof t=="string"?ls(t):t,output:t=>Wi(new Uint8Array(t))})}),Object:Wm,FundsWithdrawal:x3}),Bp=Pt.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:Pt.lazy(()=>Bp),struct:Pt.lazy(()=>dh),u16:null,u32:null,u256:null}),_l=Bp.transform({input:t=>typeof t=="string"?ta.parseFromStr(t,!0):t,output:t=>ta.tagToString(t)}),La=Pt.enum("Argument",{GasCoin:null,Input:Pt.u16(),Result:Pt.u16(),NestedResult:Pt.tuple([Pt.u16(),Pt.u16()])}),qm=Pt.struct("ProgrammableMoveCall",{package:Ii,module:Pt.string(),function:Pt.string(),typeArguments:Pt.vector(_l),arguments:Pt.vector(La)}),Zm=Pt.enum("Command",{MoveCall:qm,TransferObjects:Pt.struct("TransferObjects",{objects:Pt.vector(La),address:La}),SplitCoins:Pt.struct("SplitCoins",{coin:La,amounts:Pt.vector(La)}),MergeCoins:Pt.struct("MergeCoins",{destination:La,sources:Pt.vector(La)}),Publish:Pt.struct("Publish",{modules:Pt.vector(Pt.byteVector().transform({input:t=>typeof t=="string"?ls(t):t,output:t=>Wi(new Uint8Array(t))})),dependencies:Pt.vector(Ii)}),MakeMoveVec:Pt.struct("MakeMoveVec",{type:_3(_l).transform({input:t=>t===null?{None:!0}:{Some:t},output:t=>t.Some??null}),elements:Pt.vector(La)}),Upgrade:Pt.struct("Upgrade",{modules:Pt.vector(Pt.byteVector().transform({input:t=>typeof t=="string"?ls(t):t,output:t=>Wi(new Uint8Array(t))})),dependencies:Pt.vector(Ii),package:Ii,ticket:La})}),Xm=Pt.struct("ProgrammableTransaction",{inputs:Pt.vector(Gm),commands:Pt.vector(Zm)}),Ym=Pt.enum("TransactionKind",{ProgrammableTransaction:Xm,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),I3=Pt.struct("ValidDuring",{minEpoch:Pt.option(Pt.u64()),maxEpoch:Pt.option(Pt.u64()),minTimestamp:Pt.option(Pt.u64()),maxTimestamp:Pt.option(Pt.u64()),chain:To,nonce:Pt.u32()}),fh=Pt.enum("TransactionExpiration",{None:null,Epoch:w3(),ValidDuring:I3}),dh=Pt.struct("StructTag",{address:Ii,module:Pt.string(),name:Pt.string(),typeParams:Pt.vector(Bp)}),kp=Pt.struct("GasData",{payment:Pt.vector(na),owner:Ii,price:Pt.u64(),budget:Pt.u64()}),Jm=Pt.struct("TransactionDataV1",{kind:Ym,sender:Ii,gasData:kp,expiration:fh}),Qm=Pt.enum("TransactionData",{V1:Jm}),eb=Pt.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),hh=Pt.enum("IntentVersion",{V0:null}),tb=Pt.enum("AppId",{Sui:null}),nb=Pt.struct("Intent",{scope:eb,version:hh,appId:tb});function rb(t){return Pt.struct(`IntentMessage<${t.name}>`,{intent:nb,value:t})}const po=Pt.enum("CompressedSignature",{ED25519:Pt.bytes(64),Secp256k1:Pt.bytes(64),Secp256r1:Pt.bytes(64),ZkLogin:Pt.byteVector(),Passkey:Pt.byteVector()}),ph=Pt.enum("PublicKey",{ED25519:Pt.bytes(32),Secp256k1:Pt.bytes(33),Secp256r1:Pt.bytes(33),ZkLogin:Pt.byteVector(),Passkey:Pt.bytes(33)}),ib=Pt.struct("MultiSigPkMap",{pubKey:ph,weight:Pt.u8()}),sb=Pt.struct("MultiSigPublicKey",{pk_map:Pt.vector(ib),threshold:Pt.u16()}),B3=Pt.struct("MultiSig",{sigs:Pt.vector(po),bitmap:Pt.u16(),multisig_pk:sb}),k3=Pt.byteVector().transform({input:t=>typeof t=="string"?ls(t):t,output:t=>Wi(new Uint8Array(t))}),gh=Pt.struct("SenderSignedTransaction",{intentMessage:rb(Qm),txSignatures:Pt.vector(k3)}),T3=Pt.vector(gh,{name:"SenderSignedData"}),Tp=Pt.struct("PasskeyAuthenticator",{authenticatorData:Pt.byteVector(),clientDataJson:Pt.string(),userSignature:Pt.byteVector()}),ob=Pt.enum("MoveObjectType",{Other:dh,GasCoin:null,StakedSui:null,Coin:_l,AccumulatorBalanceWrapper:null}),ab=Pt.struct("TypeOrigin",{moduleName:Pt.string(),datatypeName:Pt.string(),package:Ii}),cb=Pt.struct("UpgradeInfo",{upgradedId:Ii,upgradedVersion:Pt.u64()}),ub=Pt.struct("MovePackage",{id:Ii,version:Pt.u64(),moduleMap:Pt.map(Pt.string(),Pt.byteVector()),typeOriginTable:Pt.vector(ab),linkageTable:Pt.map(Ii,cb)}),Cp=Pt.struct("MoveObject",{type:ob,hasPublicTransfer:Pt.bool(),version:Pt.u64(),contents:Pt.byteVector()}),lb=Pt.enum("Data",{Move:Cp,Package:ub}),C3=Pt.struct("ObjectInner",{data:lb,owner:$c,previousTransaction:To,storageRebate:Pt.u64()}),P3=Pt.enum("PackageUpgradeError",{UnableToFetchPackage:Pt.struct("UnableToFetchPackage",{packageId:Ii}),NotAPackage:Pt.struct("NotAPackage",{objectId:Ii}),IncompatibleUpgrade:null,DigestDoesNotMatch:Pt.struct("DigestDoesNotMatch",{digest:Pt.byteVector()}),UnknownUpgradePolicy:Pt.struct("UnknownUpgradePolicy",{policy:Pt.u8()}),PackageIDDoesNotMatch:Pt.struct("PackageIDDoesNotMatch",{packageId:Ii,ticketId:Ii})}),Pp=Pt.struct("ModuleId",{address:Ii,name:Pt.string()}),yh=Pt.struct("MoveLocation",{module:Pp,function:Pt.u16(),instruction:Pt.u16(),functionName:Pt.option(Pt.string())}),M3=Pt.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:Pt.struct("IndexOutOfBounds",{idx:Pt.u16()}),SecondaryIndexOutOfBounds:Pt.struct("SecondaryIndexOutOfBounds",{resultIdx:Pt.u16(),secondaryIdx:Pt.u16()}),InvalidResultArity:Pt.struct("InvalidResultArity",{resultIdx:Pt.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null,InvalidArgumentArity:null,InvalidTransferObject:null,InvalidMakeMoveVecNonObjectArgument:null,ArgumentWithoutValue:null,CannotMoveBorrowedValue:null,CannotWriteToExtendedReference:null,InvalidReferenceArgument:null}),O3=Pt.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),R3=Pt.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:Pt.struct("MoveObjectTooBig",{objectSize:Pt.u64(),maxObjectSize:Pt.u64()}),MovePackageTooBig:Pt.struct("MovePackageTooBig",{objectSize:Pt.u64(),maxObjectSize:Pt.u64()}),CircularObjectOwnership:Pt.struct("CircularObjectOwnership",{object:Ii}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:Pt.option(yh),MoveAbort:Pt.tuple([yh,Pt.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:Pt.struct("CommandArgumentError",{argIdx:Pt.u16(),kind:M3}),TypeArgumentError:Pt.struct("TypeArgumentError",{argumentIdx:Pt.u16(),kind:O3}),UnusedValueWithoutDrop:Pt.struct("UnusedValueWithoutDrop",{resultIdx:Pt.u16(),secondaryIdx:Pt.u16()}),InvalidPublicFunctionReturnType:Pt.struct("InvalidPublicFunctionReturnType",{idx:Pt.u16()}),InvalidTransferObject:null,EffectsTooLarge:Pt.struct("EffectsTooLarge",{currentSize:Pt.u64(),maxSize:Pt.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:Pt.struct("PackageUpgradeError",{upgradeError:P3}),WrittenObjectsTooLarge:Pt.struct("WrittenObjectsTooLarge",{currentSize:Pt.u64(),maxSize:Pt.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:Pt.struct("ExecutionCancelledDueToSharedObjectCongestion",{congested_objects:Pt.vector(Ii)}),AddressDeniedForCoin:Pt.struct("AddressDeniedForCoin",{address:Ii,coinType:Pt.string()}),CoinTypeGlobalPause:Pt.struct("CoinTypeGlobalPause",{coinType:Pt.string()}),ExecutionCancelledDueToRandomnessUnavailable:null,MoveVectorElemTooBig:Pt.struct("MoveVectorElemTooBig",{valueSize:Pt.u64(),maxScaledSize:Pt.u64()}),MoveRawValueTooBig:Pt.struct("MoveRawValueTooBig",{valueSize:Pt.u64(),maxScaledSize:Pt.u64()}),InvalidLinkage:null,InsufficientBalanceForWithdraw:null,NonExclusiveWriteInputObjectModified:Pt.struct("NonExclusiveWriteInputObjectModified",{id:Ii})}),Mp=Pt.enum("ExecutionStatus",{Success:null,Failure:Pt.struct("Failure",{error:R3,command:Pt.option(Pt.u64())})}),fb=Pt.struct("GasCostSummary",{computationCost:Pt.u64(),storageCost:Pt.u64(),storageRebate:Pt.u64(),nonRefundableStorageFee:Pt.u64()}),N3=Pt.struct("TransactionEffectsV1",{status:Mp,executedEpoch:Pt.u64(),gasUsed:fb,modifiedAtVersions:Pt.vector(Pt.tuple([Ii,Pt.u64()])),sharedObjects:Pt.vector(na),transactionDigest:To,created:Pt.vector(Pt.tuple([na,$c])),mutated:Pt.vector(Pt.tuple([na,$c])),unwrapped:Pt.vector(Pt.tuple([na,$c])),deleted:Pt.vector(na),unwrappedThenDeleted:Pt.vector(na),wrapped:Pt.vector(na),gasObject:Pt.tuple([na,$c]),eventsDigest:Pt.option(To),dependencies:Pt.vector(To)}),Op=Pt.tuple([Pt.u64(),To]),U3=Pt.enum("ObjectIn",{NotExist:null,Exist:Pt.tuple([Op,$c])}),D3=Pt.struct("AccumulatorAddress",{address:Ii,ty:_l}),L3=Pt.enum("AccumulatorOperation",{Merge:null,Split:null}),F3=Pt.enum("AccumulatorValue",{Integer:Pt.u64(),IntegerTuple:Pt.tuple([Pt.u64(),Pt.u64()]),EventDigest:Pt.vector(Pt.tuple([Pt.u64(),To]))}),j3=Pt.struct("AccumulatorWriteV1",{address:D3,operation:L3,value:F3}),z3=Pt.enum("ObjectOut",{NotExist:null,ObjectWrite:Pt.tuple([To,$c]),PackageWrite:Op,AccumulatorWriteV1:j3}),H3=Pt.enum("IDOperation",{None:null,Created:null,Deleted:null}),K3=Pt.struct("EffectsObjectChange",{inputState:U3,outputState:z3,idOperation:H3}),$3=Pt.enum("UnchangedConsensusKind",{ReadOnlyRoot:Op,MutateConsensusStreamEnded:Pt.u64(),ReadConsensusStreamEnded:Pt.u64(),Cancelled:Pt.u64(),PerEpochConfig:null}),V3=Pt.struct("TransactionEffectsV2",{status:Mp,executedEpoch:Pt.u64(),gasUsed:fb,transactionDigest:To,gasObjectIndex:Pt.option(Pt.u32()),eventsDigest:Pt.option(To),dependencies:Pt.vector(To),lamportVersion:Pt.u64(),changedObjects:Pt.vector(Pt.tuple([Ii,K3])),unchangedConsensusObjects:Pt.vector(Pt.tuple([Ii,$3])),auxDataDigest:Pt.option(To)}),W3=Pt.enum("TransactionEffects",{V1:N3,V2:V3}),jr={...Pt,U8:Pt.u8(),U16:Pt.u16(),U32:Pt.u32(),U64:Pt.u64(),U128:Pt.u128(),U256:Pt.u256(),ULEB128:Pt.uleb128(),Bool:Pt.bool(),String:Pt.string(),Address:Ii,AppId:tb,Argument:La,CallArg:Gm,Command:Zm,CompressedSignature:po,Data:lb,GasData:kp,Intent:nb,IntentMessage:rb,IntentScope:eb,IntentVersion:hh,MoveObject:Cp,MoveObjectType:ob,MovePackage:ub,MultiSig:B3,MultiSigPkMap:ib,MultiSigPublicKey:sb,Object:C3,ObjectArg:Wm,ObjectDigest:To,Owner:$c,PasskeyAuthenticator:Tp,ProgrammableMoveCall:qm,ProgrammableTransaction:Xm,PublicKey:ph,SenderSignedData:T3,SenderSignedTransaction:gh,SharedObjectRef:Vm,StructTag:dh,SuiObjectRef:na,TransactionData:Qm,TransactionDataV1:Jm,TransactionEffects:W3,TransactionExpiration:fh,TransactionKind:Ym,TypeOrigin:ab,TypeTag:_l,UpgradeInfo:cb};/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function db(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Sa(t,e=""){if(!Number.isSafeInteger(t)||t<0){const s=e&&`"${e}" `;throw new Error(`${s}expected integer >= 0, got ${t}`)}}function M(t,e,s=""){const f=db(t),d=t?.length,h=e!==void 0;if(!f||h&&d!==e){const E=s&&`"${s}" `,P=h?` of length ${e}`:"",R=f?`length=${d}`:`type=${typeof t}`;throw new Error(E+"expected Uint8Array"+P+", got "+R)}return t}function K(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash must wrapped by utils.createHasher");Sa(t.outputLen),Sa(t.blockLen)}function ae(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Be(t,e){M(t,void 0,"digestInto() output");const s=e.outputLen;if(t.length<s)throw new Error('"digestInto() output" expected to be of length >='+s)}function Je(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function yt(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function jt(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Xt(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function tn(t,e){return t<<32-e|t>>>e}function On(t,e){return t<<e|t>>>32-e>>>0}const Pn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function jn(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}const er=Pn?t=>t:t=>jn(t);function kr(t){for(let e=0;e<t.length;e++)t[e]=jn(t[e]);return t}const Mr=Pn?t=>t:kr,Jr=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Lr=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Qr(t){if(M(t),Jr)return t.toHex();let e="";for(let s=0;s<t.length;s++)e+=Lr[t[s]];return e}const qr={_0:48,_9:57,A:65,F:70,a:97,f:102};function Co(t){if(t>=qr._0&&t<=qr._9)return t-qr._0;if(t>=qr.A&&t<=qr.F)return t-(qr.A-10);if(t>=qr.a&&t<=qr.f)return t-(qr.a-10)}function Ys(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(Jr)return Uint8Array.fromHex(t);const e=t.length,s=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const f=new Uint8Array(s);for(let d=0,h=0;d<s;d++,h+=2){const E=Co(t.charCodeAt(h)),P=Co(t.charCodeAt(h+1));if(E===void 0||P===void 0){const R=t[h]+t[h+1];throw new Error('hex string expected, got non-hex character "'+R+'" at index '+h)}f[d]=E*16+P}return f}const Ko=async()=>{};async function Ts(t,e,s){let f=Date.now();for(let d=0;d<t;d++){s(d);const h=Date.now()-f;h>=0&&h<e||(await Ko(),f+=h)}}function Aa(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Fa(t,e=""){return typeof t=="string"?Aa(t):M(t,void 0,e)}function Rp(...t){let e=0;for(let f=0;f<t.length;f++){const d=t[f];M(d),e+=d.length}const s=new Uint8Array(e);for(let f=0,d=0;f<t.length;f++){const h=t[f];s.set(h,d),d+=h.length}return s}function k9(t,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("options must be object or undefined");return Object.assign(t,e)}function f8(t,e={}){const s=(d,h)=>t(h).update(d).digest(),f=t(void 0);return s.outputLen=f.outputLen,s.blockLen=f.blockLen,s.create=d=>t(d),Object.assign(s,e),Object.freeze(s)}function T9(t=32){const e=typeof globalThis=="object"?globalThis.crypto:null;if(typeof e?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");return e.getRandomValues(new Uint8Array(t))}const C9=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])}),d8=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);function El(t,e,s,f,d){return t=t+e+d|0,f=tn(f^t,16),s=s+f|0,e=tn(e^s,12),{a:t,b:e,c:s,d:f}}function Sl(t,e,s,f,d){return t=t+e+d|0,f=tn(f^t,8),s=s+f|0,e=tn(e^s,7),{a:t,b:e,c:s,d:f}}function P9(t,e,s){return t&e^~t&s}function M9(t,e,s){return t&e^t&s^e&s}class h8{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,s,f,d){this.blockLen=e,this.outputLen=s,this.padOffset=f,this.isLE=d,this.buffer=new Uint8Array(e),this.view=Xt(this.buffer)}update(e){ae(this),M(e);const{view:s,buffer:f,blockLen:d}=this,h=e.length;for(let E=0;E<h;){const P=Math.min(d-this.pos,h-E);if(P===d){const R=Xt(e);for(;d<=h-E;E+=d)this.process(R,E);continue}f.set(e.subarray(E,E+P),this.pos),this.pos+=P,E+=P,this.pos===d&&(this.process(s,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ae(this),Be(e,this),this.finished=!0;const{buffer:s,view:f,blockLen:d,isLE:h}=this;let{pos:E}=this;s[E++]=128,jt(this.buffer.subarray(E)),this.padOffset>d-E&&(this.process(f,0),E=0);for(let ne=E;ne<d;ne++)s[ne]=0;f.setBigUint64(d-8,BigInt(this.length*8),h),this.process(f,0);const P=Xt(e),R=this.outputLen;if(R%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const q=R/4,te=this.get();if(q>te.length)throw new Error("_sha2: outputLen bigger than state");for(let ne=0;ne<q;ne++)P.setUint32(4*ne,te[ne],h)}digest(){const{buffer:e,outputLen:s}=this;this.digestInto(e);const f=e.slice(0,s);return this.destroy(),f}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:s,buffer:f,length:d,finished:h,destroyed:E,pos:P}=this;return e.destroyed=E,e.finished=h,e.length=d,e.pos=P,d%s&&e.buffer.set(f),e}clone(){return this._cloneInto()}}const Bu=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Al=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Po=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Mo=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),hb=BigInt(2**32-1),G3=BigInt(32);function q3(t,e=!1){return e?{h:Number(t&hb),l:Number(t>>G3&hb)}:{h:Number(t>>G3&hb)|0,l:Number(t&hb)|0}}function O9(t,e=!1){const s=t.length;let f=new Uint32Array(s),d=new Uint32Array(s);for(let h=0;h<s;h++){const{h:E,l:P}=q3(t[h],e);[f[h],d[h]]=[E,P]}return[f,d]}const FV=(t,e)=>BigInt(t>>>0)<<G3|BigInt(e>>>0),p8=(t,e,s)=>t>>>s,g8=(t,e,s)=>t<<32-s|e>>>s,xl=(t,e,s)=>t>>>s|e<<32-s,Il=(t,e,s)=>t<<32-s|e>>>s,Np=(t,e,s)=>t<<64-s|e>>>s-32,Up=(t,e,s)=>t>>>s-32|e<<64-s,R9=(t,e)=>e,N9=(t,e)=>t,jV=(t,e,s)=>t<<s|e>>>32-s,zV=(t,e,s)=>e<<s|t>>>32-s,HV=(t,e,s)=>e<<s-32|t>>>64-s,KV=(t,e,s)=>t<<s-32|e>>>64-s;function fc(t,e,s,f){const d=(e>>>0)+(f>>>0);return{h:t+s+(d/2**32|0)|0,l:d|0}}const Z3=(t,e,s)=>(t>>>0)+(e>>>0)+(s>>>0),X3=(t,e,s,f)=>e+s+f+(t/2**32|0)|0,U9=(t,e,s,f)=>(t>>>0)+(e>>>0)+(s>>>0)+(f>>>0),D9=(t,e,s,f,d)=>e+s+f+d+(t/2**32|0)|0,L9=(t,e,s,f,d)=>(t>>>0)+(e>>>0)+(s>>>0)+(f>>>0)+(d>>>0),F9=(t,e,s,f,d,h)=>e+s+f+d+h+(t/2**32|0)|0,$V=null,VV=null,Js=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),wr=new Uint32Array(32);function Bl(t,e,s,f,d,h){const E=d[h],P=d[h+1];let R=wr[2*t],q=wr[2*t+1],te=wr[2*e],ne=wr[2*e+1],ue=wr[2*s],ge=wr[2*s+1],xe=wr[2*f],pe=wr[2*f+1],Se=Z3(R,te,E);q=X3(Se,q,ne,P),R=Se|0,{Dh:pe,Dl:xe}={Dh:pe^q,Dl:xe^R},{Dh:pe,Dl:xe}={Dh:R9(pe,xe),Dl:N9(pe,xe)},{h:ge,l:ue}=fc(ge,ue,pe,xe),{Bh:ne,Bl:te}={Bh:ne^ge,Bl:te^ue},{Bh:ne,Bl:te}={Bh:xl(ne,te,24),Bl:Il(ne,te,24)},wr[2*t]=R,wr[2*t+1]=q,wr[2*e]=te,wr[2*e+1]=ne,wr[2*s]=ue,wr[2*s+1]=ge,wr[2*f]=xe,wr[2*f+1]=pe}function kl(t,e,s,f,d,h){const E=d[h],P=d[h+1];let R=wr[2*t],q=wr[2*t+1],te=wr[2*e],ne=wr[2*e+1],ue=wr[2*s],ge=wr[2*s+1],xe=wr[2*f],pe=wr[2*f+1],Se=Z3(R,te,E);q=X3(Se,q,ne,P),R=Se|0,{Dh:pe,Dl:xe}={Dh:pe^q,Dl:xe^R},{Dh:pe,Dl:xe}={Dh:xl(pe,xe,16),Dl:Il(pe,xe,16)},{h:ge,l:ue}=fc(ge,ue,pe,xe),{Bh:ne,Bl:te}={Bh:ne^ge,Bl:te^ue},{Bh:ne,Bl:te}={Bh:Np(ne,te,63),Bl:Up(ne,te,63)},wr[2*t]=R,wr[2*t+1]=q,wr[2*e]=te,wr[2*e+1]=ne,wr[2*s]=ue,wr[2*s+1]=ge,wr[2*f]=xe,wr[2*f+1]=pe}function y8(t,e={},s,f,d){if(Sa(s),t<0||t>s)throw new Error("outputLen bigger than keyLen");const{key:h,salt:E,personalization:P}=e;if(h!==void 0&&(h.length<1||h.length>s))throw new Error('"key" expected to be undefined or of length=1..'+s);E!==void 0&&M(E,f,"salt"),P!==void 0&&M(P,d,"personalization")}class m8{buffer;buffer32;finished=!1;destroyed=!1;length=0;pos=0;blockLen;outputLen;constructor(e,s){Sa(e),Sa(s),this.blockLen=e,this.outputLen=s,this.buffer=new Uint8Array(e),this.buffer32=yt(this.buffer)}update(e){ae(this),M(e);const{blockLen:s,buffer:f,buffer32:d}=this,h=e.length,E=e.byteOffset,P=e.buffer;for(let R=0;R<h;){this.pos===s&&(Mr(d),this.compress(d,0,!1),Mr(d),this.pos=0);const q=Math.min(s-this.pos,h-R),te=E+R;if(q===s&&!(te%4)&&R+q<h){const ne=new Uint32Array(P,te,Math.floor((h-R)/4));Mr(ne);for(let ue=0;R+s<h;ue+=d.length,R+=s)this.length+=s,this.compress(ne,ue,!1);Mr(ne);continue}f.set(e.subarray(R,R+q),this.pos),this.pos+=q,this.length+=q,R+=q}return this}digestInto(e){ae(this),Be(e,this);const{pos:s,buffer32:f}=this;this.finished=!0,jt(this.buffer.subarray(s)),Mr(f),this.compress(f,0,!0),Mr(f);const d=yt(e);this.get().forEach((h,E)=>d[E]=er(h))}digest(){const{buffer:e,outputLen:s}=this;this.digestInto(e);const f=e.slice(0,s);return this.destroy(),f}_cloneInto(e){const{buffer:s,length:f,finished:d,destroyed:h,outputLen:E,pos:P}=this;return e||=new this.constructor({dkLen:E}),e.set(...this.get()),e.buffer.set(s),e.destroyed=h,e.finished=d,e.length=f,e.pos=P,e.outputLen=E,e}clone(){return this._cloneInto()}}class j9 extends m8{v0l=Js[0]|0;v0h=Js[1]|0;v1l=Js[2]|0;v1h=Js[3]|0;v2l=Js[4]|0;v2h=Js[5]|0;v3l=Js[6]|0;v3h=Js[7]|0;v4l=Js[8]|0;v4h=Js[9]|0;v5l=Js[10]|0;v5h=Js[11]|0;v6l=Js[12]|0;v6h=Js[13]|0;v7l=Js[14]|0;v7h=Js[15]|0;constructor(e={}){const s=e.dkLen===void 0?64:e.dkLen;super(128,s),y8(s,e,64,16,16);let{key:f,personalization:d,salt:h}=e,E=0;if(f!==void 0&&(M(f,void 0,"key"),E=f.length),this.v0l^=this.outputLen|E<<8|65536|1<<24,h!==void 0){M(h,void 0,"salt");const P=yt(h);this.v4l^=er(P[0]),this.v4h^=er(P[1]),this.v5l^=er(P[2]),this.v5h^=er(P[3])}if(d!==void 0){M(d,void 0,"personalization");const P=yt(d);this.v6l^=er(P[0]),this.v6h^=er(P[1]),this.v7l^=er(P[2]),this.v7h^=er(P[3])}if(f!==void 0){const P=new Uint8Array(this.blockLen);P.set(f),this.update(P)}}get(){let{v0l:e,v0h:s,v1l:f,v1h:d,v2l:h,v2h:E,v3l:P,v3h:R,v4l:q,v4h:te,v5l:ne,v5h:ue,v6l:ge,v6h:xe,v7l:pe,v7h:Se}=this;return[e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se]}set(e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se){this.v0l=e|0,this.v0h=s|0,this.v1l=f|0,this.v1h=d|0,this.v2l=h|0,this.v2h=E|0,this.v3l=P|0,this.v3h=R|0,this.v4l=q|0,this.v4h=te|0,this.v5l=ne|0,this.v5h=ue|0,this.v6l=ge|0,this.v6h=xe|0,this.v7l=pe|0,this.v7h=Se|0}compress(e,s,f){this.get().forEach((R,q)=>wr[q]=R),wr.set(Js,16);let{h:d,l:h}=q3(BigInt(this.length));wr[24]=Js[8]^h,wr[25]=Js[9]^d,f&&(wr[28]=~wr[28],wr[29]=~wr[29]);let E=0;const P=d8;for(let R=0;R<12;R++)Bl(0,4,8,12,e,s+2*P[E++]),kl(0,4,8,12,e,s+2*P[E++]),Bl(1,5,9,13,e,s+2*P[E++]),kl(1,5,9,13,e,s+2*P[E++]),Bl(2,6,10,14,e,s+2*P[E++]),kl(2,6,10,14,e,s+2*P[E++]),Bl(3,7,11,15,e,s+2*P[E++]),kl(3,7,11,15,e,s+2*P[E++]),Bl(0,5,10,15,e,s+2*P[E++]),kl(0,5,10,15,e,s+2*P[E++]),Bl(1,6,11,12,e,s+2*P[E++]),kl(1,6,11,12,e,s+2*P[E++]),Bl(2,7,8,13,e,s+2*P[E++]),kl(2,7,8,13,e,s+2*P[E++]),Bl(3,4,9,14,e,s+2*P[E++]),kl(3,4,9,14,e,s+2*P[E++]);this.v0l^=wr[0]^wr[16],this.v0h^=wr[1]^wr[17],this.v1l^=wr[2]^wr[18],this.v1h^=wr[3]^wr[19],this.v2l^=wr[4]^wr[20],this.v2h^=wr[5]^wr[21],this.v3l^=wr[6]^wr[22],this.v3h^=wr[7]^wr[23],this.v4l^=wr[8]^wr[24],this.v4h^=wr[9]^wr[25],this.v5l^=wr[10]^wr[26],this.v5h^=wr[11]^wr[27],this.v6l^=wr[12]^wr[28],this.v6h^=wr[13]^wr[29],this.v7l^=wr[14]^wr[30],this.v7h^=wr[15]^wr[31],jt(wr)}destroy(){this.destroyed=!0,jt(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Dp=f8(t=>new j9(t));function z9(t,e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se,Ce,Fe,We){let xt=0;for(let kt=0;kt<f;kt++)({a:d,b:R,c:ue,d:Se}=El(d,R,ue,Se,s[e+t[xt++]])),{a:d,b:R,c:ue,d:Se}=Sl(d,R,ue,Se,s[e+t[xt++]]),{a:h,b:q,c:ge,d:Ce}=El(h,q,ge,Ce,s[e+t[xt++]]),{a:h,b:q,c:ge,d:Ce}=Sl(h,q,ge,Ce,s[e+t[xt++]]),{a:E,b:te,c:xe,d:Fe}=El(E,te,xe,Fe,s[e+t[xt++]]),{a:E,b:te,c:xe,d:Fe}=Sl(E,te,xe,Fe,s[e+t[xt++]]),{a:P,b:ne,c:pe,d:We}=El(P,ne,pe,We,s[e+t[xt++]]),{a:P,b:ne,c:pe,d:We}=Sl(P,ne,pe,We,s[e+t[xt++]]),{a:d,b:q,c:xe,d:We}=El(d,q,xe,We,s[e+t[xt++]]),{a:d,b:q,c:xe,d:We}=Sl(d,q,xe,We,s[e+t[xt++]]),{a:h,b:te,c:pe,d:Se}=El(h,te,pe,Se,s[e+t[xt++]]),{a:h,b:te,c:pe,d:Se}=Sl(h,te,pe,Se,s[e+t[xt++]]),{a:E,b:ne,c:ue,d:Ce}=El(E,ne,ue,Ce,s[e+t[xt++]]),{a:E,b:ne,c:ue,d:Ce}=Sl(E,ne,ue,Ce,s[e+t[xt++]]),{a:P,b:R,c:ge,d:Fe}=El(P,R,ge,Fe,s[e+t[xt++]]),{a:P,b:R,c:ge,d:Fe}=Sl(P,R,ge,Fe,s[e+t[xt++]]);return{v0:d,v1:h,v2:E,v3:P,v4:R,v5:q,v6:te,v7:ne,v8:ue,v9:ge,v10:xe,v11:pe,v12:Se,v13:Ce,v14:Fe,v15:We}}const go=Bu.slice();class WV extends m8{v0=go[0]|0;v1=go[1]|0;v2=go[2]|0;v3=go[3]|0;v4=go[4]|0;v5=go[5]|0;v6=go[6]|0;v7=go[7]|0;constructor(e={}){const s=e.dkLen===void 0?32:e.dkLen;super(64,s),y8(s,e,32,8,8);let{key:f,personalization:d,salt:h}=e,E=0;if(f!==void 0&&(M(f,void 0,"key"),E=f.length),this.v0^=this.outputLen|E<<8|65536|1<<24,h!==void 0){M(h,void 0,"salt");const P=yt(h);this.v4^=er(P[0]),this.v5^=er(P[1])}if(d!==void 0){M(d,void 0,"personalization");const P=yt(d);this.v6^=er(P[0]),this.v7^=er(P[1])}if(f!==void 0){const P=new Uint8Array(this.blockLen);P.set(f),this.update(P)}}get(){const{v0:e,v1:s,v2:f,v3:d,v4:h,v5:E,v6:P,v7:R}=this;return[e,s,f,d,h,E,P,R]}set(e,s,f,d,h,E,P,R){this.v0=e|0,this.v1=s|0,this.v2=f|0,this.v3=d|0,this.v4=h|0,this.v5=E|0,this.v6=P|0,this.v7=R|0}compress(e,s,f){const{h:d,l:h}=q3(BigInt(this.length)),{v0:E,v1:P,v2:R,v3:q,v4:te,v5:ne,v6:ue,v7:ge,v8:xe,v9:pe,v10:Se,v11:Ce,v12:Fe,v13:We,v14:xt,v15:kt}=z9(d8,s,e,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,go[0],go[1],go[2],go[3],h^go[4],d^go[5],f?~go[6]:go[6],go[7]);this.v0^=E^xe,this.v1^=P^pe,this.v2^=R^Se,this.v3^=q^Ce,this.v4^=te^Fe,this.v5^=ne^We,this.v6^=ue^xt,this.v7^=ge^kt}destroy(){this.destroyed=!0,jt(this.buffer32),this.set(0,0,0,0,0,0,0,0)}}const GV=null;function H9(t,e){const s=Array.from(`${t}::`).map(d=>d.charCodeAt(0)),f=new Uint8Array(s.length+e.length);return f.set(s),f.set(e,s.length),Dp(f,{dkLen:32})}function b8(t){return ni(t).replace("0x","")}var Vc=class Sd{static fromKindBytes(e){const s=jr.TransactionKind.parse(e).ProgrammableTransaction;if(!s)throw new Error("Unable to deserialize from bytes.");return Sd.restore({version:2,sender:null,expiration:null,gasData:{budget:null,owner:null,payment:null,price:null},inputs:s.inputs,commands:s.commands})}static fromBytes(e){const s=jr.TransactionData.parse(e)?.V1,f=s.kind.ProgrammableTransaction;if(!s||!f)throw new Error("Unable to deserialize from bytes.");return Sd.restore({version:2,sender:s.sender,expiration:s.expiration,gasData:s.gasData,inputs:f.inputs,commands:f.commands})}static restore(e){return e.version===2?new Sd(Wr(bi,e)):new Sd(Wr(bi,o3(e)))}static getDigestFromBytes(e){return cl(H9("TransactionData",e))}constructor(e){this.version=2,this.sender=e?.sender??null,this.expiration=e?.expiration??null,this.inputs=e?.inputs??[],this.commands=e?.commands??[],this.gasData=e?.gasData??{budget:null,price:null,owner:null,payment:null}}build({maxSizeBytes:e=1/0,overrides:s,onlyTransactionKind:f}={}){const d=this.inputs,h=this.commands,E={ProgrammableTransaction:{inputs:d,commands:h}};if(f)return jr.TransactionKind.serialize(E,{maxSize:e}).toBytes();const P=s?.expiration??this.expiration,R=s?.sender??this.sender,q={...this.gasData,...s?.gasData};if(!R)throw new Error("Missing transaction sender");if(!q.budget)throw new Error("Missing gas budget");if(!q.payment)throw new Error("Missing gas payment");if(!q.price)throw new Error("Missing gas price");const te={sender:b8(R),expiration:P||{None:!0},gasData:{payment:q.payment,owner:b8(this.gasData.owner??R),price:BigInt(q.price),budget:BigInt(q.budget)},kind:{ProgrammableTransaction:{inputs:d,commands:h}}};return jr.TransactionData.serialize({V1:te},{maxSize:e}).toBytes()}addInput(e,s){const f=this.inputs.length;return this.inputs.push(s),{Input:f,type:e,$kind:"Input"}}getInputUses(e,s){this.mapArguments((f,d)=>(f.$kind==="Input"&&f.Input===e&&s(f,d),f))}mapCommandArguments(e,s){const f=this.commands[e];switch(f.$kind){case"MoveCall":f.MoveCall.arguments=f.MoveCall.arguments.map(h=>s(h,f,e));break;case"TransferObjects":f.TransferObjects.objects=f.TransferObjects.objects.map(h=>s(h,f,e)),f.TransferObjects.address=s(f.TransferObjects.address,f,e);break;case"SplitCoins":f.SplitCoins.coin=s(f.SplitCoins.coin,f,e),f.SplitCoins.amounts=f.SplitCoins.amounts.map(h=>s(h,f,e));break;case"MergeCoins":f.MergeCoins.destination=s(f.MergeCoins.destination,f,e),f.MergeCoins.sources=f.MergeCoins.sources.map(h=>s(h,f,e));break;case"MakeMoveVec":f.MakeMoveVec.elements=f.MakeMoveVec.elements.map(h=>s(h,f,e));break;case"Upgrade":f.Upgrade.ticket=s(f.Upgrade.ticket,f,e);break;case"$Intent":const d=f.$Intent.inputs;f.$Intent.inputs={};for(const[h,E]of Object.entries(d))f.$Intent.inputs[h]=Array.isArray(E)?E.map(P=>s(P,f,e)):s(E,f,e);break;case"Publish":break;default:throw new Error(`Unexpected transaction kind: ${f.$kind}`)}}mapArguments(e){for(const s of this.commands.keys())this.mapCommandArguments(s,e)}replaceCommand(e,s,f=e){if(!Array.isArray(s)){this.commands[e]=s;return}const d=s.length-1;this.commands.splice(e,1,...structuredClone(s)),this.mapArguments((h,E,P)=>{if(P<e+s.length)return h;if(typeof f!="number"&&(h.$kind==="Result"&&h.Result===e||h.$kind==="NestedResult"&&h.NestedResult[0]===e)){if(!("NestedResult"in h)||h.NestedResult[1]===0)return Wr(Gi,structuredClone(f));throw new Error(`Cannot replace command ${e} with a specific result type: NestedResult[${e}, ${h.NestedResult[1]}] references a nested element that cannot be mapped to the replacement result`)}switch(h.$kind){case"Result":h.Result===e&&typeof f=="number"&&(h.Result=f),h.Result>e&&(h.Result+=d);break;case"NestedResult":if(h.NestedResult[0]===e&&typeof f=="number")return{$kind:"NestedResult",NestedResult:[f,h.NestedResult[1]]};h.NestedResult[0]>e&&(h.NestedResult[0]+=d);break}return h})}replaceCommandWithTransaction(e,s,f){if(f.$kind!=="Result"&&f.$kind!=="NestedResult")throw new Error("Result must be of kind Result or NestedResult");this.insertTransaction(e,s),this.replaceCommand(e+s.commands.length,[],"Result"in f?{NestedResult:[f.Result+e,0]}:{NestedResult:[f.NestedResult[0]+e,f.NestedResult[1]]})}insertTransaction(e,s){const f=new Map,d=new Map;for(let P=0;P<s.inputs.length;P++){const R=s.inputs[P],q=ah(R);let te=-1;if(q!==void 0&&(te=this.inputs.findIndex(ne=>ah(ne)===q),te!==-1&&this.inputs[te].Object?.SharedObject&&R.Object?.SharedObject&&(this.inputs[te].Object.SharedObject.mutable=this.inputs[te].Object.SharedObject.mutable||R.Object.SharedObject.mutable)),te!==-1)f.set(P,te);else{const ne=this.inputs.length;this.inputs.push(R),f.set(P,ne)}}for(let P=0;P<s.commands.length;P++)d.set(P,e+P);const h=[];for(let P=0;P<s.commands.length;P++){const R=structuredClone(s.commands[P]);c3(R,f,d),h.push(R)}this.commands.splice(e,0,...h);const E=h.length;E>0&&this.mapArguments((P,R,q)=>{if(q>=e&&q<e+h.length)return P;switch(P.$kind){case"Result":P.Result>=e&&(P.Result+=E);break;case"NestedResult":P.NestedResult[0]>=e&&(P.NestedResult[0]+=E);break}return P})}getDigest(){const e=this.build({onlyTransactionKind:!1});return Sd.getDigestFromBytes(e)}snapshot(){return Wr(bi,this)}shallowClone(){return new Sd({version:this.version,sender:this.sender,expiration:this.expiration,gasData:{...this.gasData},inputs:[...this.inputs],commands:[...this.commands]})}applyResolvedData(e){this.sender||(this.sender=e.sender??null),this.expiration||(this.expiration=e.expiration??null),this.gasData.budget||(this.gasData.budget=e.gasData.budget),this.gasData.owner||(this.gasData.owner=e.gasData.owner??null),this.gasData.payment||(this.gasData.payment=e.gasData.payment),this.gasData.price||(this.gasData.price=e.gasData.price);for(let s=0;s<this.inputs.length;s++){const f=this.inputs[s],d=e.inputs[s];switch(f.$kind){case"UnresolvedPure":if(d.$kind!=="Pure")throw new Error(`Expected input at index ${s} to resolve to a Pure argument, but got ${JSON.stringify(d)}`);this.inputs[s]=d;break;case"UnresolvedObject":if(d.$kind!=="Object")throw new Error(`Expected input at index ${s} to resolve to an Object argument, but got ${JSON.stringify(d)}`);if(d.Object.$kind==="ImmOrOwnedObject"||d.Object.$kind==="Receiving"){const h=f.UnresolvedObject,E=d.Object.ImmOrOwnedObject??d.Object.Receiving;if(ni(h.objectId)!==ni(E.objectId)||h.version!=null&&h.version!==E.version||h.digest!=null&&h.digest!==E.digest||h.mutable!=null||h.initialSharedVersion!=null)throw new Error(`Input at index ${s} did not match unresolved object. ${JSON.stringify(h)} is not compatible with ${JSON.stringify(E)}`)}else if(d.Object.$kind==="SharedObject"){const h=f.UnresolvedObject,E=d.Object.SharedObject;if(ni(h.objectId)!==ni(E.objectId)||h.initialSharedVersion!=null&&h.initialSharedVersion!==E.initialSharedVersion||h.mutable!=null&&h.mutable!==E.mutable||h.version!=null||h.digest!=null)throw new Error(`Input at index ${s} did not match unresolved object. ${JSON.stringify(h)} is not compatible with ${JSON.stringify(E)}`)}else throw new Error(`Input at index ${s} resolved to an unexpected Object kind: ${JSON.stringify(d.Object)}`);this.inputs[s]=d;break}}}};let qV=null;const xa={MoveCall(t){const[e,s="",f=""]="target"in t?t.target.split("::"):[t.package,t.module,t.function];return{$kind:"MoveCall",MoveCall:{package:e,module:s,function:f,typeArguments:t.typeArguments??[],arguments:t.arguments??[]}}},TransferObjects(t,e){return{$kind:"TransferObjects",TransferObjects:{objects:t.map(s=>Wr(Gi,s)),address:Wr(Gi,e)}}},SplitCoins(t,e){return{$kind:"SplitCoins",SplitCoins:{coin:Wr(Gi,t),amounts:e.map(s=>Wr(Gi,s))}}},MergeCoins(t,e){return{$kind:"MergeCoins",MergeCoins:{destination:Wr(Gi,t),sources:e.map(s=>Wr(Gi,s))}}},Publish({modules:t,dependencies:e}){return{$kind:"Publish",Publish:{modules:t.map(s=>typeof s=="string"?s:Wi(new Uint8Array(s))),dependencies:e.map(s=>wu(s))}}},Upgrade({modules:t,dependencies:e,package:s,ticket:f}){return{$kind:"Upgrade",Upgrade:{modules:t.map(d=>typeof d=="string"?d:Wi(new Uint8Array(d))),dependencies:e.map(d=>wu(d)),package:s,ticket:Wr(Gi,f)}}},MakeMoveVec({type:t,elements:e}){return{$kind:"MakeMoveVec",MakeMoveVec:{type:t??null,elements:e.map(s=>Wr(Gi,s))}}},Intent({name:t,inputs:e={},data:s={}}){return{$kind:"$Intent",$Intent:{name:t,inputs:Object.fromEntries(Object.entries(e).map(([f,d])=>[f,Array.isArray(d)?d.map(h=>Wr(Gi,h)):Wr(Gi,d)])),data:s}}}};function Lp(t){return Fs(Object.entries(t).map(([e,s])=>Jn({[e]:s})))}const dc=Lp({GasCoin:Rr(!0),Input:Hi(rs(),ns()),Result:Hi(rs(),ns()),NestedResult:bp([Hi(rs(),ns()),Hi(rs(),ns())])}),K9=Jn({budget:fi(ks),price:fi(ks),owner:fi(vl),payment:fi(Fr(Da))}),$9=Lp({MoveCall:Jn({package:zo,module:Gr(),function:Gr(),typeArguments:Fr(Gr()),arguments:Fr(dc)}),TransferObjects:Jn({objects:Fr(dc),address:dc}),SplitCoins:Jn({coin:dc,amounts:Fr(dc)}),MergeCoins:Jn({destination:dc,sources:Fr(dc)}),Publish:Jn({modules:Fr(Iu),dependencies:Fr(zo)}),MakeMoveVec:Jn({type:fi(Gr()),elements:Fr(dc)}),Upgrade:Jn({modules:Fr(Iu),dependencies:Fr(zo),package:zo,ticket:dc}),$Intent:Jn({name:Gr(),inputs:Rf(Gr(),Fs([dc,Fr(dc)])),data:Rf(Gr(),Xs())})}),V9=Lp({Object:Lp({ImmOrOwnedObject:Da,SharedObject:Jn({objectId:zo,initialSharedVersion:ks,mutable:ml()}),Receiving:Da}),Pure:Jn({bytes:Iu}),UnresolvedPure:Jn({value:Xs()}),UnresolvedObject:Jn({objectId:zo,version:ms(fi(ks)),digest:ms(fi(Gr())),initialSharedVersion:ms(fi(ks)),mutable:ms(fi(ml()))}),FundsWithdrawal:Xr}),W9=Lp({None:Rr(!0),Epoch:ks,ValidDuring:wp}),G9=Jn({version:Rr(2),sender:bl(vl),expiration:bl(W9),gasData:K9,inputs:Fr(V9),commands:Fr($9),digest:ms(fi(Gr()))});function q9(t){return{$kind:"Pure",Pure:{bytes:t instanceof Uint8Array?Wi(t):t.toBase64()}}}const $o={Pure:q9,ObjectRef({objectId:t,digest:e,version:s}){return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{digest:e,version:s,objectId:ni(t)}}}},SharedObjectRef({objectId:t,mutable:e,initialSharedVersion:s}){return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{mutable:e,initialSharedVersion:s,objectId:ni(t)}}}},ReceivingRef({objectId:t,digest:e,version:s}){return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{digest:e,version:s,objectId:ni(t)}}}},FundsWithdrawal({reservation:t,typeArg:e,withdrawFrom:s}){return{$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:t,typeArg:e,withdrawFrom:s}}}};var v8=class extends Error{},Z9=class extends v8{constructor(t,e){super(t,{cause:e?.cause}),this.executionError=e?.executionError}},w8=class m0 extends v8{constructor(e,s){super(s),this.code=e}static fromResponse(e,s){switch(e.code){case"notExists":return new m0(e.code,`Object ${e.object_id} does not exist`);case"dynamicFieldNotFound":return new m0(e.code,`Dynamic field not found for object ${e.parent_object_id}`);case"deleted":return new m0(e.code,`Object ${e.object_id} has been deleted`);case"displayError":return new m0(e.code,`Display error: ${e.error}`);case"unknown":default:return new m0(e.code,`Unknown error while loading object${s?` ${s}`:""}`)}}};const YV=9,JV=BigInt(1e9),_8="0x0000000000000000000000000000000000000000000000000000000000000001",mh="0x0000000000000000000000000000000000000000000000000000000000000002",X9="0x0000000000000000000000000000000000000000000000000000000000000003",Y9="0x0000000000000000000000000000000000000000000000000000000000000006",QV="sui_system",J9=`${mh}::sui::SUI`,E8="0x0000000000000000000000000000000000000000000000000000000000000005",Q9="0x0000000000000000000000000000000000000000000000000000000000000008",eW="0x000000000000000000000000000000000000000000000000000000000000000c",e7="0x0000000000000000000000000000000000000000000000000000000000000403";function S8(t){const e=t.split("::");if(e.length!==3)throw new Error(`Invalid type name format: ${t}`);return{package:e[0],module:e[1],name:e[2]}}function t7(t){if(t.body.$kind!=="datatype")return!1;const{package:e,module:s,name:f}=S8(t.body.datatype.typeName);return ni(e)===mh&&s==="tx_context"&&f==="TxContext"}function Y3(t){switch(t.$kind){case"address":return jr.Address;case"bool":return jr.Bool;case"u8":return jr.U8;case"u16":return jr.U16;case"u32":return jr.U32;case"u64":return jr.U64;case"u128":return jr.U128;case"u256":return jr.U256;case"vector":{if(t.vector.$kind==="u8")return jr.byteVector().transform({input:s=>typeof s=="string"?new TextEncoder().encode(s):s,output:s=>s});const e=Y3(t.vector);return e?jr.vector(e):null}case"datatype":{const{package:e,module:s,name:f}=S8(t.datatype.typeName),d=ni(e);if(d===_8){if(s==="ascii"&&f==="String"||s==="string"&&f==="String")return jr.String;if(s==="option"&&f==="Option"){const h=Y3(t.datatype.typeParameters[0]);return h?jr.vector(h):null}}return d===mh&&s==="object"&&f==="ID"?jr.Address:null}case"typeParameter":case"unknown":return null}}function tW(t){return typeof t=="object"&&"Reference"in t?{reference:"immutable",body:Fp(t.Reference)}:typeof t=="object"&&"MutableReference"in t?{reference:"mutable",body:Fp(t.MutableReference)}:{reference:null,body:Fp(t)}}function Fp(t){if(typeof t=="string")switch(t){case"Address":return{$kind:"address"};case"Bool":return{$kind:"bool"};case"U8":return{$kind:"u8"};case"U16":return{$kind:"u16"};case"U32":return{$kind:"u32"};case"U64":return{$kind:"u64"};case"U128":return{$kind:"u128"};case"U256":return{$kind:"u256"};default:throw new Error(`Unexpected type ${t}`)}if("Vector"in t)return{$kind:"vector",vector:Fp(t.Vector)};if("Struct"in t)return{$kind:"datatype",datatype:{typeName:`${t.Struct.address}::${t.Struct.module}::${t.Struct.name}`,typeParameters:t.Struct.typeArguments.map(Fp)}};if("TypeParameter"in t)return{$kind:"typeParameter",index:t.TypeParameter};throw new Error(`Unexpected type ${JSON.stringify(t)}`)}const n7=50,r7=1000n,i7=5e10;function s7(t){if(!t.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return t.client}async function A8(t,e,s){const f=s7(e);return await d7(t,f),await f7(t,f),e.onlyTransactionKind||await o7(t,f),await s()}async function o7(t,e){let s=null;t.gasData.price||(s=(await e.core.getCurrentSystemState()).systemState,t.gasData.price=s.referenceGasPrice),await a7(t,e),await c7(t,e),t.expiration||await u7(t,e,s)}async function a7(t,e){if(t.gasData.budget)return;const s=await e.core.simulateTransaction({transaction:t.build({overrides:{gasData:{budget:String(i7),payment:[]}}}),include:{effects:!0}});if(s.$kind==="FailedTransaction"){const P=s.FailedTransaction.status.error??void 0;throw new Z9(`Transaction resolution failed: ${P?.message??"Unknown error"}`,{cause:s,executionError:P})}const f=s.Transaction.effects.gasUsed,d=r7*BigInt(t.gasData.price||1n),h=BigInt(f.computationCost)+d,E=h+BigInt(f.storageCost)-BigInt(f.storageRebate);t.gasData.budget=String(E>h?E:h)}async function c7(t,e){if(!t.gasData.payment){const s=t.gasData.owner??t.sender;if(!s)throw new Error("Either a gas owner or sender must be set to determine gas payment.");const f=ni(s);let d=!1,h=0n;t.mapArguments(q=>{if(q.$kind==="GasCoin")d=!0;else if(q.$kind==="Input"){const te=t.inputs[q.Input];if(te.$kind==="FundsWithdrawal"){const ne=te.FundsWithdrawal.withdrawFrom.Sender?t.sender:s;ne&&ni(ne)===f&&te.FundsWithdrawal.reservation.$kind==="MaxAmountU64"&&(h+=BigInt(te.FundsWithdrawal.reservation.MaxAmountU64))}}return q});const[E,P]=await Promise.all([d?null:e.core.getBalance({owner:s}),e.core.listCoins({owner:s,coinType:J9})]);if(E?.balance.addressBalance&&BigInt(E.balance.addressBalance)>=BigInt(t.gasData.budget||"0")+h){t.gasData.payment=[];return}const R=P.objects.filter(q=>!t.inputs.find(te=>te.Object?.ImmOrOwnedObject?q.objectId===te.Object.ImmOrOwnedObject.objectId:!1)).map(q=>Wr(Da,{objectId:q.objectId,digest:q.digest,version:q.version}));if(!R.length)throw new Error("No valid gas coins found for the transaction.");t.gasData.payment=R}}async function u7(t,e,s){if(t.expiration||l7(t))return;const[f,{chainIdentifier:d}]=await Promise.all([s??e.core.getCurrentSystemState().then(E=>E.systemState),e.core.getChainIdentifier()]),h=BigInt(f.epoch);t.expiration={$kind:"ValidDuring",ValidDuring:{minEpoch:String(h),maxEpoch:String(h+1n),minTimestamp:null,maxTimestamp:null,chain:d,nonce:Math.random()*4294967296>>>0}}}function l7(t){return t.gasData.payment?.length?!0:t.inputs.some(e=>e.Object?.ImmOrOwnedObject||e.UnresolvedObject&&e.UnresolvedObject.version)}async function f7(t,e){const s=t.inputs.filter(te=>te.UnresolvedObject&&!(te.UnresolvedObject.version||te.UnresolvedObject?.initialSharedVersion)),f=[...new Set(s.map(te=>wu(te.UnresolvedObject.objectId)))],d=f.length?ll(f,n7):[],h=(await Promise.all(d.map(te=>e.core.getObjects({objectIds:te})))).flatMap(te=>te.objects),E=new Map(f.map((te,ne)=>[te,h[ne]])),P=Array.from(E).filter(([te,ne])=>ne instanceof Error).map(([te,ne])=>ne.message);if(P.length)throw new Error(`The following input objects are invalid: ${P.join(", ")}`);const R=h.map(te=>{if(te instanceof Error)throw new Error(`Failed to fetch object: ${te.message}`);const ne=te.owner,ue=ne&&typeof ne=="object"?ne.$kind==="Shared"?ne.Shared.initialSharedVersion:ne.$kind==="ConsensusAddressOwner"?ne.ConsensusAddressOwner.startVersion:null:null;return{objectId:te.objectId,digest:te.digest,version:te.version,initialSharedVersion:ue}}),q=new Map(f.map((te,ne)=>[te,R[ne]]));for(const[te,ne]of t.inputs.entries()){if(!ne.UnresolvedObject)continue;let ue;const ge=ni(ne.UnresolvedObject.objectId),xe=q.get(ge);ne.UnresolvedObject.initialSharedVersion??xe?.initialSharedVersion?ue=$o.SharedObjectRef({objectId:ge,initialSharedVersion:ne.UnresolvedObject.initialSharedVersion||xe?.initialSharedVersion,mutable:ne.UnresolvedObject.mutable||h7(t,te)}):p7(t,te)&&(ue=$o.ReceivingRef({objectId:ge,digest:ne.UnresolvedObject.digest??xe?.digest,version:ne.UnresolvedObject.version??xe?.version})),t.inputs[t.inputs.indexOf(ne)]=ue??$o.ObjectRef({objectId:ge,digest:ne.UnresolvedObject.digest??xe?.digest,version:ne.UnresolvedObject.version??xe?.version})}}async function d7(t,e){const{inputs:s,commands:f}=t,d=[],h=new Set;f.forEach(P=>{if(P.MoveCall){if(P.MoveCall._argumentTypes)return;if(P.MoveCall.arguments.map(R=>R.$kind==="Input"?t.inputs[R.Input]:null).some(R=>R?.UnresolvedPure||R?.UnresolvedObject&&typeof R?.UnresolvedObject.mutable!="boolean")){const R=`${P.MoveCall.package}::${P.MoveCall.module}::${P.MoveCall.function}`;h.add(R),d.push(P.MoveCall)}}});const E=new Map;h.size>0&&await Promise.all([...h].map(async P=>{const[R,q,te]=P.split("::"),{function:ne}=await e.core.getMoveFunction({packageId:R,moduleName:q,name:te});E.set(P,ne.parameters)})),d.length&&await Promise.all(d.map(async P=>{const R=E.get(`${P.package}::${P.module}::${P.function}`);R&&(P._argumentTypes=R.length>0&&t7(R.at(-1))?R.slice(0,R.length-1):R)})),f.forEach(P=>{if(!P.MoveCall)return;const R=P.MoveCall,q=`${R.package}::${R.module}::${R.function}`,te=R._argumentTypes;if(te){if(te.length!==P.MoveCall.arguments.length)throw new Error(`Incorrect number of arguments for ${q}`);te.forEach((ne,ue)=>{const ge=R.arguments[ue];if(ge.$kind!=="Input")return;const xe=s[ge.Input];if(!xe.UnresolvedPure&&!xe.UnresolvedObject)return;const pe=xe.UnresolvedPure?.value??xe.UnresolvedObject?.objectId,Se=Y3(ne.body);if(Se){ge.type="pure",s[s.indexOf(xe)]=$o.Pure(Se.serialize(pe));return}if(typeof pe!="string")throw new Error(`Expect the argument to be an object id string, got ${JSON.stringify(pe,null,2)}`);ge.type="object";const Ce=xe.UnresolvedPure?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:pe}}:xe;s[ge.Input]=Ce})}})}function h7(t,e){let s=!1;return t.getInputUses(e,(f,d)=>{if(d.MoveCall&&d.MoveCall._argumentTypes){const h=d.MoveCall.arguments.indexOf(f);s=d.MoveCall._argumentTypes[h].reference!=="immutable"||s}(d.$kind==="MakeMoveVec"||d.$kind==="MergeCoins"||d.$kind==="SplitCoins"||d.$kind==="TransferObjects")&&(s=!0)}),s}function p7(t,e){let s=!1;return t.getInputUses(e,(f,d)=>{if(d.MoveCall&&d.MoveCall._argumentTypes){const h=d.MoveCall.arguments.indexOf(f);s=y7(d.MoveCall._argumentTypes[h])||s}}),s}const g7="0x0000000000000000000000000000000000000000000000000000000000000002::transfer::Receiving";function y7(t){return t.body.$kind!=="datatype"?!1:t.body.datatype.typeName===g7}function x8(t,e){return!!(t.inputs.some(s=>s.UnresolvedObject||s.UnresolvedPure)||!e.onlyTransactionKind&&(!t.gasData.price||!t.gasData.budget||!t.gasData.payment||t.gasData.payment.length===0&&!t.expiration))}async function m7(t,e,s){return v7(t),x8(t,e)?(b7(e).core?.resolveTransactionPlugin()??A8)(t,e,async()=>{await I8(t),await s()}):(await I8(t),s())}function I8(t){t.inputs.forEach((e,s)=>{if(e.$kind!=="Object"&&e.$kind!=="Pure"&&e.$kind!=="FundsWithdrawal")throw new Error(`Input at index ${s} has not been resolved. Expected a Pure, Object, or FundsWithdrawal input, but found ${JSON.stringify(e)}`)})}function b7(t){if(!t.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return t.client}function v7(t){for(const e of t.commands)switch(e.$kind){case"SplitCoins":e.SplitCoins.amounts.forEach(s=>{B8(s,jr.U64,t)});break;case"TransferObjects":B8(e.TransferObjects.address,jr.Address,t);break}}function B8(t,e,s){if(t.$kind!=="Input")return;const f=s.inputs[t.Input];f.$kind==="UnresolvedPure"&&(s.inputs[t.Input]=$o.Pure(e.serialize(f.UnresolvedPure.value)))}function w7(t){function e(s){return t(s)}return e.system=s=>{const f=s?.mutable;return e(f!==void 0?$o.SharedObjectRef({objectId:E8,initialSharedVersion:1,mutable:f}):{$kind:"UnresolvedObject",UnresolvedObject:{objectId:E8,initialSharedVersion:1}})},e.clock=()=>e($o.SharedObjectRef({objectId:Y9,initialSharedVersion:1,mutable:!1})),e.random=()=>e({$kind:"UnresolvedObject",UnresolvedObject:{objectId:Q9,mutable:!1}}),e.denyList=s=>e({$kind:"UnresolvedObject",UnresolvedObject:{objectId:e7,mutable:s?.mutable}}),e.option=({type:s,value:f})=>d=>d.moveCall({typeArguments:[s],target:`${_8}::option::${f===null?"none":"some"}`,arguments:f===null?[]:[d.object(f)]}),e}function jp(t){switch(t){case"u8":return Pt.u8();case"u16":return Pt.u16();case"u32":return Pt.u32();case"u64":return Pt.u64();case"u128":return Pt.u128();case"u256":return Pt.u256();case"bool":return Pt.bool();case"string":return Pt.string();case"id":case"address":return Ii}const e=t.match(/^(vector|option)<(.+)>$/);if(e){const[s,f]=e.slice(1);return s==="vector"?Pt.vector(jp(f)):Pt.option(jp(f))}throw new Error(`Invalid Pure type name: ${t}`)}function _7(t){function e(s,f){if(typeof s=="string")return t(jp(s).serialize(f));if(s instanceof Uint8Array||uh(s))return t(s);throw new Error("tx.pure must be called either a bcs type name, or a serialized bcs value")}return e.u8=s=>t(jr.U8.serialize(s)),e.u16=s=>t(jr.U16.serialize(s)),e.u32=s=>t(jr.U32.serialize(s)),e.u64=s=>t(jr.U64.serialize(s)),e.u128=s=>t(jr.U128.serialize(s)),e.u256=s=>t(jr.U256.serialize(s)),e.bool=s=>t(jr.Bool.serialize(s)),e.string=s=>t(jr.String.serialize(s)),e.address=s=>t(jr.Address.serialize(s)),e.id=e.address,e.vector=(s,f)=>t(jr.vector(jp(s)).serialize(f)),e.option=(s,f)=>t(jr.option(jp(s)).serialize(f)),e}function E7(){return async(t,e,s)=>{const f=Yo(t);if(f.types.length===0&&f.packages.length===0)return s();if(!e.client)throw new Error("Transaction contains MVR names but no client was provided to resolve them. Please pass a client to Transaction#build()");Hv(t,await e.client.core.mvr.resolve({types:f.types,packages:f.packages})),await s()}}const Lf="CoinWithBalance",Ff=fs("0x2::sui::SUI");function nW({type:t=Ff,balance:e,useGasCoin:s=!0}){let f=null;return d=>{if(f)return f;d.addIntentResolver(Lf,k8);const h=t==="gas"?t:normalizeStructTag(t);return f=d.add(TransactionCommands.Intent({name:Lf,inputs:{},data:{type:h===Ff&&s?"gas":h,balance:BigInt(e)}})),f}}const S7=Jn({type:Gr(),balance:Jd()});async function k8(t,e,s){const f=new Set,d=new Map;if(!t.sender)throw new Error("Sender must be set to resolve CoinWithBalance");for(const te of t.commands)if(te.$kind==="$Intent"&&te.$Intent.name===Lf){const{type:ne,balance:ue}=Wr(S7,te.$Intent.data);ne!=="gas"&&ue>0n&&f.add(ne),d.set(ne,(d.get(ne)??0n)+ue)}const h=new Set;for(const te of t.inputs)te.Object?.ImmOrOwnedObject&&h.add(te.Object.ImmOrOwnedObject.objectId),te.UnresolvedObject?.objectId&&h.add(te.UnresolvedObject.objectId);const E=new Map,P=new Map,R=e.client;if(!R)throw new Error("Client must be provided to build or serialize transactions with CoinWithBalance intents");await Promise.all([...[...f].map(async te=>{const{coins:ne,addressBalance:ue}=await A7({coinType:te,balance:d.get(te),client:R,owner:t.sender,usedIds:h});E.set(te,ne),P.set(te,ue)}),d.has("gas")?await R.core.getBalance({owner:t.sender,coinType:Ff}).then(({balance:te})=>{P.set("gas",BigInt(te.addressBalance))}):null]);const q=new Map;for(const[te,ne]of t.commands.entries()){if(ne.$kind!=="$Intent"||ne.$Intent.name!==Lf)continue;const{type:ue,balance:ge}=ne.$Intent.data;if(ge===0n){t.replaceCommand(te,xa.MoveCall({target:"0x2::coin::zero",typeArguments:[ue==="gas"?Ff:ue]}));continue}const xe=[];if(P.get(ue)>=d.get(ue))xe.push(xa.MoveCall({target:"0x2::coin::redeem_funds",typeArguments:[ue==="gas"?Ff:ue],arguments:[t.addInput("withdrawal",$o.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(ge)},typeArg:{$kind:"Balance",Balance:ue==="gas"?Ff:ue},withdrawFrom:{$kind:"Sender",Sender:!0}}))]}));else{if(!q.has(ue)){const pe=P.get(ue)??0n,Se=ue==="gas"?Ff:ue;let Ce,Fe;ue==="gas"?(Ce={$kind:"GasCoin",GasCoin:!0},Fe=[]):[Ce,...Fe]=E.get(ue).map(We=>t.addInput("object",$o.ObjectRef({objectId:We.objectId,digest:We.digest,version:We.version}))),pe>0n?(xe.push(xa.MoveCall({target:"0x2::coin::redeem_funds",typeArguments:[Se],arguments:[t.addInput("withdrawal",$o.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(pe)},typeArg:{$kind:"Balance",Balance:Se},withdrawFrom:{$kind:"Sender",Sender:!0}}))]})),xe.push(xa.MergeCoins(Ce,[{$kind:"Result",Result:te+xe.length-1},...Fe]))):Fe.length>0&&xe.push(xa.MergeCoins(Ce,Fe)),q.set(ue,Ce)}xe.push(xa.SplitCoins(q.get(ue),[t.addInput("pure",$o.Pure(jr.u64().serialize(ge)))]))}t.replaceCommand(te,xe),t.mapArguments((pe,Se,Ce)=>Ce>=te&&Ce<te+xe.length?pe:pe.$kind==="Result"&&pe.Result===te?{$kind:"NestedResult",NestedResult:[te+xe.length-1,0]}:pe)}return s()}async function A7({coinType:t,balance:e,client:s,owner:f,usedIds:d}){let h=e;const E=[],P=s.core.getBalance({owner:f,coinType:t}).then(({balance:ne})=>(h-=BigInt(ne.addressBalance),ne)),[R,q]=await Promise.all([te(),P]);if(BigInt(q.balance)<e)throw new Error(`Insufficient balance of ${t} for owner ${f}. Required: ${e}, Available: ${e-h}`);return{coins:R,balance:BigInt(q.coinBalance),addressBalance:BigInt(q.addressBalance),coinBalance:BigInt(q.coinBalance)};async function te(ne=null){const{objects:ue,hasNextPage:ge,cursor:xe}=await s.core.listCoins({owner:f,coinType:t,cursor:ne});if(await P,h>0n){for(const pe of ue){if(d.has(pe.objectId))continue;const Se=BigInt(pe.balance);if(E.push(pe),h-=Se,h<=0)break}if(ge)return te(xe)}return E}}function J3(t,e=1/0){const s={$kind:"Result",get Result(){return typeof t=="function"?t():t}},f=[],d=h=>f[h]??={$kind:"NestedResult",get NestedResult(){return[typeof t=="function"?t():t,h]}};return new Proxy(s,{set(){throw new Error("The transaction result is a proxy, and does not support setting properties directly")},get(h,E){if(E in h)return Reflect.get(h,E);if(E===Symbol.iterator)return function*(){let R=0;for(;R<e;)yield d(R),R++};if(typeof E=="symbol")return;const P=parseInt(E,10);if(!(Number.isNaN(P)||P<0))return d(P)}})}const T8=Symbol.for("@mysten/transaction");function C8(t){return!!t&&typeof t=="object"&&t[T8]===!0}var Q3=class pv{#e;#n;#r=new Map;#i=[];#o=[];#s=new Set;#a=new Set;#c=new Map;static fromKind(e){const s=new pv;return s.#t=Vc.fromKindBytes(typeof e=="string"?ls(e):e),s.#i=s.#t.inputs.slice(),s.#o=s.#t.commands.slice(),s.#s=new Set(s.#o.map((f,d)=>d)),s}static from(e){const s=new pv;if(C8(e)?s.#t=Vc.restore(e.getData()):typeof e!="string"||!e.startsWith("{")?s.#t=Vc.fromBytes(typeof e=="string"?ls(e):e):s.#t=Vc.restore(JSON.parse(e)),s.#i=s.#t.inputs.slice(),s.#o=s.#t.commands.slice(),s.#s=new Set(s.#o.map((f,d)=>d)),!s.isPreparedForSerialization({supportedIntents:[Lf]}))throw new Error("Transaction has unresolved intents or async thunks. Call `prepareForSerialization` before copying.");return s.#t.commands.some(f=>f.$Intent?.name===Lf)&&s.addIntentResolver(Lf,k8),s}addSerializationPlugin(e){this.#e.push(e)}addBuildPlugin(e){this.#n.push(e)}addIntentResolver(e,s){if(this.#r.has(e)&&this.#r.get(e)!==s)throw new Error(`Intent resolver for ${e} already exists`);this.#r.set(e,s)}setSender(e){this.#t.sender=e}setSenderIfNotSet(e){this.#t.sender||(this.#t.sender=e)}setExpiration(e){this.#t.expiration=e?Wr(Nm,e):null}setGasPrice(e){this.#t.gasData.price=String(e)}setGasBudget(e){this.#t.gasData.budget=String(e)}setGasBudgetIfNotSet(e){this.#t.gasData.budget==null&&(this.#t.gasData.budget=String(e))}setGasOwner(e){this.#t.gasData.owner=e}setGasPayment(e){this.#t.gasData.payment=e.map(s=>Wr(Da,s))}#t;getData(){return this.#t.snapshot()}get[T8](){return!0}get pure(){return Object.defineProperty(this,"pure",{enumerable:!1,value:_7(e=>uh(e)?this.#u("pure",{$kind:"Pure",Pure:{bytes:e.toBase64()}}):this.#u("pure",hp(Ho,e)?Wr(Ho,e):e instanceof Uint8Array?$o.Pure(e):{$kind:"UnresolvedPure",UnresolvedPure:{value:e}}))}),this.pure}constructor(){this.object=w7(e=>{if(typeof e=="function")return this.object(this.add(e));if(typeof e=="object"&&hp(Gi,e))return e;const s=ah(e),f=this.#t.inputs.find(d=>s===ah(d));return f?.Object?.SharedObject&&typeof e=="object"&&e.Object?.SharedObject&&(f.Object.SharedObject.mutable=f.Object.SharedObject.mutable||e.Object.SharedObject.mutable),f?{$kind:"Input",Input:this.#t.inputs.indexOf(f),type:"object"}:this.#u("object",typeof e=="string"?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:ni(e)}}:e)}),this.#t=new Vc,this.#n=[],this.#e=[]}get gas(){return{$kind:"GasCoin",GasCoin:!0}}objectRef(...e){return this.object($o.ObjectRef(...e))}receivingRef(...e){return this.object($o.ReceivingRef(...e))}sharedObjectRef(...e){return this.object($o.SharedObjectRef(...e))}#g(){const e=new pv;return e.#t=this.#t,e.#e=this.#e,e.#n=this.#n,e.#r=this.#r,e.#a=this.#a,e.#s=new Set(this.#s),e.#c=this.#c,this.#i.push(e.#i),this.#o.push(e.#o),e}add(e){if(typeof e=="function"){if(this.#c.has(e))return this.#c.get(e);const s=this.#g(),f=e(s);if(!(f&&typeof f=="object"&&"then"in f))return this.#s=s.#s,this.#c.set(e,f),f;const d=this.#l({$kind:"$Intent",$Intent:{name:"AsyncTransactionThunk",inputs:{},data:{resultIndex:this.#t.commands.length,result:null}}});this.#a.add(Promise.resolve(f).then(E=>{d.$Intent.data.result=E}));const h=J3(()=>d.$Intent.data.resultIndex);return this.#c.set(e,h),h}else this.#l(e);return J3(this.#t.commands.length-1)}#l(e){const s=this.#t.commands.length;return this.#o.push(e),this.#s.add(s),this.#t.commands.push(e),this.#t.mapCommandArguments(s,f=>{if(f.$kind==="Result"&&!this.#s.has(f.Result))throw new Error(`Result { Result: ${f.Result} } is not available to use in the current transaction`);if(f.$kind==="NestedResult"&&!this.#s.has(f.NestedResult[0]))throw new Error(`Result { NestedResult: [${f.NestedResult[0]}, ${f.NestedResult[1]}] } is not available to use in the current transaction`);if(f.$kind==="Input"&&f.Input>=this.#t.inputs.length)throw new Error(`Input { Input: ${f.Input} } references an input that does not exist in the current transaction`);return f}),e}#u(e,s){return this.#i.push(s),this.#t.addInput(e,s)}#f(e){return uh(e)?this.pure(e):this.#d(e)}#d(e){if(typeof e=="function"){const s=this.add(e);return typeof s=="function"?this.#d(s):Wr(Gi,s)}return Wr(Gi,e)}splitCoins(e,s){const f=xa.SplitCoins(typeof e=="string"?this.object(e):this.#d(e),s.map(d=>typeof d=="number"||typeof d=="bigint"||typeof d=="string"?this.pure.u64(d):this.#f(d)));return this.#l(f),J3(this.#t.commands.length-1,s.length)}mergeCoins(e,s){return this.add(xa.MergeCoins(this.object(e),s.map(f=>this.object(f))))}publish({modules:e,dependencies:s}){return this.add(xa.Publish({modules:e,dependencies:s}))}upgrade({modules:e,dependencies:s,package:f,ticket:d}){return this.add(xa.Upgrade({modules:e,dependencies:s,package:f,ticket:this.object(d)}))}moveCall({arguments:e,...s}){return this.add(xa.MoveCall({...s,arguments:e?.map(f=>this.#f(f))}))}transferObjects(e,s){return this.add(xa.TransferObjects(e.map(f=>this.object(f)),typeof s=="string"?this.pure.address(s):this.#f(s)))}makeMoveVec({type:e,elements:s}){return this.add(xa.MakeMoveVec({type:e,elements:s.map(f=>this.object(f))}))}withdrawal({amount:e,type:s}){const f={$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(e)},typeArg:{$kind:"Balance",Balance:s??"0x2::sui::SUI"},withdrawFrom:{$kind:"Sender",Sender:!0}}};return this.#u("object",f)}serialize(){return JSON.stringify(js(this.#t.snapshot()))}async toJSON(e={}){await this.prepareForSerialization(e);const s=this.isFullyResolved();return JSON.stringify(Wr(G9,s?{...this.#t.snapshot(),digest:this.#t.getDigest()}:this.#t.snapshot()),(f,d)=>typeof d=="bigint"?d.toString():d,2)}async sign(e){const{signer:s,...f}=e,d=await this.build(f);return s.signTransaction(d)}isPreparedForSerialization(e={}){return!(this.#a.size>0||this.#t.commands.some(s=>s.$Intent&&!e.supportedIntents?.includes(s.$Intent.name)))}isFullyResolved(){return!(!this.isPreparedForSerialization()||!this.#t.sender||x8(this.#t,{}))}async build(e={}){return await this.prepareForSerialization(e),await this.#h(e),this.#t.build({onlyTransactionKind:e.onlyTransactionKind})}async getDigest(e={}){return await this.prepareForSerialization(e),await this.#h(e),this.#t.getDigest()}async#h(e){if(!e.onlyTransactionKind&&!this.#t.sender)throw new Error("Missing transaction sender");await this.#p([...this.#n,m7],e)}async#p(e,s){try{const f=d=>{if(d>=e.length)return()=>{};const h=e[d];return async()=>{const E=f(d+1);let P=!1,R=!1;if(await h(this.#t,s,async()=>{if(P)throw new Error(`next() was call multiple times in TransactionPlugin ${d}`);P=!0,await E(),R=!0}),!P)throw new Error(`next() was not called in TransactionPlugin ${d}`);if(!R)throw new Error(`next() was not awaited in TransactionPlugin ${d}`)}};await f(0)()}finally{this.#i=this.#t.inputs.slice(),this.#o=this.#t.commands.slice(),this.#s=new Set(this.#o.map((f,d)=>d))}}async#y(){for(;this.#a.size>0;){const e=Promise.all(this.#a);this.#a.clear(),this.#a.add(e),await e,this.#a.delete(e)}}#m(){const e=this.#t.commands,s=this.#t.inputs,f=this.#o.flat(1/0),d=this.#i.flat(1/0);if(f.length!==e.length)throw new Error("Unexpected number of commands found in transaction data");if(d.length!==s.length)throw new Error("Unexpected number of inputs found in transaction data");const h=f.filter(P=>P.$Intent?.name!=="AsyncTransactionThunk");this.#t.commands=h,this.#t.inputs=d,this.#o=h,this.#i=d,this.#s=new Set(h.map((P,R)=>R));function E(P){const R=e[P];if(R.$Intent?.name==="AsyncTransactionThunk"){const te=R.$Intent.data.result;if(te==null)throw new Error("AsyncTransactionThunk has not been resolved");return E(te.Result)}const q=h.indexOf(R);if(q===-1)throw new Error("Unable to find original index for command");return q}this.#t.mapArguments(P=>{if(P.$kind==="Input"){const R=d.indexOf(s[P.Input]);if(R===-1)throw new Error("Input has not been resolved");return{...P,Input:R}}else if(P.$kind==="Result"){const R=E(P.Result);return{...P,Result:R}}else if(P.$kind==="NestedResult"){const R=E(P.NestedResult[0]);return{...P,NestedResult:[R,P.NestedResult[1]]}}return P});for(const[P,R]of e.entries())if(R.$Intent?.name==="AsyncTransactionThunk")try{R.$Intent.data.resultIndex=E(P)}catch{}}async prepareForSerialization(e){await this.#y(),this.#m();const s=new Set;for(const d of this.#t.commands)d.$Intent&&s.add(d.$Intent.name);const f=[...this.#e];for(const d of s)if(!e.supportedIntents?.includes(d)){if(!this.#r.has(d))throw new Error(`Missing intent resolver for ${d}`);f.push(this.#r.get(d))}f.push(E7()),await this.#p(f,e)}};function P8(t,e,s){const f=jr.Address.serialize(t).toBytes(),d=jr.TypeTag.serialize(e).toBytes(),h=jr.u64().serialize(s.length).toBytes(),E=Dp.create({dkLen:32});return E.update(new Uint8Array([240])),E.update(f),E.update(h),E.update(s),E.update(d),`0x${Cc(E.digest().slice(0,32))}`}const x7={mainnet:"https://mainnet.mvr.mystenlabs.com",testnet:"https://testnet.mvr.mystenlabs.com"};var I7=class extends yy{constructor(t){super(t),this.core=this,this.mvr=new zv({cache:this.cache.scope("core.mvr"),url:t.mvr?.url??x7[this.network],pageSize:t.mvr?.pageSize,overrides:t.mvr?.overrides})}async getObject(t){const{objectId:e}=t,{objects:[s]}=await this.getObjects({objectIds:[e],signal:t.signal,include:t.include});if(s instanceof Error)throw s;return{object:s}}async getDynamicField(t){const e=ta.parseFromStr((await this.core.mvr.resolveType({type:t.name.type})).type),s=P8(t.parentId,e,t.name.bcs),{objects:[f]}=await this.getObjects({objectIds:[s],signal:t.signal,include:{previousTransaction:!0,content:!0}});if(f instanceof Error)throw f;const d=Mc(f.type),h=await f.content,E=d.typeParams[0],P=typeof E!="string"&&E.module==="dynamic_object_field"&&E.name==="Wrapper",R=h.slice(ec+t.name.bcs.length),q=typeof d.typeParams[1]=="string"?d.typeParams[1]:fs(d.typeParams[1]);return{dynamicField:{$kind:P?"DynamicObject":"DynamicField",fieldId:f.objectId,digest:f.digest,version:f.version,type:f.type,previousTransaction:f.previousTransaction,name:{type:typeof E=="string"?E:fs(E),bcs:t.name.bcs},value:{type:q,bcs:R},childId:P?jr.Address.parse(R):void 0}}}async getDynamicObjectField(t){const e=`0x2::dynamic_object_field::Wrapper<${(await this.core.mvr.resolveType({type:t.name.type})).type}>`,{dynamicField:s}=await this.getDynamicField({parentId:t.parentId,name:{type:e,bcs:t.name.bcs},signal:t.signal}),{object:f}=await this.getObject({objectId:s.childId,signal:t.signal,include:t.include});return{object:f}}async waitForTransaction(t){const{signal:e,timeout:s=60*1e3,include:f}=t,d="result"in t&&t.result?(t.result.Transaction??t.result.FailedTransaction).digest:t.digest,h=e?AbortSignal.any([AbortSignal.timeout(s),e]):AbortSignal.timeout(s),E=new Promise((P,R)=>{h.addEventListener("abort",()=>R(h.reason))});for(E.catch(()=>{});;){h.throwIfAborted();try{return await this.getTransaction({digest:d,include:f,signal:h})}catch{await Promise.race([new Promise(P=>setTimeout(P,2e3)),E])}}}async signAndExecuteTransaction({transaction:t,signer:e,additionalSignatures:s=[],...f}){let d;t instanceof Uint8Array?d=t:(t.setSenderIfNotSet(e.toSuiAddress()),d=await t.build({client:this}));const{signature:h}=await e.signTransaction(d);return this.executeTransaction({transaction:d,signatures:[h,...s],...f})}};const B7=new Intl.PluralRules("en-US",{type:"ordinal"}),k7=new Map([["one","st"],["two","nd"],["few","rd"],["other","th"]]);function T7(t){return`${t}${k7.get(B7.select(t))}`}function M8(t){const{command:e,location:s,abortCode:f,cleverError:d}=t,h=[];if(e!=null?h.push(`MoveAbort in ${T7(e+1)} command`):h.push("MoveAbort"),d?.constantName){const E=d.value?`'${d.constantName}': ${d.value}`:`'${d.constantName}'`;h.push(E)}else h.push(`abort code: ${f}`);if(s?.package&&s?.module){const E=[`in '${[s.package.startsWith("0x")?s.package:`0x${s.package}`,s.module,s.functionName].filter(Boolean).join("::")}'`];d?.lineNumber!=null?E.push(`(line ${d.lineNumber})`):s.instruction!=null&&E.push(`(instruction ${s.instruction})`),h.push(E.join(" "))}return h.join(", ")}const O8=jr.struct("MinimalEffectsWithError",{status:Mp}),C7=jr.enum("MinimalTransactionEffectsWithError",{V1:O8,V2:O8}),P7=jr.enum("MinimalExecutionStatusNoError",{Success:null,Failed:null}),R8=jr.struct("MinimalEffectsNoError",{status:P7}),M7=jr.enum("MinimalTransactionEffectsNoError",{V1:R8,V2:R8});function ra(t,e){return e!=null&&typeof e!="boolean"?`${t}(${JSON.stringify(e,(s,f)=>typeof f=="bigint"?f.toString():f)})`:t}function N8(t){const e=t.error,s=t.command!=null?Number(t.command):void 0;switch(e.$kind){case"MoveAbort":{const[f,d]=e.MoveAbort,h={package:f.module.address,module:f.module.name,function:f.function,functionName:f.functionName??void 0,instruction:f.instruction};return{$kind:"MoveAbort",message:M8({command:s,location:h,abortCode:String(d)}),command:s,MoveAbort:{abortCode:String(d),location:h}}}case"MoveObjectTooBig":return{$kind:"SizeError",message:ra("MoveObjectTooBig",e.MoveObjectTooBig),command:s,SizeError:{name:"ObjectTooBig",size:Number(e.MoveObjectTooBig.objectSize),maxSize:Number(e.MoveObjectTooBig.maxObjectSize)}};case"MovePackageTooBig":return{$kind:"SizeError",message:ra("MovePackageTooBig",e.MovePackageTooBig),command:s,SizeError:{name:"PackageTooBig",size:Number(e.MovePackageTooBig.objectSize),maxSize:Number(e.MovePackageTooBig.maxObjectSize)}};case"EffectsTooLarge":return{$kind:"SizeError",message:ra("EffectsTooLarge",e.EffectsTooLarge),command:s,SizeError:{name:"EffectsTooLarge",size:Number(e.EffectsTooLarge.currentSize),maxSize:Number(e.EffectsTooLarge.maxSize)}};case"WrittenObjectsTooLarge":return{$kind:"SizeError",message:ra("WrittenObjectsTooLarge",e.WrittenObjectsTooLarge),command:s,SizeError:{name:"WrittenObjectsTooLarge",size:Number(e.WrittenObjectsTooLarge.currentSize),maxSize:Number(e.WrittenObjectsTooLarge.maxSize)}};case"MoveVectorElemTooBig":return{$kind:"SizeError",message:ra("MoveVectorElemTooBig",e.MoveVectorElemTooBig),command:s,SizeError:{name:"MoveVectorElemTooBig",size:Number(e.MoveVectorElemTooBig.valueSize),maxSize:Number(e.MoveVectorElemTooBig.maxScaledSize)}};case"MoveRawValueTooBig":return{$kind:"SizeError",message:ra("MoveRawValueTooBig",e.MoveRawValueTooBig),command:s,SizeError:{name:"MoveRawValueTooBig",size:Number(e.MoveRawValueTooBig.valueSize),maxSize:Number(e.MoveRawValueTooBig.maxScaledSize)}};case"CommandArgumentError":return{$kind:"CommandArgumentError",message:ra("CommandArgumentError",e.CommandArgumentError),command:s,CommandArgumentError:{argument:e.CommandArgumentError.argIdx,name:e.CommandArgumentError.kind.$kind}};case"TypeArgumentError":return{$kind:"TypeArgumentError",message:ra("TypeArgumentError",e.TypeArgumentError),command:s,TypeArgumentError:{typeArgument:e.TypeArgumentError.argumentIdx,name:e.TypeArgumentError.kind.$kind}};case"PackageUpgradeError":{const f=e.PackageUpgradeError.upgradeError;return{$kind:"PackageUpgradeError",message:ra("PackageUpgradeError",e.PackageUpgradeError),command:s,PackageUpgradeError:{name:f.$kind,packageId:f.$kind==="UnableToFetchPackage"?f.UnableToFetchPackage.packageId:void 0,digest:f.$kind==="DigestDoesNotMatch"?Wi(f.DigestDoesNotMatch.digest):void 0}}}case"ExecutionCancelledDueToSharedObjectCongestion":return{$kind:"CongestedObjects",message:ra("ExecutionCancelledDueToSharedObjectCongestion",e.ExecutionCancelledDueToSharedObjectCongestion),command:s,CongestedObjects:{name:"ExecutionCanceledDueToConsensusObjectCongestion",objects:e.ExecutionCancelledDueToSharedObjectCongestion.congested_objects}};case"AddressDeniedForCoin":return{$kind:"CoinDenyListError",message:ra("AddressDeniedForCoin",e.AddressDeniedForCoin),command:s,CoinDenyListError:{name:"AddressDeniedForCoin",address:e.AddressDeniedForCoin.address,coinType:e.AddressDeniedForCoin.coinType}};case"CoinTypeGlobalPause":return{$kind:"CoinDenyListError",message:ra("CoinTypeGlobalPause",e.CoinTypeGlobalPause),command:s,CoinDenyListError:{name:"CoinTypeGlobalPause",coinType:e.CoinTypeGlobalPause.coinType}};case"CircularObjectOwnership":return{$kind:"ObjectIdError",message:ra("CircularObjectOwnership",e.CircularObjectOwnership),command:s,ObjectIdError:{name:"CircularObjectOwnership",objectId:e.CircularObjectOwnership.object}};case"InvalidGasObject":return{$kind:"ObjectIdError",message:"InvalidGasObject",command:s,ObjectIdError:{name:"InvalidGasObject",objectId:""}};case"InputObjectDeleted":return{$kind:"ObjectIdError",message:"InputObjectDeleted",command:s,ObjectIdError:{name:"InputObjectDeleted",objectId:""}};case"InvalidTransferObject":return{$kind:"ObjectIdError",message:"InvalidTransferObject",command:s,ObjectIdError:{name:"InvalidTransferObject",objectId:""}};case"NonExclusiveWriteInputObjectModified":return{$kind:"Unknown",message:ra("NonExclusiveWriteInputObjectModified",e.NonExclusiveWriteInputObjectModified),command:s,Unknown:null};case"InsufficientGas":case"InvariantViolation":case"FeatureNotYetSupported":case"InsufficientCoinBalance":case"CoinBalanceOverflow":case"PublishErrorNonZeroAddress":case"SuiMoveVerificationError":case"MovePrimitiveRuntimeError":case"VMVerificationOrDeserializationError":case"VMInvariantViolation":case"FunctionNotFound":case"ArityMismatch":case"TypeArityMismatch":case"NonEntryFunctionInvoked":case"UnusedValueWithoutDrop":case"InvalidPublicFunctionReturnType":case"PublishUpgradeMissingDependency":case"PublishUpgradeDependencyDowngrade":case"CertificateDenied":case"SuiMoveVerificationTimedout":case"SharedObjectOperationNotAllowed":case"ExecutionCancelledDueToRandomnessUnavailable":case"InvalidLinkage":case"InsufficientBalanceForWithdraw":return{$kind:"Unknown",message:e.$kind,command:s,Unknown:null};default:return{$kind:"Unknown",message:"Unknown error",command:s,Unknown:null}}}function O7(t,e=!1){return(e?Vc.fromKindBytes(t):Vc.fromBytes(t)).snapshot()}function rW(t){let e=null;try{e=C7.parse(t)}catch{const f=M7.parse(t);return(f.V1??f.V2).status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:{$kind:"Unknown",message:"ExecutionFailed",Unknown:null}}}const s=(e.V1??e.V2).status;return s.$kind==="Success"?{success:!0,error:null}:{success:!1,error:N8(s.Failure)}}function R7(t){const e=jr.TransactionEffects.parse(t);switch(e.$kind){case"V1":return N7({bytes:t,effects:e.V1});case"V2":return U7({bytes:t,effects:e.V2});default:throw new Error(`Unknown transaction effects version: ${e.$kind}`)}}function N7(t){throw new Error("V1 effects are not supported yet")}function U7({bytes:t,effects:e}){const s=e.changedObjects.map(([f,d])=>({objectId:f,inputState:d.inputState.$kind==="Exist"?"Exists":"DoesNotExist",inputVersion:d.inputState.Exist?.[0][0]??null,inputDigest:d.inputState.Exist?.[0][1]??null,inputOwner:d.inputState.Exist?.[1]??null,outputState:d.outputState.$kind==="NotExist"?"DoesNotExist":d.outputState.$kind,outputVersion:d.outputState.$kind==="PackageWrite"?d.outputState.PackageWrite?.[0]:d.outputState.$kind==="ObjectWrite"?e.lamportVersion:null,outputDigest:d.outputState.$kind==="PackageWrite"?d.outputState.PackageWrite?.[1]:d.outputState.$kind==="ObjectWrite"?d.outputState.ObjectWrite?.[0]??null:null,outputOwner:d.outputState.$kind==="ObjectWrite"?d.outputState.ObjectWrite[1]:null,idOperation:d.idOperation.$kind}));return{bcs:t,version:2,status:e.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:N8(e.status.Failure)},gasUsed:e.gasUsed,transactionDigest:e.transactionDigest,gasObject:e.gasObjectIndex===null?null:s[e.gasObjectIndex]??null,eventsDigest:e.eventsDigest,dependencies:e.dependencies,lamportVersion:e.lamportVersion,changedObjects:s,unchangedConsensusObjects:e.unchangedConsensusObjects.map(([f,d])=>({kind:d.$kind,objectId:f,version:d.$kind==="ReadOnlyRoot"?d.ReadOnlyRoot[0]:d[d.$kind],digest:d.$kind==="ReadOnlyRoot"?d.ReadOnlyRoot[1]:null})),auxiliaryDataDigest:e.auxDataDigest}}const D7=5e10;function U8(t,e){if(t.status==="success")return{success:!0,error:null};const s=t.error??"Unknown";if(e){const f=s.match(/in command (\d+)/),d=f?parseInt(f[1],10):void 0,h=s.match(/instruction:\s*(\d+)/),E=h?parseInt(h[1],10):void 0,P=e.module_id?.split("::")??[],R=P[0]?ni(P[0]):void 0,q=P[1];return{success:!1,error:{$kind:"MoveAbort",message:M8({command:d,location:R&&q?{package:R,module:q,functionName:e.function??void 0,instruction:E}:void 0,abortCode:String(e.error_code??0),cleverError:e.line!=null?{lineNumber:e.line}:void 0}),command:d,MoveAbort:{abortCode:String(e.error_code??0),location:e.module_id?{package:ni(e.module_id.split("::")[0]??""),module:e.module_id.split("::")[1]??"",functionName:e.function??void 0,instruction:E}:void 0}}}}return{success:!1,error:{$kind:"Unknown",message:s,Unknown:null}}}var L7=class extends I7{#e;constructor({jsonRpcClient:t,mvr:e}){super({network:t.network,base:t,mvr:e}),this.#e=t}async getObjects(t){const e=ll(t.objectIds,50),s=[];for(const f of e){const d=await this.#e.multiGetObjects({ids:f,options:{showOwner:!0,showType:!0,showBcs:!!(t.include?.content||t.include?.objectBcs),showPreviousTransaction:!!(t.include?.previousTransaction||t.include?.objectBcs),showStorageRebate:t.include?.objectBcs??!1,showContent:t.include?.json??!1,showDisplay:t.include?.display??!1},signal:t.signal});for(const[h,E]of d.entries())E.error?s.push(w8.fromResponse(E.error,f[h])):s.push(D8(E.data,t.include))}return{objects:s}}async listOwnedObjects(t){let e=null;if(t.type){const f=t.type.split("::");f.length===1?e={Package:t.type}:f.length===2?e={MoveModule:{package:f[0],module:f[1]}}:e={StructType:t.type}}const s=await this.#e.getOwnedObjects({owner:t.owner,limit:t.limit,cursor:t.cursor,options:{showOwner:!0,showType:!0,showBcs:!!(t.include?.content||t.include?.objectBcs),showPreviousTransaction:!!(t.include?.previousTransaction||t.include?.objectBcs),showStorageRebate:t.include?.objectBcs??!1,showContent:t.include?.json??!1,showDisplay:t.include?.display??!1},filter:e,signal:t.signal});return{objects:s.data.map(f=>{if(f.error)throw w8.fromResponse(f.error);return D8(f.data,t.include)}),hasNextPage:s.hasNextPage,cursor:s.nextCursor??null}}async listCoins(t){const e=await this.#e.getCoins({owner:t.owner,coinType:t.coinType,limit:t.limit,cursor:t.cursor,signal:t.signal});return{objects:e.data.map(s=>({objectId:s.coinObjectId,version:s.version,digest:s.digest,balance:s.balance,type:fs(`0x2::coin::Coin<${s.coinType}>`),owner:{$kind:"AddressOwner",AddressOwner:t.owner}})),hasNextPage:e.hasNextPage,cursor:e.nextCursor??null}}async getBalance(t){const e=await this.#e.getBalance({owner:t.owner,coinType:t.coinType,signal:t.signal}),s=e.fundsInAddressBalance??"0",f=String(BigInt(e.totalBalance)-BigInt(s));return{balance:{coinType:fs(e.coinType),balance:e.totalBalance,coinBalance:f,addressBalance:s}}}async getCoinMetadata(t){const e=(await this.mvr.resolveType({type:t.coinType})).type,s=await this.#e.getCoinMetadata({coinType:e,signal:t.signal});return s?{coinMetadata:{id:s.id??null,decimals:s.decimals,name:s.name,symbol:s.symbol,description:s.description,iconUrl:s.iconUrl??null}}:{coinMetadata:null}}async listBalances(t){return{balances:(await this.#e.getAllBalances({owner:t.owner,signal:t.signal})).map(e=>{const s=e.fundsInAddressBalance??"0",f=String(BigInt(e.totalBalance)-BigInt(s));return{coinType:fs(e.coinType),balance:e.totalBalance,coinBalance:f,addressBalance:s}}),hasNextPage:!1,cursor:null}}async getTransaction(t){return F8(await this.#e.getTransactionBlock({digest:t.digest,options:{showRawInput:!0,showEffects:!0,showObjectChanges:t.include?.objectTypes??!1,showRawEffects:t.include?.effects??!1,showEvents:t.include?.events??!1,showBalanceChanges:t.include?.balanceChanges??!1},signal:t.signal}),t.include)}async executeTransaction(t){return F8(await this.#e.executeTransactionBlock({transactionBlock:t.transaction,signature:t.signatures,options:{showRawInput:!0,showEffects:!0,showRawEffects:t.include?.effects??!1,showEvents:t.include?.events??!1,showObjectChanges:t.include?.objectTypes??!1,showBalanceChanges:t.include?.balanceChanges??!1},signal:t.signal}),t.include)}async simulateTransaction(t){t.transaction instanceof Uint8Array||await t.transaction.prepareForSerialization({client:this});const e=Q3.from(t.transaction),s=t.transaction instanceof Uint8Array?null:Vc.restore(t.transaction.getData()),f=s?s.build({overrides:{gasData:{budget:s.gasData.budget??String(D7),price:s.gasData.price??String(await this.#e.getReferenceGasPrice()),payment:s.gasData.payment??[]}}}):t.transaction,d=await this.#e.dryRunTransactionBlock({transactionBlock:f,signal:t.signal}),{effects:h,objectTypes:E}=z7({effects:d.effects,objectChanges:d.objectChanges}),P={digest:Vc.getDigestFromBytes(f),epoch:null,status:h.status,effects:t.include?.effects?h:void 0,objectTypes:t.include?.objectTypes?E:void 0,signatures:[],transaction:t.include?.transaction?O7(t.transaction instanceof Uint8Array?t.transaction:await t.transaction.build({client:this}).catch(()=>null)):void 0,bcs:t.include?.bcs?f:void 0,balanceChanges:t.include?.balanceChanges?d.balanceChanges.map(q=>({coinType:fs(q.coinType),address:L8(q.owner),amount:q.amount})):void 0,events:t.include?.events?d.events?.map(q=>({packageId:q.packageId,module:q.transactionModule,sender:q.sender,eventType:q.type,bcs:"bcs"in q?ls(q.bcs):new Uint8Array,json:q.parsedJson??null}))??[]:void 0};let R;if(t.include?.commandResults)try{const q=e.getData().sender??ni("0x0"),te=await this.#e.devInspectTransactionBlock({sender:q,transactionBlock:e,signal:t.signal});te.results&&(R=te.results.map(ne=>({returnValues:(ne.returnValues??[]).map(([ue])=>({bcs:new Uint8Array(ue)})),mutatedReferences:(ne.mutableReferenceOutputs??[]).map(([,ue])=>({bcs:new Uint8Array(ue)}))})))}catch{}return h.status.success?{$kind:"Transaction",Transaction:P,commandResults:R}:{$kind:"FailedTransaction",FailedTransaction:P,commandResults:R}}async getReferenceGasPrice(t){const e=await this.#e.getReferenceGasPrice({signal:t?.signal});return{referenceGasPrice:String(e)}}async getCurrentSystemState(t){const e=await this.#e.getLatestSuiSystemState({signal:t?.signal});return{systemState:{systemStateVersion:e.systemStateVersion,epoch:e.epoch,protocolVersion:e.protocolVersion,referenceGasPrice:e.referenceGasPrice?.toString()??null,epochStartTimestampMs:e.epochStartTimestampMs,safeMode:e.safeMode,safeModeStorageRewards:e.safeModeStorageRewards,safeModeComputationRewards:e.safeModeComputationRewards,safeModeStorageRebates:e.safeModeStorageRebates,safeModeNonRefundableStorageFee:e.safeModeNonRefundableStorageFee,parameters:{epochDurationMs:e.epochDurationMs,stakeSubsidyStartEpoch:e.stakeSubsidyStartEpoch,maxValidatorCount:e.maxValidatorCount,minValidatorJoiningStake:e.minValidatorJoiningStake,validatorLowStakeThreshold:e.validatorLowStakeThreshold,validatorLowStakeGracePeriod:e.validatorLowStakeGracePeriod},storageFund:{totalObjectStorageRebates:e.storageFundTotalObjectStorageRebates,nonRefundableBalance:e.storageFundNonRefundableBalance},stakeSubsidy:{balance:e.stakeSubsidyBalance,distributionCounter:e.stakeSubsidyDistributionCounter,currentDistributionAmount:e.stakeSubsidyCurrentDistributionAmount,stakeSubsidyPeriodLength:e.stakeSubsidyPeriodLength,stakeSubsidyDecreaseRate:e.stakeSubsidyDecreaseRate}}}}async listDynamicFields(t){const e=await this.#e.getDynamicFields({parentId:t.parentId,limit:t.limit,cursor:t.cursor});return{dynamicFields:e.data.map(s=>{const f=s.type==="DynamicObject",d=f?`0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${s.name.type}>, 0x2::object::ID>`:`0x2::dynamic_field::Field<${s.name.type}, ${s.objectType}>`,h=ls(s.bcsName),E=f?`0x2::dynamic_object_field::Wrapper<${s.name.type}>`:s.name.type;return{$kind:f?"DynamicObject":"DynamicField",fieldId:P8(t.parentId,E,h),type:fs(d),name:{type:s.name.type,bcs:h},valueType:s.objectType,childId:f?s.objectId:void 0}}),hasNextPage:e.hasNextPage,cursor:e.nextCursor}}async verifyZkLoginSignature(t){const e=await this.#e.verifyZkLoginSignature({bytes:t.bytes,signature:t.signature,intentScope:t.intentScope,author:t.address});return{success:e.success,errors:e.errors}}async defaultNameServiceName(t){return{data:{name:(await this.#e.resolveNameServiceNames(t)).data[0]}}}resolveTransactionPlugin(){return A8}async getMoveFunction(t){const e=(await this.mvr.resolvePackage({package:t.packageId})).package,s=await this.#e.getNormalizedMoveFunction({package:e,module:t.moduleName,function:t.name});return{function:{packageId:ni(e),moduleName:t.moduleName,name:t.name,visibility:K7(s.visibility),isEntry:s.isEntry,typeParameters:s.typeParameters.map(f=>({isPhantom:!1,constraints:H7(f)})),parameters:s.parameters.map(f=>j8(f)),returns:s.return.map(f=>j8(f))}}}async getChainIdentifier(t){return this.cache.read(["chainIdentifier"],async()=>({chainIdentifier:(await this.#e.getCheckpoint({id:"0"})).digest}))}};function F7(t){if(t.bcs?.dataType==="moveObject")try{const e=fs(t.bcs.type);let s;const f=ni(mh),d=fs(`${mh}::coin::Coin<${mh}::sui::SUI>`),h=fs(`${X9}::staking_pool::StakedSui`),E=`${f}::coin::Coin<`;if(e===d)s={GasCoin:null};else if(e===h)s={StakedSui:null};else if(e.startsWith(E)){const q=e.match(new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}::coin::Coin<(.+)>$`));if(q)s={Coin:ta.parseFromStr(q[1],!0)};else throw new Error("Failed to parse Coin type")}else{const q=ta.parseFromStr(e,!0);if(typeof q!="object"||!("struct"in q))throw new Error("Expected struct type tag");s={Other:q.struct}}const P=ls(t.bcs.bcsBytes),R=j7(t.owner);return jr.Object.serialize({data:{Move:{type:s,hasPublicTransfer:t.bcs.hasPublicTransfer,version:t.bcs.version,contents:P}},owner:R,previousTransaction:t.previousTransaction,storageRebate:t.storageRebate}).toBytes()}catch{return}}function D8(t,e){const s=t.bcs?.dataType==="moveObject"?ls(t.bcs.bcsBytes):void 0,f=e?.objectBcs?F7(t):void 0,d=t.type&&t.type.includes("::")?fs(t.type):t.type??"",h=e?.json&&t.content?.dataType==="moveObject"?t.content.fields:e?.json?null:void 0,E=e?.display?t.display?.data!=null?{output:t.display.data,errors:null}:null:void 0;return{objectId:t.objectId,version:t.version,digest:t.digest,type:d,content:e?.content?s:void 0,owner:bh(t.owner),previousTransaction:e?.previousTransaction?t.previousTransaction??void 0:void 0,objectBcs:f,json:h,display:E}}function bh(t){if(t==="Immutable")return{$kind:"Immutable",Immutable:!0};if("ConsensusAddressOwner"in t)return{$kind:"ConsensusAddressOwner",ConsensusAddressOwner:{owner:t.ConsensusAddressOwner.owner,startVersion:t.ConsensusAddressOwner.start_version}};if("AddressOwner"in t)return{$kind:"AddressOwner",AddressOwner:t.AddressOwner};if("ObjectOwner"in t)return{$kind:"ObjectOwner",ObjectOwner:t.ObjectOwner};if("Shared"in t)return{$kind:"Shared",Shared:{initialSharedVersion:t.Shared.initial_shared_version}};throw new Error(`Unknown owner type: ${JSON.stringify(t)}`)}function j7(t){if(t==="Immutable")return{Immutable:null};if("AddressOwner"in t)return{AddressOwner:t.AddressOwner};if("ObjectOwner"in t)return{ObjectOwner:t.ObjectOwner};if("Shared"in t)return{Shared:{initialSharedVersion:t.Shared.initial_shared_version}};if(typeof t=="object"&&t!==null&&"ConsensusAddressOwner"in t)return{ConsensusAddressOwner:{startVersion:t.ConsensusAddressOwner.start_version,owner:t.ConsensusAddressOwner.owner}};throw new Error(`Unknown owner type: ${JSON.stringify(t)}`)}function L8(t){if(t==="Immutable")return null;if("ConsensusAddressOwner"in t)return t.ConsensusAddressOwner.owner;if("AddressOwner"in t)return t.AddressOwner;if("ObjectOwner"in t)return t.ObjectOwner;if("Shared"in t)return null;throw new Error(`Unknown owner type: ${JSON.stringify(t)}`)}function F8(t,e){const s={};e?.objectTypes&&t.objectChanges?.forEach(q=>{q.type!=="published"&&(s[q.objectId]=fs(q.objectType))});let f,d=[],h;if(t.rawTransaction){const q=jr.SenderSignedData.parse(ls(t.rawTransaction))[0];if(d=q.txSignatures,e?.transaction||e?.bcs){const te=jr.TransactionData.serialize(q.intentMessage.value).toBytes();e?.bcs&&(h=te),e?.transaction&&(f={...Vc.restore({version:2,sender:q.intentMessage.value.V1.sender,expiration:q.intentMessage.value.V1.expiration,gasData:q.intentMessage.value.V1.gasData,inputs:q.intentMessage.value.V1.kind.ProgrammableTransaction.inputs,commands:q.intentMessage.value.V1.kind.ProgrammableTransaction.commands})})}}const E=t.effects?.status?U8(t.effects.status,t.effects.abortError):{success:!1,error:{$kind:"Unknown",message:"Unknown",Unknown:null}},P=t.rawEffects?new Uint8Array(t.rawEffects):null,R={digest:t.digest,epoch:t.effects?.executedEpoch??null,status:E,effects:e?.effects&&P?R7(P):void 0,objectTypes:e?.objectTypes?s:void 0,transaction:f,bcs:h,signatures:d,balanceChanges:e?.balanceChanges?t.balanceChanges?.map(q=>({coinType:fs(q.coinType),address:L8(q.owner),amount:q.amount}))??[]:void 0,events:e?.events?t.events?.map(q=>({packageId:q.packageId,module:q.transactionModule,sender:q.sender,eventType:q.type,bcs:"bcs"in q?ls(q.bcs):new Uint8Array,json:q.parsedJson??null}))??[]:void 0};return E.success?{$kind:"Transaction",Transaction:R}:{$kind:"FailedTransaction",FailedTransaction:R}}function z7({bytes:t,effects:e,objectChanges:s}){const f=[],d=[],h={};return s?.forEach(E=>{switch(E.type){case"published":f.push({objectId:E.packageId,inputState:"DoesNotExist",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"PackageWrite",outputVersion:E.version,outputDigest:E.digest,outputOwner:null,idOperation:"Created"});break;case"transferred":f.push({objectId:E.objectId,inputState:"Exists",inputVersion:E.version,inputDigest:E.digest,inputOwner:{$kind:"AddressOwner",AddressOwner:E.sender},outputState:"ObjectWrite",outputVersion:E.version,outputDigest:E.digest,outputOwner:bh(E.recipient),idOperation:"None"}),h[E.objectId]=fs(E.objectType);break;case"mutated":f.push({objectId:E.objectId,inputState:"Exists",inputVersion:E.previousVersion,inputDigest:null,inputOwner:bh(E.owner),outputState:"ObjectWrite",outputVersion:E.version,outputDigest:E.digest,outputOwner:bh(E.owner),idOperation:"None"}),h[E.objectId]=fs(E.objectType);break;case"deleted":f.push({objectId:E.objectId,inputState:"Exists",inputVersion:E.version,inputDigest:e.deleted?.find(P=>P.objectId===E.objectId)?.digest??null,inputOwner:null,outputState:"DoesNotExist",outputVersion:null,outputDigest:null,outputOwner:null,idOperation:"Deleted"}),h[E.objectId]=fs(E.objectType);break;case"wrapped":f.push({objectId:E.objectId,inputState:"Exists",inputVersion:E.version,inputDigest:null,inputOwner:{$kind:"AddressOwner",AddressOwner:E.sender},outputState:"ObjectWrite",outputVersion:E.version,outputDigest:e.wrapped?.find(P=>P.objectId===E.objectId)?.digest??null,outputOwner:{$kind:"ObjectOwner",ObjectOwner:E.sender},idOperation:"None"}),h[E.objectId]=fs(E.objectType);break;case"created":f.push({objectId:E.objectId,inputState:"DoesNotExist",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"ObjectWrite",outputVersion:E.version,outputDigest:E.digest,outputOwner:bh(E.owner),idOperation:"Created"}),h[E.objectId]=fs(E.objectType);break}}),{objectTypes:h,effects:{bcs:t??null,version:2,status:U8(e.status,e.abortError),gasUsed:e.gasUsed,transactionDigest:e.transactionDigest,gasObject:{objectId:e.gasObject?.reference.objectId,inputState:"Exists",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"ObjectWrite",outputVersion:e.gasObject.reference.version,outputDigest:e.gasObject.reference.digest,outputOwner:bh(e.gasObject.owner),idOperation:"None"},eventsDigest:e.eventsDigest??null,dependencies:e.dependencies??[],lamportVersion:e.gasObject.reference.version,changedObjects:f,unchangedConsensusObjects:d,auxiliaryDataDigest:null}}}function j8(t){if(typeof t!="string"){if("Reference"in t)return{reference:"immutable",body:zp(t.Reference)};if("MutableReference"in t)return{reference:"mutable",body:zp(t.MutableReference)}}return{reference:null,body:zp(t)}}function zp(t){switch(t){case"Address":return{$kind:"address"};case"Bool":return{$kind:"bool"};case"U8":return{$kind:"u8"};case"U16":return{$kind:"u16"};case"U32":return{$kind:"u32"};case"U64":return{$kind:"u64"};case"U128":return{$kind:"u128"};case"U256":return{$kind:"u256"}}if(typeof t=="string")throw new Error(`Unknown type: ${t}`);if("Vector"in t)return{$kind:"vector",vector:zp(t.Vector)};if("Struct"in t)return{$kind:"datatype",datatype:{typeName:`${ni(t.Struct.address)}::${t.Struct.module}::${t.Struct.name}`,typeParameters:t.Struct.typeArguments.map(e=>zp(e))}};if("TypeParameter"in t)return{$kind:"typeParameter",index:t.TypeParameter};throw new Error(`Unknown type: ${JSON.stringify(t)}`)}function H7(t){return t.abilities.map(e=>{switch(e){case"Copy":return"copy";case"Drop":return"drop";case"Store":return"store";case"Key":return"key";default:return"unknown"}})}function K7(t){switch(t){case"Public":return"public";case"Private":return"private";case"Friend":return"friend";default:return"unknown"}}const z8=Symbol.for("@mysten/SuiJsonRpcClient"),$7=new Uint8Array([172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172]);function H8(t){return ba(t).slice(12,32).every((e,s)=>e===$7[s])}function iW(t){return typeof t=="object"&&t!==null&&t[z8]===!0}var pb=class extends yy{get[z8](){return!0}constructor(t){super({network:t.network}),this.jsonRpc=this,this.transport=t.transport??new Zs({url:t.url}),this.core=new L7({jsonRpcClient:this,mvr:t.mvr})}async getRpcApiVersion({signal:t}={}){return(await this.transport.request({method:"rpc.discover",params:[],signal:t})).info.version}async getCoins({coinType:t,owner:e,cursor:s,limit:f,signal:d}){if(!e||!Do(ni(e)))throw new Error("Invalid Sui address");t&&Ds(t)&&(t=(await this.core.mvr.resolveType({type:t})).type);const h=await this.transport.request({method:"suix_getCoins",params:[e,t,s,f],signal:d});return{...h,data:h.data.filter(E=>!H8(E.digest))}}async getAllCoins(t){if(!t.owner||!Do(ni(t.owner)))throw new Error("Invalid Sui address");const e=await this.transport.request({method:"suix_getAllCoins",params:[t.owner,t.cursor,t.limit],signal:t.signal});return{...e,data:e.data.filter(s=>!H8(s.digest))}}async getBalance({owner:t,coinType:e,signal:s}){if(!t||!Do(ni(t)))throw new Error("Invalid Sui address");return e&&Ds(e)&&(e=(await this.core.mvr.resolveType({type:e})).type),await this.transport.request({method:"suix_getBalance",params:[t,e],signal:s})}async getAllBalances(t){if(!t.owner||!Do(ni(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getAllBalances",params:[t.owner],signal:t.signal})}async getCoinMetadata({coinType:t,signal:e}){return t&&Ds(t)&&(t=(await this.core.mvr.resolveType({type:t})).type),await this.transport.request({method:"suix_getCoinMetadata",params:[t],signal:e})}async getTotalSupply({coinType:t,signal:e}){return t&&Ds(t)&&(t=(await this.core.mvr.resolveType({type:t})).type),await this.transport.request({method:"suix_getTotalSupply",params:[t],signal:e})}async call(t,e,{signal:s}={}){return await this.transport.request({method:t,params:e,signal:s})}async getMoveFunctionArgTypes({package:t,module:e,function:s,signal:f}){return t&&xo(t)&&(t=(await this.core.mvr.resolvePackage({package:t})).package),await this.transport.request({method:"sui_getMoveFunctionArgTypes",params:[t,e,s],signal:f})}async getNormalizedMoveModulesByPackage({package:t,signal:e}){return t&&xo(t)&&(t=(await this.core.mvr.resolvePackage({package:t})).package),await this.transport.request({method:"sui_getNormalizedMoveModulesByPackage",params:[t],signal:e})}async getNormalizedMoveModule({package:t,module:e,signal:s}){return t&&xo(t)&&(t=(await this.core.mvr.resolvePackage({package:t})).package),await this.transport.request({method:"sui_getNormalizedMoveModule",params:[t,e],signal:s})}async getNormalizedMoveFunction({package:t,module:e,function:s,signal:f}){return t&&xo(t)&&(t=(await this.core.mvr.resolvePackage({package:t})).package),await this.transport.request({method:"sui_getNormalizedMoveFunction",params:[t,e,s],signal:f})}async getNormalizedMoveStruct({package:t,module:e,struct:s,signal:f}){return t&&xo(t)&&(t=(await this.core.mvr.resolvePackage({package:t})).package),await this.transport.request({method:"sui_getNormalizedMoveStruct",params:[t,e,s],signal:f})}async getOwnedObjects(t){if(!t.owner||!Do(ni(t.owner)))throw new Error("Invalid Sui address");const e=t.filter?{...t.filter}:void 0;return e&&"MoveModule"in e&&xo(e.MoveModule.package)?e.MoveModule={module:e.MoveModule.module,package:(await this.core.mvr.resolvePackage({package:e.MoveModule.package})).package}:e&&"StructType"in e&&Ds(e.StructType)&&(e.StructType=(await this.core.mvr.resolveType({type:e.StructType})).type),await this.transport.request({method:"suix_getOwnedObjects",params:[t.owner,{filter:e,options:t.options},t.cursor,t.limit],signal:t.signal})}async getObject(t){if(!t.id||!gt(wu(t.id)))throw new Error("Invalid Sui Object id");return await this.transport.request({method:"sui_getObject",params:[t.id,t.options],signal:t.signal})}async tryGetPastObject(t){return await this.transport.request({method:"sui_tryGetPastObject",params:[t.id,t.version,t.options],signal:t.signal})}async multiGetObjects(t){if(t.ids.forEach(e=>{if(!e||!gt(wu(e)))throw new Error(`Invalid Sui Object id ${e}`)}),t.ids.length!==new Set(t.ids).size)throw new Error(`Duplicate object ids in batch call ${t.ids}`);return await this.transport.request({method:"sui_multiGetObjects",params:[t.ids,t.options],signal:t.signal})}async queryTransactionBlocks({filter:t,options:e,cursor:s,limit:f,order:d,signal:h}){return t&&"MoveFunction"in t&&xo(t.MoveFunction.package)&&(t={...t,MoveFunction:{package:(await this.core.mvr.resolvePackage({package:t.MoveFunction.package})).package}}),await this.transport.request({method:"suix_queryTransactionBlocks",params:[{filter:t,options:e},s,f,(d||"descending")==="descending"],signal:h})}async getTransactionBlock(t){if(!wf(t.digest))throw new Error("Invalid Transaction digest");return await this.transport.request({method:"sui_getTransactionBlock",params:[t.digest,t.options],signal:t.signal})}async multiGetTransactionBlocks(t){if(t.digests.forEach(e=>{if(!wf(e))throw new Error(`Invalid Transaction digest ${e}`)}),t.digests.length!==new Set(t.digests).size)throw new Error(`Duplicate digests in batch call ${t.digests}`);return await this.transport.request({method:"sui_multiGetTransactionBlocks",params:[t.digests,t.options],signal:t.signal})}async executeTransactionBlock({transactionBlock:t,signature:e,options:s,signal:f}){return await this.transport.request({method:"sui_executeTransactionBlock",params:[typeof t=="string"?t:Wi(t),Array.isArray(e)?e:[e],s],signal:f})}async signAndExecuteTransaction({transaction:t,signer:e,...s}){let f;t instanceof Uint8Array?f=t:(t.setSenderIfNotSet(e.toSuiAddress()),f=await t.build({client:this}));const{signature:d,bytes:h}=await e.signTransaction(f);return this.executeTransactionBlock({transactionBlock:h,signature:d,...s})}async getTotalTransactionBlocks({signal:t}={}){const e=await this.transport.request({method:"sui_getTotalTransactionBlocks",params:[],signal:t});return BigInt(e)}async getReferenceGasPrice({signal:t}={}){const e=await this.transport.request({method:"suix_getReferenceGasPrice",params:[],signal:t});return BigInt(e)}async getStakes(t){if(!t.owner||!Do(ni(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getStakes",params:[t.owner],signal:t.signal})}async getStakesByIds(t){return t.stakedSuiIds.forEach(e=>{if(!e||!gt(wu(e)))throw new Error(`Invalid Sui Stake id ${e}`)}),await this.transport.request({method:"suix_getStakesByIds",params:[t.stakedSuiIds],signal:t.signal})}async getLatestSuiSystemState({signal:t}={}){return await this.transport.request({method:"suix_getLatestSuiSystemState",params:[],signal:t})}async queryEvents({query:t,cursor:e,limit:s,order:f,signal:d}){return t&&"MoveEventType"in t&&Ds(t.MoveEventType)&&(t={...t,MoveEventType:(await this.core.mvr.resolveType({type:t.MoveEventType})).type}),t&&"MoveEventModule"in t&&xo(t.MoveEventModule.package)&&(t={...t,MoveEventModule:{module:t.MoveEventModule.module,package:(await this.core.mvr.resolvePackage({package:t.MoveEventModule.package})).package}}),"MoveModule"in t&&xo(t.MoveModule.package)&&(t={...t,MoveModule:{module:t.MoveModule.module,package:(await this.core.mvr.resolvePackage({package:t.MoveModule.package})).package}}),await this.transport.request({method:"suix_queryEvents",params:[t,e,s,(f||"descending")==="descending"],signal:d})}async devInspectTransactionBlock(t){let e;if(C8(t.transactionBlock))t.transactionBlock.setSenderIfNotSet(t.sender),e=Wi(await t.transactionBlock.build({client:this,onlyTransactionKind:!0}));else if(typeof t.transactionBlock=="string")e=t.transactionBlock;else if(t.transactionBlock instanceof Uint8Array)e=Wi(t.transactionBlock);else throw new Error("Unknown transaction block format.");return t.signal?.throwIfAborted(),await this.transport.request({method:"sui_devInspectTransactionBlock",params:[t.sender,e,t.gasPrice?.toString(),t.epoch],signal:t.signal})}async dryRunTransactionBlock(t){return await this.transport.request({method:"sui_dryRunTransactionBlock",params:[typeof t.transactionBlock=="string"?t.transactionBlock:Wi(t.transactionBlock)]})}async getDynamicFields(t){if(!t.parentId||!gt(wu(t.parentId)))throw new Error("Invalid Sui Object id");return await this.transport.request({method:"suix_getDynamicFields",params:[t.parentId,t.cursor,t.limit],signal:t.signal})}async getDynamicFieldObject(t){return await this.transport.request({method:"suix_getDynamicFieldObject",params:[t.parentId,t.name],signal:t.signal})}async getLatestCheckpointSequenceNumber({signal:t}={}){const e=await this.transport.request({method:"sui_getLatestCheckpointSequenceNumber",params:[],signal:t});return String(e)}async getCheckpoint(t){return await this.transport.request({method:"sui_getCheckpoint",params:[t.id],signal:t.signal})}async getCheckpoints(t){return await this.transport.request({method:"sui_getCheckpoints",params:[t.cursor,t?.limit,t.descendingOrder],signal:t.signal})}async getCommitteeInfo(t){return await this.transport.request({method:"suix_getCommitteeInfo",params:[t?.epoch],signal:t?.signal})}async getNetworkMetrics({signal:t}={}){return await this.transport.request({method:"suix_getNetworkMetrics",params:[],signal:t})}async getAddressMetrics({signal:t}={}){return await this.transport.request({method:"suix_getLatestAddressMetrics",params:[],signal:t})}async getEpochMetrics(t){return await this.transport.request({method:"suix_getEpochMetrics",params:[t?.cursor,t?.limit,t?.descendingOrder],signal:t?.signal})}async getAllEpochAddressMetrics(t){return await this.transport.request({method:"suix_getAllEpochAddressMetrics",params:[t?.descendingOrder],signal:t?.signal})}async getEpochs(t){return await this.transport.request({method:"suix_getEpochs",params:[t?.cursor,t?.limit,t?.descendingOrder],signal:t?.signal})}async getMoveCallMetrics({signal:t}={}){return await this.transport.request({method:"suix_getMoveCallMetrics",params:[],signal:t})}async getCurrentEpoch({signal:t}={}){return await this.transport.request({method:"suix_getCurrentEpoch",params:[],signal:t})}async getValidatorsApy({signal:t}={}){return await this.transport.request({method:"suix_getValidatorsApy",params:[],signal:t})}async getChainIdentifier({signal:t}={}){return Cc(ba((await this.getCheckpoint({id:"0",signal:t})).digest).slice(0,4))}async resolveNameServiceAddress(t){return await this.transport.request({method:"suix_resolveNameServiceAddress",params:[t.name],signal:t.signal})}async resolveNameServiceNames({format:t="dot",...e}){const{nextCursor:s,hasNextPage:f,data:d}=await this.transport.request({method:"suix_resolveNameServiceNames",params:[e.address,e.cursor,e.limit],signal:e.signal});return{hasNextPage:f,nextCursor:s,data:d.map(h=>il(h,t))}}async getProtocolConfig(t){return await this.transport.request({method:"sui_getProtocolConfig",params:[t?.version],signal:t?.signal})}async verifyZkLoginSignature(t){return await this.transport.request({method:"sui_verifyZkLoginSignature",params:[t.bytes,t.signature,t.intentScope,t.author],signal:t.signal})}async waitForTransaction({signal:t,timeout:e=60*1e3,pollInterval:s=2*1e3,...f}){const d=AbortSignal.timeout(e),h=new Promise((E,P)=>{d.addEventListener("abort",()=>P(d.reason))});for(h.catch(()=>{});!d.aborted;){t?.throwIfAborted();try{return await this.getTransactionBlock(f)}catch{await Promise.race([new Promise(E=>setTimeout(E,s)),h])}}throw d.throwIfAborted(),new Error("Unexpected error while waiting for transaction block.")}};function gb(t){switch(t){case"mainnet":return"https://fullnode.mainnet.sui.io:443";case"testnet":return"https://fullnode.testnet.sui.io:443";case"devnet":return"https://fullnode.devnet.sui.io:443";case"localnet":return"http://127.0.0.1:9000";default:throw new Error(`Unknown network: ${t}`)}}class K8{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,s){if(K(e),M(s,void 0,"key"),this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const f=this.blockLen,d=new Uint8Array(f);d.set(s.length>f?e.create().update(s).digest():s);for(let h=0;h<d.length;h++)d[h]^=54;this.iHash.update(d),this.oHash=e.create();for(let h=0;h<d.length;h++)d[h]^=106;this.oHash.update(d),jt(d)}update(e){return ae(this),this.iHash.update(e),this}digestInto(e){ae(this),M(e,this.outputLen,"output"),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});const{oHash:s,iHash:f,finished:d,destroyed:h,blockLen:E,outputLen:P}=this;return e=e,e.finished=d,e.destroyed=h,e.blockLen=E,e.outputLen=P,e.oHash=s._cloneInto(e.oHash),e.iHash=f._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const yb=(t,e,s)=>new K8(t,e).update(s).digest();yb.create=(t,e)=>new K8(t,e);function $8(t,e,s,f){K(t);const d=k9({dkLen:32,asyncTick:10},f),{c:h,dkLen:E,asyncTick:P}=d;if(Sa(h,"c"),Sa(E,"dkLen"),Sa(P,"asyncTick"),h<1)throw new Error("iterations (c) must be >= 1");const R=Fa(e,"password"),q=Fa(s,"salt"),te=new Uint8Array(E),ne=yb.create(t,R),ue=ne._cloneInto().update(q);return{c:h,dkLen:E,asyncTick:P,DK:te,PRF:ne,PRFSalt:ue}}function V8(t,e,s,f,d){return t.destroy(),e.destroy(),f&&f.destroy(),jt(d),s}function V7(t,e,s,f){const{c:d,dkLen:h,DK:E,PRF:P,PRFSalt:R}=$8(t,e,s,f);let q;const te=new Uint8Array(4),ne=Xt(te),ue=new Uint8Array(P.outputLen);for(let ge=1,xe=0;xe<h;ge++,xe+=P.outputLen){const pe=E.subarray(xe,xe+P.outputLen);ne.setInt32(0,ge,!1),(q=R._cloneInto(q)).update(te).digestInto(ue),pe.set(ue.subarray(0,pe.length));for(let Se=1;Se<d;Se++){P._cloneInto(q).update(ue).digestInto(ue);for(let Ce=0;Ce<pe.length;Ce++)pe[Ce]^=ue[Ce]}}return V8(P,R,E,q,ue)}async function sW(t,e,s,f){const{c:d,dkLen:h,asyncTick:E,DK:P,PRF:R,PRFSalt:q}=$8(t,e,s,f);let te;const ne=new Uint8Array(4),ue=createView(ne),ge=new Uint8Array(R.outputLen);for(let xe=1,pe=0;pe<h;xe++,pe+=R.outputLen){const Se=P.subarray(pe,pe+R.outputLen);ue.setInt32(0,xe,!1),(te=q._cloneInto(te)).update(ne).digestInto(ge),Se.set(ge.subarray(0,Se.length)),await asyncLoop(d-1,E,()=>{R._cloneInto(te).update(ge).digestInto(ge);for(let Ce=0;Ce<Se.length;Ce++)Se[Ce]^=ge[Ce]})}return V8(R,q,P,te,ge)}const W7=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]),Tl=new Uint32Array(64);class W8 extends h8{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:s,C:f,D:d,E:h,F:E,G:P,H:R}=this;return[e,s,f,d,h,E,P,R]}set(e,s,f,d,h,E,P,R){this.A=e|0,this.B=s|0,this.C=f|0,this.D=d|0,this.E=h|0,this.F=E|0,this.G=P|0,this.H=R|0}process(e,s){for(let ne=0;ne<16;ne++,s+=4)Tl[ne]=e.getUint32(s,!1);for(let ne=16;ne<64;ne++){const ue=Tl[ne-15],ge=Tl[ne-2],xe=tn(ue,7)^tn(ue,18)^ue>>>3,pe=tn(ge,17)^tn(ge,19)^ge>>>10;Tl[ne]=pe+Tl[ne-7]+xe+Tl[ne-16]|0}let{A:f,B:d,C:h,D:E,E:P,F:R,G:q,H:te}=this;for(let ne=0;ne<64;ne++){const ue=tn(P,6)^tn(P,11)^tn(P,25),ge=te+ue+P9(P,R,q)+W7[ne]+Tl[ne]|0,pe=(tn(f,2)^tn(f,13)^tn(f,22))+M9(f,d,h)|0;te=q,q=R,R=P,P=E+ge|0,E=h,h=d,d=f,f=ge+pe|0}f=f+this.A|0,d=d+this.B|0,h=h+this.C|0,E=E+this.D|0,P=P+this.E|0,R=R+this.F|0,q=q+this.G|0,te=te+this.H|0,this.set(f,d,h,E,P,R,q,te)}roundClean(){jt(Tl)}destroy(){this.set(0,0,0,0,0,0,0,0),jt(this.buffer)}}class oW extends W8{A=Bu[0]|0;B=Bu[1]|0;C=Bu[2]|0;D=Bu[3]|0;E=Bu[4]|0;F=Bu[5]|0;G=Bu[6]|0;H=Bu[7]|0;constructor(){super(32)}}class aW extends W8{A=Al[0]|0;B=Al[1]|0;C=Al[2]|0;D=Al[3]|0;E=Al[4]|0;F=Al[5]|0;G=Al[6]|0;H=Al[7]|0;constructor(){super(28)}}const G8=O9(["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(t=>BigInt(t))),G7=G8[0],q7=G8[1],Cl=new Uint32Array(80),Pl=new Uint32Array(80);class mb extends h8{constructor(e){super(128,e,16,!1)}get(){const{Ah:e,Al:s,Bh:f,Bl:d,Ch:h,Cl:E,Dh:P,Dl:R,Eh:q,El:te,Fh:ne,Fl:ue,Gh:ge,Gl:xe,Hh:pe,Hl:Se}=this;return[e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se]}set(e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se){this.Ah=e|0,this.Al=s|0,this.Bh=f|0,this.Bl=d|0,this.Ch=h|0,this.Cl=E|0,this.Dh=P|0,this.Dl=R|0,this.Eh=q|0,this.El=te|0,this.Fh=ne|0,this.Fl=ue|0,this.Gh=ge|0,this.Gl=xe|0,this.Hh=pe|0,this.Hl=Se|0}process(e,s){for(let We=0;We<16;We++,s+=4)Cl[We]=e.getUint32(s),Pl[We]=e.getUint32(s+=4);for(let We=16;We<80;We++){const xt=Cl[We-15]|0,kt=Pl[We-15]|0,Bt=xl(xt,kt,1)^xl(xt,kt,8)^p8(xt,kt,7),Wt=Il(xt,kt,1)^Il(xt,kt,8)^g8(xt,kt,7),Me=Cl[We-2]|0,Ke=Pl[We-2]|0,nt=xl(Me,Ke,19)^Np(Me,Ke,61)^p8(Me,Ke,6),Tt=Il(Me,Ke,19)^Up(Me,Ke,61)^g8(Me,Ke,6),pt=U9(Wt,Tt,Pl[We-7],Pl[We-16]),Ht=D9(pt,Bt,nt,Cl[We-7],Cl[We-16]);Cl[We]=Ht|0,Pl[We]=pt|0}let{Ah:f,Al:d,Bh:h,Bl:E,Ch:P,Cl:R,Dh:q,Dl:te,Eh:ne,El:ue,Fh:ge,Fl:xe,Gh:pe,Gl:Se,Hh:Ce,Hl:Fe}=this;for(let We=0;We<80;We++){const xt=xl(ne,ue,14)^xl(ne,ue,18)^Np(ne,ue,41),kt=Il(ne,ue,14)^Il(ne,ue,18)^Up(ne,ue,41),Bt=ne&ge^~ne&pe,Wt=ue&xe^~ue&Se,Me=L9(Fe,kt,Wt,q7[We],Pl[We]),Ke=F9(Me,Ce,xt,Bt,G7[We],Cl[We]),nt=Me|0,Tt=xl(f,d,28)^Np(f,d,34)^Np(f,d,39),pt=Il(f,d,28)^Up(f,d,34)^Up(f,d,39),Ht=f&h^f&P^h&P,lt=d&E^d&R^E&R;Ce=pe|0,Fe=Se|0,pe=ge|0,Se=xe|0,ge=ne|0,xe=ue|0,{h:ne,l:ue}=fc(q|0,te|0,Ke|0,nt|0),q=P|0,te=R|0,P=h|0,R=E|0,h=f|0,E=d|0;const rt=Z3(nt,pt,lt);f=X3(rt,Ke,Tt,Ht),d=rt|0}({h:f,l:d}=fc(this.Ah|0,this.Al|0,f|0,d|0)),{h,l:E}=fc(this.Bh|0,this.Bl|0,h|0,E|0),{h:P,l:R}=fc(this.Ch|0,this.Cl|0,P|0,R|0),{h:q,l:te}=fc(this.Dh|0,this.Dl|0,q|0,te|0),{h:ne,l:ue}=fc(this.Eh|0,this.El|0,ne|0,ue|0),{h:ge,l:xe}=fc(this.Fh|0,this.Fl|0,ge|0,xe|0),{h:pe,l:Se}=fc(this.Gh|0,this.Gl|0,pe|0,Se|0),{h:Ce,l:Fe}=fc(this.Hh|0,this.Hl|0,Ce|0,Fe|0),this.set(f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se,Ce,Fe)}roundClean(){jt(Cl,Pl)}destroy(){jt(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Z7 extends mb{Ah=Mo[0]|0;Al=Mo[1]|0;Bh=Mo[2]|0;Bl=Mo[3]|0;Ch=Mo[4]|0;Cl=Mo[5]|0;Dh=Mo[6]|0;Dl=Mo[7]|0;Eh=Mo[8]|0;El=Mo[9]|0;Fh=Mo[10]|0;Fl=Mo[11]|0;Gh=Mo[12]|0;Gl=Mo[13]|0;Hh=Mo[14]|0;Hl=Mo[15]|0;constructor(){super(64)}}class cW extends mb{Ah=Po[0]|0;Al=Po[1]|0;Bh=Po[2]|0;Bl=Po[3]|0;Ch=Po[4]|0;Cl=Po[5]|0;Dh=Po[6]|0;Dl=Po[7]|0;Eh=Po[8]|0;El=Po[9]|0;Fh=Po[10]|0;Fl=Po[11]|0;Gh=Po[12]|0;Gl=Po[13]|0;Hh=Po[14]|0;Hl=Po[15]|0;constructor(){super(48)}}const Oo=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),Ro=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class uW extends mb{Ah=Oo[0]|0;Al=Oo[1]|0;Bh=Oo[2]|0;Bl=Oo[3]|0;Ch=Oo[4]|0;Cl=Oo[5]|0;Dh=Oo[6]|0;Dl=Oo[7]|0;Eh=Oo[8]|0;El=Oo[9]|0;Fh=Oo[10]|0;Fl=Oo[11]|0;Gh=Oo[12]|0;Gl=Oo[13]|0;Hh=Oo[14]|0;Hl=Oo[15]|0;constructor(){super(28)}}class lW extends mb{Ah=Ro[0]|0;Al=Ro[1]|0;Bh=Ro[2]|0;Bl=Ro[3]|0;Ch=Ro[4]|0;Cl=Ro[5]|0;Dh=Ro[6]|0;Dl=Ro[7]|0;Eh=Ro[8]|0;El=Ro[9]|0;Fh=Ro[10]|0;Fl=Ro[11]|0;Gh=Ro[12]|0;Gl=Ro[13]|0;Hh=Ro[14]|0;Hl=Ro[15]|0;constructor(){super(32)}}const fW=null,dW=null,bb=f8(()=>new Z7,C9(3)),hW=null,pW=null,gW=null;/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */const X7=t=>t[0]==="\u3042\u3044\u3053\u304F\u3057\u3093";function q8(t){if(typeof t!="string")throw new TypeError("invalid mnemonic type: "+typeof t);return t.normalize("NFKD")}function vb(t){const e=q8(t),s=e.split(" ");if(![12,15,18,21,24].includes(s.length))throw new Error("Invalid mnemonic");return{nfkd:e,words:s}}function Z8(t){if(abytes(t),![16,20,24,28,32].includes(t.length))throw new Error("invalid entropy length")}function yW(t,e=128){if(anumber(e),e%32!==0||e>256)throw new TypeError("Invalid entropy");return Q7(randomBytes(e/8),t)}const Y7=t=>{const e=8-t.length/4;return new Uint8Array([sha256(t)[0]>>e<<e])};function X8(t){if(!Array.isArray(t)||t.length!==2048||typeof t[0]!="string")throw new Error("Wordlist: expected array of 2048 strings");return t.forEach(e=>{if(typeof e!="string")throw new Error("wordlist: non-string element: "+e)}),baseUtils.chain(baseUtils.checksum(1,Y7),baseUtils.radix2(11,!0),baseUtils.alphabet(t))}function J7(t,e){const{words:s}=vb(t),f=X8(e).decode(s);return Z8(f),f}function Q7(t,e){return Z8(t),X8(e).encode(t).join(X7(e)?"\u3000":" ")}function mW(t,e){try{J7(t,e)}catch{return!1}return!0}const e_=t=>q8("mnemonic"+t);function bW(t,e=""){return pbkdf2Async(sha512,vb(t).nfkd,e_(e),{c:2048,dkLen:64})}function eP(t,e=""){return V7(bb,vb(t).nfkd,e_(e),{c:2048,dkLen:64})}function vW(t,e=""){return pbkdf2web(sha512web,vb(t).nfkd,e_(e),{c:2048,dkLen:64})}function Y8(t){return!!new RegExp("^m\\/44'\\/784'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'+$").test(t)}function wW(t){return!!new RegExp("^m\\/(54|74)'\\/784'\\/[0-9]+'\\/[0-9]+\\/[0-9]+$").test(t)}function tP(t){return eP(t,"")}function nP(t){return Cc(tP(t))}function J8(t,e){return jr.IntentMessage(jr.bytes(e.length)).serialize({intent:{scope:{[t]:!0},version:{V0:!0},appId:{Sui:!0}},value:e}).toBytes()}const t_={ED25519:0,Secp256k1:1,Secp256r1:2,MultiSig:3,ZkLogin:5,Passkey:6},rP={ED25519:32,Secp256k1:33,Secp256r1:33,Passkey:33},Q8={0:"ED25519",1:"Secp256k1",2:"Secp256r1",3:"MultiSig",5:"ZkLogin",6:"Passkey"};function iP({signature:t,signatureScheme:e,publicKey:s}){if(!s)throw new Error("`publicKey` is required");const f=s.toRawBytes(),d=new Uint8Array(1+t.length+f.length);return d.set([t_[e]]),d.set(t,1),d.set(f,1+t.length),Wi(d)}function _W(t){const e=fromBase64(t),s=SIGNATURE_FLAG_TO_SCHEME[e[0]];switch(s){case"Passkey":return parseSerializedPasskeySignature(t);case"MultiSig":return{serializedSignature:t,signatureScheme:s,multisig:suiBcs.MultiSig.parse(e.slice(1)),bytes:e,signature:void 0};case"ZkLogin":return parseSerializedZkLoginSignature(t);case"ED25519":case"Secp256k1":case"Secp256r1":return parseSerializedKeypairSignature(t);default:throw new Error("Unsupported signature scheme")}}const wb=32,EW=64,e5="suiprivkey";var sP=class{async signWithIntent(t,e){const s=Dp(J8(e,t),{dkLen:32});return{signature:iP({signature:await this.sign(s),signatureScheme:this.getKeyScheme(),publicKey:this.getPublicKey()}),bytes:Wi(t)}}async signTransaction(t){return this.signWithIntent(t,"TransactionData")}async signPersonalMessage(t){const{signature:e}=await this.signWithIntent(Pt.byteVector().serialize(t).toBytes(),"PersonalMessage");return{bytes:Wi(t),signature:e}}async signAndExecuteTransaction({transaction:t,client:e}){t.setSenderIfNotSet(this.toSuiAddress());const s=await t.build({client:e}),{signature:f}=await this.signTransaction(s);return e.core.executeTransaction({transaction:s,signatures:[f],include:{transaction:!0,effects:!0}})}toSuiAddress(){return this.getPublicKey().toSuiAddress()}},oP=class extends sP{};function aP(t){const{prefix:e,words:s}=Nd.decode(t);if(e!==e5)throw new Error("invalid private key prefix");const f=new Uint8Array(Nd.fromWords(s)),d=f.slice(1);return{scheme:Q8[f[0]],secretKey:d}}function cP(t,e){if(t.length!==wb)throw new Error("Invalid bytes length");const s=t_[e],f=new Uint8Array(t.length+1);return f.set([s]),f.set(t,1),Nd.encode(e5,Nd.toWords(f))}const uP="ed25519 seed",lP=2147483648,fP=new RegExp("^m(\\/[0-9]+')+$"),t5=t=>t.replace("'",""),dP=t=>{const e=yb.create(bb,new TextEncoder().encode(uP)).update(Tc(t)).digest();return{key:e.slice(0,32),chainCode:e.slice(32)}},hP=({key:t,chainCode:e},s)=>{const f=new ArrayBuffer(4);new DataView(f).setUint32(0,s);const d=new Uint8Array(1+t.length+f.byteLength);d.set(new Uint8Array(1).fill(0)),d.set(t,1),d.set(new Uint8Array(f,0,f.byteLength),t.length+1);const h=yb.create(bb,e).update(d).digest();return{key:h.slice(0,32),chainCode:h.slice(32)}},pP=t=>fP.test(t)?!t.split("/").slice(1).map(t5).some(isNaN):!1,n5=(t,e,s=lP)=>{if(!pP(t))throw new Error("Invalid derivation path");const{key:f,chainCode:d}=dP(e);return t.split("/").slice(1).map(t5).map(h=>parseInt(h,10)).reduce((h,E)=>hP(h,E+s),{key:f,chainCode:d})};function r5(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++)if(t[s]!==e[s])return!1;return!0}var gP=class{equals(t){return r5(this.toRawBytes(),t.toRawBytes())}toBase64(){return Wi(this.toRawBytes())}toString(){throw new Error("`toString` is not implemented on public keys. Use `toBase64()` or `toRawBytes()` instead.")}toSuiPublicKey(){return Wi(this.toSuiBytes())}verifyWithIntent(t,e,s){const f=Dp(J8(s,t),{dkLen:32});return this.verify(f,e)}verifyPersonalMessage(t,e){return this.verifyWithIntent(jr.byteVector().serialize(t).toBytes(),e,"PersonalMessage")}verifyTransaction(t,e){return this.verifyWithIntent(t,e,"TransactionData")}verifyAddress(t){return this.toSuiAddress()===t}toSuiBytes(){const t=this.toRawBytes(),e=new Uint8Array(t.length+1);return e.set([this.flag()]),e.set(t,1),e}toSuiAddress(){return ni(Qr(Dp(this.toSuiBytes(),{dkLen:32})).slice(0,ec*2))}};function yP(t){const e=ls(t),s=Q8[e[0]];switch(s){case"ED25519":case"Secp256k1":case"Secp256r1":const f=rP[s],d=e.slice(1,e.length-f);return{serializedSignature:t,signatureScheme:s,signature:d,publicKey:e.slice(1+d.length),bytes:e};default:throw new Error("Unsupported signature scheme")}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _b=BigInt(0),Hp=BigInt(1);function n_(t,e=""){if(typeof t!="boolean"){const s=e&&`"${e}" `;throw new Error(s+"expected boolean, got type="+typeof t)}return t}function r_(t){if(typeof t=="bigint"){if(!Eb(t))throw new Error("positive bigint expected, got "+t)}else Sa(t);return t}function SW(t,e=""){if(!Number.isSafeInteger(t)){const s=e&&`"${e}" `;throw new Error(s+"expected safe integer, got type="+typeof t)}}function mP(t){const e=r_(t).toString(16);return e.length&1?"0"+e:e}function i5(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?_b:BigInt("0x"+t)}function bP(t){return i5(Qr(t))}function Kp(t){return i5(Qr(i_(M(t)).reverse()))}function s5(t,e){Sa(e),t=r_(t);const s=Ys(t.toString(16).padStart(e*2,"0"));if(s.length!==e)throw new Error("number too large");return s}function vP(t,e){return s5(t,e).reverse()}function AW(t){return hexToBytes_(mP(r_(t)))}function wP(t,e){if(t.length!==e.length)return!1;let s=0;for(let f=0;f<t.length;f++)s|=t[f]^e[f];return s===0}function i_(t){return Uint8Array.from(t)}function xW(t){return Uint8Array.from(t,(e,s)=>{const f=e.charCodeAt(0);if(e.length!==1||f>127)throw new Error(`string contains non-ASCII character "${t[s]}" with code ${f} at position ${s}`);return f})}const Eb=t=>typeof t=="bigint"&&_b<=t;function _P(t,e,s){return Eb(t)&&Eb(e)&&Eb(s)&&e<=t&&t<s}function o5(t,e,s,f){if(!_P(e,s,f))throw new Error("expected valid "+t+": "+s+" <= n < "+f+", got "+e)}function IW(t){let e;for(e=0;t>_b;t>>=Hp,e+=1);return e}function BW(t,e){return t>>BigInt(e)&Hp}function kW(t,e,s){return t|(s?Hp:_b)<<BigInt(e)}const EP=t=>(Hp<<BigInt(t))-Hp;function TW(t,e,s){if(anumber(t,"hashLen"),anumber(e,"qByteLen"),typeof s!="function")throw new Error("hmacFn must be a function");const f=Se=>new Uint8Array(Se),d=Uint8Array.of(),h=Uint8Array.of(0),E=Uint8Array.of(1),P=1e3;let R=f(t),q=f(t),te=0;const ne=()=>{R.fill(1),q.fill(0),te=0},ue=(...Se)=>s(q,concatBytes_(R,...Se)),ge=(Se=d)=>{q=ue(h,Se),R=ue(),Se.length!==0&&(q=ue(E,Se),R=ue())},xe=()=>{if(te++>=P)throw new Error("drbg: tried max amount of iterations");let Se=0;const Ce=[];for(;Se<e;){R=ue();const Fe=R.slice();Ce.push(Fe),Se+=R.length}return concatBytes_(...Ce)};return(Se,Ce)=>{ne(),ge(Se);let Fe;for(;!(Fe=Ce(xe()));)ge();return ne(),Fe}}function s_(t,e={},s={}){if(!t||typeof t!="object")throw new Error("expected valid options object");function f(h,E,P){const R=t[h];if(P&&R===void 0)return;const q=typeof R;if(q!==E||R===null)throw new Error(`param "${h}" is invalid: expected ${E}, got ${q}`)}const d=(h,E)=>Object.entries(h).forEach(([P,R])=>f(P,R,E));d(e,!1),d(s,!0)}const a5=()=>{throw new Error("not implemented")};function c5(t){const e=new WeakMap;return(s,...f)=>{const d=e.get(s);if(d!==void 0)return d;const h=t(s,...f);return e.set(s,h),h}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Vo=BigInt(0),so=BigInt(1),jf=BigInt(2),u5=BigInt(3),l5=BigInt(4),f5=BigInt(5),SP=BigInt(7),d5=BigInt(8),AP=BigInt(9),h5=BigInt(16);function zs(t,e){const s=t%e;return s>=Vo?s:e+s}function CW(t,e,s){return y5(Sb(s),t,e)}function Wc(t,e,s){let f=t;for(;e-- >Vo;)f*=f,f%=s;return f}function o_(t,e){if(t===Vo)throw new Error("invert: expected non-zero number");if(e<=Vo)throw new Error("invert: expected positive modulus, got "+e);let s=zs(t,e),f=e,d=Vo,h=so,E=so,P=Vo;for(;s!==Vo;){const q=f/s,te=f%s,ne=d-E*q,ue=h-P*q;f=s,s=te,d=E,h=P,E=ne,P=ue}if(f!==so)throw new Error("invert: does not exist");return zs(d,e)}function a_(t,e,s){if(!t.eql(t.sqr(e),s))throw new Error("Cannot find square root")}function p5(t,e){const s=(t.ORDER+so)/l5,f=t.pow(e,s);return a_(t,f,e),f}function xP(t,e){const s=(t.ORDER-f5)/d5,f=t.mul(e,jf),d=t.pow(f,s),h=t.mul(e,d),E=t.mul(t.mul(h,jf),d),P=t.mul(h,t.sub(E,t.ONE));return a_(t,P,e),P}function IP(t){const e=Sb(t),s=g5(t),f=s(e,e.neg(e.ONE)),d=s(e,f),h=s(e,e.neg(f)),E=(t+SP)/h5;return(P,R)=>{let q=P.pow(R,E),te=P.mul(q,f);const ne=P.mul(q,d),ue=P.mul(q,h),ge=P.eql(P.sqr(te),R),xe=P.eql(P.sqr(ne),R);q=P.cmov(q,te,ge),te=P.cmov(ue,ne,xe);const pe=P.eql(P.sqr(te),R),Se=P.cmov(q,te,pe);return a_(P,Se,R),Se}}function g5(t){if(t<u5)throw new Error("sqrt is not defined for small field");let e=t-so,s=0;for(;e%jf===Vo;)e/=jf,s++;let f=jf;const d=Sb(t);for(;c_(d,f)===1;)if(f++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(s===1)return p5;let h=d.pow(f,e);const E=(e+so)/jf;return function(R,q){if(R.is0(q))return q;if(c_(R,q)!==1)throw new Error("Cannot find square root");let te=s,ne=R.mul(R.ONE,h),ue=R.pow(q,e),ge=R.pow(q,E);for(;!R.eql(ue,R.ONE);){if(R.is0(ue))return R.ZERO;let xe=1,pe=R.sqr(ue);for(;!R.eql(pe,R.ONE);)if(xe++,pe=R.sqr(pe),xe===te)throw new Error("Cannot find square root");const Se=so<<BigInt(te-xe-1),Ce=R.pow(ne,Se);te=xe,ne=R.sqr(Ce),ue=R.mul(ue,ne),ge=R.mul(ge,Ce)}return ge}}function BP(t){return t%l5===u5?p5:t%d5===f5?xP:t%h5===AP?IP(t):g5(t)}const zf=(t,e)=>(zs(t,e)&so)===so,kP=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function TP(t){const e={ORDER:"bigint",BYTES:"number",BITS:"number"},s=kP.reduce((f,d)=>(f[d]="function",f),e);return s_(t,s),t}function y5(t,e,s){if(s<Vo)throw new Error("invalid exponent, negatives unsupported");if(s===Vo)return t.ONE;if(s===so)return e;let f=t.ONE,d=e;for(;s>Vo;)s&so&&(f=t.mul(f,d)),d=t.sqr(d),s>>=so;return f}function m5(t,e,s=!1){const f=new Array(e.length).fill(s?t.ZERO:void 0),d=e.reduce((E,P,R)=>t.is0(P)?E:(f[R]=E,t.mul(E,P)),t.ONE),h=t.inv(d);return e.reduceRight((E,P,R)=>t.is0(P)?E:(f[R]=t.mul(E,f[R]),t.mul(E,P)),h),f}function PW(t,e,s){return t.mul(e,typeof s=="bigint"?o_(s,t.ORDER):t.inv(s))}function c_(t,e){const s=(t.ORDER-so)/jf,f=t.pow(e,s),d=t.eql(f,t.ONE),h=t.eql(f,t.ZERO),E=t.eql(f,t.neg(t.ONE));if(!d&&!h&&!E)throw new Error("invalid Legendre symbol result");return d?1:h?0:-1}function MW(t,e){return c_(t,e)===1}function CP(t,e){e!==void 0&&Sa(e);const s=e!==void 0?e:t.toString(2).length,f=Math.ceil(s/8);return{nBitLength:s,nByteLength:f}}class PP{ORDER;BITS;BYTES;isLE;ZERO=Vo;ONE=so;_lengths;_sqrt;_mod;constructor(e,s={}){if(e<=Vo)throw new Error("invalid field: expected ORDER > 0, got "+e);let f;this.isLE=!1,s!=null&&typeof s=="object"&&(typeof s.BITS=="number"&&(f=s.BITS),typeof s.sqrt=="function"&&(this.sqrt=s.sqrt),typeof s.isLE=="boolean"&&(this.isLE=s.isLE),s.allowedLengths&&(this._lengths=s.allowedLengths?.slice()),typeof s.modFromBytes=="boolean"&&(this._mod=s.modFromBytes));const{nBitLength:d,nByteLength:h}=CP(e,f);if(h>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=d,this.BYTES=h,this._sqrt=void 0,Object.preventExtensions(this)}create(e){return zs(e,this.ORDER)}isValid(e){if(typeof e!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof e);return Vo<=e&&e<this.ORDER}is0(e){return e===Vo}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&so)===so}neg(e){return zs(-e,this.ORDER)}eql(e,s){return e===s}sqr(e){return zs(e*e,this.ORDER)}add(e,s){return zs(e+s,this.ORDER)}sub(e,s){return zs(e-s,this.ORDER)}mul(e,s){return zs(e*s,this.ORDER)}pow(e,s){return y5(this,e,s)}div(e,s){return zs(e*o_(s,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,s){return e+s}subN(e,s){return e-s}mulN(e,s){return e*s}inv(e){return o_(e,this.ORDER)}sqrt(e){return this._sqrt||(this._sqrt=BP(this.ORDER)),this._sqrt(this,e)}toBytes(e){return this.isLE?vP(e,this.BYTES):s5(e,this.BYTES)}fromBytes(e,s=!1){M(e);const{_lengths:f,BYTES:d,isLE:h,ORDER:E,_mod:P}=this;if(f){if(!f.includes(e.length)||e.length>d)throw new Error("Field.fromBytes: expected "+f+" bytes, got "+e.length);const q=new Uint8Array(d);q.set(e,h?0:q.length-e.length),e=q}if(e.length!==d)throw new Error("Field.fromBytes: expected "+d+" bytes, got "+e.length);let R=h?Kp(e):bP(e);if(P&&(R=zs(R,E)),!s&&!this.isValid(R))throw new Error("invalid field element: outside of range 0..ORDER");return R}invertBatch(e){return m5(this,e)}cmov(e,s,f){return f?s:e}}function Sb(t,e={}){return new PP(t,e)}function OW(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const s=t.sqrt(e);return t.isOdd(s)?s:t.neg(s)}function RW(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const s=t.sqrt(e);return t.isOdd(s)?t.neg(s):s}function b5(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function MP(t){const e=b5(t);return e+Math.ceil(e/2)}function NW(t,e,s=!1){abytes(t);const f=t.length,d=b5(e),h=MP(e);if(f<16||f<h||f>1024)throw new Error("expected "+h+"-1024 bytes of input, got "+f);const E=s?bytesToNumberLE(t):bytesToNumberBE(t),P=zs(E,e-so)+so;return s?numberToBytesLE(P,d):numberToBytesBE(P,d)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const vh=BigInt(0),Hf=BigInt(1);function v5(t,e){const s=e.negate();return t?s:e}function u_(t,e){const s=m5(t.Fp,e.map(f=>f.Z));return e.map((f,d)=>t.fromAffine(f.toAffine(s[d])))}function l_(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function f_(t,e){l_(t,e);const s=Math.ceil(e/t)+1,f=2**(t-1),d=2**t,h=EP(t),E=BigInt(t);return{windows:s,windowSize:f,mask:h,maxNumber:d,shiftBy:E}}function w5(t,e,s){const{windowSize:f,mask:d,maxNumber:h,shiftBy:E}=s;let P=Number(t&d),R=t>>E;P>f&&(P-=h,R+=Hf);const q=e*f,te=q+Math.abs(P)-1,ne=P===0,ue=P<0,ge=e%2!==0;return{nextN:R,offset:te,isZero:ne,isNeg:ue,isNegF:ge,offsetF:q}}function _5(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((s,f)=>{if(!(s instanceof e))throw new Error("invalid point at index "+f)})}function E5(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((s,f)=>{if(!e.isValid(s))throw new Error("invalid scalar at index "+f)})}const d_=new WeakMap,S5=new WeakMap;function h_(t){return S5.get(t)||1}function A5(t){if(t!==vh)throw new Error("invalid wNAF")}class OP{BASE;ZERO;Fn;bits;constructor(e,s){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=s}_unsafeLadder(e,s,f=this.ZERO){let d=e;for(;s>vh;)s&Hf&&(f=f.add(d)),d=d.double(),s>>=Hf;return f}precomputeWindow(e,s){const{windows:f,windowSize:d}=f_(s,this.bits),h=[];let E=e,P=E;for(let R=0;R<f;R++){P=E,h.push(P);for(let q=1;q<d;q++)P=P.add(E),h.push(P);E=P.double()}return h}wNAF(e,s,f){if(!this.Fn.isValid(f))throw new Error("invalid scalar");let d=this.ZERO,h=this.BASE;const E=f_(e,this.bits);for(let P=0;P<E.windows;P++){const{nextN:R,offset:q,isZero:te,isNeg:ne,isNegF:ue,offsetF:ge}=w5(f,P,E);f=R,te?h=h.add(v5(ue,s[ge])):d=d.add(v5(ne,s[q]))}return A5(f),{p:d,f:h}}wNAFUnsafe(e,s,f,d=this.ZERO){const h=f_(e,this.bits);for(let E=0;E<h.windows&&f!==vh;E++){const{nextN:P,offset:R,isZero:q,isNeg:te}=w5(f,E,h);if(f=P,!q){const ne=s[R];d=d.add(te?ne.negate():ne)}}return A5(f),d}getPrecomputes(e,s,f){let d=d_.get(s);return d||(d=this.precomputeWindow(s,e),e!==1&&(typeof f=="function"&&(d=f(d)),d_.set(s,d))),d}cached(e,s,f){const d=h_(e);return this.wNAF(d,this.getPrecomputes(d,e,f),s)}unsafe(e,s,f,d){const h=h_(e);return h===1?this._unsafeLadder(e,s,d):this.wNAFUnsafe(h,this.getPrecomputes(h,e,f),s,d)}createCache(e,s){l_(s,this.bits),S5.set(e,s),d_.delete(e)}hasCache(e){return h_(e)!==1}}function UW(t,e,s,f){let d=e,h=t.ZERO,E=t.ZERO;for(;s>vh||f>vh;)s&Hf&&(h=h.add(d)),f&Hf&&(E=E.add(d)),d=d.double(),s>>=Hf,f>>=Hf;return{p1:h,p2:E}}function DW(t,e,s){const f=t.Fn;_5(e,t),E5(s,f);const d=e.length,h=s.length;if(d!==h)throw new Error("arrays of points and scalars must have equal length");const E=t.ZERO,P=bitLen(BigInt(d));let R=1;P>12?R=P-3:P>4?R=P-2:P>0&&(R=2);const q=bitMask(R),te=new Array(Number(q)+1).fill(E),ne=Math.floor((f.BITS-1)/R)*R;let ue=E;for(let ge=ne;ge>=0;ge-=R){te.fill(E);for(let pe=0;pe<h;pe++){const Se=s[pe],Ce=Number(Se>>BigInt(ge)&q);te[Ce]=te[Ce].add(e[pe])}let xe=E;for(let pe=te.length-1,Se=E;pe>0;pe--)Se=Se.add(te[pe]),xe=xe.add(Se);if(ue=ue.add(xe),ge!==0)for(let pe=0;pe<R;pe++)ue=ue.double()}return ue}function LW(t,e,s){const f=t.Fn;l_(s,f.BITS),_5(e,t);const d=t.ZERO,h=2**s-1,E=Math.ceil(f.BITS/s),P=bitMask(s),R=e.map(q=>{const te=[];for(let ne=0,ue=q;ne<h;ne++)te.push(ue),ue=ue.add(q);return te});return q=>{if(E5(q,f),q.length>e.length)throw new Error("array of scalars must be smaller than array of points");let te=d;for(let ne=0;ne<E;ne++){if(te!==d)for(let ge=0;ge<s;ge++)te=te.double();const ue=BigInt(E*s-(ne+1)*s);for(let ge=0;ge<q.length;ge++){const xe=q[ge],pe=Number(xe>>ue&P);pe&&(te=te.add(R[ge][pe-1]))}}return te}}function x5(t,e,s){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return TP(e),e}else return Sb(t,{isLE:s})}function RP(t,e,s={},f){if(f===void 0&&(f=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);for(const R of["p","n","h"]){const q=e[R];if(!(typeof q=="bigint"&&q>vh))throw new Error(`CURVE.${R} must be positive bigint`)}const d=x5(e.p,s.Fp,f),h=x5(e.n,s.Fn,f),P=["Gx","Gy","a",t==="weierstrass"?"b":"d"];for(const R of P)if(!d.isValid(e[R]))throw new Error(`CURVE.${R} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:d,Fn:h}}function NP(t,e){return function(f){const d=t(f);return{secretKey:d,publicKey:e(d)}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ml=BigInt(0),oo=BigInt(1),p_=BigInt(2),UP=BigInt(8);function DP(t,e,s,f){const d=t.sqr(s),h=t.sqr(f),E=t.add(t.mul(e.a,d),h),P=t.add(t.ONE,t.mul(e.d,t.mul(d,h)));return t.eql(E,P)}function LP(t,e={}){const s=RP("edwards",t,e,e.FpFnLE),{Fp:f,Fn:d}=s;let h=s.CURVE;const{h:E}=h;s_(e,{},{uvRatio:"function"});const P=p_<<BigInt(d.BYTES*8)-oo,R=Se=>f.create(Se),q=e.uvRatio||((Se,Ce)=>{try{return{isValid:!0,value:f.sqrt(f.div(Se,Ce))}}catch{return{isValid:!1,value:Ml}}});if(!DP(f,h,h.Gx,h.Gy))throw new Error("bad curve params: generator point");function te(Se,Ce,Fe=!1){const We=Fe?oo:Ml;return o5("coordinate "+Se,Ce,We,P),Ce}function ne(Se){if(!(Se instanceof xe))throw new Error("EdwardsPoint expected")}const ue=c5((Se,Ce)=>{const{X:Fe,Y:We,Z:xt}=Se,kt=Se.is0();Ce==null&&(Ce=kt?UP:f.inv(xt));const Bt=R(Fe*Ce),Wt=R(We*Ce),Me=f.mul(xt,Ce);if(kt)return{x:Ml,y:oo};if(Me!==oo)throw new Error("invZ was invalid");return{x:Bt,y:Wt}}),ge=c5(Se=>{const{a:Ce,d:Fe}=h;if(Se.is0())throw new Error("bad point: ZERO");const{X:We,Y:xt,Z:kt,T:Bt}=Se,Wt=R(We*We),Me=R(xt*xt),Ke=R(kt*kt),nt=R(Ke*Ke),Tt=R(Wt*Ce),pt=R(Ke*R(Tt+Me)),Ht=R(nt+R(Fe*R(Wt*Me)));if(pt!==Ht)throw new Error("bad point: equation left != right (1)");const lt=R(We*xt),rt=R(kt*Bt);if(lt!==rt)throw new Error("bad point: equation left != right (2)");return!0});class xe{static BASE=new xe(h.Gx,h.Gy,oo,R(h.Gx*h.Gy));static ZERO=new xe(Ml,oo,oo,Ml);static Fp=f;static Fn=d;X;Y;Z;T;constructor(Ce,Fe,We,xt){this.X=te("x",Ce),this.Y=te("y",Fe),this.Z=te("z",We,!0),this.T=te("t",xt),Object.freeze(this)}static CURVE(){return h}static fromAffine(Ce){if(Ce instanceof xe)throw new Error("extended point not allowed");const{x:Fe,y:We}=Ce||{};return te("x",Fe),te("y",We),new xe(Fe,We,oo,R(Fe*We))}static fromBytes(Ce,Fe=!1){const We=f.BYTES,{a:xt,d:kt}=h;Ce=i_(M(Ce,We,"point")),n_(Fe,"zip215");const Bt=i_(Ce),Wt=Ce[We-1];Bt[We-1]=Wt&-129;const Me=Kp(Bt),Ke=Fe?P:f.ORDER;o5("point.y",Me,Ml,Ke);const nt=R(Me*Me),Tt=R(nt-oo),pt=R(kt*nt-xt);let{isValid:Ht,value:lt}=q(Tt,pt);if(!Ht)throw new Error("bad point: invalid y coordinate");const rt=(lt&oo)===oo,ot=(Wt&128)!==0;if(!Fe&<===Ml&&ot)throw new Error("bad point: x=0 and x_0=1");return ot!==rt&&(lt=R(-lt)),xe.fromAffine({x:lt,y:Me})}static fromHex(Ce,Fe=!1){return xe.fromBytes(Ys(Ce),Fe)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(Ce=8,Fe=!0){return pe.createCache(this,Ce),Fe||this.multiply(p_),this}assertValidity(){ge(this)}equals(Ce){ne(Ce);const{X:Fe,Y:We,Z:xt}=this,{X:kt,Y:Bt,Z:Wt}=Ce,Me=R(Fe*Wt),Ke=R(kt*xt),nt=R(We*Wt),Tt=R(Bt*xt);return Me===Ke&&nt===Tt}is0(){return this.equals(xe.ZERO)}negate(){return new xe(R(-this.X),this.Y,this.Z,R(-this.T))}double(){const{a:Ce}=h,{X:Fe,Y:We,Z:xt}=this,kt=R(Fe*Fe),Bt=R(We*We),Wt=R(p_*R(xt*xt)),Me=R(Ce*kt),Ke=Fe+We,nt=R(R(Ke*Ke)-kt-Bt),Tt=Me+Bt,pt=Tt-Wt,Ht=Me-Bt,lt=R(nt*pt),rt=R(Tt*Ht),ot=R(nt*Ht),Mt=R(pt*Tt);return new xe(lt,rt,Mt,ot)}add(Ce){ne(Ce);const{a:Fe,d:We}=h,{X:xt,Y:kt,Z:Bt,T:Wt}=this,{X:Me,Y:Ke,Z:nt,T:Tt}=Ce,pt=R(xt*Me),Ht=R(kt*Ke),lt=R(Wt*We*Tt),rt=R(Bt*nt),ot=R((xt+kt)*(Me+Ke)-pt-Ht),Mt=rt-lt,Ut=rt+lt,rn=R(Ht-Fe*pt),Qt=R(ot*Mt),Cn=R(Ut*rn),qn=R(ot*rn),hr=R(Mt*Ut);return new xe(Qt,Cn,hr,qn)}subtract(Ce){return this.add(Ce.negate())}multiply(Ce){if(!d.isValidNot0(Ce))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:Fe,f:We}=pe.cached(this,Ce,xt=>u_(xe,xt));return u_(xe,[Fe,We])[0]}multiplyUnsafe(Ce,Fe=xe.ZERO){if(!d.isValid(Ce))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return Ce===Ml?xe.ZERO:this.is0()||Ce===oo?this:pe.unsafe(this,Ce,We=>u_(xe,We),Fe)}isSmallOrder(){return this.multiplyUnsafe(E).is0()}isTorsionFree(){return pe.unsafe(this,h.n).is0()}toAffine(Ce){return ue(this,Ce)}clearCofactor(){return E===oo?this:this.multiplyUnsafe(E)}toBytes(){const{x:Ce,y:Fe}=this.toAffine(),We=f.toBytes(Fe);return We[We.length-1]|=Ce&oo?128:0,We}toHex(){return Qr(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const pe=new OP(xe,d.BITS);return xe.BASE.precompute(8),xe}class FP{static BASE;static ZERO;static Fp;static Fn;ep;constructor(e){this.ep=e}static fromBytes(e){a5()}static fromHex(e){a5()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return Qr(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,s){return this.init(this.ep.precompute(e,s))}}function jP(t,e,s={}){if(typeof e!="function")throw new Error('"hash" function param is required');s_(s,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:f}=s,{BASE:d,Fp:h,Fn:E}=t,P=s.randomBytes||T9,R=s.adjustScalarBytes||(Me=>Me),q=s.domain||((Me,Ke,nt)=>{if(n_(nt,"phflag"),Ke.length||nt)throw new Error("Contexts/pre-hash are not supported");return Me});function te(Me){return E.create(Kp(Me))}function ne(Me){const Ke=We.secretKey;M(Me,We.secretKey,"secretKey");const nt=M(e(Me),2*Ke,"hashedSecretKey"),Tt=R(nt.slice(0,Ke)),pt=nt.slice(Ke,2*Ke),Ht=te(Tt);return{head:Tt,prefix:pt,scalar:Ht}}function ue(Me){const{head:Ke,prefix:nt,scalar:Tt}=ne(Me),pt=d.multiply(Tt),Ht=pt.toBytes();return{head:Ke,prefix:nt,scalar:Tt,point:pt,pointBytes:Ht}}function ge(Me){return ue(Me).pointBytes}function xe(Me=Uint8Array.of(),...Ke){const nt=Rp(...Ke);return te(e(q(nt,M(Me,void 0,"context"),!!f)))}function pe(Me,Ke,nt={}){Me=M(Me,void 0,"message"),f&&(Me=f(Me));const{prefix:Tt,scalar:pt,pointBytes:Ht}=ue(Ke),lt=xe(nt.context,Tt,Me),rt=d.multiply(lt).toBytes(),ot=xe(nt.context,rt,Ht,Me),Mt=E.create(lt+ot*pt);if(!E.isValid(Mt))throw new Error("sign failed: invalid s");const Ut=Rp(rt,E.toBytes(Mt));return M(Ut,We.signature,"result")}const Se={zip215:!0};function Ce(Me,Ke,nt,Tt=Se){const{context:pt,zip215:Ht}=Tt,lt=We.signature;Me=M(Me,lt,"signature"),Ke=M(Ke,void 0,"message"),nt=M(nt,We.publicKey,"publicKey"),Ht!==void 0&&n_(Ht,"zip215"),f&&(Ke=f(Ke));const rt=lt/2,ot=Me.subarray(0,rt),Mt=Kp(Me.subarray(rt,lt));let Ut,rn,Qt;try{Ut=t.fromBytes(nt,Ht),rn=t.fromBytes(ot,Ht),Qt=d.multiplyUnsafe(Mt)}catch{return!1}if(!Ht&&Ut.isSmallOrder())return!1;const Cn=xe(pt,rn.toBytes(),Ut.toBytes(),Ke);return rn.add(Ut.multiplyUnsafe(Cn)).subtract(Qt).clearCofactor().is0()}const Fe=h.BYTES,We={secretKey:Fe,publicKey:Fe,signature:2*Fe,seed:Fe};function xt(Me=P(We.seed)){return M(Me,We.seed,"seed")}function kt(Me){return db(Me)&&Me.length===E.BYTES}function Bt(Me,Ke){try{return!!t.fromBytes(Me,Ke)}catch{return!1}}const Wt={getExtendedPublicKey:ue,randomSecretKey:xt,isValidSecretKey:kt,isValidPublicKey:Bt,toMontgomery(Me){const{y:Ke}=t.fromBytes(Me),nt=We.publicKey,Tt=nt===32;if(!Tt&&nt!==57)throw new Error("only defined for 25519 and 448");const pt=Tt?h.div(oo+Ke,oo-Ke):h.div(Ke-oo,Ke+oo);return h.toBytes(pt)},toMontgomerySecret(Me){const Ke=We.secretKey;M(Me,Ke);const nt=e(Me.subarray(0,Ke));return R(nt).subarray(0,Ke)}};return Object.freeze({keygen:NP(xt,ge),getPublicKey:ge,sign:pe,verify:Ce,utils:Wt,Point:t,lengths:We})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zP=BigInt(0),Gc=BigInt(1),g_=BigInt(2),FW=null,I5=BigInt(5),B5=BigInt(8),Kf=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),y_={p:Kf,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:B5,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function HP(t){const e=BigInt(10),s=BigInt(20),f=BigInt(40),d=BigInt(80),h=Kf,P=t*t%h*t%h,R=Wc(P,g_,h)*P%h,q=Wc(R,Gc,h)*t%h,te=Wc(q,I5,h)*q%h,ne=Wc(te,e,h)*te%h,ue=Wc(ne,s,h)*ne%h,ge=Wc(ue,f,h)*ue%h,xe=Wc(ge,d,h)*ge%h,pe=Wc(xe,d,h)*ge%h,Se=Wc(pe,e,h)*te%h;return{pow_p_5_8:Wc(Se,g_,h)*t%h,b2:P}}function KP(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const m_=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function b_(t,e){const s=Kf,f=zs(e*e*e,s),d=zs(f*f*e,s),h=HP(t*d).pow_p_5_8;let E=zs(t*f*h,s);const P=zs(e*E*E,s),R=E,q=zs(E*m_,s),te=P===t,ne=P===zs(-t,s),ue=P===zs(-t*m_,s);return te&&(E=R),(ne||ue)&&(E=q),zf(E,s)&&(E=zs(-E,s)),{isValid:te||ne,value:E}}const Ol=LP(y_,{uvRatio:b_}),xr=Ol.Fp,$P=Ol.Fn;function jW(t,e,s){if(e.length>255)throw new Error("Context is too big");return concatBytes(asciiToBytes("SigEd25519 no Ed25519 collisions"),new Uint8Array([s?1:0,e.length]),e,t)}function VP(t){return jP(Ol,bb,Object.assign({adjustScalarBytes:KP},t))}const ku=VP({}),zW=null,HW=null,KW=null,$W=null,WP=null,k5=null;function GP(t){const e=(Kf-I5)/B5,s=BigInt(486662);let f=xr.sqr(t);f=xr.mul(f,g_);let d=xr.add(f,xr.ONE),h=xr.neg(s),E=xr.sqr(d),P=xr.mul(E,d),R=xr.mul(f,s);R=xr.mul(R,h),R=xr.add(R,E),R=xr.mul(R,h);let q=xr.sqr(P);E=xr.sqr(q),q=xr.mul(q,P),q=xr.mul(q,R),E=xr.mul(E,q);let te=xr.pow(E,e);te=xr.mul(te,q);let ne=xr.mul(te,k5);E=xr.sqr(te),E=xr.mul(E,P);let ue=xr.eql(E,R),ge=xr.cmov(ne,te,ue),xe=xr.mul(h,f),pe=xr.mul(te,t);pe=xr.mul(pe,WP);let Se=xr.mul(pe,k5),Ce=xr.mul(R,f);E=xr.sqr(pe),E=xr.mul(E,P);let Fe=xr.eql(E,Ce),We=xr.cmov(Se,pe,Fe);E=xr.sqr(ge),E=xr.mul(E,P);let xt=xr.eql(E,R),kt=xr.cmov(xe,h,xt),Bt=xr.cmov(We,ge,xt),Wt=xr.isOdd(Bt);return Bt=xr.cmov(Bt,xr.neg(Bt),xt!==Wt),{xMn:kt,xMd:d,yMn:Bt,yMd:Gc}}const qP=null;function VW(t){const{xMn:e,xMd:s,yMn:f,yMd:d}=GP(t);let h=xr.mul(e,d);h=xr.mul(h,qP);let E=xr.mul(s,f),P=xr.sub(e,s),R=xr.add(e,s),q=xr.mul(E,R),te=xr.eql(q,xr.ZERO);h=xr.cmov(h,xr.ZERO,te),E=xr.cmov(E,xr.ONE,te),P=xr.cmov(P,xr.ONE,te),R=xr.cmov(R,xr.ONE,te);const[ne,ue]=FpInvertBatch(xr,[E,R],!0);return{x:xr.mul(h,ne),y:xr.mul(P,ue)}}const WW=null,v_=m_,ZP=null,XP=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),YP=null,JP=null,T5=t=>b_(Gc,t),QP=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),eM=t=>xr.create(Kp(t)&QP);function GW(t){const{d:e}=y_,s=Kf,f=Ce=>xr.create(Ce),d=f(v_*t*t),h=f((d+Gc)*YP);let E=BigInt(-1);const P=f((E-e*d)*f(d+e));let{isValid:R,value:q}=b_(h,P),te=f(q*t);isNegativeLE(te,s)||(te=f(-te)),R||(q=te),R||(E=d);const ne=f(E*(d-Gc)*JP-P),ue=q*q,ge=f((q+q)*P),xe=f(ne*ZP),pe=f(Gc-ue),Se=f(Gc+ue);return new Ol(f(ge*Se),f(pe*xe),f(xe*Se),f(ge*pe))}class Tu extends FP{static BASE=new Tu(Ol.BASE);static ZERO=new Tu(Ol.ZERO);static Fp=xr;static Fn=$P;constructor(e){super(e)}static fromAffine(e){return new Tu(Ol.fromAffine(e))}assertSame(e){if(!(e instanceof Tu))throw new Error("RistrettoPoint expected")}init(e){return new Tu(e)}static fromBytes(e){M(e,32);const{a:s,d:f}=y_,d=Kf,h=xt=>xr.create(xt),E=eM(e);if(!wP(xr.toBytes(E),e)||zf(E,d))throw new Error("invalid ristretto255 encoding 1");const P=h(E*E),R=h(Gc+s*P),q=h(Gc-s*P),te=h(R*R),ne=h(q*q),ue=h(s*f*te-ne),{isValid:ge,value:xe}=T5(h(ue*ne)),pe=h(xe*q),Se=h(xe*pe*ue);let Ce=h((E+E)*pe);zf(Ce,d)&&(Ce=h(-Ce));const Fe=h(R*Se),We=h(Ce*Fe);if(!ge||zf(We,d)||Fe===zP)throw new Error("invalid ristretto255 encoding 2");return new Tu(new Ol(Ce,Fe,Gc,We))}static fromHex(e){return Tu.fromBytes(Ys(e))}toBytes(){let{X:e,Y:s,Z:f,T:d}=this.ep;const h=Kf,E=Se=>xr.create(Se),P=E(E(f+s)*E(f-s)),R=E(e*s),q=E(R*R),{value:te}=T5(E(P*q)),ne=E(te*P),ue=E(te*R),ge=E(ne*ue*d);let xe;if(zf(d*ge,h)){let Se=E(s*v_),Ce=E(e*v_);e=Se,s=Ce,xe=E(ne*XP)}else xe=ue;zf(e*ge,h)&&(s=E(-s));let pe=E((f-s)*xe);return zf(pe,h)&&(pe=E(-pe)),xr.toBytes(pe)}equals(e){this.assertSame(e);const{X:s,Y:f}=this.ep,{X:d,Y:h}=e.ep,E=q=>xr.create(q),P=E(s*h)===E(f*d),R=E(f*h)===E(s*d);return P||R}is0(){return this.equals(Tu.ZERO)}}const qW=null,ZW=null,XW=null,YW=null,w_=32;var C5=class extends gP{static{this.SIZE=w_}constructor(t){if(super(),typeof t=="string"?this.data=ls(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==w_)throw new Error(`Invalid public key input. Expected ${w_} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return t_.ED25519}async verify(t,e){let s;if(typeof e=="string"){const f=yP(e);if(f.signatureScheme!=="ED25519")throw new Error("Invalid signature scheme");if(!r5(this.toRawBytes(),f.publicKey))throw new Error("Signature does not match public key");s=f.signature}else s=e;return ku.verify(s,t,this.toRawBytes())}};const P5="m/44'/784'/0'/0'/0'";var tM=class Gg extends oP{constructor(e){if(super(),e)this.keypair={publicKey:e.publicKey,secretKey:e.secretKey.slice(0,32)};else{const s=ku.utils.randomSecretKey();this.keypair={publicKey:ku.getPublicKey(s),secretKey:s}}}getKeyScheme(){return"ED25519"}static generate(){const e=ku.utils.randomSecretKey();return new Gg({publicKey:ku.getPublicKey(e),secretKey:e})}static fromSecretKey(e,s){if(typeof e=="string"){const h=aP(e);if(h.scheme!=="ED25519")throw new Error(`Expected a ED25519 keypair, got ${h.scheme}`);return this.fromSecretKey(h.secretKey,s)}const f=e.length;if(f!==wb)throw new Error(`Wrong secretKey size. Expected ${wb} bytes, got ${f}.`);const d={publicKey:ku.getPublicKey(e),secretKey:e};if(!s||!s.skipValidation){const h=new TextEncoder().encode("sui validation"),E=ku.sign(h,e);if(!ku.verify(E,h,d.publicKey))throw new Error("provided secretKey is invalid")}return new Gg(d)}getPublicKey(){return new C5(this.keypair.publicKey)}getSecretKey(){return cP(this.keypair.secretKey.slice(0,wb),this.getKeyScheme())}async sign(e){return ku.sign(e,this.keypair.secretKey)}static deriveKeypair(e,s){if(s==null&&(s=P5),!Y8(s))throw new Error("Invalid derivation path");const{key:f}=n5(s,nP(e));return Gg.fromSecretKey(f)}static deriveKeypairFromSeed(e,s){if(s==null&&(s=P5),!Y8(s))throw new Error("Invalid derivation path");const f=typeof e=="string"?e:Cc(e),{key:d}=n5(s,f);return Gg.fromSecretKey(d)}};const JW="sui:devnet",QW="sui:testnet",eG="sui:localnet",nM="sui:mainnet",rM=null;function tG(t){return rM.includes(t)}var wh=function(t,e,s,f){if(s==="a"&&!f)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!f:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?f:s==="a"?f.call(t):f?f.value:e.get(t)},_h=function(t,e,s,f,d){if(f==="m")throw new TypeError("Private method is not writable");if(f==="a"&&!d)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!d:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return f==="a"?d.call(t,s):d?d.value=s:e.set(t,s),s},Ab,xb,Ib,Bb,kb,Tb;class __{get address(){return wh(this,Ab,"f")}get publicKey(){return wh(this,xb,"f").slice()}get chains(){return wh(this,Ib,"f").slice()}get features(){return wh(this,Bb,"f").slice()}get label(){return wh(this,kb,"f")}get icon(){return wh(this,Tb,"f")}constructor(e){Ab.set(this,void 0),xb.set(this,void 0),Ib.set(this,void 0),Bb.set(this,void 0),kb.set(this,void 0),Tb.set(this,void 0),new.target===__&&Object.freeze(this),_h(this,Ab,e.address,"f"),_h(this,xb,e.publicKey.slice(),"f"),_h(this,Ib,e.chains.slice(),"f"),_h(this,Bb,e.features.slice(),"f"),_h(this,kb,e.label,"f"),_h(this,Tb,e.icon,"f")}}Ab=new WeakMap,xb=new WeakMap,Ib=new WeakMap,Bb=new WeakMap,kb=new WeakMap,Tb=new WeakMap;function iM(t,e){if(t===e)return!0;const s=t.length;if(s!==e.length)return!1;for(let f=0;f<s;f++)if(t[f]!==e[f])return!1;return!0}function nG(t,e){return iM(t,e)}function rG(t,...e){const s=e.reduce((d,h)=>d+h.length,t.length),f=new Uint8Array(s);f.set(t,0);for(const d of e)f.set(d,f.length);return f}function iG(t,...e){const s={};for(const f of e)s[f]=t[f];return s}function sG(t){try{t()}catch(e){console.error(e)}}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $f(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function $p(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function ia(...t){const e=h=>h,s=(h,E)=>P=>h(E(P)),f=t.map(h=>h.encode).reduceRight(s,e),d=t.map(h=>h.decode).reduce(s,e);return{encode:f,decode:d}}function Ia(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return e.map(s=>{if(s<0||s>=t.length)throw new Error(`Digit index outside alphabet: ${s} (alphabet: ${t.length})`);return t[s]})},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("alphabet.decode input should be array of strings");return e.map(s=>{if(typeof s!="string")throw new Error(`alphabet.decode: not string element=${s}`);const f=t.indexOf(s);if(f===-1)throw new Error(`Unknown letter: "${s}". Allowed: ${t}`);return f})}}}function Ba(t=""){if(typeof t!="string")throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("join.encode input should be array of strings");for(let s of e)if(typeof s!="string")throw new Error(`join.encode: non-string input=${s}`);return e.join(t)},decode:e=>{if(typeof e!="string")throw new Error("join.decode input should be string");return e.split(t)}}}function Cb(t,e="="){if(typeof e!="string")throw new Error("padding chr should be string");return{encode(s){if(!Array.isArray(s)||s.length&&typeof s[0]!="string")throw new Error("padding.encode input should be array of strings");for(let f of s)if(typeof f!="string")throw new Error(`padding.encode: non-string input=${f}`);for(;s.length*t%8;)s.push(e);return s},decode(s){if(!Array.isArray(s)||s.length&&typeof s[0]!="string")throw new Error("padding.encode input should be array of strings");for(let d of s)if(typeof d!="string")throw new Error(`padding.decode: non-string input=${d}`);let f=s.length;if(f*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;f>0&&s[f-1]===e;f--)if(!((f-1)*t%8))throw new Error("Invalid padding: string has too much padding");return s.slice(0,f)}}}function M5(t){if(typeof t!="function")throw new Error("normalize fn should be function");return{encode:e=>e,decode:e=>t(e)}}function O5(t,e,s){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(s<2)throw new Error(`convertRadix: wrong to=${s}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let f=0;const d=[],h=Array.from(t);for(h.forEach(E=>{if(E<0||E>=e)throw new Error(`Wrong integer: ${E}`)});;){let E=0,P=!0;for(let R=f;R<h.length;R++){const q=h[R],te=e*E+q;if(!Number.isSafeInteger(te)||e*E/e!==E||te-q!==e*E)throw new Error("convertRadix: carry overflow");E=te%s;const ne=Math.floor(te/s);if(h[R]=ne,!Number.isSafeInteger(ne)||ne*s+E!==te)throw new Error("convertRadix: carry overflow");if(P)ne?P=!1:f=R;else continue}if(d.push(E),P)break}for(let E=0;E<t.length-1&&t[E]===0;E++)d.push(0);return d.reverse()}const R5=(t,e)=>e?R5(e,t%e):t,Pb=(t,e)=>t+(e-R5(t,e));function E_(t,e,s,f){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(s<=0||s>32)throw new Error(`convertRadix2: wrong to=${s}`);if(Pb(e,s)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${s} carryBits=${Pb(e,s)}`);let d=0,h=0;const E=2**s-1,P=[];for(const R of t){if(R>=2**e)throw new Error(`convertRadix2: invalid data word=${R} from=${e}`);if(d=d<<e|R,h+e>32)throw new Error(`convertRadix2: carry overflow pos=${h} from=${e}`);for(h+=e;h>=s;h-=s)P.push((d>>h-s&E)>>>0);d&=2**h-1}if(d=d<<s-h&E,!f&&h>=e)throw new Error("Excess padding");if(!f&&d)throw new Error(`Non-zero padding: ${d}`);return f&&h>0&&P.push(d>>>0),P}function sM(t){return{encode:e=>{if(!$p(e))throw new Error("radix.encode input should be Uint8Array");return O5(Array.from(e),2**8,t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(O5(e,t,2**8))}}}function ja(t,e=!1){if(t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(Pb(8,t)>32||Pb(t,8)>32)throw new Error("radix2: carry overflow");return{encode:s=>{if(!$p(s))throw new Error("radix2.encode input should be Uint8Array");return E_(Array.from(s),8,t,!e)},decode:s=>{if(!Array.isArray(s)||s.length&&typeof s[0]!="number")throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(E_(s,t,8,e))}}}function N5(t){if(typeof t!="function")throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch{}}}function oM(t,e){if(typeof e!="function")throw new Error("checksum fn should be function");return{encode(s){if(!$p(s))throw new Error("checksum.encode: input should be Uint8Array");const f=e(s).slice(0,t),d=new Uint8Array(s.length+t);return d.set(s),d.set(f,s.length),d},decode(s){if(!$p(s))throw new Error("checksum.decode: input should be Uint8Array");const f=s.slice(0,-t),d=e(f).slice(0,t),h=s.slice(-t);for(let E=0;E<t;E++)if(d[E]!==h[E])throw new Error("Invalid checksum");return f}}}const oG=null,aG=ia(ja(4),Ia("0123456789ABCDEF"),Ba("")),cG=ia(ja(5),Ia("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Cb(5),Ba("")),uG=ia(ja(5),Ia("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Ba("")),lG=ia(ja(5),Ia("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Cb(5),Ba("")),fG=ia(ja(5),Ia("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Ba("")),dG=ia(ja(5),Ia("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Ba(""),M5(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),aM=ia(ja(6),Ia("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Cb(6),Ba("")),hG=ia(ja(6),Ia("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Ba("")),pG=ia(ja(6),Ia("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Cb(6),Ba("")),gG=ia(ja(6),Ia("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Ba("")),yG=t=>ia(sM(58),Ia(t),Ba("")),cM=null,mG=null,bG=null,vG=null,wG=null,_G=t=>ia(oM(4,e=>t(t(e))),cM),EG=null,S_=ia(Ia("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Ba("")),U5=null;function Vp(t){const e=t>>25;let s=(t&33554431)<<5;for(let f=0;f<U5.length;f++)(e>>f&1)===1&&(s^=U5[f]);return s}function D5(t,e,s=1){const f=t.length;let d=1;for(let h=0;h<f;h++){const E=t.charCodeAt(h);if(E<33||E>126)throw new Error(`Invalid prefix (${t})`);d=Vp(d)^E>>5}d=Vp(d);for(let h=0;h<f;h++)d=Vp(d)^t.charCodeAt(h)&31;for(let h of e)d=Vp(d)^h;for(let h=0;h<6;h++)d=Vp(d);return d^=s,S_.encode(E_([d%2**30],30,5,!1))}function SG(t){const e=t==="bech32"?1:734539939,s=ja(5),f=s.decode,d=s.encode,h=N5(f);function E(ne,ue,ge=90){if(typeof ne!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof ne}`);if(ue instanceof Uint8Array&&(ue=Array.from(ue)),!Array.isArray(ue)||ue.length&&typeof ue[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof ue}`);if(ne.length===0)throw new TypeError(`Invalid prefix length ${ne.length}`);const xe=ne.length+7+ue.length;if(ge!==!1&&xe>ge)throw new TypeError(`Length ${xe} exceeds limit ${ge}`);const pe=ne.toLowerCase(),Se=D5(pe,ue,e);return`${pe}1${S_.encode(ue)}${Se}`}function P(ne,ue=90){if(typeof ne!="string")throw new Error(`bech32.decode input should be string, not ${typeof ne}`);if(ne.length<8||ue!==!1&&ne.length>ue)throw new TypeError(`Wrong string length: ${ne.length} (${ne}). Expected (8..${ue})`);const ge=ne.toLowerCase();if(ne!==ge&&ne!==ne.toUpperCase())throw new Error("String must be lowercase or uppercase");const xe=ge.lastIndexOf("1");if(xe===0||xe===-1)throw new Error('Letter "1" must be present between prefix and data only');const pe=ge.slice(0,xe),Se=ge.slice(xe+1);if(Se.length<6)throw new Error("Data must be at least 6 characters long");const Ce=S_.decode(Se).slice(0,-6),Fe=D5(pe,Ce,e);if(!Se.endsWith(Fe))throw new Error(`Invalid checksum in ${ne}: expected "${Fe}"`);return{prefix:pe,words:Ce}}const R=N5(P);function q(ne){const{prefix:ue,words:ge}=P(ne,!1);return{prefix:ue,words:ge,bytes:f(ge)}}function te(ne,ue){return E(ne,d(ue))}return{encode:E,decode:P,encodeFromBytes:te,decodeToBytes:q,decodeUnsafe:R,fromWords:f,fromWordsUnsafe:h,toWords:d}}const AG=null,xG=null,IG=null,BG=ia(ja(4),Ia("0123456789abcdef"),Ba(""),M5(t=>{if(typeof t!="string"||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})),Mb=null,L5="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",kG=(t,e)=>{if(typeof t!="string"||!Mb.hasOwnProperty(t))throw new TypeError(L5);if(!$p(e))throw new TypeError("bytesToString() expects Uint8Array");return Mb[t].encode(e)},TG=null,CG=(t,e)=>{if(!Mb.hasOwnProperty(t))throw new TypeError(L5);if(typeof e!="string")throw new TypeError("stringToBytes() expects string");return Mb[t].decode(e)},PG=null;function uM(t){return typeof t?.prototype?.constructor?.name=="string"}function lM(t){return getErrorMessage(t).replace(/\.$/u,"")}function F5(t,e){return uM(t)?new t({message:e}):t({message:e})}class j5 extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}function fM(t,e="Assertion failed.",s=j5){if(!t)throw e instanceof Error?e:F5(s,e)}function MG(t,e,s="Assertion failed",f=j5){try{assertSuperstruct(t,e)}catch(d){throw F5(f,`${s}: ${lM(d)}.`)}}function OG(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}var z5=Ar(36533).Buffer;const H5=48,K5=58,$5=87;function dM(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const hM=dM();function V5(t){return t instanceof Uint8Array}function Eh(t){fM(V5(t),"Value must be a Uint8Array.")}function pM(t){if(Eh(t),t.length===0)return"0x";const e=hM(),s=new Array(t.length);for(let f=0;f<t.length;f++)s[f]=e[t[f]];return add0x(s.join(""))}function gM(t){Eh(t);const e=pM(t);return BigInt(e)}function RG(t){Eh(t);let e=BigInt(0);for(const s of t)e=(e<<BigInt(8))+BigInt(s);return BigInt.asIntN(t.length*8,e)}function NG(t){Eh(t);const e=gM(t);return assert(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}function UG(t){return Eh(t),new TextDecoder().decode(t)}function Ob(t){return Eh(t),aM.encode(t)}function A_(t){if(t?.toLowerCase?.()==="0x")return new Uint8Array;assertIsHexString(t);const e=remove0x(t).toLowerCase(),s=e.length%2===0?e:`0${e}`,f=new Uint8Array(s.length/2);for(let d=0;d<f.length;d++){const h=s.charCodeAt(d*2),E=s.charCodeAt(d*2+1),P=h-(h<K5?H5:$5),R=E-(E<K5?H5:$5);f[d]=P*16+R}return f}function yM(t){assert(typeof t=="bigint","Value must be a bigint."),assert(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return A_(e)}function mM(t,e){assert(e>0);const s=t>>BigInt(31);return!((~t&s)+(t&~s)>>BigInt(e*8+-1))}function DG(t,e){assert(typeof t=="bigint","Value must be a bigint."),assert(typeof e=="number","Byte length must be a number."),assert(e>0,"Byte length must be greater than 0."),assert(mM(t,e),"Byte length is too small to represent the given value.");let s=t;const f=new Uint8Array(e);for(let d=0;d<f.length;d++)f[d]=Number(BigInt.asUintN(8,s)),s>>=BigInt(8);return f.reverse()}function bM(t){assert(typeof t=="number","Value must be a number."),assert(t>=0,"Value must be a non-negative number."),assert(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return A_(e)}function vM(t){return assert(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}function LG(t){return assert(typeof t=="string","Value must be a string."),base64.decode(t)}function wM(t){if(typeof t=="bigint")return yM(t);if(typeof t=="number")return bM(t);if(typeof t=="string")return t.startsWith("0x")?A_(t):vM(t);if(V5(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}function FG(t){const e=new Array(t.length);let s=0;for(let d=0;d<t.length;d++){const h=wM(t[d]);e[d]=h,s+=h.length}const f=new Uint8Array(s);for(let d=0,h=0;d<e.length;d++)f.set(e[d],h),h+=e[d].length;return f}function jG(t){if(typeof z5<"u"&&t instanceof z5){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}var hc;(function(t){t.STANDARD__CONNECT="standard:connect",t.STANDARD__DISCONNECT="standard:disconnect",t.STANDARD__EVENTS="standard:events",t.SUI__SIGN_AND_EXECUTE_TRANSACTION_BLOCK="sui:signAndExecuteTransactionBlock",t.SUI__SIGN_TRANSACTION_BLOCK="sui:signTransactionBlock",t.SUI__SIGN_TRANSACTION="sui:signTransaction",t.SUI__SIGN_AND_EXECUTE_TRANSACTION="sui:signAndExecuteTransaction",t.SUI__SIGN_PERSONAL_MESSAGE="sui:signPersonalMessage"})(hc||(hc={}));var _M=function(t){"use strict";z(s,t);var e=Ie(s);function s(){B(this,s);var f;f=e.call(this),le(Y(f),"_rpcUrl",void 0),le(Y(f),"_namespace","sui"),le(Y(f),"_signMethod","ed25519");var d=Y(f);le(Y(f),"connect",T(I().mark(function ne(){return I().wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return ge.prev=0,ge.next=3,d._requestNormalConnect();case 3:return d.emit("change",{accounts:d.accounts}),ge.abrupt("return",{accounts:d.accounts});case 7:throw ge.prev=7,ge.t0=ge.catch(0),d.reportError(ge.t0),ge.t0;case 11:case"end":return ge.stop()}},ne,null,[[0,7]])})));var h=Y(f);le(Y(f),"signPersonalMessage",function(){var ne=T(I().mark(function ue(ge){var xe,pe,Se,Ce,Fe,We;return I().wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.prev=0,kt.next=3,h.getIsUniversalSign();case 3:return xe=kt.sent,kt.next=6,h.getIsNewSuiSign();case 6:if(pe=kt.sent,!(xe&&pe)){kt.next=17;break}if(h._connectedAddress){kt.next=10;break}throw new Error("No connected address, please connect first");case 10:return Se={id:1,jsonrpc:"2.0",method:"sui_signPersonalMessage",params:{sender:h._connectedPubKey,message:btoa(new TextDecoder().decode(ge.message))}},kt.next=13,h._universalSign({type:"signMessage",request:Se});case 13:return Ce=kt.sent,Fe=Ce.signature,We=Ce.transaction,kt.abrupt("return",{signature:Fe,bytes:We});case 17:return kt.next=19,h._previewMessage(new TextDecoder().decode(ge.message));case 19:return kt.abrupt("return",h._keyPair.signPersonalMessage(ge.message));case 22:throw kt.prev=22,kt.t0=kt.catch(0),h.reportError(kt.t0),kt.t0;case 26:case"end":return kt.stop()}},ue,null,[[0,22]])}));return function(ue){return ne.apply(this,arguments)}}());var E=Y(f);le(Y(f),"signTransaction",function(){var ne=T(I().mark(function ue(ge){var xe,pe,Se,Ce,Fe,We,xt,kt,Bt,Wt,Me,Ke,nt,Tt,pt;return I().wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(xe=ge.transaction,lt.prev=1,E._connectedAddress){lt.next=4;break}throw new Error("No connected address, please connect first");case 4:return lt.next=6,E.getIsUniversalSign();case 6:return pe=lt.sent,lt.next=9,E.getIsNewSuiSign();case 9:return Se=lt.sent,lt.next=12,xe.toJSON();case 12:return Ce=lt.sent,Fe=Q3.from(Ce),xt=new pb({network:"mainnet",url:(We=E._rpcUrl)!==null&&We!==void 0?We:gb("mainnet")}),Fe.setSender(E._connectedAddress),Fe.getData().expiration||Fe.setExpiration({None:!0}),lt.next=20,Fe.build({client:xt});case 20:if(kt=lt.sent,!(pe&&Se)){lt.next=29;break}return Bt={id:1,jsonrpc:"2.0",method:"sui_signTransaction",params:{sender:E._connectedAddress,transactionJson:Fe.serialize(),txBytes:Ob(kt)}},lt.next=25,E._universalSign({type:"signTransaction",request:Bt});case 25:return Wt=lt.sent,Me=Wt.signature,Ke=Wt.transaction,lt.abrupt("return",{bytes:Ke,signature:Me});case 29:return lt.next=31,E._previewTransaction(Fe.getData());case 31:return lt.next=33,E._keyPair.signTransaction(kt);case 33:return nt=lt.sent,Tt=nt.signature,pt=nt.bytes,lt.abrupt("return",{bytes:pt,signature:Tt});case 39:throw lt.prev=39,lt.t0=lt.catch(1),E.reportError(lt.t0),lt.t0;case 43:case"end":return lt.stop()}},ue,null,[[1,39]])}));return function(ue){return ne.apply(this,arguments)}}());var P=Y(f);le(Y(f),"signAndExecuteTransaction",function(){var ne=T(I().mark(function ue(ge){var xe,pe,Se,Ce,Fe,We,xt,kt,Bt,Wt,Me,Ke,nt,Tt,pt;return I().wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(xe=ge.transaction,lt.prev=1,P._connectedAddress){lt.next=4;break}throw new Error("No connected address, please connect first");case 4:return lt.next=6,xe.toJSON();case 6:return pe=lt.sent,Se=Q3.from(pe),Se.setSender(P._connectedAddress),Fe=new pb({network:"mainnet",url:(Ce=P._rpcUrl)!==null&&Ce!==void 0?Ce:gb("mainnet")}),Se.getData().expiration||Se.setExpiration({None:!0}),lt.next=14,Se.build({client:Fe});case 14:return We=lt.sent,lt.next=17,P.getIsUniversalSign();case 17:return xt=lt.sent,lt.next=20,P.getIsNewSuiSign();case 20:if(kt=lt.sent,!(xt&&kt)){lt.next=30;break}return Bt={id:1,jsonrpc:"2.0",method:"sui_signTransaction",params:{sender:P._connectedAddress,transactionJson:Se.serialize(),txBytes:Ob(We)}},lt.next=25,P._universalSign({type:"sendTransaction",request:Bt});case 25:return Wt=lt.sent,Me=Wt.txHash,Ke=Wt.signature,nt=Wt.transaction,lt.abrupt("return",{digest:Me,bytes:nt??"",signature:Ke??"",effects:""});case 30:return lt.next=32,P._previewTransaction(Se.getData());case 32:return lt.next=34,P._keyPair.signTransaction(We);case 34:return Tt=lt.sent.signature,lt.next=37,P._requestRPC({method:"sui_executeTransactionBlock",params:[Ir.Buffer.from(We).toString("base64"),[Tt]],chainId:it});case 37:return pt=lt.sent,lt.abrupt("return",{digest:pt.digest,bytes:Ir.Buffer.from(We).toString("base64"),signature:Tt,effects:""});case 41:throw lt.prev=41,lt.t0=lt.catch(1),P.reportError(lt.t0),lt.t0;case 45:case"end":return lt.stop()}},ue,null,[[1,41]])}));return function(ue){return ne.apply(this,arguments)}}());var R=Y(f);le(Y(f),"signTransactionBlock",function(){var ne=T(I().mark(function ue(ge){var xe,pe,Se,Ce,Fe,We,xt,kt,Bt,Wt,Me,Ke,nt;return I().wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:if(xe=ge.transactionBlock,pt.prev=1,R._connectedAddress){pt.next=4;break}throw new Error("No connected address, please connect first");case 4:return pt.next=6,R.getIsUniversalSign();case 6:return pe=pt.sent,pt.next=9,R.getIsNewSuiSign();case 9:return Se=pt.sent,Fe=new pb({network:"mainnet",url:(Ce=R._rpcUrl)!==null&&Ce!==void 0?Ce:gb("mainnet")}),xe.setSender(R._connectedAddress),xe.getData().expiration||xe.setExpiration({None:!0}),pt.next=16,xe.build({client:Fe});case 16:if(We=pt.sent,!(pe&&Se)){pt.next=25;break}return xt={id:1,jsonrpc:"2.0",method:"sui_signTransaction",params:{sender:R._connectedAddress,transactionJson:xe.serialize(),txBytes:Ob(We)}},pt.next=21,R._universalSign({type:"signTransaction",request:xt});case 21:return kt=pt.sent,Bt=kt.signature,Wt=kt.transaction,pt.abrupt("return",{signature:Bt,transactionBlockBytes:Wt});case 25:return pt.next=27,R._previewTransaction(xe.getData());case 27:return pt.next=29,R._keyPair.signTransaction(We);case 29:return Me=pt.sent,Ke=Me.signature,nt=Me.bytes,pt.abrupt("return",{signature:Ke,transactionBlockBytes:nt});case 35:throw pt.prev=35,pt.t0=pt.catch(1),R.reportError(pt.t0),pt.t0;case 39:case"end":return pt.stop()}},ue,null,[[1,35]])}));return function(ue){return ne.apply(this,arguments)}}());var q=Y(f);le(Y(f),"signAndExecuteTransactionBlock",function(){var ne=T(I().mark(function ue(ge){var xe,pe,Se,Ce,Fe,We,xt,kt,Bt,Wt,Me;return I().wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:if(xe=ge.transactionBlock,pe=ge.options,Se=ge.requestType,nt.prev=1,q._connectedAddress){nt.next=4;break}throw new Error("No connected address, please connect first");case 4:return xe.setSender(q._connectedAddress),Fe=new pb({network:"mainnet",url:(Ce=q._rpcUrl)!==null&&Ce!==void 0?Ce:gb("mainnet")}),xe.getData().expiration||xe.setExpiration({None:!0}),nt.next=10,xe.build({client:Fe});case 10:return We=nt.sent,nt.next=13,q.getIsUniversalSign();case 13:return xt=nt.sent,nt.next=16,q.getIsNewSuiSign();case 16:if(kt=nt.sent,!(xt&&kt)){nt.next=23;break}return Bt={id:1,jsonrpc:"2.0",method:"sui_signTransaction",params:{sender:q._connectedAddress,transactionJson:xe.serialize(),txBytes:Ob(We)}},nt.next=21,q._universalSign({type:"sendTransaction",request:Bt});case 21:return Wt=nt.sent.txHash,nt.abrupt("return",{digest:Wt});case 23:return nt.next=25,q._previewTransaction(xe.getData());case 25:return nt.next=27,q._keyPair.signTransaction(We);case 27:return Me=nt.sent.signature,nt.abrupt("return",q._requestRPC({method:"sui_executeTransactionBlock",params:[Ir.Buffer.from(We).toString("base64"),[Me]],chainId:it}));case 31:throw nt.prev=31,nt.t0=nt.catch(1),q.reportError(nt.t0),nt.t0;case 35:case"end":return nt.stop()}},ue,null,[[1,31]])}));return function(ue){return ne.apply(this,arguments)}}());var te=Y(f);return le(Y(f),"disconnect",T(I().mark(function ne(){return I().wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return ge.abrupt("return",te._requestDisconnect());case 1:case"end":return ge.stop()}},ne)}))),_0(Y(f)),f}return Ln(s,[{key:"version",get:function(){return"1.0.0"}},{key:"name",get:function(){return Tn}},{key:"icon",get:function(){return Sn}},{key:"chains",get:function(){return[nM]}},{key:"accounts",get:function(){if(!this._connectedAddress)return[];var d=new __({address:this._connectedAddress,publicKey:Ir.Buffer.from(this._connectedPubKey,"hex"),chains:this.chains,features:Object.values(hc)});return[d]}},{key:"getIsNewSuiSign",value:function(){var d=this;return T(I().mark(function h(){return I().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.abrupt("return",d._request(In.requestIsNewSuiSign));case 1:case"end":return P.stop()}},h)}))()}},{key:"features",get:function(){var d=this,h;return h={},le(h,hc.STANDARD__CONNECT,{version:"1.0.0",connect:this.connect}),le(h,hc.STANDARD__DISCONNECT,{version:"1.0.0",disconnect:this.disconnect}),le(h,hc.STANDARD__EVENTS,{version:"1.0.0",on:function(E,P){d.on(E,P)}}),le(h,hc.SUI__SIGN_AND_EXECUTE_TRANSACTION_BLOCK,{version:"1.0.0",signAndExecuteTransactionBlock:this.signAndExecuteTransactionBlock}),le(h,hc.SUI__SIGN_TRANSACTION_BLOCK,{version:"1.0.0",signTransactionBlock:this.signTransactionBlock}),le(h,hc.SUI__SIGN_TRANSACTION,{version:"2.0.0",signTransaction:this.signTransaction}),le(h,hc.SUI__SIGN_AND_EXECUTE_TRANSACTION,{version:"2.0.0",signAndExecuteTransaction:this.signAndExecuteTransaction}),le(h,hc.SUI__SIGN_PERSONAL_MESSAGE,{version:"1.1.0",signPersonalMessage:this.signPersonalMessage}),h}},{key:"_keyPair",get:function(){var d=this,h=new tM;return h.getPublicKey=function(){return new C5(d.accounts[0].publicKey)},h.sign=function(E){return d._requestSign({data:E})},h}}]),s}(yu),W5=255,G5=65535,Rb=4294967295,Nb=18446744073709551615n,x_=340282366920938463463374607431768211455n,q5=115792089237316195423570985008687907853269984665640564039457584007913129639935n,qc=class extends Error{constructor(t,e){super(t),this.invalidReason=e}};function Ub(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function zG(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function EM(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function Wp(t,...e){if(!EM(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function SM(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ub(t.outputLen),Ub(t.blockLen)}function Sh(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Z5(t,e){Wp(t);const s=e.outputLen;if(t.length<s)throw new Error(`digestInto() expects output buffer of length at least ${s}`)}const HG=null,KG=null;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $G(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}const VG=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),AM=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),I_=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Zc=(t,e)=>t<<32-e|t>>>e,WG=(t,e)=>t<<e|t>>>32-e>>>0,X5=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,xM=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,GG=null;function Y5(t){for(let e=0;e<t.length;e++)t[e]=xM(t[e])}const IM=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function B_(t){Wp(t);let e="";for(let s=0;s<t.length;s++)e+=IM[t[s]];return e}const Cu={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function J5(t){if(t>=Cu._0&&t<=Cu._9)return t-Cu._0;if(t>=Cu._A&&t<=Cu._F)return t-(Cu._A-10);if(t>=Cu._a&&t<=Cu._f)return t-(Cu._a-10)}function Q5(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,s=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const f=new Uint8Array(s);for(let d=0,h=0;d<s;d++,h+=2){const E=J5(t.charCodeAt(h)),P=J5(t.charCodeAt(h+1));if(E===void 0||P===void 0){const R=t[h]+t[h+1];throw new Error('hex string expected, got non-hex character "'+R+'" at index '+h)}f[d]=E*16+P}return f}const BM=async()=>{};async function qG(t,e,s){let f=Date.now();for(let d=0;d<t;d++){s(d);const h=Date.now()-f;h>=0&&h<e||(await BM(),f+=h)}}function kM(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Ah(t){return typeof t=="string"&&(t=kM(t)),Wp(t),t}function ZG(...t){let e=0;for(let f=0;f<t.length;f++){const d=t[f];abytes(d),e+=d.length}const s=new Uint8Array(e);for(let f=0,d=0;f<t.length;f++){const h=t[f];s.set(h,d),d+=h.length}return s}class k_{clone(){return this._cloneInto()}}const TM=null;function XG(t,e){if(e!==void 0&&TM.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function T_(t){const e=f=>t().update(Ah(f)).digest(),s=t();return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=()=>t(),e}function YG(t){const e=(f,d)=>t(d).update(Ah(f)).digest(),s=t({});return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=f=>t(f),e}function JG(t){const e=(f,d)=>t(d).update(Ah(f)).digest(),s=t({});return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=f=>t(f),e}function QG(t=32){if(crypto&&typeof crypto.getRandomValues=="function")return crypto.getRandomValues(new Uint8Array(t));if(crypto&&typeof crypto.randomBytes=="function")return crypto.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}var CM=(t=>(t.TOO_SHORT="too_short",t.INVALID_LENGTH="invalid_length",t.INVALID_HEX_CHARS="invalid_hex_chars",t))(CM||{}),Qs=class qg{constructor(e){this.data=e}toUint8Array(){return this.data}toStringWithoutPrefix(){return B_(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromString(e){let s=e;if(s.startsWith("0x")&&(s=s.slice(2)),s.length===0)throw new qc("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(s.length%2!==0)throw new qc("Hex string must be an even number of hex characters.","invalid_length");try{return new qg(Q5(s))}catch(f){throw new qc(`Hex string contains invalid hex characters: ${f?.message}`,"invalid_hex_chars")}}static fromHexInput(e){return e instanceof Uint8Array?new qg(e):qg.fromString(e)}static isValid(e){try{return qg.fromString(e),{valid:!0}}catch(s){return{valid:!1,invalidReason:s?.invalidReason,invalidReasonMessage:s?.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((s,f)=>s===e.data[f])}},PM=Object.defineProperty,MM=Object.getOwnPropertyDescriptor,pc=(t,e,s,f)=>{for(var d=f>1?void 0:f?MM(e,s):e,h=t.length-1,E;h>=0;h--)(E=t[h])&&(d=(f?E(e,s,d):E(d))||d);return f&&d&&PM(e,s,d),d},Ri=class{bcsToBytes(){let t=new Pu;return this.serialize(t),t.toUint8Array()}bcsToHex(){let t=this.bcsToBytes();return Qs.fromHexInput(t)}},Pu=class{constructor(t=64){if(t<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(t),this.offset=0}ensureBufferWillHandleSize(t){for(;this.buffer.byteLength<this.offset+t;){let e=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(e).set(new Uint8Array(this.buffer)),this.buffer=e}}appendToBuffer(t){this.ensureBufferWillHandleSize(t.length),new Uint8Array(this.buffer,this.offset).set(t),this.offset+=t.length}serializeWithFunction(t,e,s){this.ensureBufferWillHandleSize(e);let f=new DataView(this.buffer,this.offset);t.apply(f,[0,s,!0]),this.offset+=e}serializeStr(t){let e=new TextEncoder;this.serializeBytes(e.encode(t))}serializeBytes(t){this.serializeU32AsUleb128(t.length),this.appendToBuffer(t)}serializeFixedBytes(t){this.appendToBuffer(t)}serializeBool(t){eA(t);let e=t?1:0;this.appendToBuffer(new Uint8Array([e]))}serializeU8(t){this.appendToBuffer(new Uint8Array([t]))}serializeU16(t){this.serializeWithFunction(DataView.prototype.setUint16,2,t)}serializeU32(t){this.serializeWithFunction(DataView.prototype.setUint32,4,t)}serializeU64(t){let e=BigInt(t)&BigInt(Rb),s=BigInt(t)>>BigInt(32);this.serializeU32(Number(e)),this.serializeU32(Number(s))}serializeU128(t){let e=BigInt(t)&Nb,s=BigInt(t)>>BigInt(64);this.serializeU64(e),this.serializeU64(s)}serializeU256(t){let e=BigInt(t)&x_,s=BigInt(t)>>BigInt(128);this.serializeU128(e),this.serializeU128(s)}serializeU32AsUleb128(t){let e=t,s=[];for(;e>>>7;)s.push(e&127|128),e>>>=7;s.push(e),this.appendToBuffer(new Uint8Array(s))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(t){t.serialize(this)}serializeVector(t){this.serializeU32AsUleb128(t.length),t.forEach(e=>{e.serialize(this)})}};pc([Wf(0,W5)],Pu.prototype,"serializeU8",1),pc([Wf(0,G5)],Pu.prototype,"serializeU16",1),pc([Wf(0,Rb)],Pu.prototype,"serializeU32",1),pc([Wf(BigInt(0),Nb)],Pu.prototype,"serializeU64",1),pc([Wf(BigInt(0),x_)],Pu.prototype,"serializeU128",1),pc([Wf(BigInt(0),q5)],Pu.prototype,"serializeU256",1),pc([Wf(0,Rb)],Pu.prototype,"serializeU32AsUleb128",1);function eA(t){if(typeof t!="boolean")throw new Error(`${t} is not a boolean value`)}var OM=(t,e,s)=>`${t} is out of range: [${e}, ${s}]`;function Vf(t,e,s){let f=BigInt(t);if(f>BigInt(s)||f<BigInt(e))throw new Error(OM(t,e,s))}function Wf(t,e){return(s,f,d)=>{let h=d.value;return d.value=function(E){return Vf(E,t,e),h.apply(this,[E])},d}}var RM=(t=>(t.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",t.INVALID_HEX_CHARS="invalid_hex_chars",t.TOO_SHORT="too_short",t.TOO_LONG="too_long",t.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",t.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",t.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",t))(RM||{}),ka=class qo extends Ri{constructor(e){if(super(),e.length!==qo.LENGTH)throw new qc("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=B_(this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return B_(this.data)}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let s=e.deserializeFixedBytes(qo.LENGTH);return new qo(s)}static fromStringStrict(e){if(!e.startsWith("0x"))throw new qc("Hex string must start with a leading 0x.","leading_zero_x_required");let s=qo.fromString(e);if(e.length!==qo.LONG_STRING_LENGTH+2)if(s.isSpecial()){if(e.length!==3)throw new qc(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new qc(`The given hex string ${e} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return s}static fromString(e){let s=e;if(e.startsWith("0x")&&(s=e.slice(2)),s.length===0)throw new qc("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(s.length>64)throw new qc("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let f;try{f=Q5(s.padStart(64,"0"))}catch(d){throw new qc(`Hex characters are invalid: ${d?.message}`,"invalid_hex_chars")}return new qo(f)}static from(e){return e instanceof qo?e:e instanceof Uint8Array?new qo(e):qo.fromString(e)}static fromStrict(e){return e instanceof qo?e:e instanceof Uint8Array?new qo(e):qo.fromStringStrict(e)}static isValid(e){try{return e.strict?qo.fromStrict(e.input):qo.from(e.input),{valid:!0}}catch(s){return{valid:!1,invalidReason:s?.invalidReason,invalidReasonMessage:s?.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((s,f)=>s===e.data[f])}};ka.LENGTH=32,ka.LONG_STRING_LENGTH=64,ka.ZERO=ka.from("0x0"),ka.ONE=ka.from("0x1"),ka.TWO=ka.from("0x2"),ka.THREE=ka.from("0x3"),ka.FOUR=ka.from("0x4");var fr=ka,NM=`
|
||
fragment TokenActivitiesFields on token_activities_v2 {
|
||
after_value
|
||
before_value
|
||
entry_function_id_str
|
||
event_account_address
|
||
event_index
|
||
from_address
|
||
is_fungible_v2
|
||
property_version_v1
|
||
to_address
|
||
token_amount
|
||
token_data_id
|
||
token_standard
|
||
transaction_timestamp
|
||
transaction_version
|
||
type
|
||
}
|
||
`,UM=`
|
||
fragment AnsTokenFragment on current_aptos_names {
|
||
domain
|
||
expiration_timestamp
|
||
registered_address
|
||
subdomain
|
||
token_standard
|
||
is_primary
|
||
owner_address
|
||
}
|
||
`,Db=`
|
||
fragment CurrentTokenOwnershipFields on current_token_ownerships_v2 {
|
||
token_standard
|
||
token_properties_mutated_v1
|
||
token_data_id
|
||
table_type_v1
|
||
storage_id
|
||
property_version_v1
|
||
owner_address
|
||
last_transaction_version
|
||
last_transaction_timestamp
|
||
is_soulbound_v2
|
||
is_fungible_v2
|
||
amount
|
||
current_token_data {
|
||
collection_id
|
||
description
|
||
is_fungible_v2
|
||
largest_property_version_v1
|
||
last_transaction_timestamp
|
||
last_transaction_version
|
||
maximum
|
||
supply
|
||
token_data_id
|
||
token_name
|
||
token_properties
|
||
token_standard
|
||
token_uri
|
||
decimals
|
||
current_collection {
|
||
collection_id
|
||
collection_name
|
||
creator_address
|
||
current_supply
|
||
description
|
||
last_transaction_timestamp
|
||
last_transaction_version
|
||
max_supply
|
||
mutable_description
|
||
mutable_uri
|
||
table_handle_v1
|
||
token_standard
|
||
total_minted_v2
|
||
uri
|
||
}
|
||
}
|
||
}
|
||
`,tA=`
|
||
query getAccountCoinsCount($address: String) {
|
||
current_fungible_asset_balances_aggregate(
|
||
where: {owner_address: {_eq: $address}}
|
||
) {
|
||
aggregate {
|
||
count
|
||
}
|
||
}
|
||
}
|
||
`,nA=`
|
||
query getAccountCoinsData($where_condition: current_fungible_asset_balances_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_fungible_asset_balances_order_by!]) {
|
||
current_fungible_asset_balances(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
order_by: $order_by
|
||
) {
|
||
amount
|
||
asset_type
|
||
is_frozen
|
||
is_primary
|
||
last_transaction_timestamp
|
||
last_transaction_version
|
||
owner_address
|
||
storage_id
|
||
token_standard
|
||
metadata {
|
||
token_standard
|
||
symbol
|
||
supply_aggregator_table_key_v1
|
||
supply_aggregator_table_handle_v1
|
||
project_uri
|
||
name
|
||
last_transaction_version
|
||
last_transaction_timestamp
|
||
icon_uri
|
||
decimals
|
||
creator_address
|
||
asset_type
|
||
}
|
||
}
|
||
}
|
||
`,rA=`
|
||
query getAccountCollectionsWithOwnedTokens($where_condition: current_collection_ownership_v2_view_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_collection_ownership_v2_view_order_by!]) {
|
||
current_collection_ownership_v2_view(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
order_by: $order_by
|
||
) {
|
||
current_collection {
|
||
collection_id
|
||
collection_name
|
||
creator_address
|
||
current_supply
|
||
description
|
||
last_transaction_timestamp
|
||
last_transaction_version
|
||
mutable_description
|
||
max_supply
|
||
mutable_uri
|
||
table_handle_v1
|
||
token_standard
|
||
total_minted_v2
|
||
uri
|
||
}
|
||
collection_id
|
||
collection_name
|
||
collection_uri
|
||
creator_address
|
||
distinct_tokens
|
||
last_transaction_version
|
||
owner_address
|
||
single_token_uri
|
||
}
|
||
}
|
||
`,iA=`
|
||
query getAccountOwnedObjects($where_condition: current_objects_bool_exp, $offset: Int, $limit: Int, $order_by: [current_objects_order_by!]) {
|
||
current_objects(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
order_by: $order_by
|
||
) {
|
||
allow_ungated_transfer
|
||
state_key_hash
|
||
owner_address
|
||
object_address
|
||
last_transaction_version
|
||
last_guid_creation_num
|
||
is_deleted
|
||
}
|
||
}
|
||
`,sA=`
|
||
query getAccountOwnedTokens($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
||
current_token_ownerships_v2(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
order_by: $order_by
|
||
) {
|
||
...CurrentTokenOwnershipFields
|
||
}
|
||
}
|
||
${Db}`,DM=`
|
||
query getAccountOwnedTokensByTokenData($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
||
current_token_ownerships_v2(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
order_by: $order_by
|
||
) {
|
||
...CurrentTokenOwnershipFields
|
||
}
|
||
}
|
||
${Db}`,oA=`
|
||
query getAccountOwnedTokensFromCollection($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
||
current_token_ownerships_v2(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
order_by: $order_by
|
||
) {
|
||
...CurrentTokenOwnershipFields
|
||
}
|
||
}
|
||
${Db}`,aA=`
|
||
query getAccountTokensCount($where_condition: current_token_ownerships_v2_bool_exp, $offset: Int, $limit: Int) {
|
||
current_token_ownerships_v2_aggregate(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
) {
|
||
aggregate {
|
||
count
|
||
}
|
||
}
|
||
}
|
||
`,cA=`
|
||
query getAccountTransactionsCount($address: String) {
|
||
account_transactions_aggregate(where: {account_address: {_eq: $address}}) {
|
||
aggregate {
|
||
count
|
||
}
|
||
}
|
||
}
|
||
`,uA=`
|
||
query getChainTopUserTransactions($limit: Int) {
|
||
user_transactions(limit: $limit, order_by: {version: desc}) {
|
||
version
|
||
}
|
||
}
|
||
`,C_=`
|
||
query getCollectionData($where_condition: current_collections_v2_bool_exp!) {
|
||
current_collections_v2(where: $where_condition) {
|
||
collection_id
|
||
collection_name
|
||
creator_address
|
||
current_supply
|
||
description
|
||
last_transaction_timestamp
|
||
last_transaction_version
|
||
max_supply
|
||
mutable_description
|
||
mutable_uri
|
||
table_handle_v1
|
||
token_standard
|
||
total_minted_v2
|
||
uri
|
||
}
|
||
}
|
||
`,lA=`
|
||
query getCurrentFungibleAssetBalances($where_condition: current_fungible_asset_balances_bool_exp, $offset: Int, $limit: Int) {
|
||
current_fungible_asset_balances(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
) {
|
||
amount
|
||
asset_type
|
||
is_frozen
|
||
is_primary
|
||
last_transaction_timestamp
|
||
last_transaction_version
|
||
owner_address
|
||
storage_id
|
||
token_standard
|
||
}
|
||
}
|
||
`,fA=`
|
||
query getDelegatedStakingActivities($delegatorAddress: String, $poolAddress: String) {
|
||
delegated_staking_activities(
|
||
where: {delegator_address: {_eq: $delegatorAddress}, pool_address: {_eq: $poolAddress}}
|
||
) {
|
||
amount
|
||
delegator_address
|
||
event_index
|
||
event_type
|
||
pool_address
|
||
transaction_version
|
||
}
|
||
}
|
||
`,dA=`
|
||
query getEvents($where_condition: events_bool_exp, $offset: Int, $limit: Int, $order_by: [events_order_by!]) {
|
||
events(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
order_by: $order_by
|
||
) {
|
||
account_address
|
||
creation_number
|
||
data
|
||
event_index
|
||
sequence_number
|
||
transaction_block_height
|
||
transaction_version
|
||
type
|
||
indexed_type
|
||
}
|
||
}
|
||
`,hA=`
|
||
query getFungibleAssetActivities($where_condition: fungible_asset_activities_bool_exp, $offset: Int, $limit: Int) {
|
||
fungible_asset_activities(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
) {
|
||
amount
|
||
asset_type
|
||
block_height
|
||
entry_function_id_str
|
||
event_index
|
||
gas_fee_payer_address
|
||
is_frozen
|
||
is_gas_fee
|
||
is_transaction_success
|
||
owner_address
|
||
storage_id
|
||
storage_refund_amount
|
||
token_standard
|
||
transaction_timestamp
|
||
transaction_version
|
||
type
|
||
}
|
||
}
|
||
`,pA=`
|
||
query getFungibleAssetMetadata($where_condition: fungible_asset_metadata_bool_exp, $offset: Int, $limit: Int) {
|
||
fungible_asset_metadata(where: $where_condition, offset: $offset, limit: $limit) {
|
||
icon_uri
|
||
project_uri
|
||
supply_aggregator_table_handle_v1
|
||
supply_aggregator_table_key_v1
|
||
creator_address
|
||
asset_type
|
||
decimals
|
||
last_transaction_timestamp
|
||
last_transaction_version
|
||
name
|
||
symbol
|
||
token_standard
|
||
}
|
||
}
|
||
`,xh=`
|
||
query getNames($offset: Int, $limit: Int, $where_condition: current_aptos_names_bool_exp, $order_by: [current_aptos_names_order_by!]) {
|
||
current_aptos_names(
|
||
limit: $limit
|
||
where: $where_condition
|
||
order_by: $order_by
|
||
offset: $offset
|
||
) {
|
||
...AnsTokenFragment
|
||
}
|
||
}
|
||
${UM}`,P_=`
|
||
query getNumberOfDelegators($where_condition: num_active_delegator_per_pool_bool_exp, $order_by: [num_active_delegator_per_pool_order_by!]) {
|
||
num_active_delegator_per_pool(where: $where_condition, order_by: $order_by) {
|
||
num_active_delegator
|
||
pool_address
|
||
}
|
||
}
|
||
`,M_=`
|
||
query getProcessorStatus($where_condition: processor_status_bool_exp) {
|
||
processor_status(where: $where_condition) {
|
||
last_success_version
|
||
processor
|
||
last_updated
|
||
}
|
||
}
|
||
`,gA=`
|
||
query getTokenActivity($where_condition: token_activities_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [token_activities_v2_order_by!]) {
|
||
token_activities_v2(
|
||
where: $where_condition
|
||
order_by: $order_by
|
||
offset: $offset
|
||
limit: $limit
|
||
) {
|
||
...TokenActivitiesFields
|
||
}
|
||
}
|
||
${NM}`,O_=`
|
||
query getCurrentTokenOwnership($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
||
current_token_ownerships_v2(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
order_by: $order_by
|
||
) {
|
||
...CurrentTokenOwnershipFields
|
||
}
|
||
}
|
||
${Db}`,yA=`
|
||
query getTokenData($where_condition: current_token_datas_v2_bool_exp, $offset: Int, $limit: Int, $order_by: [current_token_datas_v2_order_by!]) {
|
||
current_token_datas_v2(
|
||
where: $where_condition
|
||
offset: $offset
|
||
limit: $limit
|
||
order_by: $order_by
|
||
) {
|
||
collection_id
|
||
description
|
||
is_fungible_v2
|
||
largest_property_version_v1
|
||
last_transaction_timestamp
|
||
last_transaction_version
|
||
maximum
|
||
supply
|
||
token_data_id
|
||
token_name
|
||
token_properties
|
||
token_standard
|
||
token_uri
|
||
decimals
|
||
current_collection {
|
||
collection_id
|
||
collection_name
|
||
creator_address
|
||
current_supply
|
||
description
|
||
last_transaction_timestamp
|
||
last_transaction_version
|
||
max_supply
|
||
mutable_description
|
||
mutable_uri
|
||
table_handle_v1
|
||
token_standard
|
||
total_minted_v2
|
||
uri
|
||
}
|
||
}
|
||
}
|
||
`,LM=(t,e,s)=>t();function eq(t,e=LM){return{getAccountCoinsCount(s,f){return e(d=>t.request(tA,s,{...f,...d}),"getAccountCoinsCount","query")},getAccountCoinsData(s,f){return e(d=>t.request(nA,s,{...f,...d}),"getAccountCoinsData","query")},getAccountCollectionsWithOwnedTokens(s,f){return e(d=>t.request(rA,s,{...f,...d}),"getAccountCollectionsWithOwnedTokens","query")},getAccountOwnedObjects(s,f){return e(d=>t.request(iA,s,{...f,...d}),"getAccountOwnedObjects","query")},getAccountOwnedTokens(s,f){return e(d=>t.request(sA,s,{...f,...d}),"getAccountOwnedTokens","query")},getAccountOwnedTokensByTokenData(s,f){return e(d=>t.request(DM,s,{...f,...d}),"getAccountOwnedTokensByTokenData","query")},getAccountOwnedTokensFromCollection(s,f){return e(d=>t.request(oA,s,{...f,...d}),"getAccountOwnedTokensFromCollection","query")},getAccountTokensCount(s,f){return e(d=>t.request(aA,s,{...f,...d}),"getAccountTokensCount","query")},getAccountTransactionsCount(s,f){return e(d=>t.request(cA,s,{...f,...d}),"getAccountTransactionsCount","query")},getChainTopUserTransactions(s,f){return e(d=>t.request(uA,s,{...f,...d}),"getChainTopUserTransactions","query")},getCollectionData(s,f){return e(d=>t.request(C_,s,{...f,...d}),"getCollectionData","query")},getCurrentFungibleAssetBalances(s,f){return e(d=>t.request(lA,s,{...f,...d}),"getCurrentFungibleAssetBalances","query")},getDelegatedStakingActivities(s,f){return e(d=>t.request(fA,s,{...f,...d}),"getDelegatedStakingActivities","query")},getEvents(s,f){return e(d=>t.request(dA,s,{...f,...d}),"getEvents","query")},getFungibleAssetActivities(s,f){return e(d=>t.request(hA,s,{...f,...d}),"getFungibleAssetActivities","query")},getFungibleAssetMetadata(s,f){return e(d=>t.request(pA,s,{...f,...d}),"getFungibleAssetMetadata","query")},getNames(s,f){return e(d=>t.request(xh,s,{...f,...d}),"getNames","query")},getNumberOfDelegators(s,f){return e(d=>t.request(P_,s,{...f,...d}),"getNumberOfDelegators","query")},getProcessorStatus(s,f){return e(d=>t.request(M_,s,{...f,...d}),"getProcessorStatus","query")},getTokenActivity(s,f){return e(d=>t.request(gA,s,{...f,...d}),"getTokenActivity","query")},getCurrentTokenOwnership(s,f){return e(d=>t.request(O_,s,{...f,...d}),"getCurrentTokenOwnership","query")},getTokenData(s,f){return e(d=>t.request(yA,s,{...f,...d}),"getTokenData","query")}}}var Gp=class extends Error{constructor(t,e,s){super(s),this.name="AptosApiError",this.url=e.url,this.status=e.status,this.statusText=e.statusText,this.data=e.data,this.request=t}},FM="1.11.0",mA={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function jM(t,e){let{url:s,method:f,body:d,contentType:h,params:E,overrides:P}=t,R={...P?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${FM}`,"content-type":h??"application/json"};return P?.AUTH_TOKEN&&(R.Authorization=`Bearer ${P?.AUTH_TOKEN}`),P?.API_KEY&&(R.Authorization=`Bearer ${P?.API_KEY}`),e.provider({url:s,method:f,body:d,params:E,headers:R,overrides:P})}async function bA(t,e,s){let{url:f,path:d}=t,h=d?`${f}/${d}`:f,E=await jM({...t,url:h},e.client),P={status:E.status,statusText:E.statusText,data:E.data,headers:E.headers,config:E.config,request:E.request,url:h};if(P.status===401)throw new Gp(t,P,`Error: ${P.data}`);if(s==="Indexer"){let q=P.data;if(q.errors)throw new Gp(t,P,`Indexer error: ${q.errors[0].message}`??0);P.data=q.data}if(P.status>=200&&P.status<300)return P;let R;throw P&&P.data&&"message"in P.data&&"error_code"in P.data?R=JSON.stringify(P.data):P.status in mA?R=mA[P.status]:R=`Unhandled Error ${P.status} : ${P.statusText}`,new Gp(t,P,`${s} error: ${R}`)}async function vA(t){let{aptosConfig:e,overrides:s,params:f,contentType:d,acceptType:h,path:E,originMethod:P,type:R}=t,q=e.getRequestUrl(R);return bA({url:q,method:"GET",originMethod:P,path:E,contentType:d,acceptType:h,params:f,overrides:{...e.clientConfig,...s}},e,t.type)}async function Mu(t){let{aptosConfig:e}=t;return vA({...t,type:"Fullnode",overrides:{...e.clientConfig,...e.fullnodeConfig,...t.overrides,HEADERS:{...e.clientConfig?.HEADERS,...e.fullnodeConfig?.HEADERS}}})}async function Lb(t){let e=[],s,f=t.params;do{let d=await vA({type:"Fullnode",aptosConfig:t.aptosConfig,originMethod:t.originMethod,path:t.path,params:f,overrides:t.overrides});s=d.headers["x-aptos-cursor"],delete d.headers,e.push(...d.data),f.start=s}while(s!=null);return e}async function R_(t){let{type:e,originMethod:s,path:f,body:d,acceptType:h,contentType:E,params:P,aptosConfig:R,overrides:q}=t,te=R.getRequestUrl(e);return bA({url:te,method:"POST",originMethod:s,path:f,body:d,contentType:E,acceptType:h,params:P,overrides:q},R,t.type)}async function Fb(t){let{aptosConfig:e}=t;return R_({...t,type:"Fullnode",overrides:{...e.clientConfig,...e.fullnodeConfig,...t.overrides,HEADERS:{...e.clientConfig?.HEADERS,...e.fullnodeConfig?.HEADERS}}})}async function zM(t){let{aptosConfig:e}=t;return R_({...t,type:"Indexer",overrides:{...e.clientConfig,...e.indexerConfig,...t.overrides,HEADERS:{...e.clientConfig?.HEADERS,...e.indexerConfig?.HEADERS}}})}async function HM(t){let{aptosConfig:e}=t,s={...e,clientConfig:{...e.clientConfig}};return delete s?.clientConfig?.API_KEY,R_({...t,type:"Faucet",overrides:{...s.clientConfig,...s.faucetConfig,...t.overrides,HEADERS:{...s.clientConfig?.HEADERS,...s.faucetConfig?.HEADERS}}})}async function wA(t){let{aptosConfig:e}=t,{data:s}=await Mu({aptosConfig:e,originMethod:"getLedgerInfo",path:""});return s}async function KM(t){let{aptosConfig:e,ledgerVersion:s,options:f}=t,{data:d}=await Mu({aptosConfig:e,originMethod:"getBlockByVersion",path:`blocks/by_version/${s}`,params:{with_transactions:f?.withTransactions}});return d}async function $M(t){let{aptosConfig:e,blockHeight:s,options:f}=t,{data:d}=await Mu({aptosConfig:e,originMethod:"getBlockByHeight",path:`blocks/by_height/${s}`,params:{with_transactions:f?.withTransactions}});return d}async function _A(t){let{aptosConfig:e,handle:s,data:f,options:d}=t;return(await Fb({aptosConfig:e,originMethod:"getTableItem",path:`tables/${s}/item`,params:{ledger_version:d?.ledgerVersion},body:f})).data}async function VM(t){let{aptosConfig:e,limit:s}=t;return(await Fi({aptosConfig:e,query:{query:uA,variables:{limit:s}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function Fi(t){let{aptosConfig:e,query:s,originMethod:f}=t,{data:d}=await zM({aptosConfig:e,originMethod:f??"queryIndexer",path:"",body:s,overrides:{WITH_CREDENTIALS:!1}});return d}async function WM(t){let{aptosConfig:e}=t;return(await Fi({aptosConfig:e,query:{query:M_},originMethod:"getProcessorStatuses"})).processor_status}async function EA(t){let e=await WM({aptosConfig:t.aptosConfig});return BigInt(e[0].last_success_version)}async function SA(t){let{aptosConfig:e,processorType:s}=t;return(await Fi({aptosConfig:e,query:{query:M_,variables:{where_condition:{processor:{_eq:s}}}},originMethod:"getProcessorStatus"})).processor_status[0]}var AA=300,GM=t=>{if(t&&t.length>AA)throw new Error(`Event type length exceeds the maximum length of ${AA}`)};async function qM(t){let{aptosConfig:e,eventType:s,options:f}=t,d={where:{account_address:{_eq:"0x0000000000000000000000000000000000000000000000000000000000000000"},creation_number:{_eq:"0"},sequence_number:{_eq:"0"},indexed_type:{_eq:s}},pagination:f,orderBy:f?.orderBy};return jb({aptosConfig:e,options:d})}async function ZM(t){let{accountAddress:e,aptosConfig:s,creationNumber:f,options:d}=t,h={where:{account_address:{_eq:fr.from(e).toStringLong()},creation_number:{_eq:f}},pagination:d,orderBy:d?.orderBy};return jb({aptosConfig:s,options:h})}async function XM(t){let{accountAddress:e,aptosConfig:s,eventType:f,options:d}=t,h={where:{account_address:{_eq:fr.from(e).toStringLong()},indexed_type:{_eq:f}},pagination:d,orderBy:d?.orderBy};return jb({aptosConfig:s,options:h})}async function jb(t){let{aptosConfig:e,options:s}=t;GM(s?.where?.indexed_type?._eq);let f={query:dA,variables:{where_condition:s?.where,offset:s?.offset,limit:s?.limit,order_by:s?.orderBy}};return(await Fi({aptosConfig:e,query:f,originMethod:"getEvents"})).events}async function Ih(t){return new Promise(e=>{setTimeout(e,t)})}var Bh=new Map;function N_(t,e,s){return async(...f)=>{if(Bh.has(e)){let{value:h,timestamp:E}=Bh.get(e);if(s===void 0||Date.now()-E<=s)return h}let d=await t(...f);return Bh.set(e,{value:d,timestamp:Date.now()}),d}}function tq(t,e,s){return(...f)=>{if(Bh.has(e)){let{value:h,timestamp:E}=Bh.get(e);if(s===void 0||Date.now()-E<=s)return h}let d=t(...f);return Bh.set(e,{value:d,timestamp:Date.now()}),d}}var YM=(t=>(t.FULLNODE="Fullnode",t.INDEXER="Indexer",t.FAUCET="Faucet",t))(YM||{}),nq=2e5,rq=20,iq=20,xA="0x1::aptos_coin::AptosCoin",JM="APTOS::RawTransaction",IA="APTOS::RawTransactionWithData",QM=(t=>(t.ACCOUNT_TRANSACTION_PROCESSOR="account_transactions_processor",t.DEFAULT="default_processor",t.EVENTS_PROCESSOR="events_processor",t.FUNGIBLE_ASSET_PROCESSOR="fungible_asset_processor",t.STAKE_PROCESSOR="stake_processor",t.TOKEN_V2_PROCESSOR="token_v2_processor",t.USER_TRANSACTION_PROCESSOR="user_transaction_processor",t))(QM||{});async function eO(t){let{aptosConfig:e,options:s}=t;return Lb({aptosConfig:e,originMethod:"getTransactions",path:"transactions",params:{start:s?.offset,limit:s?.limit}})}async function BA(t){let{aptosConfig:e}=t;return N_(async()=>{let{data:s}=await Mu({aptosConfig:e,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return s},`gas-price-${e.network}`,1e3*60*5)()}async function tO(t){let{aptosConfig:e,ledgerVersion:s}=t,{data:f}=await Mu({aptosConfig:e,originMethod:"getTransactionByVersion",path:`transactions/by_version/${s}`});return f}async function U_(t){let{aptosConfig:e,transactionHash:s}=t,{data:f}=await Mu({aptosConfig:e,path:`transactions/by_hash/${s}`,originMethod:"getTransactionByHash"});return f}async function nO(t){let{aptosConfig:e,transactionHash:s}=t;try{return(await U_({aptosConfig:e,transactionHash:s})).type==="pending_transaction"}catch(f){if(f?.status===404)return!0;throw f}}async function D_(t){let{aptosConfig:e,transactionHash:s,options:f}=t,d=f?.timeoutSecs??20,h=f?.checkSuccess??!0,E=!0,P=0,R,q,te=200,ne=1.5;for(;E&&!(P>=d);){try{if(R=await U_({aptosConfig:e,transactionHash:s}),E=R.type==="pending_transaction",!E)break}catch(ue){if(!(ue instanceof Gp)||(q=ue,ue.status!==404&&ue.status>=400&&ue.status<500))throw ue}await Ih(te),P+=te/1e3,te*=ne}if(R===void 0)throw q||new TA(`Fetching transaction ${s} failed and timed out after ${d} seconds`,R);if(R.type==="pending_transaction")throw new TA(`Transaction ${s} timed out in pending state after ${d} seconds`,R);if(!h)return R;if(!R.success)throw new rO(`Transaction ${s} failed with an error: ${R.vm_status}`,R);return R}async function kA(t){let{aptosConfig:e,processorType:s}=t,f=BigInt(t.minimumLedgerVersion),d=3e3,h=new Date().getTime(),E=BigInt(-1);for(;E<f;){if(new Date().getTime()-h>d)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(s===void 0?E=await EA({aptosConfig:e}):E=(await SA({aptosConfig:e,processorType:s})).last_success_version,E>=f)break;await Ih(200)}}var TA=class extends Error{constructor(t,e){super(t),this.lastSubmittedTransaction=e}},rO=class extends Error{constructor(t,e){super(t),this.transaction=e}};async function qi(t){t.minimumLedgerVersion!==void 0&&await kA({aptosConfig:t.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:t.processorType})}var CA=class{constructor(t){this.config=t}async getModuleEventsByEventType(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"events_processor"}),qM({aptosConfig:this.config,...t})}async getAccountEventsByCreationNumber(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"events_processor"}),ZM({aptosConfig:this.config,...t})}async getAccountEventsByEventType(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"events_processor"}),XM({aptosConfig:this.config,...t})}async getEvents(t){return await qi({config:this.config,minimumLedgerVersion:t?.minimumLedgerVersion,processorType:"events_processor"}),jb({aptosConfig:this.config,...t})}};async function iO(t){let{aptosConfig:e,accountAddress:s,amount:f,options:d}=t,h=d?.timeoutSecs||20,{data:E}=await HM({aptosConfig:e,path:"fund",body:{address:fr.from(s).toString(),amount:f},originMethod:"fundAccount"}),P=E.txn_hashes[0],R=await D_({aptosConfig:e,transactionHash:P,options:{timeoutSecs:h,checkSuccess:d?.checkSuccess}});if(R.type==="user_transaction")return R;throw new Error(`Unexpected transaction received for fund account: ${R.type}`)}var PA=class{constructor(t){this.config=t}async fundAccount(t){let e=await iO({aptosConfig:this.config,...t});return t.options?.waitForIndexer!==!1&&await kA({aptosConfig:this.config,minimumLedgerVersion:BigInt(e.version)}),e}},za=class OC extends Ri{constructor(e){super(),this.identifier=e}serialize(e){e.serializeStr(this.identifier)}static deserialize(e){let s=e.deserializeStr();return new OC(s)}},ao=class extends Ri{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Ha.load(t);case 1:return kh.load(t);case 2:return Rl.load(t);case 3:return j_.load(t);case 4:return Gf.load(t);case 5:return zb.load(t);case 6:return Hs.load(t);case 7:return ii.load(t);case 8:return L_.load(t);case 9:return F_.load(t);case 10:return z_.load(t);case 255:return yo.load(t);default:throw new Error(`Unknown variant index for TypeTag: ${e}`)}}isBool(){return this instanceof Ha}isAddress(){return this instanceof Gf}isGeneric(){return this instanceof yo}isSigner(){return this instanceof zb}isVector(){return this instanceof Hs}isStruct(){return this instanceof ii}isU8(){return this instanceof kh}isU16(){return this instanceof L_}isU32(){return this instanceof F_}isU64(){return this instanceof Rl}isU128(){return this instanceof j_}isU256(){return this instanceof z_}},Ha=class RC extends ao{toString(){return"bool"}serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new RC}},kh=class NC extends ao{toString(){return"u8"}serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new NC}},L_=class UC extends ao{toString(){return"u16"}serialize(e){e.serializeU32AsUleb128(8)}static load(e){return new UC}},F_=class DC extends ao{toString(){return"u32"}serialize(e){e.serializeU32AsUleb128(9)}static load(e){return new DC}},Rl=class LC extends ao{toString(){return"u64"}serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new LC}},j_=class FC extends ao{toString(){return"u128"}serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new FC}},z_=class jC extends ao{toString(){return"u256"}serialize(e){e.serializeU32AsUleb128(10)}static load(e){return new jC}},Gf=class zC extends ao{toString(){return"address"}serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new zC}},zb=class HC extends ao{toString(){return"signer"}serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new HC}},sO=class KC extends ao{constructor(e){super(),this.value=e}toString(){return`&${this.value.toString()}`}serialize(e){e.serializeU32AsUleb128(254)}static load(e){let s=ao.deserialize(e);return new KC(s)}},yo=class $C extends ao{constructor(e){if(super(),this.value=e,e<0)throw new Error("Generic type parameter index cannot be negative")}toString(){return`T${this.value}`}serialize(e){e.serializeU32AsUleb128(255),e.serializeU32(this.value)}static load(e){let s=e.deserializeU32();return new $C(s)}},Hs=class mS extends ao{constructor(e){super(),this.value=e}toString(){return`vector<${this.value.toString()}>`}static u8(){return new mS(new kh)}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){let s=ao.deserialize(e);return new mS(s)}},ii=class VC extends ao{constructor(e){super(),this.value=e}toString(){let e="";return this.value.typeArgs.length>0&&(e=`<${this.value.typeArgs.map(s=>s.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${e}`}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){let s=Th.deserialize(e);return new VC(s)}isTypeTag(e,s,f){return this.value.moduleName.identifier===s&&this.value.name.identifier===f&&this.value.address.equals(e)}isString(){return this.isTypeTag(fr.ONE,"string","String")}isOption(){return this.isTypeTag(fr.ONE,"option","Option")}isObject(){return this.isTypeTag(fr.ONE,"object","Object")}},Th=class WC extends Ri{constructor(e,s,f,d){super(),this.address=e,this.moduleName=s,this.name=f,this.typeArgs=d}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let s=fr.deserialize(e),f=za.deserialize(e),d=za.deserialize(e),h=e.deserializeVector(ao);return new WC(s,f,d,h)}};function sq(){return new Th(a.ONE,new n("aptos_coin"),new n("AptosCoin"),[])}function ss(){return new Th(fr.ONE,new za("string"),new za("String"),[])}function oq(t){return new Th(a.ONE,new n("option"),new n("Option"),[t])}function Ka(t){return new Th(fr.ONE,new za("object"),new za("Object"),[t])}function MA(t){return!!t.match(/^[_a-zA-Z0-9]+$/)}function OA(t){return!!t.match(/\s/)}function oO(t){return!!t.match(/^T[0-9]+$/)}function aO(t,e){let s=e;for(;s<t.length;s+=1){let f=t[s];if(!OA(f))break}return s}var cO=(t=>(t.InvalidTypeTag="unknown type",t.UnexpectedGenericType="unexpected generic type",t.UnexpectedTypeArgumentClose="unexpected '>'",t.UnexpectedWhitespaceCharacter="unexpected whitespace character",t.UnexpectedComma="unexpected ','",t.TypeArgumentCountMismatch="type argument count doesn't match expected amount",t.MissingTypeArgumentClose="no matching '>' for '<'",t.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",t.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",t.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",t.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",t.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",t))(cO||{}),Cs=class extends Error{constructor(t,e){super(`Failed to parse typeTag '${t}', ${e}`)}};function Ch(t,e){let s=e?.allowGenerics??!1,f=[],d=[],h=[],E=0,P="",R=1;for(;E<t.length;){let q=t[E];if(q==="<")f.push({savedExpectedTypes:R,savedStr:P,savedTypes:h}),P="",h=[],R=1;else if(q===">"){if(P!==""){let xe=Hb(P,d,s);h.push(xe)}let te=f.pop();if(te===void 0)throw new Cs(t,"unexpected '>'");if(R!==h.length)throw new Cs(t,"type argument count doesn't match expected amount");let{savedStr:ne,savedTypes:ue,savedExpectedTypes:ge}=te;d=h,h=ue,P=ne,R=ge}else if(q===","){if(P.length!==0){let te=Hb(P,d,s);d=[],h.push(te),P="",R+=1}}else if(OA(q)){let te=!1;if(P.length!==0){let ue=Hb(P,d,s);d=[],h.push(ue),P="",te=!0}E=aO(t,E);let ne=t[E];if(E<t.length&&te&&ne!==","&&ne!==">")throw new Cs(t,"unexpected whitespace character");continue}else P+=q;E+=1}if(f.length>0)throw new Cs(t,"no matching '>' for '<'");switch(h.length){case 0:return Hb(P,d,s);case 1:if(P==="")return h[0];throw new Cs(t,"unexpected ','");default:throw new Cs(t,"unexpected whitespace character")}}function Hb(t,e,s){switch(t){case"&signer":if(e.length>0)throw new Cs(t,"primitive types not expected to have type arguments");return new sO(new zb);case"signer":if(e.length>0)throw new Cs(t,"primitive types not expected to have type arguments");return new zb;case"bool":if(e.length>0)throw new Cs(t,"primitive types not expected to have type arguments");return new Ha;case"address":if(e.length>0)throw new Cs(t,"primitive types not expected to have type arguments");return new Gf;case"u8":if(e.length>0)throw new Cs(t,"primitive types not expected to have type arguments");return new kh;case"u16":if(e.length>0)throw new Cs(t,"primitive types not expected to have type arguments");return new L_;case"u32":if(e.length>0)throw new Cs(t,"primitive types not expected to have type arguments");return new F_;case"u64":if(e.length>0)throw new Cs(t,"primitive types not expected to have type arguments");return new Rl;case"u128":if(e.length>0)throw new Cs(t,"primitive types not expected to have type arguments");return new j_;case"u256":if(e.length>0)throw new Cs(t,"primitive types not expected to have type arguments");return new z_;case"vector":if(e.length!==1)throw new Cs(t,"vector type expected to have exactly one type argument");return new Hs(e[0]);default:if(oO(t)){if(s)return new yo(Number(t.split("T")[1]));throw new Cs(t,"unexpected generic type")}if(!t.match(/:/))throw new Cs(t,"unknown type");let f=t.split("::");if(f.length!==3)throw new Cs(t,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!MA(f[1]))throw new Cs(t,"module name must only contain alphanumeric or '_' characters");if(!MA(f[2]))throw new Cs(t,"struct name must only contain alphanumeric or '_' characters");return new ii(new Th(fr.fromString(f[0]),new za(f[1]),new za(f[2]),e))}}var H_=class GC extends Ri{constructor(e){super(),this.value=Qs.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,s){let f=e.deserializeFixedBytes(s);return new GC(f)}},sa=class qC extends Ri{constructor(e){super(),eA(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}static deserialize(e){return new qC(e.deserializeBool())}},Ou=class ZC extends Ri{constructor(e){super(),Vf(e,0,W5),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new ZC(e.deserializeU8())}},qp=class XC extends Ri{constructor(e){super(),Vf(e,0,G5),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new XC(e.deserializeU16())}},Zp=class YC extends Ri{constructor(e){super(),Vf(e,0,Rb),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new YC(e.deserializeU32())}},Ru=class JC extends Ri{constructor(e){super(),Vf(e,BigInt(0),Nb),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new JC(e.deserializeU64())}},Xp=class QC extends Ri{constructor(e){super(),Vf(e,BigInt(0),x_),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new QC(e.deserializeU128())}},Yp=class e9 extends Ri{constructor(e){super(),Vf(e,BigInt(0),q5),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new e9(e.deserializeU256())}},ps=class du extends Ri{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}serializeForScriptFunction(e){if(!(this.values[0]instanceof Ou)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let s;if(Array.isArray(e)&&typeof e[0]=="number")s=e;else if(typeof e=="string"){let f=Qs.fromHexInput(e);s=Array.from(f.toUint8Array())}else if(e instanceof Uint8Array)s=Array.from(e);else throw new Error("Invalid input type");return new du(s.map(f=>new Ou(f)))}static U16(e){return new du(e.map(s=>new qp(s)))}static U32(e){return new du(e.map(s=>new Zp(s)))}static U64(e){return new du(e.map(s=>new Ru(s)))}static U128(e){return new du(e.map(s=>new Xp(s)))}static U256(e){return new du(e.map(s=>new Yp(s)))}static Bool(e){return new du(e.map(s=>new sa(s)))}static MoveString(e){return new du(e.map(s=>new vs(s)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,s){let f=e.deserializeUleb128AsU32(),d=new Array;for(let h=0;h<f;h+=1)d.push(s.deserialize(e));return new du(d)}},vs=class t9 extends Ri{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}serializeForScriptFunction(e){let s=this.bcsToBytes().slice(1);ps.U8(s).serializeForScriptFunction(e)}static deserialize(e){return new t9(e.deserializeStr())}},Kb=class hu extends Ri{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new ps([e]):this.vec=new ps([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let s=this.bcsToBytes();e.serializeBytes(s)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new hu(e!=null?new Ou(e):void 0)}static U16(e){return new hu(e!=null?new qp(e):void 0)}static U32(e){return new hu(e!=null?new Zp(e):void 0)}static U64(e){return new hu(e!=null?new Ru(e):void 0)}static U128(e){return new hu(e!=null?new Xp(e):void 0)}static U256(e){return new hu(e!=null?new Yp(e):void 0)}static Bool(e){return new hu(e!=null?new sa(e):void 0)}static MoveString(e){return new hu(e!=null?new vs(e):void 0)}static deserialize(e,s){let f=ps.deserialize(e,s);return new hu(f.values[0])}};function uO(t){return typeof t=="boolean"}function Jp(t){return typeof t=="string"}function K_(t){return typeof t=="number"}function $_(t){return typeof t=="number"||typeof t=="bigint"||typeof t=="string"}function lO(t){return t==null}function fO(t){return RA(t)||UA(t)||DA(t)||LA(t)||FA(t)||jA(t)||zA(t)||V_(t)||NA(t)||dO(t)||t instanceof ps||t instanceof Kb}function RA(t){return t instanceof sa}function V_(t){return t instanceof fr}function NA(t){return t instanceof vs}function dO(t){return t instanceof H_}function UA(t){return t instanceof Ou}function DA(t){return t instanceof qp}function LA(t){return t instanceof Zp}function FA(t){return t instanceof Ru}function jA(t){return t instanceof Xp}function zA(t){return t instanceof Yp}function hO(t){return"bytecode"in t}function Ps(t,e){throw new Error(`Type mismatch for argument ${e}, expected '${t}'`)}function pO(t){let e=t.params.findIndex(s=>s!=="signer"&&s!=="&signer");return e<0?t.params.length:e}function $b(t){let e=t.split("::");if(e.length!==3)throw new Error(`Invalid function ${t}`);let s=e[0],f=e[1],d=e[2];return{moduleAddress:s,moduleName:f,functionName:d}}var HA=class extends Ri{toString(){let t=this.toUint8Array();return Qs.fromHexInput(t).toString()}},Vb=class extends HA{},Qp=class extends Ri{toString(){let t=this.toUint8Array();return Qs.fromHexInput(t).toString()}};class KA extends k_{constructor(e,s){super(),this.finished=!1,this.destroyed=!1,SM(e);const f=Ah(s);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,h=new Uint8Array(d);h.set(f.length>d?e.create().update(f).digest():f);for(let E=0;E<h.length;E++)h[E]^=54;this.iHash.update(h),this.oHash=e.create();for(let E=0;E<h.length;E++)h[E]^=106;this.oHash.update(h),h.fill(0)}update(e){return Sh(this),this.iHash.update(e),this}digestInto(e){Sh(this),Wp(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:s,iHash:f,finished:d,destroyed:h,blockLen:E,outputLen:P}=this;return e=e,e.finished=d,e.destroyed=h,e.blockLen=E,e.outputLen=P,e.oHash=s._cloneInto(e.oHash),e.iHash=f._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const $A=(t,e,s)=>new KA(t,e).update(s).digest();$A.create=(t,e)=>new KA(t,e);function gO(t,e,s,f){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,s,f);const d=BigInt(32),h=BigInt(4294967295),E=Number(s>>d&h),P=Number(s&h),R=f?4:0,q=f?0:4;t.setUint32(e+R,E,f),t.setUint32(e+q,P,f)}const yO=(t,e,s)=>t&e^~t&s,mO=(t,e,s)=>t&e^t&s^e&s;class VA extends k_{constructor(e,s,f,d){super(),this.blockLen=e,this.outputLen=s,this.padOffset=f,this.isLE=d,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=I_(this.buffer)}update(e){Sh(this);const{view:s,buffer:f,blockLen:d}=this;e=Ah(e);const h=e.length;for(let E=0;E<h;){const P=Math.min(d-this.pos,h-E);if(P===d){const R=I_(e);for(;d<=h-E;E+=d)this.process(R,E);continue}f.set(e.subarray(E,E+P),this.pos),this.pos+=P,E+=P,this.pos===d&&(this.process(s,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Sh(this),Z5(e,this),this.finished=!0;const{buffer:s,view:f,blockLen:d,isLE:h}=this;let{pos:E}=this;s[E++]=128,this.buffer.subarray(E).fill(0),this.padOffset>d-E&&(this.process(f,0),E=0);for(let ne=E;ne<d;ne++)s[ne]=0;gO(f,d-8,BigInt(this.length*8),h),this.process(f,0);const P=I_(e),R=this.outputLen;if(R%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const q=R/4,te=this.get();if(q>te.length)throw new Error("_sha2: outputLen bigger than state");for(let ne=0;ne<q;ne++)P.setUint32(4*ne,te[ne],h)}digest(){const{buffer:e,outputLen:s}=this;this.digestInto(e);const f=e.slice(0,s);return this.destroy(),f}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:s,buffer:f,length:d,finished:h,destroyed:E,pos:P}=this;return e.length=d,e.pos=P,e.finished=h,e.destroyed=E,d%s&&e.buffer.set(f),e}}const Wb=BigInt(2**32-1),W_=BigInt(32);function WA(t,e=!1){return e?{h:Number(t&Wb),l:Number(t>>W_&Wb)}:{h:Number(t>>W_&Wb)|0,l:Number(t&Wb)|0}}function GA(t,e=!1){let s=new Uint32Array(t.length),f=new Uint32Array(t.length);for(let d=0;d<t.length;d++){const{h,l:E}=WA(t[d],e);[s[d],f[d]]=[h,E]}return[s,f]}const bO=(t,e)=>BigInt(t>>>0)<<W_|BigInt(e>>>0),vO=(t,e,s)=>t>>>s,wO=(t,e,s)=>t<<32-s|e>>>s,_O=(t,e,s)=>t>>>s|e<<32-s,EO=(t,e,s)=>t<<32-s|e>>>s,SO=(t,e,s)=>t<<64-s|e>>>s-32,AO=(t,e,s)=>t>>>s-32|e<<64-s,xO=(t,e)=>e,IO=(t,e)=>t,qA=(t,e,s)=>t<<s|e>>>32-s,ZA=(t,e,s)=>e<<s|t>>>32-s,XA=(t,e,s)=>e<<s-32|t>>>64-s,YA=(t,e,s)=>t<<s-32|e>>>64-s;function BO(t,e,s,f){const d=(e>>>0)+(f>>>0);return{h:t+s+(d/2**32|0)|0,l:d|0}}const si={fromBig:WA,split:GA,toBig:bO,shrSH:vO,shrSL:wO,rotrSH:_O,rotrSL:EO,rotrBH:SO,rotrBL:AO,rotr32H:xO,rotr32L:IO,rotlSH:qA,rotlSL:ZA,rotlBH:XA,rotlBL:YA,add:BO,add3L:(t,e,s)=>(t>>>0)+(e>>>0)+(s>>>0),add3H:(t,e,s,f)=>e+s+f+(t/2**32|0)|0,add4L:(t,e,s,f)=>(t>>>0)+(e>>>0)+(s>>>0)+(f>>>0),add4H:(t,e,s,f,d)=>e+s+f+d+(t/2**32|0)|0,add5H:(t,e,s,f,d,h)=>e+s+f+d+h+(t/2**32|0)|0,add5L:(t,e,s,f,d)=>(t>>>0)+(e>>>0)+(s>>>0)+(f>>>0)+(d>>>0)},[kO,TO]=si.split(["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(t=>BigInt(t))),Nl=new Uint32Array(80),Ul=new Uint32Array(80);class Gb extends VA{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:s,Bh:f,Bl:d,Ch:h,Cl:E,Dh:P,Dl:R,Eh:q,El:te,Fh:ne,Fl:ue,Gh:ge,Gl:xe,Hh:pe,Hl:Se}=this;return[e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se]}set(e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se){this.Ah=e|0,this.Al=s|0,this.Bh=f|0,this.Bl=d|0,this.Ch=h|0,this.Cl=E|0,this.Dh=P|0,this.Dl=R|0,this.Eh=q|0,this.El=te|0,this.Fh=ne|0,this.Fl=ue|0,this.Gh=ge|0,this.Gl=xe|0,this.Hh=pe|0,this.Hl=Se|0}process(e,s){for(let We=0;We<16;We++,s+=4)Nl[We]=e.getUint32(s),Ul[We]=e.getUint32(s+=4);for(let We=16;We<80;We++){const xt=Nl[We-15]|0,kt=Ul[We-15]|0,Bt=si.rotrSH(xt,kt,1)^si.rotrSH(xt,kt,8)^si.shrSH(xt,kt,7),Wt=si.rotrSL(xt,kt,1)^si.rotrSL(xt,kt,8)^si.shrSL(xt,kt,7),Me=Nl[We-2]|0,Ke=Ul[We-2]|0,nt=si.rotrSH(Me,Ke,19)^si.rotrBH(Me,Ke,61)^si.shrSH(Me,Ke,6),Tt=si.rotrSL(Me,Ke,19)^si.rotrBL(Me,Ke,61)^si.shrSL(Me,Ke,6),pt=si.add4L(Wt,Tt,Ul[We-7],Ul[We-16]),Ht=si.add4H(pt,Bt,nt,Nl[We-7],Nl[We-16]);Nl[We]=Ht|0,Ul[We]=pt|0}let{Ah:f,Al:d,Bh:h,Bl:E,Ch:P,Cl:R,Dh:q,Dl:te,Eh:ne,El:ue,Fh:ge,Fl:xe,Gh:pe,Gl:Se,Hh:Ce,Hl:Fe}=this;for(let We=0;We<80;We++){const xt=si.rotrSH(ne,ue,14)^si.rotrSH(ne,ue,18)^si.rotrBH(ne,ue,41),kt=si.rotrSL(ne,ue,14)^si.rotrSL(ne,ue,18)^si.rotrBL(ne,ue,41),Bt=ne&ge^~ne&pe,Wt=ue&xe^~ue&Se,Me=si.add5L(Fe,kt,Wt,TO[We],Ul[We]),Ke=si.add5H(Me,Ce,xt,Bt,kO[We],Nl[We]),nt=Me|0,Tt=si.rotrSH(f,d,28)^si.rotrBH(f,d,34)^si.rotrBH(f,d,39),pt=si.rotrSL(f,d,28)^si.rotrBL(f,d,34)^si.rotrBL(f,d,39),Ht=f&h^f&P^h&P,lt=d&E^d&R^E&R;Ce=pe|0,Fe=Se|0,pe=ge|0,Se=xe|0,ge=ne|0,xe=ue|0,{h:ne,l:ue}=si.add(q|0,te|0,Ke|0,nt|0),q=P|0,te=R|0,P=h|0,R=E|0,h=f|0,E=d|0;const rt=si.add3L(nt,pt,lt);f=si.add3H(rt,Ke,Tt,Ht),d=rt|0}({h:f,l:d}=si.add(this.Ah|0,this.Al|0,f|0,d|0)),{h,l:E}=si.add(this.Bh|0,this.Bl|0,h|0,E|0),{h:P,l:R}=si.add(this.Ch|0,this.Cl|0,P|0,R|0),{h:q,l:te}=si.add(this.Dh|0,this.Dl|0,q|0,te|0),{h:ne,l:ue}=si.add(this.Eh|0,this.El|0,ne|0,ue|0),{h:ge,l:xe}=si.add(this.Fh|0,this.Fl|0,ge|0,xe|0),{h:pe,l:Se}=si.add(this.Gh|0,this.Gl|0,pe|0,Se|0),{h:Ce,l:Fe}=si.add(this.Hh|0,this.Hl|0,Ce|0,Fe|0),this.set(f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se,Ce,Fe)}roundClean(){Nl.fill(0),Ul.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class pq extends Gb{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class gq extends Gb{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class yq extends Gb{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const CO=T_(()=>new Gb),mq=null,bq=null,vq=null;function eg(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function PO(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function gc(t,...e){if(!PO(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function JA(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");eg(t.outputLen),eg(t.blockLen)}function qb(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function MO(t,e){gc(t);const s=e.outputLen;if(t.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}const Ph=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function wq(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function _q(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function Eq(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function qf(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Xc(t,e){return t<<32-e|t>>>e}function Zb(t,e){return t<<e|t>>>32-e>>>0}const Sq=null;function OO(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}const Aq=null;function xq(t){for(let e=0;e<t.length;e++)t[e]=OO(t[e])}const RO=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function NO(t){gc(t);let e="";for(let s=0;s<t.length;s++)e+=RO[t[s]];return e}const Nu={_0:48,_9:57,A:65,F:70,a:97,f:102};function QA(t){if(t>=Nu._0&&t<=Nu._9)return t-Nu._0;if(t>=Nu.A&&t<=Nu.F)return t-(Nu.A-10);if(t>=Nu.a&&t<=Nu.f)return t-(Nu.a-10)}function UO(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,s=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const f=new Uint8Array(s);for(let d=0,h=0;d<s;d++,h+=2){const E=QA(t.charCodeAt(h)),P=QA(t.charCodeAt(h+1));if(E===void 0||P===void 0){const R=t[h]+t[h+1];throw new Error('hex string expected, got non-hex character "'+R+'" at index '+h)}f[d]=E*16+P}return f}const DO=async()=>{};async function Iq(t,e,s){let f=Date.now();for(let d=0;d<t;d++){s(d);const h=Date.now()-f;h>=0&&h<e||(await DO(),f+=h)}}function ex(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function Zf(t){return typeof t=="string"&&(t=ex(t)),gc(t),t}function tg(...t){let e=0;for(let f=0;f<t.length;f++){const d=t[f];gc(d),e+=d.length}const s=new Uint8Array(e);for(let f=0,d=0;f<t.length;f++){const h=t[f];s.set(h,d),d+=h.length}return s}class tx{clone(){return this._cloneInto()}}function LO(t,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function G_(t){const e=f=>t().update(Zf(f)).digest(),s=t();return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=()=>t(),e}function Bq(t){const e=(f,d)=>t(d).update(Zf(f)).digest(),s=t({});return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=f=>t(f),e}function kq(t){const e=(f,d)=>t(d).update(Zf(f)).digest(),s=t({});return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=f=>t(f),e}function FO(t=32){if(Ph&&typeof Ph.getRandomValues=="function")return Ph.getRandomValues(new Uint8Array(t));if(Ph&&typeof Ph.randomBytes=="function")return Ph.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}class nx extends tx{constructor(e,s){super(),this.finished=!1,this.destroyed=!1,JA(e);const f=Zf(s);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,h=new Uint8Array(d);h.set(f.length>d?e.create().update(f).digest():f);for(let E=0;E<h.length;E++)h[E]^=54;this.iHash.update(h),this.oHash=e.create();for(let E=0;E<h.length;E++)h[E]^=106;this.oHash.update(h),h.fill(0)}update(e){return qb(this),this.iHash.update(e),this}digestInto(e){qb(this),gc(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:s,iHash:f,finished:d,destroyed:h,blockLen:E,outputLen:P}=this;return e=e,e.finished=d,e.destroyed=h,e.blockLen=E,e.outputLen=P,e.oHash=s._cloneInto(e.oHash),e.iHash=f._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ng=(t,e,s)=>new nx(t,e).update(s).digest();ng.create=(t,e)=>new nx(t,e);function rx(t,e,s,f){JA(t);const d=LO({dkLen:32,asyncTick:10},f),{c:h,dkLen:E,asyncTick:P}=d;if(eg(h),eg(E),eg(P),h<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const R=Zf(e),q=Zf(s),te=new Uint8Array(E),ne=ng.create(t,R),ue=ne._cloneInto().update(q);return{c:h,dkLen:E,asyncTick:P,DK:te,PRF:ne,PRFSalt:ue}}function ix(t,e,s,f,d){return t.destroy(),e.destroy(),f&&f.destroy(),d.fill(0),s}function jO(t,e,s,f){const{c:d,dkLen:h,DK:E,PRF:P,PRFSalt:R}=rx(t,e,s,f);let q;const te=new Uint8Array(4),ne=qf(te),ue=new Uint8Array(P.outputLen);for(let ge=1,xe=0;xe<h;ge++,xe+=P.outputLen){const pe=E.subarray(xe,xe+P.outputLen);ne.setInt32(0,ge,!1),(q=R._cloneInto(q)).update(te).digestInto(ue),pe.set(ue.subarray(0,pe.length));for(let Se=1;Se<d;Se++){P._cloneInto(q).update(ue).digestInto(ue);for(let Ce=0;Ce<pe.length;Ce++)pe[Ce]^=ue[Ce]}}return ix(P,R,E,q,ue)}async function Tq(t,e,s,f){const{c:d,dkLen:h,asyncTick:E,DK:P,PRF:R,PRFSalt:q}=rx(t,e,s,f);let te;const ne=new Uint8Array(4),ue=createView(ne),ge=new Uint8Array(R.outputLen);for(let xe=1,pe=0;pe<h;xe++,pe+=R.outputLen){const Se=P.subarray(pe,pe+R.outputLen);ue.setInt32(0,xe,!1),(te=q._cloneInto(te)).update(ne).digestInto(ge),Se.set(ge.subarray(0,Se.length)),await asyncLoop(d-1,E,()=>{R._cloneInto(te).update(ge).digestInto(ge);for(let Ce=0;Ce<Se.length;Ce++)Se[Ce]^=ge[Ce]})}return ix(R,q,P,te,ge)}function zO(t,e,s,f){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,s,f);const d=BigInt(32),h=BigInt(4294967295),E=Number(s>>d&h),P=Number(s&h),R=f?4:0,q=f?0:4;t.setUint32(e+R,E,f),t.setUint32(e+q,P,f)}function HO(t,e,s){return t&e^~t&s}function KO(t,e,s){return t&e^t&s^e&s}class q_ extends tx{constructor(e,s,f,d){super(),this.blockLen=e,this.outputLen=s,this.padOffset=f,this.isLE=d,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=qf(this.buffer)}update(e){qb(this);const{view:s,buffer:f,blockLen:d}=this;e=Zf(e);const h=e.length;for(let E=0;E<h;){const P=Math.min(d-this.pos,h-E);if(P===d){const R=qf(e);for(;d<=h-E;E+=d)this.process(R,E);continue}f.set(e.subarray(E,E+P),this.pos),this.pos+=P,E+=P,this.pos===d&&(this.process(s,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){qb(this),MO(e,this),this.finished=!0;const{buffer:s,view:f,blockLen:d,isLE:h}=this;let{pos:E}=this;s[E++]=128,this.buffer.subarray(E).fill(0),this.padOffset>d-E&&(this.process(f,0),E=0);for(let ne=E;ne<d;ne++)s[ne]=0;zO(f,d-8,BigInt(this.length*8),h),this.process(f,0);const P=qf(e),R=this.outputLen;if(R%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const q=R/4,te=this.get();if(q>te.length)throw new Error("_sha2: outputLen bigger than state");for(let ne=0;ne<q;ne++)P.setUint32(4*ne,te[ne],h)}digest(){const{buffer:e,outputLen:s}=this;this.digestInto(e);const f=e.slice(0,s);return this.destroy(),f}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:s,buffer:f,length:d,finished:h,destroyed:E,pos:P}=this;return e.length=d,e.pos=P,e.finished=h,e.destroyed=E,d%s&&e.buffer.set(f),e}}const Xb=BigInt(2**32-1),Z_=BigInt(32);function sx(t,e=!1){return e?{h:Number(t&Xb),l:Number(t>>Z_&Xb)}:{h:Number(t>>Z_&Xb)|0,l:Number(t&Xb)|0}}function $O(t,e=!1){let s=new Uint32Array(t.length),f=new Uint32Array(t.length);for(let d=0;d<t.length;d++){const{h,l:E}=sx(t[d],e);[s[d],f[d]]=[h,E]}return[s,f]}const VO=(t,e)=>BigInt(t>>>0)<<Z_|BigInt(e>>>0),WO=(t,e,s)=>t>>>s,GO=(t,e,s)=>t<<32-s|e>>>s,qO=(t,e,s)=>t>>>s|e<<32-s,ZO=(t,e,s)=>t<<32-s|e>>>s,XO=(t,e,s)=>t<<64-s|e>>>s-32,YO=(t,e,s)=>t>>>s-32|e<<64-s,JO=(t,e)=>e,QO=(t,e)=>t,eR=(t,e,s)=>t<<s|e>>>32-s,tR=(t,e,s)=>e<<s|t>>>32-s,nR=(t,e,s)=>e<<s-32|t>>>64-s,rR=(t,e,s)=>t<<s-32|e>>>64-s;function iR(t,e,s,f){const d=(e>>>0)+(f>>>0);return{h:t+s+(d/2**32|0)|0,l:d|0}}const oi={fromBig:sx,split:$O,toBig:VO,shrSH:WO,shrSL:GO,rotrSH:qO,rotrSL:ZO,rotrBH:XO,rotrBL:YO,rotr32H:JO,rotr32L:QO,rotlSH:eR,rotlSL:tR,rotlBH:nR,rotlBL:rR,add:iR,add3L:(t,e,s)=>(t>>>0)+(e>>>0)+(s>>>0),add3H:(t,e,s,f)=>e+s+f+(t/2**32|0)|0,add4L:(t,e,s,f)=>(t>>>0)+(e>>>0)+(s>>>0)+(f>>>0),add4H:(t,e,s,f,d)=>e+s+f+d+(t/2**32|0)|0,add5H:(t,e,s,f,d,h)=>e+s+f+d+h+(t/2**32|0)|0,add5L:(t,e,s,f,d)=>(t>>>0)+(e>>>0)+(s>>>0)+(f>>>0)+(d>>>0)},[sR,oR]=oi.split(["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(t=>BigInt(t))),Dl=new Uint32Array(80),Ll=new Uint32Array(80);class Yb extends q_{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:s,Bh:f,Bl:d,Ch:h,Cl:E,Dh:P,Dl:R,Eh:q,El:te,Fh:ne,Fl:ue,Gh:ge,Gl:xe,Hh:pe,Hl:Se}=this;return[e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se]}set(e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se){this.Ah=e|0,this.Al=s|0,this.Bh=f|0,this.Bl=d|0,this.Ch=h|0,this.Cl=E|0,this.Dh=P|0,this.Dl=R|0,this.Eh=q|0,this.El=te|0,this.Fh=ne|0,this.Fl=ue|0,this.Gh=ge|0,this.Gl=xe|0,this.Hh=pe|0,this.Hl=Se|0}process(e,s){for(let We=0;We<16;We++,s+=4)Dl[We]=e.getUint32(s),Ll[We]=e.getUint32(s+=4);for(let We=16;We<80;We++){const xt=Dl[We-15]|0,kt=Ll[We-15]|0,Bt=oi.rotrSH(xt,kt,1)^oi.rotrSH(xt,kt,8)^oi.shrSH(xt,kt,7),Wt=oi.rotrSL(xt,kt,1)^oi.rotrSL(xt,kt,8)^oi.shrSL(xt,kt,7),Me=Dl[We-2]|0,Ke=Ll[We-2]|0,nt=oi.rotrSH(Me,Ke,19)^oi.rotrBH(Me,Ke,61)^oi.shrSH(Me,Ke,6),Tt=oi.rotrSL(Me,Ke,19)^oi.rotrBL(Me,Ke,61)^oi.shrSL(Me,Ke,6),pt=oi.add4L(Wt,Tt,Ll[We-7],Ll[We-16]),Ht=oi.add4H(pt,Bt,nt,Dl[We-7],Dl[We-16]);Dl[We]=Ht|0,Ll[We]=pt|0}let{Ah:f,Al:d,Bh:h,Bl:E,Ch:P,Cl:R,Dh:q,Dl:te,Eh:ne,El:ue,Fh:ge,Fl:xe,Gh:pe,Gl:Se,Hh:Ce,Hl:Fe}=this;for(let We=0;We<80;We++){const xt=oi.rotrSH(ne,ue,14)^oi.rotrSH(ne,ue,18)^oi.rotrBH(ne,ue,41),kt=oi.rotrSL(ne,ue,14)^oi.rotrSL(ne,ue,18)^oi.rotrBL(ne,ue,41),Bt=ne&ge^~ne&pe,Wt=ue&xe^~ue&Se,Me=oi.add5L(Fe,kt,Wt,oR[We],Ll[We]),Ke=oi.add5H(Me,Ce,xt,Bt,sR[We],Dl[We]),nt=Me|0,Tt=oi.rotrSH(f,d,28)^oi.rotrBH(f,d,34)^oi.rotrBH(f,d,39),pt=oi.rotrSL(f,d,28)^oi.rotrBL(f,d,34)^oi.rotrBL(f,d,39),Ht=f&h^f&P^h&P,lt=d&E^d&R^E&R;Ce=pe|0,Fe=Se|0,pe=ge|0,Se=xe|0,ge=ne|0,xe=ue|0,{h:ne,l:ue}=oi.add(q|0,te|0,Ke|0,nt|0),q=P|0,te=R|0,P=h|0,R=E|0,h=f|0,E=d|0;const rt=oi.add3L(nt,pt,lt);f=oi.add3H(rt,Ke,Tt,Ht),d=rt|0}({h:f,l:d}=oi.add(this.Ah|0,this.Al|0,f|0,d|0)),{h,l:E}=oi.add(this.Bh|0,this.Bl|0,h|0,E|0),{h:P,l:R}=oi.add(this.Ch|0,this.Cl|0,P|0,R|0),{h:q,l:te}=oi.add(this.Dh|0,this.Dl|0,q|0,te|0),{h:ne,l:ue}=oi.add(this.Eh|0,this.El|0,ne|0,ue|0),{h:ge,l:xe}=oi.add(this.Fh|0,this.Fl|0,ge|0,xe|0),{h:pe,l:Se}=oi.add(this.Gh|0,this.Gl|0,pe|0,Se|0),{h:Ce,l:Fe}=oi.add(this.Hh|0,this.Hl|0,Ce|0,Fe|0),this.set(f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se,Ce,Fe)}roundClean(){Dl.fill(0),Ll.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Dq extends Yb{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class Lq extends Yb{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class Fq extends Yb{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const X_=G_(()=>new Yb),jq=null,zq=null,Hq=null;/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */const aR=t=>t[0]==="\u3042\u3044\u3053\u304F\u3057\u3093";function ox(t){if(typeof t!="string")throw new TypeError("invalid mnemonic type: "+typeof t);return t.normalize("NFKD")}function Y_(t){const e=ox(t),s=e.split(" ");if(![12,15,18,21,24].includes(s.length))throw new Error("Invalid mnemonic");return{nfkd:e,words:s}}function ax(t){abytes(t,16,20,24,28,32)}function Kq(t,e=128){if(anumber(e),e%32!==0||e>256)throw new TypeError("Invalid entropy");return lR(randomBytes(e/8),t)}const cR=t=>{const e=8-t.length/4;return new Uint8Array([sha256(t)[0]>>e<<e])};function cx(t){if(!Array.isArray(t)||t.length!==2048||typeof t[0]!="string")throw new Error("Wordlist: expected array of 2048 strings");return t.forEach(e=>{if(typeof e!="string")throw new Error("wordlist: non-string element: "+e)}),baseUtils.chain(baseUtils.checksum(1,cR),baseUtils.radix2(11,!0),baseUtils.alphabet(t))}function uR(t,e){const{words:s}=Y_(t),f=cx(e).decode(s);return ax(f),f}function lR(t,e){return ax(t),cx(e).encode(t).join(aR(e)?"\u3000":" ")}function $q(t,e){try{uR(t,e)}catch{return!1}return!0}const ux=t=>ox("mnemonic"+t);function Vq(t,e=""){return pbkdf2Async(sha512,Y_(t).nfkd,ux(e),{c:2048,dkLen:64})}function fR(t,e=""){return jO(X_,Y_(t).nfkd,ux(e),{c:2048,dkLen:64})}var dR=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,hR=/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,pR=(t=>(t.ED25519="ed25519 seed",t))(pR||{}),gR=2147483648;function yR(t){return hR.test(t)}function mR(t){return dR.test(t)}var lx=(t,e)=>{let s=$A.create(CO,t).update(e).digest();return{key:s.slice(0,32),chainCode:s.slice(32)}},bR=({key:t,chainCode:e},s)=>{let f=new ArrayBuffer(4);new DataView(f).setUint32(0,s);let d=new Uint8Array(f),h=new Uint8Array([0]),E=new Uint8Array([...h,...t,...d]);return lx(e,E)},vR=t=>t.replace("'",""),wR=t=>t.split("/").slice(1).map(vR),fx=t=>{let e=t.trim().split(/\s+/).map(s=>s.toLowerCase()).join(" ");return fR(e)};const dx=[],hx=[],px=[],_R=BigInt(0),rg=BigInt(1),ER=BigInt(2),SR=BigInt(7),AR=BigInt(256),xR=BigInt(113);for(let t=0,e=rg,s=1,f=0;t<24;t++){[s,f]=[f,(2*s+3*f)%5],dx.push(2*(5*f+s)),hx.push((t+1)*(t+2)/2%64);let d=_R;for(let h=0;h<7;h++)e=(e<<rg^(e>>SR)*xR)%AR,e&ER&&(d^=rg<<(rg<<BigInt(h))-rg);px.push(d)}const[IR,BR]=GA(px,!0),gx=(t,e,s)=>s>32?XA(t,e,s):qA(t,e,s),yx=(t,e,s)=>s>32?YA(t,e,s):ZA(t,e,s);function kR(t,e=24){const s=new Uint32Array(10);for(let f=24-e;f<24;f++){for(let E=0;E<10;E++)s[E]=t[E]^t[E+10]^t[E+20]^t[E+30]^t[E+40];for(let E=0;E<10;E+=2){const P=(E+8)%10,R=(E+2)%10,q=s[R],te=s[R+1],ne=gx(q,te,1)^s[P],ue=yx(q,te,1)^s[P+1];for(let ge=0;ge<50;ge+=10)t[E+ge]^=ne,t[E+ge+1]^=ue}let d=t[2],h=t[3];for(let E=0;E<24;E++){const P=hx[E],R=gx(d,h,P),q=yx(d,h,P),te=dx[E];d=t[te],h=t[te+1],t[te]=R,t[te+1]=q}for(let E=0;E<50;E+=10){for(let P=0;P<10;P++)s[P]=t[E+P];for(let P=0;P<10;P++)t[E+P]^=~s[(P+2)%10]&s[(P+4)%10]}t[0]^=IR[f],t[1]^=BR[f]}s.fill(0)}class Jb extends k_{constructor(e,s,f,d=!1,h=24){if(super(),this.blockLen=e,this.suffix=s,this.outputLen=f,this.enableXOF=d,this.rounds=h,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ub(f),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=AM(this.state)}keccak(){X5||Y5(this.state32),kR(this.state32,this.rounds),X5||Y5(this.state32),this.posOut=0,this.pos=0}update(e){Sh(this);const{blockLen:s,state:f}=this;e=Ah(e);const d=e.length;for(let h=0;h<d;){const E=Math.min(s-this.pos,d-h);for(let P=0;P<E;P++)f[this.pos++]^=e[h++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:s,pos:f,blockLen:d}=this;e[f]^=s,s&128&&f===d-1&&this.keccak(),e[d-1]^=128,this.keccak()}writeInto(e){Sh(this,!1),Wp(e),this.finish();const s=this.state,{blockLen:f}=this;for(let d=0,h=e.length;d<h;){this.posOut>=f&&this.keccak();const E=Math.min(f-this.posOut,h-d);e.set(s.subarray(this.posOut,this.posOut+E),d),this.posOut+=E,d+=E}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ub(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Z5(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:s,suffix:f,outputLen:d,rounds:h,enableXOF:E}=this;return e||(e=new Jb(s,f,d,E,h)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=h,e.suffix=f,e.outputLen=d,e.enableXOF=E,e.destroyed=this.destroyed,e}}const mx=(t,e,s)=>T_(()=>new Jb(e,t,s)),Wq=null,Qb=mx(6,136,256/8),Gq=null,qq=null,Zq=null,bx=mx(1,136,256/8),Xq=null,Yq=null,Jq=(t,e,s)=>wrapXOFConstructorWithOpts((f={})=>new Jb(e,t,f.dkLen===void 0?s:f.dkLen,!0)),Qq=null,eZ=null;var vx=class b0 extends Ri{constructor(e){super();let{data:s}=e,f=Qs.fromHexInput(s);if(f.toUint8Array().length!==b0.LENGTH)throw new Error(`Authentication Key length should be ${b0.LENGTH}`);this.data=f}serialize(e){e.serializeFixedBytes(this.data.toUint8Array())}static deserialize(e){let s=e.deserializeFixedBytes(b0.LENGTH);return new b0({data:s})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromSchemeAndBytes(e){let{scheme:s,input:f}=e,d=Qs.fromHexInput(f).toUint8Array(),h=new Uint8Array([...d,s]),E=Qb.create();E.update(h);let P=E.digest();return new b0({data:P})}static fromPublicKeyAndScheme(e){let{publicKey:s}=e;return s.authKey()}static fromPublicKey(e){let{publicKey:s}=e;return s.authKey()}derivedAddress(){return new fr(this.data.toUint8Array())}};vx.LENGTH=32;var Xf=vx,Fl=Ar(18861),wx=class Zg extends Vb{constructor(e){super();let s=Qs.fromHexInput(e);if(s.toUint8Array().length!==Zg.LENGTH)throw new Error(`PublicKey length should be ${Zg.LENGTH}`);this.key=s}verifySignature(e){let{message:s,signature:f}=e;if(!(f instanceof aa))return!1;let d=Qs.fromHexInput(s).toUint8Array(),h=f.toUint8Array(),E=this.key.toUint8Array();return Fl.sign.detached.verify(d,h,E)}authKey(){return Xf.fromSchemeAndBytes({scheme:0,input:this.toUint8Array()})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let s=e.deserializeBytes();return new Zg(s)}static isPublicKey(e){return e instanceof Zg}};wx.LENGTH=32;var oa=wx,J_=class Ja extends Ri{constructor(e){super();let s=Qs.fromHexInput(e);if(s.toUint8Array().length!==Ja.LENGTH)throw new Error(`PrivateKey length should be ${Ja.LENGTH}`);this.signingKeyPair=Fl.sign.keyPair.fromSeed(s.toUint8Array().slice(0,Ja.LENGTH))}static generate(){let e=Fl.sign.keyPair();return new Ja(e.secretKey.slice(0,Ja.LENGTH))}static fromDerivationPath(e,s){if(!mR(e))throw new Error(`Invalid derivation path ${e}`);return Ja.fromDerivationPathInner(e,fx(s))}static fromDerivationPathInner(e,s,f=gR){let{key:d,chainCode:h}=lx(Ja.SLIP_0010_SEED,s),E=wR(e).map(R=>parseInt(R,10)),{key:P}=E.reduce((R,q)=>bR(R,q+f),{key:d,chainCode:h});return new Ja(P)}publicKey(){let e=this.signingKeyPair.publicKey;return new oa(e)}sign(e){let s=Qs.fromHexInput(e).toUint8Array(),f=Fl.sign.detached(s,this.signingKeyPair.secretKey);return new aa(f)}toUint8Array(){return this.signingKeyPair.secretKey.slice(0,Ja.LENGTH)}toString(){return Qs.fromHexInput(this.toUint8Array()).toString()}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let s=e.deserializeBytes();return new Ja(s)}static isPrivateKey(e){return e instanceof Ja}};J_.LENGTH=32,J_.SLIP_0010_SEED="ed25519 seed";var Mh=J_,_x=class gv extends Qp{constructor(e){super();let s=Qs.fromHexInput(e);if(s.toUint8Array().length!==gv.LENGTH)throw new Error(`Signature length should be ${gv.LENGTH}`);this.data=s}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let s=e.deserializeBytes();return new gv(s)}};_x.LENGTH=64;var aa=_x,e1=class lf extends Vb{constructor(e){super();let{publicKeys:s,threshold:f}=e;if(s.length>lf.MAX_KEYS||s.length<lf.MIN_KEYS)throw new Error(`Must have between ${lf.MIN_KEYS} and ${lf.MAX_KEYS} public keys, inclusive`);if(f<lf.MIN_THRESHOLD||f>s.length)throw new Error(`Threshold must be between ${lf.MIN_THRESHOLD} and ${s.length}, inclusive`);this.publicKeys=s,this.threshold=f}verifySignature(e){let{message:s,signature:f}=e;if(!(f instanceof eE))return!1;let d=[];for(let h=0;h<4;h+=1)for(let E=0;E<8;E+=1)if(f.bitmap[h]&1<<7-E){let P=h*8+E;d.push(P)}if(d.length!==f.signatures.length)throw new Error("Bitmap and signatures length mismatch");if(d.length<this.threshold)throw new Error("Not enough signatures");for(let h=0;h<d.length;h+=1)if(!this.publicKeys[d[h]].verifySignature({message:s,signature:f.signatures[h]}))return!1;return!0}authKey(){return Xf.fromSchemeAndBytes({scheme:1,input:this.toUint8Array()})}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*oa.LENGTH+1);return this.publicKeys.forEach((s,f)=>{e.set(s.toUint8Array(),f*oa.LENGTH)}),e[this.publicKeys.length*oa.LENGTH]=this.threshold,e}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let s=e.deserializeBytes(),f=s[s.length-1],d=[];for(let h=0;h<s.length-1;h+=oa.LENGTH){let E=h;d.push(new oa(s.subarray(E,E+oa.LENGTH)))}return new lf({publicKeys:d,threshold:f})}};e1.MAX_KEYS=32,e1.MIN_KEYS=2,e1.MIN_THRESHOLD=1;var Ex=e1,Q_=class pu extends Qp{constructor(e){super();let{signatures:s,bitmap:f}=e;if(s.length>pu.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${pu.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=s,!(f instanceof Uint8Array))this.bitmap=pu.createBitmap({bits:f});else{if(f.length!==pu.BITMAP_LEN)throw new Error(`"bitmap" length should be ${pu.BITMAP_LEN}`);this.bitmap=f}}toUint8Array(){let e=new Uint8Array(this.signatures.length*aa.LENGTH+pu.BITMAP_LEN);return this.signatures.forEach((s,f)=>{e.set(s.toUint8Array(),f*aa.LENGTH)}),e.set(this.bitmap,this.signatures.length*aa.LENGTH),e}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let s=e.deserializeBytes(),f=s.subarray(s.length-4),d=[];for(let h=0;h<s.length-f.length;h+=aa.LENGTH){let E=h;d.push(new aa(s.subarray(E,E+aa.LENGTH)))}return new pu({signatures:d,bitmap:f})}static createBitmap(e){let{bits:s}=e,f=128,d=new Uint8Array([0,0,0,0]),h=new Set;return s.forEach((E,P)=>{if(E>=pu.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${pu.MAX_SIGNATURES_SUPPORTED-1}.`);if(h.has(E))throw new Error("Duplicate bits detected.");if(P>0&&E<=s[P-1])throw new Error("The bits need to be sorted in ascending order.");h.add(E);let R=Math.floor(E/8),q=d[R];q|=f>>E%8,d[R]=q}),d}};Q_.MAX_SIGNATURES_SUPPORTED=32,Q_.BITMAP_LEN=4;var eE=Q_;function Sx(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function tZ(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function TR(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function t1(t,...e){if(!TR(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function CR(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Sx(t.outputLen),Sx(t.blockLen)}function n1(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function PR(t,e){t1(t);const s=e.outputLen;if(t.length<s)throw new Error(`digestInto() expects output buffer of length at least ${s}`)}const nZ=null,rZ=null,tE=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function iZ(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}const sZ=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),oZ=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),nE=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Yc=(t,e)=>t<<32-e|t>>>e,aZ=(t,e)=>t<<e|t>>>32-e>>>0,cZ=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,MR=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,uZ=null;function lZ(t){for(let e=0;e<t.length;e++)t[e]=MR(t[e])}const OR=null;function fZ(t){abytes(t);let e="";for(let s=0;s<t.length;s++)e+=OR[t[s]];return e}const Uu=null;function Ax(t){if(t>=Uu._0&&t<=Uu._9)return t-Uu._0;if(t>=Uu._A&&t<=Uu._F)return t-(Uu._A-10);if(t>=Uu._a&&t<=Uu._f)return t-(Uu._a-10)}function dZ(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,s=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const f=new Uint8Array(s);for(let d=0,h=0;d<s;d++,h+=2){const E=Ax(t.charCodeAt(h)),P=Ax(t.charCodeAt(h+1));if(E===void 0||P===void 0){const R=t[h]+t[h+1];throw new Error('hex string expected, got non-hex character "'+R+'" at index '+h)}f[d]=E*16+P}return f}const RR=async()=>{};async function hZ(t,e,s){let f=Date.now();for(let d=0;d<t;d++){s(d);const h=Date.now()-f;h>=0&&h<e||(await RR(),f+=h)}}function NR(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function ig(t){return typeof t=="string"&&(t=NR(t)),t1(t),t}function UR(...t){let e=0;for(let f=0;f<t.length;f++){const d=t[f];t1(d),e+=d.length}const s=new Uint8Array(e);for(let f=0,d=0;f<t.length;f++){const h=t[f];s.set(h,d),d+=h.length}return s}class xx{clone(){return this._cloneInto()}}const DR=null;function pZ(t,e){if(e!==void 0&&DR.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function Ix(t){const e=f=>t().update(ig(f)).digest(),s=t();return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=()=>t(),e}function gZ(t){const e=(f,d)=>t(d).update(ig(f)).digest(),s=t({});return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=f=>t(f),e}function yZ(t){const e=(f,d)=>t(d).update(ig(f)).digest(),s=t({});return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=f=>t(f),e}function Bx(t=32){if(tE&&typeof tE.getRandomValues=="function")return tE.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function LR(t,e,s,f){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,s,f);const d=BigInt(32),h=BigInt(4294967295),E=Number(s>>d&h),P=Number(s&h),R=f?4:0,q=f?0:4;t.setUint32(e+R,E,f),t.setUint32(e+q,P,f)}const FR=(t,e,s)=>t&e^~t&s,jR=(t,e,s)=>t&e^t&s^e&s;class kx extends xx{constructor(e,s,f,d){super(),this.blockLen=e,this.outputLen=s,this.padOffset=f,this.isLE=d,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=nE(this.buffer)}update(e){n1(this);const{view:s,buffer:f,blockLen:d}=this;e=ig(e);const h=e.length;for(let E=0;E<h;){const P=Math.min(d-this.pos,h-E);if(P===d){const R=nE(e);for(;d<=h-E;E+=d)this.process(R,E);continue}f.set(e.subarray(E,E+P),this.pos),this.pos+=P,E+=P,this.pos===d&&(this.process(s,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){n1(this),PR(e,this),this.finished=!0;const{buffer:s,view:f,blockLen:d,isLE:h}=this;let{pos:E}=this;s[E++]=128,this.buffer.subarray(E).fill(0),this.padOffset>d-E&&(this.process(f,0),E=0);for(let ne=E;ne<d;ne++)s[ne]=0;LR(f,d-8,BigInt(this.length*8),h),this.process(f,0);const P=nE(e),R=this.outputLen;if(R%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const q=R/4,te=this.get();if(q>te.length)throw new Error("_sha2: outputLen bigger than state");for(let ne=0;ne<q;ne++)P.setUint32(4*ne,te[ne],h)}digest(){const{buffer:e,outputLen:s}=this;this.digestInto(e);const f=e.slice(0,s);return this.destroy(),f}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:s,buffer:f,length:d,finished:h,destroyed:E,pos:P}=this;return e.length=d,e.pos=P,e.finished=h,e.destroyed=E,d%s&&e.buffer.set(f),e}}const zR=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),jl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),zl=new Uint32Array(64);class Tx extends kx{constructor(){super(64,32,8,!1),this.A=jl[0]|0,this.B=jl[1]|0,this.C=jl[2]|0,this.D=jl[3]|0,this.E=jl[4]|0,this.F=jl[5]|0,this.G=jl[6]|0,this.H=jl[7]|0}get(){const{A:e,B:s,C:f,D:d,E:h,F:E,G:P,H:R}=this;return[e,s,f,d,h,E,P,R]}set(e,s,f,d,h,E,P,R){this.A=e|0,this.B=s|0,this.C=f|0,this.D=d|0,this.E=h|0,this.F=E|0,this.G=P|0,this.H=R|0}process(e,s){for(let ne=0;ne<16;ne++,s+=4)zl[ne]=e.getUint32(s,!1);for(let ne=16;ne<64;ne++){const ue=zl[ne-15],ge=zl[ne-2],xe=Yc(ue,7)^Yc(ue,18)^ue>>>3,pe=Yc(ge,17)^Yc(ge,19)^ge>>>10;zl[ne]=pe+zl[ne-7]+xe+zl[ne-16]|0}let{A:f,B:d,C:h,D:E,E:P,F:R,G:q,H:te}=this;for(let ne=0;ne<64;ne++){const ue=Yc(P,6)^Yc(P,11)^Yc(P,25),ge=te+ue+FR(P,R,q)+zR[ne]+zl[ne]|0,pe=(Yc(f,2)^Yc(f,13)^Yc(f,22))+jR(f,d,h)|0;te=q,q=R,R=P,P=E+ge|0,E=h,h=d,d=f,f=ge+pe|0}f=f+this.A|0,d=d+this.B|0,h=h+this.C|0,E=E+this.D|0,P=P+this.E|0,R=R+this.F|0,q=q+this.G|0,te=te+this.H|0,this.set(f,d,h,E,P,R,q,te)}roundClean(){zl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class mZ extends Tx{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const HR=Ix(()=>new Tx),bZ=null;class Cx extends xx{constructor(e,s){super(),this.finished=!1,this.destroyed=!1,CR(e);const f=ig(s);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,h=new Uint8Array(d);h.set(f.length>d?e.create().update(f).digest():f);for(let E=0;E<h.length;E++)h[E]^=54;this.iHash.update(h),this.oHash=e.create();for(let E=0;E<h.length;E++)h[E]^=106;this.oHash.update(h),h.fill(0)}update(e){return n1(this),this.iHash.update(e),this}digestInto(e){n1(this),t1(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:s,iHash:f,finished:d,destroyed:h,blockLen:E,outputLen:P}=this;return e=e,e.finished=d,e.destroyed=h,e.blockLen=E,e.outputLen=P,e.oHash=s._cloneInto(e.oHash),e.iHash=f._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Px=(t,e,s)=>new Cx(t,e).update(s).digest();Px.create=(t,e)=>new Cx(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rE=BigInt(0),r1=BigInt(1),KR=BigInt(2);function Yf(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function sg(t){if(!Yf(t))throw new Error("Uint8Array expected")}function Du(t,e){if(typeof e!="boolean")throw new Error(`${t} must be valid boolean, got "${e}".`)}const $R=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Jf(t){sg(t);let e="";for(let s=0;s<t.length;s++)e+=$R[t[s]];return e}function VR(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function Mx(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}const Lu={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Ox(t){if(t>=Lu._0&&t<=Lu._9)return t-Lu._0;if(t>=Lu._A&&t<=Lu._F)return t-(Lu._A-10);if(t>=Lu._a&&t<=Lu._f)return t-(Lu._a-10)}function Oh(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,s=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const f=new Uint8Array(s);for(let d=0,h=0;d<s;d++,h+=2){const E=Ox(t.charCodeAt(h)),P=Ox(t.charCodeAt(h+1));if(E===void 0||P===void 0){const R=t[h]+t[h+1];throw new Error('hex string expected, got non-hex character "'+R+'" at index '+h)}f[d]=E*16+P}return f}function Qf(t){return Mx(Jf(t))}function Rh(t){return sg(t),Mx(Jf(Uint8Array.from(t).reverse()))}function Nh(t,e){return Oh(t.toString(16).padStart(e*2,"0"))}function og(t,e){return Nh(t,e).reverse()}function vZ(t){return Oh(VR(t))}function eo(t,e,s){let f;if(typeof e=="string")try{f=Oh(e)}catch(h){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${h}`)}else if(Yf(e))f=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const d=f.length;if(typeof s=="number"&&d!==s)throw new Error(`${t} expected ${s} bytes, got ${d}`);return f}function ed(...t){let e=0;for(let f=0;f<t.length;f++){const d=t[f];sg(d),e+=d.length}const s=new Uint8Array(e);for(let f=0,d=0;f<t.length;f++){const h=t[f];s.set(h,d),d+=h.length}return s}function wZ(t,e){if(t.length!==e.length)return!1;let s=0;for(let f=0;f<t.length;f++)s|=t[f]^e[f];return s===0}function _Z(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}const iE=t=>typeof t=="bigint"&&rE<=t;function i1(t,e,s){return iE(t)&&iE(e)&&iE(s)&&e<=t&&t<s}function $a(t,e,s,f){if(!i1(e,s,f))throw new Error(`expected valid ${t}: ${s} <= n < ${f}, got ${typeof e} ${e}`)}function EZ(t){let e;for(e=0;t>rE;t>>=r1,e+=1);return e}function SZ(t,e){return t>>BigInt(e)&r1}function AZ(t,e,s){return t|(s?r1:rE)<<BigInt(e)}const sE=t=>(KR<<BigInt(t-1))-r1,oE=t=>new Uint8Array(t),Rx=t=>Uint8Array.from(t);function Nx(t,e,s){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof s!="function")throw new Error("hmacFn must be a function");let f=oE(t),d=oE(t),h=0;const E=()=>{f.fill(1),d.fill(0),h=0},P=(...ne)=>s(d,f,...ne),R=(ne=oE())=>{d=P(Rx([0]),ne),f=P(),ne.length!==0&&(d=P(Rx([1]),ne),f=P())},q=()=>{if(h++>=1e3)throw new Error("drbg: tried 1000 values");let ne=0;const ue=[];for(;ne<e;){f=P();const ge=f.slice();ue.push(ge),ne+=f.length}return ed(...ue)};return(ne,ue)=>{E(),R(ne);let ge;for(;!(ge=ue(q()));)R();return E(),ge}}const WR={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Yf(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Uh(t,e,s={}){const f=(d,h,E)=>{const P=WR[h];if(typeof P!="function")throw new Error(`Invalid validator "${h}", expected function`);const R=t[d];if(!(E&&R===void 0)&&!P(R,t))throw new Error(`Invalid param ${String(d)}=${R} (${typeof R}), expected ${h}`)};for(const[d,h]of Object.entries(e))f(d,h,!1);for(const[d,h]of Object.entries(s))f(d,h,!0);return t}const xZ=()=>{throw new Error("not implemented")};function ag(t){const e=new WeakMap;return(s,...f)=>{const d=e.get(s);if(d!==void 0)return d;const h=t(s,...f);return e.set(s,h),h}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const to=BigInt(0),Zi=BigInt(1),Hl=BigInt(2),GR=BigInt(3),aE=BigInt(4),Ux=BigInt(5),Dx=BigInt(8),qR=BigInt(9),ZR=BigInt(16);function os(t,e){const s=t%e;return s>=to?s:e+s}function XR(t,e,s){if(s<=to||e<to)throw new Error("Expected power/modulo > 0");if(s===Zi)return to;let f=Zi;for(;e>to;)e&Zi&&(f=f*t%s),t=t*t%s,e>>=Zi;return f}function Ms(t,e,s){let f=t;for(;e-- >to;)f*=f,f%=s;return f}function s1(t,e){if(t===to||e<=to)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let s=os(t,e),f=e,d=to,h=Zi,E=Zi,P=to;for(;s!==to;){const q=f/s,te=f%s,ne=d-E*q,ue=h-P*q;f=s,s=te,d=E,h=P,E=ne,P=ue}if(f!==Zi)throw new Error("invert: does not exist");return os(d,e)}function YR(t){const e=(t-Zi)/Hl;let s,f,d;for(s=t-Zi,f=0;s%Hl===to;s/=Hl,f++);for(d=Hl;d<t&&XR(d,e,t)!==t-Zi;d++);if(f===1){const E=(t+Zi)/aE;return function(R,q){const te=R.pow(q,E);if(!R.eql(R.sqr(te),q))throw new Error("Cannot find square root");return te}}const h=(s+Zi)/Hl;return function(P,R){if(P.pow(R,e)===P.neg(P.ONE))throw new Error("Cannot find square root");let q=f,te=P.pow(P.mul(P.ONE,d),s),ne=P.pow(R,h),ue=P.pow(R,s);for(;!P.eql(ue,P.ONE);){if(P.eql(ue,P.ZERO))return P.ZERO;let ge=1;for(let pe=P.sqr(ue);ge<q&&!P.eql(pe,P.ONE);ge++)pe=P.sqr(pe);const xe=P.pow(te,Zi<<BigInt(q-ge-1));te=P.sqr(xe),ne=P.mul(ne,xe),ue=P.mul(ue,te),q=ge}return ne}}function JR(t){if(t%aE===GR){const e=(t+Zi)/aE;return function(f,d){const h=f.pow(d,e);if(!f.eql(f.sqr(h),d))throw new Error("Cannot find square root");return h}}if(t%Dx===Ux){const e=(t-Ux)/Dx;return function(f,d){const h=f.mul(d,Hl),E=f.pow(h,e),P=f.mul(d,E),R=f.mul(f.mul(P,Hl),E),q=f.mul(P,f.sub(R,f.ONE));if(!f.eql(f.sqr(q),d))throw new Error("Cannot find square root");return q}}return t%ZR,YR(t)}const QR=(t,e)=>(os(t,e)&Zi)===Zi,eN=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tN(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},s=eN.reduce((f,d)=>(f[d]="function",f),e);return Uh(t,s)}function nN(t,e,s){if(s<to)throw new Error("Expected power > 0");if(s===to)return t.ONE;if(s===Zi)return e;let f=t.ONE,d=e;for(;s>to;)s&Zi&&(f=t.mul(f,d)),d=t.sqr(d),s>>=Zi;return f}function rN(t,e){const s=new Array(e.length),f=e.reduce((h,E,P)=>t.is0(E)?h:(s[P]=h,t.mul(h,E)),t.ONE),d=t.inv(f);return e.reduceRight((h,E,P)=>t.is0(E)?h:(s[P]=t.mul(h,s[P]),t.mul(h,E)),d),s}function IZ(t,e,s){return t.mul(e,typeof s=="bigint"?s1(s,t.ORDER):t.inv(s))}function iN(t){const e=(t-Zi)/Hl;return(s,f)=>s.pow(f,e)}function BZ(t){const e=iN(t.ORDER);return s=>{const f=e(t,s);return t.eql(f,t.ZERO)||t.eql(f,t.ONE)}}function cE(t,e){const s=e!==void 0?e:t.toString(2).length,f=Math.ceil(s/8);return{nBitLength:s,nByteLength:f}}function Lx(t,e,s=!1,f={}){if(t<=to)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:d,nByteLength:h}=cE(t,e);if(h>2048)throw new Error("Field lengths over 2048 bytes are not supported");const E=JR(t),P=Object.freeze({ORDER:t,BITS:d,BYTES:h,MASK:sE(d),ZERO:to,ONE:Zi,create:R=>os(R,t),isValid:R=>{if(typeof R!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof R}`);return to<=R&&R<t},is0:R=>R===to,isOdd:R=>(R&Zi)===Zi,neg:R=>os(-R,t),eql:(R,q)=>R===q,sqr:R=>os(R*R,t),add:(R,q)=>os(R+q,t),sub:(R,q)=>os(R-q,t),mul:(R,q)=>os(R*q,t),pow:(R,q)=>nN(P,R,q),div:(R,q)=>os(R*s1(q,t),t),sqrN:R=>R*R,addN:(R,q)=>R+q,subN:(R,q)=>R-q,mulN:(R,q)=>R*q,inv:R=>s1(R,t),sqrt:f.sqrt||(R=>E(P,R)),invertBatch:R=>rN(P,R),cmov:(R,q,te)=>te?q:R,toBytes:R=>s?og(R,h):Nh(R,h),fromBytes:R=>{if(R.length!==h)throw new Error(`Fp.fromBytes: expected ${h}, got ${R.length}`);return s?Rh(R):Qf(R)}});return Object.freeze(P)}function kZ(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const s=t.sqrt(e);return t.isOdd(s)?s:t.neg(s)}function TZ(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const s=t.sqrt(e);return t.isOdd(s)?t.neg(s):s}function CZ(t,e,s=!1){t=ensureBytes("privateHash",t);const f=t.length,d=cE(e).nByteLength+8;if(d<24||f<d||f>1024)throw new Error(`hashToPrivateScalar: expected ${d}-1024 bytes of input, got ${f}`);const h=s?bytesToNumberLE(t):bytesToNumberBE(t);return os(h,e-Zi)+Zi}function Fx(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function jx(t){const e=Fx(t);return e+Math.ceil(e/2)}function sN(t,e,s=!1){const f=t.length,d=Fx(e),h=jx(e);if(f<16||f<h||f>1024)throw new Error(`expected ${h}-1024 bytes of input, got ${f}`);const E=s?Qf(t):Rh(t),P=os(E,e-Zi)+Zi;return s?og(P,d):Nh(P,d)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const oN=BigInt(0),uE=BigInt(1),lE=new WeakMap,zx=new WeakMap;function Hx(t,e){const s=(h,E)=>{const P=E.negate();return h?P:E},f=h=>{if(!Number.isSafeInteger(h)||h<=0||h>e)throw new Error(`Wrong window size=${h}, should be [1..${e}]`)},d=h=>{f(h);const E=Math.ceil(e/h)+1,P=2**(h-1);return{windows:E,windowSize:P}};return{constTimeNegate:s,unsafeLadder(h,E){let P=t.ZERO,R=h;for(;E>oN;)E&uE&&(P=P.add(R)),R=R.double(),E>>=uE;return P},precomputeWindow(h,E){const{windows:P,windowSize:R}=d(E),q=[];let te=h,ne=te;for(let ue=0;ue<P;ue++){ne=te,q.push(ne);for(let ge=1;ge<R;ge++)ne=ne.add(te),q.push(ne);te=ne.double()}return q},wNAF(h,E,P){const{windows:R,windowSize:q}=d(h);let te=t.ZERO,ne=t.BASE;const ue=BigInt(2**h-1),ge=2**h,xe=BigInt(h);for(let pe=0;pe<R;pe++){const Se=pe*q;let Ce=Number(P&ue);P>>=xe,Ce>q&&(Ce-=ge,P+=uE);const Fe=Se,We=Se+Math.abs(Ce)-1,xt=pe%2!==0,kt=Ce<0;Ce===0?ne=ne.add(s(xt,E[Fe])):te=te.add(s(kt,E[We]))}return{p:te,f:ne}},wNAFCached(h,E,P){const R=zx.get(h)||1;let q=lE.get(h);return q||(q=this.precomputeWindow(h,R),R!==1&&lE.set(h,P(q))),this.wNAF(R,q,E)},setWindowSize(h,E){f(E),zx.set(h,E),lE.delete(h)}}}function fE(t){return tN(t.Fp),Uh(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...cE(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Kx(t){t.lowS!==void 0&&Du("lowS",t.lowS),t.prehash!==void 0&&Du("prehash",t.prehash)}function aN(t){const e=fE(t);Uh(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:s,Fp:f,a:d}=e;if(s){if(!f.eql(d,f.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof s!="object"||typeof s.beta!="bigint"||typeof s.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{Ph:cN,aT:uN}=fe,td={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=td;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const s=t[1],f=t.subarray(2,s+2);if(!s||f.length!==s)throw new e("Invalid signature integer: wrong length");if(f[0]&128)throw new e("Invalid signature integer: negative");if(f[0]===0&&!(f[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:cN(f),l:t.subarray(s+2)}},toSig(t){const{Err:e}=td,s=typeof t=="string"?uN(t):t;sg(s);let f=s.length;if(f<2||s[0]!=48)throw new e("Invalid signature tag");if(s[1]!==f-2)throw new e("Invalid signature: incorrect length");const{d,l:h}=td._parseInt(s.subarray(2)),{d:E,l:P}=td._parseInt(h);if(P.length)throw new e("Invalid signature: left bytes after parsing");return{r:d,s:E}},hexFromSig(t){const e=q=>Number.parseInt(q[0],16)&8?"00"+q:q,s=q=>{const te=q.toString(16);return te.length&1?`0${te}`:te},f=e(s(t.s)),d=e(s(t.r)),h=f.length/2,E=d.length/2,P=s(h),R=s(E);return`30${s(E+h+4)}02${R}${d}02${P}${f}`}},Jc=BigInt(0),Ki=BigInt(1),Kl=BigInt(2),o1=BigInt(3),$x=BigInt(4);function lN(t){const e=aN(t),{Fp:s}=e,f=e.toBytes||((xe,pe,Se)=>{const Ce=pe.toAffine();return ed(Uint8Array.from([4]),s.toBytes(Ce.x),s.toBytes(Ce.y))}),d=e.fromBytes||(xe=>{const pe=xe.subarray(1),Se=s.fromBytes(pe.subarray(0,s.BYTES)),Ce=s.fromBytes(pe.subarray(s.BYTES,2*s.BYTES));return{x:Se,y:Ce}});function h(xe){const{a:pe,b:Se}=e,Ce=s.sqr(xe),Fe=s.mul(Ce,xe);return s.add(s.add(Fe,s.mul(xe,pe)),Se)}if(!s.eql(s.sqr(e.Gy),h(e.Gx)))throw new Error("bad generator point: equation left != right");function E(xe){return i1(xe,Ki,e.n)}function P(xe){const{allowedPrivateKeyLengths:pe,nByteLength:Se,wrapPrivateKey:Ce,n:Fe}=e;if(pe&&typeof xe!="bigint"){if(Yf(xe)&&(xe=Jf(xe)),typeof xe!="string"||!pe.includes(xe.length))throw new Error("Invalid key");xe=xe.padStart(Se*2,"0")}let We;try{We=typeof xe=="bigint"?xe:Qf(eo("private key",xe,Se))}catch{throw new Error(`private key must be ${Se} bytes, hex or bigint, not ${typeof xe}`)}return Ce&&(We=os(We,Fe)),$a("private key",We,Ki,Fe),We}function R(xe){if(!(xe instanceof ne))throw new Error("ProjectivePoint expected")}const q=ag((xe,pe)=>{const{px:Se,py:Ce,pz:Fe}=xe;if(s.eql(Fe,s.ONE))return{x:Se,y:Ce};const We=xe.is0();pe==null&&(pe=We?s.ONE:s.inv(Fe));const xt=s.mul(Se,pe),kt=s.mul(Ce,pe),Bt=s.mul(Fe,pe);if(We)return{x:s.ZERO,y:s.ZERO};if(!s.eql(Bt,s.ONE))throw new Error("invZ was invalid");return{x:xt,y:kt}}),te=ag(xe=>{if(xe.is0()){if(e.allowInfinityPoint&&!s.is0(xe.py))return;throw new Error("bad point: ZERO")}const{x:pe,y:Se}=xe.toAffine();if(!s.isValid(pe)||!s.isValid(Se))throw new Error("bad point: x or y not FE");const Ce=s.sqr(Se),Fe=h(pe);if(!s.eql(Ce,Fe))throw new Error("bad point: equation left != right");if(!xe.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class ne{constructor(pe,Se,Ce){if(this.px=pe,this.py=Se,this.pz=Ce,pe==null||!s.isValid(pe))throw new Error("x required");if(Se==null||!s.isValid(Se))throw new Error("y required");if(Ce==null||!s.isValid(Ce))throw new Error("z required");Object.freeze(this)}static fromAffine(pe){const{x:Se,y:Ce}=pe||{};if(!pe||!s.isValid(Se)||!s.isValid(Ce))throw new Error("invalid affine point");if(pe instanceof ne)throw new Error("projective point not allowed");const Fe=We=>s.eql(We,s.ZERO);return Fe(Se)&&Fe(Ce)?ne.ZERO:new ne(Se,Ce,s.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(pe){const Se=s.invertBatch(pe.map(Ce=>Ce.pz));return pe.map((Ce,Fe)=>Ce.toAffine(Se[Fe])).map(ne.fromAffine)}static fromHex(pe){const Se=ne.fromAffine(d(eo("pointHex",pe)));return Se.assertValidity(),Se}static fromPrivateKey(pe){return ne.BASE.multiply(P(pe))}_setWindowSize(pe){ge.setWindowSize(this,pe)}assertValidity(){te(this)}hasEvenY(){const{y:pe}=this.toAffine();if(s.isOdd)return!s.isOdd(pe);throw new Error("Field doesn't support isOdd")}equals(pe){R(pe);const{px:Se,py:Ce,pz:Fe}=this,{px:We,py:xt,pz:kt}=pe,Bt=s.eql(s.mul(Se,kt),s.mul(We,Fe)),Wt=s.eql(s.mul(Ce,kt),s.mul(xt,Fe));return Bt&&Wt}negate(){return new ne(this.px,s.neg(this.py),this.pz)}double(){const{a:pe,b:Se}=e,Ce=s.mul(Se,o1),{px:Fe,py:We,pz:xt}=this;let kt=s.ZERO,Bt=s.ZERO,Wt=s.ZERO,Me=s.mul(Fe,Fe),Ke=s.mul(We,We),nt=s.mul(xt,xt),Tt=s.mul(Fe,We);return Tt=s.add(Tt,Tt),Wt=s.mul(Fe,xt),Wt=s.add(Wt,Wt),kt=s.mul(pe,Wt),Bt=s.mul(Ce,nt),Bt=s.add(kt,Bt),kt=s.sub(Ke,Bt),Bt=s.add(Ke,Bt),Bt=s.mul(kt,Bt),kt=s.mul(Tt,kt),Wt=s.mul(Ce,Wt),nt=s.mul(pe,nt),Tt=s.sub(Me,nt),Tt=s.mul(pe,Tt),Tt=s.add(Tt,Wt),Wt=s.add(Me,Me),Me=s.add(Wt,Me),Me=s.add(Me,nt),Me=s.mul(Me,Tt),Bt=s.add(Bt,Me),nt=s.mul(We,xt),nt=s.add(nt,nt),Me=s.mul(nt,Tt),kt=s.sub(kt,Me),Wt=s.mul(nt,Ke),Wt=s.add(Wt,Wt),Wt=s.add(Wt,Wt),new ne(kt,Bt,Wt)}add(pe){R(pe);const{px:Se,py:Ce,pz:Fe}=this,{px:We,py:xt,pz:kt}=pe;let Bt=s.ZERO,Wt=s.ZERO,Me=s.ZERO;const Ke=e.a,nt=s.mul(e.b,o1);let Tt=s.mul(Se,We),pt=s.mul(Ce,xt),Ht=s.mul(Fe,kt),lt=s.add(Se,Ce),rt=s.add(We,xt);lt=s.mul(lt,rt),rt=s.add(Tt,pt),lt=s.sub(lt,rt),rt=s.add(Se,Fe);let ot=s.add(We,kt);return rt=s.mul(rt,ot),ot=s.add(Tt,Ht),rt=s.sub(rt,ot),ot=s.add(Ce,Fe),Bt=s.add(xt,kt),ot=s.mul(ot,Bt),Bt=s.add(pt,Ht),ot=s.sub(ot,Bt),Me=s.mul(Ke,rt),Bt=s.mul(nt,Ht),Me=s.add(Bt,Me),Bt=s.sub(pt,Me),Me=s.add(pt,Me),Wt=s.mul(Bt,Me),pt=s.add(Tt,Tt),pt=s.add(pt,Tt),Ht=s.mul(Ke,Ht),rt=s.mul(nt,rt),pt=s.add(pt,Ht),Ht=s.sub(Tt,Ht),Ht=s.mul(Ke,Ht),rt=s.add(rt,Ht),Tt=s.mul(pt,rt),Wt=s.add(Wt,Tt),Tt=s.mul(ot,rt),Bt=s.mul(lt,Bt),Bt=s.sub(Bt,Tt),Tt=s.mul(lt,pt),Me=s.mul(ot,Me),Me=s.add(Me,Tt),new ne(Bt,Wt,Me)}subtract(pe){return this.add(pe.negate())}is0(){return this.equals(ne.ZERO)}wNAF(pe){return ge.wNAFCached(this,pe,ne.normalizeZ)}multiplyUnsafe(pe){$a("scalar",pe,Jc,e.n);const Se=ne.ZERO;if(pe===Jc)return Se;if(pe===Ki)return this;const{endo:Ce}=e;if(!Ce)return ge.unsafeLadder(this,pe);let{k1neg:Fe,k1:We,k2neg:xt,k2:kt}=Ce.splitScalar(pe),Bt=Se,Wt=Se,Me=this;for(;We>Jc||kt>Jc;)We&Ki&&(Bt=Bt.add(Me)),kt&Ki&&(Wt=Wt.add(Me)),Me=Me.double(),We>>=Ki,kt>>=Ki;return Fe&&(Bt=Bt.negate()),xt&&(Wt=Wt.negate()),Wt=new ne(s.mul(Wt.px,Ce.beta),Wt.py,Wt.pz),Bt.add(Wt)}multiply(pe){const{endo:Se,n:Ce}=e;$a("scalar",pe,Ki,Ce);let Fe,We;if(Se){const{k1neg:xt,k1:kt,k2neg:Bt,k2:Wt}=Se.splitScalar(pe);let{p:Me,f:Ke}=this.wNAF(kt),{p:nt,f:Tt}=this.wNAF(Wt);Me=ge.constTimeNegate(xt,Me),nt=ge.constTimeNegate(Bt,nt),nt=new ne(s.mul(nt.px,Se.beta),nt.py,nt.pz),Fe=Me.add(nt),We=Ke.add(Tt)}else{const{p:xt,f:kt}=this.wNAF(pe);Fe=xt,We=kt}return ne.normalizeZ([Fe,We])[0]}multiplyAndAddUnsafe(pe,Se,Ce){const Fe=ne.BASE,We=(kt,Bt)=>Bt===Jc||Bt===Ki||!kt.equals(Fe)?kt.multiplyUnsafe(Bt):kt.multiply(Bt),xt=We(this,Se).add(We(pe,Ce));return xt.is0()?void 0:xt}toAffine(pe){return q(this,pe)}isTorsionFree(){const{h:pe,isTorsionFree:Se}=e;if(pe===Ki)return!0;if(Se)return Se(ne,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:pe,clearCofactor:Se}=e;return pe===Ki?this:Se?Se(ne,this):this.multiplyUnsafe(e.h)}toRawBytes(pe=!0){return Du("isCompressed",pe),this.assertValidity(),f(ne,this,pe)}toHex(pe=!0){return Du("isCompressed",pe),Jf(this.toRawBytes(pe))}}ne.BASE=new ne(e.Gx,e.Gy,s.ONE),ne.ZERO=new ne(s.ZERO,s.ONE,s.ZERO);const ue=e.nBitLength,ge=Hx(ne,e.endo?Math.ceil(ue/2):ue);return{CURVE:e,ProjectivePoint:ne,normPrivateKeyToScalar:P,weierstrassEquation:h,isWithinCurveOrder:E}}function fN(t){const e=fE(t);return Uh(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function dN(t){const e=fN(t),{Fp:s,n:f}=e,d=s.BYTES+1,h=2*s.BYTES+1;function E(lt){return os(lt,f)}function P(lt){return s1(lt,f)}const{ProjectivePoint:R,normPrivateKeyToScalar:q,weierstrassEquation:te,isWithinCurveOrder:ne}=lN({...e,toBytes(lt,rt,ot){const Mt=rt.toAffine(),Ut=s.toBytes(Mt.x),rn=ed;return Du("isCompressed",ot),ot?rn(Uint8Array.from([rt.hasEvenY()?2:3]),Ut):rn(Uint8Array.from([4]),Ut,s.toBytes(Mt.y))},fromBytes(lt){const rt=lt.length,ot=lt[0],Mt=lt.subarray(1);if(rt===d&&(ot===2||ot===3)){const Ut=Qf(Mt);if(!i1(Ut,Ki,s.ORDER))throw new Error("Point is not on curve");const rn=te(Ut);let Qt;try{Qt=s.sqrt(rn)}catch(hr){const lr=hr instanceof Error?": "+hr.message:"";throw new Error("Point is not on curve"+lr)}const Cn=(Qt&Ki)===Ki;return(ot&1)===1!==Cn&&(Qt=s.neg(Qt)),{x:Ut,y:Qt}}else if(rt===h&&ot===4){const Ut=s.fromBytes(Mt.subarray(0,s.BYTES)),rn=s.fromBytes(Mt.subarray(s.BYTES,2*s.BYTES));return{x:Ut,y:rn}}else throw new Error(`Point of length ${rt} was invalid. Expected ${d} compressed bytes or ${h} uncompressed bytes`)}}),ue=lt=>Jf(Nh(lt,e.nByteLength));function ge(lt){const rt=f>>Ki;return lt>rt}function xe(lt){return ge(lt)?E(-lt):lt}const pe=(lt,rt,ot)=>Qf(lt.slice(rt,ot));class Se{constructor(rt,ot,Mt){this.r=rt,this.s=ot,this.recovery=Mt,this.assertValidity()}static fromCompact(rt){const ot=e.nByteLength;return rt=eo("compactSignature",rt,ot*2),new Se(pe(rt,0,ot),pe(rt,ot,2*ot))}static fromDER(rt){const{r:ot,s:Mt}=td.toSig(eo("DER",rt));return new Se(ot,Mt)}assertValidity(){$a("r",this.r,Ki,f),$a("s",this.s,Ki,f)}addRecoveryBit(rt){return new Se(this.r,this.s,rt)}recoverPublicKey(rt){const{r:ot,s:Mt,recovery:Ut}=this,rn=Bt(eo("msgHash",rt));if(Ut==null||![0,1,2,3].includes(Ut))throw new Error("recovery id invalid");const Qt=Ut===2||Ut===3?ot+e.n:ot;if(Qt>=s.ORDER)throw new Error("recovery id 2 or 3 invalid");const Cn=Ut&1?"03":"02",qn=R.fromHex(Cn+ue(Qt)),hr=P(Qt),lr=E(-rn*hr),Sr=E(Mt*hr),_r=R.BASE.multiplyAndAddUnsafe(qn,lr,Sr);if(!_r)throw new Error("point at infinify");return _r.assertValidity(),_r}hasHighS(){return ge(this.s)}normalizeS(){return this.hasHighS()?new Se(this.r,E(-this.s),this.recovery):this}toDERRawBytes(){return Oh(this.toDERHex())}toDERHex(){return td.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Oh(this.toCompactHex())}toCompactHex(){return ue(this.r)+ue(this.s)}}const Ce={isValidPrivateKey(lt){try{return q(lt),!0}catch{return!1}},normPrivateKeyToScalar:q,randomPrivateKey:()=>{const lt=jx(e.n);return sN(e.randomBytes(lt),e.n)},precompute(lt=8,rt=R.BASE){return rt._setWindowSize(lt),rt.multiply(BigInt(3)),rt}};function Fe(lt,rt=!0){return R.fromPrivateKey(lt).toRawBytes(rt)}function We(lt){const rt=Yf(lt),ot=typeof lt=="string",Mt=(rt||ot)&<.length;return rt?Mt===d||Mt===h:ot?Mt===2*d||Mt===2*h:lt instanceof R}function xt(lt,rt,ot=!0){if(We(lt))throw new Error("first arg must be private key");if(!We(rt))throw new Error("second arg must be public key");return R.fromHex(rt).multiply(q(lt)).toRawBytes(ot)}const kt=e.bits2int||function(lt){const rt=Qf(lt),ot=lt.length*8-e.nBitLength;return ot>0?rt>>BigInt(ot):rt},Bt=e.bits2int_modN||function(lt){return E(kt(lt))},Wt=sE(e.nBitLength);function Me(lt){return $a(`num < 2^${e.nBitLength}`,lt,Jc,Wt),Nh(lt,e.nByteLength)}function Ke(lt,rt,ot=nt){if(["recovered","canonical"].some(li=>li in ot))throw new Error("sign() legacy options not supported");const{hash:Mt,randomBytes:Ut}=e;let{lowS:rn,prehash:Qt,extraEntropy:Cn}=ot;rn==null&&(rn=!0),lt=eo("msgHash",lt),Kx(ot),Qt&&(lt=eo("prehashed msgHash",Mt(lt)));const qn=Bt(lt),hr=q(rt),lr=[Me(hr),Me(qn)];if(Cn!=null&&Cn!==!1){const li=Cn===!0?Ut(s.BYTES):Cn;lr.push(eo("extraEntropy",li))}const Sr=ed(...lr),_r=qn;function Kr(li){const ti=kt(li);if(!ne(ti))return;const Yi=P(ti),Yr=R.BASE.multiply(ti).toAffine(),Ai=E(Yr.x);if(Ai===Jc)return;const yi=E(Yi*E(_r+Ai*hr));if(yi===Jc)return;let Bi=(Yr.x===Ai?0:2)|Number(Yr.y&Ki),ki=yi;return rn&&ge(yi)&&(ki=xe(yi),Bi^=1),new Se(Ai,ki,Bi)}return{seed:Sr,k2sig:Kr}}const nt={lowS:e.lowS,prehash:!1},Tt={lowS:e.lowS,prehash:!1};function pt(lt,rt,ot=nt){const{seed:Mt,k2sig:Ut}=Ke(lt,rt,ot),rn=e;return Nx(rn.hash.outputLen,rn.nByteLength,rn.hmac)(Mt,Ut)}R.BASE._setWindowSize(8);function Ht(lt,rt,ot,Mt=Tt){const Ut=lt;if(rt=eo("msgHash",rt),ot=eo("publicKey",ot),"strict"in Mt)throw new Error("options.strict was renamed to lowS");Kx(Mt);const{lowS:rn,prehash:Qt}=Mt;let Cn,qn;try{if(typeof Ut=="string"||Yf(Ut))try{Cn=Se.fromDER(Ut)}catch(Yr){if(!(Yr instanceof td.Err))throw Yr;Cn=Se.fromCompact(Ut)}else if(typeof Ut=="object"&&typeof Ut.r=="bigint"&&typeof Ut.s=="bigint"){const{r:Yr,s:Ai}=Ut;Cn=new Se(Yr,Ai)}else throw new Error("PARSE");qn=R.fromHex(ot)}catch(Yr){if(Yr.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(rn&&Cn.hasHighS())return!1;Qt&&(rt=e.hash(rt));const{r:hr,s:lr}=Cn,Sr=Bt(rt),_r=P(lr),Kr=E(Sr*_r),li=E(hr*_r),ti=R.BASE.multiplyAndAddUnsafe(qn,Kr,li)?.toAffine();return ti?E(ti.x)===hr:!1}return{CURVE:e,getPublicKey:Fe,getSharedSecret:xt,sign:pt,verify:Ht,ProjectivePoint:R,Signature:Se,utils:Ce}}function hN(t,e){const s=t.ORDER;let f=Jc;for(let xe=s-Ki;xe%Kl===Jc;xe/=Kl)f+=Ki;const d=f,h=Kl<<d-Ki-Ki,E=h*Kl,P=(s-Ki)/E,R=(P-Ki)/Kl,q=E-Ki,te=h,ne=t.pow(e,P),ue=t.pow(e,(P+Ki)/Kl);let ge=(xe,pe)=>{let Se=ne,Ce=t.pow(pe,q),Fe=t.sqr(Ce);Fe=t.mul(Fe,pe);let We=t.mul(xe,Fe);We=t.pow(We,R),We=t.mul(We,Ce),Ce=t.mul(We,pe),Fe=t.mul(We,xe);let xt=t.mul(Fe,Ce);We=t.pow(xt,te);let kt=t.eql(We,t.ONE);Ce=t.mul(Fe,ue),We=t.mul(xt,Se),Fe=t.cmov(Ce,Fe,kt),xt=t.cmov(We,xt,kt);for(let Bt=d;Bt>Ki;Bt--){let Wt=Bt-Kl;Wt=Kl<<Wt-Ki;let Me=t.pow(xt,Wt);const Ke=t.eql(Me,t.ONE);Ce=t.mul(Fe,Se),Se=t.mul(Se,Se),Me=t.mul(xt,Se),Fe=t.cmov(Ce,Fe,Ke),xt=t.cmov(Me,xt,Ke)}return{isValid:kt,value:Fe}};if(t.ORDER%$x===o1){const xe=(t.ORDER-o1)/$x,pe=t.sqrt(t.neg(e));ge=(Se,Ce)=>{let Fe=t.sqr(Ce);const We=t.mul(Se,Ce);Fe=t.mul(Fe,We);let xt=t.pow(Fe,xe);xt=t.mul(xt,We);const kt=t.mul(xt,pe),Bt=t.mul(t.sqr(xt),Ce),Wt=t.eql(Bt,Se);let Me=t.cmov(kt,xt,Wt);return{isValid:Wt,value:Me}}}return ge}function PZ(t,e){if(mod.validateField(t),!t.isValid(e.A)||!t.isValid(e.B)||!t.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const s=hN(t,e.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return f=>{let d,h,E,P,R,q,te,ne;d=t.sqr(f),d=t.mul(d,e.Z),h=t.sqr(d),h=t.add(h,d),E=t.add(h,t.ONE),E=t.mul(E,e.B),P=t.cmov(e.Z,t.neg(h),!t.eql(h,t.ZERO)),P=t.mul(P,e.A),h=t.sqr(E),q=t.sqr(P),R=t.mul(q,e.A),h=t.add(h,R),h=t.mul(h,E),q=t.mul(q,P),R=t.mul(q,e.B),h=t.add(h,R),te=t.mul(d,E);const{isValid:ue,value:ge}=s(h,q);ne=t.mul(d,f),ne=t.mul(ne,ge),te=t.cmov(te,E,ue),ne=t.cmov(ne,ge,ue);const xe=t.isOdd(f)===t.isOdd(ne);return ne=t.cmov(t.neg(ne),ne,xe),te=t.div(te,P),{x:te,y:ne}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function pN(t){return{hash:t,hmac:(e,...s)=>Px(t,e,UR(...s)),randomBytes:Bx}}function gN(t,e){const s=f=>dN({...t,...pN(f)});return Object.freeze({...s(e),create:s})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const cg=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),a1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ug=BigInt(1),c1=BigInt(2),Vx=(t,e)=>(t+e/c1)/e;function Wx(t){const e=cg,s=BigInt(3),f=BigInt(6),d=BigInt(11),h=BigInt(22),E=BigInt(23),P=BigInt(44),R=BigInt(88),q=t*t*t%e,te=q*q*t%e,ne=Ms(te,s,e)*te%e,ue=Ms(ne,s,e)*te%e,ge=Ms(ue,c1,e)*q%e,xe=Ms(ge,d,e)*ge%e,pe=Ms(xe,h,e)*xe%e,Se=Ms(pe,P,e)*pe%e,Ce=Ms(Se,R,e)*Se%e,Fe=Ms(Ce,P,e)*pe%e,We=Ms(Fe,s,e)*te%e,xt=Ms(We,E,e)*xe%e,kt=Ms(xt,f,e)*q%e,Bt=Ms(kt,c1,e);if(!dE.eql(dE.sqr(Bt),t))throw new Error("Cannot find square root");return Bt}const dE=Lx(cg,void 0,void 0,{sqrt:Wx}),Fu=gN({a:BigInt(0),b:BigInt(7),Fp:dE,n:a1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=a1,s=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),f=-ug*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),d=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),h=s,E=BigInt("0x100000000000000000000000000000000"),P=Vx(h*t,e),R=Vx(-f*t,e);let q=os(t-P*s-R*d,e),te=os(-P*f-R*h,e);const ne=q>E,ue=te>E;if(ne&&(q=e-q),ue&&(te=e-te),q>E||te>E)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:ne,k1:q,k2neg:ue,k2:te}}}},HR),Gx=BigInt(0),qx=null;function hE(t,...e){let s=qx[t];if(s===void 0){const f=sha256(Uint8Array.from(t,d=>d.charCodeAt(0)));s=concatBytes(f,f),qx[t]=s}return sha256(concatBytes(s,...e))}const Zx=t=>t.toRawBytes(!0).slice(1),pE=t=>numberToBytesBE(t,32),gE=t=>mod(t,cg),lg=t=>mod(t,a1),yE=Fu.ProjectivePoint,yN=(t,e,s)=>yE.BASE.multiplyAndAddUnsafe(t,e,s);function mE(t){let e=Fu.utils.normPrivateKeyToScalar(t),s=yE.fromPrivateKey(e);return{scalar:s.hasEvenY()?e:lg(-e),bytes:Zx(s)}}function mN(t){aInRange("x",t,ug,cg);const e=gE(t*t),s=gE(e*t+BigInt(7));let f=Wx(s);f%c1!==Gx&&(f=gE(-f));const d=new yE(t,f,ug);return d.assertValidity(),d}const Dh=null;function Xx(...t){return lg(Dh(hE("BIP0340/challenge",...t)))}function MZ(t){return mE(t).bytes}function OZ(t,e,s=randomBytes(32)){const f=ensureBytes("message",t),{bytes:d,scalar:h}=mE(e),E=ensureBytes("auxRand",s,32),P=pE(h^Dh(hE("BIP0340/aux",E))),R=hE("BIP0340/nonce",P,d,f),q=lg(Dh(R));if(q===Gx)throw new Error("sign failed: k is zero");const{bytes:te,scalar:ne}=mE(q),ue=Xx(te,d,f),ge=new Uint8Array(64);if(ge.set(te,0),ge.set(pE(lg(ne+ue*h)),32),!bN(ge,f,d))throw new Error("sign: Invalid signature produced");return ge}function bN(t,e,s){const f=ensureBytes("signature",t,64),d=ensureBytes("message",e),h=ensureBytes("publicKey",s,32);try{const E=mN(Dh(h)),P=Dh(f.subarray(0,32));if(!inRange(P,ug,cg))return!1;const R=Dh(f.subarray(32,64));if(!inRange(R,ug,a1))return!1;const q=Xx(pE(P),Zx(E),d),te=yN(E,R,lg(-q));return!(!te||!te.hasEvenY()||te.toAffine().x!==P)}catch{return!1}}const RZ=null,NZ=null,UZ=null,DZ=null,LZ=null,FZ=null,vN=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Yx=new Uint8Array(new Array(16).fill(0).map((t,e)=>e)),wN=Yx.map(t=>(9*t+5)%16);let bE=[Yx],vE=[wN];for(let t=0;t<4;t++)for(let e of[bE,vE])e.push(e[t].map(s=>vN[s]));const Jx=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),_N=bE.map((t,e)=>t.map(s=>Jx[e][s])),EN=vE.map((t,e)=>t.map(s=>Jx[e][s])),SN=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),AN=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function Qx(t,e,s,f){return t===0?e^s^f:t===1?e&s|~e&f:t===2?(e|~s)^f:t===3?e&f|s&~f:e^(s|~f)}const u1=new Uint32Array(16);class xN extends q_{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:s,h2:f,h3:d,h4:h}=this;return[e,s,f,d,h]}set(e,s,f,d,h){this.h0=e|0,this.h1=s|0,this.h2=f|0,this.h3=d|0,this.h4=h|0}process(e,s){for(let ge=0;ge<16;ge++,s+=4)u1[ge]=e.getUint32(s,!0);let f=this.h0|0,d=f,h=this.h1|0,E=h,P=this.h2|0,R=P,q=this.h3|0,te=q,ne=this.h4|0,ue=ne;for(let ge=0;ge<5;ge++){const xe=4-ge,pe=SN[ge],Se=AN[ge],Ce=bE[ge],Fe=vE[ge],We=_N[ge],xt=EN[ge];for(let kt=0;kt<16;kt++){const Bt=Zb(f+Qx(ge,h,P,q)+u1[Ce[kt]]+pe,We[kt])+ne|0;f=ne,ne=q,q=Zb(P,10)|0,P=h,h=Bt}for(let kt=0;kt<16;kt++){const Bt=Zb(d+Qx(xe,E,R,te)+u1[Fe[kt]]+Se,xt[kt])+ue|0;d=ue,ue=te,te=Zb(R,10)|0,R=E,E=Bt}}this.set(this.h1+P+te|0,this.h2+q+ue|0,this.h3+ne+d|0,this.h4+f+E|0,this.h0+h+R|0)}roundClean(){u1.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const IN=G_(()=>new xN),BN=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),$l=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Vl=new Uint32Array(64);class eI extends q_{constructor(){super(64,32,8,!1),this.A=$l[0]|0,this.B=$l[1]|0,this.C=$l[2]|0,this.D=$l[3]|0,this.E=$l[4]|0,this.F=$l[5]|0,this.G=$l[6]|0,this.H=$l[7]|0}get(){const{A:e,B:s,C:f,D:d,E:h,F:E,G:P,H:R}=this;return[e,s,f,d,h,E,P,R]}set(e,s,f,d,h,E,P,R){this.A=e|0,this.B=s|0,this.C=f|0,this.D=d|0,this.E=h|0,this.F=E|0,this.G=P|0,this.H=R|0}process(e,s){for(let ne=0;ne<16;ne++,s+=4)Vl[ne]=e.getUint32(s,!1);for(let ne=16;ne<64;ne++){const ue=Vl[ne-15],ge=Vl[ne-2],xe=Xc(ue,7)^Xc(ue,18)^ue>>>3,pe=Xc(ge,17)^Xc(ge,19)^ge>>>10;Vl[ne]=pe+Vl[ne-7]+xe+Vl[ne-16]|0}let{A:f,B:d,C:h,D:E,E:P,F:R,G:q,H:te}=this;for(let ne=0;ne<64;ne++){const ue=Xc(P,6)^Xc(P,11)^Xc(P,25),ge=te+ue+HO(P,R,q)+BN[ne]+Vl[ne]|0,pe=(Xc(f,2)^Xc(f,13)^Xc(f,22))+KO(f,d,h)|0;te=q,q=R,R=P,P=E+ge|0,E=h,h=d,d=f,f=ge+pe|0}f=f+this.A|0,d=d+this.B|0,h=h+this.C|0,E=E+this.D|0,P=P+this.E|0,R=R+this.F|0,q=q+this.G|0,te=te+this.H|0,this.set(f,d,h,E,P,R,q,te)}roundClean(){Vl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class jZ extends eI{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const wE=G_(()=>new eI),zZ=null;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const l1=BigInt(0),f1=BigInt(1),kN=BigInt(2);function nd(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function fg(t){if(!nd(t))throw new Error("Uint8Array expected")}function Lh(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const TN=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Fh(t){fg(t);let e="";for(let s=0;s<t.length;s++)e+=TN[t[s]];return e}function jh(t){const e=t.toString(16);return e.length&1?"0"+e:e}function tI(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?l1:BigInt("0x"+t)}const ju={_0:48,_9:57,A:65,F:70,a:97,f:102};function nI(t){if(t>=ju._0&&t<=ju._9)return t-ju._0;if(t>=ju.A&&t<=ju.F)return t-(ju.A-10);if(t>=ju.a&&t<=ju.f)return t-(ju.a-10)}function zh(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,s=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const f=new Uint8Array(s);for(let d=0,h=0;d<s;d++,h+=2){const E=nI(t.charCodeAt(h)),P=nI(t.charCodeAt(h+1));if(E===void 0||P===void 0){const R=t[h]+t[h+1];throw new Error('hex string expected, got non-hex character "'+R+'" at index '+h)}f[d]=E*16+P}return f}function rd(t){return tI(Fh(t))}function _E(t){return fg(t),tI(Fh(Uint8Array.from(t).reverse()))}function Hh(t,e){return zh(t.toString(16).padStart(e*2,"0"))}function EE(t,e){return Hh(t,e).reverse()}function HZ(t){return zh(jh(t))}function yc(t,e,s){let f;if(typeof e=="string")try{f=zh(e)}catch(h){throw new Error(t+" must be hex string or Uint8Array, cause: "+h)}else if(nd(e))f=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const d=f.length;if(typeof s=="number"&&d!==s)throw new Error(t+" of length "+s+" expected, got "+d);return f}function dg(...t){let e=0;for(let f=0;f<t.length;f++){const d=t[f];fg(d),e+=d.length}const s=new Uint8Array(e);for(let f=0,d=0;f<t.length;f++){const h=t[f];s.set(h,d),d+=h.length}return s}function KZ(t,e){if(t.length!==e.length)return!1;let s=0;for(let f=0;f<t.length;f++)s|=t[f]^e[f];return s===0}function $Z(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}const SE=t=>typeof t=="bigint"&&l1<=t;function d1(t,e,s){return SE(t)&&SE(e)&&SE(s)&&e<=t&&t<s}function id(t,e,s,f){if(!d1(e,s,f))throw new Error("expected valid "+t+": "+s+" <= n < "+f+", got "+e)}function rI(t){let e;for(e=0;t>l1;t>>=f1,e+=1);return e}function VZ(t,e){return t>>BigInt(e)&f1}function WZ(t,e,s){return t|(s?f1:l1)<<BigInt(e)}const AE=t=>(kN<<BigInt(t-1))-f1,xE=t=>new Uint8Array(t),iI=t=>Uint8Array.from(t);function sI(t,e,s){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof s!="function")throw new Error("hmacFn must be a function");let f=xE(t),d=xE(t),h=0;const E=()=>{f.fill(1),d.fill(0),h=0},P=(...ne)=>s(d,f,...ne),R=(ne=xE())=>{d=P(iI([0]),ne),f=P(),ne.length!==0&&(d=P(iI([1]),ne),f=P())},q=()=>{if(h++>=1e3)throw new Error("drbg: tried 1000 values");let ne=0;const ue=[];for(;ne<e;){f=P();const ge=f.slice();ue.push(ge),ne+=f.length}return dg(...ue)};return(ne,ue)=>{E(),R(ne);let ge;for(;!(ge=ue(q()));)R();return E(),ge}}const CN={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||nd(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function hg(t,e,s={}){const f=(d,h,E)=>{const P=CN[h];if(typeof P!="function")throw new Error("invalid validator function");const R=t[d];if(!(E&&R===void 0)&&!P(R,t))throw new Error("param "+String(d)+" is invalid. Expected "+h+", got "+R)};for(const[d,h]of Object.entries(e))f(d,h,!1);for(const[d,h]of Object.entries(s))f(d,h,!0);return t}const GZ=()=>{throw new Error("not implemented")};function IE(t){const e=new WeakMap;return(s,...f)=>{const d=e.get(s);if(d!==void 0)return d;const h=t(s,...f);return e.set(s,h),h}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const no=BigInt(0),Xi=BigInt(1),Wl=BigInt(2),PN=BigInt(3),BE=BigInt(4),oI=BigInt(5),aI=BigInt(8),MN=BigInt(9),ON=BigInt(16);function mo(t,e){const s=t%e;return s>=no?s:e+s}function RN(t,e,s){if(e<no)throw new Error("invalid exponent, negatives unsupported");if(s<=no)throw new Error("invalid modulus");if(s===Xi)return no;let f=Xi;for(;e>no;)e&Xi&&(f=f*t%s),t=t*t%s,e>>=Xi;return f}function Va(t,e,s){let f=t;for(;e-- >no;)f*=f,f%=s;return f}function h1(t,e){if(t===no)throw new Error("invert: expected non-zero number");if(e<=no)throw new Error("invert: expected positive modulus, got "+e);let s=mo(t,e),f=e,d=no,h=Xi,E=Xi,P=no;for(;s!==no;){const q=f/s,te=f%s,ne=d-E*q,ue=h-P*q;f=s,s=te,d=E,h=P,E=ne,P=ue}if(f!==Xi)throw new Error("invert: does not exist");return mo(d,e)}function NN(t){const e=(t-Xi)/Wl;let s,f,d;for(s=t-Xi,f=0;s%Wl===no;s/=Wl,f++);for(d=Wl;d<t&&RN(d,e,t)!==t-Xi;d++)if(d>1e3)throw new Error("Cannot find square root: likely non-prime P");if(f===1){const E=(t+Xi)/BE;return function(R,q){const te=R.pow(q,E);if(!R.eql(R.sqr(te),q))throw new Error("Cannot find square root");return te}}const h=(s+Xi)/Wl;return function(P,R){if(P.pow(R,e)===P.neg(P.ONE))throw new Error("Cannot find square root");let q=f,te=P.pow(P.mul(P.ONE,d),s),ne=P.pow(R,h),ue=P.pow(R,s);for(;!P.eql(ue,P.ONE);){if(P.eql(ue,P.ZERO))return P.ZERO;let ge=1;for(let pe=P.sqr(ue);ge<q&&!P.eql(pe,P.ONE);ge++)pe=P.sqr(pe);const xe=P.pow(te,Xi<<BigInt(q-ge-1));te=P.sqr(xe),ne=P.mul(ne,xe),ue=P.mul(ue,te),q=ge}return ne}}function UN(t){if(t%BE===PN){const e=(t+Xi)/BE;return function(f,d){const h=f.pow(d,e);if(!f.eql(f.sqr(h),d))throw new Error("Cannot find square root");return h}}if(t%aI===oI){const e=(t-oI)/aI;return function(f,d){const h=f.mul(d,Wl),E=f.pow(h,e),P=f.mul(d,E),R=f.mul(f.mul(P,Wl),E),q=f.mul(P,f.sub(R,f.ONE));if(!f.eql(f.sqr(q),d))throw new Error("Cannot find square root");return q}}return t%ON,NN(t)}const qZ=(t,e)=>(mo(t,e)&Xi)===Xi,DN=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function LN(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},s=DN.reduce((f,d)=>(f[d]="function",f),e);return hg(t,s)}function FN(t,e,s){if(s<no)throw new Error("invalid exponent, negatives unsupported");if(s===no)return t.ONE;if(s===Xi)return e;let f=t.ONE,d=e;for(;s>no;)s&Xi&&(f=t.mul(f,d)),d=t.sqr(d),s>>=Xi;return f}function jN(t,e){const s=new Array(e.length),f=e.reduce((h,E,P)=>t.is0(E)?h:(s[P]=h,t.mul(h,E)),t.ONE),d=t.inv(f);return e.reduceRight((h,E,P)=>t.is0(E)?h:(s[P]=t.mul(h,s[P]),t.mul(h,E)),d),s}function ZZ(t,e,s){return t.mul(e,typeof s=="bigint"?h1(s,t.ORDER):t.inv(s))}function zN(t){const e=(t-Xi)/Wl;return(s,f)=>s.pow(f,e)}function XZ(t){const e=zN(t.ORDER);return s=>{const f=e(t,s);return t.eql(f,t.ZERO)||t.eql(f,t.ONE)}}function kE(t,e){const s=e!==void 0?e:t.toString(2).length,f=Math.ceil(s/8);return{nBitLength:s,nByteLength:f}}function cI(t,e,s=!1,f={}){if(t<=no)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:d,nByteLength:h}=kE(t,e);if(h>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let E;const P=Object.freeze({ORDER:t,isLE:s,BITS:d,BYTES:h,MASK:AE(d),ZERO:no,ONE:Xi,create:R=>mo(R,t),isValid:R=>{if(typeof R!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof R);return no<=R&&R<t},is0:R=>R===no,isOdd:R=>(R&Xi)===Xi,neg:R=>mo(-R,t),eql:(R,q)=>R===q,sqr:R=>mo(R*R,t),add:(R,q)=>mo(R+q,t),sub:(R,q)=>mo(R-q,t),mul:(R,q)=>mo(R*q,t),pow:(R,q)=>FN(P,R,q),div:(R,q)=>mo(R*h1(q,t),t),sqrN:R=>R*R,addN:(R,q)=>R+q,subN:(R,q)=>R-q,mulN:(R,q)=>R*q,inv:R=>h1(R,t),sqrt:f.sqrt||(R=>(E||(E=UN(t)),E(P,R))),invertBatch:R=>jN(P,R),cmov:(R,q,te)=>te?q:R,toBytes:R=>s?EE(R,h):Hh(R,h),fromBytes:R=>{if(R.length!==h)throw new Error("Field.fromBytes: expected "+h+" bytes, got "+R.length);return s?_E(R):rd(R)}});return Object.freeze(P)}function YZ(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const s=t.sqrt(e);return t.isOdd(s)?s:t.neg(s)}function JZ(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const s=t.sqrt(e);return t.isOdd(s)?t.neg(s):s}function QZ(t,e,s=!1){t=ensureBytes("privateHash",t);const f=t.length,d=kE(e).nByteLength+8;if(d<24||f<d||f>1024)throw new Error("hashToPrivateScalar: expected "+d+"-1024 bytes of input, got "+f);const h=s?bytesToNumberLE(t):bytesToNumberBE(t);return mo(h,e-Xi)+Xi}function uI(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function lI(t){const e=uI(t);return e+Math.ceil(e/2)}function HN(t,e,s=!1){const f=t.length,d=uI(e),h=lI(e);if(f<16||f<h||f>1024)throw new Error("expected "+h+"-1024 bytes of input, got "+f);const E=s?_E(t):rd(t),P=mo(E,e-Xi)+Xi;return s?EE(P,d):Hh(P,d)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fI=BigInt(0),p1=BigInt(1);function TE(t,e){const s=e.negate();return t?s:e}function CE(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function PE(t,e){CE(t,e);const s=Math.ceil(e/t)+1,f=2**(t-1);return{windows:s,windowSize:f}}function dI(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((s,f)=>{if(!(s instanceof e))throw new Error("invalid point at index "+f)})}function hI(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((s,f)=>{if(!e.isValid(s))throw new Error("invalid scalar at index "+f)})}const ME=new WeakMap,pI=new WeakMap;function OE(t){return pI.get(t)||1}function KN(t,e){return{constTimeNegate:TE,hasPrecomputes(s){return OE(s)!==1},unsafeLadder(s,f,d=t.ZERO){let h=s;for(;f>fI;)f&p1&&(d=d.add(h)),h=h.double(),f>>=p1;return d},precomputeWindow(s,f){const{windows:d,windowSize:h}=PE(f,e),E=[];let P=s,R=P;for(let q=0;q<d;q++){R=P,E.push(R);for(let te=1;te<h;te++)R=R.add(P),E.push(R);P=R.double()}return E},wNAF(s,f,d){const{windows:h,windowSize:E}=PE(s,e);let P=t.ZERO,R=t.BASE;const q=BigInt(2**s-1),te=2**s,ne=BigInt(s);for(let ue=0;ue<h;ue++){const ge=ue*E;let xe=Number(d&q);d>>=ne,xe>E&&(xe-=te,d+=p1);const pe=ge,Se=ge+Math.abs(xe)-1,Ce=ue%2!==0,Fe=xe<0;xe===0?R=R.add(TE(Ce,f[pe])):P=P.add(TE(Fe,f[Se]))}return{p:P,f:R}},wNAFUnsafe(s,f,d,h=t.ZERO){const{windows:E,windowSize:P}=PE(s,e),R=BigInt(2**s-1),q=2**s,te=BigInt(s);for(let ne=0;ne<E;ne++){const ue=ne*P;if(d===fI)break;let ge=Number(d&R);if(d>>=te,ge>P&&(ge-=q,d+=p1),ge===0)continue;let xe=f[ue+Math.abs(ge)-1];ge<0&&(xe=xe.negate()),h=h.add(xe)}return h},getPrecomputes(s,f,d){let h=ME.get(f);return h||(h=this.precomputeWindow(f,s),s!==1&&ME.set(f,d(h))),h},wNAFCached(s,f,d){const h=OE(s);return this.wNAF(h,this.getPrecomputes(h,s,d),f)},wNAFCachedUnsafe(s,f,d,h){const E=OE(s);return E===1?this.unsafeLadder(s,f,h):this.wNAFUnsafe(E,this.getPrecomputes(E,s,d),f,h)},setWindowSize(s,f){CE(f,e),pI.set(s,f),ME.delete(s)}}}function $N(t,e,s,f){if(dI(s,t),hI(f,e),s.length!==f.length)throw new Error("arrays of points and scalars must have equal length");const d=t.ZERO,h=rI(BigInt(s.length)),E=h>12?h-3:h>4?h-2:h?2:1,P=(1<<E)-1,R=new Array(P+1).fill(d),q=Math.floor((e.BITS-1)/E)*E;let te=d;for(let ne=q;ne>=0;ne-=E){R.fill(d);for(let ge=0;ge<f.length;ge++){const xe=f[ge],pe=Number(xe>>BigInt(ne)&BigInt(P));R[pe]=R[pe].add(s[ge])}let ue=d;for(let ge=R.length-1,xe=d;ge>0;ge--)xe=xe.add(R[ge]),ue=ue.add(xe);if(te=te.add(ue),ne!==0)for(let ge=0;ge<E;ge++)te=te.double()}return te}function eX(t,e,s,f){CE(f,e.BITS),dI(s,t);const d=t.ZERO,h=2**f-1,E=Math.ceil(e.BITS/f),P=BigInt((1<<f)-1),R=s.map(q=>{const te=[];for(let ne=0,ue=q;ne<h;ne++)te.push(ue),ue=ue.add(q);return te});return q=>{if(hI(q,e),q.length>s.length)throw new Error("array of scalars must be smaller than array of points");let te=d;for(let ne=0;ne<E;ne++){if(te!==d)for(let ge=0;ge<f;ge++)te=te.double();const ue=BigInt(E*f-(ne+1)*f);for(let ge=0;ge<q.length;ge++){const xe=q[ge],pe=Number(xe>>ue&P);pe&&(te=te.add(R[ge][pe-1]))}}return te}}function gI(t){return LN(t.Fp),hg(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...kE(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function yI(t){t.lowS!==void 0&&Lh("lowS",t.lowS),t.prehash!==void 0&&Lh("prehash",t.prehash)}function VN(t){const e=gI(t);hg(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:s,Fp:f,a:d}=e;if(s){if(!f.eql(d,f.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof s!="object"||typeof s.beta!="bigint"||typeof s.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{Ph:WN,aT:GN}=p;class qN extends Error{constructor(e=""){super(e)}}const zu={Err:qN,_tlv:{encode:(t,e)=>{const{Err:s}=zu;if(t<0||t>256)throw new s("tlv.encode: wrong tag");if(e.length&1)throw new s("tlv.encode: unpadded data");const f=e.length/2,d=jh(f);if(d.length/2&128)throw new s("tlv.encode: long form length too big");const h=f>127?jh(d.length/2|128):"";return jh(t)+h+d+e},decode(t,e){const{Err:s}=zu;let f=0;if(t<0||t>256)throw new s("tlv.encode: wrong tag");if(e.length<2||e[f++]!==t)throw new s("tlv.decode: wrong tlv");const d=e[f++],h=!!(d&128);let E=0;if(!h)E=d;else{const R=d&127;if(!R)throw new s("tlv.decode(long): indefinite length not supported");if(R>4)throw new s("tlv.decode(long): byte length is too big");const q=e.subarray(f,f+R);if(q.length!==R)throw new s("tlv.decode: length bytes not complete");if(q[0]===0)throw new s("tlv.decode(long): zero leftmost byte");for(const te of q)E=E<<8|te;if(f+=R,E<128)throw new s("tlv.decode(long): not minimal encoding")}const P=e.subarray(f,f+E);if(P.length!==E)throw new s("tlv.decode: wrong value length");return{v:P,l:e.subarray(f+E)}}},_int:{encode(t){const{Err:e}=zu;if(t<mc)throw new e("integer: negative integers are not allowed");let s=jh(t);if(Number.parseInt(s[0],16)&8&&(s="00"+s),s.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return s},decode(t){const{Err:e}=zu;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return WN(t)}},toSig(t){const{Err:e,_int:s,_tlv:f}=zu,d=typeof t=="string"?GN(t):t;fg(d);const{v:h,l:E}=f.decode(48,d);if(E.length)throw new e("invalid signature: left bytes after parsing");const{v:P,l:R}=f.decode(2,h),{v:q,l:te}=f.decode(2,R);if(te.length)throw new e("invalid signature: left bytes after parsing");return{r:s.decode(P),s:s.decode(q)}},hexFromSig(t){const{_tlv:e,_int:s}=zu,f=e.encode(2,s.encode(t.r)),d=e.encode(2,s.encode(t.s)),h=f+d;return e.encode(48,h)}},mc=BigInt(0),$i=BigInt(1),Gl=BigInt(2),g1=BigInt(3),mI=BigInt(4);function ZN(t){const e=VN(t),{Fp:s}=e,f=cI(e.n,e.nBitLength),d=e.toBytes||((pe,Se,Ce)=>{const Fe=Se.toAffine();return dg(Uint8Array.from([4]),s.toBytes(Fe.x),s.toBytes(Fe.y))}),h=e.fromBytes||(pe=>{const Se=pe.subarray(1),Ce=s.fromBytes(Se.subarray(0,s.BYTES)),Fe=s.fromBytes(Se.subarray(s.BYTES,2*s.BYTES));return{x:Ce,y:Fe}});function E(pe){const{a:Se,b:Ce}=e,Fe=s.sqr(pe),We=s.mul(Fe,pe);return s.add(s.add(We,s.mul(pe,Se)),Ce)}if(!s.eql(s.sqr(e.Gy),E(e.Gx)))throw new Error("bad generator point: equation left != right");function P(pe){return d1(pe,$i,e.n)}function R(pe){const{allowedPrivateKeyLengths:Se,nByteLength:Ce,wrapPrivateKey:Fe,n:We}=e;if(Se&&typeof pe!="bigint"){if(nd(pe)&&(pe=Fh(pe)),typeof pe!="string"||!Se.includes(pe.length))throw new Error("invalid private key");pe=pe.padStart(Ce*2,"0")}let xt;try{xt=typeof pe=="bigint"?pe:rd(yc("private key",pe,Ce))}catch{throw new Error("invalid private key, expected hex or "+Ce+" bytes, got "+typeof pe)}return Fe&&(xt=mo(xt,We)),id("private key",xt,$i,We),xt}function q(pe){if(!(pe instanceof ue))throw new Error("ProjectivePoint expected")}const te=IE((pe,Se)=>{const{px:Ce,py:Fe,pz:We}=pe;if(s.eql(We,s.ONE))return{x:Ce,y:Fe};const xt=pe.is0();Se==null&&(Se=xt?s.ONE:s.inv(We));const kt=s.mul(Ce,Se),Bt=s.mul(Fe,Se),Wt=s.mul(We,Se);if(xt)return{x:s.ZERO,y:s.ZERO};if(!s.eql(Wt,s.ONE))throw new Error("invZ was invalid");return{x:kt,y:Bt}}),ne=IE(pe=>{if(pe.is0()){if(e.allowInfinityPoint&&!s.is0(pe.py))return;throw new Error("bad point: ZERO")}const{x:Se,y:Ce}=pe.toAffine();if(!s.isValid(Se)||!s.isValid(Ce))throw new Error("bad point: x or y not FE");const Fe=s.sqr(Ce),We=E(Se);if(!s.eql(Fe,We))throw new Error("bad point: equation left != right");if(!pe.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class ue{constructor(Se,Ce,Fe){if(this.px=Se,this.py=Ce,this.pz=Fe,Se==null||!s.isValid(Se))throw new Error("x required");if(Ce==null||!s.isValid(Ce))throw new Error("y required");if(Fe==null||!s.isValid(Fe))throw new Error("z required");Object.freeze(this)}static fromAffine(Se){const{x:Ce,y:Fe}=Se||{};if(!Se||!s.isValid(Ce)||!s.isValid(Fe))throw new Error("invalid affine point");if(Se instanceof ue)throw new Error("projective point not allowed");const We=xt=>s.eql(xt,s.ZERO);return We(Ce)&&We(Fe)?ue.ZERO:new ue(Ce,Fe,s.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(Se){const Ce=s.invertBatch(Se.map(Fe=>Fe.pz));return Se.map((Fe,We)=>Fe.toAffine(Ce[We])).map(ue.fromAffine)}static fromHex(Se){const Ce=ue.fromAffine(h(yc("pointHex",Se)));return Ce.assertValidity(),Ce}static fromPrivateKey(Se){return ue.BASE.multiply(R(Se))}static msm(Se,Ce){return $N(ue,f,Se,Ce)}_setWindowSize(Se){xe.setWindowSize(this,Se)}assertValidity(){ne(this)}hasEvenY(){const{y:Se}=this.toAffine();if(s.isOdd)return!s.isOdd(Se);throw new Error("Field doesn't support isOdd")}equals(Se){q(Se);const{px:Ce,py:Fe,pz:We}=this,{px:xt,py:kt,pz:Bt}=Se,Wt=s.eql(s.mul(Ce,Bt),s.mul(xt,We)),Me=s.eql(s.mul(Fe,Bt),s.mul(kt,We));return Wt&&Me}negate(){return new ue(this.px,s.neg(this.py),this.pz)}double(){const{a:Se,b:Ce}=e,Fe=s.mul(Ce,g1),{px:We,py:xt,pz:kt}=this;let Bt=s.ZERO,Wt=s.ZERO,Me=s.ZERO,Ke=s.mul(We,We),nt=s.mul(xt,xt),Tt=s.mul(kt,kt),pt=s.mul(We,xt);return pt=s.add(pt,pt),Me=s.mul(We,kt),Me=s.add(Me,Me),Bt=s.mul(Se,Me),Wt=s.mul(Fe,Tt),Wt=s.add(Bt,Wt),Bt=s.sub(nt,Wt),Wt=s.add(nt,Wt),Wt=s.mul(Bt,Wt),Bt=s.mul(pt,Bt),Me=s.mul(Fe,Me),Tt=s.mul(Se,Tt),pt=s.sub(Ke,Tt),pt=s.mul(Se,pt),pt=s.add(pt,Me),Me=s.add(Ke,Ke),Ke=s.add(Me,Ke),Ke=s.add(Ke,Tt),Ke=s.mul(Ke,pt),Wt=s.add(Wt,Ke),Tt=s.mul(xt,kt),Tt=s.add(Tt,Tt),Ke=s.mul(Tt,pt),Bt=s.sub(Bt,Ke),Me=s.mul(Tt,nt),Me=s.add(Me,Me),Me=s.add(Me,Me),new ue(Bt,Wt,Me)}add(Se){q(Se);const{px:Ce,py:Fe,pz:We}=this,{px:xt,py:kt,pz:Bt}=Se;let Wt=s.ZERO,Me=s.ZERO,Ke=s.ZERO;const nt=e.a,Tt=s.mul(e.b,g1);let pt=s.mul(Ce,xt),Ht=s.mul(Fe,kt),lt=s.mul(We,Bt),rt=s.add(Ce,Fe),ot=s.add(xt,kt);rt=s.mul(rt,ot),ot=s.add(pt,Ht),rt=s.sub(rt,ot),ot=s.add(Ce,We);let Mt=s.add(xt,Bt);return ot=s.mul(ot,Mt),Mt=s.add(pt,lt),ot=s.sub(ot,Mt),Mt=s.add(Fe,We),Wt=s.add(kt,Bt),Mt=s.mul(Mt,Wt),Wt=s.add(Ht,lt),Mt=s.sub(Mt,Wt),Ke=s.mul(nt,ot),Wt=s.mul(Tt,lt),Ke=s.add(Wt,Ke),Wt=s.sub(Ht,Ke),Ke=s.add(Ht,Ke),Me=s.mul(Wt,Ke),Ht=s.add(pt,pt),Ht=s.add(Ht,pt),lt=s.mul(nt,lt),ot=s.mul(Tt,ot),Ht=s.add(Ht,lt),lt=s.sub(pt,lt),lt=s.mul(nt,lt),ot=s.add(ot,lt),pt=s.mul(Ht,ot),Me=s.add(Me,pt),pt=s.mul(Mt,ot),Wt=s.mul(rt,Wt),Wt=s.sub(Wt,pt),pt=s.mul(rt,Ht),Ke=s.mul(Mt,Ke),Ke=s.add(Ke,pt),new ue(Wt,Me,Ke)}subtract(Se){return this.add(Se.negate())}is0(){return this.equals(ue.ZERO)}wNAF(Se){return xe.wNAFCached(this,Se,ue.normalizeZ)}multiplyUnsafe(Se){const{endo:Ce,n:Fe}=e;id("scalar",Se,mc,Fe);const We=ue.ZERO;if(Se===mc)return We;if(this.is0()||Se===$i)return this;if(!Ce||xe.hasPrecomputes(this))return xe.wNAFCachedUnsafe(this,Se,ue.normalizeZ);let{k1neg:xt,k1:kt,k2neg:Bt,k2:Wt}=Ce.splitScalar(Se),Me=We,Ke=We,nt=this;for(;kt>mc||Wt>mc;)kt&$i&&(Me=Me.add(nt)),Wt&$i&&(Ke=Ke.add(nt)),nt=nt.double(),kt>>=$i,Wt>>=$i;return xt&&(Me=Me.negate()),Bt&&(Ke=Ke.negate()),Ke=new ue(s.mul(Ke.px,Ce.beta),Ke.py,Ke.pz),Me.add(Ke)}multiply(Se){const{endo:Ce,n:Fe}=e;id("scalar",Se,$i,Fe);let We,xt;if(Ce){const{k1neg:kt,k1:Bt,k2neg:Wt,k2:Me}=Ce.splitScalar(Se);let{p:Ke,f:nt}=this.wNAF(Bt),{p:Tt,f:pt}=this.wNAF(Me);Ke=xe.constTimeNegate(kt,Ke),Tt=xe.constTimeNegate(Wt,Tt),Tt=new ue(s.mul(Tt.px,Ce.beta),Tt.py,Tt.pz),We=Ke.add(Tt),xt=nt.add(pt)}else{const{p:kt,f:Bt}=this.wNAF(Se);We=kt,xt=Bt}return ue.normalizeZ([We,xt])[0]}multiplyAndAddUnsafe(Se,Ce,Fe){const We=ue.BASE,xt=(Bt,Wt)=>Wt===mc||Wt===$i||!Bt.equals(We)?Bt.multiplyUnsafe(Wt):Bt.multiply(Wt),kt=xt(this,Ce).add(xt(Se,Fe));return kt.is0()?void 0:kt}toAffine(Se){return te(this,Se)}isTorsionFree(){const{h:Se,isTorsionFree:Ce}=e;if(Se===$i)return!0;if(Ce)return Ce(ue,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:Se,clearCofactor:Ce}=e;return Se===$i?this:Ce?Ce(ue,this):this.multiplyUnsafe(e.h)}toRawBytes(Se=!0){return Lh("isCompressed",Se),this.assertValidity(),d(ue,this,Se)}toHex(Se=!0){return Lh("isCompressed",Se),Fh(this.toRawBytes(Se))}}ue.BASE=new ue(e.Gx,e.Gy,s.ONE),ue.ZERO=new ue(s.ZERO,s.ONE,s.ZERO);const ge=e.nBitLength,xe=KN(ue,e.endo?Math.ceil(ge/2):ge);return{CURVE:e,ProjectivePoint:ue,normPrivateKeyToScalar:R,weierstrassEquation:E,isWithinCurveOrder:P}}function XN(t){const e=gI(t);return hg(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function YN(t){const e=XN(t),{Fp:s,n:f}=e,d=s.BYTES+1,h=2*s.BYTES+1;function E(lt){return mo(lt,f)}function P(lt){return h1(lt,f)}const{ProjectivePoint:R,normPrivateKeyToScalar:q,weierstrassEquation:te,isWithinCurveOrder:ne}=ZN({...e,toBytes(lt,rt,ot){const Mt=rt.toAffine(),Ut=s.toBytes(Mt.x),rn=dg;return Lh("isCompressed",ot),ot?rn(Uint8Array.from([rt.hasEvenY()?2:3]),Ut):rn(Uint8Array.from([4]),Ut,s.toBytes(Mt.y))},fromBytes(lt){const rt=lt.length,ot=lt[0],Mt=lt.subarray(1);if(rt===d&&(ot===2||ot===3)){const Ut=rd(Mt);if(!d1(Ut,$i,s.ORDER))throw new Error("Point is not on curve");const rn=te(Ut);let Qt;try{Qt=s.sqrt(rn)}catch(hr){const lr=hr instanceof Error?": "+hr.message:"";throw new Error("Point is not on curve"+lr)}const Cn=(Qt&$i)===$i;return(ot&1)===1!==Cn&&(Qt=s.neg(Qt)),{x:Ut,y:Qt}}else if(rt===h&&ot===4){const Ut=s.fromBytes(Mt.subarray(0,s.BYTES)),rn=s.fromBytes(Mt.subarray(s.BYTES,2*s.BYTES));return{x:Ut,y:rn}}else{const Ut=d,rn=h;throw new Error("invalid Point, expected length of "+Ut+", or uncompressed "+rn+", got "+rt)}}}),ue=lt=>Fh(Hh(lt,e.nByteLength));function ge(lt){const rt=f>>$i;return lt>rt}function xe(lt){return ge(lt)?E(-lt):lt}const pe=(lt,rt,ot)=>rd(lt.slice(rt,ot));class Se{constructor(rt,ot,Mt){this.r=rt,this.s=ot,this.recovery=Mt,this.assertValidity()}static fromCompact(rt){const ot=e.nByteLength;return rt=yc("compactSignature",rt,ot*2),new Se(pe(rt,0,ot),pe(rt,ot,2*ot))}static fromDER(rt){const{r:ot,s:Mt}=zu.toSig(yc("DER",rt));return new Se(ot,Mt)}assertValidity(){id("r",this.r,$i,f),id("s",this.s,$i,f)}addRecoveryBit(rt){return new Se(this.r,this.s,rt)}recoverPublicKey(rt){const{r:ot,s:Mt,recovery:Ut}=this,rn=Bt(yc("msgHash",rt));if(Ut==null||![0,1,2,3].includes(Ut))throw new Error("recovery id invalid");const Qt=Ut===2||Ut===3?ot+e.n:ot;if(Qt>=s.ORDER)throw new Error("recovery id 2 or 3 invalid");const Cn=Ut&1?"03":"02",qn=R.fromHex(Cn+ue(Qt)),hr=P(Qt),lr=E(-rn*hr),Sr=E(Mt*hr),_r=R.BASE.multiplyAndAddUnsafe(qn,lr,Sr);if(!_r)throw new Error("point at infinify");return _r.assertValidity(),_r}hasHighS(){return ge(this.s)}normalizeS(){return this.hasHighS()?new Se(this.r,E(-this.s),this.recovery):this}toDERRawBytes(){return zh(this.toDERHex())}toDERHex(){return zu.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return zh(this.toCompactHex())}toCompactHex(){return ue(this.r)+ue(this.s)}}const Ce={isValidPrivateKey(lt){try{return q(lt),!0}catch{return!1}},normPrivateKeyToScalar:q,randomPrivateKey:()=>{const lt=lI(e.n);return HN(e.randomBytes(lt),e.n)},precompute(lt=8,rt=R.BASE){return rt._setWindowSize(lt),rt.multiply(BigInt(3)),rt}};function Fe(lt,rt=!0){return R.fromPrivateKey(lt).toRawBytes(rt)}function We(lt){const rt=nd(lt),ot=typeof lt=="string",Mt=(rt||ot)&<.length;return rt?Mt===d||Mt===h:ot?Mt===2*d||Mt===2*h:lt instanceof R}function xt(lt,rt,ot=!0){if(We(lt))throw new Error("first arg must be private key");if(!We(rt))throw new Error("second arg must be public key");return R.fromHex(rt).multiply(q(lt)).toRawBytes(ot)}const kt=e.bits2int||function(lt){if(lt.length>8192)throw new Error("input is too large");const rt=rd(lt),ot=lt.length*8-e.nBitLength;return ot>0?rt>>BigInt(ot):rt},Bt=e.bits2int_modN||function(lt){return E(kt(lt))},Wt=AE(e.nBitLength);function Me(lt){return id("num < 2^"+e.nBitLength,lt,mc,Wt),Hh(lt,e.nByteLength)}function Ke(lt,rt,ot=nt){if(["recovered","canonical"].some(li=>li in ot))throw new Error("sign() legacy options not supported");const{hash:Mt,randomBytes:Ut}=e;let{lowS:rn,prehash:Qt,extraEntropy:Cn}=ot;rn==null&&(rn=!0),lt=yc("msgHash",lt),yI(ot),Qt&&(lt=yc("prehashed msgHash",Mt(lt)));const qn=Bt(lt),hr=q(rt),lr=[Me(hr),Me(qn)];if(Cn!=null&&Cn!==!1){const li=Cn===!0?Ut(s.BYTES):Cn;lr.push(yc("extraEntropy",li))}const Sr=dg(...lr),_r=qn;function Kr(li){const ti=kt(li);if(!ne(ti))return;const Yi=P(ti),Yr=R.BASE.multiply(ti).toAffine(),Ai=E(Yr.x);if(Ai===mc)return;const yi=E(Yi*E(_r+Ai*hr));if(yi===mc)return;let Bi=(Yr.x===Ai?0:2)|Number(Yr.y&$i),ki=yi;return rn&&ge(yi)&&(ki=xe(yi),Bi^=1),new Se(Ai,ki,Bi)}return{seed:Sr,k2sig:Kr}}const nt={lowS:e.lowS,prehash:!1},Tt={lowS:e.lowS,prehash:!1};function pt(lt,rt,ot=nt){const{seed:Mt,k2sig:Ut}=Ke(lt,rt,ot),rn=e;return sI(rn.hash.outputLen,rn.nByteLength,rn.hmac)(Mt,Ut)}R.BASE._setWindowSize(8);function Ht(lt,rt,ot,Mt=Tt){const Ut=lt;rt=yc("msgHash",rt),ot=yc("publicKey",ot);const{lowS:rn,prehash:Qt,format:Cn}=Mt;if(yI(Mt),"strict"in Mt)throw new Error("options.strict was renamed to lowS");if(Cn!==void 0&&Cn!=="compact"&&Cn!=="der")throw new Error("format must be compact or der");const qn=typeof Ut=="string"||nd(Ut),hr=!qn&&!Cn&&typeof Ut=="object"&&Ut!==null&&typeof Ut.r=="bigint"&&typeof Ut.s=="bigint";if(!qn&&!hr)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let lr,Sr;try{if(hr&&(lr=new Se(Ut.r,Ut.s)),qn){try{Cn!=="compact"&&(lr=Se.fromDER(Ut))}catch(Bi){if(!(Bi instanceof zu.Err))throw Bi}!lr&&Cn!=="der"&&(lr=Se.fromCompact(Ut))}Sr=R.fromHex(ot)}catch{return!1}if(!lr||rn&&lr.hasHighS())return!1;Qt&&(rt=e.hash(rt));const{r:_r,s:Kr}=lr,li=Bt(rt),ti=P(Kr),Yi=E(li*ti),Yr=E(_r*ti),Ai=R.BASE.multiplyAndAddUnsafe(Sr,Yi,Yr)?.toAffine();return Ai?E(Ai.x)===_r:!1}return{CURVE:e,getPublicKey:Fe,getSharedSecret:xt,sign:pt,verify:Ht,ProjectivePoint:R,Signature:Se,utils:Ce}}function JN(t,e){const s=t.ORDER;let f=mc;for(let xe=s-$i;xe%Gl===mc;xe/=Gl)f+=$i;const d=f,h=Gl<<d-$i-$i,E=h*Gl,P=(s-$i)/E,R=(P-$i)/Gl,q=E-$i,te=h,ne=t.pow(e,P),ue=t.pow(e,(P+$i)/Gl);let ge=(xe,pe)=>{let Se=ne,Ce=t.pow(pe,q),Fe=t.sqr(Ce);Fe=t.mul(Fe,pe);let We=t.mul(xe,Fe);We=t.pow(We,R),We=t.mul(We,Ce),Ce=t.mul(We,pe),Fe=t.mul(We,xe);let xt=t.mul(Fe,Ce);We=t.pow(xt,te);let kt=t.eql(We,t.ONE);Ce=t.mul(Fe,ue),We=t.mul(xt,Se),Fe=t.cmov(Ce,Fe,kt),xt=t.cmov(We,xt,kt);for(let Bt=d;Bt>$i;Bt--){let Wt=Bt-Gl;Wt=Gl<<Wt-$i;let Me=t.pow(xt,Wt);const Ke=t.eql(Me,t.ONE);Ce=t.mul(Fe,Se),Se=t.mul(Se,Se),Me=t.mul(xt,Se),Fe=t.cmov(Ce,Fe,Ke),xt=t.cmov(Me,xt,Ke)}return{isValid:kt,value:Fe}};if(t.ORDER%mI===g1){const xe=(t.ORDER-g1)/mI,pe=t.sqrt(t.neg(e));ge=(Se,Ce)=>{let Fe=t.sqr(Ce);const We=t.mul(Se,Ce);Fe=t.mul(Fe,We);let xt=t.pow(Fe,xe);xt=t.mul(xt,We);const kt=t.mul(xt,pe),Bt=t.mul(t.sqr(xt),Ce),Wt=t.eql(Bt,Se);let Me=t.cmov(kt,xt,Wt);return{isValid:Wt,value:Me}}}return ge}function tX(t,e){if(validateField(t),!t.isValid(e.A)||!t.isValid(e.B)||!t.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const s=JN(t,e.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return f=>{let d,h,E,P,R,q,te,ne;d=t.sqr(f),d=t.mul(d,e.Z),h=t.sqr(d),h=t.add(h,d),E=t.add(h,t.ONE),E=t.mul(E,e.B),P=t.cmov(e.Z,t.neg(h),!t.eql(h,t.ZERO)),P=t.mul(P,e.A),h=t.sqr(E),q=t.sqr(P),R=t.mul(q,e.A),h=t.add(h,R),h=t.mul(h,E),q=t.mul(q,P),R=t.mul(q,e.B),h=t.add(h,R),te=t.mul(d,E);const{isValid:ue,value:ge}=s(h,q);ne=t.mul(d,f),ne=t.mul(ne,ge),te=t.cmov(te,E,ue),ne=t.cmov(ne,ge,ue);const xe=t.isOdd(f)===t.isOdd(ne);return ne=t.cmov(t.neg(ne),ne,xe),te=t.div(te,P),{x:te,y:ne}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function QN(t){return{hash:t,hmac:(e,...s)=>ng(t,e,tg(...s)),randomBytes:FO}}function eU(t,e){const s=f=>YN({...t,...QN(f)});return{...s(e),create:s}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pg=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),y1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),gg=BigInt(1),m1=BigInt(2),bI=(t,e)=>(t+e/m1)/e;function vI(t){const e=pg,s=BigInt(3),f=BigInt(6),d=BigInt(11),h=BigInt(22),E=BigInt(23),P=BigInt(44),R=BigInt(88),q=t*t*t%e,te=q*q*t%e,ne=Va(te,s,e)*te%e,ue=Va(ne,s,e)*te%e,ge=Va(ue,m1,e)*q%e,xe=Va(ge,d,e)*ge%e,pe=Va(xe,h,e)*xe%e,Se=Va(pe,P,e)*pe%e,Ce=Va(Se,R,e)*Se%e,Fe=Va(Ce,P,e)*pe%e,We=Va(Fe,s,e)*te%e,xt=Va(We,E,e)*xe%e,kt=Va(xt,f,e)*q%e,Bt=Va(kt,m1,e);if(!RE.eql(RE.sqr(Bt),t))throw new Error("Cannot find square root");return Bt}const RE=cI(pg,void 0,void 0,{sqrt:vI}),bc=eU({a:BigInt(0),b:BigInt(7),Fp:RE,n:y1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=y1,s=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),f=-gg*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),d=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),h=s,E=BigInt("0x100000000000000000000000000000000"),P=bI(h*t,e),R=bI(-f*t,e);let q=mo(t-P*s-R*d,e),te=mo(-P*f-R*h,e);const ne=q>E,ue=te>E;if(ne&&(q=e-q),ue&&(te=e-te),q>E||te>E)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:ne,k1:q,k2neg:ue,k2:te}}}},wE),wI=BigInt(0),_I=null;function NE(t,...e){let s=_I[t];if(s===void 0){const f=sha256(Uint8Array.from(t,d=>d.charCodeAt(0)));s=concatBytes(f,f),_I[t]=s}return sha256(concatBytes(s,...e))}const EI=t=>t.toRawBytes(!0).slice(1),UE=t=>numberToBytesBE(t,32),DE=t=>mod(t,pg),yg=t=>mod(t,y1),LE=bc.ProjectivePoint,tU=(t,e,s)=>LE.BASE.multiplyAndAddUnsafe(t,e,s);function FE(t){let e=bc.utils.normPrivateKeyToScalar(t),s=LE.fromPrivateKey(e);return{scalar:s.hasEvenY()?e:yg(-e),bytes:EI(s)}}function nU(t){aInRange("x",t,gg,pg);const e=DE(t*t),s=DE(e*t+BigInt(7));let f=vI(s);f%m1!==wI&&(f=DE(-f));const d=new LE(t,f,gg);return d.assertValidity(),d}const Kh=null;function SI(...t){return yg(Kh(NE("BIP0340/challenge",...t)))}function nX(t){return FE(t).bytes}function rX(t,e,s=randomBytes(32)){const f=ensureBytes("message",t),{bytes:d,scalar:h}=FE(e),E=ensureBytes("auxRand",s,32),P=UE(h^Kh(NE("BIP0340/aux",E))),R=NE("BIP0340/nonce",P,d,f),q=yg(Kh(R));if(q===wI)throw new Error("sign failed: k is zero");const{bytes:te,scalar:ne}=FE(q),ue=SI(te,d,f),ge=new Uint8Array(64);if(ge.set(te,0),ge.set(UE(yg(ne+ue*h)),32),!rU(ge,f,d))throw new Error("sign: Invalid signature produced");return ge}function rU(t,e,s){const f=ensureBytes("signature",t,64),d=ensureBytes("message",e),h=ensureBytes("publicKey",s,32);try{const E=nU(Kh(h)),P=Kh(f.subarray(0,32));if(!inRange(P,gg,pg))return!1;const R=Kh(f.subarray(32,64));if(!inRange(R,gg,y1))return!1;const q=SI(UE(P),EI(E),d),te=tU(E,R,yg(-q));return!(!te||!te.hasEvenY()||te.toAffine().x!==P)}catch{return!1}}const iX=null,sX=null,oX=null,aX=null,cX=null,uX=null;/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function sd(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function jE(t,...e){if(!sd(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function AI(t,e){return Array.isArray(e)?e.length===0?!0:t?e.every(s=>typeof s=="string"):e.every(s=>Number.isSafeInteger(s)):!1}function zE(t){if(typeof t!="function")throw new Error("function expected");return!0}function ql(t,e){if(typeof e!="string")throw new Error(`${t}: string expected`);return!0}function $h(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function b1(t){if(!Array.isArray(t))throw new Error("array expected")}function v1(t,e){if(!AI(!0,e))throw new Error(`${t}: array of strings expected`)}function HE(t,e){if(!AI(!1,e))throw new Error(`${t}: array of numbers expected`)}function ca(...t){const e=h=>h,s=(h,E)=>P=>h(E(P)),f=t.map(h=>h.encode).reduceRight(s,e),d=t.map(h=>h.decode).reduce(s,e);return{encode:f,decode:d}}function Ta(t){const e=typeof t=="string"?t.split(""):t,s=e.length;v1("alphabet",e);const f=new Map(e.map((d,h)=>[d,h]));return{encode:d=>(b1(d),d.map(h=>{if(!Number.isSafeInteger(h)||h<0||h>=s)throw new Error(`alphabet.encode: digit index outside alphabet "${h}". Allowed: ${t}`);return e[h]})),decode:d=>(b1(d),d.map(h=>{ql("alphabet.decode",h);const E=f.get(h);if(E===void 0)throw new Error(`Unknown letter: "${h}". Allowed: ${t}`);return E}))}}function Ca(t=""){return ql("join",t),{encode:e=>(v1("join.decode",e),e.join(t)),decode:e=>(ql("join.decode",e),e.split(t))}}function w1(t,e="="){return $h(t),ql("padding",e),{encode(s){for(v1("padding.encode",s);s.length*t%8;)s.push(e);return s},decode(s){v1("padding.decode",s);let f=s.length;if(f*t%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;f>0&&s[f-1]===e;f--)if((f-1)*t%8===0)throw new Error("padding: invalid, string has too much padding");return s.slice(0,f)}}}function xI(t){return zE(t),{encode:e=>e,decode:e=>t(e)}}function II(t,e,s){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(s<2)throw new Error(`convertRadix: invalid to=${s}, base cannot be less than 2`);if(b1(t),!t.length)return[];let f=0;const d=[],h=Array.from(t,P=>{if($h(P),P<0||P>=e)throw new Error(`invalid integer: ${P}`);return P}),E=h.length;for(;;){let P=0,R=!0;for(let q=f;q<E;q++){const te=h[q],ne=e*P,ue=ne+te;if(!Number.isSafeInteger(ue)||ne/e!==P||ue-te!==ne)throw new Error("convertRadix: carry overflow");const ge=ue/s;P=ue%s;const xe=Math.floor(ge);if(h[q]=xe,!Number.isSafeInteger(xe)||xe*s+P!==ue)throw new Error("convertRadix: carry overflow");if(R)xe?R=!1:f=q;else continue}if(d.push(P),R)break}for(let P=0;P<t.length-1&&t[P]===0;P++)d.push(0);return d.reverse()}const BI=(t,e)=>e===0?t:BI(e,t%e),_1=(t,e)=>t+(e-BI(t,e)),E1=(()=>{let t=[];for(let e=0;e<40;e++)t.push(2**e);return t})();function KE(t,e,s,f){if(b1(t),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(s<=0||s>32)throw new Error(`convertRadix2: wrong to=${s}`);if(_1(e,s)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${s} carryBits=${_1(e,s)}`);let d=0,h=0;const E=E1[e],P=E1[s]-1,R=[];for(const q of t){if($h(q),q>=E)throw new Error(`convertRadix2: invalid data word=${q} from=${e}`);if(d=d<<e|q,h+e>32)throw new Error(`convertRadix2: carry overflow pos=${h} from=${e}`);for(h+=e;h>=s;h-=s)R.push((d>>h-s&P)>>>0);const te=E1[h];if(te===void 0)throw new Error("invalid carry");d&=te-1}if(d=d<<s-h&P,!f&&h>=e)throw new Error("Excess padding");if(!f&&d>0)throw new Error(`Non-zero padding: ${d}`);return f&&h>0&&R.push(d>>>0),R}function iU(t){$h(t);const e=2**8;return{encode:s=>{if(!sd(s))throw new Error("radix.encode input should be Uint8Array");return II(Array.from(s),e,t)},decode:s=>(HE("radix.decode",s),Uint8Array.from(II(s,t,e)))}}function Wa(t,e=!1){if($h(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(_1(8,t)>32||_1(t,8)>32)throw new Error("radix2: carry overflow");return{encode:s=>{if(!sd(s))throw new Error("radix2.encode input should be Uint8Array");return KE(Array.from(s),8,t,!e)},decode:s=>(HE("radix2.decode",s),Uint8Array.from(KE(s,t,8,e)))}}function kI(t){return zE(t),function(...e){try{return t.apply(null,e)}catch{}}}function sU(t,e){return $h(t),zE(e),{encode(s){if(!sd(s))throw new Error("checksum.encode: input should be Uint8Array");const f=e(s).slice(0,t),d=new Uint8Array(s.length+t);return d.set(s),d.set(f,s.length),d},decode(s){if(!sd(s))throw new Error("checksum.decode: input should be Uint8Array");const f=s.slice(0,-t),d=s.slice(-t),h=e(f).slice(0,t);for(let E=0;E<t;E++)if(h[E]!==d[E])throw new Error("Invalid checksum");return f}}}const lX=null,fX=ca(Wa(4),Ta("0123456789ABCDEF"),Ca("")),dX=ca(Wa(5),Ta("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),w1(5),Ca("")),hX=ca(Wa(5),Ta("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Ca("")),pX=ca(Wa(5),Ta("0123456789ABCDEFGHIJKLMNOPQRSTUV"),w1(5),Ca("")),gX=ca(Wa(5),Ta("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Ca("")),yX=ca(Wa(5),Ta("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Ca(""),xI(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),TI=typeof Uint8Array.from([]).toBase64=="function"&&typeof Uint8Array.fromBase64=="function",CI=(t,e)=>{ql("base64",t);const s=e?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,f=e?"base64url":"base64";if(t.length>0&&!s.test(t))throw new Error("invalid base64");return Uint8Array.fromBase64(t,{alphabet:f,lastChunkHandling:"strict"})},mX=TI?{encode(t){return jE(t),t.toBase64()},decode(t){return CI(t,!1)}}:ca(Wa(6),Ta("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),w1(6),Ca("")),bX=ca(Wa(6),Ta("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Ca("")),vX=TI?{encode(t){return jE(t),t.toBase64({alphabet:"base64url"})},decode(t){return CI(t,!0)}}:ca(Wa(6),Ta("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),w1(6),Ca("")),wX=ca(Wa(6),Ta("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Ca("")),$E=t=>ca(iU(58),Ta(t),Ca("")),oU=$E("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),_X=$E("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),EX=$E("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),SX=null,AX=null,aU=t=>ca(sU(4,e=>t(t(e))),oU),xX=null,VE=ca(Ta("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Ca("")),PI=[996825010,642813549,513874426,1027748829,705979059];function mg(t){const e=t>>25;let s=(t&33554431)<<5;for(let f=0;f<PI.length;f++)(e>>f&1)===1&&(s^=PI[f]);return s}function MI(t,e,s=1){const f=t.length;let d=1;for(let h=0;h<f;h++){const E=t.charCodeAt(h);if(E<33||E>126)throw new Error(`Invalid prefix (${t})`);d=mg(d)^E>>5}d=mg(d);for(let h=0;h<f;h++)d=mg(d)^t.charCodeAt(h)&31;for(let h of e)d=mg(d)^h;for(let h=0;h<6;h++)d=mg(d);return d^=s,VE.encode(KE([d%E1[30]],30,5,!1))}function OI(t){const e=t==="bech32"?1:734539939,s=Wa(5),f=s.decode,d=s.encode,h=kI(f);function E(ne,ue,ge=90){ql("bech32.encode prefix",ne),sd(ue)&&(ue=Array.from(ue)),HE("bech32.encode",ue);const xe=ne.length;if(xe===0)throw new TypeError(`Invalid prefix length ${xe}`);const pe=xe+7+ue.length;if(ge!==!1&&pe>ge)throw new TypeError(`Length ${pe} exceeds limit ${ge}`);const Se=ne.toLowerCase(),Ce=MI(Se,ue,e);return`${Se}1${VE.encode(ue)}${Ce}`}function P(ne,ue=90){ql("bech32.decode input",ne);const ge=ne.length;if(ge<8||ue!==!1&&ge>ue)throw new TypeError(`invalid string length: ${ge} (${ne}). Expected (8..${ue})`);const xe=ne.toLowerCase();if(ne!==xe&&ne!==ne.toUpperCase())throw new Error("String must be lowercase or uppercase");const pe=xe.lastIndexOf("1");if(pe===0||pe===-1)throw new Error('Letter "1" must be present between prefix and data only');const Se=xe.slice(0,pe),Ce=xe.slice(pe+1);if(Ce.length<6)throw new Error("Data must be at least 6 characters long");const Fe=VE.decode(Ce).slice(0,-6),We=MI(Se,Fe,e);if(!Ce.endsWith(We))throw new Error(`Invalid checksum in ${ne}: expected "${We}"`);return{prefix:Se,words:Fe}}const R=kI(P);function q(ne){const{prefix:ue,words:ge}=P(ne,!1);return{prefix:ue,words:ge,bytes:f(ge)}}function te(ne,ue){return E(ne,d(ue))}return{encode:E,decode:P,encodeFromBytes:te,decodeToBytes:q,decodeUnsafe:R,fromWords:f,fromWordsUnsafe:h,toWords:d}}const IX=OI("bech32"),BX=OI("bech32m"),kX=null,PX=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function"?{encode(t){return jE(t),t.toHex()},decode(t){return ql("hex",t),Uint8Array.fromHex(t)}}:ca(Wa(4),Ta("0123456789abcdef"),Ca(""),xI(t=>{if(typeof t!="string"||t.length%2!==0)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})),S1=null,RI="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",MX=(t,e)=>{if(typeof t!="string"||!S1.hasOwnProperty(t))throw new TypeError(RI);if(!sd(e))throw new TypeError("bytesToString() expects Uint8Array");return S1[t].encode(e)},OX=null,RX=(t,e)=>{if(!S1.hasOwnProperty(t))throw new TypeError(RI);if(typeof e!="string")throw new TypeError("stringToBytes() expects string");return S1[t].decode(e)},NX=null;/*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */const A1=bc.ProjectivePoint,WE=aU(wE);function NI(t){gc(t);const e=t.length===0?"0":NO(t);return BigInt("0x"+e)}function cU(t){if(typeof t!="bigint")throw new Error("bigint expected");return UO(t.toString(16).padStart(64,"0"))}const uU=ex("Bitcoin seed"),GE={private:76066276,public:76067358},qE=2147483648,lU=t=>IN(wE(t)),fU=t=>qf(t).getUint32(0,!1),x1=t=>{if(!Number.isSafeInteger(t)||t<0||t>2**32-1)throw new Error("invalid number, should be from 0 to 2**32-1, got "+t);const e=new Uint8Array(4);return qf(e).setUint32(0,t,!1),e};class od{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return fU(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){const e=this.privateKey;if(!e)throw new Error("No private key");return WE.encode(this.serialize(this.versions.private,tg(new Uint8Array([0]),e)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return WE.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(e,s=GE){if(gc(e),8*e.length<128||8*e.length>512)throw new Error("HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got "+e.length);const f=ng(X_,uU,e);return new od({versions:s,chainCode:f.slice(32),privateKey:f.slice(0,32)})}static fromExtendedKey(e,s=GE){const f=WE.decode(e),d=qf(f),h=d.getUint32(0,!1),E={versions:s,depth:f[4],parentFingerprint:d.getUint32(5,!1),index:d.getUint32(9,!1),chainCode:f.slice(13,45)},P=f.slice(45),R=P[0]===0;if(h!==s[R?"private":"public"])throw new Error("Version mismatch");return R?new od({...E,privateKey:P.slice(1)}):new od({...E,publicKey:P})}static fromJSON(e){return od.fromExtendedKey(e.xpriv)}constructor(e){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!e||typeof e!="object")throw new Error("HDKey.constructor must not be called directly");if(this.versions=e.versions||GE,this.depth=e.depth||0,this.chainCode=e.chainCode||null,this.index=e.index||0,this.parentFingerprint=e.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(e.publicKey&&e.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(e.privateKey){if(!bc.utils.isValidPrivateKey(e.privateKey))throw new Error("Invalid private key");this.privKey=typeof e.privateKey=="bigint"?e.privateKey:NI(e.privateKey),this.privKeyBytes=cU(this.privKey),this.pubKey=bc.getPublicKey(e.privateKey,!0)}else if(e.publicKey)this.pubKey=A1.fromHex(e.publicKey).toRawBytes(!0);else throw new Error("HDKey: no public or private key provided");this.pubHash=lU(this.pubKey)}derive(e){if(!/^[mM]'?/.test(e))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(e))return this;const s=e.replace(/^[mM]'?\//,"").split("/");let f=this;for(const d of s){const h=/^(\d+)('?)$/.exec(d),E=h&&h[1];if(!h||h.length!==3||typeof E!="string")throw new Error("invalid child index: "+d);let P=+E;if(!Number.isSafeInteger(P)||P>=qE)throw new Error("Invalid index");h[2]==="'"&&(P+=qE),f=f.deriveChild(P)}return f}deriveChild(e){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let s=x1(e);if(e>=qE){const P=this.privateKey;if(!P)throw new Error("Could not derive hardened child key");s=tg(new Uint8Array([0]),P,s)}else s=tg(this.pubKey,s);const f=ng(X_,this.chainCode,s),d=NI(f.slice(0,32)),h=f.slice(32);if(!bc.utils.isValidPrivateKey(d))throw new Error("Tweak bigger than curve order");const E={versions:this.versions,chainCode:h,depth:this.depth+1,parentFingerprint:this.fingerprint,index:e};try{if(this.privateKey){const P=mo(this.privKey+d,bc.CURVE.n);if(!bc.utils.isValidPrivateKey(P))throw new Error("The tweak was out of range or the resulted private key is invalid");E.privateKey=P}else{const P=A1.fromHex(this.pubKey).add(A1.fromPrivateKey(d));if(P.equals(A1.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");E.publicKey=P.toRawBytes(!0)}return new od(E)}catch{return this.deriveChild(e+1)}}sign(e){if(!this.privateKey)throw new Error("No privateKey set!");return gc(e,32),bc.sign(e,this.privKey).toCompactRawBytes()}verify(e,s){if(gc(e,32),gc(s,64),!this.publicKey)throw new Error("No publicKey set!");let f;try{f=bc.Signature.fromCompact(s)}catch{return!1}return bc.verify(f,e,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(e,s){if(!this.chainCode)throw new Error("No chainCode set");return gc(s,33),tg(x1(e),new Uint8Array([this.depth]),x1(this.parentFingerprint),x1(this.index),this.chainCode,s)}}var UI=class Xg extends HA{constructor(e){super();let s=Qs.fromHexInput(e);if(s.toUint8Array().length!==Xg.LENGTH)throw new Error(`PublicKey length should be ${Xg.LENGTH}`);this.key=s}verifySignature(e){let{message:s,signature:f}=e;if(!(f instanceof vg))return!1;let d=Qs.fromHexInput(s).toUint8Array(),h=Qb(d),E=f.toUint8Array();return Fu.verify(E,h,this.key.toUint8Array())}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let s=e.deserializeBytes();return new Xg(s)}static isPublicKey(e){return e instanceof Xg}};UI.LENGTH=65;var bg=UI,DI=class ff extends Ri{constructor(e){super();let s=Qs.fromHexInput(e);if(s.toUint8Array().length!==ff.LENGTH)throw new Error(`PrivateKey length should be ${ff.LENGTH}`);this.key=s}static generate(){let e=Fu.utils.randomPrivateKey();return new ff(e)}static fromDerivationPath(e,s){if(!yR(e))throw new Error(`Invalid derivation path ${e}`);return ff.fromDerivationPathInner(e,fx(s))}static fromDerivationPathInner(e,s){let{privateKey:f}=od.fromMasterSeed(s).derive(e);if(f===null)throw new Error("Invalid key");return new ff(f)}sign(e){let s=Qs.fromHexInput(e),f=Qb(s.toUint8Array()),d=Fu.sign(f,this.key.toUint8Array());return new vg(d.toCompactRawBytes())}publicKey(){let e=Fu.getPublicKey(this.key.toUint8Array(),!1);return new bg(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let s=e.deserializeBytes();return new ff(s)}static isPrivateKey(e){return e instanceof ff}};DI.LENGTH=32;var ZE=DI,LI=class yv extends Qp{constructor(e){super();let s=Qs.fromHexInput(e);if(s.toUint8Array().length!==yv.LENGTH)throw new Error(`Signature length should be ${yv.LENGTH}, received ${s.toUint8Array().length}`);this.data=s}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let s=e.deserializeBytes();return new yv(s)}};LI.LENGTH=64;var vg=LI,ad=class bS extends Vb{constructor(e){if(super(),this.publicKey=e,e instanceof oa)this.variant=0;else if(e instanceof bg)this.variant=1;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:s,signature:f}=e;return f instanceof Hu?this.publicKey.verifySignature({message:s,signature:f.signature}):!1}authKey(){return Xf.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let s=e.deserializeUleb128AsU32(),f;switch(s){case 0:f=oa.deserialize(e);break;case 1:f=bg.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${s}`)}return new bS(f)}static isPublicKey(e){return e instanceof bS}isEd25519(){return this.publicKey instanceof oa}isSecp256k1PublicKey(){return this.publicKey instanceof bg}},Hu=class n9 extends Qp{constructor(e){if(super(),this.signature=e,e instanceof aa)this.variant=0;else if(e instanceof vg)this.variant=1;else throw new Error("Unsupported signature type")}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let s=e.deserializeUleb128AsU32(),f;switch(s){case 0:f=aa.deserialize(e);break;case 1:f=vg.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${s}`)}return new n9(f)}};function FI(t){let e=t;return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}var dU=class r9 extends Vb{constructor(e){super();let{publicKeys:s,signaturesRequired:f}=e;if(f<1)throw new Error("The number of required signatures needs to be greater than 0");if(s.length<f)throw new Error(`Provided ${s.length} public keys is smaller than the ${f} required signatures`);this.publicKeys=s.map(d=>d instanceof ad?d:new ad(d)),this.signaturesRequired=f}verifySignature(e){throw new Error("not implemented")}authKey(){return Xf.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let s=e.deserializeVector(ad),f=e.deserializeU8();return new r9({publicKeys:s,signaturesRequired:f})}createBitmap(e){let{bits:s}=e,f=128,d=new Uint8Array([0,0,0,0]),h=new Set;return s.forEach((E,P)=>{if(P+1>this.publicKeys.length)throw new Error(`Signature index ${P+1} is out of public keys range, ${this.publicKeys.length}.`);if(h.has(E))throw new Error(`Duplicate bit ${E} detected.`);h.add(E);let R=Math.floor(E/8),q=d[R];q|=f>>E%8,d[R]=q}),d}},XE=class Zu extends Qp{constructor(e){super();let{signatures:s,bitmap:f}=e;if(s.length>Zu.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${Zu.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=s.map(h=>h instanceof Hu?h:new Hu(h)),!(f instanceof Uint8Array))this.bitmap=Zu.createBitmap({bits:f});else{if(f.length!==Zu.BITMAP_LEN)throw new Error(`"bitmap" length should be ${Zu.BITMAP_LEN}`);this.bitmap=f}let d=this.bitmap.reduce((h,E)=>h+FI(E),0);if(d!==this.signatures.length)throw new Error(`Expecting ${d} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:s}=e,f=128,d=new Uint8Array([0,0,0,0]),h=new Set;return s.forEach(E=>{if(E>=Zu.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${Zu.MAX_SIGNATURES_SUPPORTED-1}.`);if(h.has(E))throw new Error("Duplicate bits detected.");h.add(E);let P=Math.floor(E/8),R=d[P];R|=f>>E%8,d[P]=R}),d}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let s=e.deserializeBytes(),f=s.reduce((h,E)=>h+FI(E),0),d=[];for(let h=0;h<f;h+=1){let E=Hu.deserialize(e);d.push(E)}return new Zu({signatures:d,bitmap:s})}};XE.BITMAP_LEN=4,XE.MAX_SIGNATURES_SUPPORTED=XE.BITMAP_LEN*8;var UX=null,Qc=class extends Ri{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Vh.load(t);case 1:return jI.load(t);case 2:return cd.load(t);case 3:return YE.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}isEd25519(){return this instanceof Vh}isMultiEd25519(){return this instanceof jI}isSingleKey(){return this instanceof cd}isMultiKey(){return this instanceof YE}},Vh=class i9 extends Qc{constructor(e,s){super(),this.public_key=e,this.signature=s}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let s=oa.deserialize(e),f=aa.deserialize(e);return new i9(s,f)}},jI=class s9 extends Qc{constructor(e,s){super(),this.public_key=e,this.signature=s}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let s=Ex.deserialize(e),f=eE.deserialize(e);return new s9(s,f)}},cd=class o9 extends Qc{constructor(e,s){super(),this.public_key=e,this.signature=s}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let s=ad.deserialize(e),f=Hu.deserialize(e);return new o9(s,f)}},YE=class a9 extends Qc{constructor(e,s,f){super(),this.public_keys=e,this.signatures=s,this.signatures_bitmap=f}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),e.serializeVector(this.signatures),e.serializeBytes(this.signatures_bitmap)}static load(e){let s=dU.deserialize(e),f=e.deserializeVector(Hu),d=e.deserializeBytes();return new a9(s,f,d)}},JE=class vS{constructor(e){this.signingScheme=0;let{privateKey:s,address:f}=e;this.privateKey=s,this.publicKey=s.publicKey(),this.accountAddress=f?fr.from(f):this.publicKey.authKey().derivedAddress()}static generate(){let e=Mh.generate();return new vS({privateKey:e})}static fromDerivationPath(e){let{path:s,mnemonic:f}=e,d=Mh.fromDerivationPath(s,f);return new vS({privateKey:d})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let s=this.privateKey.sign(e);return new Vh(this.publicKey,s)}sign(e){return this.signWithAuthenticator(e).signature}},QE=class wS{constructor(e){this.signingScheme=2;let{privateKey:s,address:f}=e;this.privateKey=s,this.publicKey=new ad(s.publicKey()),this.accountAddress=f?fr.from(f):this.publicKey.authKey().derivedAddress()}static generate(e={}){let{scheme:s=0}=e,f;switch(s){case 0:f=Mh.generate();break;case 2:f=ZE.generate();break;default:throw new Error(`Unsupported signature scheme ${s}`)}return new wS({privateKey:f})}static fromDerivationPath(e){let{scheme:s=0,path:f,mnemonic:d}=e,h;switch(s){case 0:h=Mh.fromDerivationPath(f,d);break;case 2:h=ZE.fromDerivationPath(f,d);break;default:throw new Error(`Unsupported signature scheme ${s}`)}return new wS({privateKey:h})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let s=this.privateKey.sign(e),f=new Hu(s);return new cd(this.publicKey,f)}sign(e){return this.signWithAuthenticator(e).signature}},I1=class{static generate(t={}){let{scheme:e=0,legacy:s=!0}=t;return e===0&&s?JE.generate():QE.generate({scheme:e})}static fromPrivateKey(t){let{privateKey:e,address:s,legacy:f=!0}=t;return e instanceof Mh&&f?new JE({privateKey:e,address:s}):new QE({privateKey:e,address:s})}static fromPrivateKeyAndAddress(t){return this.fromPrivateKey(t)}static fromDerivationPath(t){let{scheme:e=0,mnemonic:s,path:f,legacy:d=!0}=t;return e===0&&d?JE.fromDerivationPath({mnemonic:s,path:f}):QE.fromDerivationPath({scheme:e,mnemonic:s,path:f})}static authKey(t){let{publicKey:e}=t;return e.authKey()}verifySignature(t){return this.publicKey.verifySignature(t)}};async function Wh(t){let{aptosConfig:e,accountAddress:s}=t,{data:f}=await Mu({aptosConfig:e,originMethod:"getInfo",path:`accounts/${fr.from(s).toString()}`});return f}async function hU(t){let{aptosConfig:e,accountAddress:s,options:f}=t;return Lb({aptosConfig:e,originMethod:"getModules",path:`accounts/${fr.from(s).toString()}/modules`,params:{ledger_version:f?.ledgerVersion,start:f?.offset,limit:f?.limit??1e3}})}async function zI(t){return t.options?.ledgerVersion!==void 0?HI(t):N_(async()=>HI(t),`module-${t.accountAddress}-${t.moduleName}`,1e3*60*5)()}async function HI(t){let{aptosConfig:e,accountAddress:s,moduleName:f,options:d}=t,{data:h}=await Mu({aptosConfig:e,originMethod:"getModule",path:`accounts/${fr.from(s).toString()}/module/${f}`,params:{ledger_version:d?.ledgerVersion}});return h}async function pU(t){let{aptosConfig:e,accountAddress:s,options:f}=t;return Lb({aptosConfig:e,originMethod:"getTransactions",path:`accounts/${fr.from(s).toString()}/transactions`,params:{start:f?.offset,limit:f?.limit}})}async function gU(t){let{aptosConfig:e,accountAddress:s,options:f}=t;return Lb({aptosConfig:e,originMethod:"getResources",path:`accounts/${fr.from(s).toString()}/resources`,params:{ledger_version:f?.ledgerVersion,start:f?.offset,limit:f?.limit??999}})}async function KI(t){let{aptosConfig:e,accountAddress:s,resourceType:f,options:d}=t,{data:h}=await Mu({aptosConfig:e,originMethod:"getResource",path:`accounts/${fr.from(s).toString()}/resource/${f}`,params:{ledger_version:d?.ledgerVersion}});return h.data}async function $I(t){let{aptosConfig:e,authenticationKey:s,options:f}=t,d=await KI({aptosConfig:e,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:f}),{address_map:{handle:h}}=d,E=fr.from(s);try{let P=await _A({aptosConfig:e,handle:h,data:{key:E.toString(),key_type:"address",value_type:"address"},options:f});return fr.from(P)}catch(P){if(P instanceof Gp&&P.data.error_code==="table_item_not_found")return E;throw P}}async function yU(t){let{aptosConfig:e,accountAddress:s}=t,f={owner_address:{_eq:fr.from(s).toStringLong()},amount:{_gt:0}},d=await Fi({aptosConfig:e,query:{query:aA,variables:{where_condition:f}},originMethod:"getAccountTokensCount"});return d.current_token_ownerships_v2_aggregate.aggregate?d.current_token_ownerships_v2_aggregate.aggregate.count:0}async function mU(t){let{aptosConfig:e,accountAddress:s,options:f}=t,d={owner_address:{_eq:fr.from(s).toStringLong()},amount:{_gt:0}};f?.tokenStandard&&(d.token_standard={_eq:f?.tokenStandard});let h={query:sA,variables:{where_condition:d,offset:f?.offset,limit:f?.limit,order_by:f?.orderBy}};return(await Fi({aptosConfig:e,query:h,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function bU(t){let{aptosConfig:e,accountAddress:s,collectionAddress:f,options:d}=t,h=fr.from(s).toStringLong(),E=fr.from(f).toStringLong(),P={owner_address:{_eq:h},current_token_data:{collection_id:{_eq:E}},amount:{_gt:0}};d?.tokenStandard&&(P.token_standard={_eq:d?.tokenStandard});let R={query:oA,variables:{where_condition:P,offset:d?.offset,limit:d?.limit,order_by:d?.orderBy}};return(await Fi({aptosConfig:e,query:R,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function vU(t){let{aptosConfig:e,accountAddress:s,options:f}=t,d={owner_address:{_eq:fr.from(s).toStringLong()},amount:{_gt:0}};f?.tokenStandard&&(d.current_collection={token_standard:{_eq:f?.tokenStandard}});let h={query:rA,variables:{where_condition:d,offset:f?.offset,limit:f?.limit,order_by:f?.orderBy}};return(await Fi({aptosConfig:e,query:h,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function wU(t){let{aptosConfig:e,accountAddress:s}=t,f=fr.from(s).toStringLong(),d=await Fi({aptosConfig:e,query:{query:cA,variables:{address:f}},originMethod:"getAccountTransactionsCount"});return d.account_transactions_aggregate.aggregate?d.account_transactions_aggregate.aggregate.count:0}async function _U(t){let{aptosConfig:e,accountAddress:s,coinType:f}=t,d=fr.from(s).toStringLong(),h=await VI({aptosConfig:e,accountAddress:d,options:{where:{asset_type:{_eq:f}}}});return h[0]?h[0].amount:0}async function VI(t){let{aptosConfig:e,accountAddress:s,options:f}=t,d=fr.from(s).toStringLong(),h={...f?.where,owner_address:{_eq:d}},E={query:nA,variables:{where_condition:h,offset:f?.offset,limit:f?.limit,order_by:f?.orderBy}};return(await Fi({aptosConfig:e,query:E,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function EU(t){let{aptosConfig:e,accountAddress:s}=t,f=fr.from(s).toStringLong(),d=await Fi({aptosConfig:e,query:{query:tA,variables:{address:f}},originMethod:"getAccountCoinsCount"});if(!d.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return d.current_fungible_asset_balances_aggregate.aggregate.count}async function SU(t){let{aptosConfig:e,accountAddress:s,options:f}=t,d={owner_address:{_eq:fr.from(s).toStringLong()}},h={query:iA,variables:{where_condition:d,offset:f?.offset,limit:f?.limit,order_by:f?.orderBy}};return(await Fi({aptosConfig:e,query:h,originMethod:"getAccountOwnedObjects"})).current_objects}async function AU(t){let{aptosConfig:e,privateKey:s}=t,f=new ad(s.publicKey());if(s instanceof ZE){let d=Xf.fromPublicKeyAndScheme({publicKey:f,scheme:2}).derivedAddress();return I1.fromPrivateKeyAndAddress({privateKey:s,address:d})}if(s instanceof Mh){let d=Xf.fromPublicKeyAndScheme({publicKey:f,scheme:2});if(await WI({authKey:d,aptosConfig:e})){let E=d.derivedAddress();return I1.fromPrivateKeyAndAddress({privateKey:s,address:E,legacy:!1})}let h=Xf.fromPublicKeyAndScheme({publicKey:f.publicKey,scheme:0});if(await WI({authKey:h,aptosConfig:e})){let E=h.derivedAddress();return I1.fromPrivateKeyAndAddress({privateKey:s,address:E,legacy:!0})}}throw new Error(`Can't derive account from private key ${s}`)}async function WI(t){let{aptosConfig:e,authKey:s}=t,f=await $I({aptosConfig:e,authenticationKey:s.derivedAddress()});try{return await Wh({aptosConfig:e,accountAddress:f}),!0}catch(d){if(d.status===404)return!1;throw new Error(`Error while looking for an account info ${f.toString()}`)}}var xU=new TextEncoder;function GI(t){return t?.map(e=>Jp(e)?Ch(e):e)??[]}async function qI(t,e,s,f){let d=await zI({aptosConfig:f,accountAddress:t,moduleName:e});if(d.abi)return d.abi.exposed_functions.find(h=>h.name===s)}async function IU(t,e,s,f){let d=await qI(t,e,s,f);if(!d)throw new Error(`Could not find entry function ABI for '${t}::${e}::${s}'`);if(!d.is_entry)throw new Error(`'${t}::${e}::${s}' is not an entry function`);let h=pO(d),E=[];for(let P=h;P<d.params.length;P+=1)E.push(Ch(d.params[P],{allowGenerics:!0}));return{signers:h,typeParameters:d.generic_type_params,parameters:E}}async function BU(t,e,s,f){let d=await qI(t,e,s,f);if(!d)throw new Error(`Could not find view function ABI for '${t}::${e}::${s}'`);if(!d.is_view)throw new Error(`'${t}::${e}::${s}' is not an view function`);let h=[];for(let P=0;P<d.params.length;P+=1)h.push(Ch(d.params[P],{allowGenerics:!0}));let E=[];for(let P=0;P<d.return.length;P+=1)E.push(Ch(d.return[P],{allowGenerics:!0}));return{typeParameters:d.generic_type_params,parameters:h,returnTypes:E}}function ZI(t,e,s,f,d){if(f>=e.parameters.length)throw new Error(`Too many arguments for '${t}', expected ${e.parameters.length}`);let h=e.parameters[f];return wg(s,h,f,d)}function wg(t,e,s,f){return fO(t)?(e6(e,t,s),t):kU(t,e,s,f)}function kU(t,e,s,f){if(e.isBool()){if(uO(t))return new sa(t);Ps("boolean",s)}if(e.isAddress()){if(Jp(t))return fr.fromString(t);Ps("string | AccountAddress",s)}if(e.isU8()){if(K_(t))return new Ou(t);Ps("number",s)}if(e.isU16()){if(K_(t))return new qp(t);Ps("number",s)}if(e.isU32()){if(K_(t))return new Zp(t);Ps("number",s)}if(e.isU64()){if($_(t))return new Ru(BigInt(t));Ps("bigint | number | string",s)}if(e.isU128()){if($_(t))return new Xp(BigInt(t));Ps("bigint | number | string",s)}if(e.isU256()){if($_(t))return new Yp(BigInt(t));Ps("bigint | number | string",s)}if(e.isGeneric()){let d=e.value;if(d<0||d>=f.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${s}`);return wg(t,f[d],s,f)}if(e.isVector()){if(e.value.isU8()){if(Jp(t))return ps.U8(xU.encode(t));if(t instanceof Uint8Array)return ps.U8(t);if(t instanceof ArrayBuffer)return ps.U8(new Uint8Array(t))}if(Array.isArray(t))return new ps(t.map(d=>wg(d,e.value,s,f)));throw new Error(`Type mismatch for argument ${s}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(Jp(t))return new vs(t);Ps("string",s)}if(e.isObject()){if(Jp(t))return fr.fromString(t);Ps("string | AccountAddress",s)}if(e.isOption())return lO(t)?new Kb(null):new Kb(wg(t,e.value.typeArgs[0],s,f));throw new Error(`Unsupported struct input type for argument ${s}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${s}, type '${e.toString()}'`)}function e6(t,e,s){if(t.isBool()){if(RA(e))return;Ps("Bool",s)}if(t.isAddress()){if(V_(e))return;Ps("AccountAddress",s)}if(t.isU8()){if(UA(e))return;Ps("U8",s)}if(t.isU16()){if(DA(e))return;Ps("U16",s)}if(t.isU32()){if(LA(e))return;Ps("U32",s)}if(t.isU64()){if(FA(e))return;Ps("U64",s)}if(t.isU128()){if(jA(e))return;Ps("U128",s)}if(t.isU256()){if(zA(e))return;Ps("U256",s)}if(t.isVector()){if(e instanceof ps){e.values.length>0&&e6(t.value,e.values[0],s);return}Ps("MoveVector",s)}if(t instanceof ii){if(t.isString()){if(NA(e))return;Ps("MoveString",s)}if(t.isObject()){if(V_(e))return;Ps("AccountAddress",s)}if(t.isOption()){if(e instanceof Kb){e.value!==void 0&&e6(t.value.typeArgs[0],e.value,s);return}Ps("MoveOption",s)}}throw new Error(`Type mismatch for argument ${s}, expected '${t.toString()}'`)}var XI=class _S extends Ri{constructor(e,s){super(),this.address=e,this.name=s}static fromStr(e){let s=e.split("::");if(s.length!==2)throw new Error("Invalid module id.");return new _S(fr.fromString(s[0]),new za(s[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let s=fr.deserialize(e),f=za.deserialize(e);return new _S(s,f)}},TU=class c9 extends Ri{constructor(e){super(),this.value=new H_(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let f=H_.deserialize(e,s);return new c9(f.value)}};function CU(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Ou.deserialize(t);case 1:return Ru.deserialize(t);case 2:return Xp.deserialize(t);case 3:return fr.deserialize(t);case 4:return ps.deserialize(t,Ou);case 5:return sa.deserialize(t);case 6:return qp.deserialize(t);case 7:return Zp.deserialize(t);case 8:return Yp.deserialize(t);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var B1=class extends Ri{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return YI.load(t);case 2:return JI.load(t);case 3:return QI.load(t);default:throw new Error(`Unknown variant index for TransactionPayload: ${e}`)}}},YI=class u9 extends B1{constructor(e){super(),this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let s=eB.deserialize(e);return new u9(s)}},JI=class l9 extends B1{constructor(e){super(),this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let s=k1.deserialize(e);return new l9(s)}},QI=class f9 extends B1{constructor(e){super(),this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let s=tB.deserialize(e);return new f9(s)}},k1=class ES{constructor(e,s,f,d){this.module_name=e,this.function_name=s,this.type_args=f,this.args=d}static build(e,s,f,d){return new ES(XI.fromStr(e),new za(s),f,d)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(s=>{s.serializeForEntryFunction(e)})}static deserialize(e){let s=XI.deserialize(e),f=za.deserialize(e),d=e.deserializeVector(ao),h=e.deserializeUleb128AsU32(),E=new Array;for(let P=0;P<h;P+=1){let R=e.deserializeUleb128AsU32(),q=TU.deserialize(e,R);E.push(q)}return new ES(s,f,d,E)}},eB=class d9{constructor(e,s,f){this.bytecode=e,this.type_args=s,this.args=f}serialize(e){e.serializeBytes(this.bytecode),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(s=>{s.serializeForScriptFunction(e)})}static deserialize(e){let s=e.deserializeBytes(),f=e.deserializeVector(ao),d=e.deserializeUleb128AsU32(),h=new Array;for(let E=0;E<d;E+=1){let P=CU(e);h.push(P)}return new d9(s,f,h)}},tB=class h9{constructor(e,s){this.multisig_address=e,this.transaction_payload=s}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){let s=fr.deserialize(e),f=e.deserializeBool(),d;return f&&(d=nB.deserialize(e)),new h9(s,d)}},nB=class p9 extends Ri{constructor(e){super(),this.transaction_payload=e}serialize(e){e.serializeU32AsUleb128(0),this.transaction_payload.serialize(e)}static deserialize(e){return e.deserializeUleb128AsU32(),new p9(k1.deserialize(e))}},rB=class g9 extends Ri{constructor(e){super(),this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new g9(s)}},ud=class y9 extends Ri{constructor(e,s,f,d,h,E,P){super(),this.sender=e,this.sequence_number=s,this.payload=f,this.max_gas_amount=d,this.gas_unit_price=h,this.expiration_timestamp_secs=E,this.chain_id=P}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=fr.deserialize(e),f=e.deserializeU64(),d=B1.deserialize(e),h=e.deserializeU64(),E=e.deserializeU64(),P=e.deserializeU64(),R=rB.deserialize(e);return new y9(s,f,d,h,E,P,R)}},iB=class extends Ri{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Gh.load(t);case 1:return qh.load(t);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},Gh=class m9 extends iB{constructor(e,s){super(),this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=ud.deserialize(e),f=e.deserializeVector(fr);return new m9(s,f)}},qh=class b9 extends iB{constructor(e,s,f){super(),this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=f}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=ud.deserialize(e),f=e.deserializeVector(fr),d=fr.deserialize(e);return new b9(s,f,d)}},Zh=class extends Ri{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return t6.load(t);case 1:return PU.load(t);case 2:return n6.load(t);case 3:return r6.load(t);case 4:return i6.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},t6=class v9 extends Zh{constructor(e,s){super(),this.public_key=e,this.signature=s}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let s=oa.deserialize(e),f=aa.deserialize(e);return new v9(s,f)}},PU=class w9 extends Zh{constructor(e,s){super(),this.public_key=e,this.signature=s}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let s=Ex.deserialize(e),f=eE.deserialize(e);return new w9(s,f)}},n6=class _9 extends Zh{constructor(e,s,f){super(),this.sender=e,this.secondary_signer_addresses=s,this.secondary_signers=f}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let s=Qc.deserialize(e),f=e.deserializeVector(fr),d=e.deserializeVector(Qc);return new _9(s,f,d)}},r6=class E9 extends Zh{constructor(e,s,f,d){super(),this.sender=e,this.secondary_signer_addresses=s,this.secondary_signers=f,this.fee_payer=d}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let s=Qc.deserialize(e),f=e.deserializeVector(fr),d=e.deserializeVector(Qc),h=fr.deserialize(e),E=Qc.deserialize(e),P={address:h,authenticator:E};return new E9(s,f,d,P)}},i6=class S9 extends Zh{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let s=Qc.deserialize(e);return new S9(s)}},ld=class A9 extends Ri{constructor(e,s){super(),this.raw_txn=e,this.authenticator=s}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){let s=ud.deserialize(e),f=Zh.deserialize(e);return new A9(s,f)}},MU={mainnet:"https://api.mainnet.aptoslabs.com/v1/graphql",testnet:"https://api.testnet.aptoslabs.com/v1/graphql",devnet:"https://api.devnet.aptoslabs.com/v1/graphql",randomnet:"https://indexer-randomnet.hasura.app/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},OU={mainnet:"https://api.mainnet.aptoslabs.com/v1",testnet:"https://api.testnet.aptoslabs.com/v1",devnet:"https://api.devnet.aptoslabs.com/v1",randomnet:"https://fullnode.random.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},RU={mainnet:"https://faucet.mainnet.aptoslabs.com",testnet:"https://faucet.testnet.aptoslabs.com",devnet:"https://faucet.devnet.aptoslabs.com",randomnet:"https://faucet.random.aptoslabs.com",local:"http://127.0.0.1:8081"},s6=(t=>(t.MAINNET="mainnet",t.TESTNET="testnet",t.DEVNET="devnet",t.RANDOMNET="randomnet",t.LOCAL="local",t.CUSTOM="custom",t))(s6||{}),sB={mainnet:1,testnet:2,randomnet:70},DX=null;async function o6(t){if(hO(t))return LU(t);let{moduleAddress:e,moduleName:s,functionName:f}=$b(t.function),d=await uB({key:"entry-function",moduleAddress:e,moduleName:s,functionName:f,aptosConfig:t.aptosConfig,abi:t.abi,fetch:IU});return NU({abi:d,...t})}function NU(t){let e=t.abi,{moduleAddress:s,moduleName:f,functionName:d}=$b(t.function),h=GI(t.typeArguments);if(h.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${h.length}`);let E=t.functionArguments.map((R,q)=>ZI(t.function,e,R,q,h));if(E.length!==e.parameters.length)throw new Error(`Too few arguments for '${s}::${f}::${d}', expected ${e.parameters.length} but got ${E.length}`);let P=k1.build(`${s}::${f}`,d,h,E);if("multisigAddress"in t){let R=fr.from(t.multisigAddress);return new QI(new tB(R,new nB(P)))}return new JI(P)}async function UU(t){let{moduleAddress:e,moduleName:s,functionName:f}=$b(t.function),d=await uB({key:"view-function",moduleAddress:e,moduleName:s,functionName:f,aptosConfig:t.aptosConfig,abi:t.abi,fetch:BU});return DU({abi:d,...t})}function DU(t){let e=t.abi,{moduleAddress:s,moduleName:f,functionName:d}=$b(t.function),h=GI(t.typeArguments);if(h.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${h.length}`);let E=t?.functionArguments?.map((P,R)=>ZI(t.function,e,P,R,h))??[];if(E.length!==e.parameters.length)throw new Error(`Too few arguments for '${s}::${f}::${d}', expected ${e.parameters.length} but got ${E.length}`);return k1.build(`${s}::${f}`,d,h,E)}function LU(t){return new YI(new eB(Qs.fromHexInput(t.bytecode).toUint8Array(),t.typeArguments??[],t.functionArguments))}async function FU(t){let{aptosConfig:e,sender:s,payload:f,options:d,feePayerAddress:h}=t,E=sB[e.network]?Promise.resolve({chain_id:sB[e.network]}):wA({aptosConfig:e}),P=d?.gasUnitPrice?Promise.resolve({gas_estimate:d.gasUnitPrice}):BA({aptosConfig:e}),[{chain_id:R},{gas_estimate:q}]=await Promise.all([E,P]),te=d?.accountSequenceNumber!==void 0?Promise.resolve({sequence_number:d.accountSequenceNumber}):Wh({aptosConfig:e,accountAddress:s}),ne;if(h&&fr.from(h).equals(fr.ZERO))try{let{sequence_number:pe}=await te;ne=pe}catch{ne="0"}else{let{sequence_number:pe}=await te;ne=pe}let{maxGasAmount:ue,gasUnitPrice:ge,expireTimestamp:xe}={maxGasAmount:d?.maxGasAmount?BigInt(d.maxGasAmount):BigInt(2e5),gasUnitPrice:BigInt(q),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+20),...d};return new ud(fr.from(s),BigInt(ne),f,BigInt(ue),BigInt(ge),BigInt(xe),new rB(R))}async function oB(t){let{aptosConfig:e,sender:s,payload:f,options:d,feePayerAddress:h}=t,E=await FU({aptosConfig:e,sender:s,payload:f,options:d,feePayerAddress:h});if("secondarySignerAddresses"in t){let P=t.secondarySignerAddresses?.map(R=>fr.from(R))??[];return{rawTransaction:E,secondarySignerAddresses:P,feePayerAddress:t.feePayerAddress?fr.from(t.feePayerAddress):void 0}}return{rawTransaction:E,feePayerAddress:t.feePayerAddress?fr.from(t.feePayerAddress):void 0}}function jU(t){let{signerPublicKey:e,transaction:s,secondarySignersPublicKeys:f,feePayerPublicKey:d}=t,h=T1(e);if(s.feePayerAddress){let P=new qh(s.rawTransaction,s.secondarySignerAddresses??[],s.feePayerAddress),R=[];f&&(R=f.map(ne=>T1(ne)));let q=T1(d),te=new r6(h,s.secondarySignerAddresses??[],R,{address:s.feePayerAddress,authenticator:q});return new ld(P.raw_txn,te).bcsToBytes()}if(s.secondarySignerAddresses){let P=new Gh(s.rawTransaction,s.secondarySignerAddresses),R=[];R=f.map(te=>T1(te));let q=new n6(h,s.secondarySignerAddresses,R);return new ld(P.raw_txn,q).bcsToBytes()}let E;if(h instanceof Vh)E=new t6(h.public_key,h.signature);else if(h instanceof cd)E=new i6(h);else throw new Error("Invalid public key");return new ld(s.rawTransaction,E).bcsToBytes()}function T1(t){if(t instanceof ad){if(t.publicKey instanceof oa)return new cd(t,new Hu(new aa(new Uint8Array(64))));if(t.publicKey instanceof bg)return new cd(t,new Hu(new vg(new Uint8Array(64))))}return new Vh(new oa(t.toUint8Array()),new aa(new Uint8Array(64)))}function zU(t){let{signer:e,transaction:s}=t,f=cB(s);return e.signWithAuthenticator(f)}function HU(t){let{transaction:e,senderAuthenticator:s,feePayerAuthenticator:f,additionalSignersAuthenticators:d}=t,h=aB(e);if((f||d)&&(h instanceof Gh||h instanceof qh))return KU(h,s,f,d);if(s instanceof Vh&&h instanceof ud){let E=new t6(s.public_key,s.signature);return new ld(h,E).bcsToBytes()}if((s instanceof cd||s instanceof YE)&&h instanceof ud){let E=new i6(s);return new ld(h,E).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${s} is not a supported account authentication scheme`)}function aB(t){return t.feePayerAddress?new qh(t.rawTransaction,t.secondarySignerAddresses??[],t.feePayerAddress):t.secondarySignerAddresses?new Gh(t.rawTransaction,t.secondarySignerAddresses):t.rawTransaction}function KU(t,e,s,f){if(t instanceof qh){if(!s)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let d=new r6(e,t.secondary_signer_addresses,f??[],{address:t.fee_payer_address,authenticator:s});return new ld(t.raw_txn,d).bcsToBytes()}if(t instanceof Gh){if(!f)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let d=new n6(e,t.secondary_signer_addresses,f??[]);return new ld(t.raw_txn,d).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof t} transaction is not supported`)}function cB(t){let e=aB(t),s=Qb.create();if(e instanceof ud)s.update(JM);else if(e instanceof Gh)s.update(IA);else if(e instanceof qh)s.update(IA);else throw new Error(`Unknown transaction type to sign on: ${e}`);let f=s.digest(),d=e.bcsToBytes(),h=new Uint8Array(f.length+d.length);return h.set(f),h.set(d,f.length),h}async function uB({key:t,moduleAddress:e,moduleName:s,functionName:f,aptosConfig:d,abi:h,fetch:E}){return h||N_(async()=>E(e,s,f,d),`${t}-${d.network}-${e}-${s}-${f}`,1e3*60*5)()}var $U=class extends Ri{constructor(t){super(),this.accountAddress=fr.ONE,this.moduleName=new vs("account"),this.structName=new vs("RotationProofChallenge"),this.sequenceNumber=new Ru(t.sequenceNumber),this.originator=t.originator,this.currentAuthKey=t.currentAuthKey,this.newPublicKey=ps.U8(t.newPublicKey.toUint8Array())}serialize(t){t.serialize(this.accountAddress),t.serialize(this.moduleName),t.serialize(this.structName),t.serialize(this.sequenceNumber),t.serialize(this.originator),t.serialize(this.currentAuthKey),t.serialize(this.newPublicKey)}};async function Vi(t){let e=await VU(t);return WU(t,e)}async function VU(t){let{aptosConfig:e,data:s}=t,f,d;return"bytecode"in s?d=await o6(s):"multisigAddress"in s?(f={aptosConfig:e,multisigAddress:s.multisigAddress,function:s.function,functionArguments:s.functionArguments,typeArguments:s.typeArguments},d=await o6(f)):(f={aptosConfig:e,function:s.function,functionArguments:s.functionArguments,typeArguments:s.typeArguments},d=await o6(f)),d}async function WU(t,e){let{aptosConfig:s,sender:f,options:d}=t,h;if(GU(t)&&(h=fr.ZERO.toString()),qU(t)){let{secondarySignerAddresses:E}=t;return oB({aptosConfig:s,sender:f,payload:e,options:d,secondarySignerAddresses:E,feePayerAddress:h})}return oB({aptosConfig:s,sender:f,payload:e,options:d,feePayerAddress:h})}function GU(t){return t.withFeePayer===!0}function qU(t){return"secondarySignerAddresses"in t}function ZU(t){let{transaction:e}=t;return cB(e)}function a6(t){return zU({...t})}async function lB(t){let{aptosConfig:e,transaction:s,signerPublicKey:f,secondarySignersPublicKeys:d,feePayerPublicKey:h,options:E}=t,P=jU({transaction:s,signerPublicKey:f,secondarySignersPublicKeys:d,feePayerPublicKey:h,options:E}),{data:R}=await Fb({aptosConfig:e,body:P,path:"transactions/simulate",params:{estimate_gas_unit_price:t.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:t.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:t.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return R}async function c6(t){let{aptosConfig:e}=t,s=HU({...t}),{data:f}=await Fb({aptosConfig:e,body:s,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return f}async function u6(t){let{aptosConfig:e,signer:s,transaction:f}=t,d=a6({signer:s,transaction:f});return c6({aptosConfig:e,transaction:f,senderAuthenticator:d})}var XU={typeParameters:[],parameters:[Hs.u8(),new Hs(Hs.u8())]};async function YU(t){let{aptosConfig:e,account:s,metadataBytes:f,moduleBytecode:d,options:h}=t,E=d.map(P=>ps.U8(P));return Vi({aptosConfig:e,sender:fr.from(s),data:{function:"0x1::code::publish_package_txn",functionArguments:[ps.U8(f),new ps(E)],abi:XU},options:h})}var JU={typeParameters:[],parameters:[new kh,Hs.u8(),new kh,Hs.u8(),Hs.u8(),Hs.u8()]};async function QU(t){let{aptosConfig:e,fromAccount:s,toNewPrivateKey:f}=t,d=await Wh({aptosConfig:e,accountAddress:s.accountAddress}),h=I1.fromPrivateKey({privateKey:f,legacy:!0}),E=new $U({sequenceNumber:BigInt(d.sequence_number),originator:s.accountAddress,currentAuthKey:fr.from(d.authentication_key),newPublicKey:h.publicKey}).bcsToBytes(),P=s.sign(E),R=h.sign(E),q=await Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new Ou(s.signingScheme),ps.U8(s.publicKey.toUint8Array()),new Ou(h.signingScheme),ps.U8(h.publicKey.toUint8Array()),ps.U8(P.toUint8Array()),ps.U8(R.toUint8Array())],abi:JU}});return u6({aptosConfig:e,signer:s,transaction:q})}async function fB(t){let{aptosConfig:e,options:s}=t,f={query:pA,variables:{where_condition:s?.where,limit:s?.limit,offset:s?.offset}};return(await Fi({aptosConfig:e,query:f,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function eD(t){let{aptosConfig:e,options:s}=t,f={query:hA,variables:{where_condition:s?.where,limit:s?.limit,offset:s?.offset}};return(await Fi({aptosConfig:e,query:f,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function tD(t){let{aptosConfig:e,options:s}=t,f={query:lA,variables:{where_condition:s?.where,limit:s?.limit,offset:s?.offset}};return(await Fi({aptosConfig:e,query:f,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var nD={typeParameters:[],parameters:[Ch("0x1::object::Object"),new Gf,new Rl]};async function rD(t){let{aptosConfig:e,sender:s,fungibleAssetMetadataAddress:f,recipient:d,amount:h,options:E}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[f,d,h],abi:nD},options:E})}var dB=class{constructor(t){this.config=t}async getFungibleAssetMetadata(t){return await qi({config:this.config,minimumLedgerVersion:t?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),fB({aptosConfig:this.config,...t})}async getFungibleAssetMetadataByAssetType(t){return await qi({config:this.config,minimumLedgerVersion:t?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await fB({aptosConfig:this.config,options:{where:{asset_type:{_eq:t.assetType}}}}))[0]}async getFungibleAssetActivities(t){return await qi({config:this.config,minimumLedgerVersion:t?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),eD({aptosConfig:this.config,...t})}async getCurrentFungibleAssetBalances(t){return await qi({config:this.config,minimumLedgerVersion:t?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),tD({aptosConfig:this.config,...t})}async transferFungibleAsset(t){return rD({aptosConfig:this.config,...t})}};async function Xh(t){let{aptosConfig:e,payload:s,options:f}=t,d=await UU({...s,aptosConfig:e}),h=new Pu;d.serialize(h);let E=h.toUint8Array(),{data:P}=await Fb({aptosConfig:e,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:f?.ledgerVersion},body:E});return P}var hB=class{constructor(t){this.config=t}async getLedgerInfo(){return wA({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(t){return KM({aptosConfig:this.config,...t})}async getBlockByHeight(t){return $M({aptosConfig:this.config,...t})}async getTableItem(t){return _A({aptosConfig:this.config,...t})}async view(t){return Xh({aptosConfig:this.config,...t})}async getChainTopUserTransactions(t){return VM({aptosConfig:this.config,...t})}async queryIndexer(t){return Fi({aptosConfig:this.config,...t})}async getIndexerLastSuccessVersion(){return EA({aptosConfig:this.config})}async getProcessorStatus(t){return SA({aptosConfig:this.config,processorType:t})}};async function iD(t){let{aptosConfig:e,poolAddress:s}=t,f=fr.from(s).toStringLong(),d=await Fi({aptosConfig:e,query:{query:P_,variables:{where_condition:{pool_address:{_eq:f}}}}});return d.num_active_delegator_per_pool[0]?d.num_active_delegator_per_pool[0].num_active_delegator:0}async function sD(t){let{aptosConfig:e,options:s}=t,f={query:P_,variables:{order_by:s?.orderBy}};return(await Fi({aptosConfig:e,query:f})).num_active_delegator_per_pool}async function oD(t){let{aptosConfig:e,delegatorAddress:s,poolAddress:f}=t,d={query:fA,variables:{delegatorAddress:fr.from(s).toStringLong(),poolAddress:fr.from(f).toStringLong()}};return(await Fi({aptosConfig:e,query:d})).delegated_staking_activities}var pB=class{constructor(t){this.config=t}async getNumberOfDelegators(t){return await qi({config:this.config,minimumLedgerVersion:t?.minimumLedgerVersion,processorType:"stake_processor"}),iD({aptosConfig:this.config,...t})}async getNumberOfDelegatorsForAllPools(t){return await qi({config:this.config,minimumLedgerVersion:t?.minimumLedgerVersion,processorType:"stake_processor"}),sD({aptosConfig:this.config,...t})}async getDelegatedStakingActivities(t){return await qi({config:this.config,minimumLedgerVersion:t?.minimumLedgerVersion,processorType:"stake_processor"}),oD({aptosConfig:this.config,...t})}};function gB(t,e,s){let f=s.value;return s.value=async function(...d){let[h]=d;if(h.transaction.feePayerAddress&&!h.feePayerAuthenticator)throw new Error("You are submitting a Fee Payer transaction but missing the feePayerAuthenticator");return f.apply(this,d)},s}function yB(t,e,s){let f=s.value;return s.value=async function(...d){let[h]=d;if(h.transaction.feePayerAddress&&!h.feePayerPublicKey)throw new Error("You are simulating a Fee Payer transaction but missing the feePayerPublicKey");return f.apply(this,d)},s}var l6=class{constructor(t){this.config=t}async simple(t){return lB({aptosConfig:this.config,...t})}async multiAgent(t){return lB({aptosConfig:this.config,...t})}};pc([yB],l6.prototype,"simple",1),pc([yB],l6.prototype,"multiAgent",1);var f6=class{constructor(t){this.config=t}async simple(t){return c6({aptosConfig:this.config,...t})}async multiAgent(t){return c6({aptosConfig:this.config,...t})}};pc([gB],f6.prototype,"simple",1),pc([gB],f6.prototype,"multiAgent",1);var aD=class{constructor(t){this.config=t}async simple(t){return Vi({aptosConfig:this.config,...t})}async multiAgent(t){return Vi({aptosConfig:this.config,...t})}},C1=()=>Math.floor(Date.now()/1e3),cD=class{constructor(t,e,s,f,d){this.lastUncommintedNumber=null,this.currentNumber=null,this.lock=!1,this.aptosConfig=t,this.account=e,this.maxWaitTime=s,this.maximumInFlight=f,this.sleepTime=d}async nextSequenceNumber(){for(;this.lock;)await Ih(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let e=C1();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await Ih(this.sleepTime),C1()-e>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(e){console.error("error in getting next sequence number for this account",e)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await Wh({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await Wh({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await Ih(this.sleepTime);this.lock=!0;try{await this.update();let t=C1();for(;this.lastUncommintedNumber!==this.currentNumber;)C1()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await Ih(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}},d6=class{constructor(){this.queue=[],this.pendingDequeue=[],this.cancelled=!1}enqueue(t){if(this.cancelled=!1,this.pendingDequeue.length>0){this.pendingDequeue.shift()?.resolve(t);return}this.queue.push(t)}async dequeue(){return this.queue.length>0?Promise.resolve(this.queue.shift()):new Promise((t,e)=>{this.pendingDequeue.push({resolve:t,reject:e})})}isEmpty(){return this.queue.length===0}cancel(){this.cancelled=!0,this.pendingDequeue.forEach(async({reject:t})=>{t(new h6("Task cancelled"))}),this.pendingDequeue=[],this.queue.length=0}isCancelled(){return this.cancelled}pendingDequeueLength(){return this.pendingDequeue.length}},h6=class extends Error{},mB="fulfilled",uD=(t=>(t.TransactionSent="transactionSent",t.TransactionSendFailed="transactionSendFailed",t.TransactionExecuted="transactionExecuted",t.TransactionExecutionFailed="transactionExecutionFailed",t.ExecutionFinish="executionFinish",t))(uD||{}),lD=class extends Yt{constructor(t,e,s=30,f=100,d=10){super(),this.taskQueue=new d6,this.transactionsQueue=new d6,this.outstandingTransactions=new d6,this.sentTransactions=[],this.executedTransactions=[],this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new cD(t,e,s,f,d)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let s=u6({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([s,t])}}catch(t){if(t instanceof h6)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[s,f]=await this.outstandingTransactions.dequeue();for(t.push(s),e.push(f);!this.outstandingTransactions.isEmpty();)[s,f]=await this.outstandingTransactions.dequeue(),t.push(s),e.push(f);let d=await Promise.allSettled(t);for(let h=0;h<d.length&&h<e.length;h+=1){let E=d[h];f=e[h],E.status===mB?(this.sentTransactions.push([E.value.hash,f,null]),this.emit("transactionSent",{message:`transaction hash ${E.value.hash} has been committed to chain`,transactionHash:E.value.hash}),await this.checkTransaction(E,f)):(this.sentTransactions.push([E.status,f,E.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${E.reason}`,error:E.reason}))}this.emit("executionFinish",{message:`execute ${d.length} transactions finished`})}}catch(t){if(t instanceof h6)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let s=[];s.push(D_({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let f=await Promise.allSettled(s);for(let d=0;d<f.length;d+=1){let h=f[d];h.status===mB?(this.executedTransactions.push([h.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${h.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([h.status,e,h.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${h.reason}`,error:h.reason}))}}catch(s){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${s}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[s,f]=await this.transactionsQueue.dequeue();return Vi({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:s,options:{...f,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}},fD=class extends Yt{constructor(t){super(),this.config=t}start(t){let{sender:e}=t;this.account=e,this.transactionWorker=new lD(this.config,e),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:e,options:s}=t;for(let f of e)this.transactionWorker.push(f,s)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:e,data:s,options:f}=t;this.start({sender:e}),this.push({data:s,options:f})}catch(e){throw new Error(`failed to submit transactions with error: ${e}`)}}},bB=class{constructor(t){this.config=t,this.build=new aD(this.config),this.simulate=new l6(this.config),this.submit=new f6(this.config),this.batch=new fD(this.config)}async getTransactions(t){return eO({aptosConfig:this.config,...t})}async getTransactionByVersion(t){return tO({aptosConfig:this.config,...t})}async getTransactionByHash(t){return U_({aptosConfig:this.config,...t})}async isPendingTransaction(t){return nO({aptosConfig:this.config,...t})}async waitForTransaction(t){return D_({aptosConfig:this.config,...t})}async getGasPriceEstimation(){return BA({aptosConfig:this.config})}getSigningMessage(t){return ZU(t)}async publishPackageTransaction(t){return YU({aptosConfig:this.config,...t})}async rotateAuthKey(t){return QU({aptosConfig:this.config,...t})}sign(t){return a6({...t})}signAsFeePayer(t){let{signer:e,transaction:s}=t;if(!s.feePayerAddress)throw new Error(`Transaction ${s} is not a Fee Payer transaction`);return s.feePayerAddress=e.accountAddress,a6({signer:e,transaction:s})}async batchTransactionsForSingleAccount(t){try{let{sender:e,data:s,options:f}=t;this.batch.forSingleAccount({sender:e,data:s,options:f})}catch(e){throw new Error(`failed to submit transactions with error: ${e}`)}}async signAndSubmitTransaction(t){let{signer:e,transaction:s}=t;return u6({aptosConfig:this.config,signer:e,transaction:s})}},vB=class{constructor(t){this.config=t}async getAccountInfo(t){return Wh({aptosConfig:this.config,...t})}async getAccountModules(t){return hU({aptosConfig:this.config,...t})}async getAccountModule(t){return zI({aptosConfig:this.config,...t})}async getAccountTransactions(t){return pU({aptosConfig:this.config,...t})}async getAccountResources(t){return gU({aptosConfig:this.config,...t})}async getAccountResource(t){return KI({aptosConfig:this.config,...t})}async lookupOriginalAccountAddress(t){return $I({aptosConfig:this.config,...t})}async getAccountTokensCount(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"account_transactions_processor"}),yU({aptosConfig:this.config,...t})}async getAccountOwnedTokens(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),mU({aptosConfig:this.config,...t})}async getAccountOwnedTokensFromCollectionAddress(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),bU({aptosConfig:this.config,...t})}async getAccountCollectionsWithOwnedTokens(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),vU({aptosConfig:this.config,...t})}async getAccountTransactionsCount(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"account_transactions_processor"}),wU({aptosConfig:this.config,...t})}async getAccountCoinsData(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"fungible_asset_processor"}),VI({aptosConfig:this.config,...t})}async getAccountCoinsCount(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"fungible_asset_processor"}),EU({aptosConfig:this.config,...t})}async getAccountAPTAmount(t){return this.getAccountCoinAmount({coinType:xA,...t})}async getAccountCoinAmount(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"fungible_asset_processor"}),_U({aptosConfig:this.config,...t})}async getAccountOwnedObjects(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"default_processor"}),SU({aptosConfig:this.config,...t})}async deriveAccountFromPrivateKey(t){return AU({aptosConfig:this.config,...t})}},wB=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function _B(t){return!(!t||t.length<3||t.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(t))}function Zl(t){let[e,s,...f]=t.replace(/\.apt$/,"").split(".");if(f.length>0)throw new Error(`${t} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!_B(e))throw new Error(`${e} is not valid. ${wB}`);if(s&&!_B(s))throw new Error(`${s} is not valid. ${wB}`);return{domainName:s||e,subdomainName:s?e:void 0}}var LX="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",dD="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",hD={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:dD,custom:null,devnet:null,randomnet:null};function Ku(t){let e=hD[t.network];if(!e)throw new Error(`The ANS contract is not deployed to ${t.network}`);return e}var P1=t=>{if(t&&typeof t=="object"&&"vec"in t&&Array.isArray(t.vec))return t.vec[0]};async function pD(t){let{aptosConfig:e,name:s}=t,f=Ku(e),{domainName:d,subdomainName:h}=Zl(s),E=await Xh({aptosConfig:e,payload:{function:`${f}::router::get_owner_addr`,functionArguments:[d,h]}}),P=P1(E[0]);return P?fr.from(P).toString():void 0}async function gD(t){let{aptosConfig:e,expiration:s,name:f,sender:d,targetAddress:h,toAddress:E,options:P,transferable:R}=t,q=Ku(e),{domainName:te,subdomainName:ne}=Zl(f),ue=s.policy==="subdomain:independent"||s.policy==="subdomain:follow-domain";if(ne&&!ue)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(ue&&!ne)throw new Error(`Policy is set to ${s.policy} but no subdomain was provided`);if(s.policy==="domain"){let pe=s.years??1;if(pe!==1)throw new Error("For now, names can only be registered for 1 year at a time");let Se=pe*31536e3;return await Vi({aptosConfig:e,sender:d.accountAddress.toString(),data:{function:`${q}::router::register_domain`,functionArguments:[te,Se,h,E]},options:P})}if(!ne)throw new Error(`${s.policy} requires a subdomain to be provided.`);let ge=await EB({aptosConfig:e,name:te});if(!ge)throw new Error("The domain does not exist");let xe=s.policy==="subdomain:independent"?s.expirationDate:ge;if(xe>ge)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await Vi({aptosConfig:e,sender:d.accountAddress.toString(),data:{function:`${q}::router::register_subdomain`,functionArguments:[te,ne,Math.round(xe/1e3),s.policy==="subdomain:follow-domain"?1:0,!!R,h,E]},options:P})}async function EB(t){let{aptosConfig:e,name:s}=t,f=Ku(e),{domainName:d,subdomainName:h}=Zl(s);try{let E=await Xh({aptosConfig:e,payload:{function:`${f}::router::get_expiration`,functionArguments:[d,h]}});return Number(E[0])*1e3}catch{return}}async function yD(t){let{aptosConfig:e,address:s}=t,f=Ku(e),d=await Xh({aptosConfig:e,payload:{function:`${f}::router::get_primary_name`,functionArguments:[fr.from(s).toString()]}}),h=P1(d[1]),E=P1(d[0]);if(h)return[E,h].filter(Boolean).join(".")}async function mD(t){let{aptosConfig:e,sender:s,name:f,options:d}=t,h=Ku(e);if(!f)return await Vi({aptosConfig:e,sender:s.accountAddress.toString(),data:{function:`${h}::router::clear_primary_name`,functionArguments:[]},options:d});let{domainName:E,subdomainName:P}=Zl(f);return await Vi({aptosConfig:e,sender:s.accountAddress.toString(),data:{function:`${h}::router::set_primary_name`,functionArguments:[E,P]},options:d})}async function bD(t){let{aptosConfig:e,name:s}=t,f=Ku(e),{domainName:d,subdomainName:h}=Zl(s),E=await Xh({aptosConfig:e,payload:{function:`${f}::router::get_target_addr`,functionArguments:[d,h]}}),P=P1(E[0]);return P?fr.from(P).toString():void 0}async function vD(t){let{aptosConfig:e,sender:s,name:f,address:d,options:h}=t,E=Ku(e),{domainName:P,subdomainName:R}=Zl(f);return await Vi({aptosConfig:e,sender:s.accountAddress.toString(),data:{function:`${E}::router::set_target_addr`,functionArguments:[P,R,d]},options:h})}async function wD(t){let{aptosConfig:e,name:s}=t,{domainName:f,subdomainName:d=""}=Zl(s),h=(await Fi({aptosConfig:e,query:{query:xh,variables:{where_condition:{domain:{_eq:f},subdomain:{_eq:d},is_active:{_eq:!0}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return h&&(h=_g(h)),h}async function _D(t){let{aptosConfig:e,options:s,accountAddress:f}=t,d=await p6({aptosConfig:e});return(await Fi({aptosConfig:e,originMethod:"getAccountNames",query:{query:xh,variables:{limit:s?.limit,offset:s?.offset,order_by:s?.orderBy,where_condition:{...t.options?.where??{},owner_address:{_eq:f.toString()},expiration_timestamp:{_gte:d}}}}})).current_aptos_names.map(_g)}async function ED(t){let{aptosConfig:e,options:s,accountAddress:f}=t,d=await p6({aptosConfig:e});return(await Fi({aptosConfig:e,originMethod:"getAccountDomains",query:{query:xh,variables:{limit:s?.limit,offset:s?.offset,order_by:s?.orderBy,where_condition:{...t.options?.where??{},owner_address:{_eq:f.toString()},expiration_timestamp:{_gte:d},subdomain:{_eq:""}}}}})).current_aptos_names.map(_g)}async function SD(t){let{aptosConfig:e,options:s,accountAddress:f}=t,d=await p6({aptosConfig:e});return(await Fi({aptosConfig:e,originMethod:"getAccountSubdomains",query:{query:xh,variables:{limit:s?.limit,offset:s?.offset,order_by:s?.orderBy,where_condition:{...t.options?.where??{},owner_address:{_eq:f.toString()},expiration_timestamp:{_gte:d},subdomain:{_neq:""}}}}})).current_aptos_names.map(_g)}async function AD(t){let{aptosConfig:e,options:s,domain:f}=t;return(await Fi({aptosConfig:e,originMethod:"getDomainSubdomains",query:{query:xh,variables:{limit:s?.limit,offset:s?.offset,order_by:s?.orderBy,where_condition:{...t.options?.where??{},domain:{_eq:f},subdomain:{_neq:""},is_active:{_eq:!0}}}}})).current_aptos_names.map(_g)}async function p6(t){let{aptosConfig:e}=t,s=Ku(e),[f]=await Xh({aptosConfig:e,payload:{function:`${s}::config::reregistration_grace_sec`,functionArguments:[]}}),d=f/60/60/24,h=()=>new Date;return new Date(h().setDate(h().getDate()-d)).toISOString()}async function xD(t){let{aptosConfig:e,sender:s,name:f,years:d=1,options:h}=t,E=Ku(e),P=d*31536e3,{domainName:R,subdomainName:q}=Zl(f);if(q)throw new Error("Subdomains cannot be renewed");if(d!==1)throw new Error("Currently, only 1 year renewals are supported");return await Vi({aptosConfig:e,sender:s.accountAddress.toString(),data:{function:`${E}::router::renew_domain`,functionArguments:[R,P]},options:h})}function _g(t){return{...t,expiration_timestamp:new Date(t.expiration_timestamp).getTime()}}var SB=class{constructor(t){this.config=t}async getOwnerAddress(t){return pD({aptosConfig:this.config,...t})}async getExpiration(t){return EB({aptosConfig:this.config,...t})}async getTargetAddress(t){return bD({aptosConfig:this.config,...t})}async setTargetAddress(t){return vD({aptosConfig:this.config,...t})}async getPrimaryName(t){return yD({aptosConfig:this.config,...t})}async setPrimaryName(t){return mD({aptosConfig:this.config,...t})}async registerName(t){return gD({aptosConfig:this.config,...t})}async renewDomain(t){return xD({aptosConfig:this.config,...t})}async getName(t){return wD({aptosConfig:this.config,...t})}async getAccountNames(t){return _D({aptosConfig:this.config,...t})}async getAccountDomains(t){return ED({aptosConfig:this.config,...t})}async getAccountSubdomains(t){return SD({aptosConfig:this.config,...t})}async getDomainSubdomains(t){return AD({aptosConfig:this.config,...t})}};function AB(t,e){return function(){return t.apply(e,arguments)}}var xB=Ar(85409);const{toString:ID}=Object.prototype,{getPrototypeOf:g6}=Object,M1=(t=>e=>{const s=ID.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),vc=t=>(t=t.toLowerCase(),e=>M1(e)===t),O1=t=>e=>typeof e===t,{isArray:Yh}=Array,Eg=O1("undefined");function BD(t){return t!==null&&!Eg(t)&&t.constructor!==null&&!Eg(t.constructor)&&Pa(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const IB=vc("ArrayBuffer");function kD(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&IB(t.buffer),e}const TD=O1("string"),Pa=O1("function"),BB=O1("number"),R1=t=>t!==null&&typeof t=="object",CD=t=>t===!0||t===!1,N1=t=>{if(M1(t)!=="object")return!1;const e=g6(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},PD=vc("Date"),MD=vc("File"),OD=vc("Blob"),RD=vc("FileList"),ND=t=>R1(t)&&Pa(t.pipe),UD=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Pa(t.append)&&((e=M1(t))==="formdata"||e==="object"&&Pa(t.toString)&&t.toString()==="[object FormData]"))},DD=vc("URLSearchParams"),[LD,FD,jD,zD]=["ReadableStream","Request","Response","Headers"].map(vc),HD=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sg(t,e,{allOwnKeys:s=!1}={}){if(t===null||typeof t>"u")return;let f,d;if(typeof t!="object"&&(t=[t]),Yh(t))for(f=0,d=t.length;f<d;f++)e.call(null,t[f],f,t);else{const h=s?Object.getOwnPropertyNames(t):Object.keys(t),E=h.length;let P;for(f=0;f<E;f++)P=h[f],e.call(null,t[P],P,t)}}function kB(t,e){e=e.toLowerCase();const s=Object.keys(t);let f=s.length,d;for(;f-- >0;)if(d=s[f],e===d.toLowerCase())return d;return null}const fd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,TB=t=>!Eg(t)&&t!==fd;function y6(){const{caseless:t}=TB(this)&&this||{},e={},s=(f,d)=>{const h=t&&kB(e,d)||d;N1(e[h])&&N1(f)?e[h]=y6(e[h],f):N1(f)?e[h]=y6({},f):Yh(f)?e[h]=f.slice():e[h]=f};for(let f=0,d=arguments.length;f<d;f++)arguments[f]&&Sg(arguments[f],s);return e}const KD=(t,e,s,{allOwnKeys:f}={})=>(Sg(e,(d,h)=>{s&&Pa(d)?t[h]=AB(d,s):t[h]=d},{allOwnKeys:f}),t),$D=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),VD=(t,e,s,f)=>{t.prototype=Object.create(e.prototype,f),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),s&&Object.assign(t.prototype,s)},WD=(t,e,s,f)=>{let d,h,E;const P={};if(e=e||{},t==null)return e;do{for(d=Object.getOwnPropertyNames(t),h=d.length;h-- >0;)E=d[h],(!f||f(E,t,e))&&!P[E]&&(e[E]=t[E],P[E]=!0);t=s!==!1&&g6(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},GD=(t,e,s)=>{t=String(t),(s===void 0||s>t.length)&&(s=t.length),s-=e.length;const f=t.indexOf(e,s);return f!==-1&&f===s},qD=t=>{if(!t)return null;if(Yh(t))return t;let e=t.length;if(!BB(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},ZD=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&g6(Uint8Array)),XD=(t,e)=>{const f=(t&&t[Symbol.iterator]).call(t);let d;for(;(d=f.next())&&!d.done;){const h=d.value;e.call(t,h[0],h[1])}},YD=(t,e)=>{let s;const f=[];for(;(s=t.exec(e))!==null;)f.push(s);return f},JD=vc("HTMLFormElement"),QD=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,f,d){return f.toUpperCase()+d}),CB=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),eL=vc("RegExp"),PB=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),f={};Sg(s,(d,h)=>{let E;(E=e(d,h,t))!==!1&&(f[h]=E||d)}),Object.defineProperties(t,f)},tL=t=>{PB(t,(e,s)=>{if(Pa(t)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const f=t[s];if(Pa(f)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},nL=(t,e)=>{const s={},f=d=>{d.forEach(h=>{s[h]=!0})};return Yh(t)?f(t):f(String(t).split(e)),s},rL=()=>{},iL=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,m6="abcdefghijklmnopqrstuvwxyz",MB="0123456789",OB={DIGIT:MB,ALPHA:m6,ALPHA_DIGIT:m6+m6.toUpperCase()+MB},sL=(t=16,e=OB.ALPHA_DIGIT)=>{let s="";const{length:f}=e;for(;t--;)s+=e[Math.random()*f|0];return s};function oL(t){return!!(t&&Pa(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const aL=t=>{const e=new Array(10),s=(f,d)=>{if(R1(f)){if(e.indexOf(f)>=0)return;if(!("toJSON"in f)){e[d]=f;const h=Yh(f)?[]:{};return Sg(f,(E,P)=>{const R=s(E,d+1);!Eg(R)&&(h[P]=R)}),e[d]=void 0,h}}return f};return s(t,0)},cL=vc("AsyncFunction"),uL=t=>t&&(R1(t)||Pa(t))&&Pa(t.then)&&Pa(t.catch),RB=((t,e)=>t?setImmediate:e?((s,f)=>(fd.addEventListener("message",({source:d,data:h})=>{d===fd&&h===s&&f.length&&f.shift()()},!1),d=>{f.push(d),fd.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",Pa(fd.postMessage)),lL=typeof queueMicrotask<"u"?queueMicrotask.bind(fd):typeof xB<"u"&&xB.nextTick||RB,En={isArray:Yh,isArrayBuffer:IB,isBuffer:BD,isFormData:UD,isArrayBufferView:kD,isString:TD,isNumber:BB,isBoolean:CD,isObject:R1,isPlainObject:N1,isReadableStream:LD,isRequest:FD,isResponse:jD,isHeaders:zD,isUndefined:Eg,isDate:PD,isFile:MD,isBlob:OD,isRegExp:eL,isFunction:Pa,isStream:ND,isURLSearchParams:DD,isTypedArray:ZD,isFileList:RD,forEach:Sg,merge:y6,extend:KD,trim:HD,stripBOM:$D,inherits:VD,toFlatObject:WD,kindOf:M1,kindOfTest:vc,endsWith:GD,toArray:qD,forEachEntry:XD,matchAll:YD,isHTMLForm:JD,hasOwnProperty:CB,hasOwnProp:CB,reduceDescriptors:PB,freezeMethods:tL,toObjectSet:nL,toCamelCase:QD,noop:rL,toFiniteNumber:iL,findKey:kB,global:fd,isContextDefined:TB,ALPHABET:OB,generateString:sL,isSpecCompliantForm:oL,toJSONObject:aL,isAsyncFn:cL,isThenable:uL,setImmediate:RB,asap:lL};function Jh(t,e,s,f,d){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),s&&(this.config=s),f&&(this.request=f),d&&(this.response=d)}En.inherits(Jh,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:En.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const NB=Jh.prototype,UB={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{UB[t]={value:t}}),Object.defineProperties(Jh,UB),Object.defineProperty(NB,"isAxiosError",{value:!0}),Jh.from=(t,e,s,f,d,h)=>{const E=Object.create(NB);return En.toFlatObject(t,E,function(R){return R!==Error.prototype},P=>P!=="isAxiosError"),Jh.call(E,t.message,e,s,f,d),E.cause=t,E.name=t.name,h&&Object.assign(E,h),E};const pi=Jh,DB=null;var fL=Ar(36533).Buffer;function b6(t){return En.isPlainObject(t)||En.isArray(t)}function LB(t){return En.endsWith(t,"[]")?t.slice(0,-2):t}function FB(t,e,s){return t?t.concat(e).map(function(d,h){return d=LB(d),!s&&h?"["+d+"]":d}).join(s?".":""):e}function dL(t){return En.isArray(t)&&!t.some(b6)}const hL=En.toFlatObject(En,{},null,function(e){return/^is[A-Z]/.test(e)});function pL(t,e,s){if(!En.isObject(t))throw new TypeError("target must be an object");e=e||new(DB||FormData),s=En.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(pe,Se){return!En.isUndefined(Se[pe])});const f=s.metaTokens,d=s.visitor||te,h=s.dots,E=s.indexes,R=(s.Blob||typeof Blob<"u"&&Blob)&&En.isSpecCompliantForm(e);if(!En.isFunction(d))throw new TypeError("visitor must be a function");function q(xe){if(xe===null)return"";if(En.isDate(xe))return xe.toISOString();if(!R&&En.isBlob(xe))throw new pi("Blob is not supported. Use a Buffer instead.");return En.isArrayBuffer(xe)||En.isTypedArray(xe)?R&&typeof Blob=="function"?new Blob([xe]):fL.from(xe):xe}function te(xe,pe,Se){let Ce=xe;if(xe&&!Se&&typeof xe=="object"){if(En.endsWith(pe,"{}"))pe=f?pe:pe.slice(0,-2),xe=JSON.stringify(xe);else if(En.isArray(xe)&&dL(xe)||(En.isFileList(xe)||En.endsWith(pe,"[]"))&&(Ce=En.toArray(xe)))return pe=LB(pe),Ce.forEach(function(We,xt){!(En.isUndefined(We)||We===null)&&e.append(E===!0?FB([pe],xt,h):E===null?pe:pe+"[]",q(We))}),!1}return b6(xe)?!0:(e.append(FB(Se,pe,h),q(xe)),!1)}const ne=[],ue=Object.assign(hL,{defaultVisitor:te,convertValue:q,isVisitable:b6});function ge(xe,pe){if(!En.isUndefined(xe)){if(ne.indexOf(xe)!==-1)throw Error("Circular reference detected in "+pe.join("."));ne.push(xe),En.forEach(xe,function(Ce,Fe){(!(En.isUndefined(Ce)||Ce===null)&&d.call(e,Ce,En.isString(Fe)?Fe.trim():Fe,pe,ue))===!0&&ge(Ce,pe?pe.concat(Fe):[Fe])}),ne.pop()}}if(!En.isObject(t))throw new TypeError("data must be an object");return ge(t),e}const U1=pL;function jB(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(f){return e[f]})}function zB(t,e){this._pairs=[],t&&U1(t,this,e)}const HB=zB.prototype;HB.append=function(e,s){this._pairs.push([e,s])},HB.toString=function(e){const s=e?function(f){return e.call(this,f,jB)}:jB;return this._pairs.map(function(d){return s(d[0])+"="+s(d[1])},"").join("&")};const KB=zB;function gL(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $B(t,e,s){if(!e)return t;const f=s&&s.encode||gL,d=s&&s.serialize;let h;if(d?h=d(e,s):h=En.isURLSearchParams(e)?e.toString():new KB(e,s).toString(f),h){const E=t.indexOf("#");E!==-1&&(t=t.slice(0,E)),t+=(t.indexOf("?")===-1?"?":"&")+h}return t}class yL{constructor(){this.handlers=[]}use(e,s,f){return this.handlers.push({fulfilled:e,rejected:s,synchronous:f?f.synchronous:!1,runWhen:f?f.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){En.forEach(this.handlers,function(f){f!==null&&e(f)})}}const VB=yL,WB={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mL={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:KB,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},v6=typeof document<"u",bL=(t=>v6&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),vL=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wL=v6&&window.location.href||"http://localhost",wc={...x,...mL};function _L(t,e){return U1(t,new wc.classes.URLSearchParams,Object.assign({visitor:function(s,f,d,h){return wc.isNode&&En.isBuffer(s)?(this.append(f,s.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},e))}function EL(t){return En.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function SL(t){const e={},s=Object.keys(t);let f;const d=s.length;let h;for(f=0;f<d;f++)h=s[f],e[h]=t[h];return e}function AL(t){function e(s,f,d,h){let E=s[h++];if(E==="__proto__")return!0;const P=Number.isFinite(+E),R=h>=s.length;return E=!E&&En.isArray(d)?d.length:E,R?(En.hasOwnProp(d,E)?d[E]=[d[E],f]:d[E]=f,!P):((!d[E]||!En.isObject(d[E]))&&(d[E]=[]),e(s,f,d[E],h)&&En.isArray(d[E])&&(d[E]=SL(d[E])),!P)}if(En.isFormData(t)&&En.isFunction(t.entries)){const s={};return En.forEachEntry(t,(f,d)=>{e(EL(f),d,s,0)}),s}return null}const GB=AL;function xL(t,e,s){if(En.isString(t))try{return(e||JSON.parse)(t),En.trim(t)}catch(f){if(f.name!=="SyntaxError")throw f}return(s||JSON.stringify)(t)}const w6={transitional:WB,adapter:["xhr","http","fetch"],transformRequest:[function(e,s){const f=s.getContentType()||"",d=f.indexOf("application/json")>-1,h=En.isObject(e);if(h&&En.isHTMLForm(e)&&(e=new FormData(e)),En.isFormData(e))return d?JSON.stringify(GB(e)):e;if(En.isArrayBuffer(e)||En.isBuffer(e)||En.isStream(e)||En.isFile(e)||En.isBlob(e)||En.isReadableStream(e))return e;if(En.isArrayBufferView(e))return e.buffer;if(En.isURLSearchParams(e))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let P;if(h){if(f.indexOf("application/x-www-form-urlencoded")>-1)return _L(e,this.formSerializer).toString();if((P=En.isFileList(e))||f.indexOf("multipart/form-data")>-1){const R=this.env&&this.env.FormData;return U1(P?{"files[]":e}:e,R&&new R,this.formSerializer)}}return h||d?(s.setContentType("application/json",!1),xL(e)):e}],transformResponse:[function(e){const s=this.transitional||w6.transitional,f=s&&s.forcedJSONParsing,d=this.responseType==="json";if(En.isResponse(e)||En.isReadableStream(e))return e;if(e&&En.isString(e)&&(f&&!this.responseType||d)){const E=!(s&&s.silentJSONParsing)&&d;try{return JSON.parse(e)}catch(P){if(E)throw P.name==="SyntaxError"?pi.from(P,pi.ERR_BAD_RESPONSE,this,null,this.response):P}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:wc.classes.FormData,Blob:wc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};En.forEach(["delete","get","head","post","put","patch"],t=>{w6.headers[t]={}});const _6=w6,IL=En.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),BL=t=>{const e={};let s,f,d;return t&&t.split(`
|
||
`).forEach(function(E){d=E.indexOf(":"),s=E.substring(0,d).trim().toLowerCase(),f=E.substring(d+1).trim(),!(!s||e[s]&&IL[s])&&(s==="set-cookie"?e[s]?e[s].push(f):e[s]=[f]:e[s]=e[s]?e[s]+", "+f:f)}),e},qB=Symbol("internals");function Ag(t){return t&&String(t).trim().toLowerCase()}function D1(t){return t===!1||t==null?t:En.isArray(t)?t.map(D1):String(t)}function kL(t){const e=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let f;for(;f=s.exec(t);)e[f[1]]=f[2];return e}const TL=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function E6(t,e,s,f,d){if(En.isFunction(f))return f.call(this,e,s);if(d&&(e=s),!!En.isString(e)){if(En.isString(f))return e.indexOf(f)!==-1;if(En.isRegExp(f))return f.test(e)}}function CL(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,f)=>s.toUpperCase()+f)}function PL(t,e){const s=En.toCamelCase(" "+e);["get","set","has"].forEach(f=>{Object.defineProperty(t,f+s,{value:function(d,h,E){return this[f].call(this,e,d,h,E)},configurable:!0})})}class L1{constructor(e){e&&this.set(e)}set(e,s,f){const d=this;function h(P,R,q){const te=Ag(R);if(!te)throw new Error("header name must be a non-empty string");const ne=En.findKey(d,te);(!ne||d[ne]===void 0||q===!0||q===void 0&&d[ne]!==!1)&&(d[ne||R]=D1(P))}const E=(P,R)=>En.forEach(P,(q,te)=>h(q,te,R));if(En.isPlainObject(e)||e instanceof this.constructor)E(e,s);else if(En.isString(e)&&(e=e.trim())&&!TL(e))E(BL(e),s);else if(En.isHeaders(e))for(const[P,R]of e.entries())h(R,P,f);else e!=null&&h(s,e,f);return this}get(e,s){if(e=Ag(e),e){const f=En.findKey(this,e);if(f){const d=this[f];if(!s)return d;if(s===!0)return kL(d);if(En.isFunction(s))return s.call(this,d,f);if(En.isRegExp(s))return s.exec(d);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,s){if(e=Ag(e),e){const f=En.findKey(this,e);return!!(f&&this[f]!==void 0&&(!s||E6(this,this[f],f,s)))}return!1}delete(e,s){const f=this;let d=!1;function h(E){if(E=Ag(E),E){const P=En.findKey(f,E);P&&(!s||E6(f,f[P],P,s))&&(delete f[P],d=!0)}}return En.isArray(e)?e.forEach(h):h(e),d}clear(e){const s=Object.keys(this);let f=s.length,d=!1;for(;f--;){const h=s[f];(!e||E6(this,this[h],h,e,!0))&&(delete this[h],d=!0)}return d}normalize(e){const s=this,f={};return En.forEach(this,(d,h)=>{const E=En.findKey(f,h);if(E){s[E]=D1(d),delete s[h];return}const P=e?CL(h):String(h).trim();P!==h&&delete s[h],s[P]=D1(d),f[P]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const s=Object.create(null);return En.forEach(this,(f,d)=>{f!=null&&f!==!1&&(s[d]=e&&En.isArray(f)?f.join(", "):f)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,s])=>e+": "+s).join(`
|
||
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...s){const f=new this(e);return s.forEach(d=>f.set(d)),f}static accessor(e){const f=(this[qB]=this[qB]={accessors:{}}).accessors,d=this.prototype;function h(E){const P=Ag(E);f[P]||(PL(d,E),f[P]=!0)}return En.isArray(e)?e.forEach(h):h(e),this}}L1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),En.reduceDescriptors(L1.prototype,({value:t},e)=>{let s=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(f){this[s]=f}}}),En.freezeMethods(L1);const _c=L1;function S6(t,e){const s=this||_6,f=e||s,d=_c.from(f.headers);let h=f.data;return En.forEach(t,function(P){h=P.call(s,h,d.normalize(),e?e.status:void 0)}),d.normalize(),h}function ZB(t){return!!(t&&t.__CANCEL__)}function XB(t,e,s){pi.call(this,t??"canceled",pi.ERR_CANCELED,e,s),this.name="CanceledError"}En.inherits(XB,pi,{__CANCEL__:!0});const xg=XB;function YB(t,e,s){const f=s.config.validateStatus;!s.status||!f||f(s.status)?t(s):e(new pi("Request failed with status code "+s.status,[pi.ERR_BAD_REQUEST,pi.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function ML(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function OL(t,e){t=t||10;const s=new Array(t),f=new Array(t);let d=0,h=0,E;return e=e!==void 0?e:1e3,function(R){const q=Date.now(),te=f[h];E||(E=q),s[d]=R,f[d]=q;let ne=h,ue=0;for(;ne!==d;)ue+=s[ne++],ne=ne%t;if(d=(d+1)%t,d===h&&(h=(h+1)%t),q-E<e)return;const ge=te&&q-te;return ge?Math.round(ue*1e3/ge):void 0}}const RL=OL;function NL(t,e){let s=0,f=1e3/e,d,h;const E=(q,te=Date.now())=>{s=te,d=null,h&&(clearTimeout(h),h=null),t.apply(null,q)};return[(...q)=>{const te=Date.now(),ne=te-s;ne>=f?E(q,te):(d=q,h||(h=setTimeout(()=>{h=null,E(d)},f-ne)))},()=>d&&E(d)]}const UL=NL,F1=(t,e,s=3)=>{let f=0;const d=RL(50,250);return UL(h=>{const E=h.loaded,P=h.lengthComputable?h.total:void 0,R=E-f,q=d(R),te=E<=P;f=E;const ne={loaded:E,total:P,progress:P?E/P:void 0,bytes:R,rate:q||void 0,estimated:q&&P&&te?(P-E)/q:void 0,event:h,lengthComputable:P!=null,[e?"download":"upload"]:!0};t(ne)},s)},JB=(t,e)=>{const s=t!=null;return[f=>e[0]({lengthComputable:s,total:t,loaded:f}),e[1]]},QB=t=>(...e)=>En.asap(()=>t(...e)),DL=wc.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a");let f;function d(h){let E=h;return e&&(s.setAttribute("href",E),E=s.href),s.setAttribute("href",E),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return f=d(window.location.href),function(E){const P=En.isString(E)?d(E):E;return P.protocol===f.protocol&&P.host===f.host}}():function(){return function(){return!0}}(),LL=wc.hasStandardBrowserEnv?{write(t,e,s,f,d,h){const E=[t+"="+encodeURIComponent(e)];En.isNumber(s)&&E.push("expires="+new Date(s).toGMTString()),En.isString(f)&&E.push("path="+f),En.isString(d)&&E.push("domain="+d),h===!0&&E.push("secure"),document.cookie=E.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function FL(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function jL(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ek(t,e){return t&&!FL(e)?jL(t,e):e}const tk=t=>t instanceof _c?{...t}:t;function dd(t,e){e=e||{};const s={};function f(q,te,ne){return En.isPlainObject(q)&&En.isPlainObject(te)?En.merge.call({caseless:ne},q,te):En.isPlainObject(te)?En.merge({},te):En.isArray(te)?te.slice():te}function d(q,te,ne){if(En.isUndefined(te)){if(!En.isUndefined(q))return f(void 0,q,ne)}else return f(q,te,ne)}function h(q,te){if(!En.isUndefined(te))return f(void 0,te)}function E(q,te){if(En.isUndefined(te)){if(!En.isUndefined(q))return f(void 0,q)}else return f(void 0,te)}function P(q,te,ne){if(ne in e)return f(q,te);if(ne in t)return f(void 0,q)}const R={url:h,method:h,data:h,baseURL:E,transformRequest:E,transformResponse:E,paramsSerializer:E,timeout:E,timeoutMessage:E,withCredentials:E,withXSRFToken:E,adapter:E,responseType:E,xsrfCookieName:E,xsrfHeaderName:E,onUploadProgress:E,onDownloadProgress:E,decompress:E,maxContentLength:E,maxBodyLength:E,beforeRedirect:E,transport:E,httpAgent:E,httpsAgent:E,cancelToken:E,socketPath:E,responseEncoding:E,validateStatus:P,headers:(q,te)=>d(tk(q),tk(te),!0)};return En.forEach(Object.keys(Object.assign({},t,e)),function(te){const ne=R[te]||d,ue=ne(t[te],e[te],te);En.isUndefined(ue)&&ne!==P||(s[te]=ue)}),s}const nk=t=>{const e=dd({},t);let{data:s,withXSRFToken:f,xsrfHeaderName:d,xsrfCookieName:h,headers:E,auth:P}=e;e.headers=E=_c.from(E),e.url=$B(ek(e.baseURL,e.url),t.params,t.paramsSerializer),P&&E.set("Authorization","Basic "+btoa((P.username||"")+":"+(P.password?unescape(encodeURIComponent(P.password)):"")));let R;if(En.isFormData(s)){if(wc.hasStandardBrowserEnv||wc.hasStandardBrowserWebWorkerEnv)E.setContentType(void 0);else if((R=E.getContentType())!==!1){const[q,...te]=R?R.split(";").map(ne=>ne.trim()).filter(Boolean):[];E.setContentType([q||"multipart/form-data",...te].join("; "))}}if(wc.hasStandardBrowserEnv&&(f&&En.isFunction(f)&&(f=f(e)),f||f!==!1&&DL(e.url))){const q=d&&h&&LL.read(h);q&&E.set(d,q)}return e},zL=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(s,f){const d=nk(t);let h=d.data;const E=_c.from(d.headers).normalize();let{responseType:P,onUploadProgress:R,onDownloadProgress:q}=d,te,ne,ue,ge,xe;function pe(){ge&&ge(),xe&&xe(),d.cancelToken&&d.cancelToken.unsubscribe(te),d.signal&&d.signal.removeEventListener("abort",te)}let Se=new XMLHttpRequest;Se.open(d.method.toUpperCase(),d.url,!0),Se.timeout=d.timeout;function Ce(){if(!Se)return;const We=_c.from("getAllResponseHeaders"in Se&&Se.getAllResponseHeaders()),kt={data:!P||P==="text"||P==="json"?Se.responseText:Se.response,status:Se.status,statusText:Se.statusText,headers:We,config:t,request:Se};YB(function(Wt){s(Wt),pe()},function(Wt){f(Wt),pe()},kt),Se=null}"onloadend"in Se?Se.onloadend=Ce:Se.onreadystatechange=function(){!Se||Se.readyState!==4||Se.status===0&&!(Se.responseURL&&Se.responseURL.indexOf("file:")===0)||setTimeout(Ce)},Se.onabort=function(){Se&&(f(new pi("Request aborted",pi.ECONNABORTED,t,Se)),Se=null)},Se.onerror=function(){f(new pi("Network Error",pi.ERR_NETWORK,t,Se)),Se=null},Se.ontimeout=function(){let xt=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded";const kt=d.transitional||WB;d.timeoutErrorMessage&&(xt=d.timeoutErrorMessage),f(new pi(xt,kt.clarifyTimeoutError?pi.ETIMEDOUT:pi.ECONNABORTED,t,Se)),Se=null},h===void 0&&E.setContentType(null),"setRequestHeader"in Se&&En.forEach(E.toJSON(),function(xt,kt){Se.setRequestHeader(kt,xt)}),En.isUndefined(d.withCredentials)||(Se.withCredentials=!!d.withCredentials),P&&P!=="json"&&(Se.responseType=d.responseType),q&&([ue,xe]=F1(q,!0),Se.addEventListener("progress",ue)),R&&Se.upload&&([ne,ge]=F1(R),Se.upload.addEventListener("progress",ne),Se.upload.addEventListener("loadend",ge)),(d.cancelToken||d.signal)&&(te=We=>{Se&&(f(!We||We.type?new xg(null,t,Se):We),Se.abort(),Se=null)},d.cancelToken&&d.cancelToken.subscribe(te),d.signal&&(d.signal.aborted?te():d.signal.addEventListener("abort",te)));const Fe=ML(d.url);if(Fe&&wc.protocols.indexOf(Fe)===-1){f(new pi("Unsupported protocol "+Fe+":",pi.ERR_BAD_REQUEST,t));return}Se.send(h||null)})},HL=(t,e)=>{let s=new AbortController,f;const d=function(R){if(!f){f=!0,E();const q=R instanceof Error?R:this.reason;s.abort(q instanceof pi?q:new xg(q instanceof Error?q.message:q))}};let h=e&&setTimeout(()=>{d(new pi(`timeout ${e} of ms exceeded`,pi.ETIMEDOUT))},e);const E=()=>{t&&(h&&clearTimeout(h),h=null,t.forEach(R=>{R&&(R.removeEventListener?R.removeEventListener("abort",d):R.unsubscribe(d))}),t=null)};t.forEach(R=>R&&R.addEventListener&&R.addEventListener("abort",d));const{signal:P}=s;return P.unsubscribe=E,[P,()=>{h&&clearTimeout(h),h=null}]},KL=function*(t,e){let s=t.byteLength;if(!e||s<e){yield t;return}let f=0,d;for(;f<s;)d=f+e,yield t.slice(f,d),f=d},$L=async function*(t,e,s){for await(const f of t)yield*KL(ArrayBuffer.isView(f)?f:await s(String(f)),e)},rk=(t,e,s,f,d)=>{const h=$L(t,e,d);let E=0,P,R=q=>{P||(P=!0,f&&f(q))};return new ReadableStream({async pull(q){try{const{done:te,value:ne}=await h.next();if(te){R(),q.close();return}let ue=ne.byteLength;if(s){let ge=E+=ue;s(ge)}q.enqueue(new Uint8Array(ne))}catch(te){throw R(te),te}},cancel(q){return R(q),h.return()}},{highWaterMark:2})},j1=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ik=j1&&typeof ReadableStream=="function",A6=j1&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),sk=(t,...e)=>{try{return!!t(...e)}catch{return!1}},VL=ik&&sk(()=>{let t=!1;const e=new Request(wc.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),ok=64*1024,x6=ik&&sk(()=>En.isReadableStream(new Response("").body)),z1={stream:x6&&(t=>t.body)};j1&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!z1[e]&&(z1[e]=En.isFunction(t[e])?s=>s[e]():(s,f)=>{throw new pi(`Response type '${e}' is not supported`,pi.ERR_NOT_SUPPORT,f)})})})(new Response);const WL=async t=>{if(t==null)return 0;if(En.isBlob(t))return t.size;if(En.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(En.isArrayBufferView(t)||En.isArrayBuffer(t))return t.byteLength;if(En.isURLSearchParams(t)&&(t=t+""),En.isString(t))return(await A6(t)).byteLength},GL=async(t,e)=>{const s=En.toFiniteNumber(t.getContentLength());return s??WL(e)},I6={http:DB,xhr:zL,fetch:j1&&(async t=>{let{url:e,method:s,data:f,signal:d,cancelToken:h,timeout:E,onDownloadProgress:P,onUploadProgress:R,responseType:q,headers:te,withCredentials:ne="same-origin",fetchOptions:ue}=nk(t);q=q?(q+"").toLowerCase():"text";let[ge,xe]=d||h||E?HL([d,h],E):[],pe,Se;const Ce=()=>{!pe&&setTimeout(()=>{ge&&ge.unsubscribe()}),pe=!0};let Fe;try{if(R&&VL&&s!=="get"&&s!=="head"&&(Fe=await GL(te,f))!==0){let Bt=new Request(e,{method:"POST",body:f,duplex:"half"}),Wt;if(En.isFormData(f)&&(Wt=Bt.headers.get("content-type"))&&te.setContentType(Wt),Bt.body){const[Me,Ke]=JB(Fe,F1(QB(R)));f=rk(Bt.body,ok,Me,Ke,A6)}}En.isString(ne)||(ne=ne?"include":"omit"),Se=new Request(e,{...ue,signal:ge,method:s.toUpperCase(),headers:te.normalize().toJSON(),body:f,duplex:"half",credentials:ne});let We=await fetch(Se);const xt=x6&&(q==="stream"||q==="response");if(x6&&(P||xt)){const Bt={};["status","statusText","headers"].forEach(nt=>{Bt[nt]=We[nt]});const Wt=En.toFiniteNumber(We.headers.get("content-length")),[Me,Ke]=P&&JB(Wt,F1(QB(P),!0))||[];We=new Response(rk(We.body,ok,Me,()=>{Ke&&Ke(),xt&&Ce()},A6),Bt)}q=q||"text";let kt=await z1[En.findKey(z1,q)||"text"](We,t);return!xt&&Ce(),xe&&xe(),await new Promise((Bt,Wt)=>{YB(Bt,Wt,{data:kt,headers:_c.from(We.headers),status:We.status,statusText:We.statusText,config:t,request:Se})})}catch(We){throw Ce(),We&&We.name==="TypeError"&&/fetch/i.test(We.message)?Object.assign(new pi("Network Error",pi.ERR_NETWORK,t,Se),{cause:We.cause||We}):pi.from(We,We&&We.code,t,Se)}})};En.forEach(I6,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ak=t=>`- ${t}`,qL=t=>En.isFunction(t)||t===null||t===!1,ck={getAdapter:t=>{t=En.isArray(t)?t:[t];const{length:e}=t;let s,f;const d={};for(let h=0;h<e;h++){s=t[h];let E;if(f=s,!qL(s)&&(f=I6[(E=String(s)).toLowerCase()],f===void 0))throw new pi(`Unknown adapter '${E}'`);if(f)break;d[E||"#"+h]=f}if(!f){const h=Object.entries(d).map(([P,R])=>`adapter ${P} `+(R===!1?"is not supported by the environment":"is not available in the build"));let E=e?h.length>1?`since :
|
||
`+h.map(ak).join(`
|
||
`):" "+ak(h[0]):"as no adapter specified";throw new pi("There is no suitable adapter to dispatch the request "+E,"ERR_NOT_SUPPORT")}return f},adapters:I6};function B6(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new xg(null,t)}function uk(t){return B6(t),t.headers=_c.from(t.headers),t.data=S6.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ck.getAdapter(t.adapter||_6.adapter)(t).then(function(f){return B6(t),f.data=S6.call(t,t.transformResponse,f),f.headers=_c.from(f.headers),f},function(f){return ZB(f)||(B6(t),f&&f.response&&(f.response.data=S6.call(t,t.transformResponse,f.response),f.response.headers=_c.from(f.response.headers))),Promise.reject(f)})}const lk="1.7.4",k6={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{k6[t]=function(f){return typeof f===t||"a"+(e<1?"n ":" ")+t}});const fk={};k6.transitional=function(e,s,f){function d(h,E){return"[Axios v"+lk+"] Transitional option '"+h+"'"+E+(f?". "+f:"")}return(h,E,P)=>{if(e===!1)throw new pi(d(E," has been removed"+(s?" in "+s:"")),pi.ERR_DEPRECATED);return s&&!fk[E]&&(fk[E]=!0,console.warn(d(E," has been deprecated since v"+s+" and will be removed in the near future"))),e?e(h,E,P):!0}};function ZL(t,e,s){if(typeof t!="object")throw new pi("options must be an object",pi.ERR_BAD_OPTION_VALUE);const f=Object.keys(t);let d=f.length;for(;d-- >0;){const h=f[d],E=e[h];if(E){const P=t[h],R=P===void 0||E(P,h,t);if(R!==!0)throw new pi("option "+h+" must be "+R,pi.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new pi("Unknown option "+h,pi.ERR_BAD_OPTION)}}const T6={assertOptions:ZL,validators:k6},Xl=T6.validators;class H1{constructor(e){this.defaults=e,this.interceptors={request:new VB,response:new VB}}async request(e,s){try{return await this._request(e,s)}catch(f){if(f instanceof Error){let d;Error.captureStackTrace?Error.captureStackTrace(d={}):d=new Error;const h=d.stack?d.stack.replace(/^.+\n/,""):"";try{f.stack?h&&!String(f.stack).endsWith(h.replace(/^.+\n.+\n/,""))&&(f.stack+=`
|
||
`+h):f.stack=h}catch{}}throw f}}_request(e,s){typeof e=="string"?(s=s||{},s.url=e):s=e||{},s=dd(this.defaults,s);const{transitional:f,paramsSerializer:d,headers:h}=s;f!==void 0&&T6.assertOptions(f,{silentJSONParsing:Xl.transitional(Xl.boolean),forcedJSONParsing:Xl.transitional(Xl.boolean),clarifyTimeoutError:Xl.transitional(Xl.boolean)},!1),d!=null&&(En.isFunction(d)?s.paramsSerializer={serialize:d}:T6.assertOptions(d,{encode:Xl.function,serialize:Xl.function},!0)),s.method=(s.method||this.defaults.method||"get").toLowerCase();let E=h&&En.merge(h.common,h[s.method]);h&&En.forEach(["delete","get","head","post","put","patch","common"],xe=>{delete h[xe]}),s.headers=_c.concat(E,h);const P=[];let R=!0;this.interceptors.request.forEach(function(pe){typeof pe.runWhen=="function"&&pe.runWhen(s)===!1||(R=R&&pe.synchronous,P.unshift(pe.fulfilled,pe.rejected))});const q=[];this.interceptors.response.forEach(function(pe){q.push(pe.fulfilled,pe.rejected)});let te,ne=0,ue;if(!R){const xe=[uk.bind(this),void 0];for(xe.unshift.apply(xe,P),xe.push.apply(xe,q),ue=xe.length,te=Promise.resolve(s);ne<ue;)te=te.then(xe[ne++],xe[ne++]);return te}ue=P.length;let ge=s;for(ne=0;ne<ue;){const xe=P[ne++],pe=P[ne++];try{ge=xe(ge)}catch(Se){pe.call(this,Se);break}}try{te=uk.call(this,ge)}catch(xe){return Promise.reject(xe)}for(ne=0,ue=q.length;ne<ue;)te=te.then(q[ne++],q[ne++]);return te}getUri(e){e=dd(this.defaults,e);const s=ek(e.baseURL,e.url);return $B(s,e.params,e.paramsSerializer)}}En.forEach(["delete","get","head","options"],function(e){H1.prototype[e]=function(s,f){return this.request(dd(f||{},{method:e,url:s,data:(f||{}).data}))}}),En.forEach(["post","put","patch"],function(e){function s(f){return function(h,E,P){return this.request(dd(P||{},{method:e,headers:f?{"Content-Type":"multipart/form-data"}:{},url:h,data:E}))}}H1.prototype[e]=s(),H1.prototype[e+"Form"]=s(!0)});const K1=H1;class C6{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(h){s=h});const f=this;this.promise.then(d=>{if(!f._listeners)return;let h=f._listeners.length;for(;h-- >0;)f._listeners[h](d);f._listeners=null}),this.promise.then=d=>{let h;const E=new Promise(P=>{f.subscribe(P),h=P}).then(d);return E.cancel=function(){f.unsubscribe(h)},E},e(function(h,E,P){f.reason||(f.reason=new xg(h,E,P),s(f.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}static source(){let e;return{token:new C6(function(d){e=d}),cancel:e}}}const XL=C6;function YL(t){return function(s){return t.apply(null,s)}}function JL(t){return En.isObject(t)&&t.isAxiosError===!0}const P6={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(P6).forEach(([t,e])=>{P6[e]=t});const QL=P6;function dk(t){const e=new K1(t),s=AB(K1.prototype.request,e);return En.extend(s,K1.prototype,e,{allOwnKeys:!0}),En.extend(s,e,null,{allOwnKeys:!0}),s.create=function(d){return dk(dd(t,d))},s}const Ks=dk(_6);Ks.Axios=K1,Ks.CanceledError=xg,Ks.CancelToken=XL,Ks.isCancel=ZB,Ks.VERSION=lk,Ks.toFormData=U1,Ks.AxiosError=pi,Ks.Cancel=Ks.CanceledError,Ks.all=function(e){return Promise.all(e)},Ks.spread=YL,Ks.isAxiosError=JL,Ks.mergeConfig=dd,Ks.AxiosHeaders=_c,Ks.formToJSON=t=>GB(En.isHTMLForm(t)?new FormData(t):t),Ks.getAdapter=ck.getAdapter,Ks.HttpStatusCode=QL,Ks.default=Ks;const eF=Ks;async function tF(t){var e;const{params:s,method:f,url:d,headers:h,body:E,overrides:P}=t,R={headers:h,method:f,url:d,params:s,data:E,withCredentials:(e=P?.WITH_CREDENTIALS)!=null?e:!0};try{const q=await eF(R);return{status:q.status,statusText:q.statusText,data:q.data,headers:q.headers,config:q.config}}catch(q){const te=q;if(te.response)return te.response;throw q}}var nF=class{constructor(t){this.network=t?.network??"devnet",this.fullnode=t?.fullnode,this.faucet=t?.faucet,this.indexer=t?.indexer,this.client=t?.client??{provider:tF},this.clientConfig=t?.clientConfig??{},this.fullnodeConfig=t?.fullnodeConfig??{},this.indexerConfig=t?.indexerConfig??{},this.faucetConfig=t?.faucetConfig??{}}getRequestUrl(t){switch(t){case"Fullnode":if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return OU[this.network];case"Faucet":if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return RU[this.network];case"Indexer":if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return MU[this.network];default:throw Error(`apiType ${t} is not supported`)}}},rF={typeParameters:[{constraints:[]}],parameters:[new Gf,new Rl]};async function iF(t){let{aptosConfig:e,sender:s,recipient:f,amount:d,coinType:h,options:E}=t;return Vi({aptosConfig:e,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[h??xA],functionArguments:[f,d],abi:rF},options:E})}var hk=class{constructor(t){this.config=t}async transferCoinTransaction(t){return iF({aptosConfig:this.config,...t})}},Yl={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},Ga="0x4::token::Token";async function sF(t){let{aptosConfig:e,digitalAssetAddress:s}=t,f={token_data_id:{_eq:fr.from(s).toStringLong()}};return(await Fi({aptosConfig:e,query:{query:yA,variables:{where_condition:f}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function oF(t){let{aptosConfig:e,digitalAssetAddress:s}=t,f={token_data_id:{_eq:fr.from(s).toStringLong()},amount:{_gt:0}};return(await Fi({aptosConfig:e,query:{query:O_,variables:{where_condition:f}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function aF(t){let{aptosConfig:e,ownerAddress:s,options:f}=t,d={owner_address:{_eq:fr.from(s).toStringLong()},amount:{_gt:0}},h={query:O_,variables:{where_condition:d,offset:f?.offset,limit:f?.limit,order_by:f?.orderBy}};return(await Fi({aptosConfig:e,query:h,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function cF(t){let{aptosConfig:e,digitalAssetAddress:s,options:f}=t,d={token_data_id:{_eq:fr.from(s).toStringLong()}},h={query:gA,variables:{where_condition:d,offset:f?.offset,limit:f?.limit,order_by:f?.orderBy}};return(await Fi({aptosConfig:e,query:h,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var uF={typeParameters:[],parameters:[new ii(ss()),new Rl,new ii(ss()),new ii(ss()),new Ha,new Ha,new Ha,new Ha,new Ha,new Ha,new Ha,new Ha,new Ha,new Rl,new Rl]};async function lF(t){let{aptosConfig:e,options:s,creator:f}=t;return Vi({aptosConfig:e,sender:f.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new vs(t.description),new Ru(t.maxSupply??Nb),new vs(t.name),new vs(t.uri),new sa(t.mutableDescription??!0),new sa(t.mutableRoyalty??!0),new sa(t.mutableURI??!0),new sa(t.mutableTokenDescription??!0),new sa(t.mutableTokenName??!0),new sa(t.mutableTokenProperties??!0),new sa(t.mutableTokenURI??!0),new sa(t.tokensBurnableByCreator??!0),new sa(t.tokensFreezableByCreator??!0),new Ru(t.royaltyNumerator??0),new Ru(t.royaltyDenominator??1)],abi:uF},options:s})}async function pk(t){let{aptosConfig:e,creatorAddress:s,collectionName:f,options:d}=t,h=fr.from(s),E={collection_name:{_eq:f},creator_address:{_eq:h.toStringLong()}};return d?.tokenStandard&&(E.token_standard={_eq:d?.tokenStandard??"v2"}),(await Fi({aptosConfig:e,query:{query:C_,variables:{where_condition:E}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function fF(t){let{aptosConfig:e,collectionId:s}=t,f={collection_id:{_eq:fr.from(s).toStringLong()}};return(await Fi({aptosConfig:e,query:{query:C_,variables:{where_condition:f}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function dF(t){return(await pk(t)).collection_id}var hF={typeParameters:[],parameters:[new ii(ss()),new ii(ss()),new ii(ss()),new ii(ss()),new Hs(new ii(ss())),new Hs(new ii(ss())),new Hs(Hs.u8())]};async function pF(t){let{aptosConfig:e,options:s,creator:f,collection:d,description:h,name:E,uri:P,propertyKeys:R,propertyTypes:q,propertyValues:te}=t,ne=q?.map(ue=>Yl[ue]);return Vi({aptosConfig:e,sender:f.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new vs(d),new vs(h),new vs(E),new vs(P),ps.MoveString(R??[]),ps.MoveString(ne??[]),gk(te??[],ne??[])],abi:hF},options:s})}var gF={typeParameters:[{constraints:["key"]}],parameters:[new ii(Ka(new yo(0))),new Gf]};async function yF(t){let{aptosConfig:e,sender:s,digitalAssetAddress:f,recipient:d,digitalAssetType:h,options:E}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[h??Ga],functionArguments:[fr.from(f),fr.from(d)],abi:gF},options:E})}var mF={typeParameters:[],parameters:[new ii(ss()),new ii(ss()),new ii(ss()),new ii(ss()),new Hs(new ii(ss())),new Hs(new ii(ss())),new Hs(Hs.u8()),new Gf]};async function bF(t){let{aptosConfig:e,account:s,collection:f,description:d,name:h,uri:E,recipient:P,propertyKeys:R,propertyTypes:q,propertyValues:te,options:ne}=t;if(R?.length!==te?.length)throw new Error("Property keys and property values counts do not match");if(q?.length!==te?.length)throw new Error("Property types and property values counts do not match");let ue=q?.map(ge=>Yl[ge]);return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[f,d,h,E,ps.MoveString(R??[]),ps.MoveString(ue??[]),gk(te??[],ue??[]),P],abi:mF},options:ne})}var vF={typeParameters:[{constraints:["key"]}],parameters:[new ii(Ka(new yo(0)))]};async function wF(t){let{aptosConfig:e,creator:s,digitalAssetAddress:f,digitalAssetType:d,options:h}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[d??Ga],functionArguments:[fr.from(f)],abi:vF},options:h})}var _F={typeParameters:[{constraints:["key"]}],parameters:[new ii(Ka(new yo(0)))]};async function EF(t){let{aptosConfig:e,creator:s,digitalAssetAddress:f,digitalAssetType:d,options:h}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[d??Ga],functionArguments:[f],abi:_F},options:h})}var SF={typeParameters:[{constraints:["key"]}],parameters:[new ii(Ka(new yo(0)))]};async function AF(t){let{aptosConfig:e,creator:s,digitalAssetAddress:f,digitalAssetType:d,options:h}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[d??Ga],functionArguments:[f],abi:SF},options:h})}var xF={typeParameters:[{constraints:["key"]}],parameters:[new ii(Ka(new yo(0))),new ii(ss())]};async function IF(t){let{aptosConfig:e,creator:s,description:f,digitalAssetAddress:d,digitalAssetType:h,options:E}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[h??Ga],functionArguments:[fr.from(d),new vs(f)],abi:xF},options:E})}var BF={typeParameters:[{constraints:["key"]}],parameters:[new ii(Ka(new yo(0))),new ii(ss())]};async function kF(t){let{aptosConfig:e,creator:s,name:f,digitalAssetAddress:d,digitalAssetType:h,options:E}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[h??Ga],functionArguments:[fr.from(d),new vs(f)],abi:BF},options:E})}var TF={typeParameters:[{constraints:["key"]}],parameters:[new ii(Ka(new yo(0))),new ii(ss())]};async function CF(t){let{aptosConfig:e,creator:s,uri:f,digitalAssetAddress:d,digitalAssetType:h,options:E}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[h??Ga],functionArguments:[fr.from(d),new vs(f)],abi:TF},options:E})}var PF={typeParameters:[{constraints:["key"]}],parameters:[new ii(Ka(new yo(0))),new ii(ss()),new ii(ss()),Hs.u8()]};async function MF(t){let{aptosConfig:e,creator:s,propertyKey:f,propertyType:d,propertyValue:h,digitalAssetAddress:E,digitalAssetType:P,options:R}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[P??Ga],functionArguments:[fr.from(E),new vs(f),new vs(Yl[d]),ps.U8(M6(h,Yl[d]))],abi:PF},options:R})}var OF={typeParameters:[{constraints:["key"]}],parameters:[new ii(Ka(new yo(0))),new ii(ss())]};async function RF(t){let{aptosConfig:e,creator:s,propertyKey:f,digitalAssetAddress:d,digitalAssetType:h,options:E}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[h??Ga],functionArguments:[fr.from(d),new vs(f)],abi:OF},options:E})}var NF={typeParameters:[{constraints:["key"]}],parameters:[new ii(Ka(new yo(0))),new ii(ss()),new ii(ss()),Hs.u8()]};async function UF(t){let{aptosConfig:e,creator:s,propertyKey:f,propertyType:d,propertyValue:h,digitalAssetAddress:E,digitalAssetType:P,options:R}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[P??Ga],functionArguments:[fr.from(E),new vs(f),new vs(Yl[d]),M6(h,Yl[d])],abi:NF},options:R})}var DF={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new ii(Ka(new yo(0))),new ii(ss()),new yo(1)]};async function LF(t){let{aptosConfig:e,creator:s,propertyKey:f,propertyType:d,propertyValue:h,digitalAssetAddress:E,digitalAssetType:P,options:R}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[P??Ga,Yl[d]],functionArguments:[fr.from(E),new vs(f),h],abi:DF},options:R})}var FF={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new ii(Ka(new yo(0))),new ii(ss()),new yo(1)]};async function jF(t){let{aptosConfig:e,creator:s,propertyKey:f,propertyType:d,propertyValue:h,digitalAssetAddress:E,digitalAssetType:P,options:R}=t;return Vi({aptosConfig:e,sender:s.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[P??Ga,Yl[d]],functionArguments:[fr.from(E),new vs(f),h],abi:FF},options:R})}function gk(t,e){let s=new Array;return e.forEach((f,d)=>{s.push(M6(t[d],f))}),s}function M6(t,e){let s=Ch(e);return wg(t,s,0,[]).bcsToBytes()}var yk=class{constructor(t){this.config=t}async getCollectionData(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),pk({aptosConfig:this.config,...t})}async getCollectionDataByCollectionId(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),fF({aptosConfig:this.config,...t})}async getCollectionId(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),dF({aptosConfig:this.config,...t})}async getDigitalAssetData(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),sF({aptosConfig:this.config,...t})}async getCurrentDigitalAssetOwnership(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),oF({aptosConfig:this.config,...t})}async getOwnedDigitalAssets(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),aF({aptosConfig:this.config,...t})}async getDigitalAssetActivity(t){return await qi({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),cF({aptosConfig:this.config,...t})}async createCollectionTransaction(t){return lF({aptosConfig:this.config,...t})}async mintDigitalAssetTransaction(t){return pF({aptosConfig:this.config,...t})}async transferDigitalAssetTransaction(t){return yF({aptosConfig:this.config,...t})}async mintSoulBoundTransaction(t){return bF({aptosConfig:this.config,...t})}async burnDigitalAssetTransaction(t){return wF({aptosConfig:this.config,...t})}async freezeDigitalAssetTransaferTransaction(t){return EF({aptosConfig:this.config,...t})}async unfreezeDigitalAssetTransaferTransaction(t){return AF({aptosConfig:this.config,...t})}async setDigitalAssetDescriptionTransaction(t){return IF({aptosConfig:this.config,...t})}async setDigitalAssetNameTransaction(t){return kF({aptosConfig:this.config,...t})}async setDigitalAssetURITransaction(t){return CF({aptosConfig:this.config,...t})}async addDigitalAssetPropertyTransaction(t){return MF({aptosConfig:this.config,...t})}async removeDigitalAssetPropertyTransaction(t){return RF({aptosConfig:this.config,...t})}async updateDigitalAssetPropertyTransaction(t){return UF({aptosConfig:this.config,...t})}async addDigitalAssetTypedPropertyTransaction(t){return LF({aptosConfig:this.config,...t})}async updateDigitalAssetTypedPropertyTransaction(t){return jF({aptosConfig:this.config,...t})}},eu=class{constructor(t){this.config=new nF(t),this.account=new vB(this.config),this.ans=new SB(this.config),this.coin=new hk(this.config),this.digitalAsset=new yk(this.config),this.event=new CA(this.config),this.faucet=new PA(this.config),this.fungibleAsset=new dB(this.config),this.general=new hB(this.config),this.staking=new pB(this.config),this.transaction=new bB(this.config)}};function tu(t,e,s){Object.getOwnPropertyNames(e.prototype).forEach(f=>{let d=Object.getOwnPropertyDescriptor(e.prototype,f);d&&(d.value=function(...h){return this[s][f](...h)},Object.defineProperty(t.prototype,f,d))})}tu(eu,vB,"account"),tu(eu,SB,"ans"),tu(eu,hk,"coin"),tu(eu,yk,"digitalAsset"),tu(eu,CA,"event"),tu(eu,PA,"faucet"),tu(eu,dB,"fungibleAsset"),tu(eu,hB,"general"),tu(eu,pB,"staking"),tu(eu,bB,"transaction");var zF=Ar(36533).Buffer,HF=(t,e)=>{let s=t.bcsToBytes(),f=typeof e=="string"?zF.from(e,"utf8"):e,d=new Uint8Array([...s,...f,254]);return new o(n(d))},VX=(t,e,s)=>{let f=`${e}::${s}`;return HF(t,f)},KF=(t=>(t.JSON="application/json",t.BCS="application/x-bcs",t.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",t.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",t))(KF||{}),$F=(t=>(t[t.Bool=0]="Bool",t[t.U8=1]="U8",t[t.U64=2]="U64",t[t.U128=3]="U128",t[t.Address=4]="Address",t[t.Signer=5]="Signer",t[t.Vector=6]="Vector",t[t.Struct=7]="Struct",t[t.U16=8]="U16",t[t.U32=9]="U32",t[t.U256=10]="U256",t[t.Reference=254]="Reference",t[t.Generic=255]="Generic",t))($F||{}),VF=(t=>(t[t.U8=0]="U8",t[t.U64=1]="U64",t[t.U128=2]="U128",t[t.Address=3]="Address",t[t.U8Vector=4]="U8Vector",t[t.Bool=5]="Bool",t[t.U16=6]="U16",t[t.U32=7]="U32",t[t.U256=8]="U256",t))(VF||{}),WF=(t=>(t[t.Script=0]="Script",t[t.EntryFunction=2]="EntryFunction",t[t.Multisig=3]="Multisig",t))(WF||{}),GF=(t=>(t[t.MultiAgentTransaction=0]="MultiAgentTransaction",t[t.FeePayerTransaction=1]="FeePayerTransaction",t))(GF||{}),qF=(t=>(t[t.Ed25519=0]="Ed25519",t[t.MultiEd25519=1]="MultiEd25519",t[t.MultiAgent=2]="MultiAgent",t[t.FeePayer=3]="FeePayer",t[t.SingleSender=4]="SingleSender",t))(qF||{}),ZF=(t=>(t[t.Ed25519=0]="Ed25519",t[t.MultiEd25519=1]="MultiEd25519",t[t.SingleKey=2]="SingleKey",t[t.MultiKey=3]="MultiKey",t))(ZF||{}),XF=(t=>(t[t.Ed25519=0]="Ed25519",t[t.Secp256k1=1]="Secp256k1",t))(XF||{}),YF=(t=>(t[t.Ed25519=0]="Ed25519",t[t.Secp256k1=1]="Secp256k1",t))(YF||{}),JF=(t=>(t.Pending="pending_transaction",t.User="user_transaction",t.Genesis="genesis_transaction",t.BlockMetadata="block_metadata_transaction",t.StateCheckpoint="state_checkpoint_transaction",t.Validator="validator_transaction",t))(JF||{});function WX(t){return t.type==="pending_transaction"}function GX(t){return t.type==="user_transaction"}function qX(t){return t.type==="genesis_transaction"}function ZX(t){return t.type==="block_metadata_transaction"}function XX(t){return t.type==="state_checkpoint_transaction"}function YX(t){return t.type==="validator_transaction"}function JX(t){return"signature"in t&&t.signature==="ed25519_signature"}function QX(t){return"signature"in t&&t.signature==="secp256k1_ecdsa_signature"}function eY(t){return t.type==="multi_agent_signature"}function tY(t){return t.type==="fee_payer_signature"}function nY(t){return t.type==="multi_ed25519_signature"}var QF=(t=>(t.PRIVATE="private",t.PUBLIC="public",t.FRIEND="friend",t))(QF||{}),ej=(t=>(t.STORE="store",t.DROP="drop",t.KEY="key",t.COPY="copy",t))(ej||{}),tj=(t=>(t.VALIDATOR="validator",t.FULL_NODE="full_node",t))(tj||{}),nj=(t=>(t[t.Ed25519=0]="Ed25519",t[t.MultiEd25519=1]="MultiEd25519",t[t.SingleKey=2]="SingleKey",t[t.MultiKey=3]="MultiKey",t))(nj||{}),rj=(t=>(t[t.Ed25519=0]="Ed25519",t[t.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",t))(rj||{}),ij=(t=>(t[t.DeriveAuid=251]="DeriveAuid",t[t.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",t[t.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",t[t.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",t[t.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",t))(ij||{}),rY=class x9 extends null{constructor({address:e,publicKey:s,ansName:f}){super(),this.address=l.from(e),this.publicKey=s,this.ansName=f}serialize(e){if(this.address.serialize(e),this.publicKey instanceof c)e.serializeU32AsUleb128(i.Ed25519);else if(this.publicKey instanceof r)e.serializeU32AsUleb128(i.MultiEd25519);else if(this.publicKey instanceof a)e.serializeU32AsUleb128(i.SingleKey);else if(this.publicKey instanceof u)e.serializeU32AsUleb128(i.MultiKey);else throw new Error("Unsupported public key");this.publicKey.serialize(e),e.serializeStr(this.ansName??"")}static deserialize(e){let s=l.deserialize(e),f=e.deserializeUleb128AsU32(),d;switch(f){case i.Ed25519:d=c.deserialize(e);break;case i.MultiEd25519:d=r.deserialize(e);break;case i.SingleKey:d=a.deserialize(e);break;case i.MultiKey:d=u.deserialize(e);break;default:throw new Error(`Unknown variant index for WrappedPublicKey: ${f}`)}let h=e.deserializeStr()||void 0;return new x9({address:s,publicKey:d,ansName:h})}},iY="aptos:devnet",sj="aptos:testnet",sY="aptos:localnet",oj="aptos:mainnet",oY=null,aj=(t=>(t[t.Unauthorized=4100]="Unauthorized",t[t.InternalError=-30001]="InternalError",t))(aj||{}),mk=Object.freeze({4100:{status:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[-30001]:{status:"Internal error",message:"Something went wrong within the wallet."}}),aY=class I9 extends null{constructor(e,s){super(s??mk[e]?.message??"Unknown error occurred"),this.code=e,this.status=mk[e]?.status??"Unknown error",this.name="AptosWalletError",Object.setPrototypeOf(this,I9.prototype)}},cj=(t=>(t.APPROVED="Approved",t.REJECTED="Rejected",t))(cj||{}),cY=[{name:s6.MAINNET,chainId:1,_chainId:"apt-1",_walletStandardChain:oj,url:"https://fullnode.mainnet.aptoslabs.com/v1"},{name:s6.CUSTOM,chainId:27,_chainId:"apt-27",_walletStandardChain:sj,url:"https://aptos.testnet.suzuka.movementlabs.xyz/v1"}],uY=function t(e){"use strict";var s=e.address,f=e.publicKey;_class_call_check(this,t),_define_property(this,"address",void 0),_define_property(this,"publicKey",void 0),_define_property(this,"chains",[APTOS_MAINNET_CHAIN,APTOS_TESTNET_CHAIN]),_define_property(this,"features",void 0),_define_property(this,"signingScheme",void 0),_define_property(this,"label",void 0),_define_property(this,"icon",void 0),this.address=s,this.publicKey=hexToBytes(f),this.chains=[APTOS_MAINNET_CHAIN],this.features=["aptos:connect"],this.signingScheme=SigningScheme.Ed25519},lY=null,gs=Ar(83351),bk=[{env:"livenet",chainId:Dn,btcLibNetwork:gs.networks.bitcoin,networkId:"BTC"},{env:"testnet",chainId:Gn,btcLibNetwork:gs.networks.testnet,networkId:"BTC_TESTNET"},{env:"signet",chainId:$r,btcLibNetwork:gs.networks.testnet,networkId:"BTC_SIGNET"},{env:"regtest",chainId:Vr,btcLibNetwork:gs.networks.regtest,networkId:"BTC_REGTEST"}],fY=function(t){var e;return(e=bk.find(function(s){return s.chainId===t}))===null||e===void 0?void 0:e.env},dY=function(t){var e;return(e=bk.find(function(s){return s.env===t}))===null||e===void 0?void 0:e.chainId},uj=function(){var t=T(I().mark(function e(){var s;return I().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,window.unisat._requestPubKeyConsiderBabylon();case 2:return s=d.sent.tweaked,console.log("shouldTweak:",s),d.abrupt("return",s);case 5:case"end":return d.stop()}},e)}));return function(){return t.apply(this,arguments)}}();function lj(t){if(Array.isArray(t))return $(t)}function fj(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Jl(t){return lj(t)||U(t)||ee(t)||fj()}var vk=Ar(60488),$s;(function(t){t[t.P2PKH=0]="P2PKH",t[t.P2WPKH=1]="P2WPKH",t[t.P2TR=2]="P2TR",t[t.P2SH_P2WPKH=3]="P2SH_P2WPKH",t[t.M44_P2WPKH=4]="M44_P2WPKH",t[t.M44_P2TR=5]="M44_P2TR",t[t.P2WSH=6]="P2WSH",t[t.P2SH=7]="P2SH",t[t.UNKNOWN=8]="UNKNOWN"})($s||($s={}));var No;(function(t){t.BTC_MAINNET="livenet",t.BTC_TESTNET="testnet",t.BTC_SIGNET="signet",t.BTC_REGTEST="regtest"})(No||(No={}));function Ig(t){return t===No.BTC_MAINNET?gs.networks.bitcoin:t===No.BTC_TESTNET||t===No.BTC_SIGNET?gs.networks.testnet:gs.networks.regtest}function hY(t){return t.bech32===networks.bitcoin.bech32?BTCNetwork.BTC_MAINNET:t.bech32===networks.testnet.bech32?BTCNetwork.BTC_TESTNET:BTCNetwork.BTC_REGTEST}var dj=Ar(52155),hj=Ar(36533).Buffer;function pj(t){return t&&!!(t.tapInternalKey||t.tapMerkleRoot||t.tapLeafScript&&t.tapLeafScript.length||t.tapBip32Derivation&&t.tapBip32Derivation.length||t.witnessUtxo&&(0,dj.isP2TR)(hj.from(t.witnessUtxo.script)))}var gj=function(){var t=T(I().mark(function e(s,f){var d,h;return I().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(!pj(s)){P.next=16;break}if(h=!0,f&&(h=!1),!(s.tapLeafScript&&((d=s.tapLeafScript)===null||d===void 0?void 0:d.length)>0&&!s.tapMerkleRoot)){P.next=12;break}return s.tapLeafScript.map(function(R){R.controlBlock&&R.script&&(h=!1)}),P.next=8,uj();case 8:if(!P.sent){P.next=10;break}h=!0;case 10:P.next=13;break;case 12:s.tapMerkleRoot&&(h=!0);case 13:return P.abrupt("return",h);case 16:return P.abrupt("return",!1);case 17:case"end":return P.stop()}},e)}));return function(s,f){return t.apply(this,arguments)}}(),yj=function(t){window.bn.miniProgram.postMessage(t)},mj=function(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];var f;return(f=console).log.apply(f,["logDaApp:"].concat(Jl(e))),yj({id:0,method:In.dappLog,payload:e,metadata:yf,namespace:"eip155"})},ua=Ar(36533).Buffer,wk=ua.from(`Bitcoin Signed Message:
|
||
`);function _k(t){var e;return t<253?(e=ua.alloc(1),e.writeUInt8(t,0)):t<65536?(e=ua.alloc(3),e.writeUInt8(253,0),e.writeUInt16LE(t,1)):t<4294967296?(e=ua.alloc(5),e.writeUInt8(254,0),e.writeUInt32LE(t,1)):(e=ua.alloc(9),e.writeUInt8(255,0),e.writeInt32LE(t&-1,1),e.writeUInt32LE(Math.floor(t/4294967296),5)),e}function bj(t){var e=_k(wk.length),s=ua.from(t),f=_k(s.length),d=ua.concat([e,wk,f,s]);return gs.crypto.hash256(d)}function vj(t,e,s){if(!(t===0||t===1||t===2||t===3))throw new Error("i must be equal to 0, 1, 2, or 3");var f=t+27+4;return s||(f=f-4),ua.concat([Uint8Array.of(f),Uint8Array.from(e)])}var wj=function(){var t=T(I().mark(function e(s,f,d){var h,E,P,R,q,te;return I().wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return h={data:{images:[{data:s,networkId:f,disableTweak:!0}],input:""}},ue.next=3,d(h,"ecdsa",1,1,void 0,{});case 3:return E=ue.sent,P=E.result,R=ua.from(O6(P[0]),"hex"),te=(q=Number(_j(P[0])))!==null&&q!==void 0?q:1,ue.abrupt("return",vj(te,R,!0).toString("base64"));case 9:case"end":return ue.stop()}},e)}));return function(s,f,d){return t.apply(this,arguments)}}(),O6=function(t){return ua.from(ua.from(t,"hex").subarray(0,64)).toString("hex")},_j=function(t){return t.slice(128,130)},pY=function(t,e){var s=Psbt.fromHex(t,{network:toPsbtNetwork(e)});return s},Ej="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",Sj=function(){var t=T(I().mark(function e(s,f,d,h,E,P,R,q,te,ne){var ue,ge,xe,pe,Se,Ce,Fe,We,xt,kt=arguments;return I().wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return ue=kt.length>10&&kt[10]!==void 0?kt[10]:!0,ge=q,Wt.next=4,P({data:{images:[{networkId:h,data:Ej}],input:""}},h==="BTC_TAPROOT"?"schnorr":"ecdsa",R,ge,te,ne);case 4:xe=Wt.sent,pe=xe.token,ge++,Se=0;case 8:if(!(Se<E.length)){Wt.next=32;break}return Wt.next=11,gj(s.data.inputs[Se],E[Se].disableTweakSigner);case 11:return Ce=!Wt.sent,mj("disableTweak in signPsbtInternal:",{disableTweak:Ce,pubkey:Ce?d:f}),Fe=E[Se].index,We={publicKey:ua.from(Ce?d:f,"hex"),sign:function(){var Me=T(I().mark(function Ke(nt){var Tt,pt,Ht,lt;return I().wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return pt=nt.toString("hex"),console.log("hash to sign:",pt),ot.next=5,P({data:{images:[{networkId:h,data:pt,disableTweak:Ce||!!(!((Tt=E[Se])===null||Tt===void 0)&&Tt.disableTweakSigner)}],input:""}},"ecdsa",R,ge,pe,ne);case 5:return Ht=ot.sent,lt=Ht.result,ge++,ot.abrupt("return",ua.from(O6(lt[0]),"hex"));case 9:case"end":return ot.stop()}},Ke)}));return function(Ke){return Me.apply(this,arguments)}}(),signSchnorr:function(){var Me=T(I().mark(function Ke(nt){var Tt,pt,Ht,lt;return I().wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return pt=nt.toString("hex"),console.log("hash to sign:",pt),ot.next=5,P({data:{images:[{networkId:h,data:pt,disableTweak:Ce||!!(!((Tt=E[Se])===null||Tt===void 0)&&Tt.disableTweakSigner)}],input:""}},"schnorr",R,ge,pe,ne);case 5:return Ht=ot.sent,lt=Ht.result,ge++,console.log("signResult",lt),ot.abrupt("return",ua.from(O6(lt[0]),"hex"));case 10:case"end":return ot.stop()}},Ke)}));return function(Ke){return Me.apply(this,arguments)}}()},xt=E[Se].sighashTypes,console.log("sighashTypes",{sighashTypes:xt}),console.log("prev psbt",s.toBase64()),Wt.prev=18,Wt.next=21,s.signInputAsync(Fe,We,xt);case 21:ue&&s.finalizeInput(Fe),Wt.next=28;break;case 24:if(Wt.prev=24,Wt.t0=Wt.catch(18),!E[Se].isUserInput){Wt.next=28;break}throw Wt.t0;case 28:console.log("after psbt",s.toBase64());case 29:Se++,Wt.next=8;break;case 32:return Wt.abrupt("return",{psbt:s,currentSignTimes:ge,token:pe});case 33:case"end":return Wt.stop()}},e,null,[[18,24]])}));return function(s,f,d,h,E,P,R,q,te,ne){return t.apply(this,arguments)}}(),Aj=Ar(71534),xj=Ar.t(Aj,2),gY=Ar(70978);setTimeout(function(){gs.initEccLib(xj)});var R6,yY=function(){return R6||(R6=ECPairFactory(ecc)),R6},Ij=Ar(36533).Buffer;function Ek(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:No.BTC_MAINNET,s=Ig(e);try{var f=gs.address.fromOutputScript(typeof t=="string"?Ij.from(t,"hex"):t,s);return f}catch{return""}}function Sk(t){return t===$s.P2WPKH||t===$s.M44_P2WPKH?294:t===$s.P2TR||t===$s.M44_P2TR?330:546}function Bj(t,e){var s=Ig(e);return gs.address.toOutputScript(t,s)}function kj(t){var e=gs.networks.bitcoin,s=gs.networks.testnet,f=gs.networks.regtest,d,h,E,P;if(t.startsWith("bc1")||t.startsWith("tb1")||t.startsWith("bcrt1"))try{return h=gs.address.fromBech32(t),h.prefix===e.bech32?E=No.BTC_MAINNET:h.prefix===s.bech32?E=No.BTC_TESTNET:h.prefix===f.bech32&&(E=No.BTC_REGTEST),h.version===0?h.data.length===20?P=$s.P2WPKH:h.data.length===32&&(P=$s.P2WSH):h.version===1&&h.data.length===32&&(P=$s.P2TR),{networkType:E,addressType:P,dust:Sk(P)}}catch(R){console.error(R)}else try{return d=gs.address.fromBase58Check(t),d.version===e.pubKeyHash?(E=No.BTC_MAINNET,P=$s.P2PKH):d.version===s.pubKeyHash?(E=No.BTC_TESTNET,P=$s.P2PKH):d.version===f.pubKeyHash?(E=No.BTC_REGTEST,P=$s.P2PKH):d.version===e.scriptHash?(E=No.BTC_MAINNET,P=$s.P2SH_P2WPKH):d.version===s.scriptHash?(E=No.BTC_TESTNET,P=$s.P2SH_P2WPKH):d.version===f.scriptHash&&(E=No.BTC_REGTEST,P=$s.P2SH_P2WPKH),{networkType:E,addressType:P,dust:Sk(P)}}catch(R){console.error(R)}return{networkType:No.BTC_MAINNET,addressType:$s.UNKNOWN,dust:546}}function Tj(t){return kj(t).addressType}var Cj=Ar(36533).Buffer,Pj=function(t,e,s,f,d){var h=s,E=e,P=[];if(d&&d.toSignInputs)P=d.toSignInputs.map(function(ne){var ue,ge=Number(ne.index);if(isNaN(ge))throw new Error("invalid index in toSignInput");if(!ne.address&&!ne.publicKey)throw new Error("no address or public key in toSignInput");if(ne.address&&ne.address!==h)throw new Error("invalid address in toSignInput");if(ne.publicKey&&ne.publicKey!==E)throw new Error("invalid public key in toSignInput");var xe=(ue=ne.sighashTypes)===null||ue===void 0?void 0:ue.map(Number);if(xe?.some(isNaN))throw new Error("invalid sighash type in toSignInput");return{index:ge,publicKey:E,sighashTypes:xe,disableTweakSigner:ne.disableTweakSigner,isUserInput:!0}});else{var R=f,q=Ig(R),te=typeof t=="string"?gs.Psbt.fromHex(t,{network:q}):t;te.data.inputs.forEach(function(ne,ue){var ge=null;if(ne.witnessUtxo)ge=ne.witnessUtxo.script;else if(ne.nonWitnessUtxo){var xe=gs.Transaction.fromBuffer(ne.nonWitnessUtxo),pe=xe.outs[te.txInputs[ue].index];ge=pe.script}var Se=ne.finalScriptSig||ne.finalScriptWitness;if(console.log("formatOptionsToSignInputs",{script:ge,isSigned:Se}),ge&&!Se){var Ce=Ek(ge,R);console.log("formatOptionsToSignInputs",{address:Ce,accountAddress:h,script:ge,networkType:R}),P.push({index:ue,publicKey:E,sighashTypes:ne.sighashType?[ne.sighashType]:void 0,isUserInput:!1})}})}return P},Mj=function(t){return t.length===32?t:t.slice(1,33)},N6=function(t,e,s,f,d){var h=d||{autoFinalized:!0,toSignInputs:[]},E=Pj(t,e,s,f,d);if(E.length===0)throw new Error("no input to sign");var P=f;return t.data.inputs.forEach(function(R){var q=!(R.finalScriptSig||R.finalScriptWitness),te=s.startsWith("bc1p")||s.startsWith("tb1p"),ne=!R.tapInternalKey;if(q&&te&&ne){var ue,ge=Mj(Cj.from(e,"hex")),xe=gs.payments.p2tr({pubkey:ge,network:Ig(P)}).output;((ue=R.witnessUtxo)===null||ue===void 0?void 0:ue.script.toString("hex"))===xe?.toString("hex")&&(R.tapInternalKey=ge)}}),{toSignInputs:E,opts:h}},U6=function(){var t=T(I().mark(function e(s,f,d,h,E,P,R,q,te,ne,ue){var ge,xe,pe;return I().wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return console.log("signPsbt",{inputs:ue}),Ce.next=3,Sj(s,f,d,h,ue,E,P,R,q,te,ne.autoFinalized);case 3:return ge=Ce.sent,xe=ge.token,pe=ge.currentSignTimes,Ce.abrupt("return",{psbt:s,token:xe,currentTimes:pe});case 7:case"end":return Ce.stop()}},e)}));return function(s,f,d,h,E,P,R,q,te,ne,ue){return t.apply(this,arguments)}}();function Oj(t,e,s,f){var d=Ig(e),h=typeof t=="string"?gs.Psbt.fromHex(t,{network:d}):t,E=[],P=h.data.inputs.map(function(ne,ue){var ge=h.txInputs[ue].hash.reverse().toString("hex"),xe=h.txInputs[ue].index,pe,Se=0,Ce="";if(ne.witnessUtxo)pe=ne.witnessUtxo.script,Se=ne.witnessUtxo.value;else if(ne.nonWitnessUtxo){var Fe=gs.Transaction.fromBuffer(ne.nonWitnessUtxo),We=Fe.outs[xe];pe=We.script,Se=We.value}pe&&(Ce=Ek(pe,e));var xt=!!ne.finalScriptSig||!!ne.finalScriptWitness;return Ce===s&&!xt&&E.push({index:ue,publicKey:f,sighashTypes:ne.sighashType?[ne.sighashType]:void 0,isUserInput:!1}),{txId:ge,vout:xe,address:Ce,value:Se,isSigned:xt}}),R=h.txOutputs.map(function(ne,ue){var ge=ne.address,xe=ne.value;return{address:ge,value:xe,index:ue}}),q=P.reduce(function(ne,ue){return ne+ue.value},0)-R.reduce(function(ne,ue){return ne+ue.value},0),te=P.filter(function(ne){return ne.address===s}).reduce(function(ne,ue){return ne+ue.value},0)-R.filter(function(ne){return ne.address===s}).reduce(function(ne,ue){return ne+ue.value},0);return{inputsDetails:P,outputsDetails:R,toSignInputs:E,gas:q,spend:te}}var Rj=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,D6=Math.ceil,nu=Math.floor,la="[BigNumber Error] ",Ak=la+"Number primitive has more than 15 significant digits: ",Ec=1e14,ei=14,L6=9007199254740991,F6=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ql=1e7,co=1e9;function xk(t){var e,s,f,d=Fe.prototype={constructor:Fe,toString:null,valueOf:null},h=new Fe(1),E=20,P=4,R=-7,q=21,te=-1e7,ne=1e7,ue=!1,ge=1,xe=0,pe={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Se="0123456789abcdefghijklmnopqrstuvwxyz",Ce=!0;function Fe(Me,Ke){var nt,Tt,pt,Ht,lt,rt,ot,Mt,Ut=this;if(!(Ut instanceof Fe))return new Fe(Me,Ke);if(Ke==null){if(Me&&Me._isBigNumber===!0){Ut.s=Me.s,!Me.c||Me.e>ne?Ut.c=Ut.e=null:Me.e<te?Ut.c=[Ut.e=0]:(Ut.e=Me.e,Ut.c=Me.c.slice());return}if((rt=typeof Me=="number")&&Me*0==0){if(Ut.s=1/Me<0?(Me=-Me,-1):1,Me===~~Me){for(Ht=0,lt=Me;lt>=10;lt/=10,Ht++);Ht>ne?Ut.c=Ut.e=null:(Ut.e=Ht,Ut.c=[Me]);return}Mt=String(Me)}else{if(!Rj.test(Mt=String(Me)))return f(Ut,Mt,rt);Ut.s=Mt.charCodeAt(0)==45?(Mt=Mt.slice(1),-1):1}(Ht=Mt.indexOf("."))>-1&&(Mt=Mt.replace(".","")),(lt=Mt.search(/e/i))>0?(Ht<0&&(Ht=lt),Ht+=+Mt.slice(lt+1),Mt=Mt.substring(0,lt)):Ht<0&&(Ht=Mt.length)}else{if(ws(Ke,2,Se.length,"Base"),Ke==10&&Ce)return Ut=new Fe(Me),Bt(Ut,E+Ut.e+1,P);if(Mt=String(Me),rt=typeof Me=="number"){if(Me*0!=0)return f(Ut,Mt,rt,Ke);if(Ut.s=1/Me<0?(Mt=Mt.slice(1),-1):1,Fe.DEBUG&&Mt.replace(/^0\.0*|\./,"").length>15)throw Error(Ak+Me)}else Ut.s=Mt.charCodeAt(0)===45?(Mt=Mt.slice(1),-1):1;for(nt=Se.slice(0,Ke),Ht=lt=0,ot=Mt.length;lt<ot;lt++)if(nt.indexOf(Tt=Mt.charAt(lt))<0){if(Tt=="."){if(lt>Ht){Ht=ot;continue}}else if(!pt&&(Mt==Mt.toUpperCase()&&(Mt=Mt.toLowerCase())||Mt==Mt.toLowerCase()&&(Mt=Mt.toUpperCase()))){pt=!0,lt=-1,Ht=0;continue}return f(Ut,String(Me),rt,Ke)}rt=!1,Mt=s(Mt,Ke,10,Ut.s),(Ht=Mt.indexOf("."))>-1?Mt=Mt.replace(".",""):Ht=Mt.length}for(lt=0;Mt.charCodeAt(lt)===48;lt++);for(ot=Mt.length;Mt.charCodeAt(--ot)===48;);if(Mt=Mt.slice(lt,++ot)){if(ot-=lt,rt&&Fe.DEBUG&&ot>15&&(Me>L6||Me!==nu(Me)))throw Error(Ak+Ut.s*Me);if((Ht=Ht-lt-1)>ne)Ut.c=Ut.e=null;else if(Ht<te)Ut.c=[Ut.e=0];else{if(Ut.e=Ht,Ut.c=[],lt=(Ht+1)%ei,Ht<0&&(lt+=ei),lt<ot){for(lt&&Ut.c.push(+Mt.slice(0,lt)),ot-=ei;lt<ot;)Ut.c.push(+Mt.slice(lt,lt+=ei));lt=ei-(Mt=Mt.slice(lt)).length}else lt-=ot;for(;lt--;Mt+="0");Ut.c.push(+Mt)}}else Ut.c=[Ut.e=0]}Fe.clone=xk,Fe.ROUND_UP=0,Fe.ROUND_DOWN=1,Fe.ROUND_CEIL=2,Fe.ROUND_FLOOR=3,Fe.ROUND_HALF_UP=4,Fe.ROUND_HALF_DOWN=5,Fe.ROUND_HALF_EVEN=6,Fe.ROUND_HALF_CEIL=7,Fe.ROUND_HALF_FLOOR=8,Fe.EUCLID=9,Fe.config=Fe.set=function(Me){var Ke,nt;if(Me!=null)if(typeof Me=="object"){if(Me.hasOwnProperty(Ke="DECIMAL_PLACES")&&(nt=Me[Ke],ws(nt,0,co,Ke),E=nt),Me.hasOwnProperty(Ke="ROUNDING_MODE")&&(nt=Me[Ke],ws(nt,0,8,Ke),P=nt),Me.hasOwnProperty(Ke="EXPONENTIAL_AT")&&(nt=Me[Ke],nt&&nt.pop?(ws(nt[0],-co,0,Ke),ws(nt[1],0,co,Ke),R=nt[0],q=nt[1]):(ws(nt,-co,co,Ke),R=-(q=nt<0?-nt:nt))),Me.hasOwnProperty(Ke="RANGE"))if(nt=Me[Ke],nt&&nt.pop)ws(nt[0],-co,-1,Ke),ws(nt[1],1,co,Ke),te=nt[0],ne=nt[1];else if(ws(nt,-co,co,Ke),nt)te=-(ne=nt<0?-nt:nt);else throw Error(la+Ke+" cannot be zero: "+nt);if(Me.hasOwnProperty(Ke="CRYPTO"))if(nt=Me[Ke],nt===!!nt)if(nt)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ue=nt;else throw ue=!nt,Error(la+"crypto unavailable");else ue=nt;else throw Error(la+Ke+" not true or false: "+nt);if(Me.hasOwnProperty(Ke="MODULO_MODE")&&(nt=Me[Ke],ws(nt,0,9,Ke),ge=nt),Me.hasOwnProperty(Ke="POW_PRECISION")&&(nt=Me[Ke],ws(nt,0,co,Ke),xe=nt),Me.hasOwnProperty(Ke="FORMAT"))if(nt=Me[Ke],typeof nt=="object")pe=nt;else throw Error(la+Ke+" not an object: "+nt);if(Me.hasOwnProperty(Ke="ALPHABET"))if(nt=Me[Ke],typeof nt=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(nt))Ce=nt.slice(0,10)=="0123456789",Se=nt;else throw Error(la+Ke+" invalid: "+nt)}else throw Error(la+"Object expected: "+Me);return{DECIMAL_PLACES:E,ROUNDING_MODE:P,EXPONENTIAL_AT:[R,q],RANGE:[te,ne],CRYPTO:ue,MODULO_MODE:ge,POW_PRECISION:xe,FORMAT:pe,ALPHABET:Se}},Fe.isBigNumber=function(Me){if(!Me||Me._isBigNumber!==!0)return!1;if(!Fe.DEBUG)return!0;var Ke,nt,Tt=Me.c,pt=Me.e,Ht=Me.s;e:if({}.toString.call(Tt)=="[object Array]"){if((Ht===1||Ht===-1)&&pt>=-co&&pt<=co&&pt===nu(pt)){if(Tt[0]===0){if(pt===0&&Tt.length===1)return!0;break e}if(Ke=(pt+1)%ei,Ke<1&&(Ke+=ei),String(Tt[0]).length==Ke){for(Ke=0;Ke<Tt.length;Ke++)if(nt=Tt[Ke],nt<0||nt>=Ec||nt!==nu(nt))break e;if(nt!==0)return!0}}}else if(Tt===null&&pt===null&&(Ht===null||Ht===1||Ht===-1))return!0;throw Error(la+"Invalid BigNumber: "+Me)},Fe.maximum=Fe.max=function(){return xt(arguments,d.lt)},Fe.minimum=Fe.min=function(){return xt(arguments,d.gt)},Fe.random=function(){var Me=9007199254740992,Ke=Math.random()*Me&2097151?function(){return nu(Math.random()*Me)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(nt){var Tt,pt,Ht,lt,rt,ot=0,Mt=[],Ut=new Fe(h);if(nt==null?nt=E:ws(nt,0,co),lt=D6(nt/ei),ue)if(crypto.getRandomValues){for(Tt=crypto.getRandomValues(new Uint32Array(lt*=2));ot<lt;)rt=Tt[ot]*131072+(Tt[ot+1]>>>11),rt>=9e15?(pt=crypto.getRandomValues(new Uint32Array(2)),Tt[ot]=pt[0],Tt[ot+1]=pt[1]):(Mt.push(rt%1e14),ot+=2);ot=lt/2}else if(crypto.randomBytes){for(Tt=crypto.randomBytes(lt*=7);ot<lt;)rt=(Tt[ot]&31)*281474976710656+Tt[ot+1]*1099511627776+Tt[ot+2]*4294967296+Tt[ot+3]*16777216+(Tt[ot+4]<<16)+(Tt[ot+5]<<8)+Tt[ot+6],rt>=9e15?crypto.randomBytes(7).copy(Tt,ot):(Mt.push(rt%1e14),ot+=7);ot=lt/7}else throw ue=!1,Error(la+"crypto unavailable");if(!ue)for(;ot<lt;)rt=Ke(),rt<9e15&&(Mt[ot++]=rt%1e14);for(lt=Mt[--ot],nt%=ei,lt&&nt&&(rt=F6[ei-nt],Mt[ot]=nu(lt/rt)*rt);Mt[ot]===0;Mt.pop(),ot--);if(ot<0)Mt=[Ht=0];else{for(Ht=-1;Mt[0]===0;Mt.splice(0,1),Ht-=ei);for(ot=1,rt=Mt[0];rt>=10;rt/=10,ot++);ot<ei&&(Ht-=ei-ot)}return Ut.e=Ht,Ut.c=Mt,Ut}}(),Fe.sum=function(){for(var Me=1,Ke=arguments,nt=new Fe(Ke[0]);Me<Ke.length;)nt=nt.plus(Ke[Me++]);return nt},s=function(){var Me="0123456789";function Ke(nt,Tt,pt,Ht){for(var lt,rt=[0],ot,Mt=0,Ut=nt.length;Mt<Ut;){for(ot=rt.length;ot--;rt[ot]*=Tt);for(rt[0]+=Ht.indexOf(nt.charAt(Mt++)),lt=0;lt<rt.length;lt++)rt[lt]>pt-1&&(rt[lt+1]==null&&(rt[lt+1]=0),rt[lt+1]+=rt[lt]/pt|0,rt[lt]%=pt)}return rt.reverse()}return function(nt,Tt,pt,Ht,lt){var rt,ot,Mt,Ut,rn,Qt,Cn,qn,hr=nt.indexOf("."),lr=E,Sr=P;for(hr>=0&&(Ut=xe,xe=0,nt=nt.replace(".",""),qn=new Fe(Tt),Qt=qn.pow(nt.length-hr),xe=Ut,qn.c=Ke($u(Za(Qt.c),Qt.e,"0"),10,pt,Me),qn.e=qn.c.length),Cn=Ke(nt,Tt,pt,lt?(rt=Se,Me):(rt=Me,Se)),Mt=Ut=Cn.length;Cn[--Ut]==0;Cn.pop());if(!Cn[0])return rt.charAt(0);if(hr<0?--Mt:(Qt.c=Cn,Qt.e=Mt,Qt.s=Ht,Qt=e(Qt,qn,lr,Sr,pt),Cn=Qt.c,rn=Qt.r,Mt=Qt.e),ot=Mt+lr+1,hr=Cn[ot],Ut=pt/2,rn=rn||ot<0||Cn[ot+1]!=null,rn=Sr<4?(hr!=null||rn)&&(Sr==0||Sr==(Qt.s<0?3:2)):hr>Ut||hr==Ut&&(Sr==4||rn||Sr==6&&Cn[ot-1]&1||Sr==(Qt.s<0?8:7)),ot<1||!Cn[0])nt=rn?$u(rt.charAt(1),-lr,rt.charAt(0)):rt.charAt(0);else{if(Cn.length=ot,rn)for(--pt;++Cn[--ot]>pt;)Cn[ot]=0,ot||(++Mt,Cn=[1].concat(Cn));for(Ut=Cn.length;!Cn[--Ut];);for(hr=0,nt="";hr<=Ut;nt+=rt.charAt(Cn[hr++]));nt=$u(nt,Mt,rt.charAt(0))}return nt}}(),e=function(){function Me(Tt,pt,Ht){var lt,rt,ot,Mt,Ut=0,rn=Tt.length,Qt=pt%Ql,Cn=pt/Ql|0;for(Tt=Tt.slice();rn--;)ot=Tt[rn]%Ql,Mt=Tt[rn]/Ql|0,lt=Cn*ot+Mt*Qt,rt=Qt*ot+lt%Ql*Ql+Ut,Ut=(rt/Ht|0)+(lt/Ql|0)+Cn*Mt,Tt[rn]=rt%Ht;return Ut&&(Tt=[Ut].concat(Tt)),Tt}function Ke(Tt,pt,Ht,lt){var rt,ot;if(Ht!=lt)ot=Ht>lt?1:-1;else for(rt=ot=0;rt<Ht;rt++)if(Tt[rt]!=pt[rt]){ot=Tt[rt]>pt[rt]?1:-1;break}return ot}function nt(Tt,pt,Ht,lt){for(var rt=0;Ht--;)Tt[Ht]-=rt,rt=Tt[Ht]<pt[Ht]?1:0,Tt[Ht]=rt*lt+Tt[Ht]-pt[Ht];for(;!Tt[0]&&Tt.length>1;Tt.splice(0,1));}return function(Tt,pt,Ht,lt,rt){var ot,Mt,Ut,rn,Qt,Cn,qn,hr,lr,Sr,_r,Kr,li,ti,Yi,Yr,Ai,yi=Tt.s==pt.s?1:-1,Bi=Tt.c,ki=pt.c;if(!Bi||!Bi[0]||!ki||!ki[0])return new Fe(!Tt.s||!pt.s||(Bi?ki&&Bi[0]==ki[0]:!ki)?NaN:Bi&&Bi[0]==0||!ki?yi*0:yi/0);for(hr=new Fe(yi),lr=hr.c=[],Mt=Tt.e-pt.e,yi=Ht+Mt+1,rt||(rt=Ec,Mt=qa(Tt.e/ei)-qa(pt.e/ei),yi=yi/ei|0),Ut=0;ki[Ut]==(Bi[Ut]||0);Ut++);if(ki[Ut]>(Bi[Ut]||0)&&Mt--,yi<0)lr.push(1),rn=!0;else{for(ti=Bi.length,Yr=ki.length,Ut=0,yi+=2,Qt=nu(rt/(ki[0]+1)),Qt>1&&(ki=Me(ki,Qt,rt),Bi=Me(Bi,Qt,rt),Yr=ki.length,ti=Bi.length),li=Yr,Sr=Bi.slice(0,Yr),_r=Sr.length;_r<Yr;Sr[_r++]=0);Ai=ki.slice(),Ai=[0].concat(Ai),Yi=ki[0],ki[1]>=rt/2&&Yi++;do{if(Qt=0,ot=Ke(ki,Sr,Yr,_r),ot<0){if(Kr=Sr[0],Yr!=_r&&(Kr=Kr*rt+(Sr[1]||0)),Qt=nu(Kr/Yi),Qt>1)for(Qt>=rt&&(Qt=rt-1),Cn=Me(ki,Qt,rt),qn=Cn.length,_r=Sr.length;Ke(Cn,Sr,qn,_r)==1;)Qt--,nt(Cn,Yr<qn?Ai:ki,qn,rt),qn=Cn.length,ot=1;else Qt==0&&(ot=Qt=1),Cn=ki.slice(),qn=Cn.length;if(qn<_r&&(Cn=[0].concat(Cn)),nt(Sr,Cn,_r,rt),_r=Sr.length,ot==-1)for(;Ke(ki,Sr,Yr,_r)<1;)Qt++,nt(Sr,Yr<_r?Ai:ki,_r,rt),_r=Sr.length}else ot===0&&(Qt++,Sr=[0]);lr[Ut++]=Qt,Sr[0]?Sr[_r++]=Bi[li]||0:(Sr=[Bi[li]],_r=1)}while((li++<ti||Sr[0]!=null)&&yi--);rn=Sr[0]!=null,lr[0]||lr.splice(0,1)}if(rt==Ec){for(Ut=1,yi=lr[0];yi>=10;yi/=10,Ut++);Bt(hr,Ht+(hr.e=Ut+Mt*ei-1)+1,lt,rn)}else hr.e=Mt,hr.r=+rn;return hr}}();function We(Me,Ke,nt,Tt){var pt,Ht,lt,rt,ot;if(nt==null?nt=P:ws(nt,0,8),!Me.c)return Me.toString();if(pt=Me.c[0],lt=Me.e,Ke==null)ot=Za(Me.c),ot=Tt==1||Tt==2&&(lt<=R||lt>=q)?V1(ot,lt):$u(ot,lt,"0");else if(Me=Bt(new Fe(Me),Ke,nt),Ht=Me.e,ot=Za(Me.c),rt=ot.length,Tt==1||Tt==2&&(Ke<=Ht||Ht<=R)){for(;rt<Ke;ot+="0",rt++);ot=V1(ot,Ht)}else if(Ke-=lt,ot=$u(ot,Ht,"0"),Ht+1>rt){if(--Ke>0)for(ot+=".";Ke--;ot+="0");}else if(Ke+=Ht-rt,Ke>0)for(Ht+1==rt&&(ot+=".");Ke--;ot+="0");return Me.s<0&&pt?"-"+ot:ot}function xt(Me,Ke){for(var nt,Tt=1,pt=new Fe(Me[0]);Tt<Me.length;Tt++)if(nt=new Fe(Me[Tt]),nt.s)Ke.call(pt,nt)&&(pt=nt);else{pt=nt;break}return pt}function kt(Me,Ke,nt){for(var Tt=1,pt=Ke.length;!Ke[--pt];Ke.pop());for(pt=Ke[0];pt>=10;pt/=10,Tt++);return(nt=Tt+nt*ei-1)>ne?Me.c=Me.e=null:nt<te?Me.c=[Me.e=0]:(Me.e=nt,Me.c=Ke),Me}f=function(){var Me=/^(-?)0([xbo])(?=\w[\w.]*$)/i,Ke=/^([^.]+)\.$/,nt=/^\.([^.]+)$/,Tt=/^-?(Infinity|NaN)$/,pt=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(Ht,lt,rt,ot){var Mt,Ut=rt?lt:lt.replace(pt,"");if(Tt.test(Ut))Ht.s=isNaN(Ut)?null:Ut<0?-1:1;else{if(!rt&&(Ut=Ut.replace(Me,function(rn,Qt,Cn){return Mt=(Cn=Cn.toLowerCase())=="x"?16:Cn=="b"?2:8,!ot||ot==Mt?Qt:rn}),ot&&(Mt=ot,Ut=Ut.replace(Ke,"$1").replace(nt,"0.$1")),lt!=Ut))return new Fe(Ut,Mt);if(Fe.DEBUG)throw Error(la+"Not a"+(ot?" base "+ot:"")+" number: "+lt);Ht.s=null}Ht.c=Ht.e=null}}();function Bt(Me,Ke,nt,Tt){var pt,Ht,lt,rt,ot,Mt,Ut,rn=Me.c,Qt=F6;if(rn){e:{for(pt=1,rt=rn[0];rt>=10;rt/=10,pt++);if(Ht=Ke-pt,Ht<0)Ht+=ei,lt=Ke,ot=rn[Mt=0],Ut=ot/Qt[pt-lt-1]%10|0;else if(Mt=D6((Ht+1)/ei),Mt>=rn.length)if(Tt){for(;rn.length<=Mt;rn.push(0));ot=Ut=0,pt=1,Ht%=ei,lt=Ht-ei+1}else break e;else{for(ot=rt=rn[Mt],pt=1;rt>=10;rt/=10,pt++);Ht%=ei,lt=Ht-ei+pt,Ut=lt<0?0:ot/Qt[pt-lt-1]%10|0}if(Tt=Tt||Ke<0||rn[Mt+1]!=null||(lt<0?ot:ot%Qt[pt-lt-1]),Tt=nt<4?(Ut||Tt)&&(nt==0||nt==(Me.s<0?3:2)):Ut>5||Ut==5&&(nt==4||Tt||nt==6&&(Ht>0?lt>0?ot/Qt[pt-lt]:0:rn[Mt-1])%10&1||nt==(Me.s<0?8:7)),Ke<1||!rn[0])return rn.length=0,Tt?(Ke-=Me.e+1,rn[0]=Qt[(ei-Ke%ei)%ei],Me.e=-Ke||0):rn[0]=Me.e=0,Me;if(Ht==0?(rn.length=Mt,rt=1,Mt--):(rn.length=Mt+1,rt=Qt[ei-Ht],rn[Mt]=lt>0?nu(ot/Qt[pt-lt]%Qt[lt])*rt:0),Tt)for(;;)if(Mt==0){for(Ht=1,lt=rn[0];lt>=10;lt/=10,Ht++);for(lt=rn[0]+=rt,rt=1;lt>=10;lt/=10,rt++);Ht!=rt&&(Me.e++,rn[0]==Ec&&(rn[0]=1));break}else{if(rn[Mt]+=rt,rn[Mt]!=Ec)break;rn[Mt--]=0,rt=1}for(Ht=rn.length;rn[--Ht]===0;rn.pop());}Me.e>ne?Me.c=Me.e=null:Me.e<te&&(Me.c=[Me.e=0])}return Me}function Wt(Me){var Ke,nt=Me.e;return nt===null?Me.toString():(Ke=Za(Me.c),Ke=nt<=R||nt>=q?V1(Ke,nt):$u(Ke,nt,"0"),Me.s<0?"-"+Ke:Ke)}return d.absoluteValue=d.abs=function(){var Me=new Fe(this);return Me.s<0&&(Me.s=1),Me},d.comparedTo=function(Me,Ke){return Qh(this,new Fe(Me,Ke))},d.decimalPlaces=d.dp=function(Me,Ke){var nt,Tt,pt,Ht=this;if(Me!=null)return ws(Me,0,co),Ke==null?Ke=P:ws(Ke,0,8),Bt(new Fe(Ht),Me+Ht.e+1,Ke);if(!(nt=Ht.c))return null;if(Tt=((pt=nt.length-1)-qa(this.e/ei))*ei,pt=nt[pt])for(;pt%10==0;pt/=10,Tt--);return Tt<0&&(Tt=0),Tt},d.dividedBy=d.div=function(Me,Ke){return e(this,new Fe(Me,Ke),E,P)},d.dividedToIntegerBy=d.idiv=function(Me,Ke){return e(this,new Fe(Me,Ke),0,1)},d.exponentiatedBy=d.pow=function(Me,Ke){var nt,Tt,pt,Ht,lt,rt,ot,Mt,Ut,rn=this;if(Me=new Fe(Me),Me.c&&!Me.isInteger())throw Error(la+"Exponent not an integer: "+Wt(Me));if(Ke!=null&&(Ke=new Fe(Ke)),rt=Me.e>14,!rn.c||!rn.c[0]||rn.c[0]==1&&!rn.e&&rn.c.length==1||!Me.c||!Me.c[0])return Ut=new Fe(Math.pow(+Wt(rn),rt?Me.s*(2-$1(Me)):+Wt(Me))),Ke?Ut.mod(Ke):Ut;if(ot=Me.s<0,Ke){if(Ke.c?!Ke.c[0]:!Ke.s)return new Fe(NaN);Tt=!ot&&rn.isInteger()&&Ke.isInteger(),Tt&&(rn=rn.mod(Ke))}else{if(Me.e>9&&(rn.e>0||rn.e<-1||(rn.e==0?rn.c[0]>1||rt&&rn.c[1]>=24e7:rn.c[0]<8e13||rt&&rn.c[0]<=9999975e7)))return Ht=rn.s<0&&$1(Me)?-0:0,rn.e>-1&&(Ht=1/Ht),new Fe(ot?1/Ht:Ht);xe&&(Ht=D6(xe/ei+2))}for(rt?(nt=new Fe(.5),ot&&(Me.s=1),Mt=$1(Me)):(pt=Math.abs(+Wt(Me)),Mt=pt%2),Ut=new Fe(h);;){if(Mt){if(Ut=Ut.times(rn),!Ut.c)break;Ht?Ut.c.length>Ht&&(Ut.c.length=Ht):Tt&&(Ut=Ut.mod(Ke))}if(pt){if(pt=nu(pt/2),pt===0)break;Mt=pt%2}else if(Me=Me.times(nt),Bt(Me,Me.e+1,1),Me.e>14)Mt=$1(Me);else{if(pt=+Wt(Me),pt===0)break;Mt=pt%2}rn=rn.times(rn),Ht?rn.c&&rn.c.length>Ht&&(rn.c.length=Ht):Tt&&(rn=rn.mod(Ke))}return Tt?Ut:(ot&&(Ut=h.div(Ut)),Ke?Ut.mod(Ke):Ht?Bt(Ut,xe,P,lt):Ut)},d.integerValue=function(Me){var Ke=new Fe(this);return Me==null?Me=P:ws(Me,0,8),Bt(Ke,Ke.e+1,Me)},d.isEqualTo=d.eq=function(Me,Ke){return Qh(this,new Fe(Me,Ke))===0},d.isFinite=function(){return!!this.c},d.isGreaterThan=d.gt=function(Me,Ke){return Qh(this,new Fe(Me,Ke))>0},d.isGreaterThanOrEqualTo=d.gte=function(Me,Ke){return(Ke=Qh(this,new Fe(Me,Ke)))===1||Ke===0},d.isInteger=function(){return!!this.c&&qa(this.e/ei)>this.c.length-2},d.isLessThan=d.lt=function(Me,Ke){return Qh(this,new Fe(Me,Ke))<0},d.isLessThanOrEqualTo=d.lte=function(Me,Ke){return(Ke=Qh(this,new Fe(Me,Ke)))===-1||Ke===0},d.isNaN=function(){return!this.s},d.isNegative=function(){return this.s<0},d.isPositive=function(){return this.s>0},d.isZero=function(){return!!this.c&&this.c[0]==0},d.minus=function(Me,Ke){var nt,Tt,pt,Ht,lt=this,rt=lt.s;if(Me=new Fe(Me,Ke),Ke=Me.s,!rt||!Ke)return new Fe(NaN);if(rt!=Ke)return Me.s=-Ke,lt.plus(Me);var ot=lt.e/ei,Mt=Me.e/ei,Ut=lt.c,rn=Me.c;if(!ot||!Mt){if(!Ut||!rn)return Ut?(Me.s=-Ke,Me):new Fe(rn?lt:NaN);if(!Ut[0]||!rn[0])return rn[0]?(Me.s=-Ke,Me):new Fe(Ut[0]?lt:P==3?-0:0)}if(ot=qa(ot),Mt=qa(Mt),Ut=Ut.slice(),rt=ot-Mt){for((Ht=rt<0)?(rt=-rt,pt=Ut):(Mt=ot,pt=rn),pt.reverse(),Ke=rt;Ke--;pt.push(0));pt.reverse()}else for(Tt=(Ht=(rt=Ut.length)<(Ke=rn.length))?rt:Ke,rt=Ke=0;Ke<Tt;Ke++)if(Ut[Ke]!=rn[Ke]){Ht=Ut[Ke]<rn[Ke];break}if(Ht&&(pt=Ut,Ut=rn,rn=pt,Me.s=-Me.s),Ke=(Tt=rn.length)-(nt=Ut.length),Ke>0)for(;Ke--;Ut[nt++]=0);for(Ke=Ec-1;Tt>rt;){if(Ut[--Tt]<rn[Tt]){for(nt=Tt;nt&&!Ut[--nt];Ut[nt]=Ke);--Ut[nt],Ut[Tt]+=Ec}Ut[Tt]-=rn[Tt]}for(;Ut[0]==0;Ut.splice(0,1),--Mt);return Ut[0]?kt(Me,Ut,Mt):(Me.s=P==3?-1:1,Me.c=[Me.e=0],Me)},d.modulo=d.mod=function(Me,Ke){var nt,Tt,pt=this;return Me=new Fe(Me,Ke),!pt.c||!Me.s||Me.c&&!Me.c[0]?new Fe(NaN):!Me.c||pt.c&&!pt.c[0]?new Fe(pt):(ge==9?(Tt=Me.s,Me.s=1,nt=e(pt,Me,0,3),Me.s=Tt,nt.s*=Tt):nt=e(pt,Me,0,ge),Me=pt.minus(nt.times(Me)),!Me.c[0]&&ge==1&&(Me.s=pt.s),Me)},d.multipliedBy=d.times=function(Me,Ke){var nt,Tt,pt,Ht,lt,rt,ot,Mt,Ut,rn,Qt,Cn,qn,hr,lr,Sr=this,_r=Sr.c,Kr=(Me=new Fe(Me,Ke)).c;if(!_r||!Kr||!_r[0]||!Kr[0])return!Sr.s||!Me.s||_r&&!_r[0]&&!Kr||Kr&&!Kr[0]&&!_r?Me.c=Me.e=Me.s=null:(Me.s*=Sr.s,!_r||!Kr?Me.c=Me.e=null:(Me.c=[0],Me.e=0)),Me;for(Tt=qa(Sr.e/ei)+qa(Me.e/ei),Me.s*=Sr.s,ot=_r.length,rn=Kr.length,ot<rn&&(qn=_r,_r=Kr,Kr=qn,pt=ot,ot=rn,rn=pt),pt=ot+rn,qn=[];pt--;qn.push(0));for(hr=Ec,lr=Ql,pt=rn;--pt>=0;){for(nt=0,Qt=Kr[pt]%lr,Cn=Kr[pt]/lr|0,lt=ot,Ht=pt+lt;Ht>pt;)Mt=_r[--lt]%lr,Ut=_r[lt]/lr|0,rt=Cn*Mt+Ut*Qt,Mt=Qt*Mt+rt%lr*lr+qn[Ht]+nt,nt=(Mt/hr|0)+(rt/lr|0)+Cn*Ut,qn[Ht--]=Mt%hr;qn[Ht]=nt}return nt?++Tt:qn.splice(0,1),kt(Me,qn,Tt)},d.negated=function(){var Me=new Fe(this);return Me.s=-Me.s||null,Me},d.plus=function(Me,Ke){var nt,Tt=this,pt=Tt.s;if(Me=new Fe(Me,Ke),Ke=Me.s,!pt||!Ke)return new Fe(NaN);if(pt!=Ke)return Me.s=-Ke,Tt.minus(Me);var Ht=Tt.e/ei,lt=Me.e/ei,rt=Tt.c,ot=Me.c;if(!Ht||!lt){if(!rt||!ot)return new Fe(pt/0);if(!rt[0]||!ot[0])return ot[0]?Me:new Fe(rt[0]?Tt:pt*0)}if(Ht=qa(Ht),lt=qa(lt),rt=rt.slice(),pt=Ht-lt){for(pt>0?(lt=Ht,nt=ot):(pt=-pt,nt=rt),nt.reverse();pt--;nt.push(0));nt.reverse()}for(pt=rt.length,Ke=ot.length,pt-Ke<0&&(nt=ot,ot=rt,rt=nt,Ke=pt),pt=0;Ke;)pt=(rt[--Ke]=rt[Ke]+ot[Ke]+pt)/Ec|0,rt[Ke]=Ec===rt[Ke]?0:rt[Ke]%Ec;return pt&&(rt=[pt].concat(rt),++lt),kt(Me,rt,lt)},d.precision=d.sd=function(Me,Ke){var nt,Tt,pt,Ht=this;if(Me!=null&&Me!==!!Me)return ws(Me,1,co),Ke==null?Ke=P:ws(Ke,0,8),Bt(new Fe(Ht),Me,Ke);if(!(nt=Ht.c))return null;if(pt=nt.length-1,Tt=pt*ei+1,pt=nt[pt]){for(;pt%10==0;pt/=10,Tt--);for(pt=nt[0];pt>=10;pt/=10,Tt++);}return Me&&Ht.e+1>Tt&&(Tt=Ht.e+1),Tt},d.shiftedBy=function(Me){return ws(Me,-L6,L6),this.times("1e"+Me)},d.squareRoot=d.sqrt=function(){var Me,Ke,nt,Tt,pt,Ht=this,lt=Ht.c,rt=Ht.s,ot=Ht.e,Mt=E+4,Ut=new Fe("0.5");if(rt!==1||!lt||!lt[0])return new Fe(!rt||rt<0&&(!lt||lt[0])?NaN:lt?Ht:1/0);if(rt=Math.sqrt(+Wt(Ht)),rt==0||rt==1/0?(Ke=Za(lt),(Ke.length+ot)%2==0&&(Ke+="0"),rt=Math.sqrt(+Ke),ot=qa((ot+1)/2)-(ot<0||ot%2),rt==1/0?Ke="5e"+ot:(Ke=rt.toExponential(),Ke=Ke.slice(0,Ke.indexOf("e")+1)+ot),nt=new Fe(Ke)):nt=new Fe(rt+""),nt.c[0]){for(ot=nt.e,rt=ot+Mt,rt<3&&(rt=0);;)if(pt=nt,nt=Ut.times(pt.plus(e(Ht,pt,Mt,1))),Za(pt.c).slice(0,rt)===(Ke=Za(nt.c)).slice(0,rt))if(nt.e<ot&&--rt,Ke=Ke.slice(rt-3,rt+1),Ke=="9999"||!Tt&&Ke=="4999"){if(!Tt&&(Bt(pt,pt.e+E+2,0),pt.times(pt).eq(Ht))){nt=pt;break}Mt+=4,rt+=4,Tt=1}else{(!+Ke||!+Ke.slice(1)&&Ke.charAt(0)=="5")&&(Bt(nt,nt.e+E+2,1),Me=!nt.times(nt).eq(Ht));break}}return Bt(nt,nt.e+E+1,P,Me)},d.toExponential=function(Me,Ke){return Me!=null&&(ws(Me,0,co),Me++),We(this,Me,Ke,1)},d.toFixed=function(Me,Ke){return Me!=null&&(ws(Me,0,co),Me=Me+this.e+1),We(this,Me,Ke)},d.toFormat=function(Me,Ke,nt){var Tt,pt=this;if(nt==null)Me!=null&&Ke&&typeof Ke=="object"?(nt=Ke,Ke=null):Me&&typeof Me=="object"?(nt=Me,Me=Ke=null):nt=pe;else if(typeof nt!="object")throw Error(la+"Argument not an object: "+nt);if(Tt=pt.toFixed(Me,Ke),pt.c){var Ht,lt=Tt.split("."),rt=+nt.groupSize,ot=+nt.secondaryGroupSize,Mt=nt.groupSeparator||"",Ut=lt[0],rn=lt[1],Qt=pt.s<0,Cn=Qt?Ut.slice(1):Ut,qn=Cn.length;if(ot&&(Ht=rt,rt=ot,ot=Ht,qn-=Ht),rt>0&&qn>0){for(Ht=qn%rt||rt,Ut=Cn.substr(0,Ht);Ht<qn;Ht+=rt)Ut+=Mt+Cn.substr(Ht,rt);ot>0&&(Ut+=Mt+Cn.slice(Ht)),Qt&&(Ut="-"+Ut)}Tt=rn?Ut+(nt.decimalSeparator||"")+((ot=+nt.fractionGroupSize)?rn.replace(new RegExp("\\d{"+ot+"}\\B","g"),"$&"+(nt.fractionGroupSeparator||"")):rn):Ut}return(nt.prefix||"")+Tt+(nt.suffix||"")},d.toFraction=function(Me){var Ke,nt,Tt,pt,Ht,lt,rt,ot,Mt,Ut,rn,Qt,Cn=this,qn=Cn.c;if(Me!=null&&(rt=new Fe(Me),!rt.isInteger()&&(rt.c||rt.s!==1)||rt.lt(h)))throw Error(la+"Argument "+(rt.isInteger()?"out of range: ":"not an integer: ")+Wt(rt));if(!qn)return new Fe(Cn);for(Ke=new Fe(h),Mt=nt=new Fe(h),Tt=ot=new Fe(h),Qt=Za(qn),Ht=Ke.e=Qt.length-Cn.e-1,Ke.c[0]=F6[(lt=Ht%ei)<0?ei+lt:lt],Me=!Me||rt.comparedTo(Ke)>0?Ht>0?Ke:Mt:rt,lt=ne,ne=1/0,rt=new Fe(Qt),ot.c[0]=0;Ut=e(rt,Ke,0,1),pt=nt.plus(Ut.times(Tt)),pt.comparedTo(Me)!=1;)nt=Tt,Tt=pt,Mt=ot.plus(Ut.times(pt=Mt)),ot=pt,Ke=rt.minus(Ut.times(pt=Ke)),rt=pt;return pt=e(Me.minus(nt),Tt,0,1),ot=ot.plus(pt.times(Mt)),nt=nt.plus(pt.times(Tt)),ot.s=Mt.s=Cn.s,Ht=Ht*2,rn=e(Mt,Tt,Ht,P).minus(Cn).abs().comparedTo(e(ot,nt,Ht,P).minus(Cn).abs())<1?[Mt,Tt]:[ot,nt],ne=lt,rn},d.toNumber=function(){return+Wt(this)},d.toPrecision=function(Me,Ke){return Me!=null&&ws(Me,1,co),We(this,Me,Ke,2)},d.toString=function(Me){var Ke,nt=this,Tt=nt.s,pt=nt.e;return pt===null?Tt?(Ke="Infinity",Tt<0&&(Ke="-"+Ke)):Ke="NaN":(Me==null?Ke=pt<=R||pt>=q?V1(Za(nt.c),pt):$u(Za(nt.c),pt,"0"):Me===10&&Ce?(nt=Bt(new Fe(nt),E+pt+1,P),Ke=$u(Za(nt.c),nt.e,"0")):(ws(Me,2,Se.length,"Base"),Ke=s($u(Za(nt.c),pt,"0"),10,Me,Tt,!0)),Tt<0&&nt.c[0]&&(Ke="-"+Ke)),Ke},d.valueOf=d.toJSON=function(){return Wt(this)},d._isBigNumber=!0,d[Symbol.toStringTag]="BigNumber",d[Symbol.for("nodejs.util.inspect.custom")]=d.valueOf,t!=null&&Fe.set(t),Fe}function qa(t){var e=t|0;return t>0||t===e?e:e-1}function Za(t){for(var e,s,f=1,d=t.length,h=t[0]+"";f<d;){for(e=t[f++]+"",s=ei-e.length;s--;e="0"+e);h+=e}for(d=h.length;h.charCodeAt(--d)===48;);return h.slice(0,d+1||1)}function Qh(t,e){var s,f,d=t.c,h=e.c,E=t.s,P=e.s,R=t.e,q=e.e;if(!E||!P)return null;if(s=d&&!d[0],f=h&&!h[0],s||f)return s?f?0:-P:E;if(E!=P)return E;if(s=E<0,f=R==q,!d||!h)return f?0:!d^s?1:-1;if(!f)return R>q^s?1:-1;for(P=(R=d.length)<(q=h.length)?R:q,E=0;E<P;E++)if(d[E]!=h[E])return d[E]>h[E]^s?1:-1;return R==q?0:R>q^s?1:-1}function ws(t,e,s,f){if(t<e||t>s||t!==nu(t))throw Error(la+(f||"Argument")+(typeof t=="number"?t<e||t>s?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function $1(t){var e=t.c.length-1;return qa(t.e/ei)==e&&t.c[e]%2!=0}function V1(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function $u(t,e,s){var f,d;if(e<0){for(d=s+".";++e;d+=s);t=d+t}else if(f=t.length,++e>f){for(d=s,e-=f;--e;d+=s);t+=d}else e<f&&(t=t.slice(0,e)+"."+t.slice(e));return t}var Nj=xk();const Ik=Nj;var mY=function(t,e,s){return getECPair().fromPublicKey(t).verify(e,s)},bY=function(t,e,s){return getECPair().fromPublicKey(t).verifySchnorr(e,s)},Uj=new Ik(10).exponentiatedBy(8),vY=function(t){return new BigNumber(t).dividedBy(Uj).toFixed()},_s=Ar(36533).Buffer;function j6(t){var e=gs.crypto.sha256,s="BIP0322-signed-message",f=e(_s.from(s)),d=e(_s.concat([f,f,_s.from(t)]));return d.toString("hex")}function Dj(t){return z6.apply(this,arguments)}function z6(){return z6=T(I().mark(function t(e){var s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se,Ce,Fe,We,xt,kt,Bt,Wt,Me;return I().wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:if(kt=function(pt){return _s.concat([(0,vk.encode)(pt.byteLength),pt])},s=e.message,f=e.address,d=e.pubKey,h=e.originPubKey,E=e.networkType,P=e.bitcoinNetworkId,R=e.signData,q=Bj(f,E),te=Tj(f),ne=[$s.P2WPKH,$s.P2TR,$s.M44_P2WPKH,$s.M44_P2TR],ne.includes(te)!==!1){nt.next=7;break}throw new Error("Not support address type to sign");case 7:return ue=_s.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),ge=4294967295,xe=0,pe=_s.concat([_s.from("0020","hex"),_s.from(j6(s),"hex")]),Se=new gs.Transaction,Se.version=0,Se.addInput(ue,ge,xe,pe),Se.addOutput(q,0),Ce=new gs.Psbt,Ce.setVersion(0),Ce.addInput({hash:Se.getHash(),index:0,sequence:0,witnessUtxo:{script:q,value:0}}),Ce.addOutput({script:_s.from("6a","hex"),value:0}),Fe=N6(Ce,d,f,E).toSignInputs,We=function(){var Tt=T(I().mark(function pt(){var Ht=arguments;return I().wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return rt.next=2,window.unisat._previewMessage(s);case 2:return rt.abrupt("return",R.apply(self,Ht));case 3:case"end":return rt.stop()}},pt)}));return function(){return Tt.apply(this,arguments)}}(),nt.next=23,U6(Ce,d,h,P,We,2,1,void 0,{network:P,from:f,inputData:Ce.toHex()},{autoFinalized:!0},Fe);case 23:return xt=Ce.extractTransaction(),Bt=(0,vk.encode)(xt.ins[0].witness.length),Wt=_s.concat([Bt].concat(Jl(xt.ins[0].witness.map(function(Tt){return kt(Tt)})))),Me=Wt.toString("base64"),nt.abrupt("return",Me);case 29:case"end":return nt.stop()}},t)})),z6.apply(this,arguments)}function wY(t,e,s){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:BTCNetwork.BTC_MAINNET,d=getAddressType(t);return d===AddressType.P2WPKH||d===AddressType.M44_P2WPKH?Fj(t,e,s,f):d===AddressType.P2TR||d===AddressType.M44_P2TR?Lj(t,e,s,f):!1}function Lj(t,e,s){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:BTCNetwork.BTC_MAINNET,d=toPsbtNetwork(f),h=bitcoin.address.toOutputScript(t,d),E=_s.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),P=4294967295,R=0,q=_s.concat([_s.from("0020","hex"),_s.from(j6(e),"hex")]),te=new bitcoin.Transaction;te.version=0,te.addInput(E,P,R,q),te.addOutput(h,0);var ne=_s.from(s,"base64"),ue=bitcoin.script.decompile(ne.slice(1)),ge=ue[0],xe=_s.from("02"+h.subarray(2).toString("hex"),"hex"),pe=new bitcoin.Psbt;pe.setVersion(0),pe.addInput({hash:te.getHash(),index:0,sequence:0,witnessUtxo:{script:h,value:0}}),pe.addOutput({script:_s.from("6a","hex"),value:0});var Se=pe.__CACHE.__TX.hashForWitnessV1(0,[h],[0],0),Ce=schnorrValidator(xe,Se,ge);return Ce}function Fj(t,e,s){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:BTCNetwork.BTC_MAINNET,d=toPsbtNetwork(f),h=bitcoin.address.toOutputScript(t,d),E=_s.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),P=4294967295,R=0,q=_s.concat([_s.from("0020","hex"),_s.from(j6(e),"hex")]),te=new bitcoin.Transaction;te.version=0,te.addInput(E,P,R,q),te.addOutput(h,0);var ne=_s.from(s,"base64"),ue=bitcoin.script.decompile(ne.slice(1)),ge=new bitcoin.Psbt;ge.setVersion(0),ge.addInput({hash:te.getHash(),index:0,sequence:0,witnessUtxo:{script:h,value:0}}),ge.addOutput({script:_s.from("6a","hex"),value:0}),ge.updateInput(0,{partialSig:[{pubkey:ue[1],signature:ue[0]}]});var xe=ge.validateSignaturesOfAllInputs(validator);return xe}var jj=function(){var t=T(I().mark(function e(s,f,d,h,E,P){var R,q,te,ne,ue,ge,xe,pe;return I().wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,window.unisat._requestBinanceChainIdAndNetworkId.bind(window.unisat)(window.unisat._connectedChainId);case 2:return R=Ce.sent,q=R.binanceChainId,te=R.networkId,console.log("messageForRisk:",P),ne=window.unisat._connectedAddress,ue={signData:s.data.images.map(function(Fe){return{address:ne,data:Fe.data,binanceChainId:q,signMethod:f,disableTweak:Fe.disableTweak||!1}}),messageForRisk:{network:te,from:ne},totalSignTimes:d,currentTime:h,token:E},Ce.next=10,window.unisat._requestSignFullNative.bind(window.unisat)(ue);case 10:return ge=Ce.sent,xe=ge.result,pe=ge.token,Ce.abrupt("return",{result:xe,token:pe});case 14:case"end":return Ce.stop()}},e)}));return function(s,f,d,h,E,P){return t.apply(this,arguments)}}(),zj=function(){"use strict";function t(){B(this,t)}return Ln(t,[{key:"signPsbt",value:function(s,f,d,h,E,P){var R=this;return T(I().mark(function q(){var te,ne,ue,ge,xe,pe,Se,Ce;return I().wrap(function(We){for(;;)switch(We.prev=We.next){case 0:return We.next=2,window.unisat._requestTweakedPubkey();case 2:return te=We.sent,We.next=5,window.unisat._requestOriginPubkey();case 5:return ne=We.sent,We.next=8,window.unisat.getPublicKey();case 8:return ue=We.sent,ge=N6(s,ue,f,h,P),xe=ge.toSignInputs,pe=ge.opts,Se=R,Ce=function(){var xt=T(I().mark(function kt(){var Bt=arguments;return I().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return Me.next=2,window.unisat._request(hn.bip122PreviewTx,E);case 2:return Me.abrupt("return",Se.signData.apply(Se,Bt));case 3:case"end":return Me.stop()}},kt)}));return function(){return xt.apply(this,arguments)}}(),We.next=14,U6(s,te,ne,d,Ce,xe.length+1,1,void 0,{network:d,from:f,inputData:s.toHex()},pe,xe);case 14:return We.abrupt("return",s);case 15:case"end":return We.stop()}},q)}))()}},{key:"getPublicKey",value:function(){return window.unisat.getPublicKey()}},{key:"signPsbts",value:function(s,f,d,h,E){var P=this;return T(I().mark(function R(){var q,te,ne,ue,ge,xe,pe,Se,Ce,Fe;return I().wrap(function(xt){for(;;)switch(xt.prev=xt.next){case 0:return xt.next=2,window.unisat._requestTweakedPubkey();case 2:return q=xt.sent,xt.next=5,window.unisat._requestOriginPubkey();case 5:te=xt.sent,ne=void 0,ue=1,ge=s.map(function(kt,Bt){var Wt=E?E[Bt]:void 0,Me=N6(kt,q,f,h,Wt),Ke=Me.toSignInputs,nt=Me.opts;return{toSignInputs:Ke,formattedOpts:nt}}),xe=ge.reduce(function(kt,Bt){var Wt=Bt.toSignInputs;return kt+Wt.length},s.length),pe=0;case 11:if(!(pe<s.length)){xt.next=22;break}return xt.next=14,U6(s[pe],q,te,d,P.signData,xe,ue,ne,ge[pe].formattedOpts,ge[pe].toSignInputs);case 14:Se=xt.sent,Ce=Se.token,Fe=Se.currentTimes,ne=Ce,ue=Fe;case 19:pe++,xt.next=11;break;case 22:return xt.abrupt("return",s);case 23:case"end":return xt.stop()}},R)}))()}},{key:"parsePsbt",value:function(s,f,d){return T(I().mark(function h(){var E;return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,window.unisat._requestTweakedPubkey();case 2:return E=R.sent,R.next=5,Oj(s,f,d,E);case 5:return R.abrupt("return",R.sent);case 6:case"end":return R.stop()}},h)}))()}},{key:"signMessage",value:function(s,f,d,h,E){var P=this;return T(I().mark(function R(){var q,te,ne;return I().wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:if(f!=="bip322-simple"){ge.next=12;break}return ge.next=3,window.unisat._requestTweakedPubkey();case 3:return q=ge.sent,ge.next=6,window.unisat._requestOriginPubkey();case 6:return te=ge.sent,ge.next=9,Dj({message:s,address:d,originPubKey:te,pubKey:q,networkType:E,bitcoinNetworkId:h,signData:P.signData});case 9:return ge.abrupt("return",ge.sent);case 12:return ne=bj(s).toString("hex"),ge.next=15,window.unisat._previewMessage(s);case 15:return ge.next=17,wj(ne,h,P.signData);case 17:return ge.abrupt("return",ge.sent);case 18:case"end":return ge.stop()}},R)}))()}},{key:"signData",value:function(s,f,d,h,E,P){return T(I().mark(function R(){return I().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,jj(s,f,d,h,E,P);case 2:return te.abrupt("return",te.sent);case 3:case"end":return te.stop()}},R)}))()}}]),t}(),_Y=new zj,EY=null,SY=null,AY=Ar(36533).Buffer,xY=null;const W1=BigInt(2**32-1),H6=BigInt(32);function Bk(t,e=!1){return e?{h:Number(t&W1),l:Number(t>>H6&W1)}:{h:Number(t>>H6&W1)|0,l:Number(t&W1)|0}}function Hj(t,e=!1){let s=new Uint32Array(t.length),f=new Uint32Array(t.length);for(let d=0;d<t.length;d++){const{h,l:E}=Bk(t[d],e);[s[d],f[d]]=[h,E]}return[s,f]}const Kj=(t,e)=>BigInt(t>>>0)<<H6|BigInt(e>>>0),$j=(t,e,s)=>t>>>s,Vj=(t,e,s)=>t<<32-s|e>>>s,Wj=(t,e,s)=>t>>>s|e<<32-s,Gj=(t,e,s)=>t<<32-s|e>>>s,qj=(t,e,s)=>t<<64-s|e>>>s-32,Zj=(t,e,s)=>t>>>s-32|e<<64-s,Xj=(t,e)=>e,Yj=(t,e)=>t,Jj=(t,e,s)=>t<<s|e>>>32-s,Qj=(t,e,s)=>e<<s|t>>>32-s,ez=(t,e,s)=>e<<s-32|t>>>64-s,tz=(t,e,s)=>t<<s-32|e>>>64-s;function nz(t,e,s,f){const d=(e>>>0)+(f>>>0);return{h:t+s+(d/2**32|0)|0,l:d|0}}const ai={fromBig:Bk,split:Hj,toBig:Kj,shrSH:$j,shrSL:Vj,rotrSH:Wj,rotrSL:Gj,rotrBH:qj,rotrBL:Zj,rotr32H:Xj,rotr32L:Yj,rotlSH:Jj,rotlSL:Qj,rotlBH:ez,rotlBL:tz,add:nz,add3L:(t,e,s)=>(t>>>0)+(e>>>0)+(s>>>0),add3H:(t,e,s,f)=>e+s+f+(t/2**32|0)|0,add4L:(t,e,s,f)=>(t>>>0)+(e>>>0)+(s>>>0)+(f>>>0),add4H:(t,e,s,f,d)=>e+s+f+d+(t/2**32|0)|0,add5H:(t,e,s,f,d,h)=>e+s+f+d+h+(t/2**32|0)|0,add5L:(t,e,s,f,d)=>(t>>>0)+(e>>>0)+(s>>>0)+(f>>>0)+(d>>>0)},[rz,iz]=ai.split(["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(t=>BigInt(t))),ef=new Uint32Array(80),tf=new Uint32Array(80);class G1 extends kx{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:s,Bh:f,Bl:d,Ch:h,Cl:E,Dh:P,Dl:R,Eh:q,El:te,Fh:ne,Fl:ue,Gh:ge,Gl:xe,Hh:pe,Hl:Se}=this;return[e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se]}set(e,s,f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se){this.Ah=e|0,this.Al=s|0,this.Bh=f|0,this.Bl=d|0,this.Ch=h|0,this.Cl=E|0,this.Dh=P|0,this.Dl=R|0,this.Eh=q|0,this.El=te|0,this.Fh=ne|0,this.Fl=ue|0,this.Gh=ge|0,this.Gl=xe|0,this.Hh=pe|0,this.Hl=Se|0}process(e,s){for(let We=0;We<16;We++,s+=4)ef[We]=e.getUint32(s),tf[We]=e.getUint32(s+=4);for(let We=16;We<80;We++){const xt=ef[We-15]|0,kt=tf[We-15]|0,Bt=ai.rotrSH(xt,kt,1)^ai.rotrSH(xt,kt,8)^ai.shrSH(xt,kt,7),Wt=ai.rotrSL(xt,kt,1)^ai.rotrSL(xt,kt,8)^ai.shrSL(xt,kt,7),Me=ef[We-2]|0,Ke=tf[We-2]|0,nt=ai.rotrSH(Me,Ke,19)^ai.rotrBH(Me,Ke,61)^ai.shrSH(Me,Ke,6),Tt=ai.rotrSL(Me,Ke,19)^ai.rotrBL(Me,Ke,61)^ai.shrSL(Me,Ke,6),pt=ai.add4L(Wt,Tt,tf[We-7],tf[We-16]),Ht=ai.add4H(pt,Bt,nt,ef[We-7],ef[We-16]);ef[We]=Ht|0,tf[We]=pt|0}let{Ah:f,Al:d,Bh:h,Bl:E,Ch:P,Cl:R,Dh:q,Dl:te,Eh:ne,El:ue,Fh:ge,Fl:xe,Gh:pe,Gl:Se,Hh:Ce,Hl:Fe}=this;for(let We=0;We<80;We++){const xt=ai.rotrSH(ne,ue,14)^ai.rotrSH(ne,ue,18)^ai.rotrBH(ne,ue,41),kt=ai.rotrSL(ne,ue,14)^ai.rotrSL(ne,ue,18)^ai.rotrBL(ne,ue,41),Bt=ne&ge^~ne&pe,Wt=ue&xe^~ue&Se,Me=ai.add5L(Fe,kt,Wt,iz[We],tf[We]),Ke=ai.add5H(Me,Ce,xt,Bt,rz[We],ef[We]),nt=Me|0,Tt=ai.rotrSH(f,d,28)^ai.rotrBH(f,d,34)^ai.rotrBH(f,d,39),pt=ai.rotrSL(f,d,28)^ai.rotrBL(f,d,34)^ai.rotrBL(f,d,39),Ht=f&h^f&P^h&P,lt=d&E^d&R^E&R;Ce=pe|0,Fe=Se|0,pe=ge|0,Se=xe|0,ge=ne|0,xe=ue|0,{h:ne,l:ue}=ai.add(q|0,te|0,Ke|0,nt|0),q=P|0,te=R|0,P=h|0,R=E|0,h=f|0,E=d|0;const rt=ai.add3L(nt,pt,lt);f=ai.add3H(rt,Ke,Tt,Ht),d=rt|0}({h:f,l:d}=ai.add(this.Ah|0,this.Al|0,f|0,d|0)),{h,l:E}=ai.add(this.Bh|0,this.Bl|0,h|0,E|0),{h:P,l:R}=ai.add(this.Ch|0,this.Cl|0,P|0,R|0),{h:q,l:te}=ai.add(this.Dh|0,this.Dl|0,q|0,te|0),{h:ne,l:ue}=ai.add(this.Eh|0,this.El|0,ne|0,ue|0),{h:ge,l:xe}=ai.add(this.Fh|0,this.Fl|0,ge|0,xe|0),{h:pe,l:Se}=ai.add(this.Gh|0,this.Gl|0,pe|0,Se|0),{h:Ce,l:Fe}=ai.add(this.Hh|0,this.Hl|0,Ce|0,Fe|0),this.set(f,d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se,Ce,Fe)}roundClean(){ef.fill(0),tf.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class OY extends G1{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class RY extends G1{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class NY extends G1{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const sz=Ix(()=>new G1),UY=null,DY=null,LY=null;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Sc=BigInt(0),fa=BigInt(1),q1=BigInt(2),oz=BigInt(8),az={zip215:!0};function cz(t){const e=fE(t);return Uh(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function uz(t){const e=cz(t),{Fp:s,n:f,prehash:d,hash:h,randomBytes:E,nByteLength:P,h:R}=e,q=q1<<BigInt(P*8)-fa,te=s.create,ne=e.uvRatio||((rt,ot)=>{try{return{isValid:!0,value:s.sqrt(rt*s.inv(ot))}}catch{return{isValid:!1,value:Sc}}}),ue=e.adjustScalarBytes||(rt=>rt),ge=e.domain||((rt,ot,Mt)=>{if(Du("phflag",Mt),ot.length||Mt)throw new Error("Contexts/pre-hash are not supported");return rt});function xe(rt,ot){$a("coordinate "+rt,ot,Sc,q)}function pe(rt){if(!(rt instanceof Fe))throw new Error("ExtendedPoint expected")}const Se=ag((rt,ot)=>{const{ex:Mt,ey:Ut,ez:rn}=rt,Qt=rt.is0();ot==null&&(ot=Qt?oz:s.inv(rn));const Cn=te(Mt*ot),qn=te(Ut*ot),hr=te(rn*ot);if(Qt)return{x:Sc,y:fa};if(hr!==fa)throw new Error("invZ was invalid");return{x:Cn,y:qn}}),Ce=ag(rt=>{const{a:ot,d:Mt}=e;if(rt.is0())throw new Error("bad point: ZERO");const{ex:Ut,ey:rn,ez:Qt,et:Cn}=rt,qn=te(Ut*Ut),hr=te(rn*rn),lr=te(Qt*Qt),Sr=te(lr*lr),_r=te(qn*ot),Kr=te(lr*te(_r+hr)),li=te(Sr+te(Mt*te(qn*hr)));if(Kr!==li)throw new Error("bad point: equation left != right (1)");const ti=te(Ut*rn),Yi=te(Qt*Cn);if(ti!==Yi)throw new Error("bad point: equation left != right (2)");return!0});class Fe{constructor(ot,Mt,Ut,rn){this.ex=ot,this.ey=Mt,this.ez=Ut,this.et=rn,xe("x",ot),xe("y",Mt),xe("z",Ut),xe("t",rn),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(ot){if(ot instanceof Fe)throw new Error("extended point not allowed");const{x:Mt,y:Ut}=ot||{};return xe("x",Mt),xe("y",Ut),new Fe(Mt,Ut,fa,te(Mt*Ut))}static normalizeZ(ot){const Mt=s.invertBatch(ot.map(Ut=>Ut.ez));return ot.map((Ut,rn)=>Ut.toAffine(Mt[rn])).map(Fe.fromAffine)}_setWindowSize(ot){kt.setWindowSize(this,ot)}assertValidity(){Ce(this)}equals(ot){pe(ot);const{ex:Mt,ey:Ut,ez:rn}=this,{ex:Qt,ey:Cn,ez:qn}=ot,hr=te(Mt*qn),lr=te(Qt*rn),Sr=te(Ut*qn),_r=te(Cn*rn);return hr===lr&&Sr===_r}is0(){return this.equals(Fe.ZERO)}negate(){return new Fe(te(-this.ex),this.ey,this.ez,te(-this.et))}double(){const{a:ot}=e,{ex:Mt,ey:Ut,ez:rn}=this,Qt=te(Mt*Mt),Cn=te(Ut*Ut),qn=te(q1*te(rn*rn)),hr=te(ot*Qt),lr=Mt+Ut,Sr=te(te(lr*lr)-Qt-Cn),_r=hr+Cn,Kr=_r-qn,li=hr-Cn,ti=te(Sr*Kr),Yi=te(_r*li),Yr=te(Sr*li),Ai=te(Kr*_r);return new Fe(ti,Yi,Ai,Yr)}add(ot){pe(ot);const{a:Mt,d:Ut}=e,{ex:rn,ey:Qt,ez:Cn,et:qn}=this,{ex:hr,ey:lr,ez:Sr,et:_r}=ot;if(Mt===BigInt(-1)){const Ed=te((Qt-rn)*(lr+hr)),hv=te((Qt+rn)*(lr-hr)),Wg=te(hv-Ed);if(Wg===Sc)return this.double();const AC=te(Cn*q1*_r),xC=te(qn*q1*Sr),IC=xC+AC,BC=hv+Ed,kC=xC-AC,RV=te(IC*Wg),NV=te(BC*kC),UV=te(IC*kC),DV=te(Wg*BC);return new Fe(RV,NV,DV,UV)}const Kr=te(rn*hr),li=te(Qt*lr),ti=te(qn*Ut*_r),Yi=te(Cn*Sr),Yr=te((rn+Qt)*(hr+lr)-Kr-li),Ai=Yi-ti,yi=Yi+ti,Bi=te(li-Mt*Kr),ki=te(Yr*Ai),$g=te(yi*Bi),g0=te(Yr*Bi),Vg=te(Ai*yi);return new Fe(ki,$g,Vg,g0)}subtract(ot){return this.add(ot.negate())}wNAF(ot){return kt.wNAFCached(this,ot,Fe.normalizeZ)}multiply(ot){const Mt=ot;$a("scalar",Mt,fa,f);const{p:Ut,f:rn}=this.wNAF(Mt);return Fe.normalizeZ([Ut,rn])[0]}multiplyUnsafe(ot){const Mt=ot;return $a("scalar",Mt,Sc,f),Mt===Sc?xt:this.equals(xt)||Mt===fa?this:this.equals(We)?this.wNAF(Mt).p:kt.unsafeLadder(this,Mt)}isSmallOrder(){return this.multiplyUnsafe(R).is0()}isTorsionFree(){return kt.unsafeLadder(this,f).is0()}toAffine(ot){return Se(this,ot)}clearCofactor(){const{h:ot}=e;return ot===fa?this:this.multiplyUnsafe(ot)}static fromHex(ot,Mt=!1){const{d:Ut,a:rn}=e,Qt=s.BYTES;ot=eo("pointHex",ot,Qt),Du("zip215",Mt);const Cn=ot.slice(),qn=ot[Qt-1];Cn[Qt-1]=qn&-129;const hr=Rh(Cn),lr=Mt?q:s.ORDER;$a("pointHex.y",hr,Sc,lr);const Sr=te(hr*hr),_r=te(Sr-fa),Kr=te(Ut*Sr-rn);let{isValid:li,value:ti}=ne(_r,Kr);if(!li)throw new Error("Point.fromHex: invalid y coordinate");const Yi=(ti&fa)===fa,Yr=(qn&128)!==0;if(!Mt&&ti===Sc&&Yr)throw new Error("Point.fromHex: x=0 and x_0=1");return Yr!==Yi&&(ti=te(-ti)),Fe.fromAffine({x:ti,y:hr})}static fromPrivateKey(ot){return Me(ot).point}toRawBytes(){const{x:ot,y:Mt}=this.toAffine(),Ut=og(Mt,s.BYTES);return Ut[Ut.length-1]|=ot&fa?128:0,Ut}toHex(){return Jf(this.toRawBytes())}}Fe.BASE=new Fe(e.Gx,e.Gy,fa,te(e.Gx*e.Gy)),Fe.ZERO=new Fe(Sc,fa,fa,Sc);const{BASE:We,ZERO:xt}=Fe,kt=Hx(Fe,P*8);function Bt(rt){return os(rt,f)}function Wt(rt){return Bt(Rh(rt))}function Me(rt){const ot=P;rt=eo("private key",rt,ot);const Mt=eo("hashed private key",h(rt),2*ot),Ut=ue(Mt.slice(0,ot)),rn=Mt.slice(ot,2*ot),Qt=Wt(Ut),Cn=We.multiply(Qt),qn=Cn.toRawBytes();return{head:Ut,prefix:rn,scalar:Qt,point:Cn,pointBytes:qn}}function Ke(rt){return Me(rt).pointBytes}function nt(rt=new Uint8Array,...ot){const Mt=ed(...ot);return Wt(h(ge(Mt,eo("context",rt),!!d)))}function Tt(rt,ot,Mt={}){rt=eo("message",rt),d&&(rt=d(rt));const{prefix:Ut,scalar:rn,pointBytes:Qt}=Me(ot),Cn=nt(Mt.context,Ut,rt),qn=We.multiply(Cn).toRawBytes(),hr=nt(Mt.context,qn,Qt,rt),lr=Bt(Cn+hr*rn);$a("signature.s",lr,Sc,f);const Sr=ed(qn,og(lr,s.BYTES));return eo("result",Sr,P*2)}const pt=az;function Ht(rt,ot,Mt,Ut=pt){const{context:rn,zip215:Qt}=Ut,Cn=s.BYTES;rt=eo("signature",rt,2*Cn),ot=eo("message",ot),Qt!==void 0&&Du("zip215",Qt),d&&(ot=d(ot));const qn=Rh(rt.slice(Cn,2*Cn));let hr,lr,Sr;try{hr=Fe.fromHex(Mt,Qt),lr=Fe.fromHex(rt.slice(0,Cn),Qt),Sr=We.multiplyUnsafe(qn)}catch{return!1}if(!Qt&&hr.isSmallOrder())return!1;const _r=nt(rn,lr.toRawBytes(),hr.toRawBytes(),ot);return lr.add(hr.multiplyUnsafe(_r)).subtract(Sr).clearCofactor().equals(Fe.ZERO)}return We._setWindowSize(8),{CURVE:e,getPublicKey:Ke,sign:Tt,verify:Ht,ExtendedPoint:Fe,utils:{getExtendedPublicKey:Me,randomPrivateKey:()=>E(s.BYTES),precompute(rt=8,ot=Fe.BASE){return ot._setWindowSize(rt),ot.multiply(BigInt(3)),ot}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const K6=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),kk=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),lz=BigInt(0),ru=BigInt(1),$6=BigInt(2),FY=BigInt(3),Tk=BigInt(5),Ck=BigInt(8);function fz(t){const e=BigInt(10),s=BigInt(20),f=BigInt(40),d=BigInt(80),h=K6,P=t*t%h*t%h,R=Ms(P,$6,h)*P%h,q=Ms(R,ru,h)*t%h,te=Ms(q,Tk,h)*q%h,ne=Ms(te,e,h)*te%h,ue=Ms(ne,s,h)*ne%h,ge=Ms(ue,f,h)*ue%h,xe=Ms(ge,d,h)*ge%h,pe=Ms(xe,d,h)*ge%h,Se=Ms(pe,e,h)*te%h;return{pow_p_5_8:Ms(Se,$6,h)*t%h,b2:P}}function dz(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function V6(t,e){const s=K6,f=os(e*e*e,s),d=os(f*f*e,s),h=fz(t*d).pow_p_5_8;let E=os(t*f*h,s);const P=os(e*E*E,s),R=E,q=os(E*kk,s),te=P===t,ne=P===os(-t,s),ue=P===os(-t*kk,s);return te&&(E=R),(ne||ue)&&(E=q),QR(E,s)&&(E=os(-E,s)),{isValid:te||ne,value:E}}const jY=null,Br=Lx(K6,void 0,!0),W6={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Br,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Ck,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:sz,randomBytes:Bx,adjustScalarBytes:dz,uvRatio:V6},Vs=uz(W6);function zY(t,e,s){if(e.length>255)throw new Error("Context is too big");return concatBytes(utf8ToBytes("SigEd25519 no Ed25519 collisions"),new Uint8Array([s?1:0,e.length]),e,t)}const HY=null,KY=null,$Y=null;function VY(t){const{y:e}=Vs.ExtendedPoint.fromHex(t),s=BigInt(1);return Br.toBytes(Br.create((s+e)*Br.inv(s-e)))}const WY=null;function GY(t){const e=W6.hash(t.subarray(0,32));return W6.adjustScalarBytes(e).subarray(0,32)}const qY=null,hz=null,Pk=null;function pz(t){const e=(Br.ORDER-Tk)/Ck,s=BigInt(486662);let f=Br.sqr(t);f=Br.mul(f,$6);let d=Br.add(f,Br.ONE),h=Br.neg(s),E=Br.sqr(d),P=Br.mul(E,d),R=Br.mul(f,s);R=Br.mul(R,h),R=Br.add(R,E),R=Br.mul(R,h);let q=Br.sqr(P);E=Br.sqr(q),q=Br.mul(q,P),q=Br.mul(q,R),E=Br.mul(E,q);let te=Br.pow(E,e);te=Br.mul(te,q);let ne=Br.mul(te,Pk);E=Br.sqr(te),E=Br.mul(E,P);let ue=Br.eql(E,R),ge=Br.cmov(ne,te,ue),xe=Br.mul(h,f),pe=Br.mul(te,t);pe=Br.mul(pe,hz);let Se=Br.mul(pe,Pk),Ce=Br.mul(R,f);E=Br.sqr(pe),E=Br.mul(E,P);let Fe=Br.eql(E,Ce),We=Br.cmov(Se,pe,Fe);E=Br.sqr(ge),E=Br.mul(E,P);let xt=Br.eql(E,R),kt=Br.cmov(xe,h,xt),Bt=Br.cmov(We,ge,xt),Wt=Br.isOdd(Bt);return Bt=Br.cmov(Bt,Br.neg(Bt),xt!==Wt),{xMn:kt,xMd:d,yMn:Bt,yMd:ru}}const gz=null;function ZY(t){const{xMn:e,xMd:s,yMn:f,yMd:d}=pz(t);let h=Br.mul(e,d);h=Br.mul(h,gz);let E=Br.mul(s,f),P=Br.sub(e,s),R=Br.add(e,s),q=Br.mul(E,R),te=Br.eql(q,Br.ZERO);h=Br.cmov(h,Br.ZERO,te),E=Br.cmov(E,Br.ONE,te),P=Br.cmov(P,Br.ONE,te),R=Br.cmov(R,Br.ONE,te);const ne=Br.invertBatch([E,R]);return{x:Br.mul(h,ne[0]),y:Br.mul(P,ne[1])}}const XY=null,YY=null,JY=null;function G6(t){if(!(t instanceof Xa))throw new Error("RistrettoPoint expected")}const q6=null,yz=null,mz=null,bz=null,vz=null,Mk=t=>V6(ru,t),wz=null,Z6=t=>Vs.CURVE.Fp.create(bytesToNumberLE(t)&wz);function Ok(t){const{d:e}=Vs.CURVE,s=Vs.CURVE.Fp.ORDER,f=Vs.CURVE.Fp.create,d=f(q6*t*t),h=f((d+ru)*bz);let E=BigInt(-1);const P=f((E-e*d)*f(d+e));let{isValid:R,value:q}=V6(h,P),te=f(q*t);isNegativeLE(te,s)||(te=f(-te)),R||(q=te),R||(E=d);const ne=f(E*(d-ru)*vz-P),ue=q*q,ge=f((q+q)*P),xe=f(ne*yz),pe=f(ru-ue),Se=f(ru+ue);return new Vs.ExtendedPoint(f(ge*Se),f(pe*xe),f(xe*Se),f(ge*pe))}class Xa{constructor(e){this.ep=e}static fromAffine(e){return new Xa(Vs.ExtendedPoint.fromAffine(e))}static hashToCurve(e){e=ensureBytes("ristrettoHash",e,64);const s=Z6(e.slice(0,32)),f=Ok(s),d=Z6(e.slice(32,64)),h=Ok(d);return new Xa(f.add(h))}static fromHex(e){e=ensureBytes("ristrettoHex",e,32);const{a:s,d:f}=Vs.CURVE,d=Vs.CURVE.Fp.ORDER,h=Vs.CURVE.Fp.create,E="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",P=Z6(e);if(!equalBytes(numberToBytesLE(P,32),e)||isNegativeLE(P,d))throw new Error(E);const R=h(P*P),q=h(ru+s*R),te=h(ru-s*R),ne=h(q*q),ue=h(te*te),ge=h(s*f*ne-ue),{isValid:xe,value:pe}=Mk(h(ge*ue)),Se=h(pe*te),Ce=h(pe*Se*ge);let Fe=h((P+P)*Se);isNegativeLE(Fe,d)&&(Fe=h(-Fe));const We=h(q*Ce),xt=h(Fe*We);if(!xe||isNegativeLE(xt,d)||We===lz)throw new Error(E);return new Xa(new Vs.ExtendedPoint(Fe,We,ru,xt))}toRawBytes(){let{ex:e,ey:s,ez:f,et:d}=this.ep;const h=Vs.CURVE.Fp.ORDER,E=Vs.CURVE.Fp.create,P=E(E(f+s)*E(f-s)),R=E(e*s),q=E(R*R),{value:te}=Mk(E(P*q)),ne=E(te*P),ue=E(te*R),ge=E(ne*ue*d);let xe;if(isNegativeLE(d*ge,h)){let Se=E(s*q6),Ce=E(e*q6);e=Se,s=Ce,xe=E(ne*mz)}else xe=ue;isNegativeLE(e*ge,h)&&(s=E(-s));let pe=E((f-s)*xe);return isNegativeLE(pe,h)&&(pe=E(-pe)),numberToBytesLE(pe,32)}toHex(){return bytesToHex(this.toRawBytes())}toString(){return this.toHex()}equals(e){G6(e);const{ex:s,ey:f}=this.ep,{ex:d,ey:h}=e.ep,E=Vs.CURVE.Fp.create,P=E(s*h)===E(f*d),R=E(f*h)===E(s*d);return P||R}add(e){return G6(e),new Xa(this.ep.add(e.ep))}subtract(e){return G6(e),new Xa(this.ep.subtract(e.ep))}multiply(e){return new Xa(this.ep.multiply(e))}multiplyUnsafe(e){return new Xa(this.ep.multiplyUnsafe(e))}double(){return new Xa(this.ep.double())}negate(){return new Xa(this.ep.negate())}}const QY=null,eJ=(t,e)=>{const s=e.DST,f=typeof s=="string"?utf8ToBytes(s):s,d=expand_message_xmd(t,f,64,sha512);return Xa.hashToCurve(d)},tJ=null;var _z=Ar(83900),Rk=Ar.n(_z),Ez=Ar(22265),bo=Ar.n(Ez);const Sz=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),nf=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),rf=new Uint32Array(64);class Nk extends VA{constructor(){super(64,32,8,!1),this.A=nf[0]|0,this.B=nf[1]|0,this.C=nf[2]|0,this.D=nf[3]|0,this.E=nf[4]|0,this.F=nf[5]|0,this.G=nf[6]|0,this.H=nf[7]|0}get(){const{A:e,B:s,C:f,D:d,E:h,F:E,G:P,H:R}=this;return[e,s,f,d,h,E,P,R]}set(e,s,f,d,h,E,P,R){this.A=e|0,this.B=s|0,this.C=f|0,this.D=d|0,this.E=h|0,this.F=E|0,this.G=P|0,this.H=R|0}process(e,s){for(let ne=0;ne<16;ne++,s+=4)rf[ne]=e.getUint32(s,!1);for(let ne=16;ne<64;ne++){const ue=rf[ne-15],ge=rf[ne-2],xe=Zc(ue,7)^Zc(ue,18)^ue>>>3,pe=Zc(ge,17)^Zc(ge,19)^ge>>>10;rf[ne]=pe+rf[ne-7]+xe+rf[ne-16]|0}let{A:f,B:d,C:h,D:E,E:P,F:R,G:q,H:te}=this;for(let ne=0;ne<64;ne++){const ue=Zc(P,6)^Zc(P,11)^Zc(P,25),ge=te+ue+yO(P,R,q)+Sz[ne]+rf[ne]|0,pe=(Zc(f,2)^Zc(f,13)^Zc(f,22))+mO(f,d,h)|0;te=q,q=R,R=P,P=E+ge|0,E=h,h=d,d=f,f=ge+pe|0}f=f+this.A|0,d=d+this.B|0,h=h+this.C|0,E=E+this.D|0,P=P+this.E|0,R=R+this.F|0,q=q+this.G|0,te=te+this.H|0,this.set(f,d,h,E,P,R,q,te)}roundClean(){rf.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class nJ extends Nk{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const Uk=T_(()=>new Nk),rJ=null;var X6=Ar(59229),Kt=Ar(53857),Y6=Ar(19808);class Az extends TypeError{constructor(e,s){let f;const{message:d,explanation:h,...E}=e,{path:P}=e,R=P.length===0?d:`At path: ${P.join(".")} -- ${d}`;super(h??R),h!=null&&(this.cause=R),Object.assign(this,E),this.name=this.constructor.name,this.failures=()=>f??(f=[e,...s()])}}function xz(t){return e0(t)&&typeof t[Symbol.iterator]=="function"}function e0(t){return typeof t=="object"&&t!=null}function t0(t){return e0(t)&&!Array.isArray(t)}function Dk(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function ro(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Iz(t){const{done:e,value:s}=t.next();return e?void 0:s}function Bz(t,e,s,f){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:d,branch:h}=e,{type:E}=s,{refinement:P,message:R=`Expected a value of type \`${E}\`${P?` with refinement \`${P}\``:""}, but received: \`${ro(f)}\``}=t;return{value:f,type:E,refinement:P,key:d[d.length-1],path:d,branch:h,...t,message:R}}function*J6(t,e,s,f){xz(t)||(t=[t]);for(const d of t){const h=Bz(d,e,s,f);h&&(yield h)}}function*Q6(t,e,s={}){const{path:f=[],branch:d=[t],coerce:h=!1,mask:E=!1}=s,P={path:f,branch:d,mask:E};h&&(t=e.coercer(t,P));let R="valid";for(const q of e.validator(t,P))q.explanation=s.message,R="not_valid",yield[q,void 0];for(let[q,te,ne]of e.entries(t,P)){const ue=Q6(te,ne,{path:q===void 0?f:[...f,q],branch:q===void 0?d:[...d,te],coerce:h,mask:E,message:s.message});for(const ge of ue)ge[0]?(R=ge[0].refinement!=null?"not_refined":"not_valid",yield[ge[0],void 0]):h&&(te=ge[1],q===void 0?t=te:t instanceof Map?t.set(q,te):t instanceof Set?t.add(te):e0(t)&&(te!==void 0||q in t)&&(t[q]=te))}if(R!=="not_valid")for(const q of e.refiner(t,P))q.explanation=s.message,R="not_refined",yield[q,void 0];R==="valid"&&(yield[void 0,t])}class Ws{constructor(e){const{type:s,schema:f,validator:d,refiner:h,coercer:E=R=>R,entries:P=function*(){}}=e;this.type=s,this.schema=f,this.entries=P,this.coercer=E,d?this.validator=(R,q)=>{const te=d(R,q);return J6(te,q,this,R)}:this.validator=()=>[],h?this.refiner=(R,q)=>{const te=h(R,q);return J6(te,q,this,R)}:this.refiner=()=>[]}assert(e,s){return kz(e,this,s)}create(e,s){return dr(e,this,s)}is(e){return Lk(e,this)}mask(e,s){return Tz(e,this,s)}validate(e,s={}){return Bg(e,this,s)}}function kz(t,e,s){const f=Bg(t,e,{message:s});if(f[0])throw f[0]}function dr(t,e,s){const f=Bg(t,e,{coerce:!0,message:s});if(f[0])throw f[0];return f[1]}function Tz(t,e,s){const f=Bg(t,e,{coerce:!0,mask:!0,message:s});if(f[0])throw f[0];return f[1]}function Lk(t,e){return!Bg(t,e)[0]}function Bg(t,e,s={}){const f=Q6(t,e,s),d=Iz(f);return d[0]?[new Az(d[0],function*(){for(const E of f)E[0]&&(yield E[0])}),void 0]:[void 0,d[1]]}function iJ(...t){const e=t[0].type==="type",s=t.map(d=>d.schema),f=Object.assign({},...s);return e?zn(f):Z1(f)}function Ma(t,e){return new Ws({type:t,schema:null,validator:e})}function sJ(t,e){return new Ws({...t,refiner:(s,f)=>s===void 0||t.refiner(s,f),validator(s,f){return s===void 0?!0:(e(s,f),t.validator(s,f))}})}function oJ(t){return new Ws({type:"dynamic",schema:null,*entries(e,s){yield*t(e,s).entries(e,s)},validator(e,s){return t(e,s).validator(e,s)},coercer(e,s){return t(e,s).coercer(e,s)},refiner(e,s){return t(e,s).refiner(e,s)}})}function aJ(t){let e;return new Ws({type:"lazy",schema:null,*entries(s,f){e??(e=t()),yield*e.entries(s,f)},validator(s,f){return e??(e=t()),e.validator(s,f)},coercer(s,f){return e??(e=t()),e.coercer(s,f)},refiner(s,f){return e??(e=t()),e.refiner(s,f)}})}function cJ(t,e){const{schema:s}=t,f={...s};for(const d of e)delete f[d];switch(t.type){case"type":return zn(f);default:return Z1(f)}}function uJ(t){const e=t instanceof Ws,s=e?{...t.schema}:{...t};for(const f in s)s[f]=Dr(s[f]);return e&&t.type==="type"?zn(s):Z1(s)}function lJ(t,e){const{schema:s}=t,f={};for(const d of e)f[d]=s[d];switch(t.type){case"type":return zn(f);default:return Z1(f)}}function fJ(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ma(t,e)}function Cz(){return Ma("any",()=>!0)}function mr(t){return new Ws({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[s,f]of e.entries())yield[s,f,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${ro(e)}`}})}function dJ(){return Ma("bigint",t=>typeof t=="bigint")}function iu(){return Ma("boolean",t=>typeof t=="boolean")}function hJ(){return Ma("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${ro(t)}`)}function pJ(t){const e={},s=t.map(f=>ro(f)).join();for(const f of t)e[f]=f;return new Ws({type:"enums",schema:e,validator(f){return t.includes(f)||`Expected one of \`${s}\`, but received: ${ro(f)}`}})}function gJ(){return Ma("func",t=>typeof t=="function"||`Expected a function, but received: ${ro(t)}`)}function e4(t){return Ma("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${ro(e)}`)}function yJ(){return Ma("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${ro(t)}`)}function mJ(t){return new Ws({type:"intersection",schema:null,*entries(e,s){for(const f of t)yield*f.entries(e,s)},*validator(e,s){for(const f of t)yield*f.validator(e,s)},*refiner(e,s){for(const f of t)yield*f.refiner(e,s)}})}function Es(t){const e=ro(t),s=typeof t;return new Ws({type:"literal",schema:s==="string"||s==="number"||s==="boolean"?t:null,validator(f){return f===t||`Expected the literal \`${e}\`, but received: ${ro(f)}`}})}function bJ(t,e){return new Ws({type:"map",schema:null,*entries(s){if(t&&e&&s instanceof Map)for(const[f,d]of s.entries())yield[f,f,t],yield[f,d,e]},coercer(s){return s instanceof Map?new Map(s):s},validator(s){return s instanceof Map||`Expected a \`Map\` object, but received: ${ro(s)}`}})}function Fk(){return Ma("never",()=>!1)}function vr(t){return new Ws({...t,validator:(e,s)=>e===null||t.validator(e,s),refiner:(e,s)=>e===null||t.refiner(e,s)})}function gn(){return Ma("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${ro(t)}`)}function Z1(t){const e=t?Object.keys(t):[],s=Fk();return new Ws({type:"object",schema:t||null,*entries(f){if(t&&e0(f)){const d=new Set(Object.keys(f));for(const h of e)d.delete(h),yield[h,f[h],t[h]];for(const h of d)yield[h,f[h],s]}},validator(f){return t0(f)||`Expected an object, but received: ${ro(f)}`},coercer(f,d){if(!t0(f))return f;const h={...f};if(d.mask&&t)for(const E in h)t[E]===void 0&&delete h[E];return h}})}function Dr(t){return new Ws({...t,validator:(e,s)=>e===void 0||t.validator(e,s),refiner:(e,s)=>e===void 0||t.refiner(e,s)})}function jk(t,e){return new Ws({type:"record",schema:null,*entries(s){if(e0(s))for(const f in s){const d=s[f];yield[f,f,t],yield[f,d,e]}},validator(s){return t0(s)||`Expected an object, but received: ${ro(s)}`},coercer(s){return t0(s)?{...s}:s}})}function vJ(){return Ma("regexp",t=>t instanceof RegExp)}function wJ(t){return new Ws({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const s of e)yield[s,s,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${ro(e)}`}})}function rr(){return Ma("string",t=>typeof t=="string"||`Expected a string, but received: ${ro(t)}`)}function t4(t){const e=Fk();return new Ws({type:"tuple",schema:null,*entries(s){if(Array.isArray(s)){const f=Math.max(t.length,s.length);for(let d=0;d<f;d++)yield[d,s[d],t[d]||e]}},validator(s){return Array.isArray(s)||`Expected an array, but received: ${ro(s)}`},coercer(s){return Array.isArray(s)?s.slice():s}})}function zn(t){const e=Object.keys(t);return new Ws({type:"type",schema:t,*entries(s){if(e0(s))for(const f of e)yield[f,s[f],t[f]]},validator(s){return t0(s)||`Expected an object, but received: ${ro(s)}`},coercer(s){return t0(s)?{...s}:s}})}function Wo(t){const e=t.map(s=>s.type).join(" | ");return new Ws({type:"union",schema:null,coercer(s,f){for(const d of t){const[h,E]=d.validate(s,{coerce:!0,mask:f.mask});if(!h)return E}return s},validator(s,f){const d=[];for(const h of t){const[...E]=Q6(s,h,f),[P]=E;if(P[0])for(const[R]of E)R&&d.push(R);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${ro(s)}`,...d]}})}function hd(){return Ma("unknown",()=>!0)}function pd(t,e,s){return new Ws({...t,coercer:(f,d)=>Lk(f,e)?t.coercer(s(f,d),d):t.coercer(f,d)})}function _J(t,e,s={}){return pd(t,hd(),f=>{const d=typeof e=="function"?e():e;if(f===void 0)return d;if(!s.strict&&Dk(f)&&Dk(d)){const h={...f};let E=!1;for(const P in d)h[P]===void 0&&(h[P]=d[P],E=!0);if(E)return h}return f})}function EJ(t){return pd(t,rr(),e=>e.trim())}function SJ(t){return n0(t,"empty",e=>{const s=zk(e);return s===0||`Expected an empty ${t.type} but received one with a size of \`${s}\``})}function zk(t){return t instanceof Map||t instanceof Set?t.size:t.length}function AJ(t,e,s={}){const{exclusive:f}=s;return n0(t,"max",d=>f?d<e:d<=e||`Expected a ${t.type} less than ${f?"":"or equal to "}${e} but received \`${d}\``)}function xJ(t,e,s={}){const{exclusive:f}=s;return n0(t,"min",d=>f?d>e:d>=e||`Expected a ${t.type} greater than ${f?"":"or equal to "}${e} but received \`${d}\``)}function IJ(t){return n0(t,"nonempty",e=>zk(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function BJ(t,e){return n0(t,"pattern",s=>e.test(s)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${s}"`)}function kJ(t,e,s=e){const f=`Expected a ${t.type}`,d=e===s?`of \`${e}\``:`between \`${e}\` and \`${s}\``;return n0(t,"size",h=>{if(typeof h=="number"||h instanceof Date)return e<=h&&h<=s||`${f} ${d} but received \`${h}\``;if(h instanceof Map||h instanceof Set){const{size:E}=h;return e<=E&&E<=s||`${f} with a size ${d} but received one with a size of \`${E}\``}else{const{length:E}=h;return e<=E&&E<=s||`${f} with a length ${d} but received one with a length of \`${E}\``}})}function n0(t,e,s){return new Ws({...t,*refiner(f,d){yield*t.refiner(f,d);const h=s(f,d),E=J6(h,d,t,f);for(const P of E)yield{...P,refinement:e}}})}var Pz=Ar(52149),Mz=Ar.n(Pz),Oz=class extends Ot(){socket;constructor(t,e,s){super(),this.socket=new window.WebSocket(t,s),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=f=>this.emit("message",f.data),this.socket.onerror=f=>this.emit("error",f),this.socket.onclose=f=>{this.emit("close",f.code,f.reason)}}send(t,e,s){const f=s||e;try{this.socket.send(t),f()}catch(d){f(d)}}close(t,e){this.socket.close(t,e)}addEventListener(t,e,s){this.socket.addEventListener(t,e,s)}};function Hk(t,e){return new Oz(t,e)}var Rz=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},Nz=class extends Ot(){address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(t,e="ws://localhost:8080",{autoconnect:s=!0,reconnect:f=!0,reconnect_interval:d=1e3,max_reconnects:h=5,...E}={},P,R){super(),this.webSocketFactory=t,this.queue={},this.rpc_id=0,this.address=e,this.autoconnect=s,this.ready=!1,this.reconnect=f,this.reconnect_timer_id=void 0,this.reconnect_interval=d,this.max_reconnects=h,this.rest_options=E,this.current_reconnects=0,this.generate_request_id=P||(()=>typeof this.rpc_id=="number"?++this.rpc_id:Number(this.rpc_id)+1),R?this.dataPack=R:this.dataPack=new Rz,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(t,e,s,f){return!f&&typeof s=="object"&&(f=s,s=null),new Promise((d,h)=>{if(!this.ready)return h(new Error("socket not ready"));const E=this.generate_request_id(t,e),P={jsonrpc:"2.0",method:t,params:e||void 0,id:E};this.socket.send(this.dataPack.encode(P),f,R=>{if(R)return h(R);this.queue[E]={promise:[d,h]},s&&(this.queue[E].timeout=setTimeout(()=>{delete this.queue[E],h(new Error("reply timeout"))},s))})})}async login(t){const e=await this.call("rpc.login",t);if(!e)throw new Error("authentication failed");return e}async listMethods(){return await this.call("__listMethods")}notify(t,e){return new Promise((s,f)=>{if(!this.ready)return f(new Error("socket not ready"));const d={jsonrpc:"2.0",method:t,params:e};this.socket.send(this.dataPack.encode(d),h=>{if(h)return f(h);s()})})}async subscribe(t){typeof t=="string"&&(t=[t]);const e=await this.call("rpc.on",t);if(typeof t=="string"&&e[t]!=="ok")throw new Error("Failed subscribing to an event '"+t+"' with: "+e[t]);return e}async unsubscribe(t){typeof t=="string"&&(t=[t]);const e=await this.call("rpc.off",t);if(typeof t=="string"&&e[t]!=="ok")throw new Error("Failed unsubscribing from an event with: "+e);return e}close(t,e){this.socket.close(t||1e3,e)}setAutoReconnect(t){this.reconnect=t}setReconnectInterval(t){this.reconnect_interval=t}setMaxReconnects(t){this.max_reconnects=t}_connect(t,e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:s})=>{s instanceof ArrayBuffer&&(s=Ir.Buffer.from(s).toString());try{s=this.dataPack.decode(s)}catch{return}if(s.notification&&this.listeners(s.notification).length){if(!Object.keys(s.params).length)return this.emit(s.notification);const f=[s.notification];if(s.params.constructor===Object)f.push(s.params);else for(let d=0;d<s.params.length;d++)f.push(s.params[d]);return Promise.resolve().then(()=>{this.emit.apply(this,f)})}if(!this.queue[s.id])return s.method?Promise.resolve().then(()=>{this.emit(s.method,s?.params)}):void 0;"error"in s=="result"in s&&this.queue[s.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[s.id].timeout&&clearTimeout(this.queue[s.id].timeout),s.error?this.queue[s.id].promise[1](s.error):this.queue[s.id].promise[0](s.result),delete this.queue[s.id]}),this.socket.addEventListener("error",s=>this.emit("error",s)),this.socket.addEventListener("close",({code:s,reason:f})=>{this.ready&&setTimeout(()=>this.emit("close",s,f),0),this.ready=!1,this.socket=void 0,s!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(t,e),this.reconnect_interval)))})}},TJ=class extends null{constructor(t="ws://localhost:8080",{autoconnect:e=!0,reconnect:s=!0,reconnect_interval:f=1e3,max_reconnects:d=5}={},h){super(Hk,t,{autoconnect:e,reconnect:s,reconnect_interval:f,max_reconnects:d},h)}};const Uz=Vs.utils.randomPrivateKey,Kk=()=>{const t=Vs.utils.randomPrivateKey(),e=X1(t),s=new Uint8Array(64);return s.set(t),s.set(e,32),{publicKey:e,secretKey:s}},X1=Vs.getPublicKey;function $k(t){try{return Vs.ExtendedPoint.fromHex(t),!0}catch{return!1}}const n4=(t,e)=>Vs.sign(t,e.slice(0,32)),Dz=Vs.verify,ci=t=>Ir.Buffer.isBuffer(t)?t:t instanceof Uint8Array?Ir.Buffer.from(t.buffer,t.byteOffset,t.byteLength):Ir.Buffer.from(t);class Vk{constructor(e){Object.assign(this,e)}encode(){return Ir.Buffer.from((0,X6.serialize)(Y1,this))}static decode(e){return(0,X6.deserialize)(Y1,this,e)}static decodeUnchecked(e){return(0,X6.deserializeUnchecked)(Y1,this,e)}}class CJ extends Vk{constructor(e){if(super(e),this.enum="",Object.keys(e).length!==1)throw new Error("Enum can only take single value");Object.keys(e).map(s=>{this.enum=s})}}const Y1=new Map;var Wk;const Lz=32,Vu=32;function Fz(t){return t._bn!==void 0}let Gk=1;class sr extends Vk{constructor(e){if(super({}),this._bn=void 0,Fz(e))this._bn=e._bn;else{if(typeof e=="string"){const s=bo().decode(e);if(s.length!=Vu)throw new Error("Invalid public key input");this._bn=new(Rk())(s)}else this._bn=new(Rk())(e);if(this._bn.byteLength()>Vu)throw new Error("Invalid public key input")}}static unique(){const e=new sr(Gk);return Gk+=1,new sr(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return bo().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(Ir.Buffer);if(e.length===Vu)return e;const s=Ir.Buffer.alloc(32);return e.copy(s,32-e.length),s}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,s,f){const d=Ir.Buffer.concat([e.toBuffer(),Ir.Buffer.from(s),f.toBuffer()]),h=Uk(d);return new sr(h)}static createProgramAddressSync(e,s){let f=Ir.Buffer.alloc(0);e.forEach(function(h){if(h.length>Lz)throw new TypeError("Max seed length exceeded");f=Ir.Buffer.concat([f,ci(h)])}),f=Ir.Buffer.concat([f,s.toBuffer(),Ir.Buffer.from("ProgramDerivedAddress")]);const d=Uk(f);if($k(d))throw new Error("Invalid seeds, address must fall off the curve");return new sr(d)}static async createProgramAddress(e,s){return this.createProgramAddressSync(e,s)}static findProgramAddressSync(e,s){let f=255,d;for(;f!=0;){try{const h=e.concat(Ir.Buffer.from([f]));d=this.createProgramAddressSync(h,s)}catch(h){if(h instanceof TypeError)throw h;f--;continue}return[d,f]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,s){return this.findProgramAddressSync(e,s)}static isOnCurve(e){const s=new sr(e);return $k(s.toBytes())}}Wk=sr,sr.default=new Wk("11111111111111111111111111111111"),Y1.set(sr,{kind:"struct",fields:[["_bn","u256"]]});class PJ{constructor(e){if(this._publicKey=void 0,this._secretKey=void 0,e){const s=ci(e);if(e.length!==64)throw new Error("bad secret key size");this._publicKey=s.slice(32,64),this._secretKey=s.slice(0,32)}else this._secretKey=ci(Uz()),this._publicKey=ci(X1(this._secretKey))}get publicKey(){return new sr(this._publicKey)}get secretKey(){return Buffer.concat([this._secretKey,this._publicKey],64)}}const MJ=new sr("BPFLoader1111111111111111111111111111111111"),gd=1232,r4=127,J1=64;class qk extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(qk.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class Zk extends Error{constructor(e,s){super(`Transaction was not confirmed in ${s.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(Zk.prototype,"name",{value:"TransactionExpiredTimeoutError"});class kg extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(kg.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class Q1{constructor(e,s){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=s}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const s of this.keySegments()){if(e<s.length)return s[e];e-=s.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const f=new Map;this.keySegments().flat().forEach((h,E)=>{f.set(h.toBase58(),E)});const d=h=>{const E=f.get(h.toBase58());if(E===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return E};return e.map(h=>({programIdIndex:d(h.programId),accountKeyIndexes:h.keys.map(E=>d(E.pubkey)),data:h.data}))}}const gi=(t="publicKey")=>Kt.blob(32,t),jz=(t="signature")=>Kt.blob(64,t),yd=(t="string")=>{const e=Kt.struct([Kt.u32("length"),Kt.u32("lengthPadding"),Kt.blob(Kt.offset(Kt.u32(),-8),"chars")],t),s=e.decode.bind(e),f=e.encode.bind(e),d=e;return d.decode=(h,E)=>s(h,E).chars.toString(),d.encode=(h,E,P)=>{const R={chars:Ir.Buffer.from(h,"utf8")};return f(R,E,P)},d.alloc=h=>Kt.u32().span+Kt.u32().span+Ir.Buffer.from(h,"utf8").length,d},zz=(t="authorized")=>Kt.struct([gi("staker"),gi("withdrawer")],t),Hz=(t="lockup")=>Kt.struct([Kt.ns64("unixTimestamp"),Kt.ns64("epoch"),gi("custodian")],t),Kz=(t="voteInit")=>Kt.struct([gi("nodePubkey"),gi("authorizedVoter"),gi("authorizedWithdrawer"),Kt.u8("commission")],t),$z=(t="voteAuthorizeWithSeedArgs")=>Kt.struct([Kt.u32("voteAuthorizationType"),gi("currentAuthorityDerivedKeyOwnerPubkey"),yd("currentAuthorityDerivedKeySeed"),gi("newAuthorized")],t);function Xk(t,e){const s=d=>{if(d.span>=0)return d.span;if(typeof d.alloc=="function")return d.alloc(e[d.property]);if("count"in d&&"elementLayout"in d){const h=e[d.property];if(Array.isArray(h))return h.length*s(d.elementLayout)}else if("fields"in d)return Xk({layout:d},e[d.property]);return 0};let f=0;return t.layout.fields.forEach(d=>{f+=s(d)}),f}function da(t){let e=0,s=0;for(;;){let f=t.shift();if(e|=(f&127)<<s*7,s+=1,!(f&128))break}return e}function Oa(t,e){let s=e;for(;;){let f=s&127;if(s>>=7,s==0){t.push(f);break}else f|=128,t.push(f)}}function Ci(t,e){if(!t)throw new Error(e||"Assertion failed")}class ev{constructor(e,s){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=s}static compile(e,s){const f=new Map,d=E=>{const P=E.toBase58();let R=f.get(P);return R===void 0&&(R={isSigner:!1,isWritable:!1,isInvoked:!1},f.set(P,R)),R},h=d(s);h.isSigner=!0,h.isWritable=!0;for(const E of e){d(E.programId).isInvoked=!0;for(const P of E.keys){const R=d(P.pubkey);R.isSigner||=P.isSigner,R.isWritable||=P.isWritable}}return new ev(s,f)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];Ci(e.length<=256,"Max static account keys length exceeded");const s=e.filter(([,R])=>R.isSigner&&R.isWritable),f=e.filter(([,R])=>R.isSigner&&!R.isWritable),d=e.filter(([,R])=>!R.isSigner&&R.isWritable),h=e.filter(([,R])=>!R.isSigner&&!R.isWritable),E={numRequiredSignatures:s.length+f.length,numReadonlySignedAccounts:f.length,numReadonlyUnsignedAccounts:h.length};{Ci(s.length>0,"Expected at least one writable signer key");const[R]=s[0];Ci(R===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const P=[...s.map(([R])=>new sr(R)),...f.map(([R])=>new sr(R)),...d.map(([R])=>new sr(R)),...h.map(([R])=>new sr(R))];return[E,P]}extractTableLookup(e){const[s,f]=this.drainKeysFoundInLookupTable(e.state.addresses,E=>!E.isSigner&&!E.isInvoked&&E.isWritable),[d,h]=this.drainKeysFoundInLookupTable(e.state.addresses,E=>!E.isSigner&&!E.isInvoked&&!E.isWritable);if(!(s.length===0&&d.length===0))return[{accountKey:e.key,writableIndexes:s,readonlyIndexes:d},{writable:f,readonly:h}]}drainKeysFoundInLookupTable(e,s){const f=new Array,d=new Array;for(const[h,E]of this.keyMetaMap.entries())if(s(E)){const P=new sr(h),R=e.findIndex(q=>q.equals(P));R>=0&&(Ci(R<256,"Max lookup table index exceeded"),f.push(R),d.push(P),this.keyMetaMap.delete(h))}return[f,d]}}const Yk="Reached end of buffer unexpectedly";function su(t){if(t.length===0)throw new Error(Yk);return t.shift()}function ha(t,...e){const[s]=e;if(e.length===2?s+(e[1]??0)>t.length:s>=t.length)throw new Error(Yk);return t.splice(...e)}class ou{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(s=>new sr(s)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(s=>this.indexToProgramIds.set(s.programIdIndex,this.accountKeys[s.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:bo().decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Q1(this.staticAccountKeys)}static compile(e){const s=ev.compile(e.instructions,e.payerKey),[f,d]=s.getMessageComponents(),E=new Q1(d).compileInstructions(e.instructions).map(P=>({programIdIndex:P.programIdIndex,accounts:P.accountKeyIndexes,data:bo().encode(P.data)}));return new ou({header:f,accountKeys:d,recentBlockhash:e.recentBlockhash,instructions:E})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const s=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const f=e-s,h=this.accountKeys.length-s-this.header.numReadonlyUnsignedAccounts;return f<h}else{const f=s-this.header.numReadonlySignedAccounts;return e<f}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,s)=>!this.isProgramId(s))}serialize(){const e=this.accountKeys.length;let s=[];Oa(s,e);const f=this.instructions.map(ne=>{const{accounts:ue,programIdIndex:ge}=ne,xe=Array.from(bo().decode(ne.data));let pe=[];Oa(pe,ue.length);let Se=[];return Oa(Se,xe.length),{programIdIndex:ge,keyIndicesCount:Ir.Buffer.from(pe),keyIndices:ue,dataLength:Ir.Buffer.from(Se),data:xe}});let d=[];Oa(d,f.length);let h=Ir.Buffer.alloc(gd);Ir.Buffer.from(d).copy(h);let E=d.length;f.forEach(ne=>{const ge=Kt.struct([Kt.u8("programIdIndex"),Kt.blob(ne.keyIndicesCount.length,"keyIndicesCount"),Kt.seq(Kt.u8("keyIndex"),ne.keyIndices.length,"keyIndices"),Kt.blob(ne.dataLength.length,"dataLength"),Kt.seq(Kt.u8("userdatum"),ne.data.length,"data")]).encode(ne,h,E);E+=ge}),h=h.slice(0,E);const P=Kt.struct([Kt.blob(1,"numRequiredSignatures"),Kt.blob(1,"numReadonlySignedAccounts"),Kt.blob(1,"numReadonlyUnsignedAccounts"),Kt.blob(s.length,"keyCount"),Kt.seq(gi("key"),e,"keys"),gi("recentBlockhash")]),R={numRequiredSignatures:Ir.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Ir.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Ir.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Ir.Buffer.from(s),keys:this.accountKeys.map(ne=>ci(ne.toBytes())),recentBlockhash:bo().decode(this.recentBlockhash)};let q=Ir.Buffer.alloc(2048);const te=P.encode(R,q);return h.copy(q,te),q.slice(0,te+h.length)}static from(e){let s=[...e];const f=su(s);if(f!==(f&r4))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const d=su(s),h=su(s),E=da(s);let P=[];for(let ue=0;ue<E;ue++){const ge=ha(s,0,Vu);P.push(new sr(Ir.Buffer.from(ge)))}const R=ha(s,0,Vu),q=da(s);let te=[];for(let ue=0;ue<q;ue++){const ge=su(s),xe=da(s),pe=ha(s,0,xe),Se=da(s),Ce=ha(s,0,Se),Fe=bo().encode(Ir.Buffer.from(Ce));te.push({programIdIndex:ge,accounts:pe,data:Fe})}const ne={header:{numRequiredSignatures:f,numReadonlySignedAccounts:d,numReadonlyUnsignedAccounts:h},recentBlockhash:bo().encode(Ir.Buffer.from(R)),accountKeys:P,instructions:te};return new ou(ne)}}class r0{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const s of this.addressTableLookups)e+=s.readonlyIndexes.length+s.writableIndexes.length;return e}getAccountKeys(e){let s;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");s=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)s=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new Q1(this.staticAccountKeys,s)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const s=this.header.numRequiredSignatures,f=this.staticAccountKeys.length;if(e>=f){const d=e-f,h=this.addressTableLookups.reduce((E,P)=>E+P.writableIndexes.length,0);return d<h}else if(e>=this.header.numRequiredSignatures){const d=e-s,E=f-s-this.header.numReadonlyUnsignedAccounts;return d<E}else{const d=s-this.header.numReadonlySignedAccounts;return e<d}}resolveAddressTableLookups(e){const s={writable:[],readonly:[]};for(const f of this.addressTableLookups){const d=e.find(h=>h.key.equals(f.accountKey));if(!d)throw new Error(`Failed to find address lookup table account for table key ${f.accountKey.toBase58()}`);for(const h of f.writableIndexes)if(h<d.state.addresses.length)s.writable.push(d.state.addresses[h]);else throw new Error(`Failed to find address for index ${h} in address lookup table ${f.accountKey.toBase58()}`);for(const h of f.readonlyIndexes)if(h<d.state.addresses.length)s.readonly.push(d.state.addresses[h]);else throw new Error(`Failed to find address for index ${h} in address lookup table ${f.accountKey.toBase58()}`)}return s}static compile(e){const s=ev.compile(e.instructions,e.payerKey),f=new Array,d={writable:new Array,readonly:new Array},h=e.addressLookupTableAccounts||[];for(const te of h){const ne=s.extractTableLookup(te);if(ne!==void 0){const[ue,{writable:ge,readonly:xe}]=ne;f.push(ue),d.writable.push(...ge),d.readonly.push(...xe)}}const[E,P]=s.getMessageComponents(),q=new Q1(P,d).compileInstructions(e.instructions);return new r0({header:E,staticAccountKeys:P,recentBlockhash:e.recentBlockhash,compiledInstructions:q,addressTableLookups:f})}serialize(){const e=Array();Oa(e,this.staticAccountKeys.length);const s=this.serializeInstructions(),f=Array();Oa(f,this.compiledInstructions.length);const d=this.serializeAddressTableLookups(),h=Array();Oa(h,this.addressTableLookups.length);const E=Kt.struct([Kt.u8("prefix"),Kt.struct([Kt.u8("numRequiredSignatures"),Kt.u8("numReadonlySignedAccounts"),Kt.u8("numReadonlyUnsignedAccounts")],"header"),Kt.blob(e.length,"staticAccountKeysLength"),Kt.seq(gi(),this.staticAccountKeys.length,"staticAccountKeys"),gi("recentBlockhash"),Kt.blob(f.length,"instructionsLength"),Kt.blob(s.length,"serializedInstructions"),Kt.blob(h.length,"addressTableLookupsLength"),Kt.blob(d.length,"serializedAddressTableLookups")]),P=new Uint8Array(gd),q=E.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(te=>te.toBytes()),recentBlockhash:bo().decode(this.recentBlockhash),instructionsLength:new Uint8Array(f),serializedInstructions:s,addressTableLookupsLength:new Uint8Array(h),serializedAddressTableLookups:d},P);return P.slice(0,q)}serializeInstructions(){let e=0;const s=new Uint8Array(gd);for(const f of this.compiledInstructions){const d=Array();Oa(d,f.accountKeyIndexes.length);const h=Array();Oa(h,f.data.length);const E=Kt.struct([Kt.u8("programIdIndex"),Kt.blob(d.length,"encodedAccountKeyIndexesLength"),Kt.seq(Kt.u8(),f.accountKeyIndexes.length,"accountKeyIndexes"),Kt.blob(h.length,"encodedDataLength"),Kt.blob(f.data.length,"data")]);e+=E.encode({programIdIndex:f.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(d),accountKeyIndexes:f.accountKeyIndexes,encodedDataLength:new Uint8Array(h),data:f.data},s,e)}return s.slice(0,e)}serializeAddressTableLookups(){let e=0;const s=new Uint8Array(gd);for(const f of this.addressTableLookups){const d=Array();Oa(d,f.writableIndexes.length);const h=Array();Oa(h,f.readonlyIndexes.length);const E=Kt.struct([gi("accountKey"),Kt.blob(d.length,"encodedWritableIndexesLength"),Kt.seq(Kt.u8(),f.writableIndexes.length,"writableIndexes"),Kt.blob(h.length,"encodedReadonlyIndexesLength"),Kt.seq(Kt.u8(),f.readonlyIndexes.length,"readonlyIndexes")]);e+=E.encode({accountKey:f.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(d),writableIndexes:f.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(h),readonlyIndexes:f.readonlyIndexes},s,e)}return s.slice(0,e)}static deserialize(e){let s=[...e];const f=su(s),d=f&r4;Ci(f!==d,"Expected versioned message but received legacy message");const h=d;Ci(h===0,`Expected versioned message with version 0 but found version ${h}`);const E={numRequiredSignatures:su(s),numReadonlySignedAccounts:su(s),numReadonlyUnsignedAccounts:su(s)},P=[],R=da(s);for(let xe=0;xe<R;xe++)P.push(new sr(ha(s,0,Vu)));const q=bo().encode(ha(s,0,Vu)),te=da(s),ne=[];for(let xe=0;xe<te;xe++){const pe=su(s),Se=da(s),Ce=ha(s,0,Se),Fe=da(s),We=new Uint8Array(ha(s,0,Fe));ne.push({programIdIndex:pe,accountKeyIndexes:Ce,data:We})}const ue=da(s),ge=[];for(let xe=0;xe<ue;xe++){const pe=new sr(ha(s,0,Vu)),Se=da(s),Ce=ha(s,0,Se),Fe=da(s),We=ha(s,0,Fe);ge.push({accountKey:pe,writableIndexes:Ce,readonlyIndexes:We})}return new r0({header:E,staticAccountKeys:P,recentBlockhash:q,compiledInstructions:ne,addressTableLookups:ge})}}const Jk={deserializeMessageVersion(t){const e=t[0],s=e&r4;return s===e?"legacy":s},deserialize:t=>{const e=Jk.deserializeMessageVersion(t);if(e==="legacy")return ou.from(t);if(e===0)return r0.deserialize(t);throw new Error(`Transaction message version ${e} deserialization is not supported`)}};let sf=function(t){return t[t.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",t[t.PROCESSED=1]="PROCESSED",t[t.TIMED_OUT=2]="TIMED_OUT",t[t.NONCE_INVALID=3]="NONCE_INVALID",t}({});const Vz=Ir.Buffer.alloc(J1).fill(0);class Ji{constructor(e){this.keys=void 0,this.programId=void 0,this.data=Ir.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:s,isWritable:f})=>({pubkey:e.toJSON(),isSigner:s,isWritable:f})),programId:this.programId.toJSON(),data:[...this.data]}}}class Ei{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:s,nonceInfo:f}=e;this.minNonceContextSlot=s,this.nonceInfo=f}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:s,lastValidBlockHeight:f}=e;this.recentBlockhash=s,this.lastValidBlockHeight=f}else{const{recentBlockhash:s,nonceInfo:f}=e;f&&(this.nonceInfo=f),this.recentBlockhash=s}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.forEach(s=>{"instructions"in s?this.instructions=this.instructions.concat(s.instructions):"data"in s&&"programId"in s&&"keys"in s?this.instructions.push(s):this.instructions.push(new Ji(s))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,s;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?s=[this.nonceInfo.nonceInstruction,...this.instructions]:s=this.instructions):(e=this.recentBlockhash,s=this.instructions),!e)throw new Error("Transaction recentBlockhash required");s.length<1&&console.warn("No instructions provided");let f;if(this.feePayer)f=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)f=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let pe=0;pe<s.length;pe++)if(s[pe].programId===void 0)throw new Error(`Transaction instruction index ${pe} has undefined program id`);const d=[],h=[];s.forEach(pe=>{pe.keys.forEach(Ce=>{h.push({...Ce})});const Se=pe.programId.toString();d.includes(Se)||d.push(Se)}),d.forEach(pe=>{h.push({pubkey:new sr(pe),isSigner:!1,isWritable:!1})});const E=[];h.forEach(pe=>{const Se=pe.pubkey.toString(),Ce=E.findIndex(Fe=>Fe.pubkey.toString()===Se);Ce>-1?(E[Ce].isWritable=E[Ce].isWritable||pe.isWritable,E[Ce].isSigner=E[Ce].isSigner||pe.isSigner):E.push(pe)}),E.sort(function(pe,Se){if(pe.isSigner!==Se.isSigner)return pe.isSigner?-1:1;if(pe.isWritable!==Se.isWritable)return pe.isWritable?-1:1;const Ce={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return pe.pubkey.toBase58().localeCompare(Se.pubkey.toBase58(),"en",Ce)});const P=E.findIndex(pe=>pe.pubkey.equals(f));if(P>-1){const[pe]=E.splice(P,1);pe.isSigner=!0,pe.isWritable=!0,E.unshift(pe)}else E.unshift({pubkey:f,isSigner:!0,isWritable:!0});for(const pe of this.signatures){const Se=E.findIndex(Ce=>Ce.pubkey.equals(pe.publicKey));if(Se>-1)E[Se].isSigner||(E[Se].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${pe.publicKey.toString()}`)}let R=0,q=0,te=0;const ne=[],ue=[];E.forEach(({pubkey:pe,isSigner:Se,isWritable:Ce})=>{Se?(ne.push(pe.toString()),R+=1,Ce||(q+=1)):(ue.push(pe.toString()),Ce||(te+=1))});const ge=ne.concat(ue),xe=s.map(pe=>{const{data:Se,programId:Ce}=pe;return{programIdIndex:ge.indexOf(Ce.toString()),accounts:pe.keys.map(Fe=>ge.indexOf(Fe.pubkey.toString())),data:bo().encode(Se)}});return xe.forEach(pe=>{Ci(pe.programIdIndex>=0),pe.accounts.forEach(Se=>Ci(Se>=0))}),new ou({header:{numRequiredSignatures:R,numReadonlySignedAccounts:q,numReadonlyUnsignedAccounts:te},accountKeys:ge,recentBlockhash:e,instructions:xe})}_compile(){const e=this.compileMessage(),s=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===s.length&&this.signatures.every((d,h)=>s[h].equals(d.publicKey))||(this.signatures=s.map(f=>({signature:null,publicKey:f}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const s=new Set;this.signatures=e.filter(f=>{const d=f.toString();return s.has(d)?!1:(s.add(d),!0)}).map(f=>({signature:null,publicKey:f}))}sign(...e){if(e.length===0)throw new Error("No signers");const s=new Set,f=[];for(const h of e){const E=h.publicKey.toString();s.has(E)||(s.add(E),f.push(h))}this.signatures=f.map(h=>({signature:null,publicKey:h.publicKey}));const d=this._compile();this._partialSign(d,...f)}partialSign(...e){if(e.length===0)throw new Error("No signers");const s=new Set,f=[];for(const h of e){const E=h.publicKey.toString();s.has(E)||(s.add(E),f.push(h))}const d=this._compile();this._partialSign(d,...f)}_partialSign(e,...s){const f=e.serialize();s.forEach(d=>{const h=n4(f,d.secretKey);this._addSignature(d.publicKey,ci(h))})}addSignature(e,s){this._compile(),this._addSignature(e,s)}_addSignature(e,s){Ci(s.length===64);const f=this.signatures.findIndex(d=>e.equals(d.publicKey));if(f<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[f].signature=Ir.Buffer.from(s)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,s){const f={};for(const{signature:d,publicKey:h}of this.signatures)d===null?s&&(f.missing||=[]).push(h):Dz(d,e,h.toBytes())||(f.invalid||=[]).push(h);return f.invalid||f.missing?f:void 0}serialize(e){const{requireAllSignatures:s,verifySignatures:f}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),d=this.serializeMessage();if(f){const h=this._getMessageSignednessErrors(d,s);if(h){let E="Signature verification failed.";throw h.invalid&&(E+=`
|
||
Invalid signature for public key${h.invalid.length===1?"":"(s)"} [\`${h.invalid.map(P=>P.toBase58()).join("`, `")}\`].`),h.missing&&(E+=`
|
||
Missing signature for public key${h.missing.length===1?"":"(s)"} [\`${h.missing.map(P=>P.toBase58()).join("`, `")}\`].`),new Error(E)}}return this._serialize(d)}_serialize(e){const{signatures:s}=this,f=[];Oa(f,s.length);const d=f.length+s.length*64+e.length,h=Ir.Buffer.alloc(d);return Ci(s.length<256),Ir.Buffer.from(f).copy(h,0),s.forEach(({signature:E},P)=>{E!==null&&(Ci(E.length===64,"signature has invalid length"),Ir.Buffer.from(E).copy(h,f.length+P*64))}),e.copy(h,f.length+s.length*64),Ci(h.length<=gd,`Transaction too large: ${h.length} > ${gd}`),h}get keys(){return Ci(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return Ci(this.instructions.length===1),this.instructions[0].programId}get data(){return Ci(this.instructions.length===1),this.instructions[0].data}static from(e){let s=[...e];const f=da(s);let d=[];for(let h=0;h<f;h++){const E=ha(s,0,J1);d.push(bo().encode(Ir.Buffer.from(E)))}return Ei.populate(ou.from(s),d)}static populate(e,s=[]){const f=new Ei;return f.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(f.feePayer=e.accountKeys[0]),s.forEach((d,h)=>{const E={signature:d==bo().encode(Vz)?null:bo().decode(d),publicKey:e.accountKeys[h]};f.signatures.push(E)}),e.instructions.forEach(d=>{const h=d.accounts.map(E=>{const P=e.accountKeys[E];return{pubkey:P,isSigner:f.signatures.some(R=>R.publicKey.toString()===P.toString())||e.isAccountSigner(E),isWritable:e.isAccountWritable(E)}});f.instructions.push(new Ji({keys:h,programId:e.accountKeys[d.programIdIndex],data:bo().decode(d.data)}))}),f._message=e,f._json=f.toJSON(),f}}class Qk{constructor(e){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}static decompile(e,s){const{header:f,compiledInstructions:d,recentBlockhash:h}=e,{numRequiredSignatures:E,numReadonlySignedAccounts:P,numReadonlyUnsignedAccounts:R}=f,q=E-P;Ci(q>0,"Message header is invalid");const te=e.staticAccountKeys.length-E-R;Ci(te>=0,"Message header is invalid");const ne=e.getAccountKeys(s),ue=ne.get(0);if(ue===void 0)throw new Error("Failed to decompile message because no account keys were found");const ge=[];for(const xe of d){const pe=[];for(const Ce of xe.accountKeyIndexes){const Fe=ne.get(Ce);if(Fe===void 0)throw new Error(`Failed to find key for account key index ${Ce}`);const We=Ce<E;let xt;We?xt=Ce<q:Ce<ne.staticAccountKeys.length?xt=Ce-E<te:xt=Ce-ne.staticAccountKeys.length<ne.accountKeysFromLookups.writable.length,pe.push({pubkey:Fe,isSigner:Ce<f.numRequiredSignatures,isWritable:xt})}const Se=ne.get(xe.programIdIndex);if(Se===void 0)throw new Error(`Failed to find program id for program id index ${xe.programIdIndex}`);ge.push(new Ji({programId:Se,data:ci(xe.data),keys:pe}))}return new Qk({payerKey:ue,instructions:ge,recentBlockhash:h})}compileToLegacyMessage(){return ou.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(e){return r0.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}class i0{get version(){return this.message.version}constructor(e,s){if(this.signatures=void 0,this.message=void 0,s!==void 0)Ci(s.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=s;else{const f=[];for(let d=0;d<e.header.numRequiredSignatures;d++)f.push(new Uint8Array(J1));this.signatures=f}this.message=e}serialize(){const e=this.message.serialize(),s=Array();Oa(s,this.signatures.length);const f=Kt.struct([Kt.blob(s.length,"encodedSignaturesLength"),Kt.seq(jz(),this.signatures.length,"signatures"),Kt.blob(e.length,"serializedMessage")]),d=new Uint8Array(2048),h=f.encode({encodedSignaturesLength:new Uint8Array(s),signatures:this.signatures,serializedMessage:e},d);return d.slice(0,h)}static deserialize(e){let s=[...e];const f=[],d=da(s);for(let E=0;E<d;E++)f.push(new Uint8Array(ha(s,0,J1)));const h=Jk.deserialize(new Uint8Array(s));return new i0(h,f)}sign(e){const s=this.message.serialize(),f=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const d of e){const h=f.findIndex(E=>E.equals(d.publicKey));Ci(h>=0,`Cannot sign with non signer key ${d.publicKey.toBase58()}`),this.signatures[h]=n4(s,d.secretKey)}}addSignature(e,s){Ci(s.byteLength===64,"Signature must be 64 bytes long");const d=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(h=>h.equals(e));Ci(d>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[d]=s}}const eT=1e3/(160/64),Wu=new sr("SysvarC1ock11111111111111111111111111111111"),UJ=new sr("SysvarEpochSchedu1e111111111111111111111111"),DJ=new sr("Sysvar1nstructions1111111111111111111111111"),i4=new sr("SysvarRecentB1ockHashes11111111111111111111"),Tg=new sr("SysvarRent111111111111111111111111111111111"),LJ=new sr("SysvarRewards111111111111111111111111111111"),FJ=new sr("SysvarS1otHashes111111111111111111111111111"),jJ=new sr("SysvarS1otHistory11111111111111111111111111"),s4=new sr("SysvarStakeHistory1111111111111111111111111");class tv extends Error{constructor({action:e,signature:s,transactionMessage:f,logs:d}){const h=d?`Logs:
|
||
${JSON.stringify(d.slice(-10),null,2)}. `:"",E="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";let P;switch(e){case"send":P=`Transaction ${s} resulted in an error.
|
||
${f}. `+h+E;break;case"simulate":P=`Simulation failed.
|
||
Message: ${f}.
|
||
`+h+E;break;default:P=`Unknown action '${(R=>R)(e)}'`}super(P),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=s,this.transactionMessage=f,this.transactionLogs=d||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){const e=this.transactionLogs;if(!(e!=null&&typeof e=="object"&&"then"in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((s,f)=>{e.getTransaction(this.signature).then(d=>{if(d&&d.meta&&d.meta.logMessages){const h=d.meta.logMessages;this.transactionLogs=h,s(h)}else f(new Error("Log messages not found"))}).catch(f)})),await this.transactionLogs}}const zJ=null;class Pr extends Error{constructor({code:e,message:s,data:f},d){super(d!=null?`${d}: ${s}`:s),this.code=void 0,this.data=void 0,this.code=e,this.data=f,this.name="SolanaJSONRPCError"}}async function tT(t,e,s,f){const d=f&&{skipPreflight:f.skipPreflight,preflightCommitment:f.preflightCommitment||f.commitment,maxRetries:f.maxRetries,minContextSlot:f.minContextSlot},h=await t.sendTransaction(e,s,d);let E;if(e.recentBlockhash!=null&&e.lastValidBlockHeight!=null)E=(await t.confirmTransaction({abortSignal:f?.abortSignal,signature:h,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},f&&f.commitment)).value;else if(e.minNonceContextSlot!=null&&e.nonceInfo!=null){const{nonceInstruction:P}=e.nonceInfo,R=P.keys[0].pubkey;E=(await t.confirmTransaction({abortSignal:f?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:R,nonceValue:e.nonceInfo.nonce,signature:h},f&&f.commitment)).value}else f?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),E=(await t.confirmTransaction(h,f&&f.commitment)).value;if(E.err)throw h!=null?new tv({action:"send",signature:h,transactionMessage:`Status: (${JSON.stringify(E)})`}):new Error(`Transaction ${h} failed (${JSON.stringify(E)})`);return h}function md(t){return new Promise(e=>setTimeout(e,t))}function Si(t,e){const s=t.layout.span>=0?t.layout.span:Xk(t,e),f=Ir.Buffer.alloc(s),d=Object.assign({instruction:t.index},e);return t.layout.encode(d,f),f}function ji(t,e){let s;try{s=t.layout.decode(e)}catch(f){throw new Error("invalid instruction; "+f)}if(s.instruction!==t.index)throw new Error(`invalid instruction; instruction index mismatch ${s.instruction} != ${t.index}`);return s}const Wz=Kt.nu64("lamportsPerSignature"),nT=Kt.struct([Kt.u32("version"),Kt.u32("state"),gi("authorizedPubkey"),gi("nonce"),Kt.struct([Wz],"feeCalculator")]),rT=nT.span;class o4{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const s=nT.decode(ci(e),0);return new o4({authorizedPubkey:new sr(s.authorizedPubkey),nonce:new sr(s.nonce).toString(),feeCalculator:s.feeCalculator})}}const Gz=t=>{const e=t.decode.bind(t),s=t.encode.bind(t);return{decode:e,encode:s}},s0=(t=>e=>{const s=(0,Kt.blob)(t,e),{encode:f,decode:d}=Gz(s),h=s;return h.decode=(E,P)=>{const R=d(E,P);return(0,Y6.toBigIntLE)(Ir.Buffer.from(R))},h.encode=(E,P,R)=>{const q=(0,Y6.toBufferLE)(E,t);return f(q,P,R)},h})(8);class KJ{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const f=BufferLayout.u32("instruction").decode(e.data);let d;for(const[h,E]of Object.entries(as))if(E.index==f){d=h;break}if(!d)throw new Error("Instruction type incorrect; not a SystemInstruction");return d}static decodeCreateAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:s,space:f,programId:d}=ji(as.Create,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:s,space:f,programId:new sr(d)}}static decodeTransfer(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:s}=ji(as.Transfer,e.data);return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:s}}static decodeTransferWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:s,seed:f,programId:d}=ji(as.TransferWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:s,seed:f,programId:new sr(d)}}static decodeAllocate(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{space:s}=ji(as.Allocate,e.data);return{accountPubkey:e.keys[0].pubkey,space:s}}static decodeAllocateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:s,seed:f,space:d,programId:h}=ji(as.AllocateWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new sr(s),seed:f,space:d,programId:new sr(h)}}static decodeAssign(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{programId:s}=ji(as.Assign,e.data);return{accountPubkey:e.keys[0].pubkey,programId:new sr(s)}}static decodeAssignWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:s,seed:f,programId:d}=ji(as.AssignWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new sr(s),seed:f,programId:new sr(d)}}static decodeCreateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{base:s,seed:f,lamports:d,space:h,programId:E}=ji(as.CreateWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new sr(s),seed:f,lamports:d,space:h,programId:new sr(E)}}static decodeNonceInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{authorized:s}=ji(as.InitializeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new sr(s)}}static decodeNonceAdvance(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),ji(as.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static decodeNonceWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:s}=ji(as.WithdrawNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:s}}static decodeNonceAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:s}=ji(as.AuthorizeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new sr(s)}}static checkProgramId(e){if(!e.equals(vo.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(e,s){if(e.length<s)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${s}`)}}const as=Object.freeze({Create:{index:0,layout:Kt.struct([Kt.u32("instruction"),Kt.ns64("lamports"),Kt.ns64("space"),gi("programId")])},Assign:{index:1,layout:Kt.struct([Kt.u32("instruction"),gi("programId")])},Transfer:{index:2,layout:Kt.struct([Kt.u32("instruction"),s0("lamports")])},CreateWithSeed:{index:3,layout:Kt.struct([Kt.u32("instruction"),gi("base"),yd("seed"),Kt.ns64("lamports"),Kt.ns64("space"),gi("programId")])},AdvanceNonceAccount:{index:4,layout:Kt.struct([Kt.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:Kt.struct([Kt.u32("instruction"),Kt.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:Kt.struct([Kt.u32("instruction"),gi("authorized")])},AuthorizeNonceAccount:{index:7,layout:Kt.struct([Kt.u32("instruction"),gi("authorized")])},Allocate:{index:8,layout:Kt.struct([Kt.u32("instruction"),Kt.ns64("space")])},AllocateWithSeed:{index:9,layout:Kt.struct([Kt.u32("instruction"),gi("base"),yd("seed"),Kt.ns64("space"),gi("programId")])},AssignWithSeed:{index:10,layout:Kt.struct([Kt.u32("instruction"),gi("base"),yd("seed"),gi("programId")])},TransferWithSeed:{index:11,layout:Kt.struct([Kt.u32("instruction"),s0("lamports"),yd("seed"),gi("programId")])},UpgradeNonceAccount:{index:12,layout:Kt.struct([Kt.u32("instruction")])}});class vo{constructor(){}static createAccount(e){const s=as.Create,f=Si(s,{lamports:e.lamports,space:e.space,programId:ci(e.programId.toBuffer())});return new Ji({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:f})}static transfer(e){let s,f;if("basePubkey"in e){const d=as.TransferWithSeed;s=Si(d,{lamports:BigInt(e.lamports),seed:e.seed,programId:ci(e.programId.toBuffer())}),f=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{const d=as.Transfer;s=Si(d,{lamports:BigInt(e.lamports)}),f=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new Ji({keys:f,programId:this.programId,data:s})}static assign(e){let s,f;if("basePubkey"in e){const d=as.AssignWithSeed;s=Si(d,{base:ci(e.basePubkey.toBuffer()),seed:e.seed,programId:ci(e.programId.toBuffer())}),f=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const d=as.Assign;s=Si(d,{programId:ci(e.programId.toBuffer())}),f=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Ji({keys:f,programId:this.programId,data:s})}static createAccountWithSeed(e){const s=as.CreateWithSeed,f=Si(s,{base:ci(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:ci(e.programId.toBuffer())});let d=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||d.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new Ji({keys:d,programId:this.programId,data:f})}static createNonceAccount(e){const s=new Ei;"basePubkey"in e&&"seed"in e?s.add(vo.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:rT,programId:this.programId})):s.add(vo.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:rT,programId:this.programId}));const f={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return s.add(this.nonceInitialize(f)),s}static nonceInitialize(e){const s=as.InitializeNonceAccount,f=Si(s,{authorized:ci(e.authorizedPubkey.toBuffer())}),d={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:i4,isSigner:!1,isWritable:!1},{pubkey:Tg,isSigner:!1,isWritable:!1}],programId:this.programId,data:f};return new Ji(d)}static nonceAdvance(e){const s=as.AdvanceNonceAccount,f=Si(s),d={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:i4,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:f};return new Ji(d)}static nonceWithdraw(e){const s=as.WithdrawNonceAccount,f=Si(s,{lamports:e.lamports});return new Ji({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:i4,isSigner:!1,isWritable:!1},{pubkey:Tg,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:f})}static nonceAuthorize(e){const s=as.AuthorizeNonceAccount,f=Si(s,{authorized:ci(e.newAuthorizedPubkey.toBuffer())});return new Ji({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:f})}static allocate(e){let s,f;if("basePubkey"in e){const d=as.AllocateWithSeed;s=Si(d,{base:ci(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:ci(e.programId.toBuffer())}),f=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const d=as.Allocate;s=Si(d,{space:e.space}),f=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Ji({keys:f,programId:this.programId,data:s})}}vo.programId=new sr("11111111111111111111111111111111");const qz=gd-300;class o0{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/o0.chunkSize)+1+1)}static async load(e,s,f,d,h){{const ne=await e.getMinimumBalanceForRentExemption(h.length),ue=await e.getAccountInfo(f.publicKey,"confirmed");let ge=null;if(ue!==null){if(ue.executable)return console.error("Program load failed, account is already executable"),!1;ue.data.length!==h.length&&(ge=ge||new Ei,ge.add(vo.allocate({accountPubkey:f.publicKey,space:h.length}))),ue.owner.equals(d)||(ge=ge||new Ei,ge.add(vo.assign({accountPubkey:f.publicKey,programId:d}))),ue.lamports<ne&&(ge=ge||new Ei,ge.add(vo.transfer({fromPubkey:s.publicKey,toPubkey:f.publicKey,lamports:ne-ue.lamports})))}else ge=new Ei().add(vo.createAccount({fromPubkey:s.publicKey,newAccountPubkey:f.publicKey,lamports:ne>0?ne:1,space:h.length,programId:d}));ge!==null&&await tT(e,ge,[s,f],{commitment:"confirmed"})}const E=Kt.struct([Kt.u32("instruction"),Kt.u32("offset"),Kt.u32("bytesLength"),Kt.u32("bytesLengthPadding"),Kt.seq(Kt.u8("byte"),Kt.offset(Kt.u32(),-8),"bytes")]),P=o0.chunkSize;let R=0,q=h,te=[];for(;q.length>0;){const ne=q.slice(0,P),ue=Ir.Buffer.alloc(P+16);E.encode({instruction:0,offset:R,bytes:ne,bytesLength:0,bytesLengthPadding:0},ue);const ge=new Ei().add({keys:[{pubkey:f.publicKey,isSigner:!0,isWritable:!0}],programId:d,data:ue});te.push(tT(e,ge,[s,f],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await md(1e3/4),R+=P,q=q.slice(P)}await Promise.all(te);{const ne=Kt.struct([Kt.u32("instruction")]),ue=Ir.Buffer.alloc(ne.span);ne.encode({instruction:1},ue);const ge=new Ei().add({keys:[{pubkey:f.publicKey,isSigner:!0,isWritable:!0},{pubkey:Tg,isSigner:!1,isWritable:!1}],programId:d,data:ue}),xe="processed",pe=await e.sendTransaction(ge,[s,f],{preflightCommitment:xe}),{context:Se,value:Ce}=await e.confirmTransaction({signature:pe,lastValidBlockHeight:ge.lastValidBlockHeight,blockhash:ge.recentBlockhash},xe);if(Ce.err)throw new Error(`Transaction ${pe} failed (${JSON.stringify(Ce)})`);for(;;){try{if(await e.getSlot({commitment:xe})>Se.slot)break}catch{}await new Promise(Fe=>setTimeout(Fe,Math.round(eT/2)))}}return!0}}o0.chunkSize=qz;const $J=new sr("BPFLoader2111111111111111111111111111111111");class VJ{static getMinNumSignatures(e){return o0.getMinNumSignatures(e)}static load(e,s,f,d,h){return o0.load(e,s,f,h,d)}}function Zz(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var a4,iT;function Xz(){if(iT)return a4;iT=1;var t=Object.prototype.toString,e=Object.keys||function(f){var d=[];for(var h in f)d.push(h);return d};function s(f,d){var h,E,P,R,q,te,ne;if(f===!0)return"true";if(f===!1)return"false";switch(typeof f){case"object":if(f===null)return null;if(f.toJSON&&typeof f.toJSON=="function")return s(f.toJSON(),d);if(ne=t.call(f),ne==="[object Array]"){for(P="[",E=f.length-1,h=0;h<E;h++)P+=s(f[h],!0)+",";return E>-1&&(P+=s(f[h],!0)),P+"]"}else if(ne==="[object Object]"){for(R=e(f).sort(),E=R.length,P="",h=0;h<E;)q=R[h],te=s(f[q],!1),te!==void 0&&(P&&(P+=","),P+=JSON.stringify(q)+":"+te),h++;return"{"+P+"}"}else return JSON.stringify(f);case"function":case"undefined":return d?null:void 0;case"string":return JSON.stringify(f);default:return isFinite(f)?f:null}}return a4=function(f){var d=s(f,!1);if(d!==void 0)return""+d},a4}var Yz=Xz(),sT=Zz(Yz);const Cg=32;function c4(t){let e=0;for(;t>1;)t/=2,e++;return e}function Jz(t){return t===0?1:(t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t+1)}class Qz{constructor(e,s,f,d,h){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=s,this.warmup=f,this.firstNormalEpoch=d,this.firstNormalSlot=h}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){const s=c4(Jz(e+Cg+1))-c4(Cg)-1,f=this.getSlotsInEpoch(s),d=e-(f-Cg);return[s,d]}else{const s=e-this.firstNormalSlot,f=Math.floor(s/this.slotsPerEpoch),d=this.firstNormalEpoch+f,h=s%this.slotsPerEpoch;return[d,h]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(Math.pow(2,e)-1)*Cg:(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?Math.pow(2,e+c4(Cg)):this.slotsPerEpoch}}var eH=globalThis.fetch;class tH extends Nz{constructor(e,s,f){const d=h=>{const E=Hk(h,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...s});return"socket"in E?this.underlyingSocket=E.socket:this.underlyingSocket=E,E};super(d,e,s,f),this.underlyingSocket=void 0}call(...e){const s=this.underlyingSocket?.readyState;return s===1?super.call(...e):Promise.reject(new Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+s+")"))}notify(...e){const s=this.underlyingSocket?.readyState;return s===1?super.notify(...e):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+s+")"))}}function nH(t,e){let s;try{s=t.layout.decode(e)}catch(f){throw new Error("invalid instruction; "+f)}if(s.typeIndex!==t.index)throw new Error(`invalid account data; account type mismatch ${s.typeIndex} != ${t.index}`);return s}const oT=56;class aT{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const s=nH(rH,e),f=e.length-oT;Ci(f>=0,"lookup table is invalid"),Ci(f%32===0,"lookup table is invalid");const d=f/32,{addresses:h}=Kt.struct([Kt.seq(gi(),d,"addresses")]).decode(e.slice(oT));return{deactivationSlot:s.deactivationSlot,lastExtendedSlot:s.lastExtendedSlot,lastExtendedSlotStartIndex:s.lastExtendedStartIndex,authority:s.authority.length!==0?new sr(s.authority[0]):void 0,addresses:h.map(E=>new sr(E))}}}const rH={index:1,layout:Kt.struct([Kt.u32("typeIndex"),s0("deactivationSlot"),Kt.nu64("lastExtendedSlot"),Kt.u8("lastExtendedStartIndex"),Kt.u8(),Kt.seq(gi(),Kt.offset(Kt.u8(),-1),"authority")])},iH=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function sH(t){const e=t.match(iH);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${t}\``);const[s,f,d,h]=e,E=t.startsWith("https:")?"wss:":"ws:",P=d==null?null:parseInt(d.slice(1),10),R=P==null?"":`:${P+1}`;return`${E}//${f}${R}${h}`}const Ss=pd(e4(sr),rr(),t=>new sr(t)),cT=t4([rr(),Es("base64")]),u4=pd(e4(Ir.Buffer),cT,t=>Ir.Buffer.from(t[0],"base64")),oH=30*1e3;function aH(t){if(/^https?:/.test(t)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return t}function Qi(t){let e,s;if(typeof t=="string")e=t;else if(t){const{commitment:f,...d}=t;e=f,s=d}return{commitment:e,config:s}}function uT(t){return t.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function lT(t){return Wo([zn({jsonrpc:Es("2.0"),id:rr(),result:t}),zn({jsonrpc:Es("2.0"),id:rr(),error:zn({code:hd(),message:rr(),data:Dr(Cz())})})])}const cH=lT(hd());function ui(t){return pd(lT(t),cH,e=>"error"in e?e:{...e,result:dr(e.result,t)})}function Os(t){return ui(zn({context:zn({slot:gn()}),value:t}))}function nv(t){return zn({context:zn({slot:gn()}),value:t})}function l4(t,e){return t===0?new r0({header:e.header,staticAccountKeys:e.accountKeys.map(s=>new sr(s)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(s=>({programIdIndex:s.programIdIndex,accountKeyIndexes:s.accounts,data:bo().decode(s.data)})),addressTableLookups:e.addressTableLookups}):new ou(e)}const uH=zn({foundation:gn(),foundationTerm:gn(),initial:gn(),taper:gn(),terminal:gn()}),lH=ui(mr(vr(zn({epoch:gn(),effectiveSlot:gn(),amount:gn(),postBalance:gn(),commission:Dr(vr(gn()))})))),fH=mr(zn({slot:gn(),prioritizationFee:gn()})),dH=zn({total:gn(),validator:gn(),foundation:gn(),epoch:gn()}),hH=zn({epoch:gn(),slotIndex:gn(),slotsInEpoch:gn(),absoluteSlot:gn(),blockHeight:Dr(gn()),transactionCount:Dr(gn())}),pH=zn({slotsPerEpoch:gn(),leaderScheduleSlotOffset:gn(),warmup:iu(),firstNormalEpoch:gn(),firstNormalSlot:gn()}),gH=jk(rr(),mr(gn())),bd=vr(Wo([zn({}),rr()])),yH=zn({err:bd}),mH=Es("receivedSignature"),bH=zn({"solana-core":rr(),"feature-set":Dr(gn())}),vH=zn({program:rr(),programId:Ss,parsed:hd()}),wH=zn({programId:Ss,accounts:mr(Ss),data:rr()}),fT=Os(zn({err:vr(Wo([zn({}),rr()])),logs:vr(mr(rr())),accounts:Dr(vr(mr(vr(zn({executable:iu(),owner:rr(),lamports:gn(),data:mr(rr()),rentEpoch:Dr(gn())}))))),unitsConsumed:Dr(gn()),returnData:Dr(vr(zn({programId:rr(),data:t4([rr(),Es("base64")])}))),innerInstructions:Dr(vr(mr(zn({index:gn(),instructions:mr(Wo([vH,wH]))}))))})),_H=Os(zn({byIdentity:jk(rr(),mr(gn())),range:zn({firstSlot:gn(),lastSlot:gn()})}));function EH(t,e,s,f,d,h){const E=s||eH;let P;h!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let R;return f&&(R=async(te,ne)=>{const ue=await new Promise((ge,xe)=>{try{f(te,ne,(pe,Se)=>ge([pe,Se]))}catch(pe){xe(pe)}});return await E(...ue)}),new(Mz())(async(te,ne)=>{const ue={method:"POST",body:te,agent:P,headers:Object.assign({"Content-Type":"application/json"},e||{},EK)};try{let ge=5,xe,pe=500;for(;R?xe=await R(t,ue):xe=await E(t,ue),!(xe.status!==429||d===!0||(ge-=1,ge===0));)console.error(`Server responded with ${xe.status} ${xe.statusText}. Retrying after ${pe}ms delay...`),await md(pe),pe*=2;const Se=await xe.text();xe.ok?ne(null,Se):ne(new Error(`${xe.status} ${xe.statusText}: ${Se}`))}catch(ge){ge instanceof Error&&ne(ge)}},{})}function SH(t){return(e,s)=>new Promise((f,d)=>{t.request(e,s,(h,E)=>{if(h){d(h);return}f(E)})})}function AH(t){return e=>new Promise((s,f)=>{e.length===0&&s([]);const d=e.map(h=>t.request(h.methodName,h.args));t.request(d,(h,E)=>{if(h){f(h);return}s(E)})})}const xH=ui(uH),IH=ui(dH),BH=ui(fH),kH=ui(hH),TH=ui(pH),CH=ui(gH),PH=ui(gn()),MH=Os(zn({total:gn(),circulating:gn(),nonCirculating:gn(),nonCirculatingAccounts:mr(Ss)})),f4=zn({amount:rr(),uiAmount:vr(gn()),decimals:gn(),uiAmountString:Dr(rr())}),OH=Os(mr(zn({address:Ss,amount:rr(),uiAmount:vr(gn()),decimals:gn(),uiAmountString:Dr(rr())}))),RH=Os(mr(zn({pubkey:Ss,account:zn({executable:iu(),owner:Ss,lamports:gn(),data:u4,rentEpoch:gn()})}))),d4=zn({program:rr(),parsed:hd(),space:gn()}),NH=Os(mr(zn({pubkey:Ss,account:zn({executable:iu(),owner:Ss,lamports:gn(),data:d4,rentEpoch:gn()})}))),UH=Os(mr(zn({lamports:gn(),address:Ss}))),Pg=zn({executable:iu(),owner:Ss,lamports:gn(),data:u4,rentEpoch:gn()}),DH=zn({pubkey:Ss,account:Pg}),LH=pd(Wo([e4(Ir.Buffer),d4]),Wo([cT,d4]),t=>Array.isArray(t)?dr(t,u4):t),h4=zn({executable:iu(),owner:Ss,lamports:gn(),data:LH,rentEpoch:gn()}),FH=zn({pubkey:Ss,account:h4}),jH=zn({state:Wo([Es("active"),Es("inactive"),Es("activating"),Es("deactivating")]),active:gn(),inactive:gn()}),zH=ui(mr(zn({signature:rr(),slot:gn(),err:bd,memo:vr(rr()),blockTime:Dr(vr(gn()))}))),HH=ui(mr(zn({signature:rr(),slot:gn(),err:bd,memo:vr(rr()),blockTime:Dr(vr(gn()))}))),KH=zn({subscription:gn(),result:nv(Pg)}),$H=zn({pubkey:Ss,account:Pg}),VH=zn({subscription:gn(),result:nv($H)}),WH=zn({parent:gn(),slot:gn(),root:gn()}),GH=zn({subscription:gn(),result:WH}),qH=Wo([zn({type:Wo([Es("firstShredReceived"),Es("completed"),Es("optimisticConfirmation"),Es("root")]),slot:gn(),timestamp:gn()}),zn({type:Es("createdBank"),parent:gn(),slot:gn(),timestamp:gn()}),zn({type:Es("frozen"),slot:gn(),timestamp:gn(),stats:zn({numTransactionEntries:gn(),numSuccessfulTransactions:gn(),numFailedTransactions:gn(),maxTransactionsPerEntry:gn()})}),zn({type:Es("dead"),slot:gn(),timestamp:gn(),err:rr()})]),ZH=zn({subscription:gn(),result:qH}),XH=zn({subscription:gn(),result:nv(Wo([yH,mH]))}),YH=zn({subscription:gn(),result:gn()}),JH=zn({pubkey:rr(),gossip:vr(rr()),tpu:vr(rr()),rpc:vr(rr()),version:vr(rr())}),dT=zn({votePubkey:rr(),nodePubkey:rr(),activatedStake:gn(),epochVoteAccount:iu(),epochCredits:mr(t4([gn(),gn(),gn()])),commission:gn(),lastVote:gn(),rootSlot:vr(gn())}),QH=ui(zn({current:mr(dT),delinquent:mr(dT)})),eK=Wo([Es("processed"),Es("confirmed"),Es("finalized")]),tK=zn({slot:gn(),confirmations:vr(gn()),err:bd,confirmationStatus:Dr(eK)}),nK=Os(mr(vr(tK))),rK=ui(gn()),hT=zn({accountKey:Ss,writableIndexes:mr(gn()),readonlyIndexes:mr(gn())}),p4=zn({signatures:mr(rr()),message:zn({accountKeys:mr(rr()),header:zn({numRequiredSignatures:gn(),numReadonlySignedAccounts:gn(),numReadonlyUnsignedAccounts:gn()}),instructions:mr(zn({accounts:mr(gn()),data:rr(),programIdIndex:gn()})),recentBlockhash:rr(),addressTableLookups:Dr(mr(hT))})}),pT=zn({pubkey:Ss,signer:iu(),writable:iu(),source:Dr(Wo([Es("transaction"),Es("lookupTable")]))}),gT=zn({accountKeys:mr(pT),signatures:mr(rr())}),yT=zn({parsed:hd(),program:rr(),programId:Ss}),mT=zn({accounts:mr(Ss),data:rr(),programId:Ss}),iK=Wo([mT,yT]),sK=Wo([zn({parsed:hd(),program:rr(),programId:rr()}),zn({accounts:mr(rr()),data:rr(),programId:rr()})]),bT=pd(iK,sK,t=>"accounts"in t?dr(t,mT):dr(t,yT)),vT=zn({signatures:mr(rr()),message:zn({accountKeys:mr(pT),instructions:mr(bT),recentBlockhash:rr(),addressTableLookups:Dr(vr(mr(hT)))})}),rv=zn({accountIndex:gn(),mint:rr(),owner:Dr(rr()),programId:Dr(rr()),uiTokenAmount:f4}),wT=zn({writable:mr(Ss),readonly:mr(Ss)}),iv=zn({err:bd,fee:gn(),innerInstructions:Dr(vr(mr(zn({index:gn(),instructions:mr(zn({accounts:mr(gn()),data:rr(),programIdIndex:gn()}))})))),preBalances:mr(gn()),postBalances:mr(gn()),logMessages:Dr(vr(mr(rr()))),preTokenBalances:Dr(vr(mr(rv))),postTokenBalances:Dr(vr(mr(rv))),loadedAddresses:Dr(wT),computeUnitsConsumed:Dr(gn())}),g4=zn({err:bd,fee:gn(),innerInstructions:Dr(vr(mr(zn({index:gn(),instructions:mr(bT)})))),preBalances:mr(gn()),postBalances:mr(gn()),logMessages:Dr(vr(mr(rr()))),preTokenBalances:Dr(vr(mr(rv))),postTokenBalances:Dr(vr(mr(rv))),loadedAddresses:Dr(wT),computeUnitsConsumed:Dr(gn())}),a0=Wo([Es(0),Es("legacy")]),vd=zn({pubkey:rr(),lamports:gn(),postBalance:vr(gn()),rewardType:vr(rr()),commission:Dr(vr(gn()))}),oK=ui(vr(zn({blockhash:rr(),previousBlockhash:rr(),parentSlot:gn(),transactions:mr(zn({transaction:p4,meta:vr(iv),version:Dr(a0)})),rewards:Dr(mr(vd)),blockTime:vr(gn()),blockHeight:vr(gn())}))),aK=ui(vr(zn({blockhash:rr(),previousBlockhash:rr(),parentSlot:gn(),rewards:Dr(mr(vd)),blockTime:vr(gn()),blockHeight:vr(gn())}))),cK=ui(vr(zn({blockhash:rr(),previousBlockhash:rr(),parentSlot:gn(),transactions:mr(zn({transaction:gT,meta:vr(iv),version:Dr(a0)})),rewards:Dr(mr(vd)),blockTime:vr(gn()),blockHeight:vr(gn())}))),uK=ui(vr(zn({blockhash:rr(),previousBlockhash:rr(),parentSlot:gn(),transactions:mr(zn({transaction:vT,meta:vr(g4),version:Dr(a0)})),rewards:Dr(mr(vd)),blockTime:vr(gn()),blockHeight:vr(gn())}))),lK=ui(vr(zn({blockhash:rr(),previousBlockhash:rr(),parentSlot:gn(),transactions:mr(zn({transaction:gT,meta:vr(g4),version:Dr(a0)})),rewards:Dr(mr(vd)),blockTime:vr(gn()),blockHeight:vr(gn())}))),fK=ui(vr(zn({blockhash:rr(),previousBlockhash:rr(),parentSlot:gn(),rewards:Dr(mr(vd)),blockTime:vr(gn()),blockHeight:vr(gn())}))),dK=ui(vr(zn({blockhash:rr(),previousBlockhash:rr(),parentSlot:gn(),transactions:mr(zn({transaction:p4,meta:vr(iv)})),rewards:Dr(mr(vd)),blockTime:vr(gn())}))),_T=ui(vr(zn({blockhash:rr(),previousBlockhash:rr(),parentSlot:gn(),signatures:mr(rr()),blockTime:vr(gn())}))),y4=ui(vr(zn({slot:gn(),meta:vr(iv),blockTime:Dr(vr(gn())),transaction:p4,version:Dr(a0)}))),sv=ui(vr(zn({slot:gn(),transaction:vT,meta:vr(g4),blockTime:Dr(vr(gn())),version:Dr(a0)}))),hK=Os(zn({blockhash:rr(),lastValidBlockHeight:gn()})),pK=Os(iu()),gK=zn({slot:gn(),numTransactions:gn(),numSlots:gn(),samplePeriodSecs:gn()}),yK=ui(mr(gK)),mK=Os(vr(zn({feeCalculator:zn({lamportsPerSignature:gn()})}))),bK=ui(rr()),vK=ui(rr()),wK=zn({err:bd,logs:mr(rr()),signature:rr()}),_K=zn({result:nv(wK),subscription:gn()}),EK={"solana-client":"js/1.0.0-maintenance"};class SK{constructor(e,s){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const q={};return async te=>{const{commitment:ne,config:ue}=Qi(te),ge=this._buildArgs([],ne,void 0,ue),xe=sT(ge);return q[xe]=q[xe]??(async()=>{try{const pe=await this._rpcRequest("getBlockHeight",ge),Se=dr(pe,ui(gn()));if("error"in Se)throw new Pr(Se.error,"failed to get block height information");return Se.result}finally{delete q[xe]}})(),await q[xe]}})();let f,d,h,E,P,R;s&&typeof s=="string"?this._commitment=s:s&&(this._commitment=s.commitment,this._confirmTransactionInitialTimeout=s.confirmTransactionInitialTimeout,f=s.wsEndpoint,d=s.httpHeaders,h=s.fetch,E=s.fetchMiddleware,P=s.disableRetryOnRateLimit,R=s.httpAgent),this._rpcEndpoint=aH(e),this._rpcWsEndpoint=f||sH(e),this._rpcClient=EH(e,d,h,E,P,R),this._rpcRequest=SH(this._rpcClient),this._rpcBatchRequest=AH(this._rpcClient),this._rpcWebSocket=new tH(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,s){const{commitment:f,config:d}=Qi(s),h=this._buildArgs([e.toBase58()],f,void 0,d),E=await this._rpcRequest("getBalance",h),P=dr(E,Os(gn()));if("error"in P)throw new Pr(P.error,`failed to get balance for ${e.toBase58()}`);return P.result}async getBalance(e,s){return await this.getBalanceAndContext(e,s).then(f=>f.value).catch(f=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+f)})}async getBlockTime(e){const s=await this._rpcRequest("getBlockTime",[e]),f=dr(s,ui(vr(gn())));if("error"in f)throw new Pr(f.error,`failed to get block time for slot ${e}`);return f.result}async getMinimumLedgerSlot(){const e=await this._rpcRequest("minimumLedgerSlot",[]),s=dr(e,ui(gn()));if("error"in s)throw new Pr(s.error,"failed to get minimum ledger slot");return s.result}async getFirstAvailableBlock(){const e=await this._rpcRequest("getFirstAvailableBlock",[]),s=dr(e,PH);if("error"in s)throw new Pr(s.error,"failed to get first available block");return s.result}async getSupply(e){let s={};typeof e=="string"?s={commitment:e}:e?s={...e,commitment:e&&e.commitment||this.commitment}:s={commitment:this.commitment};const f=await this._rpcRequest("getSupply",[s]),d=dr(f,MH);if("error"in d)throw new Pr(d.error,"failed to get supply");return d.result}async getTokenSupply(e,s){const f=this._buildArgs([e.toBase58()],s),d=await this._rpcRequest("getTokenSupply",f),h=dr(d,Os(f4));if("error"in h)throw new Pr(h.error,"failed to get token supply");return h.result}async getTokenAccountBalance(e,s){const f=this._buildArgs([e.toBase58()],s),d=await this._rpcRequest("getTokenAccountBalance",f),h=dr(d,Os(f4));if("error"in h)throw new Pr(h.error,"failed to get token account balance");return h.result}async getTokenAccountsByOwner(e,s,f){const{commitment:d,config:h}=Qi(f);let E=[e.toBase58()];"mint"in s?E.push({mint:s.mint.toBase58()}):E.push({programId:s.programId.toBase58()});const P=this._buildArgs(E,d,"base64",h),R=await this._rpcRequest("getTokenAccountsByOwner",P),q=dr(R,RH);if("error"in q)throw new Pr(q.error,`failed to get token accounts owned by account ${e.toBase58()}`);return q.result}async getParsedTokenAccountsByOwner(e,s,f){let d=[e.toBase58()];"mint"in s?d.push({mint:s.mint.toBase58()}):d.push({programId:s.programId.toBase58()});const h=this._buildArgs(d,f,"jsonParsed"),E=await this._rpcRequest("getTokenAccountsByOwner",h),P=dr(E,NH);if("error"in P)throw new Pr(P.error,`failed to get token accounts owned by account ${e.toBase58()}`);return P.result}async getLargestAccounts(e){const s={...e,commitment:e&&e.commitment||this.commitment},f=s.filter||s.commitment?[s]:[],d=await this._rpcRequest("getLargestAccounts",f),h=dr(d,UH);if("error"in h)throw new Pr(h.error,"failed to get largest accounts");return h.result}async getTokenLargestAccounts(e,s){const f=this._buildArgs([e.toBase58()],s),d=await this._rpcRequest("getTokenLargestAccounts",f),h=dr(d,OH);if("error"in h)throw new Pr(h.error,"failed to get token largest accounts");return h.result}async getAccountInfoAndContext(e,s){const{commitment:f,config:d}=Qi(s),h=this._buildArgs([e.toBase58()],f,"base64",d),E=await this._rpcRequest("getAccountInfo",h),P=dr(E,Os(vr(Pg)));if("error"in P)throw new Pr(P.error,`failed to get info about account ${e.toBase58()}`);return P.result}async getParsedAccountInfo(e,s){const{commitment:f,config:d}=Qi(s),h=this._buildArgs([e.toBase58()],f,"jsonParsed",d),E=await this._rpcRequest("getAccountInfo",h),P=dr(E,Os(vr(h4)));if("error"in P)throw new Pr(P.error,`failed to get info about account ${e.toBase58()}`);return P.result}async getAccountInfo(e,s){try{return(await this.getAccountInfoAndContext(e,s)).value}catch(f){throw new Error("failed to get info about account "+e.toBase58()+": "+f)}}async getMultipleParsedAccounts(e,s){const{commitment:f,config:d}=Qi(s),h=e.map(q=>q.toBase58()),E=this._buildArgs([h],f,"jsonParsed",d),P=await this._rpcRequest("getMultipleAccounts",E),R=dr(P,Os(mr(vr(h4))));if("error"in R)throw new Pr(R.error,`failed to get info for accounts ${h}`);return R.result}async getMultipleAccountsInfoAndContext(e,s){const{commitment:f,config:d}=Qi(s),h=e.map(q=>q.toBase58()),E=this._buildArgs([h],f,"base64",d),P=await this._rpcRequest("getMultipleAccounts",E),R=dr(P,Os(mr(vr(Pg))));if("error"in R)throw new Pr(R.error,`failed to get info for accounts ${h}`);return R.result}async getMultipleAccountsInfo(e,s){return(await this.getMultipleAccountsInfoAndContext(e,s)).value}async getStakeActivation(e,s,f){const{commitment:d,config:h}=Qi(s),E=this._buildArgs([e.toBase58()],d,void 0,{...h,epoch:f??h?.epoch}),P=await this._rpcRequest("getStakeActivation",E),R=dr(P,ui(jH));if("error"in R)throw new Pr(R.error,`failed to get Stake Activation ${e.toBase58()}`);return R.result}async getProgramAccounts(e,s){const{commitment:f,config:d}=Qi(s),{encoding:h,...E}=d||{},P=this._buildArgs([e.toBase58()],f,h||"base64",{...E,...E.filters?{filters:uT(E.filters)}:null}),R=await this._rpcRequest("getProgramAccounts",P),q=mr(DH),te=E.withContext===!0?dr(R,Os(q)):dr(R,ui(q));if("error"in te)throw new Pr(te.error,`failed to get accounts owned by program ${e.toBase58()}`);return te.result}async getParsedProgramAccounts(e,s){const{commitment:f,config:d}=Qi(s),h=this._buildArgs([e.toBase58()],f,"jsonParsed",d),E=await this._rpcRequest("getProgramAccounts",h),P=dr(E,ui(mr(FH)));if("error"in P)throw new Pr(P.error,`failed to get accounts owned by program ${e.toBase58()}`);return P.result}async confirmTransaction(e,s){let f;if(typeof e=="string")f=e;else{const h=e;if(h.abortSignal?.aborted)return Promise.reject(h.abortSignal.reason);f=h.signature}let d;try{d=bo().decode(f)}catch{throw new Error("signature must be base58 encoded: "+f)}return Ci(d.length===64,"signature has invalid length"),typeof e=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:s||this.commitment,signature:f}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:s||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:s||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise((s,f)=>{e!=null&&(e.aborted?f(e.reason):e.addEventListener("abort",()=>{f(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:s}){let f,d,h=!1;const E=new Promise((R,q)=>{try{f=this.onSignature(s,(ne,ue)=>{f=void 0;const ge={context:ue,value:ne};R({__type:sf.PROCESSED,response:ge})},e);const te=new Promise(ne=>{f==null?ne():d=this._onSubscriptionStateChange(f,ue=>{ue==="subscribed"&&ne()})});(async()=>{if(await te,h)return;const ne=await this.getSignatureStatus(s);if(h||ne==null)return;const{context:ue,value:ge}=ne;if(ge!=null)if(ge?.err)q(ge.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(ge.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(ge.confirmationStatus==="processed"||ge.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}h=!0,R({__type:sf.PROCESSED,response:{context:ue,value:ge}})}})()}catch(te){q(te)}});return{abortConfirmation:()=>{d&&(d(),d=void 0),f!=null&&(this.removeSignatureListener(f),f=void 0)},confirmationPromise:E}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:s,lastValidBlockHeight:f,signature:d}}){let h=!1;const E=new Promise(ne=>{const ue=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let ge=await ue();if(!h){for(;ge<=f;)if(await md(1e3),h||(ge=await ue(),h))return;ne({__type:sf.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:P,confirmationPromise:R}=this.getTransactionConfirmationPromise({commitment:e,signature:d}),q=this.getCancellationPromise(s);let te;try{const ne=await Promise.race([q,R,E]);if(ne.__type===sf.PROCESSED)te=ne.response;else throw new qk(d)}finally{h=!0,P()}return te}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:s,minContextSlot:f,nonceAccountPubkey:d,nonceValue:h,signature:E}}){let P=!1;const R=new Promise(ge=>{let xe=h,pe=null;const Se=async()=>{try{const{context:Ce,value:Fe}=await this.getNonceAndContext(d,{commitment:e,minContextSlot:f});return pe=Ce.slot,Fe?.nonce}catch{return xe}};(async()=>{if(xe=await Se(),!P)for(;;){if(h!==xe){ge({__type:sf.NONCE_INVALID,slotInWhichNonceDidAdvance:pe});return}if(await md(2e3),P||(xe=await Se(),P))return}})()}),{abortConfirmation:q,confirmationPromise:te}=this.getTransactionConfirmationPromise({commitment:e,signature:E}),ne=this.getCancellationPromise(s);let ue;try{const ge=await Promise.race([ne,te,R]);if(ge.__type===sf.PROCESSED)ue=ge.response;else{let xe;for(;;){const pe=await this.getSignatureStatus(E);if(pe==null)break;if(pe.context.slot<(ge.slotInWhichNonceDidAdvance??f)){await md(400);continue}xe=pe;break}if(xe?.value){const pe=e||"finalized",{confirmationStatus:Se}=xe.value;switch(pe){case"processed":case"recent":if(Se!=="processed"&&Se!=="confirmed"&&Se!=="finalized")throw new kg(E);break;case"confirmed":case"single":case"singleGossip":if(Se!=="confirmed"&&Se!=="finalized")throw new kg(E);break;case"finalized":case"max":case"root":if(Se!=="finalized")throw new kg(E);break;default:}ue={context:xe.context,value:{err:xe.value.err}}}else throw new kg(E)}}finally{P=!0,q()}return ue}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:s}){let f;const d=new Promise(R=>{let q=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{q=this._confirmTransactionInitialTimeout||3e4;break}}f=setTimeout(()=>R({__type:sf.TIMED_OUT,timeoutMs:q}),q)}),{abortConfirmation:h,confirmationPromise:E}=this.getTransactionConfirmationPromise({commitment:e,signature:s});let P;try{const R=await Promise.race([E,d]);if(R.__type===sf.PROCESSED)P=R.response;else throw new Zk(s,R.timeoutMs/1e3)}finally{clearTimeout(f),h()}return P}async getClusterNodes(){const e=await this._rpcRequest("getClusterNodes",[]),s=dr(e,ui(mr(JH)));if("error"in s)throw new Pr(s.error,"failed to get cluster nodes");return s.result}async getVoteAccounts(e){const s=this._buildArgs([],e),f=await this._rpcRequest("getVoteAccounts",s),d=dr(f,QH);if("error"in d)throw new Pr(d.error,"failed to get vote accounts");return d.result}async getSlot(e){const{commitment:s,config:f}=Qi(e),d=this._buildArgs([],s,void 0,f),h=await this._rpcRequest("getSlot",d),E=dr(h,ui(gn()));if("error"in E)throw new Pr(E.error,"failed to get slot");return E.result}async getSlotLeader(e){const{commitment:s,config:f}=Qi(e),d=this._buildArgs([],s,void 0,f),h=await this._rpcRequest("getSlotLeader",d),E=dr(h,ui(rr()));if("error"in E)throw new Pr(E.error,"failed to get slot leader");return E.result}async getSlotLeaders(e,s){const f=[e,s],d=await this._rpcRequest("getSlotLeaders",f),h=dr(d,ui(mr(Ss)));if("error"in h)throw new Pr(h.error,"failed to get slot leaders");return h.result}async getSignatureStatus(e,s){const{context:f,value:d}=await this.getSignatureStatuses([e],s);Ci(d.length===1);const h=d[0];return{context:f,value:h}}async getSignatureStatuses(e,s){const f=[e];s&&f.push(s);const d=await this._rpcRequest("getSignatureStatuses",f),h=dr(d,nK);if("error"in h)throw new Pr(h.error,"failed to get signature status");return h.result}async getTransactionCount(e){const{commitment:s,config:f}=Qi(e),d=this._buildArgs([],s,void 0,f),h=await this._rpcRequest("getTransactionCount",d),E=dr(h,ui(gn()));if("error"in E)throw new Pr(E.error,"failed to get transaction count");return E.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const s=this._buildArgs([],e),f=await this._rpcRequest("getInflationGovernor",s),d=dr(f,xH);if("error"in d)throw new Pr(d.error,"failed to get inflation");return d.result}async getInflationReward(e,s,f){const{commitment:d,config:h}=Qi(f),E=this._buildArgs([e.map(q=>q.toBase58())],d,void 0,{...h,epoch:s??h?.epoch}),P=await this._rpcRequest("getInflationReward",E),R=dr(P,lH);if("error"in R)throw new Pr(R.error,"failed to get inflation reward");return R.result}async getInflationRate(){const e=await this._rpcRequest("getInflationRate",[]),s=dr(e,IH);if("error"in s)throw new Pr(s.error,"failed to get inflation rate");return s.result}async getEpochInfo(e){const{commitment:s,config:f}=Qi(e),d=this._buildArgs([],s,void 0,f),h=await this._rpcRequest("getEpochInfo",d),E=dr(h,kH);if("error"in E)throw new Pr(E.error,"failed to get epoch info");return E.result}async getEpochSchedule(){const e=await this._rpcRequest("getEpochSchedule",[]),s=dr(e,TH);if("error"in s)throw new Pr(s.error,"failed to get epoch schedule");const f=s.result;return new Qz(f.slotsPerEpoch,f.leaderScheduleSlotOffset,f.warmup,f.firstNormalEpoch,f.firstNormalSlot)}async getLeaderSchedule(){const e=await this._rpcRequest("getLeaderSchedule",[]),s=dr(e,CH);if("error"in s)throw new Pr(s.error,"failed to get leader schedule");return s.result}async getMinimumBalanceForRentExemption(e,s){const f=this._buildArgs([e],s),d=await this._rpcRequest("getMinimumBalanceForRentExemption",f),h=dr(d,rK);return"error"in h?(console.warn("Unable to fetch minimum balance for rent exemption"),0):h.result}async getRecentBlockhashAndContext(e){const{context:s,value:{blockhash:f}}=await this.getLatestBlockhashAndContext(e);return{context:s,value:{blockhash:f,feeCalculator:{get lamportsPerSignature(){throw new Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON(){return{}}}}}}async getRecentPerformanceSamples(e){const s=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),f=dr(s,yK);if("error"in f)throw new Pr(f.error,"failed to get recent performance samples");return f.result}async getFeeCalculatorForBlockhash(e,s){const f=this._buildArgs([e],s),d=await this._rpcRequest("getFeeCalculatorForBlockhash",f),h=dr(d,mK);if("error"in h)throw new Pr(h.error,"failed to get fee calculator");const{context:E,value:P}=h.result;return{context:E,value:P!==null?P.feeCalculator:null}}async getFeeForMessage(e,s){const f=ci(e.serialize()).toString("base64"),d=this._buildArgs([f],s),h=await this._rpcRequest("getFeeForMessage",d),E=dr(h,Os(vr(gn())));if("error"in E)throw new Pr(E.error,"failed to get fee for message");if(E.result===null)throw new Error("invalid blockhash");return E.result}async getRecentPrioritizationFees(e){const s=e?.lockedWritableAccounts?.map(E=>E.toBase58()),f=s?.length?[s]:[],d=await this._rpcRequest("getRecentPrioritizationFees",f),h=dr(d,BH);if("error"in h)throw new Pr(h.error,"failed to get recent prioritization fees");return h.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(s){throw new Error("failed to get recent blockhash: "+s)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(s){throw new Error("failed to get recent blockhash: "+s)}}async getLatestBlockhashAndContext(e){const{commitment:s,config:f}=Qi(e),d=this._buildArgs([],s,void 0,f),h=await this._rpcRequest("getLatestBlockhash",d),E=dr(h,hK);if("error"in E)throw new Pr(E.error,"failed to get latest blockhash");return E.result}async isBlockhashValid(e,s){const{commitment:f,config:d}=Qi(s),h=this._buildArgs([e],f,void 0,d),E=await this._rpcRequest("isBlockhashValid",h),P=dr(E,pK);if("error"in P)throw new Pr(P.error,"failed to determine if the blockhash `"+e+"`is valid");return P.result}async getVersion(){const e=await this._rpcRequest("getVersion",[]),s=dr(e,ui(bH));if("error"in s)throw new Pr(s.error,"failed to get version");return s.result}async getGenesisHash(){const e=await this._rpcRequest("getGenesisHash",[]),s=dr(e,ui(rr()));if("error"in s)throw new Pr(s.error,"failed to get genesis hash");return s.result}async getBlock(e,s){const{commitment:f,config:d}=Qi(s),h=this._buildArgsAtLeastConfirmed([e],f,void 0,d),E=await this._rpcRequest("getBlock",h);try{switch(d?.transactionDetails){case"accounts":{const P=dr(E,cK);if("error"in P)throw P.error;return P.result}case"none":{const P=dr(E,aK);if("error"in P)throw P.error;return P.result}default:{const P=dr(E,oK);if("error"in P)throw P.error;const{result:R}=P;return R?{...R,transactions:R.transactions.map(({transaction:q,meta:te,version:ne})=>({meta:te,transaction:{...q,message:l4(ne,q.message)},version:ne}))}:null}}}catch(P){throw new Pr(P,"failed to get confirmed block")}}async getParsedBlock(e,s){const{commitment:f,config:d}=Qi(s),h=this._buildArgsAtLeastConfirmed([e],f,"jsonParsed",d),E=await this._rpcRequest("getBlock",h);try{switch(d?.transactionDetails){case"accounts":{const P=dr(E,lK);if("error"in P)throw P.error;return P.result}case"none":{const P=dr(E,fK);if("error"in P)throw P.error;return P.result}default:{const P=dr(E,uK);if("error"in P)throw P.error;return P.result}}}catch(P){throw new Pr(P,"failed to get block")}}async getBlockProduction(e){let s,f;if(typeof e=="string")f=e;else if(e){const{commitment:P,...R}=e;f=P,s=R}const d=this._buildArgs([],f,"base64",s),h=await this._rpcRequest("getBlockProduction",d),E=dr(h,_H);if("error"in E)throw new Pr(E.error,"failed to get block production information");return E.result}async getTransaction(e,s){const{commitment:f,config:d}=Qi(s),h=this._buildArgsAtLeastConfirmed([e],f,void 0,d),E=await this._rpcRequest("getTransaction",h),P=dr(E,y4);if("error"in P)throw new Pr(P.error,"failed to get transaction");const R=P.result;return R&&{...R,transaction:{...R.transaction,message:l4(R.version,R.transaction.message)}}}async getParsedTransaction(e,s){const{commitment:f,config:d}=Qi(s),h=this._buildArgsAtLeastConfirmed([e],f,"jsonParsed",d),E=await this._rpcRequest("getTransaction",h),P=dr(E,sv);if("error"in P)throw new Pr(P.error,"failed to get transaction");return P.result}async getParsedTransactions(e,s){const{commitment:f,config:d}=Qi(s),h=e.map(R=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([R],f,"jsonParsed",d)}));return(await this._rpcBatchRequest(h)).map(R=>{const q=dr(R,sv);if("error"in q)throw new Pr(q.error,"failed to get transactions");return q.result})}async getTransactions(e,s){const{commitment:f,config:d}=Qi(s),h=e.map(R=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([R],f,void 0,d)}));return(await this._rpcBatchRequest(h)).map(R=>{const q=dr(R,y4);if("error"in q)throw new Pr(q.error,"failed to get transactions");const te=q.result;return te&&{...te,transaction:{...te.transaction,message:l4(te.version,te.transaction.message)}}})}async getConfirmedBlock(e,s){const f=this._buildArgsAtLeastConfirmed([e],s),d=await this._rpcRequest("getBlock",f),h=dr(d,dK);if("error"in h)throw new Pr(h.error,"failed to get confirmed block");const E=h.result;if(!E)throw new Error("Confirmed block "+e+" not found");const P={...E,transactions:E.transactions.map(({transaction:R,meta:q})=>{const te=new ou(R.message);return{meta:q,transaction:{...R,message:te}}})};return{...P,transactions:P.transactions.map(({transaction:R,meta:q})=>({meta:q,transaction:Ei.populate(R.message,R.signatures)}))}}async getBlocks(e,s,f){const d=this._buildArgsAtLeastConfirmed(s!==void 0?[e,s]:[e],f),h=await this._rpcRequest("getBlocks",d),E=dr(h,ui(mr(gn())));if("error"in E)throw new Pr(E.error,"failed to get blocks");return E.result}async getBlockSignatures(e,s){const f=this._buildArgsAtLeastConfirmed([e],s,void 0,{transactionDetails:"signatures",rewards:!1}),d=await this._rpcRequest("getBlock",f),h=dr(d,_T);if("error"in h)throw new Pr(h.error,"failed to get block");const E=h.result;if(!E)throw new Error("Block "+e+" not found");return E}async getConfirmedBlockSignatures(e,s){const f=this._buildArgsAtLeastConfirmed([e],s,void 0,{transactionDetails:"signatures",rewards:!1}),d=await this._rpcRequest("getBlock",f),h=dr(d,_T);if("error"in h)throw new Pr(h.error,"failed to get confirmed block");const E=h.result;if(!E)throw new Error("Confirmed block "+e+" not found");return E}async getConfirmedTransaction(e,s){const f=this._buildArgsAtLeastConfirmed([e],s),d=await this._rpcRequest("getTransaction",f),h=dr(d,y4);if("error"in h)throw new Pr(h.error,"failed to get transaction");const E=h.result;if(!E)return E;const P=new ou(E.transaction.message),R=E.transaction.signatures;return{...E,transaction:Ei.populate(P,R)}}async getParsedConfirmedTransaction(e,s){const f=this._buildArgsAtLeastConfirmed([e],s,"jsonParsed"),d=await this._rpcRequest("getTransaction",f),h=dr(d,sv);if("error"in h)throw new Pr(h.error,"failed to get confirmed transaction");return h.result}async getParsedConfirmedTransactions(e,s){const f=e.map(E=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([E],s,"jsonParsed")}));return(await this._rpcBatchRequest(f)).map(E=>{const P=dr(E,sv);if("error"in P)throw new Pr(P.error,"failed to get confirmed transactions");return P.result})}async getConfirmedSignaturesForAddress(e,s,f){let d={},h=await this.getFirstAvailableBlock();for(;!("until"in d)&&(s--,!(s<=0||s<h));)try{const R=await this.getConfirmedBlockSignatures(s,"finalized");R.signatures.length>0&&(d.until=R.signatures[R.signatures.length-1].toString())}catch(R){if(R instanceof Error&&R.message.includes("skipped"))continue;throw R}let E=await this.getSlot("finalized");for(;!("before"in d)&&(f++,!(f>E));)try{const R=await this.getConfirmedBlockSignatures(f);R.signatures.length>0&&(d.before=R.signatures[R.signatures.length-1].toString())}catch(R){if(R instanceof Error&&R.message.includes("skipped"))continue;throw R}return(await this.getConfirmedSignaturesForAddress2(e,d)).map(R=>R.signature)}async getConfirmedSignaturesForAddress2(e,s,f){const d=this._buildArgsAtLeastConfirmed([e.toBase58()],f,void 0,s),h=await this._rpcRequest("getConfirmedSignaturesForAddress2",d),E=dr(h,zH);if("error"in E)throw new Pr(E.error,"failed to get confirmed signatures for address");return E.result}async getSignaturesForAddress(e,s,f){const d=this._buildArgsAtLeastConfirmed([e.toBase58()],f,void 0,s),h=await this._rpcRequest("getSignaturesForAddress",d),E=dr(h,HH);if("error"in E)throw new Pr(E.error,"failed to get signatures for address");return E.result}async getAddressLookupTable(e,s){const{context:f,value:d}=await this.getAccountInfoAndContext(e,s);let h=null;return d!==null&&(h=new aT({key:e,state:aT.deserialize(d.data)})),{context:f,value:h}}async getNonceAndContext(e,s){const{context:f,value:d}=await this.getAccountInfoAndContext(e,s);let h=null;return d!==null&&(h=o4.fromAccountData(d.data)),{context:f,value:h}}async getNonce(e,s){return await this.getNonceAndContext(e,s).then(f=>f.value).catch(f=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+f)})}async requestAirdrop(e,s){const f=await this._rpcRequest("requestAirdrop",[e.toBase58(),s]),d=dr(f,bK);if("error"in d)throw new Pr(d.error,`airdrop to ${e.toBase58()} failed`);return d.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await md(100);const f=Date.now()-this._blockhashInfo.lastFetch>=oH;if(this._blockhashInfo.latestBlockhash!==null&&!f)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),s=this._blockhashInfo.latestBlockhash,f=s?s.blockhash:null;for(let d=0;d<50;d++){const h=await this.getLatestBlockhash("finalized");if(f!==h.blockhash)return this._blockhashInfo={latestBlockhash:h,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},h;await md(eT/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:s,config:f}=Qi(e),d=this._buildArgs([],s,"base64",f),h=await this._rpcRequest("getStakeMinimumDelegation",d),E=dr(h,Os(gn()));if("error"in E)throw new Pr(E.error,"failed to get stake minimum delegation");return E.result}async simulateTransaction(e,s,f){if("message"in e){const pe=e.serialize(),Se=Ir.Buffer.from(pe).toString("base64");if(Array.isArray(s)||f!==void 0)throw new Error("Invalid arguments");const Ce=s||{};Ce.encoding="base64","commitment"in Ce||(Ce.commitment=this.commitment),s&&typeof s=="object"&&"innerInstructions"in s&&(Ce.innerInstructions=s.innerInstructions);const Fe=[Se,Ce],We=await this._rpcRequest("simulateTransaction",Fe),xt=dr(We,fT);if("error"in xt)throw new Error("failed to simulate transaction: "+xt.error.message);return xt.result}let d;if(e instanceof Ei){let xe=e;d=new Ei,d.feePayer=xe.feePayer,d.instructions=e.instructions,d.nonceInfo=xe.nonceInfo,d.signatures=xe.signatures}else d=Ei.populate(e),d._message=d._json=void 0;if(s!==void 0&&!Array.isArray(s))throw new Error("Invalid arguments");const h=s;if(d.nonceInfo&&h)d.sign(...h);else{let xe=this._disableBlockhashCaching;for(;;){const pe=await this._blockhashWithExpiryBlockHeight(xe);if(d.lastValidBlockHeight=pe.lastValidBlockHeight,d.recentBlockhash=pe.blockhash,!h)break;if(d.sign(...h),!d.signature)throw new Error("!signature");const Se=d.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(Se)&&!this._blockhashInfo.transactionSignatures.includes(Se)){this._blockhashInfo.simulatedSignatures.push(Se);break}else xe=!0}}const E=d._compile(),P=E.serialize(),q=d._serialize(P).toString("base64"),te={encoding:"base64",commitment:this.commitment};if(f){const xe=(Array.isArray(f)?f:E.nonProgramIds()).map(pe=>pe.toBase58());te.accounts={encoding:"base64",addresses:xe}}h&&(te.sigVerify=!0),s&&typeof s=="object"&&"innerInstructions"in s&&(te.innerInstructions=s.innerInstructions);const ne=[q,te],ue=await this._rpcRequest("simulateTransaction",ne),ge=dr(ue,fT);if("error"in ge){let xe;if("data"in ge.error&&(xe=ge.error.data.logs,xe&&Array.isArray(xe))){const pe=`
|
||
`,Se=pe+xe.join(pe);console.error(ge.error.message,Se)}throw new tv({action:"simulate",signature:"",transactionMessage:ge.error.message,logs:xe})}return ge.result}async sendTransaction(e,s,f){if("version"in e){if(s&&Array.isArray(s))throw new Error("Invalid arguments");const E=e.serialize();return await this.sendRawTransaction(E,s)}if(s===void 0||!Array.isArray(s))throw new Error("Invalid arguments");const d=s;if(e.nonceInfo)e.sign(...d);else{let E=this._disableBlockhashCaching;for(;;){const P=await this._blockhashWithExpiryBlockHeight(E);if(e.lastValidBlockHeight=P.lastValidBlockHeight,e.recentBlockhash=P.blockhash,e.sign(...d),!e.signature)throw new Error("!signature");const R=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(R))E=!0;else{this._blockhashInfo.transactionSignatures.push(R);break}}}const h=e.serialize();return await this.sendRawTransaction(h,f)}async sendRawTransaction(e,s){const f=ci(e).toString("base64");return await this.sendEncodedTransaction(f,s)}async sendEncodedTransaction(e,s){const f={encoding:"base64"},d=s&&s.skipPreflight,h=d===!0?"processed":s&&s.preflightCommitment||this.commitment;s&&s.maxRetries!=null&&(f.maxRetries=s.maxRetries),s&&s.minContextSlot!=null&&(f.minContextSlot=s.minContextSlot),d&&(f.skipPreflight=d),h&&(f.preflightCommitment=h);const E=[e,f],P=await this._rpcRequest("sendTransaction",E),R=dr(P,vK);if("error"in R){let q;throw"data"in R.error&&(q=R.error.data.logs),new tv({action:d?"send":"simulate",signature:"",transactionMessage:R.error.message,logs:q})}return R.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),e===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([s,f])=>{this._setSubscription(s,{...f,state:"pending"})})}_setSubscription(e,s){const f=this._subscriptionsByHash[e]?.state;if(this._subscriptionsByHash[e]=s,f!==s.state){const d=this._subscriptionStateChangeCallbacksByHash[e];d&&d.forEach(h=>{try{h(s.state)}catch{}})}}_onSubscriptionStateChange(e,s){const f=this._subscriptionHashByClientSubscriptionId[e];if(f==null)return()=>{};const d=this._subscriptionStateChangeCallbacksByHash[f]||=new Set;return d.add(s),()=>{d.delete(s),d.size===0&&delete this._subscriptionStateChangeCallbacksByHash[f]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(f){f instanceof Error&&console.log(`Error when closing socket connection: ${f.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}const e=this._rpcWebSocketGeneration,s=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async f=>{const d=this._subscriptionsByHash[f];if(d!==void 0)switch(d.state){case"pending":case"unsubscribed":if(d.callbacks.size===0){delete this._subscriptionsByHash[f],d.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[d.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{const{args:h,method:E}=d;try{this._setSubscription(f,{...d,state:"subscribing"});const P=await this._rpcWebSocket.call(E,h);this._setSubscription(f,{...d,serverSubscriptionId:P,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[P]=d.callbacks,await this._updateSubscriptions()}catch(P){if(console.error(`Received ${P instanceof Error?"":"JSON-RPC "}error calling \`${E}\``,{args:h,error:P}),!s())return;this._setSubscription(f,{...d,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":d.callbacks.size===0&&await(async()=>{const{serverSubscriptionId:h,unsubscribeMethod:E}=d;if(this._subscriptionsAutoDisposedByRpc.has(h))this._subscriptionsAutoDisposedByRpc.delete(h);else{this._setSubscription(f,{...d,state:"unsubscribing"}),this._setSubscription(f,{...d,state:"unsubscribing"});try{await this._rpcWebSocket.call(E,[h])}catch(P){if(P instanceof Error&&console.error(`${E} error:`,P.message),!s())return;this._setSubscription(f,{...d,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(f,{...d,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,s){const f=this._subscriptionCallbacksByServerSubscriptionId[e];f!==void 0&&f.forEach(d=>{try{d(...s)}catch(h){console.error(h)}})}_wsOnAccountNotification(e){const{result:s,subscription:f}=dr(e,KH);this._handleServerNotification(f,[s.value,s.context])}_makeSubscription(e,s){const f=this._nextClientSubscriptionId++,d=sT([e.method,s]),h=this._subscriptionsByHash[d];return h===void 0?this._subscriptionsByHash[d]={...e,args:s,callbacks:new Set([e.callback]),state:"pending"}:h.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[f]=d,this._subscriptionDisposeFunctionsByClientSubscriptionId[f]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[f],delete this._subscriptionHashByClientSubscriptionId[f];const E=this._subscriptionsByHash[d];Ci(E!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${f}`),E.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),f}onAccountChange(e,s,f){const{commitment:d,config:h}=Qi(f),E=this._buildArgs([e.toBase58()],d||this._commitment||"finalized","base64",h);return this._makeSubscription({callback:s,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},E)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:s,subscription:f}=dr(e,VH);this._handleServerNotification(f,[{accountId:s.value.pubkey,accountInfo:s.value.account},s.context])}onProgramAccountChange(e,s,f,d){const{commitment:h,config:E}=Qi(f),P=this._buildArgs([e.toBase58()],h||this._commitment||"finalized","base64",E||(d?{filters:uT(d)}:void 0));return this._makeSubscription({callback:s,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},P)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,s,f){const d=this._buildArgs([typeof e=="object"?{mentions:[e.toString()]}:e],f||this._commitment||"finalized");return this._makeSubscription({callback:s,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},d)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:s,subscription:f}=dr(e,_K);this._handleServerNotification(f,[s.value,s.context])}_wsOnSlotNotification(e){const{result:s,subscription:f}=dr(e,GH);this._handleServerNotification(f,[s])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:s,subscription:f}=dr(e,ZH);this._handleServerNotification(f,[s])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,s){const f=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];f?await f():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${s}' events could not be found.`)}_buildArgs(e,s,f,d){const h=s||this._commitment;if(h||f||d){let E={};f&&(E.encoding=f),h&&(E.commitment=h),d&&(E=Object.assign(E,d)),e.push(E)}return e}_buildArgsAtLeastConfirmed(e,s,f,d){const h=s||this._commitment;if(h&&!["confirmed","finalized"].includes(h))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,s,f,d)}_wsOnSignatureNotification(e){const{result:s,subscription:f}=dr(e,XH);s.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(f),this._handleServerNotification(f,s.value==="receivedSignature"?[{type:"received"},s.context]:[{type:"status",result:s.value},s.context])}onSignature(e,s,f){const d=this._buildArgs([e],f||this._commitment||"finalized"),h=this._makeSubscription({callback:(E,P)=>{if(E.type==="status"){s(E.result,P);try{this.removeSignatureListener(h)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},d);return h}onSignatureWithOptions(e,s,f){const{commitment:d,...h}={...f,commitment:f&&f.commitment||this._commitment||"finalized"},E=this._buildArgs([e],d,void 0,h),P=this._makeSubscription({callback:(R,q)=>{s(R,q);try{this.removeSignatureListener(P)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},E);return P}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:s,subscription:f}=dr(e,YH);this._handleServerNotification(f,[s])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}class Mg{constructor(e){this._keypair=void 0,this._keypair=e??Kk()}static generate(){return new Mg(Kk())}static fromSecretKey(e,s){if(e.byteLength!==64)throw new Error("bad secret key size");const f=e.slice(32,64);if(!s||!s.skipValidation){const d=e.slice(0,32),h=X1(d);for(let E=0;E<32;E++)if(f[E]!==h[E])throw new Error("provided secretKey is invalid")}return new Mg({publicKey:f,secretKey:e})}static fromSeed(e){const s=X1(e),f=new Uint8Array(64);return f.set(e),f.set(s,32),new Mg({publicKey:s,secretKey:f})}get publicKey(){return new sr(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const of=Object.freeze({CreateLookupTable:{index:0,layout:Kt.struct([Kt.u32("instruction"),s0("recentSlot"),Kt.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:Kt.struct([Kt.u32("instruction")])},ExtendLookupTable:{index:2,layout:Kt.struct([Kt.u32("instruction"),s0(),Kt.seq(gi(),Kt.offset(Kt.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Kt.struct([Kt.u32("instruction")])},CloseLookupTable:{index:4,layout:Kt.struct([Kt.u32("instruction")])}});class WJ{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const f=BufferLayout.u32("instruction").decode(e.data);let d;for(const[h,E]of Object.entries(of))if(E.index==f){d=h;break}if(!d)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return d}static decodeCreateLookupTable(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);const{recentSlot:s}=ji(of.CreateLookupTable,e.data);return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(s)}}static decodeExtendLookupTable(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error(`invalid instruction; found ${e.keys.length} keys, expected at least 2`);const{addresses:s}=ji(of.ExtendLookupTable,e.data);return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:s.map(f=>new sr(f))}}static decodeCloseLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}static decodeFreezeLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static decodeDeactivateLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(ET.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(e,s){if(e.length<s)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${s}`)}}class ET{constructor(){}static createLookupTable(e){const[s,f]=sr.findProgramAddressSync([e.authority.toBuffer(),(0,Y6.toBufferLE)(BigInt(e.recentSlot),8)],this.programId),d=of.CreateLookupTable,h=Si(d,{recentSlot:BigInt(e.recentSlot),bumpSeed:f}),E=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:vo.programId,isSigner:!1,isWritable:!1}];return[new Ji({programId:this.programId,keys:E,data:h}),s]}static freezeLookupTable(e){const s=of.FreezeLookupTable,f=Si(s),d=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Ji({programId:this.programId,keys:d,data:f})}static extendLookupTable(e){const s=of.ExtendLookupTable,f=Si(s,{addresses:e.addresses.map(h=>h.toBytes())}),d=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&d.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:vo.programId,isSigner:!1,isWritable:!1}),new Ji({programId:this.programId,keys:d,data:f})}static deactivateLookupTable(e){const s=of.DeactivateLookupTable,f=Si(s),d=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Ji({programId:this.programId,keys:d,data:f})}static closeLookupTable(e){const s=of.CloseLookupTable,f=Si(s),d=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new Ji({programId:this.programId,keys:d,data:f})}}ET.programId=new sr("AddressLookupTab1e1111111111111111111111111");class GJ{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const f=BufferLayout.u8("instruction").decode(e.data);let d;for(const[h,E]of Object.entries(Gu))if(E.index==f){d=h;break}if(!d)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return d}static decodeRequestUnits(e){this.checkProgramId(e.programId);const{units:s,additionalFee:f}=ji(Gu.RequestUnits,e.data);return{units:s,additionalFee:f}}static decodeRequestHeapFrame(e){this.checkProgramId(e.programId);const{bytes:s}=ji(Gu.RequestHeapFrame,e.data);return{bytes:s}}static decodeSetComputeUnitLimit(e){this.checkProgramId(e.programId);const{units:s}=ji(Gu.SetComputeUnitLimit,e.data);return{units:s}}static decodeSetComputeUnitPrice(e){this.checkProgramId(e.programId);const{microLamports:s}=ji(Gu.SetComputeUnitPrice,e.data);return{microLamports:s}}static checkProgramId(e){if(!e.equals(ST.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const Gu=Object.freeze({RequestUnits:{index:0,layout:Kt.struct([Kt.u8("instruction"),Kt.u32("units"),Kt.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:Kt.struct([Kt.u8("instruction"),Kt.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:Kt.struct([Kt.u8("instruction"),Kt.u32("units")])},SetComputeUnitPrice:{index:3,layout:Kt.struct([Kt.u8("instruction"),s0("microLamports")])}});class ST{constructor(){}static requestUnits(e){const s=Gu.RequestUnits,f=Si(s,e);return new Ji({keys:[],programId:this.programId,data:f})}static requestHeapFrame(e){const s=Gu.RequestHeapFrame,f=Si(s,e);return new Ji({keys:[],programId:this.programId,data:f})}static setComputeUnitLimit(e){const s=Gu.SetComputeUnitLimit,f=Si(s,e);return new Ji({keys:[],programId:this.programId,data:f})}static setComputeUnitPrice(e){const s=Gu.SetComputeUnitPrice,f=Si(s,{microLamports:BigInt(e.microLamports)});return new Ji({keys:[],programId:this.programId,data:f})}}ST.programId=new sr("ComputeBudget111111111111111111111111111111");const AT=64,xT=32,IT=64,BT=Kt.struct([Kt.u8("numSignatures"),Kt.u8("padding"),Kt.u16("signatureOffset"),Kt.u16("signatureInstructionIndex"),Kt.u16("publicKeyOffset"),Kt.u16("publicKeyInstructionIndex"),Kt.u16("messageDataOffset"),Kt.u16("messageDataSize"),Kt.u16("messageInstructionIndex")]);class m4{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:s,message:f,signature:d,instructionIndex:h}=e;Ci(s.length===xT,`Public Key must be ${xT} bytes but received ${s.length} bytes`),Ci(d.length===IT,`Signature must be ${IT} bytes but received ${d.length} bytes`);const E=BT.span,P=E+s.length,R=P+d.length,q=1,te=Ir.Buffer.alloc(R+f.length),ne=h??65535;return BT.encode({numSignatures:q,padding:0,signatureOffset:P,signatureInstructionIndex:ne,publicKeyOffset:E,publicKeyInstructionIndex:ne,messageDataOffset:R,messageDataSize:f.length,messageInstructionIndex:ne},te),te.fill(s,E),te.fill(d,P),te.fill(f,R),new Ji({keys:[],programId:m4.programId,data:te})}static createInstructionWithPrivateKey(e){const{privateKey:s,message:f,instructionIndex:d}=e;Ci(s.length===AT,`Private key must be ${AT} bytes but received ${s.length} bytes`);try{const h=Mg.fromSecretKey(s),E=h.publicKey.toBytes(),P=n4(f,h.secretKey);return this.createInstructionWithPublicKey({publicKey:E,message:f,signature:P,instructionIndex:d})}catch(h){throw new Error(`Error creating instruction; ${h}`)}}}m4.programId=new sr("Ed25519SigVerify111111111111111111111111111");const AK=(t,e)=>{const s=Fu.sign(t,e);return[s.toCompactRawBytes(),s.recovery]};Fu.utils.isValidPrivateKey;const xK=Fu.getPublicKey,kT=32,b4=20,TT=64,IK=11,v4=Kt.struct([Kt.u8("numSignatures"),Kt.u16("signatureOffset"),Kt.u8("signatureInstructionIndex"),Kt.u16("ethAddressOffset"),Kt.u8("ethAddressInstructionIndex"),Kt.u16("messageDataOffset"),Kt.u16("messageDataSize"),Kt.u8("messageInstructionIndex"),Kt.blob(20,"ethAddress"),Kt.blob(64,"signature"),Kt.u8("recoveryId")]);class Og{constructor(){}static publicKeyToEthAddress(e){Ci(e.length===TT,`Public key must be ${TT} bytes but received ${e.length} bytes`);try{return Ir.Buffer.from(bx(ci(e))).slice(-b4)}catch(s){throw new Error(`Error constructing Ethereum address: ${s}`)}}static createInstructionWithPublicKey(e){const{publicKey:s,message:f,signature:d,recoveryId:h,instructionIndex:E}=e;return Og.createInstructionWithEthAddress({ethAddress:Og.publicKeyToEthAddress(s),message:f,signature:d,recoveryId:h,instructionIndex:E})}static createInstructionWithEthAddress(e){const{ethAddress:s,message:f,signature:d,recoveryId:h,instructionIndex:E=0}=e;let P;typeof s=="string"?s.startsWith("0x")?P=Ir.Buffer.from(s.substr(2),"hex"):P=Ir.Buffer.from(s,"hex"):P=s,Ci(P.length===b4,`Address must be ${b4} bytes but received ${P.length} bytes`);const R=1+IK,q=R,te=R+P.length,ne=te+d.length+1,ue=1,ge=Ir.Buffer.alloc(v4.span+f.length);return v4.encode({numSignatures:ue,signatureOffset:te,signatureInstructionIndex:E,ethAddressOffset:q,ethAddressInstructionIndex:E,messageDataOffset:ne,messageDataSize:f.length,messageInstructionIndex:E,signature:ci(d),ethAddress:ci(P),recoveryId:h},ge),ge.fill(ci(f),v4.span),new Ji({keys:[],programId:Og.programId,data:ge})}static createInstructionWithPrivateKey(e){const{privateKey:s,message:f,instructionIndex:d}=e;Ci(s.length===kT,`Private key must be ${kT} bytes but received ${s.length} bytes`);try{const h=ci(s),E=xK(h,!1).slice(1),P=Ir.Buffer.from(bx(ci(f))),[R,q]=AK(P,h);return this.createInstructionWithPublicKey({publicKey:E,message:f,signature:R,recoveryId:q,instructionIndex:d})}catch(h){throw new Error(`Error creating instruction; ${h}`)}}}Og.programId=new sr("KeccakSecp256k11111111111111111111111111111");var CT;const BK=new sr("StakeConfig11111111111111111111111111111111");class kK{constructor(e,s){this.staker=void 0,this.withdrawer=void 0,this.staker=e,this.withdrawer=s}}class ov{constructor(e,s,f){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=s,this.custodian=f}}CT=ov,ov.default=new CT(0,0,sr.default);class qJ{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const f=BufferLayout.u32("instruction").decode(e.data);let d;for(const[h,E]of Object.entries(wo))if(E.index==f){d=h;break}if(!d)throw new Error("Instruction type incorrect; not a StakeInstruction");return d}static decodeInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:s,lockup:f}=ji(wo.Initialize,e.data);return{stakePubkey:e.keys[0].pubkey,authorized:new kK(new sr(s.staker),new sr(s.withdrawer)),lockup:new ov(f.unixTimestamp,f.epoch,new sr(f.custodian))}}static decodeDelegate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),ji(wo.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:s,stakeAuthorizationType:f}=ji(wo.Authorize,e.data),d={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new sr(s),stakeAuthorizationType:{index:f}};return e.keys.length>3&&(d.custodianPubkey=e.keys[3].pubkey),d}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{newAuthorized:s,stakeAuthorizationType:f,authoritySeed:d,authorityOwner:h}=ji(wo.AuthorizeWithSeed,e.data),E={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:d,authorityOwner:new sr(h),newAuthorizedPubkey:new sr(s),stakeAuthorizationType:{index:f}};return e.keys.length>3&&(E.custodianPubkey=e.keys[3].pubkey),E}static decodeSplit(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:s}=ji(wo.Split,e.data);return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:s}}static decodeMerge(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),ji(wo.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:s}=ji(wo.Withdraw,e.data),f={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:s};return e.keys.length>5&&(f.custodianPubkey=e.keys[5].pubkey),f}static decodeDeactivate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),ji(wo.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static checkProgramId(e){if(!e.equals(w4.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(e,s){if(e.length<s)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${s}`)}}const wo=Object.freeze({Initialize:{index:0,layout:Kt.struct([Kt.u32("instruction"),zz(),Hz()])},Authorize:{index:1,layout:Kt.struct([Kt.u32("instruction"),gi("newAuthorized"),Kt.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:Kt.struct([Kt.u32("instruction")])},Split:{index:3,layout:Kt.struct([Kt.u32("instruction"),Kt.ns64("lamports")])},Withdraw:{index:4,layout:Kt.struct([Kt.u32("instruction"),Kt.ns64("lamports")])},Deactivate:{index:5,layout:Kt.struct([Kt.u32("instruction")])},Merge:{index:7,layout:Kt.struct([Kt.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:Kt.struct([Kt.u32("instruction"),gi("newAuthorized"),Kt.u32("stakeAuthorizationType"),yd("authoritySeed"),gi("authorityOwner")])}}),ZJ=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class w4{constructor(){}static initialize(e){const{stakePubkey:s,authorized:f,lockup:d}=e,h=d||ov.default,E=wo.Initialize,P=Si(E,{authorized:{staker:ci(f.staker.toBuffer()),withdrawer:ci(f.withdrawer.toBuffer())},lockup:{unixTimestamp:h.unixTimestamp,epoch:h.epoch,custodian:ci(h.custodian.toBuffer())}}),R={keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:Tg,isSigner:!1,isWritable:!1}],programId:this.programId,data:P};return new Ji(R)}static createAccountWithSeed(e){const s=new Ei;s.add(vo.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:f,authorized:d,lockup:h}=e;return s.add(this.initialize({stakePubkey:f,authorized:d,lockup:h}))}static createAccount(e){const s=new Ei;s.add(vo.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:f,authorized:d,lockup:h}=e;return s.add(this.initialize({stakePubkey:f,authorized:d,lockup:h}))}static delegate(e){const{stakePubkey:s,authorizedPubkey:f,votePubkey:d}=e,h=wo.Delegate,E=Si(h);return new Ei().add({keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:d,isSigner:!1,isWritable:!1},{pubkey:Wu,isSigner:!1,isWritable:!1},{pubkey:s4,isSigner:!1,isWritable:!1},{pubkey:BK,isSigner:!1,isWritable:!1},{pubkey:f,isSigner:!0,isWritable:!1}],programId:this.programId,data:E})}static authorize(e){const{stakePubkey:s,authorizedPubkey:f,newAuthorizedPubkey:d,stakeAuthorizationType:h,custodianPubkey:E}=e,P=wo.Authorize,R=Si(P,{newAuthorized:ci(d.toBuffer()),stakeAuthorizationType:h.index}),q=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!0},{pubkey:f,isSigner:!0,isWritable:!1}];return E&&q.push({pubkey:E,isSigner:!0,isWritable:!1}),new Ei().add({keys:q,programId:this.programId,data:R})}static authorizeWithSeed(e){const{stakePubkey:s,authorityBase:f,authoritySeed:d,authorityOwner:h,newAuthorizedPubkey:E,stakeAuthorizationType:P,custodianPubkey:R}=e,q=wo.AuthorizeWithSeed,te=Si(q,{newAuthorized:ci(E.toBuffer()),stakeAuthorizationType:P.index,authoritySeed:d,authorityOwner:ci(h.toBuffer())}),ne=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:f,isSigner:!0,isWritable:!1},{pubkey:Wu,isSigner:!1,isWritable:!1}];return R&&ne.push({pubkey:R,isSigner:!0,isWritable:!1}),new Ei().add({keys:ne,programId:this.programId,data:te})}static splitInstruction(e){const{stakePubkey:s,authorizedPubkey:f,splitStakePubkey:d,lamports:h}=e,E=wo.Split,P=Si(E,{lamports:h});return new Ji({keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:d,isSigner:!1,isWritable:!0},{pubkey:f,isSigner:!0,isWritable:!1}],programId:this.programId,data:P})}static split(e,s){const f=new Ei;return f.add(vo.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:s,space:this.space,programId:this.programId})),f.add(this.splitInstruction(e))}static splitWithSeed(e,s){const{stakePubkey:f,authorizedPubkey:d,splitStakePubkey:h,basePubkey:E,seed:P,lamports:R}=e,q=new Ei;return q.add(vo.allocate({accountPubkey:h,basePubkey:E,seed:P,space:this.space,programId:this.programId})),s&&s>0&&q.add(vo.transfer({fromPubkey:e.authorizedPubkey,toPubkey:h,lamports:s})),q.add(this.splitInstruction({stakePubkey:f,authorizedPubkey:d,splitStakePubkey:h,lamports:R}))}static merge(e){const{stakePubkey:s,sourceStakePubKey:f,authorizedPubkey:d}=e,h=wo.Merge,E=Si(h);return new Ei().add({keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:f,isSigner:!1,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1},{pubkey:s4,isSigner:!1,isWritable:!1},{pubkey:d,isSigner:!0,isWritable:!1}],programId:this.programId,data:E})}static withdraw(e){const{stakePubkey:s,authorizedPubkey:f,toPubkey:d,lamports:h,custodianPubkey:E}=e,P=wo.Withdraw,R=Si(P,{lamports:h}),q=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:d,isSigner:!1,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1},{pubkey:s4,isSigner:!1,isWritable:!1},{pubkey:f,isSigner:!0,isWritable:!1}];return E&&q.push({pubkey:E,isSigner:!0,isWritable:!1}),new Ei().add({keys:q,programId:this.programId,data:R})}static deactivate(e){const{stakePubkey:s,authorizedPubkey:f}=e,d=wo.Deactivate,h=Si(d);return new Ei().add({keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1},{pubkey:f,isSigner:!0,isWritable:!1}],programId:this.programId,data:h})}}w4.programId=new sr("Stake11111111111111111111111111111111111111"),w4.space=200;class TK{constructor(e,s,f,d){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=e,this.authorizedVoter=s,this.authorizedWithdrawer=f,this.commission=d}}class XJ{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const f=BufferLayout.u32("instruction").decode(e.data);let d;for(const[h,E]of Object.entries(au))if(E.index==f){d=h;break}if(!d)throw new Error("Instruction type incorrect; not a VoteInstruction");return d}static decodeInitializeAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);const{voteInit:s}=ji(au.InitializeAccount,e.data);return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new TK(new sr(s.nodePubkey),new sr(s.authorizedVoter),new sr(s.authorizedWithdrawer),s.commission)}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:s,voteAuthorizationType:f}=ji(au.Authorize,e.data);return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new sr(s),voteAuthorizationType:{index:f}}}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:s,currentAuthorityDerivedKeySeed:f,newAuthorized:d,voteAuthorizationType:h}}=ji(au.AuthorizeWithSeed,e.data);return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new sr(s),currentAuthorityDerivedKeySeed:f,newAuthorizedPubkey:new sr(d),voteAuthorizationType:{index:h},votePubkey:e.keys[0].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:s}=ji(au.Withdraw,e.data);return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:s,toPubkey:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(Rg.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(e,s){if(e.length<s)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${s}`)}}const au=Object.freeze({InitializeAccount:{index:0,layout:Kt.struct([Kt.u32("instruction"),Kz()])},Authorize:{index:1,layout:Kt.struct([Kt.u32("instruction"),gi("newAuthorized"),Kt.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:Kt.struct([Kt.u32("instruction"),Kt.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:Kt.struct([Kt.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:Kt.struct([Kt.u32("instruction"),$z()])}}),YJ=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class Rg{constructor(){}static initializeAccount(e){const{votePubkey:s,nodePubkey:f,voteInit:d}=e,h=au.InitializeAccount,E=Si(h,{voteInit:{nodePubkey:ci(d.nodePubkey.toBuffer()),authorizedVoter:ci(d.authorizedVoter.toBuffer()),authorizedWithdrawer:ci(d.authorizedWithdrawer.toBuffer()),commission:d.commission}}),P={keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:Tg,isSigner:!1,isWritable:!1},{pubkey:Wu,isSigner:!1,isWritable:!1},{pubkey:f,isSigner:!0,isWritable:!1}],programId:this.programId,data:E};return new Ji(P)}static createAccount(e){const s=new Ei;return s.add(vo.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),s.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:s,authorizedPubkey:f,newAuthorizedPubkey:d,voteAuthorizationType:h}=e,E=au.Authorize,P=Si(E,{newAuthorized:ci(d.toBuffer()),voteAuthorizationType:h.index}),R=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1},{pubkey:f,isSigner:!0,isWritable:!1}];return new Ei().add({keys:R,programId:this.programId,data:P})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:s,currentAuthorityDerivedKeyOwnerPubkey:f,currentAuthorityDerivedKeySeed:d,newAuthorizedPubkey:h,voteAuthorizationType:E,votePubkey:P}=e,R=au.AuthorizeWithSeed,q=Si(R,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:ci(f.toBuffer()),currentAuthorityDerivedKeySeed:d,newAuthorized:ci(h.toBuffer()),voteAuthorizationType:E.index}}),te=[{pubkey:P,isSigner:!1,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1},{pubkey:s,isSigner:!0,isWritable:!1}];return new Ei().add({keys:te,programId:this.programId,data:q})}static withdraw(e){const{votePubkey:s,authorizedWithdrawerPubkey:f,lamports:d,toPubkey:h}=e,E=au.Withdraw,P=Si(E,{lamports:d}),R=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:h,isSigner:!1,isWritable:!0},{pubkey:f,isSigner:!0,isWritable:!1}];return new Ei().add({keys:R,programId:this.programId,data:P})}static safeWithdraw(e,s,f){if(e.lamports>s-f)throw new Error("Withdraw will leave vote account with insufficient funds.");return Rg.withdraw(e)}static updateValidatorIdentity(e){const{votePubkey:s,authorizedWithdrawerPubkey:f,nodePubkey:d}=e,h=au.UpdateValidatorIdentity,E=Si(h),P=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:d,isSigner:!0,isWritable:!1},{pubkey:f,isSigner:!0,isWritable:!1}];return new Ei().add({keys:P,programId:this.programId,data:E})}}Rg.programId=new sr("Vote111111111111111111111111111111111111111"),Rg.space=3762;const CK=new sr("Va1idator1nfo111111111111111111111111111111"),PK=zn({name:rr(),website:Dr(rr()),details:Dr(rr()),iconUrl:Dr(rr()),keybaseUsername:Dr(rr())});class PT{constructor(e,s){this.key=void 0,this.info=void 0,this.key=e,this.info=s}static fromConfigData(e){let s=[...e];if(da(s)!==2)return null;const d=[];for(let h=0;h<2;h++){const E=new sr(ha(s,0,Vu)),P=su(s)===1;d.push({publicKey:E,isSigner:P})}if(d[0].publicKey.equals(CK)&&d[1].isSigner){const h=yd().decode(Buffer.from(s)),E=JSON.parse(h);return assert$1(E,PK),new PT(d[1].publicKey,E)}return null}}const JJ=new sr("Vote111111111111111111111111111111111111111"),MK=Kt.struct([gi("nodePubkey"),gi("authorizedWithdrawer"),Kt.u8("commission"),Kt.nu64(),Kt.seq(Kt.struct([Kt.nu64("slot"),Kt.u32("confirmationCount")]),Kt.offset(Kt.u32(),-8),"votes"),Kt.u8("rootSlotValid"),Kt.nu64("rootSlot"),Kt.nu64(),Kt.seq(Kt.struct([Kt.nu64("epoch"),gi("authorizedVoter")]),Kt.offset(Kt.u32(),-8),"authorizedVoters"),Kt.struct([Kt.seq(Kt.struct([gi("authorizedPubkey"),Kt.nu64("epochOfLastAuthorizedSwitch"),Kt.nu64("targetEpoch")]),32,"buf"),Kt.nu64("idx"),Kt.u8("isEmpty")],"priorVoters"),Kt.nu64(),Kt.seq(Kt.struct([Kt.nu64("epoch"),Kt.nu64("credits"),Kt.nu64("prevCredits")]),Kt.offset(Kt.u32(),-8),"epochCredits"),Kt.struct([Kt.nu64("slot"),Kt.nu64("timestamp")],"lastTimestamp")]);class MT{constructor(e){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=e.nodePubkey,this.authorizedWithdrawer=e.authorizedWithdrawer,this.commission=e.commission,this.rootSlot=e.rootSlot,this.votes=e.votes,this.authorizedVoters=e.authorizedVoters,this.priorVoters=e.priorVoters,this.epochCredits=e.epochCredits,this.lastTimestamp=e.lastTimestamp}static fromAccountData(e){const f=MK.decode(ci(e),4);let d=f.rootSlot;return f.rootSlotValid||(d=null),new MT({nodePubkey:new sr(f.nodePubkey),authorizedWithdrawer:new sr(f.authorizedWithdrawer),commission:f.commission,votes:f.votes,rootSlot:d,authorizedVoters:f.authorizedVoters.map(OK),priorVoters:RK(f.priorVoters),epochCredits:f.epochCredits,lastTimestamp:f.lastTimestamp})}}function OK({authorizedVoter:t,epoch:e}){return{epoch:e,authorizedVoter:new sr(t)}}function OT({authorizedPubkey:t,epochOfLastAuthorizedSwitch:e,targetEpoch:s}){return{authorizedPubkey:new sr(t),epochOfLastAuthorizedSwitch:e,targetEpoch:s}}function RK({buf:t,idx:e,isEmpty:s}){return s?[]:[...t.slice(e+1).map(OT),...t.slice(0,e).map(OT)]}const RT={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function NK(t,e){const s=e===!1?"http":"https";if(!t)return RT[s].devnet;const f=RT[s][t];if(!f)throw new Error(`Unknown ${s} cluster: ${t}`);return f}async function QJ(t,e,s,f){let d,h;s&&Object.prototype.hasOwnProperty.call(s,"lastValidBlockHeight")||s&&Object.prototype.hasOwnProperty.call(s,"nonceValue")?(d=s,h=f):h=s;const E=h&&{skipPreflight:h.skipPreflight,preflightCommitment:h.preflightCommitment||h.commitment,minContextSlot:h.minContextSlot},P=await t.sendRawTransaction(e,E),R=h&&h.commitment,te=(await(d?t.confirmTransaction(d,R):t.confirmTransaction(P,R))).value;if(te.err)throw P!=null?new tv({action:E?.skipPreflight?"send":"simulate",signature:P,transactionMessage:`Status: (${JSON.stringify(te)})`}):new Error(`Raw transaction ${P} failed (${JSON.stringify(te)})`);return P}const eQ=1e9;var UK=Ar(70329),c0=Ar.n(UK),_4=Ar(36533).Buffer,DK=function(t){"use strict";z(s,t);var e=Ie(s);function s(){B(this,s);var f;return f=e.call(this),le(Y(f),"_namespace","solana"),le(Y(f),"_signMethod","ecdsa"),le(Y(f),"isConnected",!1),_0(Y(f)),f.on(an.mpDisconnect,function(){f._clearConnectedCache(),f.emit("disconnect")}),f.on(an.mpChangeConnectedAddress,function(d,h){setTimeout(function(){f.emit("accountChanged",h)},0)}),f}return Ln(s,[{key:"publicKey",get:function(){return this._connectedPubKey?(console.log("get pubKey",new sr(this._connectedAddress)),new sr(this._connectedAddress)):null}},{key:"connect",value:function(){var d=this;return T(I().mark(function h(){return I().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.prev=0,console.debug("SolanaProvider call connect"),P.next=4,d._requestNormalConnect();case 4:if(d.emit("connect"),d.isConnected=!0,d.publicKey){P.next=8;break}throw new Error("publicKey is null");case 8:return P.abrupt("return",{publicKey:d.publicKey});case 11:throw P.prev=11,P.t0=P.catch(0),d.reportError(P.t0),P.t0;case 15:case"end":return P.stop()}},h,null,[[0,11]])}))()}},{key:"disconnect",value:function(){var d=this;return T(I().mark(function h(){return I().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,d._requestDisconnect();case 2:d._clearConnectedCache();case 3:case"end":return P.stop()}},h)}))()}},{key:"_clearConnectedCache",value:function(){this.isConnected=!1,this._connectedPubKey="",this._connectedAddress="",this._connectedAddressList=[]}},{key:"_signSolanaTx",value:function(d,h){var E=this;return T(I().mark(function P(){var R,q;return I().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:if(E.publicKey){ne.next=2;break}throw new Error("publicKey is null");case 2:return console.log("_signSolanaTx serialize",d.serialize),R=_4.from(d.serialize({requireAllSignatures:!1})),console.log("_signSolanaTx buffer:",R),q=R.toString("base64"),console.log("_signSolanaTx base64Encoded:",q),ne.next=9,E._universalSign({type:h?"sendTransaction":"signTransaction",request:{id:1,jsonrpc:"2.0",method:h?"solana_signAndSendTransaction":"solana_signTransaction",params:{transaction:q}}});case 9:return ne.abrupt("return",ne.sent);case 10:case"end":return ne.stop()}},P)}))()}},{key:"signTransaction",value:function(d){var h=this;return T(I().mark(function E(){var P,R,q,te,ne,ue,ge;return I().wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return h.reportMethodCalled({method:"signTransaction",params:d}),pe.next=3,h.getIsUniversalSign();case 3:if(P=pe.sent,pe.prev=4,h.publicKey){pe.next=7;break}throw new Error("publicKey is null");case 7:if(!P){pe.next=14;break}return pe.next=10,h._signSolanaTx(d);case 10:return R=pe.sent.transaction,q=i0.deserialize(_4.from(R,"base64")),console.log("signedTx:",q),pe.abrupt("return",q);case 14:return te=h.isVersionedTransaction(d)?d.version:"legacy",ne=c0().encode(h.isVersionedTransaction(d)?d.version===0?d.message.serialize():d.serialize():d.serializeMessage()),ue=JSON.stringify(d),pe.next=19,h._requestWalletKitSign({method:"preview_message",params:{data:ue,raw:ne,version:te},extra:{from:h._connectedAddress}});case 19:return ge=pe.sent,d.addSignature(h.publicKey,_4.from(c0().decode(ge))),pe.abrupt("return",d);case 24:throw pe.prev=24,pe.t0=pe.catch(4),h.reportError(pe.t0),console.log("signTransaction error",pe.t0),pe.t0;case 29:case"end":return pe.stop()}},E,null,[[4,24]])}))()}},{key:"signAllTransactions",value:function(d){var h=this;return T(I().mark(function E(){var P,R,q,te,ne,ue,ge,xe;return I().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:h.reportMethodCalled({method:"signAllTransactions",params:d}),Se.prev=1,P=[],R=!0,q=!1,te=void 0,Se.prev=4,ne=d[Symbol.iterator]();case 6:if(R=(ue=ne.next()).done){Se.next=15;break}return ge=ue.value,Se.next=10,h.signTransaction(ge);case 10:xe=Se.sent,P.push(xe);case 12:R=!0,Se.next=6;break;case 15:Se.next=21;break;case 17:Se.prev=17,Se.t0=Se.catch(4),q=!0,te=Se.t0;case 21:Se.prev=21,Se.prev=22,!R&&ne.return!=null&&ne.return();case 24:if(Se.prev=24,!q){Se.next=27;break}throw te;case 27:return Se.finish(24);case 28:return Se.finish(21);case 29:return Se.abrupt("return",P);case 32:throw Se.prev=32,Se.t1=Se.catch(1),h.reportError(Se.t1),Se.t1;case 36:case"end":return Se.stop()}},E,null,[[1,32],[4,17,21,29],[22,,24,28]])}))()}},{key:"signMessage",value:function(d){var h=this;return T(I().mark(function E(){var P,R,q,te;return I().wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return h.reportMethodCalled({method:"signMessage",params:d}),ue.next=3,h.getIsUniversalSign();case 3:if(P=ue.sent,ue.prev=4,!P){ue.next=10;break}return ue.next=8,h._universalSign({type:"signMessage",request:{id:1,jsonrpc:"2.0",method:"solana_signMessage",params:{message:c0().encode(d),pubkey:h._connectedPubKey}}});case 8:return R=ue.sent.signature,ue.abrupt("return",{signature:Uint8Array.from(c0().decode(R))});case 10:return q=Hr(d),ue.next=13,h._requestWalletKitSign({method:"preview_message",params:{data:q},extra:{from:h._connectedAddress}});case 13:return te=ue.sent,ue.abrupt("return",{signature:Uint8Array.from(c0().decode(te))});case 17:throw ue.prev=17,ue.t0=ue.catch(4),h.reportError(ue.t0),ue.t0;case 21:case"end":return ue.stop()}},E,null,[[4,17]])}))()}},{key:"signAndSendTransaction",value:function(d){var h=this;return T(I().mark(function E(){var P,R;return I().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return h.reportMethodCalled({method:"signAndSendTransaction",params:d}),te.next=3,h.getIsUniversalSign();case 3:if(P=te.sent,te.prev=4,h.publicKey){te.next=7;break}throw new Error("publicKey is null");case 7:if(!P){te.next=13;break}return te.next=10,h._signSolanaTx(d,!0);case 10:return R=te.sent.signature,console.log("signature:",R),te.abrupt("return",{signature:R});case 13:return te.abrupt("return",h.signTransaction(d).then(function(){var ne=T(I().mark(function ue(ge){var xe,pe;return I().wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return xe=new SK(NK("mainnet-beta"),"confirmed"),Ce.next=3,xe.sendRawTransaction(ge.serialize());case 3:return pe=Ce.sent,Ce.abrupt("return",{signature:pe});case 5:case"end":return Ce.stop()}},ue)}));return function(ue){return ne.apply(this,arguments)}}()));case 16:throw te.prev=16,te.t0=te.catch(4),h.reportError(te.t0),te.t0;case 20:case"end":return te.stop()}},E,null,[[4,16]])}))()}},{key:"isVersionedTransaction",value:function(d){return"version"in d}}]),s}(yu),LK="bn-dapp-browser-mediumRiskTooltip",FK=`
|
||
<style>
|
||
.bn-dapp-browser-mediumRiskTooltip {
|
||
display: block;
|
||
box-sizing: border-box !important;
|
||
position: fixed;
|
||
z-index: 999999;
|
||
top: 2px;
|
||
left: 16px;
|
||
width: calc(100% - 32px);
|
||
align-items: center;
|
||
}
|
||
|
||
.bn-dapp-browser-mediumRiskTooltip .tooltip-arrow {
|
||
display: block;
|
||
width: 0;
|
||
height: 0;
|
||
border-left: 5px solid transparent;
|
||
border-bottom: 4px solid rgba(32, 38, 48, 0.95);
|
||
border-right: 5px solid transparent;
|
||
margin-left: 50%;
|
||
}
|
||
|
||
.bn-dapp-browser-mediumRiskTooltip .tooltip-content {
|
||
display: block;
|
||
background-color: rgba(32, 38, 48, 0.95);
|
||
color: white;
|
||
font-size: 12px;
|
||
font-style: normal;
|
||
font-weight: 400;
|
||
line-height: 16px;
|
||
text-align: left;
|
||
border-radius: 6px;
|
||
padding: 10px 36px 10px 10px;
|
||
margin-top: 0px;
|
||
}
|
||
|
||
.bn-dapp-browser-mediumRiskTooltip .tooltip-title {
|
||
display: block;
|
||
font-weight: 600;
|
||
margin-bottom: 2px;
|
||
}
|
||
|
||
.bn-dapp-browser-mediumRiskTooltip .tooltip-close {
|
||
display: block;
|
||
position: absolute;
|
||
top: 12px;
|
||
right: 10px;
|
||
width: 16px;
|
||
height: 16px;
|
||
padding: 5px;
|
||
}
|
||
</style>
|
||
`,jK=`
|
||
<div class="bn-dapp-browser-mediumRiskTooltip">
|
||
<div class="tooltip-arrow"></div>
|
||
<div class="tooltip-content">
|
||
<div class="tooltip-title" id="bn-dapp-browser-mediumRiskTooltip-title">Potential risk</div>
|
||
<div class="tooltip-desc" id="bn-dapp-browser-mediumRiskTooltip-desc">
|
||
Never enter any personal data, private key, password, etc.
|
||
</div>
|
||
</div>
|
||
<div class="tooltip-close" id="bn-dapp-browser-mediumRiskTooltip-button">
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
width="16"
|
||
height="16"
|
||
viewBox="0 0 16 16"
|
||
fill="none"
|
||
>
|
||
<path
|
||
d="M4.46452 3.05025L3.0503 4.46447L6.58584 8L3.0503 11.5355L4.46452 12.9497L8.00005 9.41421L11.5356 12.9497L12.9498 11.5355L9.41426 8L12.9498 4.46447L11.5356 3.05025L8.00005 6.58579L4.46452 3.05025Z"
|
||
fill="white"
|
||
/>
|
||
</svg>
|
||
</div>
|
||
</div>
|
||
`,tQ=`
|
||
<div id="`.concat(LK,`">
|
||
`).concat(FK,`
|
||
`).concat(jK,`
|
||
</div>
|
||
`);function NT(){return document&&document.getElementById(fragmentId)}function zK(){var t=NT();t&&t.remove()}function nQ(t){var e=NT();if(!e){var s=document&&document.getElementById("bn-dapp-browser-inputWarningTip");s&&s.remove(),appendHTML(fragment);var f=_sliced_to_array(t||[],2),d=f[0],h=f[1];if(d){var E=document.getElementById("bn-dapp-browser-mediumRiskTooltip-title");E&&(E.innerHTML=d)}if(h){var P=document.getElementById("bn-dapp-browser-mediumRiskTooltip-desc");P&&(P.innerHTML=h)}var R=document.getElementById("bn-dapp-browser-mediumRiskTooltip-button");R&&R.addEventListener("click",zK)}}function rQ(t){var e=t||{},s=e.method,f=e.methodParams;if(s===SITE_SHOW_RISK_TOP_TIPS){var d=_to_array(f||[]),h=d[0],E=d[1],P=d.slice(2);switch(console.log("handleRiskTips",f,E),h){case SITE_RISK_MEDIUM_WARNING_EVENT_NAME:showMediumRiskTooltip(P);break;default:break}return!0}}const UT={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let av;const HK=new Uint8Array(16);function KK(){if(!av&&(av=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!av))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return av(HK)}const _o=[];for(let t=0;t<256;++t)_o.push((t+256).toString(16).slice(1));function DT(t,e=0){return _o[t[e+0]]+_o[t[e+1]]+_o[t[e+2]]+_o[t[e+3]]+"-"+_o[t[e+4]]+_o[t[e+5]]+"-"+_o[t[e+6]]+_o[t[e+7]]+"-"+_o[t[e+8]]+_o[t[e+9]]+"-"+_o[t[e+10]]+_o[t[e+11]]+_o[t[e+12]]+_o[t[e+13]]+_o[t[e+14]]+_o[t[e+15]]}function sQ(t,e=0){const s=DT(t,e);if(!validate(s))throw TypeError("Stringified UUID is invalid");return s}const oQ=null;function $K(t,e,s){if(UT.randomUUID&&!e&&!t)return UT.randomUUID();t=t||{};const f=t.random||(t.rng||KK)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,e){s=s||0;for(let d=0;d<16;++d)e[s+d]=f[d];return e}return DT(f)}const cv=$K;var wd={},aQ=function(t){if(t.method&&t.method.startsWith(METHOD_PREFIX)){var e=t?.methodParams[0],s=t.methodParams[1];return wd[e]&&(wd[e].resolve(s),delete wd[e]),!0}return!1},VK=5e3,WK=function(t,e){if(!t.startsWith(Ne))throw new Error('method name must start with "'.concat(Ne,'"'));return new Promise(function(s,f){var d=cv();wd[d]={id:d,data:e,resolve:s,reject:f},window.bn.miniProgram.postMessage({id:d,name:t,data:e}),setTimeout(function(){wd[d]&&(wd[d].reject("DApp request timeout: ".concat(t)),delete wd[d])},VK)})},GK=function(t,e,s){return WK(Et.REQUEST,{url:t,httpMethod:e,requestData:s})},qK=function(t,e){return GK(t,"post",e)},Ng=function(t,e){window.bn.miniProgram.postMessage({name:t,data:e})},cs={en:"en",zhCN:"zh-CN",zhTW:"zh-TW",ja:"ja",ko:"ko",it:"it"},ZK=["en","zh-CN","zh-TW","ja","ko","it"],E4="unidentification",LT="bn-",Nt={version:"3.4.0.20240525",translate:null,includedLanguages:"zh-CN,zh-TW,en",changeLanguage:function(e){Nt.to=e,Nt.storage.set("to",e),Nt.execute()},to:"",autoDiscriminateLocalLanguage:!1,documents:[],inProgressNodes:[],ignore:{tag:["style","script","link","pre","code","noscript","i"],class:["ignore","translateSelectLanguage"],id:[],isIgnore:function(e){if(e==null||typeof e>"u")return!1;for(var s=e,f=100;f-- >0;){if(s==null||typeof s>"u")return!1;var d=Nt.element.getNodeName(s).toLowerCase();if(d.length>0){if(d=="body"||d=="html"||d=="#document")return!1;if(Nt.ignore.tag.indexOf(d)>-1)return!0}if(s.className!=null){var h=s.className;if(h==null||typeof h!="string")continue;h=h.trim().split(" ");for(var E=0;E<h.length;E++)if(h[E]!=null&&h[E].trim().length>0&&Nt.ignore.class.indexOf(h[E])>-1)return!0}if(s.id!=null&&typeof s.id<"u"&&Nt.ignore.id.indexOf(s.id)>-1)return!0;s=s.parentNode}return!1}},nomenclature:{data:[],old_Data:[],set:function(e){alert("\u8BF7\u5C06 translate.nomenclature.set \u66F4\u6362\u4E3A append\uFF0C\u5177\u4F53\u4F7F\u7528\u53EF\u53C2\u8003\uFF1A https://github.com/xnx3/translate ")},append:function(e,s,f){typeof Nt.nomenclature.data[e]>"u"&&(Nt.nomenclature.data[e]=[]),typeof Nt.nomenclature.data[e][s]>"u"&&(Nt.nomenclature.data[e][s]=[]);for(var d=f.split(`
|
||
`),h=0;h<d.length;h++){var E=d[h].trim();if(!(E.length<1)){var P=E.split("=");if(P.length==2){var R=P[0].trim(),q=P[1].trim();R.length==0||q.length==0||(Nt.nomenclature.data[e][s][R]=q)}}}Nt.nomenclature.data[e][s]=Nt.util.objSort(Nt.nomenclature.data[e][s])},get:function(){return Nt.nomenclature.data},dispose:function(e){if(e==null||e.length==0||typeof Nt.nomenclature.data[Nt.language.getLocal()]>"u"||typeof Nt.nomenclature.data[Nt.language.getLocal()][Nt.to]>"u")return e;for(var s in Nt.nomenclature.data[Nt.language.getLocal()][Nt.to]){var f=Nt.nomenclature.data[Nt.language.getLocal()][Nt.to][s];if(typeof f!="function"){var d=e.indexOf(s);if(d>-1)if(Nt.language.getLocal()==cs.en){var h="";if(d!=0){h=e.substr(d-1,1);var E=Nt.language.getCharLanguage(h);if(E==cs.en)continue}var P="";if(d+s.length!=e.length){P=e.substr(d+s.length,1);var E=Nt.language.getCharLanguage(P);if(E==cs.en)continue}e=e.replace(new RegExp(h+s+P,"g"),h+f+P)}else e=e.replace(new RegExp(s,"g"),f)}}return e}},setAutoDiscriminateLocalLanguage:function(){Nt.autoDiscriminateLocalLanguage=!0},nodeQueue:{},setDocuments:function(e){e==null||typeof e>"u"||(typeof e.length>"u"?Nt.documents[0]=e:Nt.documents=e,Nt.nodeQueue={})},getDocuments:function(){return Nt.documents!=null&&typeof Nt.documents<"u"&&Nt.documents.length>0?Nt.documents:document.all},listener:{isStart:!1,stopListen:!1,start:function(){Nt.listener.stopListen=!1,Nt.temp_linstenerStartInterval=setInterval(function(){document.readyState==="complete"&&(clearInterval(Nt.temp_linstenerStartInterval),Nt.listener.addListener())},300)},addListener:function(){Nt.listener.isStart=!0,Nt.listener.config={attributes:!0,childList:!0,subtree:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0},Nt.listener.callback=function(d,h){if(!Nt.listener.stopListen){var E=[],P=!0,R=!1,q=void 0;try{for(var te=d[Symbol.iterator](),ne;!(P=(ne=te.next()).done);P=!0){var ue=ne.value,ge=[];ue.type==="childList"?ue.addedNodes.length>0?ge=ue.addedNodes:ue.removedNodes.length>0:ue.type==="attributes"||ue.type==="characterData"&&(ge=[ue.target]);var xe=!0,pe=!1,Se=void 0;try{for(var Ce=ge[Symbol.iterator](),Fe;!(xe=(Fe=Ce.next()).done);xe=!0){for(var We=Fe.value,xt=!1,kt=0;kt<E.length;kt++)if(E[kt].isSameNode(We)){xt=!0;break}if(xt)break;E.push.apply(E,[We])}}catch(rt){pe=!0,Se=rt}finally{try{!xe&&Ce.return!=null&&Ce.return()}finally{if(pe)throw Se}}}}catch(rt){R=!0,q=rt}finally{try{!P&&te.return!=null&&te.return()}finally{if(R)throw q}}if(E.length>0){var Bt=[],Wt=!0,Me=!1,Ke=void 0;try{for(var nt=E[Symbol.iterator](),Tt;!(Wt=(Tt=nt.next()).done);Wt=!0){for(var pt=Tt.value,Ht=!1,lt=0;lt<Nt.inProgressNodes.length;lt++)if(Nt.inProgressNodes[lt].node.isSameNode(pt)){Ht=!0;break}Ht||Bt.push(pt)}}catch(rt){Me=!0,Ke=rt}finally{try{!Wt&&nt.return!=null&&nt.return()}finally{if(Me)throw Ke}}if(Bt.length<1)return;setTimeout(function(){Nt.execute(Bt)},10)}}},Nt.listener.observer=new MutationObserver(Nt.listener.callback);for(var e=Nt.getDocuments(),s=0;s<e.length;s++){var f=e[s];f!=null&&Nt.listener.observer.observe(f,Nt.listener.config)}},stop:function(){var e,s;Nt.listener.stopListen=!0,!((e=Nt.listener)===null||e===void 0||(s=e.observer)===null||s===void 0)&&s.disconnect&&Nt.listener.observer.disconnect(),clearInterval(Nt.temp_linstenerStartInterval)},renderTaskFinish:function(e){}},renderTask:function(){"use strict";function t(){B(this,t),this.taskQueue=[],this.nodes=[]}return Ln(t,[{key:"add",value:function(s,f,d,h){var E=Nt.element.nodeAnalyse.get(s,h),P=Nt.util.hash(E.text);typeof this.nodes[P]>"u"&&(this.nodes[P]=[]),this.nodes[P].push(s);var R=this.taskQueue[P];(R==null||typeof R>"u")&&(R=[]);var q=[];f.substr(0,1)==" "&&d.substr(0,1)!=" "&&(d=" "+d),f.substr(f.length-1,1)===" "&&d.substr(0,1)!=" "&&(d=d+" "),q.originalText=f,q.resultText=d,q.attribute=h,R.push(q),this.taskQueue[P]=R}},{key:"execute",value:function(){for(var s in this.taskQueue){var f=this.taskQueue[s];typeof f!="function"&&(f.sort(function(q,te){return te.originalText.length-q.originalText.length}),this.taskQueue[s]=f)}for(var s in this.nodes)for(var f=this.taskQueue[s],d=0;d<this.nodes[s].length;d++)for(var h=0;h<f.length;h++){var E=f[h];if(typeof f!="function"){var P=this.nodes[s][h];setTimeout(function(ne){for(var ue=0;ue<Nt.inProgressNodes.length;ue++)if(Nt.inProgressNodes[ue].node.isSameNode(ne)){Nt.inProgressNodes[ue].number=Nt.inProgressNodes[ue].number-1,Nt.inProgressNodes[ue].number<1&&Nt.inProgressNodes.splice(ue,1);break}},50,P),Nt.element.nodeAnalyse.set(this.nodes[s][h],E.originalText,E.resultText,E.attribute)}}if(typeof this.taskQueue<"u"&&Object.keys(this.taskQueue).length>0){var R=this;setTimeout(function(){for(var q in R.nodes)for(var te in R.nodes[q]){var ne=Nt.element.nodeAnalyse.get(R.nodes[q][0]),ue=S4.uuid(ne.node);ue.length!=0&&(Nt.nodeHistory[ue]={},Nt.nodeHistory[ue].node=ne.node,Nt.nodeHistory[ue].translateText=ne.text)}Nt.listener.renderTaskFinish(R)},50)}}}]),t}(),execute:function(e){var s=function(qn){for(var hr=function(yi){for(var Bi=0;Bi<Se.length;Bi++)if(pe[qn][yi].node.isSameNode(Se[Bi].node)){pe[qn][yi].array=Se[Bi].array;break}pe[qn][yi].array.sort(function(hv,Wg){return Wg.length-hv.length});for(var ki=Nt.element.nodeAnalyse.get(pe[qn][yi].node),$g=ki.text,g0=0;g0<pe[qn][yi].array.length;g0++)pe[qn][yi].array[g0]<1||($g=$g.replace(new RegExp(Nt.util.regExp.pattern(pe[qn][yi].array[g0]),"g"),Nt.util.regExp.resultText(`
|
||
`)));for(var Vg=$g.split(`
|
||
`),Ed=0;Ed<Vg.length;Ed++)Vg[Ed]<1||Nt.addNodeToQueue(f,ki.node,Vg[Ed])},lr=Object.keys(Nt.nodeQueue[f].list[qn]),Sr=lr.length,_r=0;_r<pe[qn].length;_r++)hr(_r);var Kr=Object.keys(Nt.nodeQueue[f].list[qn])||[],li=Kr.length;if(Sr-li==0)return"continue";for(var ti=0;ti<Kr.length;ti++){var Yi=Kr[ti];if(lr.indexOf(Yi)==-1){var Yr=Nt.nodeQueue[f].list[qn][Yi],Ai=Yr.original==Yr.translateText?Yi:Nt.util.hash(Yr.translateText);Nt.nodeQueue[f].list[qn][Yi].cacheHash=Ai,ge[qn].push(Yr.translateText),xe[qn].push(Yi)}}};typeof e<"u"&&(Nt.useVersion="v2");var f=Nt.util.uuid();if(Nt.to==null||Nt.to==""){var d=Nt.storage.get("to");d!=null&&typeof d<"u"&&d.length>0&&(Nt.to=d)}if(Nt.to==null||typeof Nt.to>"u"||Nt.to.length==0){console.log("\u6CA1\u6709\u6307\u5B9A\u7FFB\u8BD1\u76EE\u6807\u8BED\u8A00\u3001\u53C8\u6CA1\u81EA\u52A8\u83B7\u53D6\u7528\u6237\u672C\u56FD\u8BED\u79CD\uFF0C\u5219\u4E0D\u7FFB\u8BD1");return}if(Nt.to==Nt.language.getLocal()){console.log("\u5224\u65AD\u672C\u5730\u8BED\u79CD\u8DDF\u8981\u7FFB\u8BD1\u7684\u76EE\u6807\u8BED\u79CD\u662F\u5426\u4E00\u6837\uFF0C\u5982\u679C\u662F\u4E00\u6837\uFF0C\u90A3\u5C31\u4E0D\u9700\u8981\u8FDB\u884C\u4EFB\u4F55\u7FFB\u8BD1");return}Nt.images.execute();var h;if(typeof e<"u"){if(e==null){console.log("translate.execute(...) \u4E2D\u4F20\u5165\u7684\u8981\u7FFB\u8BD1\u7684\u76EE\u6807\u533A\u57DF\u4E0D\u5B58\u5728\u3002");return}typeof e.length>"u"?(h=[],h[0]=e):h=e}else h=Nt.getDocuments();h.length>500&&console.log("docs.length \u8FC7\u5927\uFF0C\u8D85\u8FC7500\uFF0C\u8FD9\u5F88\u4E0D\u6B63\u5E38. documents.length:"+h.length);for(var E=0;E<h.length;E++){var P=h[E];Nt.element.whileNodes(f,P)}if(Nt.language.translateLanguagesRange.length>0)for(var R in Nt.nodeQueue[f].list)Nt.language.translateLanguagesRange.indexOf(R)<0&&delete Nt.nodeQueue[f].list[R];for(var R in Nt.nodeQueue[f].list){for(var q in Nt.nodeQueue[f].list[R])if(typeof Nt.nodeQueue[f].list[R][q]!="function"){for(var te=Nt.nodeQueue[f].list[R][q].nodes.length-1;te>-1;te--){var ne=Nt.element.nodeAnalyse.get(Nt.nodeQueue[f].list[R][q].nodes[te].node),ue=S4.uuid(ne.node);typeof Nt.nodeHistory[ue]<"u"&&Nt.nodeHistory[ue].translateText==ne.text&&Nt.nodeQueue[f].list[R][q].nodes.splice(te,1)}Nt.nodeQueue[f].list[R][q].nodes.length==0&&delete Nt.nodeQueue[f].list[R][q]}Object.keys(Nt.nodeQueue[f].list[R]).length==0&&delete Nt.nodeQueue[f].list[R]}var ge={},xe={},pe={},Se=[];for(var R in Nt.nodeQueue[f].list)if(!(R==null||typeof R>"u"||R.length==0||R=="undefined")){ge[R]=[],xe[R]=[];var Ce=new Nt.renderTask;pe[R]=[];for(var q in Nt.nodeQueue[f].list[R])if(typeof Nt.nodeQueue[f].list[R][q]!="function"){var Fe=Nt.nodeQueue[f].list[R][q].original,We=Nt.nodeQueue[f].list[R][q].translateText,xt=Fe==We?q:Nt.util.hash(We);Nt.nodeQueue[f].list[R][q].cacheHash=xt;var kt=Nt.storage.get("hash_"+Nt.to+"_"+xt);if(kt!=null&&kt.length>0){for(var Bt=0;Bt<Nt.nodeQueue[f].list[R][q].nodes.length;Bt++){for(var Wt=Nt.nodeQueue[f].list[R][q].nodes[Bt].node,Me=!1,Ke=0;Ke<Nt.inProgressNodes.length;Ke++)Nt.inProgressNodes[Ke].node.isSameNode(Wt)&&(Nt.inProgressNodes[Ke].number++,Me=!0);Me||Nt.inProgressNodes.push({node:Wt,number:1});var nt=Nt.nodeQueue[f].list[R][q].nodes[Bt].beforeText+kt+Nt.nodeQueue[f].list[R][q].nodes[Bt].afterText;Ce.add(Nt.nodeQueue[f].list[R][q].nodes[Bt].node,Fe,nt,Nt.nodeQueue[f].list[R][q].nodes[Bt].attribute);for(var Tt=-1,E=0;E<pe[R].length;E++)if(Nt.nodeQueue[f].list[R][q].nodes[Bt].node.isSameNode(pe[R][E].node)){Tt=E;break}for(var pt=-1,E=0;E<Se.length;E++)if(Nt.nodeQueue[f].list[R][q].nodes[Bt].node.isSameNode(Se[E].node)){pt=E;break}Tt==-1&&(Tt=pe[R].length,pe[R][Tt]={},pe[R][Tt].node=Nt.nodeQueue[f].list[R][q].nodes[Bt].node,pe[R][Tt].array=[]),pt==-1&&(pt=Se.length,Se[pt]={},Se[pt].node=Nt.nodeQueue[f].list[R][q].nodes[Bt].node,Se[pt].array=[]);var Ht=pe[R][Tt].array.length;pe[R][Tt].array[Ht]=nt;var lt=Se[pt].array.length;Se[pt].array[lt]=nt}continue}ge[R].push(We),xe[R].push(q)}Ce.execute()}for(var R in pe)s(R);var rt=[];for(var R in Nt.nodeQueue[f].list)typeof ge[R]>"u"||ge[R].length<1||rt.push(R);if(rt.length!=0){for(var R in xe)if(!(typeof xe[R]>"u")&&!(xe[R].length<1))for(var ot=0;ot<xe[R].length;ot++)for(var Mt=xe[R][ot],Ut=0;Ut<Nt.nodeQueue[f].list[R][Mt].nodes.length;Ut++){for(var Wt=Nt.nodeQueue[f].list[R][Mt].nodes[Ut].node,Me=!1,Ke=0;Ke<Nt.inProgressNodes.length;Ke++)Nt.inProgressNodes[Ke].node.isSameNode(Wt)&&(Nt.inProgressNodes[Ke].number++,Me=!0);Me||Nt.inProgressNodes.push({node:Wt,number:1})}for(var rn in rt){var R=rt[rn];if(typeof ge[R]>"u"||ge[R].length<1)return;var Qt=function(lr){if(lr.result==0){console.log("=======ERROR START======="),console.log(ge[lr.from]),console.log("response : "+lr.info),console.log("=======ERROR END =======");return}for(var Sr=new Nt.renderTask,_r=0;_r<xe[lr.from].length;_r++){var Kr=lr.from,li=lr.texts[_r];if(li!=null){li.toLowerCase().indexOf(ge[lr.from][_r].toLowerCase())>-1&&(li=ge[lr.from][_r]);var ti=xe[lr.from][_r],Yi=Nt.nodeQueue[f].list[Kr][ti].cacheHash,Yr="";try{Yr=Nt.nodeQueue[f].list[Kr][ti].original}catch(yi){console.log("uuid:"+f+", originalWord:"+Yr+", lang:"+Kr+", hash:"+ti+", text:"+li+", queue:"+Nt.nodeQueue[f]),console.log(yi);continue}for(var Ai=0;Ai<Nt.nodeQueue[f].list[Kr][ti].nodes.length;Ai++)Sr.add(Nt.nodeQueue[f].list[Kr][ti].nodes[Ai].node,Yr,Nt.nodeQueue[f].list[Kr][ti].nodes[Ai].beforeText+li+Nt.nodeQueue[f].list[Kr][ti].nodes[Ai].afterText,Nt.nodeQueue[f].list[Kr][ti].nodes[Ai].attribute);Nt.storage.set("hash_"+lr.to+"_"+Yi,li)}}Sr.execute()},Cn={from:R,to:Nt.to,texts:ge[R]};Nt.fetchTranslation(Cn,Qt)}}},nodeHistory:{},element:{nodeAnalyse:{get:function(e,s){return Nt.element.nodeAnalyse.analyse(e,"","",s)},set:function(e,s,f,d){Nt.element.nodeAnalyse.analyse(e,s,f,d)},analyse:function(e,s,f,d){var h=[];h.node=e,h.text="";var E=Nt.element.getNodeName(e);if(d!=null&&typeof d=="string"&&d.length>0)return h.text=e[d],typeof s<"u"&&s.length>0&&(typeof e[d]<"u"?e[d]=e[d].replace(new RegExp(Nt.util.regExp.pattern(s),"g"),Nt.util.regExp.resultText(f)):console.log(e)),h;if(E=="#text"&&typeof e.parentNode<"u"){var P=Nt.element.getNodeName(e.parentNode);P=="TEXTAREA"&&(E="TEXTAREA",e=e.parentNode)}if(E=="INPUT"||E=="TEXTAREA"){if(e.attributes==null||typeof e.attributes>"u")return h.text="",h;if(E=="INPUT"&&typeof e.attributes.type<"u"&&ce(e.attributes.type.nodeValue)!==null&&(e.attributes.type.nodeValue.toLowerCase()=="button"||e.attributes.type.nodeValue.toLowerCase()=="submit")){var R=e.attributes.value;if(R!=null&&typeof R<"u"&&typeof R.nodeValue<"u"&&R.nodeValue.length>0)return typeof s<"u"&&s.length>0&&(R.nodeValue=R.nodeValue.replace(new RegExp(Nt.util.regExp.pattern(s),"g"),Nt.util.regExp.resultText(f))),h.text=R.nodeValue,h.node=R,h}return typeof e.attributes.placeholder<"u"?(typeof s<"u"&&s.length>0&&(e.attributes.placeholder.nodeValue=e.attributes.placeholder.nodeValue.replace(new RegExp(Nt.util.regExp.pattern(s),"g"),Nt.util.regExp.resultText(f))),h.text=e.attributes.placeholder.nodeValue,h.node=e.attributes.placeholder,h):(h.text="",h)}if(E=="META"){if(typeof e.name<"u"&&e.name!=null){var q=e.name.toLowerCase();if(q=="keywords"||q=="description")return typeof s<"u"&&s!=null&&s.length>0&&(e.content=e.content.replace(new RegExp(Nt.util.regExp.pattern(s),"g"),Nt.util.regExp.resultText(f))),h.text=e.content,h}return h.text="",h}return E=="IMG"?typeof e.alt>"u"||e.alt==null?(h.text="",h):(typeof s<"u"&&s.length>0&&(e.alt=e.alt.replace(new RegExp(Nt.util.regExp.pattern(s),"g"),Nt.util.regExp.resultText(f))),h.text=e.alt,h):(e.nodeValue==null||typeof e.nodeValue>"u"||e.nodeValue.trim().length==0?h.text="":(typeof s<"u"&&s!=null&&s.length>0&&(e.nodeValue=e.nodeValue.replace(new RegExp(Nt.util.regExp.pattern(s),"g"),Nt.util.regExp.resultText(f))),h.text=e.nodeValue),h)}},getNodeName:function(e){if(e==null||typeof e>"u"||e.nodeName==null||typeof e.nodeName>"u")return"";var s=e.nodeName;return s},whileNodes:function(e,s){if(!(s==null||typeof s>"u")){(typeof Nt.nodeQueue[e]>"u"||Nt.nodeQueue[e]==null)&&(Nt.nodeQueue[e]=[],Nt.nodeQueue[e].expireTime=Date.now()+120*1e3,Nt.nodeQueue[e].list=[]),typeof s=="object"&&typeof s.title=="string"&&s.title.length>0&&(Nt.ignore.isIgnore(s)||Nt.addNodeToQueue(e,s,s.title,"title"));var f=s.childNodes;if(f.length>0)for(var d=0;d<f.length;d++)Nt.element.whileNodes(e,f[d]);else Nt.element.findNode(e,s)}},findNode:function(e,s){if(!(s==null||typeof s>"u")&&s.parentNode!=null){var f=Nt.element.getNodeName(s.parentNode);if(f!=""&&!(Nt.ignore.tag.indexOf(f.toLowerCase())>-1)&&!Nt.ignore.isIgnore(s)){var d=Nt.element.nodeAnalyse.get(s);d.text.length>0&&Nt.addNodeToQueue(e,d.node,d.text)}}}},addNodeToQueue:function(e,s,f,d){if(!(s==null||f==null||f.length==0)){var h=Nt.element.getNodeName(s);if(h.toLowerCase()!="#comment"){var E=Nt.util.hash(f);if(Nt.util.findTag(f)){if(s.parentNode==null)return;var P=Nt.element.getNodeName(s.parentNode);if(P=="SCRIPT"||P=="STYLE")return}var R=Nt.language.recognition(f),q=R.languageArray;typeof q[Nt.to]<"u"&&delete q[Nt.to];var te=Nt.whole.isWhole(s);if(te){var ne=R.languageName;Nt.addNodeQueueItem(e,s,f,d,ne,"","")}else for(var ne in q)for(var ue=0;ue<q[ne].list.length;ue++)if(!(typeof q[ne].list[ue]>"u"||typeof q[ne].list[ue].text>"u")){var ge=q[ne].list[ue].text,xe=q[ne].list[ue].beforeText,pe=q[ne].list[ue].afterText;Nt.addNodeQueueItem(e,s,ge,d,ne,xe,pe)}}}},addNodeQueueItem:function(e,s,f,d,h,E,P){(Nt.nodeQueue[e].list[h]==null||typeof Nt.nodeQueue[e].list[h]>"u")&&(Nt.nodeQueue[e].list[h]=[]);var R=Nt.util.hash(f);(Nt.nodeQueue[e].list[h][R]==null||typeof Nt.nodeQueue[e].list[h][R]>"u")&&(Nt.nodeQueue[e].list[h][R]=[],Nt.nodeQueue[e].list[h][R].nodes=[],Nt.nodeQueue[e].list[h][R].original=f,Nt.nodeQueue[e].list[h][R].translateText=Nt.nomenclature.dispose(f));var q=!1;if(typeof s.isSameNode<"u"){for(var te=0;te<Nt.nodeQueue[e].list[h][R].nodes.length;te++)if(s.isSameNode(Nt.nodeQueue[e].list[h][R].nodes[te].node)){q=!0;continue}}if(!q){var ne=Nt.nodeQueue[e].list[h][R].nodes.length;Nt.nodeQueue[e].list[h][R].nodes[ne]=[],Nt.nodeQueue[e].list[h][R].nodes[ne].node=s,Nt.nodeQueue[e].list[h][R].nodes[ne].attribute=d,Nt.nodeQueue[e].list[h][R].nodes[ne].beforeText=E,Nt.nodeQueue[e].list[h][R].nodes[ne].afterText=P}},whole:{class:[],tag:[],id:[],executeTip:function(){Nt.whole.class.length==0&&Nt.whole.tag.length==0&&Nt.whole.id.length==0||console.log("\u60A8\u5F00\u542F\u4E86 translate.whole \u6B64\u6B21\u884C\u4E3A\u907F\u5F00\u4E86\u6D4F\u89C8\u5668\u7AEF\u7684\u6587\u672C\u8BED\u79CD\u81EA\u52A8\u8BC6\u522B\uFF0C\u800C\u662F\u66B4\u529B\u7684\u76F4\u63A5\u5BF9\u67D0\u4E2A\u5143\u7D20\u7684\u6574\u4E2A\u6587\u672C\u8FDB\u884C\u7FFB\u8BD1\uFF0C\u5F88\u53EF\u80FD\u4F1A\u4EA7\u751F\u975E\u5E38\u5927\u7684\u7FFB\u8BD1\u91CF\uFF0C\u8BF7\u8C28\u614E\uFF01\u6709\u5173\u6BCF\u65E5\u7FFB\u8BD1\u5B57\u7B26\u7684\u8BF4\u660E\uFF0C\u53EF\u53C2\u8003\uFF1A http://translate.zvo.cn/42557.html "),Nt.whole.tag.indexOf("html")>-1&&console.log("\u81EA\u68C0\u53D1\u73B0\u60A8\u8BBE\u7F6E\u4E86 translate.whole.tag \u5176\u4E2D\u6709 html \uFF0C\u8FD9\u4E2A\u662F\u4E0D\u751F\u6548\u7684\uFF0C\u6700\u5927\u53EA\u5141\u8BB8\u8BBE\u7F6E\u5230 body ")},isWhole:function(e){if(Nt.whole.class.length==0&&Nt.whole.tag.length==0&&Nt.whole.id.length==0||e==null||typeof e>"u")return!1;for(var s=e,f=100;f-- >0;){if(s==null||typeof s>"u")return!1;var d=Nt.element.getNodeName(s).toLowerCase();if(d.length>0){if(d=="html"||d=="#document")return!1;if(Nt.whole.tag.indexOf(d)>-1)return!0}if(s.className!=null){var h=s.className;if(h==null||typeof h!="string")continue;h=h.trim().split(" ");for(var E=0;E<h.length;E++)if(h[E]!=null&&h[E].trim().length>0&&Nt.whole.class.indexOf(h[E])>-1)return!0}if(s.id!=null&&typeof s.id<"u"&&Nt.whole.id.indexOf(s.id)>-1)return!0;s=s.parentNode}return!1}},language:{local:cs.en,translateLanguagesRange:[],setLocal:function(e){Nt.useVersion="v2",Nt.language.local=e},getLocal:function(){return Nt.language.local},getCurrent:function(){var e=Nt.storage.get("to");return e!=null&&typeof e<"u"&&e.length>0?e:Nt.language.getLocal()},setDefaultTo:function(e){var s=Nt.storage.get("to");s!=null&&typeof s<"u"&&s.length>0||(Nt.storage.set("to",e),Nt.to=e)},clearCacheLanguage:function(){Nt.to="",Nt.storage.set("to","")},setUrlParamControl:function(e){(typeof e>"u"||e.length<1)&&(e="language");var s=Nt.util.getUrlParam(e);typeof s>"u"||s==""||s=="null"||s=="undefined"||(Nt.storage.set("to",s),Nt.to=s)},get:function(e,s){for(var f=[],d=[],h=[],E=[],P=0;P<e.length;P++){var R=e.charAt(P),q=Nt.language.getCharLanguage(R);q==""&&(q=E4);var te=Nt.language.analyse(q,d,h,E,R);d=te.langStrs,typeof h.language<"u"&&(E.language=h.language,E.charstr=h.charstr,E.storage_language=h.storage_language),h.language=te.storage_language,h.charstr=R,h.storage_language=te.storage_language,f.push(q)}return typeof d.specialCharacter<"u"&&delete d.specialCharacter,typeof d.number<"u"&&delete d.number,d},getDetectLanguage:function(){var e=document.body.outerText;if(e===null||typeof e>"u"||e.length<1)return{};e=e.replace(/\n|\t|\r/g,"");for(var s=Nt.language.recognition(e,!0),f=s.languageName,d=s.languageArray,h=d[f],E=0,P="",R=0;R<h.list.length;R++){var q=h.list[R];q.text.length>E&&(E=q.text.length,P=q.text)}return{languageName:f,isUnidentification:f===E4,maxLangStr:P}},recognition:function(e,s){var f=Nt.language.get(e,s),d=[],h=[],E=0;for(var P in f)if(typeof f[P]=="object"){for(var R=0,q=0;q<f[P].length;q++)R=R+f[P][q].text.length;E=E+R,d[P]=R,h[P]=R}var te=[];for(var ne in d)d[ne]/E>.05&&(te[te.length]=ne+"");te.length>1&&te.indexOf(cs.en)>-1&&(d[cs.en]=0),te.indexOf(cs.zhCN)>-1&&te.indexOf(cs.zhTW)>-1&&(d[cs.zhCN]=0);var ue="",ge=0;for(var xe in d)d[xe]>ge&&(ue=xe,ge=d[xe]);var pe={};for(var Se in f)pe[Se]={},pe[Se].number=h[Se],pe[Se].list=f[Se];var Ce={languageName:ue,languageArray:pe};return Ce},getCharLanguage:function(e){if(e===null||typeof e>"u")return"";if(this.italian(e))return cs.it;if(this.english(e))return cs.en;if(this.specialCharacter(e))return"specialCharacter";if(this.number(e))return"number";var s=this.chinese(e);return s===cs.zhCN?cs.zhCN:s===cs.zhTW?cs.zhTW:this.japanese(e)?cs.ja:this.korean(e)?cs.ko:""},analyse:function(e,s,f,d,h){typeof s[e]>"u"&&(s[e]=[]);var E=0;typeof f.storage_language>"u"||(Nt.language.connector(h)&&(e=f.storage_language),f.storage_language==e?E=s[e].length-1:E=s[e].length),typeof s[e][E]>"u"&&(s[e][E]=[],s[e][E].beforeText="",s[e][E].afterText="",s[e][E].text=""),s[e][E].text=s[e][E].text+h,Nt.language.wordBlankConnector(Nt.language.getLocal())==!1&&Nt.language.wordBlankConnector(Nt.to)&&f.storage_language!=null&&typeof f.storage_language<"u"&&f.storage_language.length>0&&f.storage_language!="specialCharacter"&&(Nt.language.wordBlankConnector(f.storage_language)==!1&&Nt.language.wordBlankConnector(e)?s[f.storage_language][s[f.storage_language].length-1].afterText=" ":f.storage_language==cs.en&&e!=cs.en&&(s[e][E].beforeText=" "));var P=[];return P.langStrs=s,P.storage_language=e,P},connector:function(e){return!!(/.*[\u0020\u00A0\u202F\u205F\u3000]+.*$/.test(e)||/.*[\u0030-\u0039]+.*$/.test(e)||/.*[\u0021\u0022\u0023\u0024\u0025\u0026\u0027\u002C\u002D\u002E\u003A\u003B\u003F\u0040]+.*$/.test(e)||/.*[\u3002\uFF1F\uFF01\uFF0C\u3001\uFF1B\uFF1A\u300C\u300D\u300E\u300F\u2018\u2019\u201C\u201D\uFF08\uFF09\u3014\u3015\u3010\u3011\u2014\u2026\u2013\uFF0E\u300A\u300B\u3008\u3009\u00b7]+.*$/.test(e))},wordBlankConnector:function(e){if(e===null||typeof e>"u")return!0;switch(e.trim().toLowerCase()){case cs.zhCN:return!1;case cs.zhTW:return!1;case cs.ko:return!1;case cs.ja:return!1}return!0},chinese_traditional_dict:"\u769A\u85F9\u7919\u611B\u7FFA\u8956\u5967\u58E9\u7F77\u64FA\u6557\u9812\u8FA6\u7D46\u5E6B\u7D81\u938A\u8B17\u525D\u98FD\u5BF6\u5831\u9B91\u8F29\u8C9D\u92C7\u72FD\u5099\u618A\u7E43\u7B46\u7562\u6583\u9589\u908A\u7DE8\u8CB6\u8B8A\u8FAF\u8FAE\u9F08\u765F\u7015\u6FF1\u8CD3\u64EF\u9905\u64A5\u7F3D\u9251\u99C1\u8514\u88DC\u53C3\u8836\u6B98\u615A\u6158\u71E6\u84BC\u8259\u5009\u6EC4\u5EC1\u5074\u518A\u6E2C\u5C64\u8A6B\u6519\u647B\u87EC\u995E\u8B92\u7E8F\u93DF\u7523\u95E1\u986B\u5834\u5617\u9577\u511F\u8178\u5EE0\u66A2\u9214\u8ECA\u5FB9\u5875\u9673\u896F\u6490\u7A31\u61F2\u8AA0\u9A01\u7661\u9072\u99B3\u6065\u9F52\u71BE\u6C96\u87F2\u5BF5\u7587\u8E8A\u7C4C\u7DA2\u919C\u6AE5\u5EDA\u92E4\u96DB\u790E\u5132\u89F8\u8655\u50B3\u7621\u95D6\u5275\u9318\u7D14\u7DBD\u8FAD\u8A5E\u8CDC\u8070\u8525\u56EA\u5F9E\u53E2\u6E4A\u7AC4\u932F\u9054\u5E36\u8CB8\u64D4\u55AE\u9132\u64A3\u81BD\u619A\u8A95\u5F48\u7576\u64CB\u9EE8\u8569\u6A94\u6417\u5CF6\u79B1\u5C0E\u76DC\u71C8\u9127\u6575\u6ECC\u905E\u7DE0\u9EDE\u588A\u96FB\u6FB1\u91E3\u8ABF\u53E0\u8ADC\u758A\u91D8\u9802\u9320\u8A02\u6771\u52D5\u68DF\u51CD\u9B25\u72A2\u7368\u8B80\u8CED\u934D\u935B\u65B7\u7DDE\u514C\u968A\u5C0D\u5678\u9813\u920D\u596A\u9D5D\u984D\u8A1B\u60E1\u9913\u5152\u723E\u990C\u8CB3\u767C\u7F70\u95A5\u743A\u792C\u91E9\u7169\u7BC4\u8CA9\u98EF\u8A2A\u7D21\u98DB\u5EE2\u8CBB\u7D1B\u58B3\u596E\u61A4\u7CDE\u8C50\u6953\u92D2\u98A8\u760B\u99AE\u7E2B\u8AF7\u9CF3\u819A\u8F3B\u64AB\u8F14\u8CE6\u8907\u8CA0\u8A03\u5A66\u7E1B\u8A72\u9223\u84CB\u5E79\u8D95\u7A08\u8D1B\u5CA1\u525B\u92FC\u7DB1\u5D17\u81EF\u93AC\u64F1\u9D3F\u95A3\u927B\u500B\u7D66\u9F94\u5BAE\u978F\u8CA2\u920E\u6E9D\u69CB\u8CFC\u5920\u8831\u9867\u526E\u95DC\u89C0\u9928\u6163\u8CAB\u5EE3\u898F\u77FD\u6B78\u9F9C\u95A8\u8ECC\u8A6D\u6AC3\u8CB4\u528A\u8F25\u6EFE\u934B\u570B\u904E\u99ED\u97D3\u6F22\u95A1\u9DB4\u8CC0\u6A6B\u8F5F\u9D3B\u7D05\u5F8C\u58FA\u8B77\u6EEC\u6236\u5629\u83EF\u756B\u5283\u8A71\u61F7\u58DE\u6B61\u74B0\u9084\u7DE9\u63DB\u559A\u7613\u7165\u6E19\u9EC3\u8B0A\u63EE\u8F1D\u6BC0\u8CC4\u7A62\u6703\u71F4\u5F59\u8AF1\u8AA8\u7E6A\u8477\u6E3E\u5925\u7372\u8CA8\u798D\u64CA\u6A5F\u7A4D\u9951\u8B4F\u96DE\u7E3E\u7DDD\u6975\u8F2F\u7D1A\u64E0\u5E7E\u858A\u5291\u6FDF\u8A08\u8A18\u969B\u7E7C\u7D00\u593E\u83A2\u9830\u8CC8\u9240\u50F9\u99D5\u6BB2\u76E3\u5805\u7B8B\u9593\u8271\u7DD8\u7E6D\u6AA2\u583F\u9E7C\u63C0\u64BF\u7C21\u5109\u6E1B\u85A6\u6ABB\u9452\u8E10\u8CE4\u898B\u9375\u8266\u528D\u991E\u6F38\u6FFA\u6F97\u6F3F\u8523\u69F3\u734E\u8B1B\u91AC\u81A0\u6F86\u9A55\u5B0C\u652A\u9278\u77EF\u50E5\u8173\u9903\u7E73\u7D5E\u8F4E\u8F03\u7A2D\u968E\u7BC0\u8396\u9A5A\u7D93\u9838\u975C\u93E1\u5F91\u75D9\u7AF6\u6DE8\u7CFE\u5EC4\u820A\u99D2\u8209\u64DA\u92F8\u61FC\u5287\u9D51\u7D79\u5091\u6F54\u7D50\u8AA1\u5C46\u7DCA\u9326\u50C5\u8B39\u9032\u6649\u71FC\u76E1\u52C1\u834A\u89BA\u6C7A\u8A23\u7D55\u921E\u8ECD\u99FF\u958B\u51F1\u9846\u6BBC\u8AB2\u58BE\u61C7\u6473\u5EAB\u8932\u8A87\u584A\u5108\u5BEC\u7926\u66E0\u6CC1\u8667\u5DCB\u7ABA\u994B\u6F70\u64F4\u95CA\u881F\u81D8\u840A\u4F86\u8CF4\u85CD\u6B04\u6514\u7C43\u95CC\u862D\u703E\u8B95\u652C\u89BD\u61F6\u7E9C\u721B\u6FEB\u6488\u52DE\u6F87\u6A02\u9433\u58D8\u985E\u6DDA\u7C6C\u96E2\u88CF\u9BC9\u79AE\u9E97\u53B2\u52F5\u792B\u66C6\u701D\u96B8\u5006\u806F\u84EE\u9023\u942E\u6190\u6F23\u7C3E\u6582\u81C9\u93C8\u6200\u7149\u7DF4\u7CE7\u6DBC\u5169\u8F1B\u8AD2\u7642\u907C\u9410\u7375\u81E8\u9130\u9C57\u51DC\u8CC3\u9F61\u9234\u6DE9\u9748\u5DBA\u9818\u993E\u5289\u9F8D\u807E\u56A8\u7C60\u58DF\u650F\u96B4\u6A13\u5A41\u645F\u7C0D\u8606\u76E7\u9871\u5EEC\u7210\u64C4\u9E75\u865C\u9B6F\u8CC2\u797F\u9304\u9678\u9A62\u5442\u92C1\u4FB6\u5C62\u7E37\u616E\u6FFE\u7DA0\u5DD2\u6523\u5B7F\u7064\u4E82\u6384\u8F2A\u502B\u4F96\u6DEA\u7DB8\u8AD6\u863F\u7F85\u908F\u947C\u7C6E\u9A3E\u99F1\u7D61\u5ABD\u746A\u78BC\u879E\u99AC\u7F75\u55CE\u8CB7\u9EA5\u8CE3\u9081\u8108\u779E\u9945\u883B\u6EFF\u8B3E\u8C93\u9328\u925A\u8CBF\u9EBD\u9EF4\u6C92\u9382\u9580\u60B6\u5011\u9333\u5922\u8B0E\u5F4C\u8993\u7DBF\u7DEC\u5EDF\u6EC5\u61AB\u95A9\u9CF4\u9298\u8B2C\u8B00\u755D\u9209\u7D0D\u96E3\u6493\u8166\u60F1\u9B27\u9912\u81A9\u6506\u649A\u91C0\u9CE5\u8076\u9F67\u9477\u93B3\u6AB8\u7370\u752F\u64F0\u6FD8\u9215\u7D10\u81BF\u6FC3\u8FB2\u7627\u8AFE\u6B50\u9DD7\u6BC6\u5614\u6F1A\u76E4\u9F90\u570B\u611B\u8CE0\u5674\u9D6C\u9A19\u98C4\u983B\u8CA7\u860B\u6191\u8A55\u6F51\u9817\u64B2\u92EA\u6A38\u8B5C\u81CD\u9F4A\u9A0E\u8C48\u5553\u6C23\u68C4\u8A16\u727D\u6261\u91FA\u925B\u9077\u7C3D\u8B19\u9322\u9257\u6F5B\u6DFA\u8B74\u5879\u69CD\u55C6\u7246\u8594\u5F37\u6436\u936C\u6A4B\u55AC\u50D1\u7FF9\u7AC5\u7ACA\u6B3D\u89AA\u8F15\u6C2B\u50BE\u9803\u8ACB\u6176\u74CA\u7AAE\u8DA8\u5340\u8EC0\u9A45\u9F72\u9874\u6B0A\u52F8\u537B\u9D72\u8B93\u9952\u64FE\u7E5E\u71B1\u97CC\u8A8D\u7D09\u69AE\u7D68\u8EDF\u92B3\u958F\u6F64\u7051\u85A9\u9C13\u8CFD\u5098\u55AA\u9A37\u6383\u6F80\u6BBA\u7D17\u7BE9\u66EC\u9583\u965D\u8D0D\u7E55\u50B7\u8CDE\u71D2\u7D39\u8CD2\u651D\u61FE\u8A2D\u7D33\u5BE9\u5B38\u814E\u6EF2\u8072\u7E69\u52DD\u8056\u5E2B\u7345\u6FD5\u8A69\u5C4D\u6642\u8755\u5BE6\u8B58\u99DB\u52E2\u91CB\u98FE\u8996\u8A66\u58FD\u7378\u6A1E\u8F38\u66F8\u8D16\u5C6C\u8853\u6A39\u8C4E\u6578\u5E25\u96D9\u8AB0\u7A05\u9806\u8AAA\u78A9\u720D\u7D72\u98FC\u8073\u616B\u980C\u8A1F\u8AA6\u64FB\u8607\u8A34\u8085\u96D6\u7D8F\u6B72\u5B6B\u640D\u7B4D\u7E2E\u7463\u9396\u737A\u64BB\u64E1\u6524\u8CAA\u7671\u7058\u58C7\u8B5A\u8AC7\u6B4E\u6E6F\u71D9\u6FE4\u7E27\u9A30\u8B04\u92BB\u984C\u9AD4\u5C5C\u689D\u8CBC\u9435\u5EF3\u807D\u70F4\u9285\u7D71\u982D\u5716\u5857\u5718\u9839\u86FB\u812B\u9D15\u99B1\u99DD\u6A62\u7AAA\u896A\u5F4E\u7063\u9811\u842C\u7DB2\u97CB\u9055\u570D\u7232\u6FF0\u7DAD\u8466\u5049\u50DE\u7DEF\u8B02\u885B\u6EAB\u805E\u7D0B\u7A69\u554F\u7515\u64BE\u8778\u6E26\u7AA9\u55DA\u93A2\u70CF\u8AA3\u7121\u856A\u5433\u5862\u9727\u52D9\u8AA4\u932B\u72A7\u8972\u7FD2\u9291\u6232\u7D30\u8766\u8F44\u5CFD\u4FE0\u72F9\u5EC8\u9341\u9BAE\u7E96\u9E79\u8CE2\u929C\u9591\u986F\u96AA\u73FE\u737B\u7E23\u9921\u7FA8\u61B2\u7DDA\u5EC2\u9472\u9109\u8A73\u97FF\u9805\u856D\u92B7\u66C9\u562F\u880D\u5354\u633E\u651C\u8105\u8AE7\u5BEB\u7009\u8B1D\u92C5\u91C1\u8208\u6D36\u93FD\u7E61\u865B\u5653\u9808\u8A31\u7DD2\u7E8C\u8ED2\u61F8\u9078\u766C\u7D62\u5B78\u52F3\u8A62\u5C0B\u99B4\u8A13\u8A0A\u905C\u58D3\u9D09\u9D28\u555E\u4E9E\u8A1D\u95B9\u7159\u9E7D\u56B4\u9854\u95BB\u8C54\u53AD\u786F\u5F65\u8AFA\u9A57\u9D26\u694A\u63DA\u760D\u967D\u7662\u990A\u6A23\u7464\u6416\u582F\u9059\u7AAF\u8B20\u85E5\u723A\u9801\u696D\u8449\u91AB\u92A5\u9824\u907A\u5100\u5F5C\u87FB\u85DD\u5104\u61B6\u7FA9\u8A63\u8B70\u8ABC\u8B6F\u7570\u7E79\u852D\u9670\u9280\u98F2\u6AFB\u5B30\u9DF9\u61C9\u7E93\u7469\u87A2\u71DF\u7192\u8805\u7A4E\u55B2\u64C1\u50AD\u7670\u8E34\u8A60\u6E67\u512A\u6182\u90F5\u923E\u7336\u904A\u8A98\u8F3F\u9B5A\u6F01\u5A1B\u8207\u5DBC\u8A9E\u7C72\u79A6\u7344\u8B7D\u9810\u99AD\u9D1B\u6DF5\u8F45\u5712\u54E1\u5713\u7DE3\u9060\u9858\u7D04\u8E8D\u9470\u5DBD\u7CB5\u6085\u95B1\u96F2\u9116\u52FB\u9695\u904B\u860A\u919E\u6688\u97FB\u96DC\u707D\u8F09\u6522\u66AB\u8D0A\u8D13\u9AD2\u947F\u68D7\u7AC8\u8CAC\u64C7\u5247\u6FA4\u8CCA\u8D08\u7D2E\u5284\u8ECB\u9358\u9598\u8A50\u9F4B\u50B5\u6C08\u76DE\u65AC\u8F3E\u5D84\u68E7\u6230\u7DBB\u5F35\u6F32\u5E33\u8CEC\u8139\u8D99\u87C4\u8F4D\u937A\u9019\u8C9E\u91DD\u5075\u8A3A\u93AE\u9663\u6399\u775C\u7319\u5E40\u912D\u8B49\u7E54\u8077\u57F7\u7D19\u646F\u64F2\u5E5F\u8CEA\u937E\u7D42\u7A2E\u816B\u8846\u8B05\u8EF8\u76BA\u665D\u9A5F\u8C6C\u8AF8\u8A85\u71ED\u77DA\u56D1\u8CAF\u9444\u7BC9\u99D0\u5C08\u78DA\u8F49\u8CFA\u6A01\u838A\u88DD\u599D\u58EF\u72C0\u9310\u8D05\u589C\u7DB4\u8AC4\u6FC1\u8332\u8CC7\u6F2C\u8E64\u7D9C\u7E3D\u7E31\u9112\u8A5B\u7D44\u947D\u7DFB\u9418\u9EBC\u70BA\u96BB\u5147\u6E96\u555F\u95C6\u88E1\u9742\u9918\u934A\u6D29",chinese:function(e){return/.*[\u4e00-\u9fa5]+.*$/.test(e)?this.chinese_traditional_dict.indexOf(e)>-1?cs.zhTW:cs.zhCN:""},english:function(e){return/.*[\u0041-\u005a]+.*$/.test(e)?!0:!!/.*[\u0061-\u007a]+.*$/.test(e)},japanese:function(e){return!!/.*[\u3040-\u309F\u30A0-\u30FF]+.*$/.test(e)},korean:function(e){return!!/.*[\uAC00-\uD7AF]+.*$/.test(e)},number:function(e){return!!/.*[\u0030-\u0039]+.*$/.test(e)},italian:function(e){return!!/.*[\u00E0-\u00F6]+.*$/.test(e)},specialCharacter:function(e){return!!(/.*[\u2460-\u24E9]+.*$/.test(e)||/.*[\u2500-\u25FF]+.*$/.test(e)||/.*[\u3200-\u33FF]+.*$/.test(e)||/.*[\uFF00-\uFF5E]+.*$/.test(e)||/.*[\u2000-\u22FF]+.*$/.test(e)||/.*[\u3001-\u3036]+.*$/.test(e)||/.*[\u0020-\u002F]+.*$/.test(e)||/.*[\u003A-\u007E]+.*$/.test(e)||/.*[\u0009\u000a\u0020\u00A0\u1680\u180E\u202F\u205F\u3000\uFEFF]+.*$/.test(e)||/.*[\u2000-\u200B]+.*$/.test(e)||/.*[\u00A1-\u0105]+.*$/.test(e)||/.*[\u2C60-\u2C77]+.*$/.test(e))}},util:{uuid:function(){var e=new Date().getTime();window.performance&&typeof window.performance.now=="function"&&(e+=performance.now());var s="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/[xy]/g,function(f){var d=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(f=="x"?d:d&3|8).toString(16)});return s},findTag:function(e){var s=/<[^>]+>/g;return s.test(e)},arrayFindMaxNumber:function(e){for(var s={},f=[],d=0,h=0,E=e.length;h<E;h++)s[e[h]]?s[e[h]]++:s[e[h]]=1,s[e[h]]>d&&(d=s[e[h]]);for(var P in s)s[P]===d&&f.push(P);return f},hash:function(e){if(e==null||typeof e>"u")return e;var s=0,f,d;if(e.length===0)return s;for(f=0;f<e.length;f++)d=e.charCodeAt(f),s=(s<<5)-s+d,s|=0;return s+""},charReplace:function(e){return e==null?"":(e=e.trim(),e=e.replace(/\t|\n|\v|\r|\f/g,""),e)},regExp:{pattern:function(e){return e=e.replace(/\\/g,"\\\\"),e=e.replace(/\"/g,'\\"'),e=e.replace(/\?/g,"\\?"),e=e.replace(/\$/g,"\\$"),e=e.replace(/\(/g,"\\("),e=e.replace(/\)/g,"\\)"),e=e.replace(/\|/g,"\\|"),e=e.replace(/\+/g,"\\+"),e=e.replace(/\*/g,"\\*"),e=e.replace(/\[/g,"\\["),e=e.replace(/\]/g,"\\]"),e=e.replace(/\^/g,"\\^"),e=e.replace(/\{/g,"\\{"),e=e.replace(/\}/g,"\\}"),e},resultText:function(e){return e}},getUrlParam:function(e){var s=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),f=window.location.search.substr(1).match(s);return f!=null?unescape(f[2]):""},objSort:function(e){var s=Array.from(Object.keys(e));s.sort(function(te,ne){return ne.length-te.length});var f=[],d=!0,h=!1,E=void 0;try{for(var P=s[Symbol.iterator](),R;!(d=(R=P.next()).done);d=!0){var q=R.value;f[q]=e[q]}}catch(te){h=!0,E=te}finally{try{!d&&P.return!=null&&P.return()}finally{if(h)throw E}}return f},versionStringToInt:function(e){var s=e.split("."),f=0;return f=parseInt(s[0])*1e3*1e3+f,f=parseInt(s[1])*1e3+f,f=parseInt(s[2])+f,f},split:function(e,s){var f=[];if(JSON.stringify(e).length<=s)f.push(e);else{var d=JSON.stringify(e).trim().substring(1,JSON.stringify(e).length-1);if(JSON.stringify(e).length-s<=2){s=s-4;var h=d.substring(0,d.lastIndexOf('","')+1),E=d.substring(d.lastIndexOf('","')+2);f.push(JSON.parse("["+h+"]")),f.push(JSON.parse("["+E+"]"))}else{s=s-2;for(var P=0;P-d.length<0;){var R="";P+s-d.length>=0?R=d.substring(P):R=d.substring(P,P+s);var q=R.length,te=1;if(R.endsWith('"')){if(R.endsWith('","'))q-=2;else if(!R.startsWith('"')){var ne=R.lastIndexOf('","');q=ne+1}}else if(R.endsWith('",'))q-=1;else{var ue=R.lastIndexOf('","');q=ue+1,q<=0&&(R.startsWith('"')?q=R.length()-1:q=R.length()-2,R.endsWith('"')||(te=0))}var ge="";q-R.length>0||q-0==0?(ge=R,q=q+ge.length):ge=R.substring(0,q),!ge.startsWith('"')&&!ge.startsWith(',"')&&(ge='"'+ge),ge.endsWith('"')||(ge=ge+'"'),P+=q+te,ge="["+ge+"]";try{f.push(JSON.parse(ge))}catch{P=P-(q+te)+1}}}}return f}},service:{name:"translate.service",use:function(e){typeof e=="string"&&e=="client.edge"&&(Nt.service.name=e,Nt.whole.tag.push("body"),Nt.whole.tag.push("head"),Nt.whole.tag.push("html"))}},storage:{set:function(e,s){localStorage.setItem(LT+e,s)},get:function(e){return localStorage.getItem(LT+e)}},images:{queues:[],add:function(e){for(var s in e)Nt.images.queues[s]=e[s]},execute:function(){if(!(Object.keys(Nt.images.queues).length<1)){for(var e=document.getElementsByTagName("img"),s=0;s<e.length;s++){var f=e[s];if(!(typeof f.src>"u"||f.src==null||f.src.length==0)){var d=f.getAttribute("src");for(var h in Nt.images.queues){var E=h,P=Nt.images.queues[h];E==d&&(P=P.replace(new RegExp("{language}","g"),Nt.to),f.src=P)}}}for(var R=document.getElementsByTagName("*"),s=0;s<R.length;s++){var q=R[s],te=window.getComputedStyle(q,null),ne=te.backgroundImage;if(ne!="none"){var ue=Nt.images.gainCssBackgroundUrl(ne);if(typeof Nt.images.queues[ue]<"u"){var P=Nt.images.queues[ue];P=P.replace(new RegExp("{language}","g"),Nt.to),q.style.backgroundImage='url("'+P+'")'}}}}},gainCssBackgroundUrl:function(e){var s=e.indexOf('"'),f=e.lastIndexOf('"');if(s!=-1&&f!=-1){var d=e.substring(s+1,f);return d}return e}},reset:function(){var e=Nt.language.getCurrent();for(var s in Nt.nodeQueue)for(var f in Nt.nodeQueue[s].list)for(var d in Nt.nodeQueue[s].list[f]){var h=Nt.nodeQueue[s].list[f][d];for(var E in h.nodes){var P=Nt.storage.get("hash_"+e+"_"+d);typeof P>"u"||P!=null&&P.length!=0&&Nt.element.nodeAnalyse.analyse(h.nodes[E].node,P,h.original,h.nodes[E].node.attribute)}}Nt.storage.set("to",""),Nt.to=null},fetchTranslation:function(){}},S4={index:function(e){var s=e.parentNode;if(s==null)return"";var f;typeof e.tagName>"u"?f=s.childNodes:f=s.querySelectorAll(e.tagName);var d=Array.prototype.indexOf.call(f,e);return e.nodeName+""+(d+1)},uuid:function(e){for(var s="",f=e;f!=null;){var d=S4.index(f);d!=""&&(s!=""&&(s="_"+s),s=d+s),f=f.parentNode}return s}};window.translate=Nt;const A4=Nt;var XK=128,YK=2500,JK=[function(t){return/^[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,6}$/.test(t)}],QK=function(t){return JK.some(function(e){return e(t)})},e$=function(t){for(var e=[[]],s=[],f=t.length,d=0,h=0;h<f;h++){var E=t[h];if(QK(E)){s.push({index:h,text:E});break}d+E.length>YK&&(e.push([]),d=0);var P=e[e.length-1];P.push(E),d+=E.length,P.length>=XK&&(e.push([]),d=0)}return{tasks:e.filter(function(R){return R.length>0}),ignoredTexts:s}},t$=function(t,e){return e.forEach(function(s){var f=s.index,d=s.text;t.splice(f,0,d)}),t},FT=function(t){var e=A4.language.getLocal(),s=ZK.includes(e),f=s&&t.from===e||!s&&t.from===E4;return!f},n$=function(t){var e=500,s=[],f=(0,ny.throttle)(function(d){console.log("!!!throttledFn");var h=s.slice();s.length=0;var E=h.reduce(function(R,q){return R.concat(q.data.texts)},[]),P=function(R){var q=R.texts;h.forEach(function(te){var ne=te.data,ue=te.callback,ge=q.splice(0,ne.texts.length);ue({result:1,from:ne.from,to:ne.to,texts:ge})})};t(Ae(be({},d),{texts:E}),P)},e);return function(d,h){if(FT(d)){h({result:1,from:d.from,to:d.to,texts:d.texts});return}s.push({data:d,callback:h}),f(d)}},r$="/bapi/defi/v1/private/wallet-direct/buw/google/translate",cQ=n$(function(t,e){var s=A4.language.getLocal(),f=e$(t.texts),d=f.tasks,h=f.ignoredTexts;if(d.length===0||FT(t)){e({result:1,from:t.from,to:t.to,texts:t.texts});return}console.log("!!!wrappedFetchTranslation"),Promise.all(d.map(function(E){return qK(r$,{targetLanguage:t.to,originalLanguage:s,texts:E}).catch(function(P){throw console.log("\u{1F680} ~~ tasks.map ~~ err:",P),Ng(Et.TRANSLATE_FAIL),new Error(P)}).then(function(P){if(!P.success)throw P.code==="015002"?(A4.listener.stop(),Ng(Et.FETCH_TRANSLATION_TOO_MANY)):(console.log("\u{1F680} ~~ tasks.map ~~ res:",P),Ng(Et.TRANSLATE_FAIL)),new Error(P.message);return P.data})})).then(function(E){var P=E.reduce(function(R,q){return R.concat(q)},[]);e({result:1,from:t.from,to:t.to,texts:t$(P,h)})}).catch(function(E){console.log("\u{1F680} ~~ wrappedFetchTranslation ~~ catch:",E),Ng(Et.TRANSLATE_FAIL)}),Ng(Et.FETCH_TRANSLATION,{from:t.from,to:t.to})}),i$="/bapi/defi/v1/private/wallet-direct/buw/google/translate/originalLanguage",s$=function(t){translate.changeLanguage(t),translate.listener.start()},uQ=function(){translate.fetchTranslation=wrappedFetchTranslation,translate.listener.renderTaskFinish=function(){postMpMessage(BrowserMsgName.TRANSLATE_SUCCESS)};var t=[],e=translate.storage.get(BrowserMsgName.TANSLATE_SHOW_ORIGINAL)==="true";translate.language.setLocal("en"),t.push(function(){if(e){translate.storage.set(BrowserMsgName.TANSLATE_SHOW_ORIGINAL,"");return}var f=translate.storage.get(BrowserMsgName.REFRESH_TRANSLATE)==="true";f&&translate.storage.set(BrowserMsgName.REFRESH_TRANSLATE,""),callMpMethod(BrowserMsgName.GET_TRANSLATE_SETTINGS).then(function(d){if(d){var h=d.to,E=d.alwaysTranslate;h&&(E||f)&&s$(h)}})});var s=function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(!(f<=0)){var d=translate.language.getDetectLanguage(),h=d.languageName,E=d.isUnidentification,P=d.maxLangStr;if(!h){setTimeout(function(){s(f-1)},300);return}E?post(i$,{text:P}).then(function(R){if(R.success){var q=R.data;translate.language.setLocal(q),t.forEach(function(te){return te()}),postMpMessage(BrowserMsgName.PAGE_READY,{showOriginal:e,detectedLanguage:q})}}):h&&(translate.language.setLocal(h),t.forEach(function(R){return R()}),postMpMessage(BrowserMsgName.PAGE_READY,{showOriginal:e,detectedLanguage:h}))}};window.addEventListener("load",function(){setTimeout(function(){s(3)},500)})},x4=null,o$=200,lQ=function(t){if(methodMessageHandle(t))return!0;if(t.method===BrowserMsgName.TRANSLATE_PAGE){if(x4[BrowserMsgName.TRANSLATE_PAGE]&&new Date().getTime()-x4[BrowserMsgName.TRANSLATE_PAGE]<o$)return!0;var e=t.methodParams[0];return changeLanguage(e),x4[BrowserMsgName.TRANSLATE_PAGE]=new Date().getTime(),!0}return t.method===BrowserMsgName.TANSLATE_SHOW_ORIGINAL?(translate.changeLanguage(translate.language.getLocal()),translate.storage.set(BrowserMsgName.TANSLATE_SHOW_ORIGINAL,"true"),window.location.reload(),!0):t.method===BrowserMsgName.REFRESH_TRANSLATE?(translate.storage.set(BrowserMsgName.REFRESH_TRANSLATE,"true"),window.location.reload(),!0):t.method===BrowserMsgName.CLEAR_CACHE?(window.localStorage.clear(),window.location.reload(),!0):!1},I4=new Map,fQ=function(t){var e=genId();return new Promise(function(s){I4.set(e,function(f){s(f)}),postMessageToMp({method:DappBrowserSentActions.sign,payload:t,id:e})})},dQ=null,hQ=function(t){var e=(t||{}).method;if(e===DappBrowserSentActions.sign){var s=t.id,f=t.payload,d=I4.get(s);return d&&(d(f),I4.delete(s)),!0}},uv=new Map,pQ=function(t){var e=genId();return new Promise(function(s){uv.set(e,function(f){s(f)}),console.log("\u{1F680} ~~ commonTgeSign signData:",t,e),postMessageToMp({method:DappBrowserSentActions.commonTgeSign,payload:t,id:e})})},gQ=function(t){var e=genId();return new Promise(function(s){uv.set(e,function(f){s(f)}),console.log("\u{1F680} ~~ commonTgeVerify payload:",t,e),postMessageToMp({method:DappBrowserSentActions.commonTgeVerify,payload:t,id:e})})},yQ=null,mQ=function(t){var e=(t||{}).method;if(e===DappBrowserSentActions.commonTgeSign||e===DappBrowserSentActions.commonTgeVerify){var s=t.id,f=t.payload,d=uv.get(s);return d&&(d(f),uv.delete(s)),!0}};function bQ(t){if(handleRiskTips(t)||translationMessageHandle(t)||getSignatureHandler(t)||getCommonTgeApiHandler(t))return!0}var a$=function(t){if(window.bn.onMessage){console.log("~~ injectedJS ~~ window.bn.onMessage is found, bind handler");var e=window.bn.onMessage.bind(window.bn);window.bn.onMessage=function(s){e(s),t(s)}}else console.log("~~ injectedJS ~~ window.bn.onMessage is not found, set handler"),window.bn.onMessage=t},vQ=function(t){a$(function(e){var s=e.data;try{if(console.log("~~ dappBrowser received event:",s),chainUnrelatedhandlers(s))return;var f=s.namespace,d=s.id,h=s.payload,E=s.method,P=function(te){if(!te)throw new Error("namespace is required to get provider");var ne=t.find(function(ue){try{return ue._namespace===te}catch{return}});if(!ne)throw new Error("provider not found");return ne};switch(s.method){case MPSentDappBrowserActions.setVersion:{window.bnVersion=h;break}case MPSentDappBrowserActions.updateConnectedInfo:{var R=h.namespace&&t.find(function(te){return te._namespace===h.namespace});R?R.setConnectedInfo(s.payload?{address:s.payload.address,chainId:s.payload.chainId,pubKey:s.payload.pubKey}:{address:"",chainId:"",pubKey:""}):t.forEach(function(te){te.setConnectedInfo({address:"",chainId:"",pubKey:""})});break}case MPSentProviderCommonActions.setResponse:{P(f).setResponse(d,h);return}case MPSentProviderCommonActions.setError:{var q=h;P(f).setError(d,new ProviderRpcError(q.code,q.message));return}default:throw new Error("No method in bn.onMessage, ".concat(E))}}catch(te){console.error(te)}})};window._bnJumpToAsset=function(){console.log("_bnJumpToAsset called"),window.bn.miniProgram.postMessage({name:"jump_to_mp_page",data:{url:"pages/wallet/home/index"}})},window._bnJumpToTrade=function(t){console.log("_bnJumpToTrade called:",t);var e=t.fromChainId,s=t.toChainId,f=t.fromTokenAddress,d=t.toTokenAddress;window.bn.miniProgram.postMessage({name:"jump_to_mp_page",data:{url:"pages/swap-with-tab/index",fromTokenAddress:f,toTokenAddress:d,fromBinanceChainId:String(e),toBinanceChainId:String(s)}})};var cu;(function(t){t.Announce="eip6963:announceProvider",t.Request="eip6963:requestProvider"})(cu||(cu={}));var c$=RegExp("(?:^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}$)|(?:^0{8}-0{4}-0{4}-0{4}-0{12}$)","u"),u$=RegExp("(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\\.)+[a-zA-Z]{2,63}$)","u");function wQ(t){window.addEventListener(cu.Announce,function(e){f$(e)||B4("Invalid EIP-6963 AnnounceProviderEvent object received from ".concat(cu.Announce," event.")),t(e.detail)}),window.dispatchEvent(new Event(cu.Request))}function l$(t){return Rn(t,Event)&&t.type===cu.Request}function f$(t){return _instanceof(t,CustomEvent)&&t.type===cu.Announce&&Object.isFrozen(t.detail)&&jT(t.detail)}function jT(t){if(!t||!t.info||!t.provider)return!1;var e=t.info;return typeof e.uuid=="string"&&c$.test(e.uuid)&&typeof e.name=="string"&&!!e.name&&typeof e.icon=="string"&&e.icon.startsWith("data:image")&&typeof e.rdns=="string"&&u$.test(e.rdns)}function B4(t){throw new Error("".concat(t," See https://eips.ethereum.org/EIPS/eip-6963 for requirements."))}function k4(t){jT(t)||B4("Invalid EIP-6963 ProviderDetail object.");var e=t.info,s=t.provider,f=function(){return window.dispatchEvent(new CustomEvent(cu.Announce,{detail:Object.freeze({info:be({},e),provider:s})}))};f(),window.addEventListener(cu.Request,function(d){l$(d)||B4("Invalid EIP-6963 RequestProviderEvent object received from ".concat(cu.Request," event.")),f()})}var d$=function(t,e){var s=new Proxy(t,{deleteProperty:function(){return!0},get:function(d,h){return d[h]}});if(window.location.href.includes("airdrop.blast.io")){k4({info:{uuid:cv(),name:"MetaMask",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMwIiBoZWlnaHQ9IjMwIiBmaWxsPSIjMEIwRTExIi8+CjxwYXRoIGQ9Ik01IDE1TDcuMjU4MDYgMTIuNzQxOUw5LjUxNjEzIDE1TDcuMjU4MDYgMTcuMjU4MUw1IDE1WiIgZmlsbD0iI0YwQjkwQiIvPgo8cGF0aCBkPSJNOC44NzA5NyAxMS4xMjlMMTUgNUwyMS4xMjkgMTEuMTI5TDE4Ljg3MSAxMy4zODcxTDE1IDkuNTE2MTNMMTEuMTI5IDEzLjM4NzFMOC44NzA5NyAxMS4xMjlaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0xMi43NDE5IDE1TDE1IDEyLjc0MTlMMTcuMjU4MSAxNUwxNSAxNy4yNTgxTDEyLjc0MTkgMTVaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0xMS4xMjkgMTYuNjEyOUw4Ljg3MDk3IDE4Ljg3MUwxNSAyNUwyMS4xMjkgMTguODcxTDE4Ljg3MSAxNi42MTI5TDE1IDIwLjQ4MzlMMTEuMTI5IDE2LjYxMjlaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0yMC40ODM5IDE1TDIyLjc0MTkgMTIuNzQxOUwyNSAxNUwyMi43NDE5IDE3LjI1ODFMMjAuNDgzOSAxNVoiIGZpbGw9IiNGMEI5MEIiLz4KPC9zdmc+Cg==",rdns:"io.metamask"},provider:s});return}if(window.location.href.includes("uniswap.org")){k4({info:{uuid:cv(),name:Tn,icon:Sn,rdns:"wallet.binance.com"},provider:s});return}k4({info:{uuid:cv(),name:e||Tn,icon:Sn,rdns:"com.binance.wallet"},provider:s})};function h$(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}function Ac(t,e,s){var f=O(t,e,"set");return h$(t,f,s),s}function T4(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function zT(t,e){W(t,e),e.add(t)}const HT="solana:signAndSendTransaction",KT="solana:signTransaction",$T="solana:signMessage",p$="standard:connect",_Q=null,g$="standard:disconnect",EQ=null,y$="standard:events",SQ=null;var m$="solana:mainnet",b$="solana:mainnet-beta",v$="solana:devnet",w$="solana:testnet",_$="solana:localnet",C4=[m$,b$,v$,w$,_$];function P4(t){return C4.includes(t)}function Ug(t){var e;try{e=Ei.from(t)}catch{}return!e}var E$=function(t){return t.map(function(e){return Ug(e)?i0.deserialize(e):Ei.from(e)})};function S$(t){return"version"in t}var A$=C4,x$=[HT,KT,$T],M4=new WeakMap,O4=new WeakMap,R4=new WeakMap,N4=new WeakMap,U4=new WeakMap,D4=new WeakMap,I$=function(){"use strict";function e(s){var f=s.address,d=s.publicKey,h=s.label,E=s.icon;B(this,e),H(this,M4,{writable:!0,value:void 0}),H(this,O4,{writable:!0,value:void 0}),H(this,R4,{writable:!0,value:void 0}),H(this,N4,{writable:!0,value:void 0}),H(this,U4,{writable:!0,value:void 0}),H(this,D4,{writable:!0,value:void 0}),(Rn(this,e)?this.constructor:void 0)===e&&Object.freeze(this),Ac(this,M4,f),Ac(this,O4,d),Ac(this,R4,A$),Ac(this,N4,x$),Ac(this,U4,h),Ac(this,D4,E)}return Ln(e,[{key:"address",get:function(){return D(this,M4)}},{key:"publicKey",get:function(){return D(this,O4).slice()}},{key:"chains",get:function(){return D(this,R4).slice()}},{key:"features",get:function(){return D(this,N4).slice()}},{key:"label",get:function(){return D(this,U4)}},{key:"icon",get:function(){return D(this,D4)}}]),e}(),B$="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMwIiBoZWlnaHQ9IjMwIiBmaWxsPSIjMEIwRTExIi8+CjxwYXRoIGQ9Ik01IDE1TDcuMjU4MDYgMTIuNzQxOUw5LjUxNjEzIDE1TDcuMjU4MDYgMTcuMjU4MUw1IDE1WiIgZmlsbD0iI0YwQjkwQiIvPgo8cGF0aCBkPSJNOC44NzA5NyAxMS4xMjlMMTUgNUwyMS4xMjkgMTEuMTI5TDE4Ljg3MSAxMy4zODcxTDE1IDkuNTE2MTNMMTEuMTI5IDEzLjM4NzFMOC44NzA5NyAxMS4xMjlaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0xMi43NDE5IDE1TDE1IDEyLjc0MTlMMTcuMjU4MSAxNUwxNSAxNy4yNTgxTDEyLjc0MTkgMTVaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0xMS4xMjkgMTYuNjEyOUw4Ljg3MDk3IDE4Ljg3MUwxNSAyNUwyMS4xMjkgMTguODcxTDE4Ljg3MSAxNi42MTI5TDE1IDIwLjQ4MzlMMTEuMTI5IDE2LjYxMjlaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0yMC40ODM5IDE1TDIyLjc0MTkgMTIuNzQxOUwyNSAxNUwyMi43NDE5IDE3LjI1ODFMMjAuNDgzOSAxNVoiIGZpbGw9IiNGMEI5MEIiLz4KPC9zdmc+Cg==";function k$(t,e){return T$(t,e)}function T$(t,e){if(t===e)return!0;var s=t.length;if(s!==e.length)return!1;for(var f=0;f<s;f++)if(t[f]!==e[f])return!1;return!0}var C$="solanaWallet:",u0=new WeakMap,VT=new WeakMap,L4=new WeakMap,WT=new WeakMap,Go=new WeakMap,Ra=new WeakMap,GT=new WeakMap,F4=new WeakSet,qT=new WeakSet,Dg=new WeakMap,j4=new WeakMap,ZT=new WeakMap,XT=new WeakMap,YT=new WeakMap,z4=new WeakMap,JT=new WeakMap,H4=new WeakMap,P$=function(){"use strict";function e(s,f){var d=this;B(this,e),zT(this,F4),zT(this,qT),H(this,u0,{writable:!0,value:{}}),H(this,VT,{writable:!0,value:"1.0.0"}),H(this,L4,{writable:!0,value:void 0}),H(this,WT,{writable:!0,value:B$}),H(this,Go,{writable:!0,value:null}),H(this,Ra,{writable:!0,value:void 0}),H(this,GT,{writable:!0,value:function(te,ne){var ue;return!((ue=D(d,u0)[te])===null||ue===void 0)&&ue.push(ne)||(D(d,u0)[te]=[ne]),function(){return T4(d,qT,M$).call(d,te,ne)}}}),H(this,Dg,{writable:!0,value:function(){var te,ne=(te=D(d,Ra).publicKey)===null||te===void 0?void 0:te.toBase58();if(ne){var ue=D(d,Ra).publicKey.toBytes(),ge=D(d,Go);(!ge||ge.address!==ne||!k$(ge.publicKey,ue))&&(Ac(d,Go,new I$({address:ne,publicKey:ue})),T4(d,F4,QT).call(d,"change",{accounts:d.accounts}))}}}),H(this,j4,{writable:!0,value:function(){D(d,Go)&&(Ac(d,Go,null),T4(d,F4,QT).call(d,"change",{accounts:d.accounts})),D(d,Ra).disconnect()}}),H(this,ZT,{writable:!0,value:function(){D(d,Ra).publicKey?D(d,Dg).call(d):D(d,j4).call(d)}});var h=this;H(this,XT,{writable:!0,value:T(I().mark(function te(){var ne,ue=arguments;return I().wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:if(ne=(ue.length>0&&ue[0]!==void 0?ue[0]:{}).silent,D(h,Go)){xe.next=4;break}return xe.next=4,D(h,Ra).connect(ne?{onlyIfTrusted:!0}:void 0);case 4:return D(h,Dg).call(h),xe.abrupt("return",{accounts:h.accounts});case 6:case"end":return xe.stop()}},te)}))});var E=this;H(this,YT,{writable:!0,value:T(I().mark(function te(){return I().wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,D(E,Ra).disconnect();case 2:case"end":return ue.stop()}},te)}))});var P=this;H(this,z4,{writable:!0,value:T(I().mark(function te(){var ne,ue,ge,xe,pe,Se,Ce,Fe,We,xt,kt,Bt,Wt,Me,Ke,nt,Tt,pt,Ht,lt,rt,ot,Mt,Ut=arguments;return I().wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:for(ne=Ut.length,ue=new Array(ne),ge=0;ge<ne;ge++)ue[ge]=Ut[ge];if(console.log("provider method signAndSendTransaction called:",ue),D(P,Go)){Qt.next=4;break}throw new Error("not connected");case 4:if(xe=[],ue.length!==1){Qt.next=21;break}if(pe=ue[0],Se=pe.transaction,Ce=pe.account,Fe=pe.chain,We=pe.options,xt=We||{},kt=xt.minContextSlot,Bt=xt.preflightCommitment,Wt=xt.skipPreflight,Me=xt.maxRetries,Ce===D(P,Go)){Qt.next=10;break}throw new Error("invalid account");case 10:if(P4(Fe)){Qt.next=12;break}throw new Error("invalid chain");case 12:return Ke=Ug(Se),console.log("isVersioned:",Ke),Qt.next=16,D(P,Ra).signAndSendTransaction(Ke?i0.deserialize(Se):Ei.from(Se),{preflightCommitment:Bt,minContextSlot:kt,maxRetries:Me,skipPreflight:Wt});case 16:nt=Qt.sent.signature,console.log("signature in wallet.ts:",nt),xe.push({signature:c0().decode(nt)}),Qt.next=54;break;case 21:if(!(ue.length>1)){Qt.next=54;break}Tt=!0,pt=!1,Ht=void 0,Qt.prev=23,lt=ue[Symbol.iterator]();case 25:if(Tt=(rt=lt.next()).done){Qt.next=40;break}return ot=rt.value,console.log("isVersioned when input more than 1:",Ug(ot.transaction)),Qt.t0=(Mt=xe).push,Qt.t1=Mt,Qt.t2=Jl,Qt.next=34,D(P,z4).call(P,ot);case 34:Qt.t3=Qt.sent,Qt.t4=(0,Qt.t2)(Qt.t3),Qt.t0.apply.call(Qt.t0,Qt.t1,Qt.t4);case 37:Tt=!0,Qt.next=25;break;case 40:Qt.next=46;break;case 42:Qt.prev=42,Qt.t5=Qt.catch(23),pt=!0,Ht=Qt.t5;case 46:Qt.prev=46,Qt.prev=47,!Tt&<.return!=null&<.return();case 49:if(Qt.prev=49,!pt){Qt.next=52;break}throw Ht;case 52:return Qt.finish(49);case 53:return Qt.finish(46);case 54:return Qt.abrupt("return",xe);case 55:case"end":return Qt.stop()}},te,null,[[23,42,46,54],[47,,49,53]])}))});var R=this;H(this,JT,{writable:!0,value:T(I().mark(function te(){var ne,ue,ge,xe,pe,Se,Ce,Fe,We,xt,kt,Bt,Wt,Me,Ke,nt,Tt,pt,Ht,lt,rt,ot,Mt,Ut=arguments;return I().wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:for(ne=Ut.length,ue=new Array(ne),ge=0;ge<ne;ge++)ue[ge]=Ut[ge];if(console.log("provider method signTransaction called:",ue),console.log("first input in string:",JSON.stringify(ue[0])),D(R,Go)){Qt.next=5;break}throw new Error("not connected");case 5:if(xe=[],ue.length!==1){Qt.next=26;break}if(pe=ue[0],Se=pe.transaction,Ce=pe.account,Fe=pe.chain,Ce===D(R,Go)){Qt.next=10;break}throw new Error("invalid account");case 10:if(!(Fe&&!P4(Fe))){Qt.next=12;break}throw new Error("invalid chain");case 12:return We=Ug(Se),console.log("isVersioned:",We),xt=We?i0.deserialize(Se):Ei.from(Se),console.log("about to pass to trust provider:",xt),console.log("about to pass to trust provider JSON:",JSON.stringify(xt)),Qt.next=19,D(R,Ra).signTransaction(xt);case 19:kt=Qt.sent,console.log("provider sign finished:",kt),Bt=We?kt.serialize():new Uint8Array(kt.serialize({requireAllSignatures:!1,verifySignatures:!1})),console.log("serialized sign finished:",Bt),xe.push({signedTransaction:Bt}),Qt.next=69;break;case 26:if(!(ue.length>1)){Qt.next=69;break}Me=void 0,Ke=!0,nt=!1,Tt=void 0,Qt.prev=30,pt=ue[Symbol.iterator]();case 32:if(Ke=(Ht=pt.next()).done){Qt.next=50;break}if(lt=Ht.value,lt.account===D(R,Go)){Qt.next=36;break}throw new Error("invalid account");case 36:if(rt=Ug(lt.transaction),console.log("isVersioned when input more than 1:",rt),!lt.chain){Qt.next=47;break}if(P4(lt.chain)){Qt.next=41;break}throw new Error("invalid chain");case 41:if(!Me){Qt.next=46;break}if(lt.chain===Me){Qt.next=44;break}throw new Error("conflicting chain");case 44:Qt.next=47;break;case 46:Me=lt.chain;case 47:Ke=!0,Qt.next=32;break;case 50:Qt.next=56;break;case 52:Qt.prev=52,Qt.t0=Qt.catch(30),nt=!0,Tt=Qt.t0;case 56:Qt.prev=56,Qt.prev=57,!Ke&&pt.return!=null&&pt.return();case 59:if(Qt.prev=59,!nt){Qt.next=62;break}throw Tt;case 62:return Qt.finish(59);case 63:return Qt.finish(56);case 64:return ot=E$(ue.map(function(Cn){return Cn.transaction})),Qt.next=67,D(R,Ra).signAllTransactions(ot);case 67:Mt=Qt.sent,(Wt=xe).push.apply(Wt,Jl(Mt.map(function(Cn){var qn=S$(Cn)?Cn.serialize():new Uint8Array(Cn.serialize({requireAllSignatures:!1,verifySignatures:!1}));return{signedTransaction:qn}})));case 69:return console.log("about to return outputs",xe),Qt.abrupt("return",xe);case 71:case"end":return Qt.stop()}},te,null,[[30,52,56,64],[57,,59,63]])}))});var q=this;H(this,H4,{writable:!0,value:T(I().mark(function te(){var ne,ue,ge,xe,pe,Se,Ce,Fe,We,xt,kt,Bt,Wt,Me,Ke,nt=arguments;return I().wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:for(ne=nt.length,ue=new Array(ne),ge=0;ge<ne;ge++)ue[ge]=nt[ge];if(console.log("provider method signMessage called:",ue),D(q,Go)){pt.next=4;break}throw new Error("not connected");case 4:if(xe=[],ue.length!==1){pt.next=15;break}if(pe=ue[0],Se=pe.message,Ce=pe.account,Ce===D(q,Go)){pt.next=9;break}throw new Error("invalid account");case 9:return pt.next=11,D(q,Ra).signMessage(Se);case 11:Fe=pt.sent.signature,xe.push({signedMessage:Se,signature:Fe}),pt.next=47;break;case 15:if(!(ue.length>1)){pt.next=47;break}We=!0,xt=!1,kt=void 0,pt.prev=17,Bt=ue[Symbol.iterator]();case 19:if(We=(Wt=Bt.next()).done){pt.next=33;break}return Me=Wt.value,pt.t0=(Ke=xe).push,pt.t1=Ke,pt.t2=Jl,pt.next=27,D(q,H4).call(q,Me);case 27:pt.t3=pt.sent,pt.t4=(0,pt.t2)(pt.t3),pt.t0.apply.call(pt.t0,pt.t1,pt.t4);case 30:We=!0,pt.next=19;break;case 33:pt.next=39;break;case 35:pt.prev=35,pt.t5=pt.catch(17),xt=!0,kt=pt.t5;case 39:pt.prev=39,pt.prev=40,!We&&Bt.return!=null&&Bt.return();case 42:if(pt.prev=42,!xt){pt.next=45;break}throw kt;case 45:return pt.finish(42);case 46:return pt.finish(39);case 47:return pt.abrupt("return",xe);case 48:case"end":return pt.stop()}},te,null,[[17,35,39,47],[40,,42,46]])}))}),Ac(this,L4,f||Tn),(Rn(this,e)?this.constructor:void 0)===e&&Object.freeze(this),Ac(this,Ra,s),s.on("connect",D(this,Dg),this),s.on("disconnect",D(this,j4),this),s.on("accountChanged",D(this,ZT),this),D(this,Dg).call(this)}return Ln(e,[{key:"version",get:function(){return D(this,VT)}},{key:"name",get:function(){return D(this,L4)}},{key:"icon",get:function(){return D(this,WT)}},{key:"chains",get:function(){return C4.slice()}},{key:"features",get:function(){var f;return f={},le(f,p$,{version:"1.0.0",connect:D(this,XT)}),le(f,g$,{version:"1.0.0",disconnect:D(this,YT)}),le(f,y$,{version:"1.0.0",on:D(this,GT)}),le(f,HT,{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:D(this,z4)}),le(f,KT,{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:D(this,JT)}),le(f,$T,{version:"1.0.0",signMessage:D(this,H4)}),le(f,C$,{solanaWallet:D(this,Ra)}),f}},{key:"accounts",get:function(){return D(this,Go)?[D(this,Go)]:[]}}]),e}();function QT(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),f=1;f<e;f++)s[f-1]=arguments[f];var d;(d=D(this,u0)[t])===null||d===void 0||d.forEach(function(h){return h.apply(null,s)})}function M$(t,e){var s;D(this,u0)[t]=(s=D(this,u0)[t])===null||s===void 0?void 0:s.filter(function(f){return e!==f})}var eC;function tC(t){var e=function(s){var f=s.register;return f(t)};try{globalThis.window.dispatchEvent(new O$(e))}catch(s){console.error(`wallet-standard:register-wallet event could not be dispatched
|
||
`,s)}try{globalThis.window.addEventListener("wallet-standard:app-ready",function(s){var f=s.detail;return e(f)})}catch(s){console.error(`wallet-standard:app-ready event listener could not be added
|
||
`,s)}}var K4=new WeakMap,O$=function(t){"use strict";z(s,t);var e=Ie(s);function s(f){B(this,s);var d;return d=e.call(this,"wallet-standard:register-wallet",{bubbles:!1,cancelable:!1,composed:!1}),H(Y(d),K4,{writable:!0,value:void 0}),Ac(Y(d),K4,f),d}return Ln(s,[{key:"detail",get:function(){return D(this,K4)}},{key:"type",get:function(){return"wallet-standard:register-wallet"}},{key:"preventDefault",value:function(){throw new Error("preventDefault cannot be called")}},{key:"stopImmediatePropagation",value:function(){throw new Error("stopImmediatePropagation cannot be called")}},{key:"stopPropagation",value:function(){throw new Error("stopPropagation cannot be called")}}]),s}(hf(Event));function AQ(t){tC(t);try{((eC=window.navigator).wallets||(eC.wallets=[])).push(function(e){var s=e.register;return s(t)})}catch(e){console.error(`window.navigator.wallets could not be pushed
|
||
`,e)}}var R$=function(t){"use strict";z(s,t);var e=Ie(s);function s(){B(this,s);var f;return f=e.call(this),le(Y(f),"_namespace","tron"),le(Y(f),"_signMethod","ed25519"),f.on(an.mpChangeConnectedAddress,function(d){d!==f._connectedAddress&&f.emit("accountsChanged",[d])}),f}return Ln(s,[{key:"getChainId",value:function(){return this._connectedChainId}},{key:"getAccount",value:function(){var d=this;return T(I().mark(function h(){var E;return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,d._requestNormalConnect();case 2:return E=R.sent,R.abrupt("return",{address:E});case 4:case"end":return R.stop()}},h)}))()}},{key:"signMessage",value:function(d){var h=this;return T(I().mark(function E(){var P;return I().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return console.log("tron signMessage called:",d),q.next=3,h._universalSign({type:"signMessage",request:{id:1,jsonrpc:"2.0",method:"tron_signMessage",params:{message:d,pubkey:h._connectedPubKey}}});case 3:return P=q.sent.signature,q.abrupt("return",P);case 5:case"end":return q.stop()}},E)}))()}},{key:"signMessageV2",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return console.log("tron signMessageV2 called:",d),R.abrupt("return",h.signMessage(d));case 2:case"end":return R.stop()}},E)}))()}},{key:"signTransaction",value:function(d){var h=this;return T(I().mark(function E(){var P;return I().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return console.log("tron signTransaction called:",d),q.next=3,h._universalSign({type:"signTransaction",request:{id:1,jsonrpc:"2.0",method:"tron_signTransaction",params:d}});case 3:return P=q.sent,q.abrupt("return",JSON.parse(P.transaction));case 5:case"end":return q.stop()}},E)}))()}},{key:"signAndSendTransaction",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return console.log("tron signAndSendTransaction called:",d),R.next=3,h._universalSign({type:"sendTransaction",request:{id:1,jsonrpc:"2.0",method:"tron_signAndSendTransaction",params:d}});case 3:return R.abrupt("return",R.sent);case 4:case"end":return R.stop()}},E)}))()}},{key:"disconnect",value:function(){return this._requestDisconnect()}}]),s}(yu),Rs=Ar(99345),Lg=Ar(95858),$4=Ar(85409),nC;(function(t){t[t.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",t[t.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",t[t.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",t[t.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",t[t.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",t[t.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",t[t.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(nC||(nC={}));var rC;(function(t){t[t.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",t[t.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(rC||(rC={}));var zi;(function(t){t[t.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",t[t.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",t[t.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",t[t.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",t[t.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(zi||(zi={}));var iC;(function(t){t[t.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",t[t.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",t[t.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",t[t.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",t[t.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(iC||(iC={}));var sC;(function(t){t[t.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",t[t.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",t[t.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",t[t.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(sC||(sC={}));var Ya;(function(t){t.MAINNET="-239",t.TESTNET="-3"})(Ya||(Ya={}));function N$(t,e){const s=Lg.encodeBase64(t);return e?encodeURIComponent(s):s}function U$(t,e){return e&&(t=decodeURIComponent(t)),Lg.decodeBase64(t)}function D$(t,e=!1){let s;return t instanceof Uint8Array?s=t:(typeof t!="string"&&(t=JSON.stringify(t)),s=Lg.decodeUTF8(t)),N$(s,e)}function L$(t,e=!1){const s=U$(t,e);return{toString(){return Lg.encodeUTF8(s)},toObject(){try{return JSON.parse(Lg.encodeUTF8(s))}catch{return null}},toUint8Array(){return s}}}const oC={encode:D$,decode:L$};function F$(t,e){const s=new Uint8Array(t.length+e.length);return s.set(t),s.set(e,t.length),s}function j$(t,e){if(e>=t.length)throw new Error("Index is out of buffer");const s=t.slice(0,e),f=t.slice(e);return[s,f]}function V4(t){let e="";return t.forEach(s=>{e+=("0"+(s&255).toString(16)).slice(-2)}),e}function af(t){if(t.length%2!==0)throw new Error(`Cannot convert ${t} to bytesArray`);const e=new Uint8Array(t.length/2);for(let s=0;s<t.length;s+=2)e[s/2]=parseInt(t.slice(s,s+2),16);return e}function xQ(){return typeof $4<"u"&&$4.versions!=null&&$4.versions.node!=null}class z${constructor(e){this.nonceLength=24,this.keyPair=e?this.createKeypairFromString(e):this.createKeypair(),this.sessionId=V4(this.keyPair.publicKey)}createKeypair(){return Fl.box.keyPair()}createKeypairFromString(e){return{publicKey:af(e.publicKey),secretKey:af(e.secretKey)}}createNonce(){return Fl.randomBytes(this.nonceLength)}encrypt(e,s){const f=new TextEncoder().encode(e),d=this.createNonce(),h=Fl.box(f,d,s,this.keyPair.secretKey);return F$(d,h)}decrypt(e,s){const[f,d]=j$(e,this.nonceLength),h=Fl.box.open(d,f,s,this.keyPair.secretKey);if(!h)throw new Error(`Decryption error:
|
||
message: ${e.toString()}
|
||
sender pubkey: ${s.toString()}
|
||
keypair pubkey: ${this.keyPair.publicKey.toString()}
|
||
keypair secretkey: ${this.keyPair.secretKey.toString()}`);return new TextDecoder().decode(h)}stringifyKeypair(){return{publicKey:V4(this.keyPair.publicKey),secretKey:V4(this.keyPair.secretKey)}}}var aC="binanceWeb3TonWallet",H$="0.0.1",IQ="binancew3w",K$="https://toncenter.com/api/v2",$$="https://testnet.toncenter.com/api/v2",V$="https://wallet.binance.com/tonbridge/bridge/events?client_id=alice",W$="https://toncenter.com/api/v2/jsonRPC",G$="https://testnet.toncenter.com/api/v2/jsonRPC",Eo=localStorage&&localStorage.getItem("network")==="testnet",BQ="v4R2",kQ="heartbeat",l0="__bw3w_ton_connectted_info",W4="__bw3w_ton_stringifyKeypair",cC="__bw3w_ton_handled_id",G4="__bw3w_ton_activeConnections",q4="__bw3w_ton_lastEventId",uC=localStorage&&localStorage.getItem("own-bridge"),q$=uC||"https://wallet.binance.com/tonbridge",lC=0,Z$=1e3*60*5,X$=1e3*2,Y$=1e3*30,J$=1e3*10,Q$="491dd51b5b37c41352e0e6f690fd965e137545ac078d00e362ae67cd9341567f",TQ="h58H1Au66O4kaKjoQjVtrWiYHCjTH6I2KaqlB0tuMCXE5SXbe03Wb4Jk9y7EWvZX",eV="CT_607",CQ=40,PQ=49,tV=Ar(2928),f0=Ar.n(tV),Fg=Ar(67641),nV=Ar(36533).Buffer,fC=f0().utils.BN,cf;(function(t){t[t.JETTON_TRANSFER=260734629]="JETTON_TRANSFER",t[t.NFT_TRANSFER=1607220500]="NFT_TRANSFER",t[t.STONFI_SWAP=630424929]="STONFI_SWAP"})(cf||(cf={}));function dC(t,e){var s=t.beginParse(),f=s.loadUint(32),d=(0,Rs.beginCell)();switch(f){case cf.STONFI_SWAP:return d=d.storeUint(cf.STONFI_SWAP,32).storeAddress(s.loadAddress()).storeCoins(s.loadCoins()).storeAddress(s.loadAddress()),s.loadBoolean()&&s.loadAddress(),d.storeBit(1).storeAddress(Rs.Address.parse(e)).endCell();case cf.NFT_TRANSFER:for(d=d.storeUint(cf.NFT_TRANSFER,32).storeUint(s.loadUint(64),64).storeAddress(s.loadAddress()),s.loadMaybeAddress();s.remainingRefs;)d=d.storeRef(s.loadRef());return d.storeAddress(Rs.Address.parse(e)).storeBits(s.loadBits(s.remainingBits)).endCell();case cf.JETTON_TRANSFER:for(d=d.storeUint(cf.JETTON_TRANSFER,32).storeUint(s.loadUint(64),64).storeCoins(s.loadCoins()).storeAddress(s.loadAddress()),s.loadMaybeAddress();s.remainingRefs;){var h=s.loadRef();d=d.storeRef(dC(h,e))}return d.storeAddress(Rs.Address.parse(e)).storeBits(s.loadBits(s.remainingBits)).endCell();default:return t}}function rV(t){if(t){var e=(0,Rs.loadStateInit)(Rs.Cell.fromBase64(t).asSlice()),s=e.code,f=e.data;return{code:s,data:f}}}function iV(t,e,s){return(0,Rs.beginCell)().storeWritable((0,Rs.storeMessage)((0,Rs.external)({to:t.address,init:e===0?t.init:void 0,body:s}))).endCell()}function sV(t){try{return Rs.Address.isFriendly(t)?Rs.Address.parseFriendly(t).isBounceable:!0}catch{return!0}}function oV(t,e){return t.map(function(s){var f=s.payload&&Rs.Cell.fromBase64(s.payload);return f&&e&&(f=dC(f,e)),(0,Fg.internal)({to:s.address,value:BigInt(s.amount),body:f,bounce:sV(s.address),init:rV(s.stateInit)})})}var qu=function(){"use strict";function t(e){var s=e.apiKey,f=e.host;B(this,t),le(this,"client",void 0),console.log("apiKey",s,f);var d=new Fg.TonClient({endpoint:f,apiKey:s});this.client=d}return Ln(t,[{key:"isContractDeployed",value:function(s){var f=this;return T(I().mark(function d(){return I().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.t0=console,E.t1=s,E.next=4,f.client.isContractDeployed(s);case 4:return E.t2=E.sent,E.t0.log.call(E.t0,"isContractDeployed",E.t1,E.t2),E.abrupt("return",f.client.isContractDeployed(s));case 7:case"end":return E.stop()}},d)}))()}},{key:"calculateFee",value:function(){var s=this;return T(I().mark(function f(){var d,h,E,P,R;return I().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return d="EQCKWpx7cNMpvmcN5ObM5lLUZHZRFKqYA4xmw9jOry0ZsF9M",h=[{value:"0.05",to:d,body:"Hello world",stateInit:"te6cckEBBAEAOgACATQCAQAAART/APSkE/S88sgLAwBI0wHQ0wMBcbCRW+D6QDBwgBDIywVYzxYh+gLLagHPFsmAQPsAlxCarA=="}],E=h.map(function(ne){var ue=(0,Rs.loadStateInit)(Rs.Cell.fromBase64(ne.stateInit).asSlice()),ge=ue.code,xe=ue.data;return(0,Fg.internal)({value:ne.value,to:ne.to,body:ne.body,init:{code:ge,data:xe}})})[0],te.next=5,s.client.estimateExternalMessageFee(Rs.Address.parse("EQCKWpx7cNMpvmcN5ObM5lLUZHZRFKqYA4xmw9jOry0ZsF9M"),{initCode:E.init.code,initData:E.init.data,body:E.body,ignoreSignature:!0});case 5:return P=te.sent,console.log("estimateFee in ton",P),R=[P.source_fees.fwd_fee,P.source_fees.storage_fee,P.source_fees.gas_fee,P.source_fees.in_fwd_fee].reduce(function(ne,ue){return new fC(ue).add(ne)},new fC(0)),te.abrupt("return",R.toString());case 9:case"end":return te.stop()}},f)}))()}},{key:"create",value:function(s){var f=s.publicKey,d=s.workchain,h=Fg.WalletContractV4.create({publicKey:f,workchain:d??lC}),E=this.client.open(h);return console.log("contract",E,h,f,d),Ae(be({},E),{getBalance:E.getBalance,getSeqno:E.getSeqno,reportTx:function(R,q,te,ne,ue,ge){return T(I().mark(function xe(){var pe,Se;return I().wrap(function(Fe){for(;;)switch(Fe.prev=Fe.next){case 0:return console.log("reportTx called with",R,q,te,this),pe=R.hash(),Se=nV.from(pe).toString("hex"),Gs._request(ve.tonHttpBridgeReportTx,{tx:{binanceChainId:eV,networkId:"TON",txType:"contract_call",actionType:"normal",txHash:Se,address:q,status:"submitted",txTime:Date.now(),source:"mp",rawData:ne,signedTransaction:ue,instructions:{contractCall:{to:""}},nonce:ge}}),Fe.abrupt("return",Se);case 5:case"end":return Fe.stop()}},xe,this)})).apply(this)},send:E.send,createTransfer:E.createTransfer,sender:E.sender,sendTransfer:E.sendTransfer,getName:function(){return E.walletId},getAddress:function(){return E.address},createStateInit:function(){var R=(0,Rs.beginCell)().store((0,Fg.storeStateInit)(E.init)).endCell();return console.log("createStateInit",R,E,R.toBoc({idx:!1}).toString("base64")),{stateInit:R.toBoc({idx:!1}).toString("base64")}},methods:{transfers:function(R){var q=R.signer,te=R.seqno,ne=R.messages,ue=R.sendMode;return T(I().mark(function ge(){var xe;return I().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return console.log("transfers",q,te,ne,ue),console.log("messages",ne.map(function(Ce){return{value:Ce.amount,to:Ce.toAddress,body:Ce.payload,init:Ce.stateInit}})),Se.next=4,E.createTransfer({signer:q,seqno:te,messages:oV(ne.map(function(Ce){return{amount:Ce.amount,address:Ce.toAddress,payload:Ce.payload,stateInit:Ce.stateInit}})),sendMode:ue});case 4:return xe=Se.sent,Se.abrupt("return",{boc:xe,externalBoc:iV(E,te,xe)});case 6:case"end":return Se.stop()}},ge)}))()}}})}}]),t}();le(qu,"utils",f0().utils),le(qu,"boc",f0().boc),le(qu,"HttpProvider",f0().HttpProvider);var uu=[];globalThis.logs=uu;function MQ(){var t=globalThis.console.log,e=globalThis.console.error;globalThis.console.log=function(){for(var s=arguments.length,f=new Array(s),d=0;d<s;d++)f[d]=arguments[d];try{return uu.length>SS_LOGS_COUNT_LIMIT&&uu.shift(),uu.push(JSON.stringify(f).slice(0,SS_LOGS_FILED_LIMIT)),t.apply(void 0,_to_consumable_array(f))}catch{return t.apply(void 0,_to_consumable_array(f))}},globalThis.console.error=function(){for(var s=arguments.length,f=new Array(s),d=0;d<s;d++)f[d]=arguments[d];try{return uu.length>SS_LOGS_COUNT_LIMIT&&uu.shift(),uu.push(JSON.stringify(f).slice(0,SS_LOGS_FILED_LIMIT)),e.apply(void 0,_to_consumable_array(f))}catch{return e.apply(void 0,_to_consumable_array(f))}}}var jg="",d0=q$,hC=void 0,pC=localStorage.getItem(W4);pC&&(hC=JSON.parse(pC));var xc=new z$(hC);localStorage.getItem(W4)||localStorage.setItem(W4,JSON.stringify(xc.stringifyKeypair()));var lu=xc.sessionId;console.log("myClientId",lu);function Z4(t){var e=localStorage.getItem(G4),s=JSON.parse(e||"[]"),f=new Map(Jl(s));console.log("getActiveConnection",f,t,f.get(t));var d=f.get(t);if(!d)throw new Error("Please connect first");return d}function aV(t,e,s){var f=localStorage.getItem(TON_ACTIVED_CONNECTIONS),d=JSON.parse(f||"[]"),h=new Map(_to_consumable_array(d));h.set(t,{pubkey:e,address:s}),localStorage.setItem(TON_ACTIVED_CONNECTIONS,JSON.stringify(Array.from(h.entries())))}function cV(t){var e=localStorage.getItem(G4),s=JSON.parse(e||"[]"),f=new Map(Jl(s));f.delete(t),localStorage.setItem(G4,JSON.stringify(Array.from(f.entries())))}var uV=function(){var t=T(I().mark(function e(s){var f,d;return I().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return f=s.to,d=s.body,E.next=3,Gs._disconnectMPConnection(f);case 3:return cV(f),E.next=6,Kg(lu,xc,d,f);case 6:case"end":return E.stop()}},e)}));return function(s){return t.apply(this,arguments)}}(),lV=localStorage.getItem(cC),fV=JSON.parse(lV||"[]"),uf=new Map(Jl(fV));function zg(){return localStorage.setItem(cC,JSON.stringify(Array.from(uf.entries())))}function dV(t,e,s){return X4.apply(this,arguments)}function X4(){return X4=T(I().mark(function t(e,s,f){var d,h,E,P,R,q,te,ne,ue,ge,xe,pe,Se,Ce,Fe,We;return I().wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(d=JSON.parse(s.params),console.log("sendTransaction",d),h=d.from,E=d.network,P=d.valid_until,!(P&&P<p0())){kt.next=5;break}throw new fu(s.id,zi.BAD_REQUEST_ERROR,"Request timed out").error;case 5:if(P>p0()+300&&(d.valid_until=p0()+300),!E){kt.next=13;break}if(!(Eo&&E!==Ya.TESTNET)){kt.next=9;break}throw new fu(s.id,zi.BAD_REQUEST_ERROR,"Invalid network").error;case 9:if(!(!Eo&&E!==Ya.MAINNET)){kt.next=11;break}throw new fu(s.id,zi.BAD_REQUEST_ERROR,"Invalid network").error;case 11:if(!(E!==Ya.TESTNET&&E!==Ya.MAINNET)){kt.next=13;break}throw new fu(s.id,zi.BAD_REQUEST_ERROR,"Invalid network").error;case 13:return kt.next=15,dv(f);case 15:if(!(h&&(!f0().utils.Address.isValid(h)||!As.getAddress().equals(Rs.Address.parse(h))))){kt.next=17;break}throw new fu(s.id,zi.BAD_REQUEST_ERROR,"Invalid sender address").error;case 17:if(R=d.messages,R.every(function(Bt){return _C(Bt)})){kt.next=20;break}throw new Error("Invalid message");case 20:return console.log("messages",R),q=Z4(f).pubkey,kt.next=24,SV({messages:R},bV,af(q),f);case 24:if(te=kt.sent,ne=te.boc,ue=te.externalBoc,ue){kt.next=31;break}ge={error:{code:zi.UNKNOWN_ERROR,message:"sendTransaction failed"},id:s.id},Kg(lu,xc,ge,f),uf.set(e.lastEventId,ge),zg(),kt.next=57;break;case 31:return xe=ue.toBoc(),console.log("query",ue,ne),kt.next=35,As.send(ne);case 35:return console.log("sentBoc",xe),pe=xe.toString("base64"),Se=ue.hash(),Ce=Ir.Buffer.from(Se).toString("hex"),console.log("boc",pe,Ce),Kg(lu,xc,{result:pe,id:s.id},f),Gs._request(ve.tonHttpBridgeTxFinished,{id:f,txHash:Ce}),uf.set(e.lastEventId,{result:pe,id:s.id}),zg(),Fe=Eo?"https://testnet.tonscan.org/address":"https://tonscan.org/address",We=Eo?"https://testnet.tonviewer.com":"https://tonviewer.com",kt.t0=console,kt.t2="sendTransaction successfully, please check by ".concat(Fe,"/"),kt.next=50,As.getAddress();case 50:return kt.t3=kt.sent.toString({urlSafe:!0,bounceable:!1,testOnly:Eo}),kt.t1=kt.t2.concat.call(kt.t2,kt.t3," or by ").concat(We,"/"),kt.next=54,As.getAddress();case 54:kt.t4=kt.sent.toString({urlSafe:!0,bounceable:!1,testOnly:Eo}),kt.t5=kt.t1.concat.call(kt.t1,kt.t4),kt.t0.log.call(kt.t0,kt.t5);case 57:case"end":return kt.stop()}},t)})),X4.apply(this,arguments)}var h0=[],_d=!1;function gC(t){if(_d=!1,h0.length>0){var e=h0.pop();t(e)}}function hV(){_d=!1,h0.length=0}var yC=0;function mC(){var t="".concat(d0,"/bridge/events?client_id=").concat(lu,"&user_info=").concat(jg);localStorage.getItem(q4)&&(t+="&last_event_id=".concat(localStorage.getItem(q4)));var e=new EventSource(t,{withCredentials:!1});return console.log("listen",t),e.addEventListener("open",function(s){console.log("open",s)}),e.addEventListener("error",function(s){console.log("error",s),e.readyState!==EventSource.CONNECTING&&(console.log("An error occurred:",s),setTimeout(function(){if(yC>5){Gs._request("sseError",{logs:uu,error:{code:zi.UNKNOWN_ERROR,message:s.toString(),url:t,source:void 0}});var f={code:zi.UNKNOWN_ERROR,message:"Failed to connect TON bridge, please try it later or contact us for further support"};Gs.reportError(f);return}eS(),yC++},X$)),e.close()}),e.addEventListener("abort",function(s){console.log("abort",s)}),e.addEventListener("readystatechange",function(s){console.log("readystatechange",s)}),e.addEventListener("heartbeat",function(s){console.debug("heartbeat",s),Q4()}),e.addEventListener("message",function(){var s=T(I().mark(function d(h){var E,P,R,q,te,ne,ue,ge;return I().wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:if(console.log("received message",h,h0,h0.length,_d),Gs._request("sseMessage",{data:h.data,id:h.lastEventId,step:"start"}),!_d){pe.next=5;break}return h0.push(h),pe.abrupt("return");case 5:if(E=JSON.parse(h.data),P=wV(xc,E),R=E.from,console.log("msg",P),!uf.has(h.lastEventId)){pe.next=13;break}return q=uf.get(h.lastEventId),console.log("already handled",q,P.id),pe.abrupt("return");case 13:if(pe.prev=13,console.log("processing",_d),_d=!0,setTimeout(function(){gC(f)},Y$),te=Z4(R),Gs._connectedPubKey=te.pubkey,Gs._connectedAddress=te.address,P.method!=="sendTransaction"){pe.next=43;break}return pe.prev=21,pe.next=24,nS(!0,!0);case 24:return pe.next=26,dV(h,P,R);case 26:Gs._request("sseMessage",{data:h.data,id:h.lastEventId,step:"end"}),pe.next=41;break;case 29:pe.prev=29,pe.t0=pe.catch(21),ne={code:zi.UNKNOWN_ERROR,message:"sendTransaction failed"},pe.t0.code&&(ne.code=pe.t0.code),pe.t0.message&&(ne.message=pe.t0.message),ne.message&&ne.message.includes("user cancelled")||ne.message&&ne.message.includes("rejected")?(ne.code=zi.USER_REJECTS_ERROR,ne.message="User declined the transaction"):Gs.reportError(pe.t0),lv(ne),Gs._request("sseMessage",{data:h.data,id:h.lastEventId,step:"end",error:ne}),Kg(lu,xc,{id:P.id,error:ne},R),uf.set(h.lastEventId,ne),zg(),console.log("handle sse error",ne,h,ne.toString());case 41:pe.next=52;break;case 43:if(P.method!=="disconnect"){pe.next=51;break}return hV(),pe.next=47,uV({to:R,body:{result:"",id:P.id}});case 47:uf.set(h.lastEventId,{result:"",id:P.id}),zg(),pe.next=52;break;case 51:throw{code:zi.METHOD_NOT_SUPPORTED,message:'Method "'.concat(P.method,'" does not supported by the wallet app')};case 52:pe.next=65;break;case 54:pe.prev=54,pe.t1=pe.catch(13),ue={error:{code:pe.t1.code!==void 0?pe.t1.code:zi.UNKNOWN_ERROR,message:pe.t1.message},id:P.id},ue.error.message||(ue.error.message="Unknown error"),ge=pe.t1,ge.message&&ge.message.includes("user cancelled")||ge.message&&ge.message.includes("rejected")?(ue.error.code=zi.USER_REJECTS_ERROR,ue.error.message="User declined the transaction"):Gs.reportError(ge),lv(ge),Kg(lu,xc,ue,R),uf.set(h.lastEventId,ue),zg(),console.log("handle sse error",ue,h);case 65:return pe.prev=65,gC(f),h.lastEventId&&(localStorage.setItem(q4,h.lastEventId),console.log("processing",_d)),pe.finish(65);case 69:case"end":return pe.stop()}},d,null,[[13,54,65,69],[21,29]])}));function f(d){return s.apply(this,arguments)}return f}()),globalThis.sseStarted=!0,function(){globalThis.sseStarted=!1,e.close()}}function pV(t,e,s,f){return Y4.apply(this,arguments)}function Y4(){return Y4=_async_to_generator(regeneratorRuntime.mark(function t(e,s,f,d){var h,E,P,R,q,te,ne;return regeneratorRuntime.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return ge.prev=0,ge.next=3,checkNetwork(!0,!0);case 3:return h=[],ge.next=6,tonProvider._requestPubKey({address:d,chainId:TON_MAINNET_CHAINID});case 6:return E=ge.sent,tonProvider._connectedChainId=TON_MAINNET_CHAINID,tonProvider._connectedAddress=d,tonProvider._connectedPubKey=E,console.log("connect",E,d),P=hexToByteArray(E),setWallet(P),ge.next=15,wallet.getAddress();case 15:return R=ge.sent.toString({urlSafe:!0,bounceable:!1,testOnly:isTestnet}),ge.t0=console,ge.t1=E,ge.t2=R,ge.next=21,wallet.getAddress();case 21:return ge.t3=ge.sent.toString({urlSafe:!0,bounceable:!1,testOnly:isTestnet}),ge.t4=P,ge.t5=wallet.getName(),ge.t0.log.call(ge.t0,"wallet info",ge.t1,ge.t2,ge.t3,ge.t4,ge.t5),aV(e,E,R),ge.t6=h,ge.next=29,createTonAddrItemReply(R,E);case 29:if(ge.t7=ge.sent,ge.t6.push.call(ge.t6,ge.t7),q=s.items.find(function(xe){return xe.name==="ton_proof"}),!q){ge.next=38;break}return ge.t8=h,ge.next=36,createTonProofItemReply({origin:f,myAddress:R,payload:q.payload,universalSign:function(xe){return tonProvider._universalSign(xe)}});case 36:ge.t9=ge.sent,ge.t8.push.call(ge.t8,ge.t9);case 38:console.log("connectResult",h),te=xc.encrypt(JSON.stringify({event:"connect",id:Date.now(),payload:{items:h,device:tonProvider.deviceInfo}}),hexToByteArray(e)),fetch("".concat(d0,"/bridge/message?user_info=").concat(jg,"&client_id=").concat(lu,"&to=").concat(e,"&ttl=300"),{method:"POST",body:Base64.encode(te)}).then(function(xe){console.log("sendConnectInfo",xe),tonProvider._request(HiddenBrowserSentActions.tonHttpBridgeConnectFinished,{id:e,manifestUrl:s.manifestUrl,step:"connectFinished"})}).catch(function(xe){console.log("fail to send message to bridge",xe,s.id),tonProvider._request(HiddenBrowserSentActions.tonHttpBridgeConnectFinished,{id:e,manifestUrl:s.manifestUrl,error:JSON.stringify({code:xe.code||xe.name,message:xe.message}),step:"connectFinished"}),handleError(xe),tonProvider.reportError(xe)}),ge.next=49;break;case 43:ge.prev=43,ge.t10=ge.catch(0),console.log("connect_error",ge.t10.message,s.id),ne=xc.encrypt(JSON.stringify({event:"connect_error",id:Date.now(),payload:{code:SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR,message:ge.t10.message}}),hexToByteArray(e)),ge.t10.message&&ge.t10.message.includes("user cancelled")||ge.t10.message&&ge.t10.message.includes("rejected")?tonProvider._request(HiddenBrowserSentActions.tonHttpBridgeConnectFinished,{id:e,step:"connectFinished"}):(tonProvider._request(HiddenBrowserSentActions.tonHttpBridgeConnectFinished,{id:e,manifestUrl:s.manifestUrl,logs:uu,error:JSON.stringify({code:ge.t10.code||ge.t10.name,message:ge.t10.message}),step:"connectFinished"}),handleError(ge.t10),tonProvider.reportError(ge.t10)),fetch("".concat(d0,"/bridge/message?user_info=").concat(jg,"&client_id=").concat(lu,"&to=").concat(e,"&ttl=300"),{method:"POST",body:Base64.encode(ne)});case 49:case"end":return ge.stop()}},t,null,[[0,43]])})),Y4.apply(this,arguments)}var J4,bC;function Q4(){clearTimeout(bC),bC=setTimeout(function(){eS()},Z$)}function eS(){console.log("restart sse, about to listen"),J4&&J4(),J4=mC(),Q4()}globalThis.restartSSE=eS,Q4();function OQ(t,e){t&&(d0=t),e&&(jg=e),mC()}function RQ(t,e){var s=xc.encrypt(JSON.stringify({event:"connect_error",id:Date.now(),payload:{code:SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR,message:e.message}}),hexToByteArray(t));fetch("".concat(d0,"/bridge/message?user_info=").concat(jg,"&client_id=").concat(lu,"&to=").concat(t,"&ttl=300"),{method:"POST",body:Base64.encode(s)})}function NQ(t,e,s,f){e&&t&&s&&(tonProvider.to=t,pV(t,JSON.parse(e),s,f))}function vC(t){return tS.apply(this,arguments)}function tS(){return tS=T(I().mark(function t(e){var s,f,d,h,E=arguments;return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return s=E.length>1&&E[1]!==void 0?E[1]:{},f=new AbortController,d=setTimeout(function(){return f.abort()},J$),R.next=5,fetch(e,Ae(be({},s),{signal:f.signal}));case 5:if(h=R.sent,clearTimeout(d),h.ok){R.next=9;break}throw new Error("Server error: ".concat(h.status," ").concat(h.statusText));case 9:return R.abrupt("return",h);case 10:case"end":return R.stop()}},t)})),tS.apply(this,arguments)}function nS(t,e){return rS.apply(this,arguments)}function rS(){return rS=T(I().mark(function t(e,s){var f,d,h,E;return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:if(f=!1,d=!1,!e){R.next=11;break}return R.prev=3,R.next=6,vC((Eo?$$:K$)+"/getConfigAll");case 6:R.next=11;break;case 8:R.prev=8,R.t0=R.catch(3),R.t0.name==="AbortError"?f=!0:d=!0;case 11:if(!s){R.next=20;break}return R.prev=12,R.next=15,vC(V$);case 15:R.next=20;break;case 17:R.prev=17,R.t1=R.catch(12),R.t1.name==="AbortError"?f=!0:d=!0;case 20:if(!d){R.next=25;break}throw h={code:zi.UNKNOWN_ERROR,message:"Failed to connect TON bridge, please try it later or contact us for further support"},h;case 25:if(!f){R.next=28;break}throw E={code:zi.UNKNOWN_ERROR,message:"Connect TON bridge timeout, please try it later or contact us for further support"},E;case 28:return R.abrupt("return",{networkTimeout:f,networkError:d});case 29:case"end":return R.stop()}},t,null,[[3,8],[12,17]])})),rS.apply(this,arguments)}function gV(t){return iS.apply(this,arguments)}function iS(){return iS=T(I().mark(function t(e){var s,f;return I().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return s=e.i18nKey,f=e.defaultText,console.log("showToast",s,f),h.abrupt("return",Gs._request(ve.showToast,{i18nKey:s,defaultText:f}));case 3:case"end":return h.stop()}},t)})),iS.apply(this,arguments)}function lv(t){var e={"User declined the transaction":"user-delined","Request timed out":"request-time-out","Invalid network":"invalid-network","Invalid sender address":"invalid-address","Insufficient balance. Please fund your wallet.":"insufficient-balance-error","Please check your network connection and try again":"network-error-desc","Failed to connect TON bridge, please try it later or contact us for further support":"ton-bridge-connect-error","Connect TON bridge timeout, please try it later or contact us for further support":"ton-bridge-connect-timeout"};t.message&&gV({i18nKey:e[t.message],defaultText:t.message})}function wC(){return console.log("getApiKey called with isTestnet:",Eo),Q$}var yV=qu.utils.Address,Hg=qu.utils.BN,fv=new Hg(0),mV=new qu.HttpProvider(Eo?G$:W$,{apiKey:wC()}),sS=new qu(Ae(be({},mV),{apiKey:wC()})),As;function oS(t){As=sS.create({publicKey:Ir.Buffer.from(t),workchain:lC}),console.log("setWallet",As)}function _C(t){return yV.isValid(t.address)&&new Ik(t.amount).gt("0")}function bV(t,e){return aS.apply(this,arguments)}function aS(){return aS=T(I().mark(function t(e,s){var f,d,h;return I().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return console.log("request",e,s),P.next=3,As.getSeqno();case 3:return f=P.sent,console.log("transfers",As.methods,f),d={hexSignature:"",seqno:f},P.next=8,As.methods.transfers({signer:function(){var R=T(I().mark(function q(te){var ne,ue;return I().wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return ne=te.hash().toString("hex"),console.log("secretKey is a async function",ne),xe.next=4,Gs._requestSign({data:ne});case 4:return ue=xe.sent,console.log("signature",ue),d.hexSignature=ue.toString("hex"),xe.abrupt("return",ue);case 8:case"end":return xe.stop()}},q)}));return function(q){return R.apply(this,arguments)}}(),seqno:f,sendMode:3,messages:e.messages.map(function(R){return{toAddress:R.address,amount:R.amount,payload:R.payload,sendMode:Rs.SendMode.IGNORE_ERRORS+Rs.SendMode.PAY_GAS_SEPARATELY,stateInit:R.stateInit}})});case 8:return h=P.sent,P.abrupt("return",be({},d,h));case 10:case"end":return P.stop()}},t)})),aS.apply(this,arguments)}function UQ(){return cS.apply(this,arguments)}function cS(){return cS=_async_to_generator(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",As.getSeqno());case 1:case"end":return s.stop()}},t)})),cS.apply(this,arguments)}function dv(t){return uS.apply(this,arguments)}function uS(){return uS=T(I().mark(function t(e){var s,f,d;return I().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(console.log("ensureWalletExists",e),!e){E.next=10;break}if(s=Z4(e),s){E.next=6;break}throw f=new Error("no pubkey with ".concat(e)),{message:f.message,code:zi.UNKNOWN_ERROR};case 6:console.log("activeConnection",s),oS(af(s.pubkey)),E.next=11;break;case 10:d=JSON.parse(gS(l0)||"[]"),oS(af(d[0].publicKey));case 11:if(As){E.next=13;break}throw new Error("setWallet failed, wallet is ".concat(As));case 13:case"end":return E.stop()}},t)})),uS.apply(this,arguments)}function vV(t){return lS.apply(this,arguments)}function lS(){return lS=T(I().mark(function t(e){return I().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.prev=0,f.next=3,dv(e);case 3:return console.log("wallet",As),f.t0=Hg,f.next=7,As.getBalance();case 7:return f.t1=f.sent.toString(),fv=new f.t0(f.t1),f.abrupt("return",!0);case 12:if(f.prev=12,f.t2=f.catch(0),console.error(f.t2),f.t2.code===void 0){f.next=17;break}throw f.t2;case 17:return f.abrupt("return",!1);case 18:case"end":return f.stop()}},t,null,[[0,12]])})),lS.apply(this,arguments)}function wV(t,e){var s=t.decrypt(oC.decode(e.message).toUint8Array(),af(e.from));return JSON.parse(s)}function Kg(t,e,s,f,d){var h=e.encrypt(JSON.stringify(s),af(f));return fetch("".concat(d0,"/bridge/message?client_id=").concat(t,"&to=").concat(f,"&ttl=300").concat(d?"&topic=".concat(d):""),{method:"POST",body:oC.encode(h)})}function DQ(t){return fS.apply(this,arguments)}function fS(){return fS=_async_to_generator(regeneratorRuntime.mark(function t(e){var s,f,d,h;return regeneratorRuntime.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return s=e.address,f=e.messageBytes,d=e.web3Sign,console.log("sign",{address:s,messageBytes:f}),h=f.toString("hex"),P.next=5,d(h);case 5:return P.abrupt("return",P.sent);case 6:case"end":return P.stop()}},t)})),fS.apply(this,arguments)}function _V(t){return dS.apply(this,arguments)}function dS(){return dS=T(I().mark(function t(e){var s,f,d,h,E,P,R,q,te,ne,ue,ge;return I().wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return s=e.myAddress,f=e.origin,d=e.payload,h=e.universalSign,console.log("createTonProofItemReply",s,f,d),E=Math.round(Date.now()/1e3),P=new URL(f).host,R=new TextEncoder().encode(P),q=new qu.utils.Address(s),te="".concat(q.wc,":").concat(Ir.Buffer.from(q.hashPart).toString("hex")),console.log("createTonProofItemReply params",{domain:P,timestamp:E,payload:d,rawAddress:te}),ne={id:1,jsonrpc:"2.0",method:"ton_proof",params:{domain:P,timestamp:E,payload:d,address:te}},pe.next=11,h({type:"signMessage",request:ne});case 11:return ue=pe.sent.signature,ge=Ir.Buffer.from(ue,"hex").toString("base64"),console.log("universalSign signatureBase64",{signatureBase64:ge}),pe.abrupt("return",{name:"ton_proof",proof:{timestamp:E,domain:{lengthBytes:R.byteLength,value:P},signature:ge,payload:d}});case 15:case"end":return pe.stop()}},t)})),dS.apply(this,arguments)}function EV(t,e){return hS.apply(this,arguments)}function hS(){return hS=T(I().mark(function t(e,s){var f,d;return I().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return f=new qu.utils.Address(e).toString(!1),console.log("createTonAddrItemReply",e,s,f),E.next=4,As.createStateInit();case 4:return d=E.sent.stateInit,E.abrupt("return",{name:"ton_addr",address:f,network:Eo?Ya.TESTNET:Ya.MAINNET,walletStateInit:d,publicKey:s});case 6:case"end":return E.stop()}},t)})),hS.apply(this,arguments)}function SV(t,e,s,f){return pS.apply(this,arguments)}function pS(){return pS=T(I().mark(function t(e,s,f,d){var h,E,P,R,q,te,ne,ue,ge;return I().wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:if(e.messages){pe.next=2;break}throw new Error("no messages");case 2:if(e.messages.length){pe.next=4;break}throw new Error("no messages to send");case 4:if(!(e.messages.length>4)){pe.next=6;break}throw new Error("maximum 4 message at once");case 6:for(h=new Hg(0),E=!0,P=!1,R=void 0,pe.prev=8,q=e.messages[Symbol.iterator]();!(E=(te=q.next()).done);E=!0)ne=te.value,h=h.add(new Hg(ne.amount));pe.next=16;break;case 12:pe.prev=12,pe.t0=pe.catch(8),P=!0,R=pe.t0;case 16:pe.prev=16,pe.prev=17,!E&&q.return!=null&&q.return();case 19:if(pe.prev=19,!P){pe.next=22;break}throw R;case 22:return pe.finish(19);case 23:return pe.finish(16);case 24:return pe.next=26,vV(d);case 26:if(pe.sent){pe.next=29;break}throw console.log("sendCheckFailed",{message:"API request error"}),new Error("sendCheckFailed: API request error");case 29:if(console.log("balance",fv.toString(),h.toString()),!fv.lt(h)){pe.next=33;break}throw console.log("sendCheckFailed",{message:"Not enough balance"}),new Error("Insufficient balance. Please fund your wallet.");case 33:return pe.next=35,sS.calculateFee();case 35:if(ue=pe.sent,!fv.sub(new Hg(ue)).lt(h)){pe.next=39;break}throw console.log("sendCheckCantPayFee",{fee:ue}),new Error("sendCheckCantPayFee: fee ".concat(ue));case 39:return pe.next=41,dv(d);case 41:return pe.t1=Gs,pe.t2=d,pe.next=45,As.getAddress();case 45:return pe.t3=pe.sent.toString({urlSafe:!0,bounceable:!1,testOnly:Eo}),pe.t4=h.toString(),pe.t5=String(ue),pe.t6={id:pe.t2,sender:pe.t3,token_amount:pe.t4,max_gas_amount:pe.t5},pe.next=51,pe.t1._previewTransaction.call(pe.t1,pe.t6);case 51:return pe.next=53,s(e,f);case 53:return ge=pe.sent,console.log("getSentBot",ge,"with fee ".concat(ue)),As.reportTx.call(sS,ge.externalBoc,As.getAddress().toString({urlSafe:!0,bounceable:!1,testOnly:Eo}),As.init,JSON.stringify(e.messages),ge.hexSignature,ge.seqno),pe.abrupt("return",ge);case 57:case"end":return pe.stop()}},t,null,[[8,12,16,24],[17,,19,23]])})),pS.apply(this,arguments)}var fu=function t(e,s,f,d){"use strict";B(this,t),le(this,"id",void 0),le(this,"error",void 0),this.id=e,this.error={code:s,message:f,data:d}};function p0(){return Math.floor(Date.now()/1e3)}var AV=localStorage&&localStorage.setItem.bind(localStorage),gS=localStorage&&localStorage.getItem.bind(localStorage),EC=localStorage&&localStorage.removeItem.bind(localStorage),xV=function(t){"use strict";z(s,t);var e=Ie(s);function s(){B(this,s);var f;return f=e.call(this),le(Y(f),"lastId",0),le(Y(f),"_namespace","ton"),le(Y(f),"_signMethod","ed25519"),le(Y(f),"deviceInfo",{platform:navigator.userAgent.includes("iPhone")?"ios":"android",appName:aC,appVersion:H$,maxProtocolVersion:2,features:[{name:"SendTransaction",maxMessages:4}]}),le(Y(f),"manifestUrl",""),le(Y(f),"to",""),le(Y(f),"tonCallbacks",new Set),le(Y(f),"walletInfo",{name:aC,image:"https://public.bnbstatic.com/static/binance-w3w/ton-provider/binancew3w.png",about_url:"https://www.binance.com/en/web3wallet",platforms:["ios","android","macos","windows","linux"]}),le(Y(f),"protocolVersion",2),le(Y(f),"isWalletBrowser",!0),f.on(an.mpChangeConnectedAddress,function(){f.disconnect(),location.reload()}),f.on(an.mpDisconnect,function(){EC(l0),f.notify({event:"disconnect",id:++f.lastId,payload:{}})}),f}return Ln(s,[{key:"connect",value:function(d,h){var E=this;return T(I().mark(function P(){var R,q,te,ne,ue,ge,xe,pe,Se,Ce,Fe,We,xt;return I().wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:if(console.log("connect",d,h),d===2){Bt.next=3;break}return Bt.abrupt("return",{error:{code:zi.BAD_REQUEST_ERROR,message:"Invalid protocol version"},id:++E.lastId});case 3:return Bt.prev=3,Bt.next=6,nS(!0,!1);case 6:if(R=[],q="",te="",!E.isWalletBrowser){Bt.next=17;break}return Bt.next=12,E._request(hn.requestTonAddressByManifest,{manifestUrl:h.manifestUrl});case 12:ne=Bt.sent,q=ne.pubKey,te=ne.address,Bt.next=25;break;case 17:return Bt.next=19,E._requestNormalConnect();case 19:return ue=Bt.sent,te=ue,Bt.next=23,E._requestPubKey({chainId:"CT_607",address:te});case 23:q=Bt.sent,q.startsWith("0x")&&(q=q.slice(2));case 25:if(E._connectedAddress=te,E._connectedPubKey=q,console.log("connect",q,te),ge=JSON.parse(gS(l0)||"[]"),!(ge&&ge.length>0)){Bt.next=32;break}if(ge[0].publicKey!==q){Bt.next=32;break}return Bt.abrupt("return",{event:"connect",id:++E.lastId,payload:{items:ge,device:E.deviceInfo}});case 32:return xe=af(q),oS(xe),Bt.next=36,As.getAddress();case 36:return pe=Bt.sent.toString({urlSafe:!0,bounceable:!1,testOnly:Eo}),Bt.t0=console,Bt.t1=q,Bt.t2=pe,Bt.next=42,As.getAddress();case 42:return Bt.t3=Bt.sent.toString({urlSafe:!0,bounceable:!1,testOnly:Eo}),Bt.t4=te,Bt.t5=xe,Bt.t6=As.getName(),Bt.t0.log.call(Bt.t0,"wallet info",Bt.t1,Bt.t2,Bt.t3,Bt.t4,Bt.t5,Bt.t6),Bt.t7=R,Bt.next=50,EV(pe,q);case 50:if(Bt.t8=Bt.sent,Bt.t7.push.call(Bt.t7,Bt.t8),Se=h.items.find(function(Wt){return Wt.name==="ton_proof"}),!Se){Bt.next=59;break}return Bt.t9=R,Bt.next=57,_V({origin,myAddress:pe,payload:Se.payload,universalSign:function(Wt){return E._universalSign(Wt)}});case 57:Bt.t10=Bt.sent,Bt.t9.push.call(Bt.t9,Bt.t10);case 59:return console.log("connectResult",R),Ce={event:"connect",id:++E.lastId,payload:{items:R,device:E.deviceInfo}},E.notify(Ce),Fe=h.manifestUrl,E.manifestUrl=Fe,AV(l0,JSON.stringify(R)),Bt.abrupt("return",Ce);case 68:return Bt.prev=68,Bt.t11=Bt.catch(3),console.error("connect error",Bt.t11),We=Bt.t11,xt={event:"connect_error",id:++E.lastId,payload:{code:zi.UNKNOWN_ERROR,message:Bt.t11.message||"unknown error"}},(We.message&&We.message.includes("user cancelled")||We.message&&We.message.includes("rejected"))&&(xt.payload.code=zi.USER_REJECTS_ERROR,xt.payload.message="User declined the transaction"),E.notify(xt),E._request(ve.tonJSridgeConnectFinished,{manifestUrl:E.manifestUrl,error:xt.payload,logs:uu,step:"js bridge connect finished"}),lv(We),Bt.abrupt("return",xt);case 78:case"end":return Bt.stop()}},P,null,[[3,68]])}))()}},{key:"listen",value:function(d){var h=this;return this.tonCallbacks.add(d),function(){h.tonCallbacks.delete(d)}}},{key:"notify",value:function(d){return console.log("notify",d),this.tonCallbacks.forEach(function(h){return h(d)}),d}},{key:"disconnect",value:function(){console.log("try to disconnect"),EC(l0),this._requestDisconnect()}},{key:"restoreConnection",value:function(){var d=this;return T(I().mark(function h(){var E,P,R;return I().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:if(console.log("restoreConnection"),E=JSON.parse(gS(l0)||"[]"),!(E&&E.length>0)){te.next=15;break}return console.log("restoreConnection",E),P={event:"connect",id:++d.lastId,payload:{items:[E[0]],device:d.deviceInfo}},d._connectedChainId=$e,d._connectedAddress=Rs.Address.parse(E[0].address).toString({urlSafe:!0,bounceable:!1,testOnly:Eo}),d._connectedPubKey=E[0].publicKey,console.log("restoreConnection",d._connectedChainId,d._connectedAddress,d._connectedPubKey),te.next=11,d._requestChangeConnectedChainId(d._connectedChainId);case 11:return te.next=13,d._requestChangeConnectedAddress(d._connectedAddress);case 13:return d.notify(P),te.abrupt("return",P);case 15:return R={event:"connect_error",id:++d.lastId,payload:{code:zi.UNKNOWN_APP_ERROR,message:"Unknown app"}},d.notify(R),te.abrupt("return",R);case 18:case"end":return te.stop()}},h)}))()}},{key:"send",value:function(d){var h=this;return T(I().mark(function E(){var P,R,q,te,ne,ue,ge,xe,pe;return I().wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(console.log("send",d),d.method!=="disconnect"){Ce.next=5;break}return h.disconnect(),h.notify({event:"disconnect",id:d.id,payload:{}}),Ce.abrupt("return",{result:"",id:d.id});case 5:if(d.method!=="sendTransaction"){Ce.next=49;break}return Ce.prev=6,Ce.next=9,nS(!0,!1);case 9:if(P=JSON.parse(d.params[0]),R=P.from,q=P.network,te=P.valid_until,console.log("sendTransaction tx",P,R,q,te),!(te&&te<p0())){Ce.next=14;break}throw new fu(d.id,zi.BAD_REQUEST_ERROR,"Request timed out").error;case 14:if(ne=P.valid_until,te>p0()+300&&(P.valid_until=p0()+300),console.log("after tx valid_until:",P.valid_until,ne===P.valid_until),!q){Ce.next=24;break}if(!(Eo&&q!==Ya.TESTNET)){Ce.next=20;break}throw new fu(d.id,zi.BAD_REQUEST_ERROR,"Invalid network").error;case 20:if(!(!Eo&&q!==Ya.MAINNET)){Ce.next=22;break}throw new fu(d.id,zi.BAD_REQUEST_ERROR,"Invalid network").error;case 22:if(!(q!==Ya.TESTNET&&q!==Ya.MAINNET)){Ce.next=24;break}throw new fu(d.id,zi.BAD_REQUEST_ERROR,"Invalid network").error;case 24:return Ce.next=26,dv();case 26:if(!(R&&(!f0().utils.Address.isValid(R)||!As.getAddress().equals(Rs.Address.parse(R))))){Ce.next=28;break}throw new fu(d.id,zi.BAD_REQUEST_ERROR,"Invalid sender address").error;case 28:if(ue=P.messages,ue.every(function(Fe){return _C(Fe)})){Ce.next=31;break}throw new Error("Invalid message");case 31:return console.log("messages",ue),ge={id:d.id,method:"ton_signAndSendTransaction",params:P},Ce.next=35,h._universalSign({type:"sendTransaction",request:ge});case 35:return xe=Ce.sent,console.log("ton result:",xe),Ce.abrupt("return",{result:xe.transaction,id:d.id});case 40:if(Ce.prev=40,Ce.t0=Ce.catch(6),console.log("handle transaction error",Ce.t0),typeof Ce.t0!="string"){Ce.next=45;break}return Ce.abrupt("return",{error:{code:zi.UNKNOWN_ERROR,message:Ce.t0},id:d.id});case 45:return pe=Ce.t0,pe.message&&pe.message.includes("user cancelled")||pe.message&&pe.message.includes("rejected")?(pe.code=zi.USER_REJECTS_ERROR,pe.message="User declined the transaction"):h.reportError(pe),lv(pe),Ce.abrupt("return",{error:{code:pe.code,message:pe.message},id:d.id});case 49:return Ce.abrupt("return",{error:{code:zi.METHOD_NOT_SUPPORTED,message:'Method "'.concat(d.method,'" does not supported by the wallet app')},id:d.id});case 50:case"end":return Ce.stop()}},E,null,[[6,40]])}))()}},{key:"_disconnectMPConnection",value:function(d){var h=this;return T(I().mark(function E(){return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",h._request(ve.disconnectTonInMP,d));case 1:case"end":return R.stop()}},E)}))()}}]),s}(yu),Gs=new xV;Gs._connectedChainId=$e;var SC="Binance Wallet",IV=function(){try{window.binancew3w={isExtension:!0}}catch{}BV(),kV(),TV(),CV(),PV(),MV()};function BV(){try{window.binancew3w.wallet=kn}catch{}}function kV(){var t=window,e=new iy;try{Object.defineProperty(t,"ethereum",{value:e,writable:!0})}catch{}d$(e,SC),Gt.registerProvider(e),t.binancew3w.ethereum=e}function TV(){var t=window,e=new DK;try{t.solana=e}catch{}Gt.registerProvider(e),tC(new P$(e,SC)),t.binancew3w.solana=e}function CV(){var t=new R$;return Gt.registerProvider(t),window.binancew3w.tron=t,console.log("tron registered"),t}var PV=function(){var t=new _M;Gt.registerProvider(t),_n(t);try{window.sui=t}catch{}try{window.binancew3w.sui=t}catch{}return t},MV=function(){Gt.registerProvider(Gs),Gs.isWalletBrowser=!1;try{window.binancew3w.tonconnect=Gs}catch{}return console.log("ton registered"),Gs};function OV(){return yS.apply(this,arguments)}function yS(){return yS=T(I().mark(function t(){return I().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:console.debug("[initInpageScript]"),tr(),IV();case 3:case"end":return s.stop()}},t)})),yS.apply(this,arguments)}OV()})()})();
|
||
|
||
//# debugId=c6dc9b5f-fc41-5881-81d2-72e214398494
|