1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,4903,987196,628920,899442,951814,531830,209890,675481,e=>{"use strict";var t,r,n,o,a,i,s,l,c,u,d,f,_,m,g=e.i(639057),E=Object.defineProperty,h=(e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?E(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r};e.s(["__publicField",0,h],987196);var p=e.i(749663),S=new Set(["then","toJSON",Symbol.for("nodejs.util.inspect.custom"),Symbol.asyncIterator,Symbol.iterator,Symbol.toPrimitive,Symbol.toStringTag,Symbol.asyncDispose,Symbol.dispose].filter(e=>null!=e)),A=new Set(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]);function N(e,t){if(!S.has(e))return Reflect.get(Object.prototype,e,t)}function R(e){return S.has(e)||A.has(e)}var O=/^(-?)(\d+)(?:[eE]\+?(\d+))?$/;function T(e){return JSON.parse(function(e){let t=[],r=!1;for(let o=0;o<e.length;o++){let a=!1;if("\\"===e[o]&&(t.push(e[o++]),a=!a),'"'===e[o]){t.push(e[o]),a||(r=!r);continue}if(!r){let r=function(e,t){if(!e[t]?.match(/[-\d]/))return null;let r=e.slice(t).match(/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/);return r?r[0]:null}(e,o);if(r?.length){var n;o+=r.length-1,r.match(/\.|[eE]-/)?t.push(r):t.push((n=r,`{"$n":"${n}"}`));continue}}t.push(e[o])}return t.join("")}(e),(e,t)=>{var r;return(r=t)&&"object"==typeof r&&"$n"in r&&"string"==typeof r.$n?function({$n:e}){let t=e.match(O);if(t){let[,r,n,o]=t;if(n.length+(o?Number(o):0)<=1e3)return o?BigInt(`${r}${n}`)*10n**BigInt(o):BigInt(e)}throw new p.SolanaError(p.SOLANA_ERROR__MALFORMED_BIGINT_STRING,{value:e})}(t):t})}var b=0n;function w(e){let t;return{id:(t=b,b++,t.toString()),jsonrpc:"2.0",method:e.methodName,params:e.params}}function I(e,t){return JSON.stringify(e,(e,t)=>{var r;return"bigint"==typeof t?(r=t,{$n:`${r}`}):t},t).replace(/\{\s*"\$n"\s*:\s*"(-?\d+)"\s*\}/g,"$1")}function v(e){return null!==e&&("object"==typeof e||"function"==typeof e)}var C=new WeakMap;async function y(e){let t,r=new Promise((r,n)=>{for(let o of(t={reject:n,resolve:r},e)){if(!v(o)){Promise.resolve(o).then(r,n);continue}let e=C.get(o);void 0===e?((e=function(e){let t=new Set,r={deferreds:t,settled:!1};return Promise.resolve(e).then(e=>{for(let{resolve:r}of t)r(e);t.clear(),r.settled=!0},e=>{for(let{reject:r}of t)r(e);t.clear(),r.settled=!0}),r}(o)).deferreds.add(t),C.set(o,e)):e.settled?Promise.resolve(o).then(r,n):e.deferreds.add(t)}});return await r.finally(()=>{for(let r of e)v(r)&&C.get(r).deferreds.delete(t)})}function L(e,t){return t?y([new Promise((e,r)=>{t.aborted?r(t.reason):t.addEventListener("abort",function(){r(this.reason)})}),e]):e}e.s(["getAbortablePromise",0,L,"safeRace",0,y],628920);var k=globalThis.AbortController,P=globalThis.EventTarget,D=Object.freeze({data:void 0,error:void 0,status:"idle"});function B(){return Symbol(void 0)}var U=Symbol();function x(e){return{on(t,r,n){function o(e){e instanceof CustomEvent?r(e.detail):r()}return e.addEventListener(t,o,n),()=>{e.removeEventListener(t,o)}}}}var M=Object.freeze({data:void 0,error:void 0,status:"idle"});function F(e){return!(null==e||"object"!=typeof e||Array.isArray(e))&&"jsonrpc"in e&&"2.0"===e.jsonrpc&&"method"in e&&"string"==typeof e.method&&"params"in e}function z(e,...t){return t.reduce((e,t)=>t(e),e)}var V={};function G(e){return function t(r,n){if(Array.isArray(r))return r.map((e,r)=>t(e,{...n,keyPath:[...n.keyPath,r]}));if("object"!=typeof r||null===r)return e.reduce((e,t)=>t(e,n),r);{let e={};for(let o in r){if(!Object.prototype.hasOwnProperty.call(r,o))continue;let a={...n,keyPath:[...n.keyPath,o]};e[o]=t(r[o],a)}return e}}}var j={accountNotifications:1,blockNotifications:1,getAccountInfo:1,getBalance:1,getBlock:1,getBlockHeight:0,getBlockProduction:0,getBlocks:2,getBlocksWithLimit:2,getEpochInfo:0,getFeeForMessage:1,getInflationGovernor:0,getInflationReward:1,getLargestAccounts:0,getLatestBlockhash:0,getLeaderSchedule:1,getMinimumBalanceForRentExemption:1,getMultipleAccounts:1,getProgramAccounts:1,get
1SignaturesForAddress:1,getSlot:0,getSlotLeader:0,getStakeMinimumDelegation:0,getSupply:0,getTokenAccountBalance:1,getTokenAccountsByDelegate:2,getTokenAccountsByOwner:2,getTokenLargestAccounts:1,getTokenSupply:1,getTransaction:1,getTransactionCount:0,getVoteAccounts:0,isBlockhashValid:1,logsNotifications:1,programNotifications:1,requestAirdrop:2,sendTransaction:1,signatureNotifications:1,simulateTransaction:1};function W(e){let t=e?.onIntegerOverflow;return r=>z(r,t?e=>{var r,n,o;return(n=[(r=(...r)=>t(e,...r),(e,{keyPath:t})=>("bigint"==typeof e&&r&&(e>Number.MAX_SAFE_INTEGER||e<-Number.MAX_SAFE_INTEGER)&&r(t,e),e))],o={keyPath:[]},e=>{let t=G(n);return Object.freeze({...e,params:t(e.params,o)})})(e)}:e=>e,function({defaultCommitment:e,optionsObjectPositionByMethod:t}){return r=>{let{params:n,methodName:o}=r;if(!Array.isArray(n))return r;let a=t[o];return null==a?r:Object.freeze({methodName:o,params:function({commitmentPropertyName:e,params:t,optionsObjectPositionInParams:r,overrideCommitment:n}){let o=t[r];if(void 0===o||o&&"object"==typeof o&&!Array.isArray(o)){if(o&&e in o){if(!o[e]||"finalized"===o[e]){let n=[...t],{[e]:a,...i}=o;return Object.keys(i).length>0?n[r]=i:r===n.length-1?n.length--:n[r]=void 0,n}}else if("finalized"!==n){let a=[...t];return a[r]={...o,[e]:n},a}}return t}({commitmentPropertyName:"sendTransaction"===o?"preflightCommitment":"commitment",optionsObjectPositionInParams:a,overrideCommitment:e,params:n})})}}({defaultCommitment:e?.defaultCommitment,optionsObjectPositionByMethod:j}))}function $(e){return function(t,{keyPath:r}){var n;return"number"==typeof t&&Number.isInteger(t)||"bigint"==typeof t?(n=r,e.some(e=>{if(e.length!==n.length)return!1;for(let t=n.length-1;t>=0;t--){let r=n[t],o=e[t];if(o!==r&&(o!==V||"number"!=typeof r))return!1}return!0}))?Number(t):BigInt(t):t}}function Y(e){var t,r;return t=[$(e)],r={keyPath:[]},e=>G(t)(e,r)}var H=[["data","parsed","info","tokenAmount","decimals"],["data","parsed","info","tokenAmount","uiAmount"],["data","parsed","info","rentExemptReserve","decimals"],["data","parsed","info","rentExemptReserve","uiAmount"],["data","parsed","info","delegatedAmount","decimals"],["data","parsed","info","delegatedAmount","uiAmount"],["data","parsed","info","extensions",V,"state","olderTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",V,"state","newerTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",V,"state","preUpdateAverageRate"],["data","parsed","info","extensions",V,"state","currentRate"]],K=[...H,["data","parsed","info","lastExtendedSlotStartIndex"],["data","parsed","info","slashPenalty"],["data","parsed","info","warmupCooldownRate"],["data","parsed","info","decimals"],["data","parsed","info","numRequiredSigners"],["data","parsed","info","numValidSigners"],["data","parsed","info","stake","delegation","warmupCooldownRate"],["data","parsed","info","exemptionThreshold"],["data","parsed","info","burnPercent"],["data","parsed","info","blockRevenueCommissionBps"],["data","parsed","info","commission"],["data","parsed","info","inflationRewardsCommissionBps"],["data","parsed","info","votes",V,"confirmationCount"],["data","parsed","info","votes",V,"latency"]],J=[["index"],["
1instructions",V,"accounts",V],["instructions",V,"programIdIndex"],["instructions",V,"stackHeight"]],q=[["accountIndex"],["uiTokenAmount","decimals"],["uiTokenAmount","uiAmount"]],X=[["addressTableLookups",V,"writableIndexes",V],["addressTableLookups",V,"readonlyIndexes",V],["header","numReadonlySignedAccounts"],["header","numReadonlyUnsignedAccounts"],["header","numRequiredSignatures"],["instructions",V,"accounts",V],["instructions",V,"programIdIndex"],["instructions",V,"stackHeight"]],Q=["getAccountInfo","getBalance","getBlock","getBlockCommitment","getBlockHeight","getBlockProduction","getBlocks","getBlocksWithLimit","getBlockTime","getClusterNodes","getEpochInfo","getEpochSchedule","getFeeForMessage","getFirstAvailableBlock","getGenesisHash","getHealth","getHighestSnapshotSlot","getIdentity","getInflationGovernor","getInflationRate","getInflationReward","getLargestAccounts","getLatestBlockhash","getLeaderSchedule","getMaxRetransmitSlot","getMaxShredInsertSlot","getMinimumBalanceForRentExemption","getMultipleAccounts","getProgramAccounts","getRecentPerformanceSamples","getRecentPrioritizationFees","getSignaturesForAddress","getSignatureStatuses","getSlot","getSlotLeader","getSlotLeaders","getStakeMinimumDelegation","getSupply","getTokenAccountBalance","getTokenAccountsByDelegate","getTokenAccountsByOwner","getTokenLargestAccounts","getTokenSupply","getTransaction","getTransactionCount","getVersion","getVoteAccounts","index","isBlockhashValid","minimumLedgerSlot","requestAirdrop","sendTransaction","simulateTransaction"];function Z(e){return F(e)&&Q.includes(e.method)}var ee=Object.prototype.toString,et=Object.keys||function(e){let t=[];for(let r in e)t.push(r);return t};function er(e){let t=function e(t,r){let n,o,a,i,s,l,c;if(!0===t)return"true";if(!1===t)return"false";switch(typeof t){case"object":if(null===t)return null;if("toJSON"in t&&"function"==typeof t.toJSON)return e(t.toJSON(),r);if("[object Array]"===(c=ee.call(t))){for(a="[",o=t.length-1,n=0;n<o;n++)a+=e(t[n],!0)+",";return o>-1&&(a+=e(t[n],!0)),a+"]"}if("[object Object]"!==c)return JSON.stringify(t);for(o=(i=et(t).sort()).length,a="",n=0;n<o;)void 0!==(l=e(t[s=i[n]],!1))&&(a&&(a+=","),a+=JSON.stringify(s)+":"+l),n++;return"{"+a+"}";case"function":case"undefined":return r?null:void 0;case"bigint":return`${t.toString()}n`;case"string":return JSON.stringify(t);default:return isFinite(t)?t:null}}(e,!1);if(void 0!==t)return""+t}var en={defaultCommitment:"confirmed",onIntegerOverflow(e,t,r){throw function e(t,r,n){let o="";if("number"==typeof r[0]){let e=r[0]+1,t=e%10,n=e%100;o=1==t&&11!=n?e+"st":2==t&&12!=n?e+"nd":3==t&&13!=n?e+"rd":e+"th"}else o=`\`${r[0].toString()}\``;let a=r.length>1?r.slice(1).map(e=>"number"==typeof e?`[${e}]`:e).join("."):void 0,i=new p.SolanaError(p.SOLANA_ERROR__RPC__INTEGER_OVERFLOW,{argumentLabel:o,keyPath:r,methodName:t,optionalPathLabel:a?` at path \`${a}\``:"",value:n,...void 0!==a?{path:a}:void 0});return(0,p.safeCaptureStackTrace)(i,e),i}(e.methodName,t,r)}},eo=globalThis.AbortController;function ea(e){return F(e)?er([e.method,e.params]):void 0}var ei=globalThis.AbortController,es=new WeakMap;function el(e,t,r){let n;if(void 0===r)return;let o=((n=es.get(t))||es.set(t,n={}),n);!o[r]&&e>0&&(o[r]=0);let a=e+o[r];return a<=0?delete o[r]:o[r]=a,a}var ec=new WeakMap;async function eu({channel:e,responseTransformer:t,signal:r,subscribeRequest:n,unsubscribeMethodName:o}){var a;let i,s,l,c,u,d,f;e.on("error",()=>{i=void 0,es.delete(e)},{signal:r});let _=new Promise((t,n)=>{function a(){if(0===el(-1,e,i)){let t=w({methodName:o,params:[i]});i=void 0,e.send(t).catch(()=>{})}n(this.reason)}r.aborted?a.call(r):r.addEventListener("abort",a)}),m=w(n);await e.send(m);let g=new Promise((t,n)=>{let o=new ei;r.addEventListener("abort",o.abort.bind(o));let a={signal:o.signal};e.on("error",e=>{o.abort(),n(e)},a),e.on("message",e=>{e&&"object"==typeof e&&"id"in e&&e.id===m.id&&(o.abort(),"error"in e?n((0,p.getSolanaErrorFromJsonRpcError)(e.error)):t(e.result))},a)});if(null==(i=await y([_,g])))throw new p.SolanaError(p.SOLANA_ERROR__RPC_SUBSCRIPTIONS__EXPECTED_SERVER_SUBSCRIPTION_ID);el(1,e,i);let E=((s=ec.get(e))||ec.set(e,s=new WeakMap),l=t??e,(c=s.get(l))||s.set(l,(a=e=>{var r;if(!("method"in e))return;let o=t?t(e.params.result,{methodName:(r=e.method).endsWith("Notification")&&!r.endsWith("Notifications")?`${r}s`:r,params:n.params}):e.params.result;return[`notification:${e.params.subscription}`,o]},c={...f=x(d=new P),on(t,r,n){u||(u={dispose:e.on("message",e=>{let t=a(e);if(!t)return;let[r,n]=t;d.dispatchEvent(new CustomEvent(r,{detail:n}))}),numSubscribers:0}),u.numSubscribers++;let o=f.on(t,r,n),i=!0;function s(){i&&(i=!1,n?.signal.removeEventListener("abort",s),u.numSubscribers--,0===u.numSubscribers&&(u.dispose(),u=void 0),o())}return n?.signal.addEventListener("abort",s),s}})),c),h=`notification:${i}`;return{on(t,r,n){switch(t){case"notification":return E.on(h,r,n);case"error":return e.on("error",r,n);default:throw new p.SolanaError(p.SOLANA_ERROR__INVARIANT_VIOLATION__DATA_PUBLISHER_CHANNEL_UNIMPLEMENT
1ED,{channelName:t,supportedChannelNames:["notification","error"]})}}}}var ed=globalThis.EventTarget,ef=globalThis.WebSocket,e_={defaultCommitment:"confirmed",onIntegerOverflow(e,t,r){throw function e(t,r,n){let o="";if("number"==typeof r[0]){let e=r[0]+1,t=e%10,n=e%100;o=1==t&&11!=n?e+"st":2==t&&12!=n?e+"nd":3==t&&13!=n?e+"rd":e+"th"}else o=`\`${r[0].toString()}\``;let a=r.length>1?r.slice(1).map(e=>"number"==typeof e?`[${e}]`:e).join("."):void 0,i=new p.SolanaError(p.SOLANA_ERROR__RPC__INTEGER_OVERFLOW,{argumentLabel:o,keyPath:r,methodName:t,optionalPathLabel:a?` at path \`${a}\``:"",value:n,...void 0!==a?{path:a}:void 0});return(0,p.safeCaptureStackTrace)(i,e),i}(e.methodName,t,r)}},em=globalThis.AbortController,eg={jsonrpc:"2.0",method:"ping"};function eE(e){return z(e,e=>Object.freeze({...e,on:(t,r,n)=>"message"!==t?e.on(t,r,n):e.on("message",e=>r(T(e)),n)}),e=>Object.freeze({...e,send:t=>e.send(I(t))}))}var eh=e.i(433690),ep=e.i(342234);function eS(){if(!globalThis.isSecureContext)throw new p.SolanaError(p.SOLANA_ERROR__SUBTLE_CRYPTO__DISALLOWED_IN_INSECURE_CONTEXT)}async function eA(e){return(void 0===c&&(c=new Promise(t=>{e.generateKey("Ed25519",!1,["sign","verify"]).then(()=>{t(c=!0)}).catch(()=>{t(c=!1)})})),"boolean"==typeof c)?c:await c}async function eN(){if(eS(),void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.subtle?.generateKey)throw new p.SolanaError(p.SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED);if(!await eA(globalThis.crypto.subtle))throw new p.SolanaError(p.SOLANA_ERROR__SUBTLE_CRYPTO__ED25519_ALGORITHM_UNIMPLEMENTED)}function eR(){if(eS(),void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.subtle?.exportKey)throw new p.SolanaError(p.SOLANA_ERROR__SUBTLE_CRYPTO__EXPORT_FUNCTION_UNIMPLEMENTED)}function eO(){return u||(u=(0,ep.getBase58Encoder)()),u}function eT(e){if(e.length<32||e.length>44)return!1;let t=eO();try{return 32===t.encode(e).byteLength}catch{return!1}}function eb(e){if(e.length<32||e.length>44)throw new p.SolanaError(p.SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE,{actualLength:e.length});let t=eO().encode(e).byteLength;if(32!==t)throw new p.SolanaError(p.SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH,{actualLength:t})}function ew(e){return eb(e),e}function eI(){return(0,eh.transformEncoder)((0,eh.fixEncoderSize)(eO(),32),e=>ew(e))}function ev(){return(0,eh.fixDecoderSize)((d||(d=(0,ep.getBase58Decoder)()),d),32)}function eC(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}async function ey(e){if(eR(),"public"!==e.type||"Ed25519"!==e.algorithm.name)throw new p.SolanaError(p.SOLANA_ERROR__ADDRESSES__INVALID_ED25519_PUBLIC_KEY);let t=await crypto.subtle.exportKey("raw",e);return ev().decode(new Uint8Array(t))}e.s(["assertDigestCapabilityIsAvailable",0,function(){if(eS(),void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.subtle?.digest)throw new p.SolanaError(p.SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED)},"assertKeyExporterIsAvailable",0,eR,"assertKeyGenerationIsAvailable",0,eN,"assertPRNGIsAvailable",0,function(){if(void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.getRandomValues)throw new p.SolanaError(p.SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED)},"assertSigningCapabilityIsAvailable",0,function(){if(eS(),void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.subtle?.sign)throw new p.SolanaError(p.SOLANA_ERROR__SUBTLE_CRYPTO__SIGN_FUNCTION_UNIMPLEMENTED)},"assertVerificationCapabilityIsAvailable",0,function(){if(eS(),void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.subtle?.verify)throw new p.SolanaError(p.SOLANA_ERROR__SUBTLE_CRYPTO__VERIFY_FUNCTION_UNIMPLEMENTED)}],899442),e.s(["address",0,ew,"assertIsAddress",0,eb,"getAddressComparator",0,eC,"getAddressDecoder",0,ev,"getAddressEncoder",0,eI,"getAddressFromPublicKey",0,ey,"isAddress",0,eT],951814);var eL=((t=eL||{})[t.Little=0]="Little",t[t.Big=1]="Big",t);function ek(e){return eT(e)}e.s(["isBlockhash",0,ek],531830);var eP=((r=eP||{})[r.Little=0]="Little",r[r.Big=1]="Big",r);function eD(e){return e?.endian!==1}function eB(e){return(0,eh.createEncoder)({fixedSize:e.size,write(t,r,n){e.range&&function(e,t,r,n){if(n<t||n>r)throw new p.SolanaError(p.SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE,{codecDescription:e,max:r,min:t,value:n})}(e.name,e.range[0],e.range[1],t);let o=new ArrayBuffer(e.size);return e.set(new DataView(o),t,eD(e.config)),r.set(new Uint8Array(o),n),n+e.size}})}var eU=()=>eB({name:"u8",range:[0,Number("0xff")],set:(e,t)=>e.setUint8(0,Number(t)),size:1});function ex(e,t,r){if(t!==r)throw new p.SolanaError(p.SOLANA_ERROR__CODECS__INVALID_
1NUMBER_OF_ITEMS,{actual:r,codecDescription:e,expected:t})}function eM(e){return e.reduce((e,t)=>null===e||null===t?null:e+t,0)}function eF(e){return(0,eh.isFixedSize)(e)?e.fixedSize:null}function ez(e){return(0,eh.isFixedSize)(e)?e.fixedSize:e.maxSize??null}function eV(e,t={}){let r=t.size??((e={})=>eB({config:e,name:"u32",range:[0,Number("0xffffffff")],set:(e,t,r)=>e.setUint32(0,Number(t),r),size:4}))(),n=eG(r,eF(e)),o=eG(r,ez(e))??void 0;return(0,eh.createEncoder)({...null!==n?{fixedSize:n}:{getSizeFromValue:t=>("object"==typeof r?(0,eh.getEncodedSize)(t.length,r):0)+[...t].reduce((t,r)=>t+(0,eh.getEncodedSize)(r,e),0),maxSize:o},write:(n,o,a)=>("number"==typeof r&&ex(t.description??"array",r,n.length),"object"==typeof r&&(a=r.write(n.length,o,a)),n.forEach(t=>{a=e.write(t,o,a)}),a)})}function eG(e,t){return"number"!=typeof e?null:0===e?0:null===t?null:t*e}function ej(){return(0,eh.createEncoder)({getSizeFromValue:e=>e.length,write:(e,t,r)=>(t.set(e,r),r+e.length)})}function eW(e,t){let r=eM(e.map(eF)),n=eM(e.map(ez))??void 0;return(0,eh.createEncoder)({...null===r?{getSizeFromValue:t=>e.map((e,r)=>(0,eh.getEncodedSize)(t[r],e)).reduce((e,t)=>e+t,0),maxSize:n}:{fixedSize:r},write:(r,n,o)=>(ex(t?.description??"tuple",e.length,r.length),e.forEach((e,t)=>{o=e.write(r[t],n,o)}),o)})}function e$(e,t){let r=eK(e),n=(r,n,o)=>{let a=t(r);return eH(e,a),e[a].write(r,n,o)};if(null!==r)return(0,eh.createEncoder)({fixedSize:r,write:n});let o=eJ(e);return(0,eh.createEncoder)({...null!==o?{maxSize:o}:{}
1,getSizeFromValue:r=>{let n=t(r);return eH(e,n),(0,eh.getEncodedSize)(r,e[n])},write:n})}function eY(e,t){let r=eK(e),n=(r,n)=>{let o=t(r,n);return eH(e,o),e[o].read(r,n)};if(null!==r)return(0,eh.createDecoder)({fixedSize:r,read:n});let o=eJ(e);return(0,eh.createDecoder)({...null!==o?{maxSize:o}:{},read:n})}function eH(e,t){if(void 0===e[t])throw new p.SolanaError(p.SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE,{maxRange:e.length-1,minRange:0,variant:t})}function eK(e){if(0===e.length)return 0;if(!(0,eh.isFixedSize)(e[0]))return null;let t=e[0].fixedSize;return e.every(e=>(0,eh.isFixedSize)(e)&&e.fixedSize===t)?t:null}function eJ(e){return e.map(e=>ez(e)).reduce((e,t)=>null===e||null===t?null:Math.max(e,t),0)}function eq(){return(0,eh.createEncoder)({fixedSize:0,write:(e,t,r)=>r})}function eX(e,t={}){var r;let n=null===t.prefix?(0,eh.transformEncoder)(eq(),e=>void 0):function(e={}){return(0,eh.transformEncoder)(e.size??eU(),e=>+!!e)}({size:t.prefix??eU()}),o="zeroes"===t.noneValue?((0,eh.assertIsFixedSize)(e),(0,eh.fixEncoderSize)(eq(),e.fixedSize)):t.noneValue?(r=t.noneValue,(0,eh.createEncoder)({fixedSize:r.length,write:(e,t,n)=>(t.set(r,n),n+r.length)})):eq();return e$([(0,eh.transformEncoder)(eW([n,o]),e=>[!1,void 0]),(0,eh.transformEncoder)(eW([n,e]),e=>[!0,e])],e=>Number(null!==e))}function eQ(e){return e$(e.map(([,e])=>e),t=>{let r=e.findIndex(([e])=>e(t));if(-1===r)throw new p.SolanaError(p.SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_VALUE);return r})}function eZ(e){let t=e.map(([,e])=>e),r=eM(t.map(eF)),n=eM(t.map(ez))??void 0;return(0,eh.createEncoder)({...null===r?{getSizeFromValue:t=>e.map(([e,r])=>(0,eh.getEncodedSize)(t[e],r)).reduce((e,t)=>e+t,0),maxSize:n}:{fixedSize:r},write:(t,r,n)=>(e.forEach(([e,o])=>{n=o.write(t[e],r,n)}),n)})}function e0(e,t,r,n){if(n<t||n>r)throw new p.SolanaError(p.SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE,{codecDescription:e,max:r,min:t,value:n})}e.s(["getArrayDecoder",0,function(e,t={}){let r=t.size??((e={})=>{var t;return t={config:e,get:(e,t)=>e.getUint32(0,t),name:"u32",size:4},(0,eh.createDecoder)({fixedSize:t.size,read(e,r=0){(0,eh.assertByteArrayIsNotEmptyForCodec)(t.name,e,r),(0,eh.assertByteArrayHasEnoughBytesForCodec)(t.name,t.size,e,r);let n=new DataView((0,eh.toArrayBuffer)(e,r,t.size));return[t.get(n,eD(t.config)),r+t.size]}})})(),n=eG(r,eF(e)),o=eG(r,ez(e))??void 0;return(0,eh.createDecoder)({...null!==n?{fixedSize:n}:{maxSize:o},read:(t,n)=>{let o=[];if("object"==typeof r&&n>=t.length)return[o,n];if("remainder"===r){for(;n<t.length;){let[r,a]=e.read(t,n);n=a,o.push(r)}return[o,n]}let[a,i]="number"==typeof r?[r,n]:r.read(t,n);n=i;for(let r=0;r<a;r+=1){let[r,a]=e.read(t,n);n=a,o.push(r)}return[o,n]}})},"getArrayEncoder",0,eV,"getBytesDecoder",0,function(){return(0,eh.createDecoder)({read:(e,t)=>{let r=e.slice(t);return[r,t+r.length]}})},"getBytesEncoder",0,ej,"getNullableEncoder",0,eX,"getPatternMatchDecoder",0,function(e){return eY(e.map(([,e])=>e),t=>{let r=e.findIndex(([e])=>e(t));if(-1===r)throw new p.SolanaError(p.SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_BYTES,{bytes:t});return r})},"getPatternMatchEncoder",0,eQ,"getPredicateDecoder",0,function(e,t,r){return eY([t,r],t=>+!e(t))},"getPredicateEncoder",0,function(e,t,r){return e$([t,r],t=>+!e(t))},"getStructDecoder",0,function(e){let t=e.map(([,e])=>e),r=eM(t.map(eF)),n=eM(t.map(ez))??void 0;return(0,eh.createDecoder)({...null===r?{maxSize:n}:{fixedSize:r},read:(t,r)=>{let n={};return e.forEach(([e,o])=>{let[a,i]=o.read(t,r);r=i,n[e]=a}),[n,r]}})},"getStructEncoder",0,eZ,"getTupleDecoder",0,function(e){let t=eM(e.map(eF)),r=eM(e.map(ez))??void 0;return(0,eh.createDecoder)({...null===t?{maxSize:r}:{fixedSize:t},read:(t,r)=>{let n=[];return e.forEach(e=>{let[o,a]=e.read(t,r);n.push(o),r=a}),[n,r]}})},"getUnitDecoder",0,function(){return(0,eh.createDecoder)({fixedSize:0,read:(e,t)=>[void 0,t]})}],209890);var e1=((n=e1||{})[n.Little=0]="Little",n[n.Big=1]="Big",n);function e2(e){return(0,eh.createEncoder)({fixedSize:e.size,write(t,r,n){var o;e.range&&e0(e.name,e.range[0],e.range[1],t);let a=new ArrayBuffer(e.size);return e.set(new DataView(a),t,(o=e.config,o?.endian!==1)),r.set(new Uint8Array(a),n),n+e.size}})}var e3=()=>(0,eh.createEncoder)({getSizeFromValue:e=>e<=127?1:e<=16383?2:3,maxSize:3,write:(e,t,r)=>{e0("shortU16",0,65535,e);let n=[0];for(let t=0;;t+=1){let r=Number(e)>>7*t;if(0===r)break;let o=127&r;n[t]=o,t>0&&(n[t-1]|=128)}return t.set(n,r),r+n.length}}),e4=(e={})=>e2({config:e,name:"u32",range:[0,Number("0xffffffff")],set:(e,t,r)=>e.setUint32(0,Number(t),r),size:4}),e8=()=>e2({name:"u8",range:[0,Number("0xff")],set:(e,t)=>e.setUint8(0,Number(t)),size:1}),e6=((o=e6||{})[o.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",o[o.READONLY_SIGNER=2]="READONLY_SIGNER",o[o.WRITABLE=1]="WRITABLE",o[o.READONLY=0]="READONLY",o);function e5(e){return(1&e)!=0}function e9(e){return"lifetimeConstraint"in e&&"string"==typeof e.lifetimeConstraint.blockhash&&"bigint"==typeof e.lifetimeConstraint.lastValidBlockHeight&&ek(e.lifetimeConstraint.blockhash)}function e7(e){if(!e9(e))throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME)}function te(e,t){return"lifetimeConstraint"in t&&t.lifetimeConstraint&&"blockhash"in t.lifetimeConstraint&&t.lifetimeConstraint.blockhash===e.blockhash&&t.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight?t:Object.freeze({...t,lifetimeConstraint:Object.freeze(e)})}function tt(){return f||(f=e8()),f}function tr(){return eZ([["numSignerAccounts",tt()],["numReadonlySignerAccounts",tt()],["numReadonlyNonSignerAccounts",tt()]])}function tn(){return _||(_=(0,eh.transformEncoder)(eZ([["programAddressIndex",e8()],["accountIndices",eV(e8(),{size:e3()})],["data",(0,eh.addEncoderSizePrefix)(ej(),e3())]]),e=>void 0!==e.accountIndices&&void 0!==e.data?e:{...e,accountIndices:e.accountIndices??[],data:e.data??new Uint8Array(0)})),_}function to(e,t){let[r,n]=e.split(RegExp(`((?!${t}).*)`));return[r,n]}function ta(e,t){let r=BigInt(t.length),n=0n;for(let o of e)n*=r,n+=BigInt(t.indexOf(o));return n}function ti(){let e;return(0,eh.transformEncoder)(eX((0,eh.fixEncoderSize)((e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",(0,eh.createEncoder)({getSizeFromValue:t=>{let[r,n]=to(t,e[0]);if(!n)return t.length;let o=ta(n,e);return r.length+Math.ceil(o.toString(16).length/2)},write(t,r,n){if(!function(e,t,r=t){if(!t.match(RegExp(`^[${e}
1]*$`)))throw new p.SolanaError(p.SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE,{alphabet:e,base:e.length,value:r})}(e,t),""===t)return n;let[o,a]=to(t,e[0]);if(!a)return r.set(new Uint8Array(o.length).fill(0),n),n+o.length;let i=ta(a,e),s=[];for(;i>0n;)s.unshift(Number(i%256n)),i/=256n;let l=[...Array(o.length).fill(0),...s];return r.set(l,n),n+l.length}})),32),{noneValue:"zeroes",prefix:null}),e=>e??null)}function ts(){return(0,eh.createEncoder)({getSizeFromValue:e=>+("legacy"!==e),maxSize:1,write:(e,t,r)=>{if("legacy"===e)return r;if(e<0||e>127)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE,{actualVersion:e});if(e>1)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED,{unsupportedVersion:e});return t.set([128|e],r),r+1}})}function tl(e,t,r){e[t]=r(e[t]??{role:e6.READONLY})}var tc=Symbol("AddressMapTypeProperty");function tu(e,t){let r={[e]:{[tc]:0,role:e6.WRITABLE_SIGNER}},n=new Set;for(let e of t)if(tl(r,e.programAddress,t=>{if(n.add(e.programAddress),tc in t){if(e5(t.role))if(0===t[tc])throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES,{programAddress:e.programAddress});else throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE,{programAddress:e.programAddress});if(1===t[tc])return t}return{[tc]:1,role:e6.READONLY}}),e.accounts)for(let t of e.accounts)tl(r,t.address,e=>{let{address:r,...o}=t;if(tc in e)switch(e[tc]){case 0:return e;case 1:{let r=e.role|o.role;if(n.has(t.address)){if(e5(o.role))throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE,{programAddress:t.address});if(e.role!==r)return{...e,role:r};return e}if(e.role!==r)return{...e,role:r};return e}}return{...o,[tc]:1}});return r}function td(e){let t;return Object.entries(e).sort(([e,r],[n,o])=>{if(r[tc]!==o[tc]){if(0===r[tc])return -1;else if(0===o[tc])return 1;else if(1===r[tc])return -1;else if(1===o[tc])return 1}let a=r.role>=2;if(a!==o.role>=2)return a?-1:1;let i=e5(r.role);return i!==e5(o.role)?i?-1:1:(t||=eC())(e,n)}).map(([e,t])=>({address:e,...t}))}function tf(e){let t=0,r=0,n=0;for(let o of e){if("lookupTableAddress"in o)break;let e=e5(o.role);o.role>=2?(n++,!e&&r++):!e&&t++}return{numReadonlyNonSignerAccounts:t,numReadonlySignerAccounts:r,numSignerAccounts:n}}function t_(e){let t={};for(let[r,n]of e.entries())t[n.address]=r;return t}function tm(e){return"nonce"in e?e.nonce:e.blockhash}function tg(e,t,r){e[t]=r(e[t]??{role:e6.READONLY})}var tE=Symbol("AddressMapTypeProperty");function th(e){switch(e){case"devnet":return"https://api.devnet.solana.com";case"testnet":return"https://api.testnet.solana.com";case"mainnet-beta":case"mainnet":return"https://api.mainnet-beta.solana.com";case"localnet":case"localhost":return"http://127.0.0.1:8899";default:throw Error("Invalid cluster moniker")}}e.s(["assertIsTransactionMessageWithBlockhashLifetime",0,e7,"compileTransactionMessage",0,function(e){let t=e.version;if("legacy"===t)return function(e){var t;let r,n=td(tu(e.feePayer.address,e.instructions)),o=n.length;if(o>64)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNT_ADDRESSES,{actualCount:o,maxAllowed:64});let a=n.filter(e=>e.role>=2).length;if(a>12)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_SIGNER_ADDRESSES,{actualCount:a,maxAllowed:12});let i=e.instructions.length;if(i>64)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_INSTRUCTIONS,{actualCount:i,maxAllowed:64});for(let t=0;t<e.instructions.length;t++){let r=e.instructions[t].accounts?.length??0;if(r>255)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNTS_IN_INSTRUCTION,{actualCount:r,instructionIndex:t,maxAllowed:255})}let s=e.lifetimeConstraint;return{...s?{lifetimeToken:tm(s)}:null,header:tf(n),instructions:(t=e.instructions,r=t_(n),t.map(({accounts:e,data:t,programAddress:n})=>({programAddressIndex:r[n],...e?{accountIndices:e.map(({address:e})=>r[e])}:null,...t?{data:t}:null}))),staticAccounts:n.map(e=>e.address),version:e.version}}(e);if(0===t)return function(e){var t;let r,n,o,a=Object.entries(function(e,t){let r={[e]:{[tE]:0,role:e6.WRITABLE_SIGNER}},n=new Set;for(let e of t){let t;if(tg(r,e.programAddress,t=>{if(n.add(e.programAddress),tE in t){if(e5(t.role))if(0===t[tE])throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES,{programAddress:e.programAddress});else throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE,{programAddress:e.programAddress});if(2===t[tE])return t}return{[tE]:2,role:e6.READONLY}}),e.accounts)for(let o of e.accounts)tg(r,o.address,e=>{let{address:r,...a}=o;if(tE in e)switch(e[tE]){case 0:return e;case 1:{let r=e.role|a.role;if("lookupTableAddress"in a){if(e.lookupTableAddress!==a.lookupTableAddress&&0>(t||=eC())(a.lookupTableAddress,e.lookupTableAddress))return{[tE]:1,...a,role:r}}else if(a.role>=2)return{[tE]:2,role:r};
1if(e.role!==r)return{...e,role:r};return e}case 2:{let t=e.role|a.role;if(n.has(o.address)){if(e5(a.role))throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE,{programAddress:o.address});if(e.role!==t)return{...e,role:t};return e}if("lookupTableAddress"in a&&!(e.role>=2))return{...a,[tE]:1,role:t};if(e.role!==t)return{...e,role:t};else return e}}return"lookupTableAddress"in a?{...a,[tE]:1}:{...a,[tE]:2}})}return r}(e.feePayer.address,e.instructions)).sort(([e,t],[n,o])=>{if(t[tE]!==o[tE]){if(0===t[tE])return -1;else if(0===o[tE])return 1;else if(2===t[tE])return -1;else if(2===o[tE])return 1}let a=t.role>=2;if(a!==o.role>=2)return a?-1:1;let i=e5(t.role);return i!==e5(o.role)?i?-1:1:(r||=eC(),1===t[tE]&&1===o[tE]&&t.lookupTableAddress!==o.lookupTableAddress)?r(t.lookupTableAddress,o.lookupTableAddress):r(e,n)}).map(([e,t])=>({address:e,...t})),i=a.length;if(i>64)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNT_ADDRESSES,{actualCount:i,maxAllowed:64});let s=a.filter(e=>e.role>=2).length;if(s>12)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_SIGNER_ADDRESSES,{actualCount:s,maxAllowed:12});let l=e.instructions.length;if(l>64)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_INSTRUCTIONS,{actualCount:l,maxAllowed:64});for(let t=0;t<e.instructions.length;t++){let r=e.instructions[t].accounts?.length??0;if(r>255)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNTS_IN_INSTRUCTION,{actualCount:r,instructionIndex:t,maxAllowed:255})}let c=e.lifetimeConstraint;return{addressTableLookups:function(e){let t={};for(let r of e){if(!("lookupTableAddress"in r))continue;let e=t[r.lookupTableAddress]||={readonlyIndexes:[],writableIndexes:[]};r.role===e6.WRITABLE?e.writableIndexes.push(r.addressIndex):e.readonlyIndexes.push(r.addressIndex)}return Object.keys(t).sort(eC()).map(e=>({lookupTableAddress:e,...t[e]}))}(a),...c?{lifetimeToken:tm(c)}:null,header:tf(a),instructions:(t=e.instructions,n=function(e){let t={};for(let[r,n]of e.entries())t[n.address]=r;return t}(a),t.map(({accounts:e,data:t,programAddress:r})=>({programAddressIndex:n[r],...e?{accountIndices:e.map(({address:e})=>n[e])}:null,...t?{data:t}:null}))),staticAccounts:(-1===(o=a.findIndex(e=>"lookupTableAddress"in e))?a:a.slice(0,o)).map(({address:e})=>e),version:e.version}}(e);if(1===t)return function(e){var t,r;let n,o,a=td(tu(e.feePayer.address,e.instructions)),i=a.length;if(i>64)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNT_ADDRESSES,{actualCount:i,maxAllowed:64});let s=a.filter(e=>e.role>=2).length;if(s>12)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_SIGNER_ADDRESSES,{actualCount:s,maxAllowed:12});let l=e.instructions.length;if(l>64)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_INSTRUCTIONS,{actualCount:l,maxAllowed:64});for(let t=0;t<e.instructions.length;t++){let r=e.instructions[t].accounts?.length??0;if(r>255)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNTS_IN_INSTRUCTION,{actualCount:r,instructionIndex:t,maxAllowed:255})}let c=t_(a),u=e.lifetimeConstraint;return{version:1,...u?{lifetimeToken:tm(u)}:null,configMask:(t=e.config??{},n=0,void 0!==t.priorityFeeLamports&&(n|=3),void 0!==t.computeUnitLimit&&(n|=4),void 0!==t.loadedAccountsDataSizeLimit&&(n|=8),void 0!==t.heapSize&&(n|=16),n),configValues:(r=e.config??{},o=[],void 0!==r.priorityFeeLamports&&o.push({kind:"u64",value:r.priorityFeeLamports}),void 0!==r.computeUnitLimit&&o.push({kind:"u32",value:r.computeUnitLimit}),void 0!==r.loadedAccountsDataSizeLimit&&o.push({kind:"u32",value:r.loadedAccountsDataSizeLimit}),void 0!==r.heapSize&&o.push({kind:"u32",value:r.heapSize}),o),header:tf(a),instructionHeaders:e.instructions.map(e=>({numInstructionAccounts:e.accounts?.length??0,numInstructionDataBytes:e.data?.byteLength??0,programAccountIndex:c[e.programAddress]})),instructionPayloads:e.instructions.map(e=>({instructionAccountIndices:e.accounts?.map(({address:e})=>c[e])??[],instructionData:e.data??new Uint8Array})),numInstructions:e.instructions.length,numStaticAccounts:a.length,staticAccounts:a.map(e=>e.address)}}(e);throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED,{version:t})},"getCompiledTransactionMessageEncoder",0,function(){return(0,eh.transformEncoder)(eQ([[e=>"legacy"===e.version,(0,eh.transformEncoder)(eZ([["header",tr()],["staticAccounts",eV(eI(),{size:e3()})],["lifetimeToken",ti()],["instructions",eV(tn(),{size:e3()})]]),e=>({...e,lifetimeToken:"lifetimeToken"in e?e.lifetimeToken:void 0}))],[e=>0===e.version,(0,eh.transformEncoder)(eZ([["version",ts()],["header",tr()],["staticAccounts",eV(eI(),{size:e3()})],["lifetimeToken",ti()],["instructions",eV(tn(),{size:e3()})],["addressTableLookups",eV(function(){if(!m){let e=eV(e8(),{size:e3()});m=eZ([["lookupTableAddress",eI()],["writableIndexes",e],["readonlyIndexes",e]])}return m}(),{size:e3()})]]),e=>({...e,addressTableLookups:e.addressTableLookups??[],lifetimeToken:"lifetimeToken"in e?e.lifetimeToken:void 0}))],[e=>1===e.version,(0,eh.transformEncoder)(eZ([["version",ts()],["header",tr()],["configMask",e4()],["lifetimeToken",ti()],["numInstructions",e8()],["numStaticAccounts",e8()],["staticAccounts",eV(eI(),{size:"remainder"})],["configValues",eV(eQ([[e=>"u32"===e.kind,(0,eh.transformEncoder)(eZ([["value",e4()]]),e=>e)],[e=>"u64"===e.kind,(0,eh.transformEncoder)(eZ([["value",((e={})=>e2({config:e,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,t,r)=>e.setBigUint64(0,BigInt(t),r),size:8}))()]]),e=>e)]]),{size:"remainder"})],["instructionHeaders",eV(eZ([["programAccountIndex",e8()],["numInstructionAccounts",e8()],["numInstructionDataBytes",((e={})=>e2({config:e,name:"u16",range:[0,Number("0xffff")],set:(e,t,r)=>e.setUint16(0,Number(t),r),size:2}))()]]),{size:"remainder"})],["instructionPayloads",eV(eZ([["instructionAccountIndices",eV(e8(),{size:"remainder"})],["instructionData",ej()]]),{size:"remainder"})]]),e=>({...e,lifetimeToken:"lifetimeToken"in e?e.lifetimeToken:void 0}))]]),e=>{if("legacy"!==e.version&&e.version>1)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED,{unsupportedVersion:e.version});return e})},"getTransactionVersionDecoder",0,function(){return(0,eh.createDecoder)({maxSize:1,read:(e,t)=>{let r=e[t];if((128&r)==0)return["legacy",t];{let e=128^r;if(e>1)throw new p.SolanaError(p.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED,{unsupportedVersion:e});return[e,t+1]}}})},"isTransactionMessageWithBlockhashLifetime",0,e9,"isTransactionMessageWithDurableNonceLifetime",0,function(e){var t,r;return"lifetimeConstraint"in e&&"string"==typeof e.lifetimeConstraint.nonce&&null!=e.instructions[0]&&"11111111111111111111111111111111"===(t=e.instructions[0]).programAddress&&null!=t.data&&4===(r=t.data).byteLength&&4===r[0]&&0===r[1]&&0===r[2]&&0===r[3]&&t.accounts?.length===3&&null!=t.accounts[0].address&&t.accounts[0].role===e6.WRITABLE&&"SysvarRecentB1ockHashes11111111111111111111"===t.accounts[1].address&&t.accounts[1].role===e6.READONLY&&null!=t.accounts[2].address&&t.accounts[2].role>=2},"setTransactionMessageLifetimeUsingBlockhash",0,te],675481);var tp={debug:0,info:1,warn:2,error:3};function tS(){return!!("u">typeof g.default&&(g.default.env?.CONNECTOR_DEBUG_LEVEL||g.default.env?.CONNECTOR_DEBUG==="true"||g.default.env?.CONNECTOR_DEBUG==="1")||"u">typeof globalThis&&(!0===globalThis.__CONNECTOR_DEBUG__||globalThis.__CONNECTOR_DEBUG_LEVEL__)||"u">typeof window&&(!0===window.__CONNECTOR_DEBUG__||window.__CONNECTOR_DEBUG_LEVEL__))}function tA(e,t="info",r="[Connector]"){if(!tS()||tp[t]<tp["u">typeof g.default&&g.default.env?.CONNECTOR_DEBUG_LEVEL?g.default.env.CONNECTOR_DEBUG_LEVEL:"u">typeof globalThis&&globalThis.__CONNECTOR_DEBUG_LEVEL__?globalThis.__CONNECTOR_DEBUG_LEVEL__:"u">typeof window&&window.__CONNECTOR_DEBUG_LEVEL__?window.__CONNECTOR_DEBUG_LEVEL__:"info"])return;let n="string"==typeof e?e:JSON.stringify(e,null,2);switch(t){case"debug":console.log(r,n);break;case"info":console.info(r,n);break;case"warn":console.warn(r,n);break;case"error":console.error(r,n)}}async function tN(e){let t=!1!==e.blockhashReset,r=e.transaction,n="lifetimeConstraint"in r;if(t||!n){let{value:o}=await e.rpc.getLatestBlockhash().send();n?t&&(tS()&&tA("Auto resetting the latest blockhash.","debug"),r={...r,lifetimeConstraint:o}):(tS()&&tA("Transaction missing latest blockhash, fetching one.","debug"),r=te(o,r))}return e7(r),r}
1var tR=class extends Error{constructor(e,t,r){super(e),h(this,"context"),h(this,"originalError"),h(this,"timestamp"),this.name=this.constructor.name,this.context=t,this.originalError=r,this.timestamp=new Date().toISOString(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,code:this.code,message:this.message,recoverable:this.recoverable,context:this.context,timestamp:this.timestamp,originalError:this.originalError?.message}}},tO=class extends tR{constructor(e,t,r,n){super(t,r,n),h(this,"code"),h(this,"recoverable",!0),this.code=e}},tT=class extends tR{constructor(e,t,r,n){super(t,r,n),h(this,"code"),h(this,"recoverable",!1),this.code=e}},tb=class extends tR{constructor(e,t,r,n){super(t,r,n),h(this,"code"),h(this,"recoverable",!1),this.code=e}},tw=class extends tR{constructor(e,t,r,n){super(t,r,n),h(this,"code"),h(this,"recoverable",!0),this.code=e}},tI=class extends tR{constructor(e,t,r,n){super(t,r,n),h(this,"code"),h(this,"recoverable"),this.code=e,this.recoverable=["USER_REJECTED","SEND_FAILED","SIMULATION_FAILED"].includes(e)}},tv=["address","publickey","signature","account","rpcurl","url","apikey","api_key","token","secret","password","private","seed","mnemonic"],tC={debug:0,info:1,warn:2,error:3},ty=class{constructor(e={}){h(this,"config");let t="u">typeof g.default&&!1;this.config={enabled:e.enabled??!1,level:e.level??"debug",redactSensitive:e.redactSensitive??!t,prefix:e.prefix??"Connector",useConnectorDebug:e.useConnectorDebug??!0}}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}log(e,t,r){let n=!!this.config.useConnectorDebug&&tS();if(!this.config.enabled&&!n)return;let o=this.config.level;if(this.config.useConnectorDebug&&"u">typeof globalThis){let e=globalThis.__CONNECTOR_DEBUG_LEVEL__;e&&["debug","info","warn","error"].includes(e)&&(o=e)}if(tC[e]<tC[o])return;let a=this.config.redactSensitive?this.redact(r):r,i=void 0!==a?`${t} ${"object"==typeof a?JSON.stringify(a,null,2):a}`:t;if(this.config.useConnectorDebug&&n)tA(i,e,this.config.prefix);else{let r=`[${this.config.prefix}]`;switch(e){case"debug":console.debug(r,t,void 0!==a?a:"");break;case"info":console.info(r,t,void 0!==a?a:"");break;case"warn":console.warn(r,t,void 0!==a?a:"");break;case"error":console.error(r,t,void 0!==a?a:"")}}}redact(e){if(null==e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>this.redact(e));let t={};for(let[r,n]of Object.entries(e)){let e=r.toLowerCase();tv.some(t=>e.includes(t))?t[r]=this.maskValue(n):"object"==typeof n&&null!==n?t[r]=this.redact(n):t[r]=n}return t}maskValue(e){if(null==e)return"***";let t=String(e);return t.length<=8?"***":`${t.slice(0,4)}...${t.slice(-4)}`}updateConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}};new ty({prefix:"Connector"}),e.s(["Errors",0,{walletNotConnected:e=>new tO("WALLET_NOT_CONNECTED","No wallet connected",e),walletNotFound:e=>new tO("WALLET_NOT_FOUND",`Wallet not found${e?`: ${e}`:""}`,{walletName:e}),connectionFailed:e=>new tO("CONNECTION_FAILED","Failed to connect to wallet",void 0,e),accountNotAvailable:e=>new tO("ACCOUNT_NOT_AVAILABLE","Requested account not available",{address:e}),invalidTransaction:(e,t)=>new tT("INVALID_TRANSACTION",`Invalid transaction: ${e}`,t),invalidFormat:(e,t)=>new tT("INVALID_FORMAT",`Invalid format: expected ${e}`,{expectedFormat:e,actualFormat:t}),unsupportedFormat:e=>new tT("UNSUPPORTED_FORMAT",`Unsupported format: ${e}`,{format:e}),missingProvider:e=>new tb("MISSING_PROVIDER",`${e} must be used within ConnectorProvider. Wrap your app with <ConnectorProvider> or <UnifiedProvider>.`,{hookName:e}),clusterNotFound:(e,t)=>new tb("CLUSTER_NOT_FOUND",`Cluster ${e} not found. Available clusters: ${t.join(", ")}`,{clusterId:e,availableClusters:t}),rpcError:(e,t)=>new tw("RPC_ERROR",e,void 0,t),networkTimeout:()=>new tw("NETWORK_TIMEOUT","Network request timed out"),signingFailed:e=>new tI("SIGNING_FAILED","Failed to sign transaction",void 0,e),featureNotSupported:e=>new tI("FEATURE_NOT_SUPPORTED",`Wallet does not support ${e}`,{feature:e}),userRejected:e=>new tI("USER_REJECTED",`User rejected ${e}`,{operation:e})},"NetworkError",0,tw,"TransactionError",0,tI,"ValidationError",0,tT,"WalletErrorType",0,{CONNECTION_FAILED:"CONNECTION_FAILED",TRANSACTION_FAILED:"TRANSACTION_FAILED",NETWORK_E
1RROR:"NETWORK_ERROR",WALLET_NOT_FOUND:"WALLET_NOT_FOUND",USER_REJECTED:"USER_REJECTED",INSUFFICIENT_FUNDS:"INSUFFICIENT_FUNDS",UNKNOWN_ERROR:"UNKNOWN_ERROR"},"createLogger",0,function(e,t){return new ty({...t,prefix:e})},"createSolanaClient",0,function({urlOrMoniker:e,rpcConfig:t,rpcSubscriptionsConfig:r}){var n,o,c,u,d,f,_,m,g,E;let h,S,A;if(!e)throw Error("Cluster url or moniker is required");if(e instanceof URL)h=e;else try{h=new URL(e.toString())}catch{try{h=new URL(th(e.toString()))}catch{throw Error("Invalid URL or cluster moniker")}}if(!h.protocol.match(/^https?:/i))throw Error("Unsupported protocol. Only HTTP and HTTPS are supported");t?.port&&(h.port=t.port.toString());let O=h.toString(),b=(c=z(function(e){let t,{fromJson:r,headers:n,toJson:o,url:a}=e,i=n&&function(e){let t={};for(let r in e)t[r.toLowerCase()]=e[r];return t}(n);return async function({payload:e,signal:n}){let s=o?o(e):JSON.stringify(e),l={...t,body:s,headers:{...i,accept:"application/json","content-type":"application/json; charset=utf-8"},method:"POST",signal:n},c=await fetch(a,l);if(!c.ok)throw new p.SolanaError(p.SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR,{headers:c.headers,message:c.statusText,statusCode:c.status});return r?r(await c.text(),e):await c.json()}}({...{...o={url:O,...void 0},headers:{...!1,...o.headers?function(e){let t={};for(let r in e)t[r.toLowerCase()]=e[r];return t}(o.headers):void 0,"solana-client":"js/7.1.1"}},fromJson:(e,t)=>Z(t)?T(e):JSON.parse(e),toJson:e=>Z(e)?I(e):JSON.stringify(e)}),e=>{let t;return async function(r){let{payload:n,signal:o}=r,a=ea(n);if(void 0===a)return await e(r);if(t||(queueMicrotask(()=>{t=void 0}),t={}),null==t[a]){let n=new eo,o=(async()=>{try{return await e({...r,signal:n.signal})}catch(e){if(e===(s||={}))return;throw e}})();t[a]={abortController:n,numConsumers:0,responsePromise:o}}let i=t[a];if(i.numConsumers++,!o)return await i.responsePromise;{let e=i.responsePromise;return await new Promise((t,r)=>{let n=e=>{o.removeEventListener("abort",n),i.numConsumers-=1,queueMicrotask(()=>{0===i.numConsumers&&i.abortController.abort(s||={})}),r(e.target.reason)};o.addEventListener("abort",n),e.then(t).catch(r).finally(()=>{o.removeEventListener("abort",n)})})}}}),f={api:(d={requestTransformer:W(en),responseTransformer:(u={allowedNumericKeyPaths:(i||(i={getAccountInfo:K.map(e=>["value",...e]),getBlock:[...q.flatMap(e=>[["transactions",V,"meta","preTokenBalances",V,...e],["transactions",V,"meta","postTokenBalances",V,...e]]),["transactions",V,"meta","rewards",V,"commission"],...J.map(e=>["transactions",V,"meta","innerInstructions",V,...e]),...X.map(e=>["transactions",V,"transaction","message",...e]),["transactions",V,"version"],["rewards",V,"commission"]],getClusterNodes:[[V,"featureSet"],[V,"shredVersion"]],getInflationGovernor:[["initial"],["foundation"],["foundationTerm"],["taper"],["terminal"]],getInflationRate:[["foundation"],["total"],["validator"]],getInflationReward:[[V,"commission"]],getMultipleAccounts:K.map(e=>["value",V,...e]),getProgramAccounts:K.flatMap(e=>[["value",V,"account",...e],[V,"account",...e]]),getRecentPerformanceSamples:[[V,"samplePeriodSecs"]],getSignaturesForAddress:[[V,"transactionIndex"]],getTokenAccountBalance:[["value","decimals"],["value","uiAmount"]],getTokenAccountsByDelegate:H.map(e=>["value",V,"account",...e]),getTokenAccountsByOwner:H.map(e=>["value",V,"account",...e]),getTokenLargestAccounts:[["value",V,"decimals"],["value",V,"uiAmount"]],getTokenSupply:[["value","decimals"],["value","uiAmount"]],getTransaction:[...q.flatMap(e=>[["meta","preTokenBalances",V,...e],["meta","postTokenBalances",V,...e]]),["meta","rewards",V,"commission"],...J.map(e=>["meta","innerInstructions",V,...e]),...X.map(e=>["transaction","message",...e]),["version"]],getTransactionsForAddress:[["data",V,"transactionIndex"],...q.flatMap(e=>[["data",V,"meta","preTokenBalances",V,...e],["data",V,"meta","postTokenBalances",V,...e]]),["data",V,"meta","rewards",V,"commission"],...J.map(e=>["data",V,"meta","innerInstructions",V,...e]),...X.map(e=>["data",V,"transaction","message",...e]),["data",V,"version"]],getVersion:[["feature-set"]],getVoteAccounts:[["current",V,"commission"],["current",V,"inflationRewardsCommissionBps"],["delinquent",V,"commission"],["delinquent",V,"inflationRewardsCommissionBps"]],simulateTransaction:[["value","loadedAccountsDataSize"],...K.map(e=>["value","accounts",V,...e]),...J.map(e=>["value","innerInstructions",V,...e]),...q.flatMap(e=>[["value","preTokenBalances",V,...e],["value","postTokenBalances",V,...e]])]}),i)},(e,t)=>{let r=t.methodName,n=u?.allowedNumericKeyPaths&&r?u.allowedNumericKeyPaths[r]:void 0;return z(e,e=>((e,t)=>{if("error"in e){let{error:o}=e;if(o&&"object"==typeof o&&"code"in o&&(-32002===o.code||o.code===-32002n)&&"data"in o&&o.data){var r,n;let e=(r=[$([["loadedAccountsDataSize"],...K.map(e=>["accounts",V,...e]),...J.map(e=>["innerInstructions",V,...e])])],n={keyPath:[]},e=>G(r)(e,n))(o.data,t),a={...o,data:e};throw(0,p.getSolanaErrorFromJsonRpcError)(a)}throw(0,p.getSolanaErrorFromJsonRpcError)(e.error)}return e})(e,t),e=>e.result,e=>Y(n??[])(e,t))})},new Proxy({},{defineProperty:()=>!1,deleteProperty:()=>!1,get(...e){let[t,r]=e;if(R(r))return N(r,e[2]);let n=r.toString();return function(...e){let t=Object.freeze({methodName:n,params:e}),r=d?.requestTransformer?d?.requestTransformer(t):t;return Object.freeze({execute:async({signal:e,transport:t})=>{let n=w(r),o=await t({payload:n,signal:e});return d?.responseTransformer?d.responseTransformer(o,r):o}})}}})),transport:c},new Proxy(f.api,{defineProperty:()=>!1,deleteProperty:()=>!1,get:(e,t,r)=>R(t)?N(t,r):function(...n){let o=t.toString(),a=Reflect.get(e,o,r);if(!a)throw new p.SolanaError(p.SOLANA_ERROR__RPC__API_PLAN_MISSING_FOR_RPC_METHOD,{method:o,params:n});return function({transport:e},t){return{reactiveStore:()=>(function(e){let t,r=D,n=new Set;function o(e){(r.status!==e.status||r.data!==e.data||r.error!==e.error)&&(r=e,n.forEac
1h(e=>e()))}let a=async(n,...a)=>{if(t?.abort(),n?.aborted)throw o({data:r.data,error:n.reason,status:"error"}),n.reason;let i=new k;t=i;let s=n?AbortSignal.any([i.signal,n]):i.signal,l=r.data;o({data:l,error:r.error,status:"running"});try{let t=await L(e(s,...a),s);if(s.aborted)throw s.reason;return o({data:t,error:void 0,status:"success"}),t}catch(e){if(i.signal.aborted)throw i.signal.reason;throw o({data:l,error:e,status:"error"}),e}},i=(...e)=>a(void 0,...e);return{dispatch:(...e)=>{i(...e).catch(()=>{})},dispatchAsync:i,getState:()=>r,reset:()=>{t?.abort(),t=void 0,o(D)},subscribe:e=>(n.add(e),()=>{n.delete(e)}),withSignal:e=>({dispatch:(...t)=>{a(e,...t).catch(()=>{})},dispatchAsync:(...t)=>a(e,...t)})}})(r=>t.execute({signal:r,transport:e})),send:async r=>await t.execute({signal:r?.abortSignal,transport:e})}}(f,a(...n))}}));return h.protocol=h.protocol.replace("http","ws"),r?.port?h.port=r.port.toString():("localhost"===h.hostname||h.hostname.startsWith("127"))&&(h.port="8900"),{rpc:b,rpcSubscriptions:(n=h.toString(),_=function({createChannel:e}){var t;return z((t=e,async({execute:e,signal:r})=>{let n=await t({abortSignal:r});return await e({channel:n,signal:r})}),e=>{let t;return t=new Map,function(r){let{request:n,signal:o}=r,a=er([n.methodName,n.params]),i=t.get(a);if(!i){let n=new em,o=e({...r,signal:n.signal});o.then(e=>{e.on("error",()=>{t.delete(a),n.abort()},{signal:n.signal})}).catch(()=>{}),t.set(a,i={abortController:n,dataPublisherPromise:o,numSubscribers:0})}return i.numSubscribers++,o.addEventListener("abort",()=>{i.numSubscribers--,0===i.numSubscribers&&queueMicrotask(()=>{0===i.numSubscribers&&(t.delete(a),i.abortController.abort())})},{signal:i.abortController.signal}),i.dataPublisherPromise}})}({createChannel:function(e){if(!1===/^wss?:/i.test(e.url)){let t=e.url.match(/^([^:]+):/);throw new DOMException(t?`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${t[1]}:' is not allowed.`:`Failed to construct 'WebSocket': The URL '${e.url}' is invalid.`)}let{intervalMs:t,...r}=e;return function(e,{maxSubscriptionsPerChannel:t,minChannels:r}){let n={entries:[],freeChannelIndex:-1};function o(){let e;if(n.entries.length<r){n.freeChannelIndex=-1;return}for(let r=0;r<n.entries.length;r++){let o=(n.freeChannelIndex+r+2)%n.entries.length,a=n.entries[o];a.subscriptionCount<t&&(!e||e.subscriptionCount>=a.subscriptionCount)&&(e={poolIndex:o,subscriptionCount:a.subscriptionCount})}n.freeChannelIndex=e?.poolIndex??-1}return function({abortSignal:t}){let r;function a(){let e=n.entries.findIndex(e=>e===r);n.entries.splice(e,1),r.dispose(),o()}if(-1===n.freeChannelIndex){let t=new em,o=e({abortSignal:t.signal});o.then(e=>{e.on("error",a,{signal:t.signal})}).catch(a),r={channel:o,dispose(){t.abort()},subscriptionCount:0},n.entries.push(r)}else r=n.entries[n.freeChannelIndex];return r.subscriptionCount++,t.addEventListener("abort",function(){r.subscriptionCount--,0===r.subscriptionCount?a():-1!==n.freeChannelIndex&&(n.freeChannelIndex--,o())}),o(),r.channel}}(({abortSignal:n})=>(function({sendBufferHighWatermark:e,signal:t,url:r}){let n,o,a;if(t.aborted)return Promise.reject(t.reason);let i=!1,s=new Set;function l(){s.forEach(e=>{e()}),s.clear()}function c(){l(),i||o(t.reason),g.readyState!==ef.CLOSED&&g.readyState!==ef.CLOSING&&g.close(1e3)}function u(e){if(!t.aborted&&!i){let t=new p.SolanaError(p.SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_FAILED_TO_CONNECT,{errorEvent:e});o(t),f.dispatchEvent(new CustomEvent("error",{detail:t}))}}function d(e){t.aborted||f.dispatchEvent(new CustomEvent("message",{detail:e.data}))}let f=new ed,_=x(f);function m(){i=!0,a({..._,async send(t){if(g.readyState!==ef.OPEN)throw new p.SolanaError(p.SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED);if(!n&&g.bufferedAmount>e){let t,r=new Promise((r,o)=>{let a=setInterval(()=>{g.readyState===ef.OPEN&&g.bufferedAmount>e||(clearInterval(a),n=void 0,r())},16);t=()=>{n=void 0,clearInterval(a),o(new p.SolanaError(p.SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CLOSED_BEFORE_MESSAGE_BUFFERED))}});n={onCancel:t,promise:r}}n&&(!ArrayBuffer.isView(t)||t instanceof DataView||(t=new t.constructor(t)),await n.promise),g.send(t)}})}let g=new ef(r);return t.addEventListener("abort",c),g.addEventListener("close",function e(r){l(),n?.onCancel(),t.removeEventListener("abort",c),g.removeEventListener("close",e),g.removeEventListener("error",u),g.removeEventListener("message",d),g.removeEventListener("open",m),t.aborted||r.wasClean&&1e3===r.code||f.dispatchEvent(new CustomEvent("error",{detail:new p.SolanaError(p.SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED,{cause:r})}))}),g.addEventListener("error",u),g.addEventListener("message",d),g.addEventListener("open",m),new Promise((e,t)=>
1{o=t,a=e})})({...r,sendBufferHighWatermark:e.sendBufferHighWatermark??131072,signal:n}).then(e.jsonSerializer).then(e=>(function({abortSignal:e,channel:t,intervalMs:r}){let n;function o(){t.send(eg).catch(e=>{(0,p.isSolanaError)(e,p.SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED)&&i.abort()})}function a(){clearInterval(n),n=setInterval(o,r)}let i=new em;return i.signal.addEventListener("abort",()=>{clearInterval(n)}),e.addEventListener("abort",()=>{i.abort()}),t.on("error",()=>{i.abort()},{signal:i.signal}),t.on("message",a,{signal:i.signal}),globalThis.navigator.onLine&&a(),globalThis.addEventListener("offline",function(){clearInterval(n)},{signal:i.signal}),globalThis.addEventListener("online",function(){o(),a()},{signal:i.signal}),{...t,send:(...e)=>(i.signal.aborted||a(),t.send(...e))}})({abortSignal:n,channel:e,intervalMs:t??5e3})),{maxSubscriptionsPerChannel:e.maxSubscriptionsPerChannel??100,minChannels:e.minChannels??1})}({...{...void 0,url:n},jsonSerializer:eE})}),m={api:(S=W(e_),g={allowedNumericKeyPaths:(l||(l={accountNotifications:K.map(e=>["value",...e]),blockNotifications:[...q.flatMap(e=>[["value","block","transactions",V,"meta","preTokenBalances",V,...e],["value","block","transactions",V,"meta","postTokenBalances",V,...e]]),["value","block","transactions",V,"meta","rewards",V,"commission"],...J.map(e=>["value","block","transactions",V,"meta","innerInstructions",V,...e]),...X.map(e=>["value","block","transactions",V,"transaction","message",...e]),["value","block","transactions",V,"version"],["value","block","rewards",V,"commission"]],programNotifications:K.flatMap(e=>[["value",V,"account",...e],[V,"account",...e]])}),l)},A=(e,t)=>{var r;let n=(r=t.methodName).endsWith("Subscribe")?`${r.slice(0,-9)}Notifications`:r.endsWith("Notification")&&!r.endsWith("Notifications")?`${r}s`:r,o=g?.allowedNumericKeyPaths&&n?g.allowedNumericKeyPaths[n]:void 0;return z(e,e=>Y(o??[])(e,t))},E={planExecutor:({request:e,...t})=>eu({...t,responseTransformer:A,subscribeRequest:{...e,methodName:e.methodName.replace(/Notifications$/,"Subscribe")},unsubscribeMethodName:e.methodName.replace(/Notifications$/,"Unsubscribe")}),requestTransformer:S},new Proxy({},{defineProperty:()=>!1,deleteProperty:()=>!1,get(...e){let[t,r]=e;if(R(r))return N(r,e[2]);let n=r.toString();return function(...e){let t={methodName:n,params:e},r=E.requestTransformer?E.requestTransformer(t):t;return{execute:e=>E.planExecutor({...e,request:r}),request:r}}}})),transport:_},new Proxy(m.api,{defineProperty:()=>!1,deleteProperty:()=>!1,get:(e,t,r)=>R(t)?N(t,r):function(...n){var o,i;let s=t.toString(),l=Reflect.get(e,s,r);if(!l)throw new p.SolanaError(p.SOLANA_ERROR__RPC_SUBSCRIPTIONS__CANNOT_CREATE_SUBSCRIPTION_PLAN,{notificationName:s});let c=l(...n);return o=m.transport,i=c,{reactiveStore:()=>(function({createDataPublisher:e,dataChannelName:t,errorChannelName:r}){let n,o=M,a=new Set;function i(e){(o.status!==e.status||o.data!==e.data||o.error!==e.error)&&(o=e,a.forEach(e=>e()))}function s(a){if(n?.abort(),a?.aborted)return void i({data:o.data,error:a.reason,status:"error"});i({data:o.data,error:o.error,status:"loading"});let s=new k;n=s;let l=a?AbortSignal.any([s.signal,a]):s.signal;a&&a.addEventListener("abort",()=>{s.signal.aborted||(i({data:o.data,error:a.reason,status:"error"}),s.abort(a.reason))},{signal:s.signal}),e(l).then(e=>{l.aborted||(e.on(t,e=>{i({data:e,error:void 0,status:"loaded"})},{signal:l}),e.on(r,e=>{"error"!==o.status&&(i({data:o.data,error:e,status:"error"}),s.abort(e))},{signal:l}))},e=>{l.aborted||(i({data:o.data,error:e,status:"error"}),s.abort(e))})}return{connect(){s(void 0)},getState:()=>o,reset:function(){n?.abort(),n=void 0,i(M)},subscribe:e=>(a.add(e),()=>{a.delete(e)}),withSignal:e=>({connect(){s(e)}})}})({createDataPublisher:e=>o({signal:e,...i}),dataChannelName:"notification",errorChannelName:"error"}),async subscribe({abortSignal:e}){let t=await o({signal:e,...i});return function({abortSignal:e,dataChannelName:t,dataPublisher:r,errorChannelName:n}){let o=new Map;function i(e){for(let[t,r]of o.entries())r.__hasPolled?(o.delete(t),r.onError(e)):r.publishQueue.push({__type:1,err:e})}let s=new k;e.addEventListener("abort",()=>{s.abort(),i(a||=B())});let l={signal:s.signal},c=U;return r.on(n,e=>{c===U&&(c=e,s.abort(),i(e))},l),r.on(t,e=>{o.forEach((t,r)=>{if(t.__hasPolled){let{onData:n}=t;o.set(r,{__hasPolled:!1,publishQueue:[]}),n(e)}else t.publishQueue.push({__type:0,data:e})})},l),{async *[Symbol.asyncIterator](){if(e.aborted)return;if(c!==U)throw c;let t=Symbol();o.set(t,{__hasPolled:!1,publishQueue:[]});try{for(;;){let e=o.get(t);if(!e)throw new p.SolanaError(p.SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_STATE_MISSING);
1if(e.__hasPolled)throw new p.SolanaError(p.SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE);let r=e.publishQueue;try{if(r.length)for(let t of(e.publishQueue=[],r))if(0===t.__type)yield t.data;else throw t.err;else yield await new Promise((e,r)=>{o.set(t,{__hasPolled:!0,onData:e,onError:r})})}catch(e){if(e===(a||=B()))return;throw e}}}finally{o.delete(t)}}}}({abortSignal:e,dataChannelName:"notification",dataPublisher:t,errorChannelName:"error"})}}}})),urlOrMoniker:O}},"getExplorerLink",0,function(e={}){let t=new URL("https://explorer.solana.com"),r=e.cluster;return r&&"mainnet"!==r||(r="mainnet-beta"),"address"in e&&e.address?t.pathname=`/address/${e.address}`:"transaction"in e&&e.transaction?t.pathname=`/tx/${e.transaction}`:"block"in e&&void 0!==e.block&&(t.pathname=`/block/${e.block}`),"mainnet-beta"!==r&&("localnet"===r||"localhost"===r?(t.searchParams.set("cluster","custom"),t.searchParams.set("customUrl","http://localhost:8899")):t.searchParams.set("cluster",r)),t.toString()},"getPublicSolanaRpcUrl",0,th,"isConnectorError",0,function(e){return e instanceof tR},"prepareTransaction",0,tN],4903)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.