@ar.io/sdk 3.11.0-alpha.10 → 3.11.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -212,7 +212,7 @@ nonce: bundlr`),Re.from(n))}};se();ue();fe();var y1=class{_publicKey;ownerLength
212
212
  }
213
213
  }
214
214
  }
215
- }`,n=kt.object({data:kt.object({transactions:kt.object({edges:kt.array(kt.object({node:kt.record(kt.any())}))})})});return h=>di(h).chain(gn(d=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:s,variables:{transactionIds:[d]}})}).then(async v=>{if(v.ok)return v.json();throw r('Error Encountered when querying gateway for transaction "%s"',d),new Error(`${v.status}: ${await v.text()}`)}).then(n.parse).then(tHe(["data","transactions","edges","0","node"])))).toPromise()}var cWe=PL(wUe(),1),_1e=(t="@permaweb/aoconnect")=>{let e=(0,cWe.default)(t);return e.child=r=>_1e(`${e.namespace}:${r}`),e.tap=(r,...s)=>fHe((...n)=>e(r,...s,...n)),e},M1e=({url:t,path:e})=>e?e.startsWith("/")?M1e({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function dWe(t){return wg(U_([]),bg((e,r)=>wg(nHe([],r.name),VL(r.value),du(r.name,$c,e))(e),{}),L_(e=>e.length>1?e:e[0]))(t)}function hu(t,e){return r=>Wpe(dze([Zde(t,"name"),JL(ZL(e),Zde(e,"value"),HL)]),r)}function Jde(t){return t1e([[n6(String),ug(t)],[n6(Array),Kze(t)],[HL,xje]])}function W1(t){let e;return n6(lu,t)?(e=new Error(pWe(t)),e.stack+=t.stack):n6(Error,t)?e=t:zze("message",t)?e=new Error(t.message):n6(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function pWe(t){return wg(e=>function r(s,n,h){return bg((d,v)=>wg(t1e([[ug(Jt.invalid_arguments),()=>r(v.argumentsError,422,"Invalid Arguments")],[ug(Jt.invalid_return_type),()=>r(v.returnTypeError,500,"Invalid Return")],[ug(Jt.invalid_union),()=>Ize(w=>r(w,400,"Invalid Union"),v.unionErrors)],[HL,()=>[{...v,status:n,contextCode:h}]]]),GL(d))(v.code),[],s.issues)}(e,400,""),e=>bg((r,s)=>{let{message:n,path:h,contextCode:d}=s,v=h[1]||h[0],w=d?`${d} `:"";return r.push(`${w}'${v}': ${n}.`),r},[],e),Xze(" | "))(t)}var vWe=kt.object({id:kt.string().min(1,{message:"message is required to be a message id"}),processId:kt.string().min(1,{message:"process is required to be a process id"})});function mWe(){return t=>di(t).map(vWe.parse).map(()=>t)}var F6=kt.object({name:kt.string(),value:kt.string()}),gWe=kt.function().args(kt.object({Id:kt.string(),Target:kt.string(),Owner:kt.string(),Anchor:kt.string().optional(),Data:kt.any().default("1234"),Tags:kt.array(kt.object({name:kt.string(),value:kt.string()}))})).returns(kt.promise(kt.any())),yWe=kt.function().args(kt.object({id:kt.string().min(1,{message:"message id is required"}),processId:kt.string().min(1,{message:"process id is required"})})).returns(kt.promise(kt.any())),bWe=kt.function().args(kt.object({process:kt.string().min(1,{message:"process id is required"}),from:kt.string().optional(),to:kt.string().optional(),sort:kt.enum(["ASC","DESC"]).default("ASC"),limit:kt.number().optional()})).returns(kt.promise(kt.object({edges:kt.array(kt.object({cursor:kt.string(),node:kt.object({Output:kt.any().optional(),Messages:kt.array(kt.any()).optional(),Spawns:kt.array(kt.any()).optional(),Error:kt.any().optional()})}))}))),x1e=kt.function().args(kt.object({processId:kt.string(),data:kt.any(),tags:kt.array(F6),anchor:kt.string().optional(),signer:kt.any()})).returns(kt.promise(kt.object({messageId:kt.string()}).passthrough())),wWe=kt.function().args(kt.object({data:kt.any(),tags:kt.array(F6),signer:kt.any()})).returns(kt.promise(kt.object({processId:kt.string()}).passthrough())),_We=kt.function().args(kt.object({process:kt.string(),message:kt.string(),baseLayer:kt.boolean().optional(),exclude:kt.array(kt.string()).optional()})).returns(kt.promise(kt.object({assignmentId:kt.string()}).passthrough())),S1e=x1e,Axt=kt.function().args(kt.object({suUrl:kt.string().url(),processId:kt.string()})).returns(kt.promise(kt.object({tags:kt.array(F6)}).passthrough())),Rxt=kt.function().args(kt.string()).returns(kt.promise(kt.object({url:kt.string()}))),MWe=kt.function().args(kt.string()).returns(kt.promise(kt.boolean())),xWe=kt.function().args(kt.string()).returns(kt.promise(kt.object({tags:kt.array(F6)}).passthrough())),q_=kt.function().args(kt.object({data:kt.any(),tags:kt.array(F6),target:kt.string().optional(),anchor:kt.string().optional()})).returns(kt.promise(kt.object({id:kt.string(),raw:kt.any()})));function SWe({loadResult:t}){return t=gn(yWe.implement(t)),e=>di({id:e.id,processId:e.processId}).chain(t)}function EWe(t){let e=mWe(t),r=SWe(t);return({message:s,process:n})=>di({id:s,processId:n}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',s)).map(h=>h).bimap(W1,H1).toPromise()}var AWe=kt.array(kt.object({name:kt.string(),value:kt.string()}));function RWe(){return t=>di(t.tags).map(U_([])).map(hu("Data-Protocol","ao")).map(hu("Variant")).map(hu("Type")).map(hu("SDK")).map(GL($c,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(AWe.parse).map(du("tags",$c,t))}function TWe({logger:t}){return e=>di(e).chain(JL(ZL(e.data),()=>q1(e),()=>q1(Math.random().toString().slice(-4)).map(du("data",$c,e)).map(r=>wg(z1("tags"),hu("Content-Type"),VL({name:"Content-Type",value:"text/plain"}),du("tags",$c,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function IWe(t){let e=RWe(t),r=TWe(t),s=x1e.implement(t.deployMessage);return n=>di(n).chain(e).chain(r).chain(gn(({id:h,data:d,tags:v,anchor:w,signer:g})=>s({processId:h,data:d,tags:v,anchor:w,signer:q_.implement(g)}))).map(h=>du("messageId",h.messageId,n))}function kWe(t){let e=IWe(t);return({process:r,data:s,tags:n,anchor:h,signer:d})=>di({id:r,data:s,tags:n,anchor:h,signer:d}).chain(e).map(v=>v.messageId).bimap(W1,H1).toPromise()}var V2=(t,e,r)=>s=>e(s[t])?q1(s):Rd(`Tag '${t}': ${r}`);function BWe({loadTransactionMeta:t,logger:e}){return t=gn(xWe.implement(t)),r=>di(r).chain(t).map(z1("tags")).map(dWe).chain(V2("Data-Protocol",Jde("ao"),"value 'ao' was not found on module")).chain(V2("Type",Jde("Module"),"value 'Module' was not found on module")).chain(V2("Module-Format",iL,"was not found on module")).chain(V2("Input-Encoding",iL,"was not found on module")).chain(V2("Output-Encoding",iL,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function PWe({logger:t,validateScheduler:e}){return e=gn(MWe.implement(e)),r=>di(r).chain(s=>e(s).chain(n=>n?q1(s):Rd(`Valid Scheduler-Location owned by ${s} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function OWe({logger:t}){return e=>di(e).map(t.tap("Checking for signer")).chain(r=>r?q1(r):Rd("signer not found"))}function NWe(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=BWe(t),s=PWe(t),n=OWe(t);return h=>di(h).chain(d=>r(d.module).map(()=>d)).chain(d=>s(d.scheduler)).map(()=>h).chain(d=>n(d.signer).map(()=>d)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var CWe=kt.array(kt.object({name:kt.string(),value:kt.string()}));function $We(){return t=>di(t).map(z1("tags")).map(U_([])).map(hu("Data-Protocol","ao")).map(hu("Variant")).map(hu("Type")).map(hu("Module")).map(hu("Scheduler")).map(hu("SDK")).map(GL($c,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map(CWe.parse).map(du("tags",$c,t))}function LWe({logger:t}){return e=>di(e).chain(JL(ZL(e.data),()=>q1(e),()=>q1(Math.random().toString().slice(-4)).map(du("data",$c,e)).map(r=>wg(z1("tags"),hu("Content-Type"),VL({name:"Content-Type",value:"text/plain"}),du("tags",$c,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function DWe(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=$We(t),s=LWe(t),n=wWe.implement(t.deployProcess);return h=>di(h).chain(r).chain(s).chain(gn(({data:d,tags:v,signer:w})=>n({data:d,tags:v,signer:q_.implement(w)}))).map(d=>du("processId",d.processId,h))}function UWe(t){let e=NWe(t),r=DWe(t);return({module:s,scheduler:n,signer:h,tags:d,data:v})=>di({module:s,scheduler:n,signer:h,tags:d,data:v}).chain(e).chain(r).map(w=>w.processId).bimap(W1,H1).toPromise()}function qWe(t){let e=S1e.implement(t.deployMonitor);return r=>di(r).chain(gn(({id:s,signer:n})=>e({processId:s,signer:q_.implement(n),data:Math.random().toString().slice(-4),tags:[]}))).map(s=>du("monitorId",s.messageId,r))}function FWe(t){let e=qWe(t);return({process:r,signer:s})=>di({id:r,signer:s}).chain(e).map(n=>n.monitorId).bimap(W1,H1).toPromise()}function jWe(t){let e=S1e.implement(t.deployUnmonitor);return r=>di(r).chain(gn(({id:s,signer:n})=>e({processId:s,signer:q_.implement(n),data:Math.random().toString().slice(-4),tags:[]}))).map(s=>du("monitorId",s.messageId,r))}function zWe(t){let e=jWe(t);return({process:r,signer:s})=>di({id:r,signer:s}).chain(e).map(n=>n.monitorId).bimap(W1,H1).toPromise()}var HWe=kt.object({process:kt.string().min(1,{message:"process identifier is required"}),from:kt.string().optional(),to:kt.string().optional(),sort:kt.enum(["ASC","DESC"]).default("ASC"),limit:kt.number().optional()});function WWe(){return t=>di(t).map(HWe.parse).map(()=>t)}function KWe({queryResults:t}){return t=gn(bWe.implement(t)),e=>di({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function ZWe(t){let e=WWe(t),r=KWe(t);return({process:s,from:n,to:h,sort:d,limit:v})=>di({process:s,from:n,to:h,sort:d,limit:v}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',s)).map(w=>w).bimap(W1,H1).toPromise()}var VWe=kt.object({Id:kt.string(),Target:kt.string(),Owner:kt.string(),Anchor:kt.string().optional(),Data:kt.any().default("1234"),Tags:kt.array(kt.object({name:kt.string(),value:kt.string()}))});function GWe(){return t=>di(t).map(VWe.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function JWe({dryrunFetch:t}){return gn(gWe.implement(t))}function YWe(t){let e=GWe(t),r=JWe(t);return s=>di(s).map(XWe).chain(e).chain(r).toPromise()}function XWe({process:t,data:e,tags:r,anchor:s,...n}){return{Id:"1234",Owner:"1234",...n,Target:t,Data:e||"1234",Tags:r||[],Anchor:s||"0"}}function QWe(t){let e=_We.implement(t.deployAssign);return r=>di(r).chain(gn(({process:s,message:n,baseLayer:h,exclude:d})=>e({process:s,message:n,baseLayer:h,exclude:d}))).map(s=>du("assignmentId",s.assignmentId,r))}function eKe(t){let e=QWe(t);return({process:r,message:s,baseLayer:n,exclude:h})=>di({process:r,message:s,baseLayer:n,exclude:h}).chain(e).map(d=>d.assignmentId).bimap(W1,H1).toPromise()}var tKe="https://arweave.net",rKe="https://mu.ao-testnet.xyz",iKe="https://cu.ao-testnet.xyz";function Gs({GRAPHQL_URL:t,GATEWAY_URL:e=tKe,MU_URL:r=rKe,CU_URL:s=iKe}={}){let n=_1e();t||(t=M1e({url:e,path:"/graphql"}));let{validate:h}=Fpe({cacheSize:100,GRAPHQL_URL:t}),d=_je({MAX_SIZE:25}),v=n.child("result"),w=EWe({loadResult:yje({fetch,CU_URL:s,logger:v}),logger:v}),g=n.child("message"),y=kWe({loadProcessMeta:eL({fetch,cache:d,logger:g}),deployMessage:cje({fetch,MU_URL:r,logger:g}),logger:g}),M=n.child("spawn"),x=UWe({loadTransactionMeta:lWe({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:dje({fetch,MU_URL:r,logger:M}),logger:M}),S=n.child("monitor"),E=FWe({loadProcessMeta:eL({fetch,cache:d,logger:S}),deployMonitor:pje({fetch,MU_URL:r,logger:S}),logger:S}),T=n.child("unmonitor"),k=zWe({loadProcessMeta:eL({fetch,cache:d,logger:T}),deployUnmonitor:vje({fetch,MU_URL:r,logger:T}),logger:S}),B=n.child("results"),C=ZWe({queryResults:bje({fetch,CU_URL:s,logger:B}),logger:B}),N=n.child("dryrun"),W=YWe({dryrunFetch:gje({fetch,CU_URL:s,logger:N}),logger:N}),H=n.child("assign"),Y=eKe({deployAssign:mje({fetch,MU_URL:r,logger:H}),logger:g});return{result:w,results:C,message:y,spawn:x,monitor:E,unmonitor:k,dryrun:W,assign:Y}}var E1e={};Qde(E1e,{createDataItemSigner:()=>TKe});var A1e=PL(xUe(),1),R1e={};Qde(R1e,{AVSCTap:()=>j6,ArweaveSigner:()=>tD,DataItem:()=>L6,MAX_TAG_BYTES:()=>F_,MIN_BINARY_SIZE:()=>nD,SIG_CONFIG:()=>Eg,SignatureConfig:()=>uu,Signer:()=>B1e,createData:()=>C1e,default:()=>EKe,deserializeTags:()=>B_,indexToType:()=>rD,serializeTags:()=>iD,tagsExceedLimit:()=>N1e,warparbundles:()=>AKe});var nKe=Object.create,QL=Object.defineProperty,aKe=Object.getOwnPropertyDescriptor,oKe=Object.getOwnPropertyNames,sKe=Object.getPrototypeOf,fKe=Object.prototype.hasOwnProperty,Dc=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),uKe=(t,e)=>{for(var r in e)QL(t,r,{get:e[r],enumerable:!0})},hKe=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of oKe(e))!fKe.call(t,n)&&n!==r&&QL(t,n,{get:()=>e[n],enumerable:!(s=aKe(e,n))||s.enumerable});return t},K1=(t,e,r)=>(r=t!=null?nKe(sKe(t)):{},hKe(e||!t||!t.__esModule?QL(r,"default",{value:t,enumerable:!0}):r,t)),lKe=Dc(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var s=4,n=r.length,h=n%s;if(!h)return r;var d=n,v=s-h,w=n+v,g=Re.alloc(w);for(g.write(r);v--;)g.write("=",d++);return g.toString()}t.default=e}),cKe=Dc(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=lKe();function r(w,g){return g===void 0&&(g="utf8"),Re.isBuffer(w)?h(w.toString("base64")):h(Re.from(w,g).toString("base64"))}function s(w,g){return g===void 0&&(g="utf8"),Re.from(n(w),"base64").toString(g)}function n(w){return w=w.toString(),e.default(w).replace(/\-/g,"+").replace(/_/g,"/")}function h(w){return w.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function d(w){return Re.from(n(w),"base64")}var v=r;v.encode=r,v.decode=s,v.toBase64=n,v.fromBase64=h,v.toBuffer=d,t.default=v}),eD=Dc((t,e)=>{e.exports=cKe().default,e.exports.default=e.exports}),T1e=Dc(t=>{"use strict";t.byteLength=w,t.toByteArray=y,t.fromByteArray=S;var e=[],r=[],s=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,d=n.length;h<d;++h)e[h]=n[h],r[n.charCodeAt(h)]=h;var h,d;r[45]=62,r[95]=63;function v(E){var T=E.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=E.indexOf("=");k===-1&&(k=T);var B=k===T?0:4-k%4;return[k,B]}function w(E){var T=v(E),k=T[0],B=T[1];return(k+B)*3/4-B}function g(E,T,k){return(T+k)*3/4-k}function y(E){var T,k=v(E),B=k[0],C=k[1],N=new s(g(E,B,C)),W=0,H=C>0?B-4:B,Y;for(Y=0;Y<H;Y+=4)T=r[E.charCodeAt(Y)]<<18|r[E.charCodeAt(Y+1)]<<12|r[E.charCodeAt(Y+2)]<<6|r[E.charCodeAt(Y+3)],N[W++]=T>>16&255,N[W++]=T>>8&255,N[W++]=T&255;return C===2&&(T=r[E.charCodeAt(Y)]<<2|r[E.charCodeAt(Y+1)]>>4,N[W++]=T&255),C===1&&(T=r[E.charCodeAt(Y)]<<10|r[E.charCodeAt(Y+1)]<<4|r[E.charCodeAt(Y+2)]>>2,N[W++]=T>>8&255,N[W++]=T&255),N}function M(E){return e[E>>18&63]+e[E>>12&63]+e[E>>6&63]+e[E&63]}function x(E,T,k){for(var B,C=[],N=T;N<k;N+=3)B=(E[N]<<16&16711680)+(E[N+1]<<8&65280)+(E[N+2]&255),C.push(M(B));return C.join("")}function S(E){for(var T,k=E.length,B=k%3,C=[],N=16383,W=0,H=k-B;W<H;W+=N)C.push(x(E,W,W+N>H?H:W+N));return B===1?(T=E[k-1],C.push(e[T>>2]+e[T<<4&63]+"==")):B===2&&(T=(E[k-2]<<8)+E[k-1],C.push(e[T>>10]+e[T>>4&63]+e[T<<2&63]+"=")),C.join("")}}),I1e=Dc(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=T1e();function r(x){let S=0;for(let k=0;k<x.length;k++)S+=x[k].byteLength;let E=new Uint8Array(S),T=0;E.set(new Uint8Array(x[0]),T),T+=x[0].byteLength;for(let k=1;k<x.length;k++)E.set(new Uint8Array(x[k]),T),T+=x[k].byteLength;return E}t.concatBuffers=r;function s(x){let S=v(x);return n(S)}t.b64UrlToString=s;function n(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=n;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function d(x){return g(h(x))}t.stringToB64Url=d;function v(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=v;function w(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=w;function g(x){return y(w(x))}t.bufferTob64Url=g;function y(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=y;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let S;return x.length%4==0?S=0:S=4-x.length%4,x.concat("=".repeat(S))}t.b64UrlDecode=M}),dKe=Dc(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=I1e(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let s=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),n=await this.driver.exportKey("jwk",s.privateKey);return{kty:n.kty,e:n.e,n:n.n,d:n.d,p:n.p,q:n.q,dp:n.dp,dq:n.dq,qi:n.qi}}async sign(s,n,{saltLength:h}={}){let d=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(s),n);return new Uint8Array(d)}async hash(s,n="SHA-256"){let h=await this.driver.digest(n,s);return new Uint8Array(h)}async verify(s,n,h){let d={kty:"RSA",e:"AQAB",n:s},v=await this.jwkToPublicCryptoKey(d),w=await this.driver.digest("SHA-256",n),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},v,h,n),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},v,h,n),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((v.algorithm.modulusLength-1)/8)-w.byteLength-2},v,h,n);return g||y||M}async jwkToCryptoKey(s){return this.driver.importKey("jwk",s,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(s){return this.driver.importKey("jwk",s,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let s=crypto?.subtle;return s===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(n=>typeof s[n]=="function")}async encrypt(s,n,h){let d=await this.driver.importKey("raw",typeof n=="string"?e.stringToBuffer(n):n,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},d,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=new Uint8Array(16);crypto.getRandomValues(w);let g=await this.driver.encrypt({name:"AES-CBC",iv:w},v,s);return e.concatBuffers([w,g])}async decrypt(s,n,h){let d=await this.driver.importKey("raw",typeof n=="string"?e.stringToBuffer(n):n,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},d,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=s.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:w},v,s.slice(16));return e.concatBuffers([g])}};t.default=r}),pKe=Dc(t=>{t.read=function(e,r,s,n,h){var d,v,w=h*8-n-1,g=(1<<w)-1,y=g>>1,M=-7,x=s?h-1:0,S=s?-1:1,E=e[r+x];for(x+=S,d=E&(1<<-M)-1,E>>=-M,M+=w;M>0;d=d*256+e[r+x],x+=S,M-=8);for(v=d&(1<<-M)-1,d>>=-M,M+=n;M>0;v=v*256+e[r+x],x+=S,M-=8);if(d===0)d=1-y;else{if(d===g)return v?NaN:(E?-1:1)*(1/0);v=v+Math.pow(2,n),d=d-y}return(E?-1:1)*v*Math.pow(2,d-n)},t.write=function(e,r,s,n,h,d){var v,w,g,y=d*8-h-1,M=(1<<y)-1,x=M>>1,S=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:d-1,T=n?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(w=isNaN(r)?1:0,v=M):(v=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-v))<1&&(v--,g*=2),v+x>=1?r+=S/g:r+=S*Math.pow(2,1-x),r*g>=2&&(v++,g/=2),v+x>=M?(w=0,v=M):v+x>=1?(w=(r*g-1)*Math.pow(2,h),v=v+x):(w=r*Math.pow(2,x-1)*Math.pow(2,h),v=0));h>=8;e[s+E]=w&255,E+=T,w/=256,h-=8);for(v=v<<h|w,y+=h;y>0;e[s+E]=v&255,E+=T,v/=256,y-=8);e[s+E-T]|=k*128}}),IL=Dc(t=>{"use strict";var e=T1e(),r=pKe(),s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=v,t.SlowBuffer=C,t.INSPECT_MAX_BYTES=50;var n=2147483647;t.kMaxLength=n,v.TYPED_ARRAY_SUPPORT=h(),!v.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 h(){try{let P=new Uint8Array(1),O={foo:function(){return 42}};return Object.setPrototypeOf(O,Uint8Array.prototype),Object.setPrototypeOf(P,O),P.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function d(P){if(P>n)throw new RangeError('The value "'+P+'" is invalid for option "size"');let O=new Uint8Array(P);return Object.setPrototypeOf(O,v.prototype),O}function v(P,O,$){if(typeof P=="number"){if(typeof O=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(P)}return w(P,O,$)}v.poolSize=8192;function w(P,O,$){if(typeof P=="string")return x(P,O);if(ArrayBuffer.isView(P))return E(P);if(P==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P);if(pt(P,ArrayBuffer)||P&&pt(P.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pt(P,SharedArrayBuffer)||P&&pt(P.buffer,SharedArrayBuffer)))return T(P,O,$);if(typeof P=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let Z=P.valueOf&&P.valueOf();if(Z!=null&&Z!==P)return v.from(Z,O,$);let te=k(P);if(te)return te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof P[Symbol.toPrimitive]=="function")return v.from(P[Symbol.toPrimitive]("string"),O,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P)}v.from=function(P,O,$){return w(P,O,$)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function g(P){if(typeof P!="number")throw new TypeError('"size" argument must be of type number');if(P<0)throw new RangeError('The value "'+P+'" is invalid for option "size"')}function y(P,O,$){return g(P),P<=0?d(P):O!==void 0?typeof $=="string"?d(P).fill(O,$):d(P).fill(O):d(P)}v.alloc=function(P,O,$){return y(P,O,$)};function M(P){return g(P),d(P<0?0:B(P)|0)}v.allocUnsafe=function(P){return M(P)},v.allocUnsafeSlow=function(P){return M(P)};function x(P,O){if((typeof O!="string"||O==="")&&(O="utf8"),!v.isEncoding(O))throw new TypeError("Unknown encoding: "+O);let $=N(P,O)|0,Z=d($),te=Z.write(P,O);return te!==$&&(Z=Z.slice(0,te)),Z}function S(P){let O=P.length<0?0:B(P.length)|0,$=d(O);for(let Z=0;Z<O;Z+=1)$[Z]=P[Z]&255;return $}function E(P){if(pt(P,Uint8Array)){let O=new Uint8Array(P);return T(O.buffer,O.byteOffset,O.byteLength)}return S(P)}function T(P,O,$){if(O<0||P.byteLength<O)throw new RangeError('"offset" is outside of buffer bounds');if(P.byteLength<O+($||0))throw new RangeError('"length" is outside of buffer bounds');let Z;return O===void 0&&$===void 0?Z=new Uint8Array(P):$===void 0?Z=new Uint8Array(P,O):Z=new Uint8Array(P,O,$),Object.setPrototypeOf(Z,v.prototype),Z}function k(P){if(v.isBuffer(P)){let O=B(P.length)|0,$=d(O);return $.length===0||P.copy($,0,0,O),$}if(P.length!==void 0)return typeof P.length!="number"||Me(P.length)?d(0):S(P);if(P.type==="Buffer"&&Array.isArray(P.data))return S(P.data)}function B(P){if(P>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return P|0}function C(P){return+P!=P&&(P=0),v.alloc(+P)}v.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==v.prototype},v.compare=function(P,O){if(pt(P,Uint8Array)&&(P=v.from(P,P.offset,P.byteLength)),pt(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),!v.isBuffer(P)||!v.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===O)return 0;let $=P.length,Z=O.length;for(let te=0,X=Math.min($,Z);te<X;++te)if(P[te]!==O[te]){$=P[te],Z=O[te];break}return $<Z?-1:Z<$?1:0},v.isEncoding=function(P){switch(String(P).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}},v.concat=function(P,O){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return v.alloc(0);let $;if(O===void 0)for(O=0,$=0;$<P.length;++$)O+=P[$].length;let Z=v.allocUnsafe(O),te=0;for($=0;$<P.length;++$){let X=P[$];if(pt(X,Uint8Array))te+X.length>Z.length?(v.isBuffer(X)||(X=v.from(X)),X.copy(Z,te)):Uint8Array.prototype.set.call(Z,X,te);else if(v.isBuffer(X))X.copy(Z,te);else throw new TypeError('"list" argument must be an Array of Buffers');te+=X.length}return Z};function N(P,O){if(v.isBuffer(P))return P.length;if(ArrayBuffer.isView(P)||pt(P,ArrayBuffer))return P.byteLength;if(typeof P!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof P);let $=P.length,Z=arguments.length>2&&arguments[2]===!0;if(!Z&&$===0)return 0;let te=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return ie(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return de(P).length;default:if(te)return Z?-1:ie(P).length;O=(""+O).toLowerCase(),te=!0}}v.byteLength=N;function W(P,O,$){let Z=!1;if((O===void 0||O<0)&&(O=0),O>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,O>>>=0,$<=O))return"";for(P||(P="utf8");;)switch(P){case"hex":return a(this,O,$);case"utf8":case"utf-8":return u(this,O,$);case"ascii":return _(this,O,$);case"latin1":case"binary":return c(this,O,$);case"base64":return f(this,O,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p(this,O,$);default:if(Z)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),Z=!0}}v.prototype._isBuffer=!0;function H(P,O,$){let Z=P[O];P[O]=P[$],P[$]=Z}v.prototype.swap16=function(){let P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<P;O+=2)H(this,O,O+1);return this},v.prototype.swap32=function(){let P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<P;O+=4)H(this,O,O+3),H(this,O+1,O+2);return this},v.prototype.swap64=function(){let P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<P;O+=8)H(this,O,O+7),H(this,O+1,O+6),H(this,O+2,O+5),H(this,O+3,O+4);return this},v.prototype.toString=function(){let P=this.length;return P===0?"":arguments.length===0?u(this,0,P):W.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(P){if(!v.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:v.compare(this,P)===0},v.prototype.inspect=function(){let P="",O=t.INSPECT_MAX_BYTES;return P=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(P+=" ... "),"<Buffer "+P+">"},s&&(v.prototype[s]=v.prototype.inspect),v.prototype.compare=function(P,O,$,Z,te){if(pt(P,Uint8Array)&&(P=v.from(P,P.offset,P.byteLength)),!v.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(O===void 0&&(O=0),$===void 0&&($=P?P.length:0),Z===void 0&&(Z=0),te===void 0&&(te=this.length),O<0||$>P.length||Z<0||te>this.length)throw new RangeError("out of range index");if(Z>=te&&O>=$)return 0;if(Z>=te)return-1;if(O>=$)return 1;if(O>>>=0,$>>>=0,Z>>>=0,te>>>=0,this===P)return 0;let X=te-Z,ae=$-O,qe=Math.min(X,ae),ce=this.slice(Z,te),ge=P.slice(O,$);for(let xe=0;xe<qe;++xe)if(ce[xe]!==ge[xe]){X=ce[xe],ae=ge[xe];break}return X<ae?-1:ae<X?1:0};function Y(P,O,$,Z,te){if(P.length===0)return-1;if(typeof $=="string"?(Z=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,Me($)&&($=te?0:P.length-1),$<0&&($=P.length+$),$>=P.length){if(te)return-1;$=P.length-1}else if($<0)if(te)$=0;else return-1;if(typeof O=="string"&&(O=v.from(O,Z)),v.isBuffer(O))return O.length===0?-1:U(P,O,$,Z,te);if(typeof O=="number")return O=O&255,typeof Uint8Array.prototype.indexOf=="function"?te?Uint8Array.prototype.indexOf.call(P,O,$):Uint8Array.prototype.lastIndexOf.call(P,O,$):U(P,[O],$,Z,te);throw new TypeError("val must be string, number or Buffer")}function U(P,O,$,Z,te){let X=1,ae=P.length,qe=O.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(P.length<2||O.length<2)return-1;X=2,ae/=2,qe/=2,$/=2}function ce(xe,ye){return X===1?xe[ye]:xe.readUInt16BE(ye*X)}let ge;if(te){let xe=-1;for(ge=$;ge<ae;ge++)if(ce(P,ge)===ce(O,xe===-1?0:ge-xe)){if(xe===-1&&(xe=ge),ge-xe+1===qe)return xe*X}else xe!==-1&&(ge-=ge-xe),xe=-1}else for($+qe>ae&&($=ae-qe),ge=$;ge>=0;ge--){let xe=!0;for(let ye=0;ye<qe;ye++)if(ce(P,ge+ye)!==ce(O,ye)){xe=!1;break}if(xe)return ge}return-1}v.prototype.includes=function(P,O,$){return this.indexOf(P,O,$)!==-1},v.prototype.indexOf=function(P,O,$){return Y(this,P,O,$,!0)},v.prototype.lastIndexOf=function(P,O,$){return Y(this,P,O,$,!1)};function j(P,O,$,Z){$=Number($)||0;let te=P.length-$;Z?(Z=Number(Z),Z>te&&(Z=te)):Z=te;let X=O.length;Z>X/2&&(Z=X/2);let ae;for(ae=0;ae<Z;++ae){let qe=parseInt(O.substr(ae*2,2),16);if(Me(qe))return ae;P[$+ae]=qe}return ae}function J(P,O,$,Z){return be(ie(O,P.length-$),P,$,Z)}function b(P,O,$,Z){return be(oe(O),P,$,Z)}function i(P,O,$,Z){return be(de(O),P,$,Z)}function o(P,O,$,Z){return be(Pe(O,P.length-$),P,$,Z)}v.prototype.write=function(P,O,$,Z){if(O===void 0)Z="utf8",$=this.length,O=0;else if($===void 0&&typeof O=="string")Z=O,$=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite($)?($=$>>>0,Z===void 0&&(Z="utf8")):(Z=$,$=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let te=this.length-O;if(($===void 0||$>te)&&($=te),P.length>0&&($<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");let X=!1;for(;;)switch(Z){case"hex":return j(this,P,O,$);case"utf8":case"utf-8":return J(this,P,O,$);case"ascii":case"latin1":case"binary":return b(this,P,O,$);case"base64":return i(this,P,O,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o(this,P,O,$);default:if(X)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),X=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(P,O,$){return O===0&&$===P.length?e.fromByteArray(P):e.fromByteArray(P.slice(O,$))}function u(P,O,$){$=Math.min(P.length,$);let Z=[],te=O;for(;te<$;){let X=P[te],ae=null,qe=X>239?4:X>223?3:X>191?2:1;if(te+qe<=$){let ce,ge,xe,ye;switch(qe){case 1:X<128&&(ae=X);break;case 2:ce=P[te+1],(ce&192)===128&&(ye=(X&31)<<6|ce&63,ye>127&&(ae=ye));break;case 3:ce=P[te+1],ge=P[te+2],(ce&192)===128&&(ge&192)===128&&(ye=(X&15)<<12|(ce&63)<<6|ge&63,ye>2047&&(ye<55296||ye>57343)&&(ae=ye));break;case 4:ce=P[te+1],ge=P[te+2],xe=P[te+3],(ce&192)===128&&(ge&192)===128&&(xe&192)===128&&(ye=(X&15)<<18|(ce&63)<<12|(ge&63)<<6|xe&63,ye>65535&&ye<1114112&&(ae=ye))}}ae===null?(ae=65533,qe=1):ae>65535&&(ae-=65536,Z.push(ae>>>10&1023|55296),ae=56320|ae&1023),Z.push(ae),te+=qe}return m(Z)}var l=4096;function m(P){let O=P.length;if(O<=l)return String.fromCharCode.apply(String,P);let $="",Z=0;for(;Z<O;)$+=String.fromCharCode.apply(String,P.slice(Z,Z+=l));return $}function _(P,O,$){let Z="";$=Math.min(P.length,$);for(let te=O;te<$;++te)Z+=String.fromCharCode(P[te]&127);return Z}function c(P,O,$){let Z="";$=Math.min(P.length,$);for(let te=O;te<$;++te)Z+=String.fromCharCode(P[te]);return Z}function a(P,O,$){let Z=P.length;(!O||O<0)&&(O=0),(!$||$<0||$>Z)&&($=Z);let te="";for(let X=O;X<$;++X)te+=Be[P[X]];return te}function p(P,O,$){let Z=P.slice(O,$),te="";for(let X=0;X<Z.length-1;X+=2)te+=String.fromCharCode(Z[X]+Z[X+1]*256);return te}v.prototype.slice=function(P,O){let $=this.length;P=~~P,O=O===void 0?$:~~O,P<0?(P+=$,P<0&&(P=0)):P>$&&(P=$),O<0?(O+=$,O<0&&(O=0)):O>$&&(O=$),O<P&&(O=P);let Z=this.subarray(P,O);return Object.setPrototypeOf(Z,v.prototype),Z};function R(P,O,$){if(P%1!==0||P<0)throw new RangeError("offset is not uint");if(P+O>$)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(P,O,$){P=P>>>0,O=O>>>0,$||R(P,O,this.length);let Z=this[P],te=1,X=0;for(;++X<O&&(te*=256);)Z+=this[P+X]*te;return Z},v.prototype.readUintBE=v.prototype.readUIntBE=function(P,O,$){P=P>>>0,O=O>>>0,$||R(P,O,this.length);let Z=this[P+--O],te=1;for(;O>0&&(te*=256);)Z+=this[P+--O]*te;return Z},v.prototype.readUint8=v.prototype.readUInt8=function(P,O){return P=P>>>0,O||R(P,1,this.length),this[P]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(P,O){return P=P>>>0,O||R(P,2,this.length),this[P]|this[P+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(P,O){return P=P>>>0,O||R(P,2,this.length),this[P]<<8|this[P+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(P,O){return P=P>>>0,O||R(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(P,O){return P=P>>>0,O||R(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},v.prototype.readBigUInt64LE=gt(function(P){P=P>>>0,K(P,"offset");let O=this[P],$=this[P+7];(O===void 0||$===void 0)&&G(P,this.length-8);let Z=O+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,te=this[++P]+this[++P]*2**8+this[++P]*2**16+$*2**24;return BigInt(Z)+(BigInt(te)<<BigInt(32))}),v.prototype.readBigUInt64BE=gt(function(P){P=P>>>0,K(P,"offset");let O=this[P],$=this[P+7];(O===void 0||$===void 0)&&G(P,this.length-8);let Z=O*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],te=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+$;return(BigInt(Z)<<BigInt(32))+BigInt(te)}),v.prototype.readIntLE=function(P,O,$){P=P>>>0,O=O>>>0,$||R(P,O,this.length);let Z=this[P],te=1,X=0;for(;++X<O&&(te*=256);)Z+=this[P+X]*te;return te*=128,Z>=te&&(Z-=Math.pow(2,8*O)),Z},v.prototype.readIntBE=function(P,O,$){P=P>>>0,O=O>>>0,$||R(P,O,this.length);let Z=O,te=1,X=this[P+--Z];for(;Z>0&&(te*=256);)X+=this[P+--Z]*te;return te*=128,X>=te&&(X-=Math.pow(2,8*O)),X},v.prototype.readInt8=function(P,O){return P=P>>>0,O||R(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},v.prototype.readInt16LE=function(P,O){P=P>>>0,O||R(P,2,this.length);let $=this[P]|this[P+1]<<8;return $&32768?$|4294901760:$},v.prototype.readInt16BE=function(P,O){P=P>>>0,O||R(P,2,this.length);let $=this[P+1]|this[P]<<8;return $&32768?$|4294901760:$},v.prototype.readInt32LE=function(P,O){return P=P>>>0,O||R(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},v.prototype.readInt32BE=function(P,O){return P=P>>>0,O||R(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},v.prototype.readBigInt64LE=gt(function(P){P=P>>>0,K(P,"offset");let O=this[P],$=this[P+7];(O===void 0||$===void 0)&&G(P,this.length-8);let Z=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+($<<24);return(BigInt(Z)<<BigInt(32))+BigInt(O+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),v.prototype.readBigInt64BE=gt(function(P){P=P>>>0,K(P,"offset");let O=this[P],$=this[P+7];(O===void 0||$===void 0)&&G(P,this.length-8);let Z=(O<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(Z)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+$)}),v.prototype.readFloatLE=function(P,O){return P=P>>>0,O||R(P,4,this.length),r.read(this,P,!0,23,4)},v.prototype.readFloatBE=function(P,O){return P=P>>>0,O||R(P,4,this.length),r.read(this,P,!1,23,4)},v.prototype.readDoubleLE=function(P,O){return P=P>>>0,O||R(P,8,this.length),r.read(this,P,!0,52,8)},v.prototype.readDoubleBE=function(P,O){return P=P>>>0,O||R(P,8,this.length),r.read(this,P,!1,52,8)};function A(P,O,$,Z,te,X){if(!v.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>te||O<X)throw new RangeError('"value" argument is out of bounds');if($+Z>P.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(P,O,$,Z){if(P=+P,O=O>>>0,$=$>>>0,!Z){let ae=Math.pow(2,8*$)-1;A(this,P,O,$,ae,0)}let te=1,X=0;for(this[O]=P&255;++X<$&&(te*=256);)this[O+X]=P/te&255;return O+$},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(P,O,$,Z){if(P=+P,O=O>>>0,$=$>>>0,!Z){let ae=Math.pow(2,8*$)-1;A(this,P,O,$,ae,0)}let te=$-1,X=1;for(this[O+te]=P&255;--te>=0&&(X*=256);)this[O+te]=P/X&255;return O+$},v.prototype.writeUint8=v.prototype.writeUInt8=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,1,255,0),this[O]=P&255,O+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,2,65535,0),this[O]=P&255,this[O+1]=P>>>8,O+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,2,65535,0),this[O]=P>>>8,this[O+1]=P&255,O+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,4,4294967295,0),this[O+3]=P>>>24,this[O+2]=P>>>16,this[O+1]=P>>>8,this[O]=P&255,O+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,4,4294967295,0),this[O]=P>>>24,this[O+1]=P>>>16,this[O+2]=P>>>8,this[O+3]=P&255,O+4};function I(P,O,$,Z,te){F(O,Z,te,P,$,7);let X=Number(O&BigInt(4294967295));P[$++]=X,X=X>>8,P[$++]=X,X=X>>8,P[$++]=X,X=X>>8,P[$++]=X;let ae=Number(O>>BigInt(32)&BigInt(4294967295));return P[$++]=ae,ae=ae>>8,P[$++]=ae,ae=ae>>8,P[$++]=ae,ae=ae>>8,P[$++]=ae,$}function D(P,O,$,Z,te){F(O,Z,te,P,$,7);let X=Number(O&BigInt(4294967295));P[$+7]=X,X=X>>8,P[$+6]=X,X=X>>8,P[$+5]=X,X=X>>8,P[$+4]=X;let ae=Number(O>>BigInt(32)&BigInt(4294967295));return P[$+3]=ae,ae=ae>>8,P[$+2]=ae,ae=ae>>8,P[$+1]=ae,ae=ae>>8,P[$]=ae,$+8}v.prototype.writeBigUInt64LE=gt(function(P,O=0){return I(this,P,O,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=gt(function(P,O=0){return D(this,P,O,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(P,O,$,Z){if(P=+P,O=O>>>0,!Z){let qe=Math.pow(2,8*$-1);A(this,P,O,$,qe-1,-qe)}let te=0,X=1,ae=0;for(this[O]=P&255;++te<$&&(X*=256);)P<0&&ae===0&&this[O+te-1]!==0&&(ae=1),this[O+te]=(P/X>>0)-ae&255;return O+$},v.prototype.writeIntBE=function(P,O,$,Z){if(P=+P,O=O>>>0,!Z){let qe=Math.pow(2,8*$-1);A(this,P,O,$,qe-1,-qe)}let te=$-1,X=1,ae=0;for(this[O+te]=P&255;--te>=0&&(X*=256);)P<0&&ae===0&&this[O+te+1]!==0&&(ae=1),this[O+te]=(P/X>>0)-ae&255;return O+$},v.prototype.writeInt8=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,1,127,-128),P<0&&(P=255+P+1),this[O]=P&255,O+1},v.prototype.writeInt16LE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,2,32767,-32768),this[O]=P&255,this[O+1]=P>>>8,O+2},v.prototype.writeInt16BE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,2,32767,-32768),this[O]=P>>>8,this[O+1]=P&255,O+2},v.prototype.writeInt32LE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,4,2147483647,-2147483648),this[O]=P&255,this[O+1]=P>>>8,this[O+2]=P>>>16,this[O+3]=P>>>24,O+4},v.prototype.writeInt32BE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[O]=P>>>24,this[O+1]=P>>>16,this[O+2]=P>>>8,this[O+3]=P&255,O+4},v.prototype.writeBigInt64LE=gt(function(P,O=0){return I(this,P,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=gt(function(P,O=0){return D(this,P,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function z(P,O,$,Z,te,X){if($+Z>P.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function re(P,O,$,Z,te){return O=+O,$=$>>>0,te||z(P,O,$,4,34028234663852886e22,-34028234663852886e22),r.write(P,O,$,Z,23,4),$+4}v.prototype.writeFloatLE=function(P,O,$){return re(this,P,O,!0,$)},v.prototype.writeFloatBE=function(P,O,$){return re(this,P,O,!1,$)};function Q(P,O,$,Z,te){return O=+O,$=$>>>0,te||z(P,O,$,8,17976931348623157e292,-17976931348623157e292),r.write(P,O,$,Z,52,8),$+8}v.prototype.writeDoubleLE=function(P,O,$){return Q(this,P,O,!0,$)},v.prototype.writeDoubleBE=function(P,O,$){return Q(this,P,O,!1,$)},v.prototype.copy=function(P,O,$,Z){if(!v.isBuffer(P))throw new TypeError("argument should be a Buffer");if($||($=0),!Z&&Z!==0&&(Z=this.length),O>=P.length&&(O=P.length),O||(O=0),Z>0&&Z<$&&(Z=$),Z===$||P.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("Index out of range");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),P.length-O<Z-$&&(Z=P.length-O+$);let te=Z-$;return this===P&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,$,Z):Uint8Array.prototype.set.call(P,this.subarray($,Z),O),te},v.prototype.fill=function(P,O,$,Z){if(typeof P=="string"){if(typeof O=="string"?(Z=O,O=0,$=this.length):typeof $=="string"&&(Z=$,$=this.length),Z!==void 0&&typeof Z!="string")throw new TypeError("encoding must be a string");if(typeof Z=="string"&&!v.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);if(P.length===1){let X=P.charCodeAt(0);(Z==="utf8"&&X<128||Z==="latin1")&&(P=X)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(O<0||this.length<O||this.length<$)throw new RangeError("Out of range index");if($<=O)return this;O=O>>>0,$=$===void 0?this.length:$>>>0,P||(P=0);let te;if(typeof P=="number")for(te=O;te<$;++te)this[te]=P;else{let X=v.isBuffer(P)?P:v.from(P,Z),ae=X.length;if(ae===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(te=0;te<$-O;++te)this[te+O]=X[te%ae]}return this};var L={};function q(P,O,$){L[P]=class extends ${constructor(){super(),Object.defineProperty(this,"message",{value:O.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${P}]`,this.stack,delete this.name}get code(){return P}set code(Z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Z,writable:!0})}toString(){return`${this.name} [${P}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(P){return P?`${P} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(P,O){return`The "${P}" argument must be of type number. Received type ${typeof O}`},TypeError),q("ERR_OUT_OF_RANGE",function(P,O,$){let Z=`The value of "${P}" is out of range.`,te=$;return Number.isInteger($)&&Math.abs($)>2**32?te=he(String($)):typeof $=="bigint"&&(te=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(te=he(te)),te+="n"),Z+=` It must be ${O}. Received ${te}`,Z},RangeError);function he(P){let O="",$=P.length,Z=P[0]==="-"?1:0;for(;$>=Z+4;$-=3)O=`_${P.slice($-3,$)}${O}`;return`${P.slice(0,$)}${O}`}function ee(P,O,$){K(O,"offset"),(P[O]===void 0||P[O+$]===void 0)&&G(O,P.length-($+1))}function F(P,O,$,Z,te,X){if(P>$||P<O){let ae=typeof O=="bigint"?"n":"",qe;throw X>3?O===0||O===BigInt(0)?qe=`>= 0${ae} and < 2${ae} ** ${(X+1)*8}${ae}`:qe=`>= -(2${ae} ** ${(X+1)*8-1}${ae}) and < 2 ** ${(X+1)*8-1}${ae}`:qe=`>= ${O}${ae} and <= ${$}${ae}`,new L.ERR_OUT_OF_RANGE("value",qe,P)}ee(Z,te,X)}function K(P,O){if(typeof P!="number")throw new L.ERR_INVALID_ARG_TYPE(O,"number",P)}function G(P,O,$){throw Math.floor(P)!==P?(K(P,$),new L.ERR_OUT_OF_RANGE($||"offset","an integer",P)):O<0?new L.ERR_BUFFER_OUT_OF_BOUNDS:new L.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${O}`,P)}var ne=/[^+/0-9A-Za-z-_]/g;function Te(P){if(P=P.split("=")[0],P=P.trim().replace(ne,""),P.length<2)return"";for(;P.length%4!==0;)P=P+"=";return P}function ie(P,O){O=O||1/0;let $,Z=P.length,te=null,X=[];for(let ae=0;ae<Z;++ae){if($=P.charCodeAt(ae),$>55295&&$<57344){if(!te){if($>56319){(O-=3)>-1&&X.push(239,191,189);continue}else if(ae+1===Z){(O-=3)>-1&&X.push(239,191,189);continue}te=$;continue}if($<56320){(O-=3)>-1&&X.push(239,191,189),te=$;continue}$=(te-55296<<10|$-56320)+65536}else te&&(O-=3)>-1&&X.push(239,191,189);if(te=null,$<128){if((O-=1)<0)break;X.push($)}else if($<2048){if((O-=2)<0)break;X.push($>>6|192,$&63|128)}else if($<65536){if((O-=3)<0)break;X.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((O-=4)<0)break;X.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return X}function oe(P){let O=[];for(let $=0;$<P.length;++$)O.push(P.charCodeAt($)&255);return O}function Pe(P,O){let $,Z,te,X=[];for(let ae=0;ae<P.length&&!((O-=2)<0);++ae)$=P.charCodeAt(ae),Z=$>>8,te=$%256,X.push(te),X.push(Z);return X}function de(P){return e.toByteArray(Te(P))}function be(P,O,$,Z){let te;for(te=0;te<Z&&!(te+$>=O.length||te>=P.length);++te)O[te+$]=P[te];return te}function pt(P,O){return P instanceof O||P!=null&&P.constructor!=null&&P.constructor.name!=null&&P.constructor.name===O.name}function Me(P){return P!==P}var Be=function(){let P="0123456789abcdef",O=new Array(256);for(let $=0;$<16;++$){let Z=$*16;for(let te=0;te<16;++te)O[Z+te]=P[$]+P[te]}return O}();function gt(P){return typeof BigInt>"u"?V:P}function V(){throw new Error("BigInt not supported")}}),vKe=Dc((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:IL().Buffer,Crypto:window.crypto}):e.exports={Buffer:IL().Buffer,Crypto:crypto}}),k1e={};uKe(k1e,{AVSCTap:()=>j6,ArweaveSigner:()=>tD,DataItem:()=>L6,MAX_TAG_BYTES:()=>F_,MIN_BINARY_SIZE:()=>nD,SIG_CONFIG:()=>Eg,SignatureConfig:()=>uu,Signer:()=>B1e,createData:()=>C1e,deserializeTags:()=>B_,indexToType:()=>rD,serializeTags:()=>iD,tagsExceedLimit:()=>N1e});var B1e=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,s){throw new Error("You must implement verify method on child")}},mKe=K1(eD(),1),uh=K1(I1e(),1);async function P1e(t){if(Array.isArray(t)){let n=(0,uh.concatBuffers)([(0,uh.stringToBuffer)("list"),(0,uh.stringToBuffer)(t.length.toString())]);return await O1e(t,await Nc().hash(n,"SHA-384"))}let e=t,r=(0,uh.concatBuffers)([(0,uh.stringToBuffer)("blob"),(0,uh.stringToBuffer)(e.byteLength.toString())]),s=(0,uh.concatBuffers)([await Nc().hash(r,"SHA-384"),await Nc().hash(e,"SHA-384")]);return await Nc().hash(s,"SHA-384")}async function O1e(t,e){if(t.length<1)return e;let r=(0,uh.concatBuffers)([e,await P1e(t[0])]),s=await Nc().hash(r,"SHA-384");return await O1e(t.slice(1),s)}var aL=K1(dKe(),1),gKe=aL.default.default?aL.default.default:aL.default,yKe=class extends gKe{getPublicKey(t){throw new Error("Unimplemented")}},bKe;function Nc(){return bKe??=new yKe}var uu;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(uu||(uu={}));var Eg={[uu.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[uu.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[uu.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[uu.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[uu.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[uu.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[uu.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},tD=class{signatureType=1;ownerLength=Eg[1].pubLength;signatureLength=Eg[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return mKe.default.toBuffer(this.pk)}sign(t){return Nc().sign(this.jwk,t)}static async verify(t,e,r){return await Nc().verify(t,e,r)}},rD={1:tD},bl=K1(eD(),1);async function kL(t){return P1e([(0,uh.stringToBuffer)("dataitem"),(0,uh.stringToBuffer)("1"),(0,uh.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function wKe(t,e){let r=await kL(t),s=await e.sign(r),n=await Nc().hash(s);return{signature:Re.from(s),id:Re.from(n)}}async function _Ke(t,e){let{signature:r,id:s}=await wKe(t,e);return t.getRaw().set(r,2),s}var j6=class{buf;pos;constructor(t=Re.alloc(F_),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let s=t[r];if(s?.name===void 0||s?.value===void 0)throw new Error(`Invalid tag format for ${s}, expected {name:string, value: string}`);this.writeString(s.name),this.writeString(s.value)}this.writeLong(0)}toBuffer(){let t=Re.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,s;if(t>=-1073741824&&t<1073741824){s=t>=0?t<<1:~t<<1|1;do e[this.pos]=s&127,s>>=7;while(s&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=Re.byteLength(t),r=this.buf;this.writeLong(e);let s=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let n,h,d,v;for(n=0,h=e;n<h;n++)d=t.charCodeAt(n),d<128?r[s++]=d:d<2048?(r[s++]=d>>6|192,r[s++]=d&63|128):(d&64512)===55296&&((v=t.charCodeAt(n+1))&64512)===56320?(d=65536+((d&1023)<<10)+(v&1023),n++,r[s++]=d>>18|240,r[s++]=d>>12&63|128,r[s++]=d>>6&63|128,r[s++]=d&63|128):(r[s++]=d>>12|224,r[s++]=d>>6&63|128,r[s++]=d&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,s,n,h,d;do s=r[this.pos++],n=s&128,t|=(s&127)<<e,e+=7;while(n&&e<28);if(n){h=t,d=268435456;do s=r[this.pos++],h+=(s&127)*d,d*=128;while(s&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),s=this.readString();t.push({name:r,value:s})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function iD(t){let e=new j6;return e.writeTags(t),e.toBuffer()}function N1e(t){let e=new j6;return e.writeTags(t),e.tagsExceedLimit()}function B_(t){return new j6(t).readTags()}function yd(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function MKe(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let s=t&255;e[r]=s,t=(t-s)/256}return Uint8Array.from(e)}function Yde(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let s=t&255;e[r]=s,t=(t-s)/256}return Uint8Array.from(e)}var xKe=K1(vKe(),1),ag=K1(IL(),1),F_=4096,nD=80,L6=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=yd(this.binary.subarray(0,2));if(uu?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return L6.verify(this.binary)}get id(){return(async()=>bl.default.encode(await this.rawId))()}set id(t){this._id=bl.default.toBuffer(t)}get rawId(){return(async()=>ag.Buffer.from(await xKe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return bl.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Eg[this.signatureType].sigLength}get owner(){return bl.default.encode(this.rawOwner)}get ownerLength(){return Eg[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):ag.Buffer.alloc(0)}get target(){return bl.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):ag.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=yd(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(yd(this.binary.subarray(t,t+8))==0)return[];let e=yd(this.binary.subarray(t+8,t+16));return B_(ag.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:bl.default.encode(t.name),value:bl.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yd(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yd(e),s=t+16+r;return this.binary.subarray(s,this.binary.length)}get data(){return bl.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await _Ke(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=ag.Buffer.from(await Nc().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:bl.default.encode(t.name),value:bl.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<nD)return!1;let e=new L6(t),r=e.signatureType,s=e.getTagsStart(),n=yd(t.subarray(s,s+8)),h=t.subarray(s+8,s+16),d=yd(h);if(d>F_)return!1;if(n>0)try{if(B_(ag.Buffer.from(t.subarray(s+16,s+16+d))).length!==n)return!1}catch{return!1}let v=rD[r],w=await kL(e);return await v.verify(e.rawOwner,w,e.rawSignature)}async getSignatureData(){return kL(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),s=this.binary[r]==1;return r+=s?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},SKe=K1(eD(),1);function C1e(t,e,r){let s=e.publicKey,n=r?.target?SKe.default.toBuffer(r.target):null,h=1+(n?.byteLength??0),d=r?.anchor?Re.from(r.anchor):null,v=1+(d?.byteLength??0),w=(r?.tags?.length??0)>0?iD(r.tags):null,g=16+(w?w.byteLength:0),y=Re.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+v+g+M,S=Re.alloc(x);if(S.set(MKe(e.signatureType),0),S.set(new Uint8Array(e.signatureLength).fill(0),2),s.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${s.byteLength}`);S.set(s,2+e.signatureLength);let E=2+e.signatureLength+e.ownerLength;if(S[E]=n?1:0,n){if(n.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${n.byteLength}`);S.set(n,E+1)}let T=E+h,k=T+1;if(S[T]=d?1:0,d){if(k+=d.byteLength,d.byteLength!==32)throw new Error("Anchor must be 32 bytes");S.set(d,T+1)}S.set(Yde(r?.tags?.length??0),k);let B=Yde(w?.byteLength??0);S.set(B,k+8),w&&S.set(w,k+16);let C=k+g;return S.set(y,C),new L6(S)}var aD={...k1e};globalThis.arbundles??=aD;var EKe=aD,AKe=aD;globalThis.Buffer||(globalThis.Buffer=A1e.Buffer);var{DataItem:RKe}=R1e;function TKe(t){return async({data:r,tags:s,target:n,anchor:h,createDataItem:d=v=>new RKe(v)})=>{let v=await t.signDataItem({data:r,tags:s,target:n,anchor:h}),w=d(A1e.Buffer.from(v));return{id:await w.id,raw:await w.getRaw()}}}var IKe=globalThis.GATEWAY_URL||void 0,kKe=globalThis.MU_URL||void 0,BKe=globalThis.CU_URL||void 0,PKe=globalThis.GRAPHQL_URL||void 0,{result:Txt,results:Ixt,message:kxt,spawn:Bxt,monitor:Pxt,unmonitor:Oxt,dryrun:Nxt,assign:Cxt}=Gs({GATEWAY_URL:IKe,MU_URL:kKe,CU_URL:BKe,GRAPHQL_URL:PKe}),$1e=E1e.createDataItemSigner;se();ue();fe();var Ive=Ni(Tve(),1),J_=Ive.default.init({host:"arweave.net",port:443,protocol:"https"});se();ue();fe();se();ue();fe();var mh=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},kve=class extends mh{},Bve=class extends mh{},Pve=class extends mh{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},Ove=class extends mh{},Y_=class extends mh{},Nve=class extends mh{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Rl=class extends mh{constructor(){super("Invalid contract configuration")}},Cve=class extends mh{constructor(){super("Invalid process configuration")}},$ve=class extends mh{};se();ue();fe();var Sh=Ni(H3e(),1);se();ue();fe();var Jg="3.11.0-alpha.9";var Lo=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,Sh.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:Jg},format:Sh.format.combine(Sh.format.timestamp(),Sh.format.json()),transports:[new Sh.transports.Console({format:Sh.format.combine(Sh.format.timestamp(),Sh.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};se();ue();fe();se();ue();fe();var W3e=t=>{let e=Object.entries(t).sort(([r,s],[n,h])=>r==="@"?-1:n==="@"?1:"priority"in s&&!("priority"in h)?-1:!("priority"in s)&&"priority"in h?1:s.priority!==void 0&&h.priority!==void 0?s.priority===h.priority?r<n?-1:r>n?1:0:s.priority-h.priority:r<n?-1:r>n?1:0);return Object.fromEntries(e.map(([r,s],n)=>[r,{...s,index:n}]))};se();ue();fe();function Ol(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}se();ue();fe();se();ue();fe();se();ue();fe();Df();var K3e="+",Z3e="/",V3e="-",G3e="_",J3e="=";function Dst(t){let e=t.length%4;return e&&(t+=J3e.repeat(4-e)),t.replaceAll(V3e,K3e).replaceAll(G3e,Z3e)}function Ust(t){return t.replaceAll(K3e,V3e).replaceAll(Z3e,G3e).replaceAll(J3e,"")}function fCt(t){let e=Dst(t);return Re.from(e,"base64")}function bu(t){let e=t.toString("base64");return Ust(e)}function uCt(t){return bu(Fo("sha256").update(Uint8Array.from(t)).digest())}function Y3e(t=32){let e=CP(t);return Array.from(e,r=>r.toString(16).padStart(2,"0")).join("").slice(0,t)}se();ue();fe();se();ue();fe();function cF(t){try{return JSON.parse(t)}catch{return t}}se();ue();fe();se();ue();fe();var pF=Ni(Q3e(),1);se();ue();fe();var jst=Object.defineProperty,zst=(t,e,r)=>e in t?jst(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$3=(t,e,r)=>(zst(t,typeof e!="symbol"?e+"":e,r),r),vF=class{constructor(e){$3(this,"value"),$3(this,"next"),this.value=e}},mF=class{constructor(){$3(this,"head"),$3(this,"tail"),$3(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(e){let r=new vF(e);return this.head&&this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),this._size++,this._size}pop(){if(!this.head)return;let e=this.head;return this.head=this.head.next,this._size--,e.value}get size(){return this._size}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}};function ewe(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let e=new mF,r=0,s=()=>{r--,e.size>0&&e.pop()()},n=async(v,w,g)=>{r++;let y=(async()=>v(...g))();w(y);try{await y}catch{}s()},h=(v,w,g)=>{e.push(n.bind(null,v,w,g)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.pop()()))()},d=(v,...w)=>new Promise(g=>{h(v,g,w)});return Object.defineProperties(d,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),d}se();ue();fe();var L3=class{static init(e){return e!==void 0&&"signer"in e?new gF(e):new oM(e)}},oM=class{process;constructor(e){if(e===void 0||Object.keys(e).length===0)this.process=new Zn({processId:ig});else if(Cd(e))this.process=e.process;else if($d(e))this.process=new Zn({processId:e.processId});else throw new Rl}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},gF=class extends oM{signer;constructor({signer:e,...r}){super(r),this.signer=Nd(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};se();ue();fe();se();ue();fe();var Hst="https://faucet.ario.permaweb.services";function bF({arioInstance:t,faucetApiUrl:e=Hst}){let r=new yF({faucetUrl:e,processId:t.process.processId});return new Proxy(t,{get(n,h){if(h==="faucet")return r;if(h in n){let d=n[h];return typeof d=="function"?d.bind(n):d}}})}var yF=class{faucetUrl;processId;constructor({faucetUrl:e,processId:r}){this.faucetUrl=e,this.processId=r}async captchaUrl(){let e=await fetch(`${this.faucetUrl}/api/captcha/url?process-id=${this.processId}`,{method:"GET"});if(!e.ok){let s=await e.json().catch(()=>({error:e.statusText}));throw new Error(s.error)}return await e.json()}async claimWithCaptchaResponse({captchaResponse:e,recipient:r,quantity:s}){let n=await fetch(`${this.faucetUrl}/api/claim/sync`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({processId:this.processId,recipient:r,quantity:s,captchaResponse:e})});if(!n.ok){let d=await n.json().catch(()=>({error:n.statusText}));throw new Error(d.error)}return await n.json()}async requestAuthToken({captchaResponse:e}){let r=await fetch(`${this.faucetUrl}/api/captcha/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({processId:this.processId,captchaResponse:e})});if(!r.ok){let n=await r.json().catch(()=>({error:r.statusText}));throw new Error(n.error)}return await r.json()}async claimWithAuthToken({authToken:e,recipient:r,quantity:s}){let n=await fetch(`${this.faucetUrl}/api/claim/async`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({recipient:r,qty:s,processId:this.processId})});if(!n.ok){let d=await n.json().catch(()=>({error:n.statusText}));throw new Error(d.error)}return await n.json()}async verifyAuthToken({authToken:e}){let r=await fetch(`${this.faucetUrl}/api/token/verify?process-id=${this.processId}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});if(!r.ok){let n=await r.json().catch(()=>({error:r.statusText}));throw new Error(n.error)}return await r.json()}};se();ue();fe();se();ue();fe();se();ue();fe();var go=[];for(sM=0;sM<256;++sM)go.push((sM+256).toString(16).slice(1));var sM;function twe(t,e=0){return(go[t[e+0]]+go[t[e+1]]+go[t[e+2]]+go[t[e+3]]+"-"+go[t[e+4]]+go[t[e+5]]+"-"+go[t[e+6]]+go[t[e+7]]+"-"+go[t[e+8]]+go[t[e+9]]+"-"+go[t[e+10]]+go[t[e+11]]+go[t[e+12]]+go[t[e+13]]+go[t[e+14]]+go[t[e+15]]).toLowerCase()}se();ue();fe();var fM,Wst=new Uint8Array(16);function wF(){if(!fM&&(fM=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!fM))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fM(Wst)}se();ue();fe();se();ue();fe();var Kst=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),_F={randomUUID:Kst};function Zst(t,e,r){if(_F.randomUUID&&!e&&!t)return _F.randomUUID();t=t||{};var s=t.random||(t.rng||wF)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){r=r||0;for(var n=0;n<16;++n)e[r+n]=s[n];return e}return twe(s)}var MF=Zst;se();ue();fe();var xF=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},SF=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("ARIOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMARIO(){return new D3(Math.floor(this.value*V$))}toString(){return`${this.value}`}},D3=class t extends xF{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toARIO(){return new SF(this.valueOf()/V$)}};se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();function U3(t,e){return function(){return t.apply(e,arguments)}}var{toString:Vst}=Object.prototype,{getPrototypeOf:AF}=Object,hM=(t=>e=>{let r=Vst.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Eh=t=>(t=t.toLowerCase(),e=>hM(e)===t),lM=t=>e=>typeof e===t,{isArray:Yg}=Array,q3=lM("undefined");function Gst(t){return t!==null&&!q3(t)&&t.constructor!==null&&!q3(t.constructor)&&rf(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var iwe=Eh("ArrayBuffer");function Jst(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&iwe(t.buffer),e}var Yst=lM("string"),rf=lM("function"),nwe=lM("number"),cM=t=>t!==null&&typeof t=="object",Xst=t=>t===!0||t===!1,uM=t=>{if(hM(t)!=="object")return!1;let e=AF(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Qst=Eh("Date"),eft=Eh("File"),tft=Eh("Blob"),rft=Eh("FileList"),ift=t=>cM(t)&&rf(t.pipe),nft=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||rf(t.append)&&((e=hM(t))==="formdata"||e==="object"&&rf(t.toString)&&t.toString()==="[object FormData]"))},aft=Eh("URLSearchParams"),[oft,sft,fft,uft]=["ReadableStream","Request","Response","Headers"].map(Eh),hft=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function F3(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,n;if(typeof t!="object"&&(t=[t]),Yg(t))for(s=0,n=t.length;s<n;s++)e.call(null,t[s],s,t);else{let h=r?Object.getOwnPropertyNames(t):Object.keys(t),d=h.length,v;for(s=0;s<d;s++)v=h[s],e.call(null,t[v],v,t)}}function awe(t,e){e=e.toLowerCase();let r=Object.keys(t),s=r.length,n;for(;s-- >0;)if(n=r[s],e===n.toLowerCase())return n;return null}var cv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,owe=t=>!q3(t)&&t!==cv;function EF(){let{caseless:t}=owe(this)&&this||{},e={},r=(s,n)=>{let h=t&&awe(e,n)||n;uM(e[h])&&uM(s)?e[h]=EF(e[h],s):uM(s)?e[h]=EF({},s):Yg(s)?e[h]=s.slice():e[h]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&F3(arguments[s],r);return e}var lft=(t,e,r,{allOwnKeys:s}={})=>(F3(e,(n,h)=>{r&&rf(n)?t[h]=U3(n,r):t[h]=n},{allOwnKeys:s}),t),cft=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),dft=(t,e,r,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},pft=(t,e,r,s)=>{let n,h,d,v={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),h=n.length;h-- >0;)d=n[h],(!s||s(d,t,e))&&!v[d]&&(e[d]=t[d],v[d]=!0);t=r!==!1&&AF(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},vft=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let s=t.indexOf(e,r);return s!==-1&&s===r},mft=t=>{if(!t)return null;if(Yg(t))return t;let e=t.length;if(!nwe(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},gft=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&AF(Uint8Array)),yft=(t,e)=>{let s=(t&&t[Symbol.iterator]).call(t),n;for(;(n=s.next())&&!n.done;){let h=n.value;e.call(t,h[0],h[1])}},bft=(t,e)=>{let r,s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},wft=Eh("HTMLFormElement"),_ft=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,s,n){return s.toUpperCase()+n}),rwe=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Mft=Eh("RegExp"),swe=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),s={};F3(r,(n,h)=>{let d;(d=e(n,h,t))!==!1&&(s[h]=d||n)}),Object.defineProperties(t,s)},xft=t=>{swe(t,(e,r)=>{if(rf(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let s=t[r];if(rf(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Sft=(t,e)=>{let r={},s=n=>{n.forEach(h=>{r[h]=!0})};return Yg(t)?s(t):s(String(t).split(e)),r},Eft=()=>{},Aft=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Rft(t){return!!(t&&rf(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var Tft=t=>{let e=new Array(10),r=(s,n)=>{if(cM(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[n]=s;let h=Yg(s)?[]:{};return F3(s,(d,v)=>{let w=r(d,n+1);!q3(w)&&(h[v]=w)}),e[n]=void 0,h}}return s};return r(t,0)},Ift=Eh("AsyncFunction"),kft=t=>t&&(cM(t)||rf(t))&&rf(t.then)&&rf(t.catch),fwe=((t,e)=>t?setImmediate:e?((r,s)=>(cv.addEventListener("message",({source:n,data:h})=>{n===cv&&h===r&&s.length&&s.shift()()},!1),n=>{s.push(n),cv.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",rf(cv.postMessage)),Bft=typeof queueMicrotask<"u"?queueMicrotask.bind(cv):typeof Ce<"u"&&Ce.nextTick||fwe,Tt={isArray:Yg,isArrayBuffer:iwe,isBuffer:Gst,isFormData:nft,isArrayBufferView:Jst,isString:Yst,isNumber:nwe,isBoolean:Xst,isObject:cM,isPlainObject:uM,isReadableStream:oft,isRequest:sft,isResponse:fft,isHeaders:uft,isUndefined:q3,isDate:Qst,isFile:eft,isBlob:tft,isRegExp:Mft,isFunction:rf,isStream:ift,isURLSearchParams:aft,isTypedArray:gft,isFileList:rft,forEach:F3,merge:EF,extend:lft,trim:hft,stripBOM:cft,inherits:dft,toFlatObject:pft,kindOf:hM,kindOfTest:Eh,endsWith:vft,toArray:mft,forEachEntry:yft,matchAll:bft,isHTMLForm:wft,hasOwnProperty:rwe,hasOwnProp:rwe,reduceDescriptors:swe,freezeMethods:xft,toObjectSet:Sft,toCamelCase:_ft,noop:Eft,toFiniteNumber:Aft,findKey:awe,global:cv,isContextDefined:owe,isSpecCompliantForm:Rft,toJSONObject:Tft,isAsyncFn:Ift,isThenable:kft,setImmediate:fwe,asap:Bft};se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();function Xg(t,e,r,s,n){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),r&&(this.config=r),s&&(this.request=s),n&&(this.response=n,this.status=n.status?n.status:null)}Tt.inherits(Xg,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:Tt.toJSONObject(this.config),code:this.code,status:this.status}}});var uwe=Xg.prototype,hwe={};["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=>{hwe[t]={value:t}});Object.defineProperties(Xg,hwe);Object.defineProperty(uwe,"isAxiosError",{value:!0});Xg.from=(t,e,r,s,n,h)=>{let d=Object.create(uwe);return Tt.toFlatObject(t,d,function(w){return w!==Error.prototype},v=>v!=="isAxiosError"),Xg.call(d,t.message,e,r,s,n),d.cause=t,d.name=t.name,h&&Object.assign(d,h),d};var Fr=Xg;se();ue();fe();var dM=null;function RF(t){return Tt.isPlainObject(t)||Tt.isArray(t)}function cwe(t){return Tt.endsWith(t,"[]")?t.slice(0,-2):t}function lwe(t,e,r){return t?t.concat(e).map(function(n,h){return n=cwe(n),!r&&h?"["+n+"]":n}).join(r?".":""):e}function Pft(t){return Tt.isArray(t)&&!t.some(RF)}var Oft=Tt.toFlatObject(Tt,{},null,function(e){return/^is[A-Z]/.test(e)});function Nft(t,e,r){if(!Tt.isObject(t))throw new TypeError("target must be an object");e=e||new(dM||FormData),r=Tt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,k){return!Tt.isUndefined(k[T])});let s=r.metaTokens,n=r.visitor||y,h=r.dots,d=r.indexes,w=(r.Blob||typeof Blob<"u"&&Blob)&&Tt.isSpecCompliantForm(e);if(!Tt.isFunction(n))throw new TypeError("visitor must be a function");function g(E){if(E===null)return"";if(Tt.isDate(E))return E.toISOString();if(!w&&Tt.isBlob(E))throw new Fr("Blob is not supported. Use a Buffer instead.");return Tt.isArrayBuffer(E)||Tt.isTypedArray(E)?w&&typeof Blob=="function"?new Blob([E]):Re.from(E):E}function y(E,T,k){let B=E;if(E&&!k&&typeof E=="object"){if(Tt.endsWith(T,"{}"))T=s?T:T.slice(0,-2),E=JSON.stringify(E);else if(Tt.isArray(E)&&Pft(E)||(Tt.isFileList(E)||Tt.endsWith(T,"[]"))&&(B=Tt.toArray(E)))return T=cwe(T),B.forEach(function(N,W){!(Tt.isUndefined(N)||N===null)&&e.append(d===!0?lwe([T],W,h):d===null?T:T+"[]",g(N))}),!1}return RF(E)?!0:(e.append(lwe(k,T,h),g(E)),!1)}let M=[],x=Object.assign(Oft,{defaultVisitor:y,convertValue:g,isVisitable:RF});function S(E,T){if(!Tt.isUndefined(E)){if(M.indexOf(E)!==-1)throw Error("Circular reference detected in "+T.join("."));M.push(E),Tt.forEach(E,function(B,C){(!(Tt.isUndefined(B)||B===null)&&n.call(e,B,Tt.isString(C)?C.trim():C,T,x))===!0&&S(B,T?T.concat(C):[C])}),M.pop()}}if(!Tt.isObject(t))throw new TypeError("data must be an object");return S(t),e}var Ld=Nft;function dwe(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function pwe(t,e){this._pairs=[],t&&Ld(t,this,e)}var vwe=pwe.prototype;vwe.append=function(e,r){this._pairs.push([e,r])};vwe.toString=function(e){let r=e?function(s){return e.call(this,s,dwe)}:dwe;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var pM=pwe;function Cft(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function j3(t,e,r){if(!e)return t;let s=r&&r.encode||Cft;Tt.isFunction(r)&&(r={serialize:r});let n=r&&r.serialize,h;if(n?h=n(e,r):h=Tt.isURLSearchParams(e)?e.toString():new pM(e,r).toString(s),h){let d=t.indexOf("#");d!==-1&&(t=t.slice(0,d)),t+=(t.indexOf("?")===-1?"?":"&")+h}return t}se();ue();fe();var TF=class{constructor(){this.handlers=[]}use(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Tt.forEach(this.handlers,function(s){s!==null&&e(s)})}},IF=TF;se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();var vM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();var mwe=typeof URLSearchParams<"u"?URLSearchParams:pM;se();ue();fe();var gwe=typeof FormData<"u"?FormData:null;se();ue();fe();var ywe=typeof Blob<"u"?Blob:null;var bwe={isBrowser:!0,classes:{URLSearchParams:mwe,FormData:gwe,Blob:ywe},protocols:["http","https","file","blob","url","data"]};var PF={};qo(PF,{hasBrowserEnv:()=>BF,hasStandardBrowserEnv:()=>$ft,hasStandardBrowserWebWorkerEnv:()=>Lft,navigator:()=>kF,origin:()=>Dft});se();ue();fe();var BF=typeof window<"u"&&typeof document<"u",kF=typeof navigator=="object"&&navigator||void 0,$ft=BF&&(!kF||["ReactNative","NativeScript","NS"].indexOf(kF.product)<0),Lft=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dft=BF&&window.location.href||"http://localhost";var Vn={...PF,...bwe};function OF(t,e){return Ld(t,new Vn.classes.URLSearchParams,Object.assign({visitor:function(r,s,n,h){return Vn.isNode&&Tt.isBuffer(r)?(this.append(s,r.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},e))}se();ue();fe();function Uft(t){return Tt.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function qft(t){let e={},r=Object.keys(t),s,n=r.length,h;for(s=0;s<n;s++)h=r[s],e[h]=t[h];return e}function Fft(t){function e(r,s,n,h){let d=r[h++];if(d==="__proto__")return!0;let v=Number.isFinite(+d),w=h>=r.length;return d=!d&&Tt.isArray(n)?n.length:d,w?(Tt.hasOwnProp(n,d)?n[d]=[n[d],s]:n[d]=s,!v):((!n[d]||!Tt.isObject(n[d]))&&(n[d]=[]),e(r,s,n[d],h)&&Tt.isArray(n[d])&&(n[d]=qft(n[d])),!v)}if(Tt.isFormData(t)&&Tt.isFunction(t.entries)){let r={};return Tt.forEachEntry(t,(s,n)=>{e(Uft(s),n,r,0)}),r}return null}var mM=Fft;function jft(t,e,r){if(Tt.isString(t))try{return(e||JSON.parse)(t),Tt.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}var NF={transitional:vM,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let s=r.getContentType()||"",n=s.indexOf("application/json")>-1,h=Tt.isObject(e);if(h&&Tt.isHTMLForm(e)&&(e=new FormData(e)),Tt.isFormData(e))return n?JSON.stringify(mM(e)):e;if(Tt.isArrayBuffer(e)||Tt.isBuffer(e)||Tt.isStream(e)||Tt.isFile(e)||Tt.isBlob(e)||Tt.isReadableStream(e))return e;if(Tt.isArrayBufferView(e))return e.buffer;if(Tt.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let v;if(h){if(s.indexOf("application/x-www-form-urlencoded")>-1)return OF(e,this.formSerializer).toString();if((v=Tt.isFileList(e))||s.indexOf("multipart/form-data")>-1){let w=this.env&&this.env.FormData;return Ld(v?{"files[]":e}:e,w&&new w,this.formSerializer)}}return h||n?(r.setContentType("application/json",!1),jft(e)):e}],transformResponse:[function(e){let r=this.transitional||NF.transitional,s=r&&r.forcedJSONParsing,n=this.responseType==="json";if(Tt.isResponse(e)||Tt.isReadableStream(e))return e;if(e&&Tt.isString(e)&&(s&&!this.responseType||n)){let d=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(v){if(d)throw v.name==="SyntaxError"?Fr.from(v,Fr.ERR_BAD_RESPONSE,this,null,this.response):v}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vn.classes.FormData,Blob:Vn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Tt.forEach(["delete","get","head","post","put","patch"],t=>{NF.headers[t]={}});var Qg=NF;se();ue();fe();se();ue();fe();var zft=Tt.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"]),wwe=t=>{let e={},r,s,n;return t&&t.split(`
215
+ }`,n=kt.object({data:kt.object({transactions:kt.object({edges:kt.array(kt.object({node:kt.record(kt.any())}))})})});return h=>di(h).chain(gn(d=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:s,variables:{transactionIds:[d]}})}).then(async v=>{if(v.ok)return v.json();throw r('Error Encountered when querying gateway for transaction "%s"',d),new Error(`${v.status}: ${await v.text()}`)}).then(n.parse).then(tHe(["data","transactions","edges","0","node"])))).toPromise()}var cWe=PL(wUe(),1),_1e=(t="@permaweb/aoconnect")=>{let e=(0,cWe.default)(t);return e.child=r=>_1e(`${e.namespace}:${r}`),e.tap=(r,...s)=>fHe((...n)=>e(r,...s,...n)),e},M1e=({url:t,path:e})=>e?e.startsWith("/")?M1e({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function dWe(t){return wg(U_([]),bg((e,r)=>wg(nHe([],r.name),VL(r.value),du(r.name,$c,e))(e),{}),L_(e=>e.length>1?e:e[0]))(t)}function hu(t,e){return r=>Wpe(dze([Zde(t,"name"),JL(ZL(e),Zde(e,"value"),HL)]),r)}function Jde(t){return t1e([[n6(String),ug(t)],[n6(Array),Kze(t)],[HL,xje]])}function W1(t){let e;return n6(lu,t)?(e=new Error(pWe(t)),e.stack+=t.stack):n6(Error,t)?e=t:zze("message",t)?e=new Error(t.message):n6(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function pWe(t){return wg(e=>function r(s,n,h){return bg((d,v)=>wg(t1e([[ug(Jt.invalid_arguments),()=>r(v.argumentsError,422,"Invalid Arguments")],[ug(Jt.invalid_return_type),()=>r(v.returnTypeError,500,"Invalid Return")],[ug(Jt.invalid_union),()=>Ize(w=>r(w,400,"Invalid Union"),v.unionErrors)],[HL,()=>[{...v,status:n,contextCode:h}]]]),GL(d))(v.code),[],s.issues)}(e,400,""),e=>bg((r,s)=>{let{message:n,path:h,contextCode:d}=s,v=h[1]||h[0],w=d?`${d} `:"";return r.push(`${w}'${v}': ${n}.`),r},[],e),Xze(" | "))(t)}var vWe=kt.object({id:kt.string().min(1,{message:"message is required to be a message id"}),processId:kt.string().min(1,{message:"process is required to be a process id"})});function mWe(){return t=>di(t).map(vWe.parse).map(()=>t)}var F6=kt.object({name:kt.string(),value:kt.string()}),gWe=kt.function().args(kt.object({Id:kt.string(),Target:kt.string(),Owner:kt.string(),Anchor:kt.string().optional(),Data:kt.any().default("1234"),Tags:kt.array(kt.object({name:kt.string(),value:kt.string()}))})).returns(kt.promise(kt.any())),yWe=kt.function().args(kt.object({id:kt.string().min(1,{message:"message id is required"}),processId:kt.string().min(1,{message:"process id is required"})})).returns(kt.promise(kt.any())),bWe=kt.function().args(kt.object({process:kt.string().min(1,{message:"process id is required"}),from:kt.string().optional(),to:kt.string().optional(),sort:kt.enum(["ASC","DESC"]).default("ASC"),limit:kt.number().optional()})).returns(kt.promise(kt.object({edges:kt.array(kt.object({cursor:kt.string(),node:kt.object({Output:kt.any().optional(),Messages:kt.array(kt.any()).optional(),Spawns:kt.array(kt.any()).optional(),Error:kt.any().optional()})}))}))),x1e=kt.function().args(kt.object({processId:kt.string(),data:kt.any(),tags:kt.array(F6),anchor:kt.string().optional(),signer:kt.any()})).returns(kt.promise(kt.object({messageId:kt.string()}).passthrough())),wWe=kt.function().args(kt.object({data:kt.any(),tags:kt.array(F6),signer:kt.any()})).returns(kt.promise(kt.object({processId:kt.string()}).passthrough())),_We=kt.function().args(kt.object({process:kt.string(),message:kt.string(),baseLayer:kt.boolean().optional(),exclude:kt.array(kt.string()).optional()})).returns(kt.promise(kt.object({assignmentId:kt.string()}).passthrough())),S1e=x1e,Axt=kt.function().args(kt.object({suUrl:kt.string().url(),processId:kt.string()})).returns(kt.promise(kt.object({tags:kt.array(F6)}).passthrough())),Rxt=kt.function().args(kt.string()).returns(kt.promise(kt.object({url:kt.string()}))),MWe=kt.function().args(kt.string()).returns(kt.promise(kt.boolean())),xWe=kt.function().args(kt.string()).returns(kt.promise(kt.object({tags:kt.array(F6)}).passthrough())),q_=kt.function().args(kt.object({data:kt.any(),tags:kt.array(F6),target:kt.string().optional(),anchor:kt.string().optional()})).returns(kt.promise(kt.object({id:kt.string(),raw:kt.any()})));function SWe({loadResult:t}){return t=gn(yWe.implement(t)),e=>di({id:e.id,processId:e.processId}).chain(t)}function EWe(t){let e=mWe(t),r=SWe(t);return({message:s,process:n})=>di({id:s,processId:n}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',s)).map(h=>h).bimap(W1,H1).toPromise()}var AWe=kt.array(kt.object({name:kt.string(),value:kt.string()}));function RWe(){return t=>di(t.tags).map(U_([])).map(hu("Data-Protocol","ao")).map(hu("Variant")).map(hu("Type")).map(hu("SDK")).map(GL($c,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(AWe.parse).map(du("tags",$c,t))}function TWe({logger:t}){return e=>di(e).chain(JL(ZL(e.data),()=>q1(e),()=>q1(Math.random().toString().slice(-4)).map(du("data",$c,e)).map(r=>wg(z1("tags"),hu("Content-Type"),VL({name:"Content-Type",value:"text/plain"}),du("tags",$c,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function IWe(t){let e=RWe(t),r=TWe(t),s=x1e.implement(t.deployMessage);return n=>di(n).chain(e).chain(r).chain(gn(({id:h,data:d,tags:v,anchor:w,signer:g})=>s({processId:h,data:d,tags:v,anchor:w,signer:q_.implement(g)}))).map(h=>du("messageId",h.messageId,n))}function kWe(t){let e=IWe(t);return({process:r,data:s,tags:n,anchor:h,signer:d})=>di({id:r,data:s,tags:n,anchor:h,signer:d}).chain(e).map(v=>v.messageId).bimap(W1,H1).toPromise()}var V2=(t,e,r)=>s=>e(s[t])?q1(s):Rd(`Tag '${t}': ${r}`);function BWe({loadTransactionMeta:t,logger:e}){return t=gn(xWe.implement(t)),r=>di(r).chain(t).map(z1("tags")).map(dWe).chain(V2("Data-Protocol",Jde("ao"),"value 'ao' was not found on module")).chain(V2("Type",Jde("Module"),"value 'Module' was not found on module")).chain(V2("Module-Format",iL,"was not found on module")).chain(V2("Input-Encoding",iL,"was not found on module")).chain(V2("Output-Encoding",iL,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function PWe({logger:t,validateScheduler:e}){return e=gn(MWe.implement(e)),r=>di(r).chain(s=>e(s).chain(n=>n?q1(s):Rd(`Valid Scheduler-Location owned by ${s} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function OWe({logger:t}){return e=>di(e).map(t.tap("Checking for signer")).chain(r=>r?q1(r):Rd("signer not found"))}function NWe(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=BWe(t),s=PWe(t),n=OWe(t);return h=>di(h).chain(d=>r(d.module).map(()=>d)).chain(d=>s(d.scheduler)).map(()=>h).chain(d=>n(d.signer).map(()=>d)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var CWe=kt.array(kt.object({name:kt.string(),value:kt.string()}));function $We(){return t=>di(t).map(z1("tags")).map(U_([])).map(hu("Data-Protocol","ao")).map(hu("Variant")).map(hu("Type")).map(hu("Module")).map(hu("Scheduler")).map(hu("SDK")).map(GL($c,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map(CWe.parse).map(du("tags",$c,t))}function LWe({logger:t}){return e=>di(e).chain(JL(ZL(e.data),()=>q1(e),()=>q1(Math.random().toString().slice(-4)).map(du("data",$c,e)).map(r=>wg(z1("tags"),hu("Content-Type"),VL({name:"Content-Type",value:"text/plain"}),du("tags",$c,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function DWe(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=$We(t),s=LWe(t),n=wWe.implement(t.deployProcess);return h=>di(h).chain(r).chain(s).chain(gn(({data:d,tags:v,signer:w})=>n({data:d,tags:v,signer:q_.implement(w)}))).map(d=>du("processId",d.processId,h))}function UWe(t){let e=NWe(t),r=DWe(t);return({module:s,scheduler:n,signer:h,tags:d,data:v})=>di({module:s,scheduler:n,signer:h,tags:d,data:v}).chain(e).chain(r).map(w=>w.processId).bimap(W1,H1).toPromise()}function qWe(t){let e=S1e.implement(t.deployMonitor);return r=>di(r).chain(gn(({id:s,signer:n})=>e({processId:s,signer:q_.implement(n),data:Math.random().toString().slice(-4),tags:[]}))).map(s=>du("monitorId",s.messageId,r))}function FWe(t){let e=qWe(t);return({process:r,signer:s})=>di({id:r,signer:s}).chain(e).map(n=>n.monitorId).bimap(W1,H1).toPromise()}function jWe(t){let e=S1e.implement(t.deployUnmonitor);return r=>di(r).chain(gn(({id:s,signer:n})=>e({processId:s,signer:q_.implement(n),data:Math.random().toString().slice(-4),tags:[]}))).map(s=>du("monitorId",s.messageId,r))}function zWe(t){let e=jWe(t);return({process:r,signer:s})=>di({id:r,signer:s}).chain(e).map(n=>n.monitorId).bimap(W1,H1).toPromise()}var HWe=kt.object({process:kt.string().min(1,{message:"process identifier is required"}),from:kt.string().optional(),to:kt.string().optional(),sort:kt.enum(["ASC","DESC"]).default("ASC"),limit:kt.number().optional()});function WWe(){return t=>di(t).map(HWe.parse).map(()=>t)}function KWe({queryResults:t}){return t=gn(bWe.implement(t)),e=>di({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function ZWe(t){let e=WWe(t),r=KWe(t);return({process:s,from:n,to:h,sort:d,limit:v})=>di({process:s,from:n,to:h,sort:d,limit:v}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',s)).map(w=>w).bimap(W1,H1).toPromise()}var VWe=kt.object({Id:kt.string(),Target:kt.string(),Owner:kt.string(),Anchor:kt.string().optional(),Data:kt.any().default("1234"),Tags:kt.array(kt.object({name:kt.string(),value:kt.string()}))});function GWe(){return t=>di(t).map(VWe.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function JWe({dryrunFetch:t}){return gn(gWe.implement(t))}function YWe(t){let e=GWe(t),r=JWe(t);return s=>di(s).map(XWe).chain(e).chain(r).toPromise()}function XWe({process:t,data:e,tags:r,anchor:s,...n}){return{Id:"1234",Owner:"1234",...n,Target:t,Data:e||"1234",Tags:r||[],Anchor:s||"0"}}function QWe(t){let e=_We.implement(t.deployAssign);return r=>di(r).chain(gn(({process:s,message:n,baseLayer:h,exclude:d})=>e({process:s,message:n,baseLayer:h,exclude:d}))).map(s=>du("assignmentId",s.assignmentId,r))}function eKe(t){let e=QWe(t);return({process:r,message:s,baseLayer:n,exclude:h})=>di({process:r,message:s,baseLayer:n,exclude:h}).chain(e).map(d=>d.assignmentId).bimap(W1,H1).toPromise()}var tKe="https://arweave.net",rKe="https://mu.ao-testnet.xyz",iKe="https://cu.ao-testnet.xyz";function Gs({GRAPHQL_URL:t,GATEWAY_URL:e=tKe,MU_URL:r=rKe,CU_URL:s=iKe}={}){let n=_1e();t||(t=M1e({url:e,path:"/graphql"}));let{validate:h}=Fpe({cacheSize:100,GRAPHQL_URL:t}),d=_je({MAX_SIZE:25}),v=n.child("result"),w=EWe({loadResult:yje({fetch,CU_URL:s,logger:v}),logger:v}),g=n.child("message"),y=kWe({loadProcessMeta:eL({fetch,cache:d,logger:g}),deployMessage:cje({fetch,MU_URL:r,logger:g}),logger:g}),M=n.child("spawn"),x=UWe({loadTransactionMeta:lWe({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:dje({fetch,MU_URL:r,logger:M}),logger:M}),S=n.child("monitor"),E=FWe({loadProcessMeta:eL({fetch,cache:d,logger:S}),deployMonitor:pje({fetch,MU_URL:r,logger:S}),logger:S}),T=n.child("unmonitor"),k=zWe({loadProcessMeta:eL({fetch,cache:d,logger:T}),deployUnmonitor:vje({fetch,MU_URL:r,logger:T}),logger:S}),B=n.child("results"),C=ZWe({queryResults:bje({fetch,CU_URL:s,logger:B}),logger:B}),N=n.child("dryrun"),W=YWe({dryrunFetch:gje({fetch,CU_URL:s,logger:N}),logger:N}),H=n.child("assign"),Y=eKe({deployAssign:mje({fetch,MU_URL:r,logger:H}),logger:g});return{result:w,results:C,message:y,spawn:x,monitor:E,unmonitor:k,dryrun:W,assign:Y}}var E1e={};Qde(E1e,{createDataItemSigner:()=>TKe});var A1e=PL(xUe(),1),R1e={};Qde(R1e,{AVSCTap:()=>j6,ArweaveSigner:()=>tD,DataItem:()=>L6,MAX_TAG_BYTES:()=>F_,MIN_BINARY_SIZE:()=>nD,SIG_CONFIG:()=>Eg,SignatureConfig:()=>uu,Signer:()=>B1e,createData:()=>C1e,default:()=>EKe,deserializeTags:()=>B_,indexToType:()=>rD,serializeTags:()=>iD,tagsExceedLimit:()=>N1e,warparbundles:()=>AKe});var nKe=Object.create,QL=Object.defineProperty,aKe=Object.getOwnPropertyDescriptor,oKe=Object.getOwnPropertyNames,sKe=Object.getPrototypeOf,fKe=Object.prototype.hasOwnProperty,Dc=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),uKe=(t,e)=>{for(var r in e)QL(t,r,{get:e[r],enumerable:!0})},hKe=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of oKe(e))!fKe.call(t,n)&&n!==r&&QL(t,n,{get:()=>e[n],enumerable:!(s=aKe(e,n))||s.enumerable});return t},K1=(t,e,r)=>(r=t!=null?nKe(sKe(t)):{},hKe(e||!t||!t.__esModule?QL(r,"default",{value:t,enumerable:!0}):r,t)),lKe=Dc(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var s=4,n=r.length,h=n%s;if(!h)return r;var d=n,v=s-h,w=n+v,g=Re.alloc(w);for(g.write(r);v--;)g.write("=",d++);return g.toString()}t.default=e}),cKe=Dc(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=lKe();function r(w,g){return g===void 0&&(g="utf8"),Re.isBuffer(w)?h(w.toString("base64")):h(Re.from(w,g).toString("base64"))}function s(w,g){return g===void 0&&(g="utf8"),Re.from(n(w),"base64").toString(g)}function n(w){return w=w.toString(),e.default(w).replace(/\-/g,"+").replace(/_/g,"/")}function h(w){return w.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function d(w){return Re.from(n(w),"base64")}var v=r;v.encode=r,v.decode=s,v.toBase64=n,v.fromBase64=h,v.toBuffer=d,t.default=v}),eD=Dc((t,e)=>{e.exports=cKe().default,e.exports.default=e.exports}),T1e=Dc(t=>{"use strict";t.byteLength=w,t.toByteArray=y,t.fromByteArray=S;var e=[],r=[],s=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,d=n.length;h<d;++h)e[h]=n[h],r[n.charCodeAt(h)]=h;var h,d;r[45]=62,r[95]=63;function v(E){var T=E.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=E.indexOf("=");k===-1&&(k=T);var B=k===T?0:4-k%4;return[k,B]}function w(E){var T=v(E),k=T[0],B=T[1];return(k+B)*3/4-B}function g(E,T,k){return(T+k)*3/4-k}function y(E){var T,k=v(E),B=k[0],C=k[1],N=new s(g(E,B,C)),W=0,H=C>0?B-4:B,Y;for(Y=0;Y<H;Y+=4)T=r[E.charCodeAt(Y)]<<18|r[E.charCodeAt(Y+1)]<<12|r[E.charCodeAt(Y+2)]<<6|r[E.charCodeAt(Y+3)],N[W++]=T>>16&255,N[W++]=T>>8&255,N[W++]=T&255;return C===2&&(T=r[E.charCodeAt(Y)]<<2|r[E.charCodeAt(Y+1)]>>4,N[W++]=T&255),C===1&&(T=r[E.charCodeAt(Y)]<<10|r[E.charCodeAt(Y+1)]<<4|r[E.charCodeAt(Y+2)]>>2,N[W++]=T>>8&255,N[W++]=T&255),N}function M(E){return e[E>>18&63]+e[E>>12&63]+e[E>>6&63]+e[E&63]}function x(E,T,k){for(var B,C=[],N=T;N<k;N+=3)B=(E[N]<<16&16711680)+(E[N+1]<<8&65280)+(E[N+2]&255),C.push(M(B));return C.join("")}function S(E){for(var T,k=E.length,B=k%3,C=[],N=16383,W=0,H=k-B;W<H;W+=N)C.push(x(E,W,W+N>H?H:W+N));return B===1?(T=E[k-1],C.push(e[T>>2]+e[T<<4&63]+"==")):B===2&&(T=(E[k-2]<<8)+E[k-1],C.push(e[T>>10]+e[T>>4&63]+e[T<<2&63]+"=")),C.join("")}}),I1e=Dc(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=T1e();function r(x){let S=0;for(let k=0;k<x.length;k++)S+=x[k].byteLength;let E=new Uint8Array(S),T=0;E.set(new Uint8Array(x[0]),T),T+=x[0].byteLength;for(let k=1;k<x.length;k++)E.set(new Uint8Array(x[k]),T),T+=x[k].byteLength;return E}t.concatBuffers=r;function s(x){let S=v(x);return n(S)}t.b64UrlToString=s;function n(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=n;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function d(x){return g(h(x))}t.stringToB64Url=d;function v(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=v;function w(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=w;function g(x){return y(w(x))}t.bufferTob64Url=g;function y(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=y;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let S;return x.length%4==0?S=0:S=4-x.length%4,x.concat("=".repeat(S))}t.b64UrlDecode=M}),dKe=Dc(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=I1e(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let s=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),n=await this.driver.exportKey("jwk",s.privateKey);return{kty:n.kty,e:n.e,n:n.n,d:n.d,p:n.p,q:n.q,dp:n.dp,dq:n.dq,qi:n.qi}}async sign(s,n,{saltLength:h}={}){let d=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(s),n);return new Uint8Array(d)}async hash(s,n="SHA-256"){let h=await this.driver.digest(n,s);return new Uint8Array(h)}async verify(s,n,h){let d={kty:"RSA",e:"AQAB",n:s},v=await this.jwkToPublicCryptoKey(d),w=await this.driver.digest("SHA-256",n),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},v,h,n),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},v,h,n),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((v.algorithm.modulusLength-1)/8)-w.byteLength-2},v,h,n);return g||y||M}async jwkToCryptoKey(s){return this.driver.importKey("jwk",s,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(s){return this.driver.importKey("jwk",s,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let s=crypto?.subtle;return s===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(n=>typeof s[n]=="function")}async encrypt(s,n,h){let d=await this.driver.importKey("raw",typeof n=="string"?e.stringToBuffer(n):n,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},d,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=new Uint8Array(16);crypto.getRandomValues(w);let g=await this.driver.encrypt({name:"AES-CBC",iv:w},v,s);return e.concatBuffers([w,g])}async decrypt(s,n,h){let d=await this.driver.importKey("raw",typeof n=="string"?e.stringToBuffer(n):n,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},d,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=s.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:w},v,s.slice(16));return e.concatBuffers([g])}};t.default=r}),pKe=Dc(t=>{t.read=function(e,r,s,n,h){var d,v,w=h*8-n-1,g=(1<<w)-1,y=g>>1,M=-7,x=s?h-1:0,S=s?-1:1,E=e[r+x];for(x+=S,d=E&(1<<-M)-1,E>>=-M,M+=w;M>0;d=d*256+e[r+x],x+=S,M-=8);for(v=d&(1<<-M)-1,d>>=-M,M+=n;M>0;v=v*256+e[r+x],x+=S,M-=8);if(d===0)d=1-y;else{if(d===g)return v?NaN:(E?-1:1)*(1/0);v=v+Math.pow(2,n),d=d-y}return(E?-1:1)*v*Math.pow(2,d-n)},t.write=function(e,r,s,n,h,d){var v,w,g,y=d*8-h-1,M=(1<<y)-1,x=M>>1,S=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:d-1,T=n?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(w=isNaN(r)?1:0,v=M):(v=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-v))<1&&(v--,g*=2),v+x>=1?r+=S/g:r+=S*Math.pow(2,1-x),r*g>=2&&(v++,g/=2),v+x>=M?(w=0,v=M):v+x>=1?(w=(r*g-1)*Math.pow(2,h),v=v+x):(w=r*Math.pow(2,x-1)*Math.pow(2,h),v=0));h>=8;e[s+E]=w&255,E+=T,w/=256,h-=8);for(v=v<<h|w,y+=h;y>0;e[s+E]=v&255,E+=T,v/=256,y-=8);e[s+E-T]|=k*128}}),IL=Dc(t=>{"use strict";var e=T1e(),r=pKe(),s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=v,t.SlowBuffer=C,t.INSPECT_MAX_BYTES=50;var n=2147483647;t.kMaxLength=n,v.TYPED_ARRAY_SUPPORT=h(),!v.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 h(){try{let P=new Uint8Array(1),O={foo:function(){return 42}};return Object.setPrototypeOf(O,Uint8Array.prototype),Object.setPrototypeOf(P,O),P.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function d(P){if(P>n)throw new RangeError('The value "'+P+'" is invalid for option "size"');let O=new Uint8Array(P);return Object.setPrototypeOf(O,v.prototype),O}function v(P,O,$){if(typeof P=="number"){if(typeof O=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(P)}return w(P,O,$)}v.poolSize=8192;function w(P,O,$){if(typeof P=="string")return x(P,O);if(ArrayBuffer.isView(P))return E(P);if(P==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P);if(pt(P,ArrayBuffer)||P&&pt(P.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pt(P,SharedArrayBuffer)||P&&pt(P.buffer,SharedArrayBuffer)))return T(P,O,$);if(typeof P=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let Z=P.valueOf&&P.valueOf();if(Z!=null&&Z!==P)return v.from(Z,O,$);let te=k(P);if(te)return te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof P[Symbol.toPrimitive]=="function")return v.from(P[Symbol.toPrimitive]("string"),O,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P)}v.from=function(P,O,$){return w(P,O,$)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function g(P){if(typeof P!="number")throw new TypeError('"size" argument must be of type number');if(P<0)throw new RangeError('The value "'+P+'" is invalid for option "size"')}function y(P,O,$){return g(P),P<=0?d(P):O!==void 0?typeof $=="string"?d(P).fill(O,$):d(P).fill(O):d(P)}v.alloc=function(P,O,$){return y(P,O,$)};function M(P){return g(P),d(P<0?0:B(P)|0)}v.allocUnsafe=function(P){return M(P)},v.allocUnsafeSlow=function(P){return M(P)};function x(P,O){if((typeof O!="string"||O==="")&&(O="utf8"),!v.isEncoding(O))throw new TypeError("Unknown encoding: "+O);let $=N(P,O)|0,Z=d($),te=Z.write(P,O);return te!==$&&(Z=Z.slice(0,te)),Z}function S(P){let O=P.length<0?0:B(P.length)|0,$=d(O);for(let Z=0;Z<O;Z+=1)$[Z]=P[Z]&255;return $}function E(P){if(pt(P,Uint8Array)){let O=new Uint8Array(P);return T(O.buffer,O.byteOffset,O.byteLength)}return S(P)}function T(P,O,$){if(O<0||P.byteLength<O)throw new RangeError('"offset" is outside of buffer bounds');if(P.byteLength<O+($||0))throw new RangeError('"length" is outside of buffer bounds');let Z;return O===void 0&&$===void 0?Z=new Uint8Array(P):$===void 0?Z=new Uint8Array(P,O):Z=new Uint8Array(P,O,$),Object.setPrototypeOf(Z,v.prototype),Z}function k(P){if(v.isBuffer(P)){let O=B(P.length)|0,$=d(O);return $.length===0||P.copy($,0,0,O),$}if(P.length!==void 0)return typeof P.length!="number"||Me(P.length)?d(0):S(P);if(P.type==="Buffer"&&Array.isArray(P.data))return S(P.data)}function B(P){if(P>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return P|0}function C(P){return+P!=P&&(P=0),v.alloc(+P)}v.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==v.prototype},v.compare=function(P,O){if(pt(P,Uint8Array)&&(P=v.from(P,P.offset,P.byteLength)),pt(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),!v.isBuffer(P)||!v.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===O)return 0;let $=P.length,Z=O.length;for(let te=0,X=Math.min($,Z);te<X;++te)if(P[te]!==O[te]){$=P[te],Z=O[te];break}return $<Z?-1:Z<$?1:0},v.isEncoding=function(P){switch(String(P).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}},v.concat=function(P,O){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return v.alloc(0);let $;if(O===void 0)for(O=0,$=0;$<P.length;++$)O+=P[$].length;let Z=v.allocUnsafe(O),te=0;for($=0;$<P.length;++$){let X=P[$];if(pt(X,Uint8Array))te+X.length>Z.length?(v.isBuffer(X)||(X=v.from(X)),X.copy(Z,te)):Uint8Array.prototype.set.call(Z,X,te);else if(v.isBuffer(X))X.copy(Z,te);else throw new TypeError('"list" argument must be an Array of Buffers');te+=X.length}return Z};function N(P,O){if(v.isBuffer(P))return P.length;if(ArrayBuffer.isView(P)||pt(P,ArrayBuffer))return P.byteLength;if(typeof P!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof P);let $=P.length,Z=arguments.length>2&&arguments[2]===!0;if(!Z&&$===0)return 0;let te=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return ie(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return de(P).length;default:if(te)return Z?-1:ie(P).length;O=(""+O).toLowerCase(),te=!0}}v.byteLength=N;function W(P,O,$){let Z=!1;if((O===void 0||O<0)&&(O=0),O>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,O>>>=0,$<=O))return"";for(P||(P="utf8");;)switch(P){case"hex":return a(this,O,$);case"utf8":case"utf-8":return u(this,O,$);case"ascii":return _(this,O,$);case"latin1":case"binary":return c(this,O,$);case"base64":return f(this,O,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p(this,O,$);default:if(Z)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),Z=!0}}v.prototype._isBuffer=!0;function H(P,O,$){let Z=P[O];P[O]=P[$],P[$]=Z}v.prototype.swap16=function(){let P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<P;O+=2)H(this,O,O+1);return this},v.prototype.swap32=function(){let P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<P;O+=4)H(this,O,O+3),H(this,O+1,O+2);return this},v.prototype.swap64=function(){let P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<P;O+=8)H(this,O,O+7),H(this,O+1,O+6),H(this,O+2,O+5),H(this,O+3,O+4);return this},v.prototype.toString=function(){let P=this.length;return P===0?"":arguments.length===0?u(this,0,P):W.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(P){if(!v.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:v.compare(this,P)===0},v.prototype.inspect=function(){let P="",O=t.INSPECT_MAX_BYTES;return P=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(P+=" ... "),"<Buffer "+P+">"},s&&(v.prototype[s]=v.prototype.inspect),v.prototype.compare=function(P,O,$,Z,te){if(pt(P,Uint8Array)&&(P=v.from(P,P.offset,P.byteLength)),!v.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(O===void 0&&(O=0),$===void 0&&($=P?P.length:0),Z===void 0&&(Z=0),te===void 0&&(te=this.length),O<0||$>P.length||Z<0||te>this.length)throw new RangeError("out of range index");if(Z>=te&&O>=$)return 0;if(Z>=te)return-1;if(O>=$)return 1;if(O>>>=0,$>>>=0,Z>>>=0,te>>>=0,this===P)return 0;let X=te-Z,ae=$-O,qe=Math.min(X,ae),ce=this.slice(Z,te),ge=P.slice(O,$);for(let xe=0;xe<qe;++xe)if(ce[xe]!==ge[xe]){X=ce[xe],ae=ge[xe];break}return X<ae?-1:ae<X?1:0};function Y(P,O,$,Z,te){if(P.length===0)return-1;if(typeof $=="string"?(Z=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,Me($)&&($=te?0:P.length-1),$<0&&($=P.length+$),$>=P.length){if(te)return-1;$=P.length-1}else if($<0)if(te)$=0;else return-1;if(typeof O=="string"&&(O=v.from(O,Z)),v.isBuffer(O))return O.length===0?-1:U(P,O,$,Z,te);if(typeof O=="number")return O=O&255,typeof Uint8Array.prototype.indexOf=="function"?te?Uint8Array.prototype.indexOf.call(P,O,$):Uint8Array.prototype.lastIndexOf.call(P,O,$):U(P,[O],$,Z,te);throw new TypeError("val must be string, number or Buffer")}function U(P,O,$,Z,te){let X=1,ae=P.length,qe=O.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(P.length<2||O.length<2)return-1;X=2,ae/=2,qe/=2,$/=2}function ce(xe,ye){return X===1?xe[ye]:xe.readUInt16BE(ye*X)}let ge;if(te){let xe=-1;for(ge=$;ge<ae;ge++)if(ce(P,ge)===ce(O,xe===-1?0:ge-xe)){if(xe===-1&&(xe=ge),ge-xe+1===qe)return xe*X}else xe!==-1&&(ge-=ge-xe),xe=-1}else for($+qe>ae&&($=ae-qe),ge=$;ge>=0;ge--){let xe=!0;for(let ye=0;ye<qe;ye++)if(ce(P,ge+ye)!==ce(O,ye)){xe=!1;break}if(xe)return ge}return-1}v.prototype.includes=function(P,O,$){return this.indexOf(P,O,$)!==-1},v.prototype.indexOf=function(P,O,$){return Y(this,P,O,$,!0)},v.prototype.lastIndexOf=function(P,O,$){return Y(this,P,O,$,!1)};function j(P,O,$,Z){$=Number($)||0;let te=P.length-$;Z?(Z=Number(Z),Z>te&&(Z=te)):Z=te;let X=O.length;Z>X/2&&(Z=X/2);let ae;for(ae=0;ae<Z;++ae){let qe=parseInt(O.substr(ae*2,2),16);if(Me(qe))return ae;P[$+ae]=qe}return ae}function J(P,O,$,Z){return be(ie(O,P.length-$),P,$,Z)}function b(P,O,$,Z){return be(oe(O),P,$,Z)}function i(P,O,$,Z){return be(de(O),P,$,Z)}function o(P,O,$,Z){return be(Pe(O,P.length-$),P,$,Z)}v.prototype.write=function(P,O,$,Z){if(O===void 0)Z="utf8",$=this.length,O=0;else if($===void 0&&typeof O=="string")Z=O,$=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite($)?($=$>>>0,Z===void 0&&(Z="utf8")):(Z=$,$=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let te=this.length-O;if(($===void 0||$>te)&&($=te),P.length>0&&($<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");let X=!1;for(;;)switch(Z){case"hex":return j(this,P,O,$);case"utf8":case"utf-8":return J(this,P,O,$);case"ascii":case"latin1":case"binary":return b(this,P,O,$);case"base64":return i(this,P,O,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o(this,P,O,$);default:if(X)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),X=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(P,O,$){return O===0&&$===P.length?e.fromByteArray(P):e.fromByteArray(P.slice(O,$))}function u(P,O,$){$=Math.min(P.length,$);let Z=[],te=O;for(;te<$;){let X=P[te],ae=null,qe=X>239?4:X>223?3:X>191?2:1;if(te+qe<=$){let ce,ge,xe,ye;switch(qe){case 1:X<128&&(ae=X);break;case 2:ce=P[te+1],(ce&192)===128&&(ye=(X&31)<<6|ce&63,ye>127&&(ae=ye));break;case 3:ce=P[te+1],ge=P[te+2],(ce&192)===128&&(ge&192)===128&&(ye=(X&15)<<12|(ce&63)<<6|ge&63,ye>2047&&(ye<55296||ye>57343)&&(ae=ye));break;case 4:ce=P[te+1],ge=P[te+2],xe=P[te+3],(ce&192)===128&&(ge&192)===128&&(xe&192)===128&&(ye=(X&15)<<18|(ce&63)<<12|(ge&63)<<6|xe&63,ye>65535&&ye<1114112&&(ae=ye))}}ae===null?(ae=65533,qe=1):ae>65535&&(ae-=65536,Z.push(ae>>>10&1023|55296),ae=56320|ae&1023),Z.push(ae),te+=qe}return m(Z)}var l=4096;function m(P){let O=P.length;if(O<=l)return String.fromCharCode.apply(String,P);let $="",Z=0;for(;Z<O;)$+=String.fromCharCode.apply(String,P.slice(Z,Z+=l));return $}function _(P,O,$){let Z="";$=Math.min(P.length,$);for(let te=O;te<$;++te)Z+=String.fromCharCode(P[te]&127);return Z}function c(P,O,$){let Z="";$=Math.min(P.length,$);for(let te=O;te<$;++te)Z+=String.fromCharCode(P[te]);return Z}function a(P,O,$){let Z=P.length;(!O||O<0)&&(O=0),(!$||$<0||$>Z)&&($=Z);let te="";for(let X=O;X<$;++X)te+=Be[P[X]];return te}function p(P,O,$){let Z=P.slice(O,$),te="";for(let X=0;X<Z.length-1;X+=2)te+=String.fromCharCode(Z[X]+Z[X+1]*256);return te}v.prototype.slice=function(P,O){let $=this.length;P=~~P,O=O===void 0?$:~~O,P<0?(P+=$,P<0&&(P=0)):P>$&&(P=$),O<0?(O+=$,O<0&&(O=0)):O>$&&(O=$),O<P&&(O=P);let Z=this.subarray(P,O);return Object.setPrototypeOf(Z,v.prototype),Z};function R(P,O,$){if(P%1!==0||P<0)throw new RangeError("offset is not uint");if(P+O>$)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(P,O,$){P=P>>>0,O=O>>>0,$||R(P,O,this.length);let Z=this[P],te=1,X=0;for(;++X<O&&(te*=256);)Z+=this[P+X]*te;return Z},v.prototype.readUintBE=v.prototype.readUIntBE=function(P,O,$){P=P>>>0,O=O>>>0,$||R(P,O,this.length);let Z=this[P+--O],te=1;for(;O>0&&(te*=256);)Z+=this[P+--O]*te;return Z},v.prototype.readUint8=v.prototype.readUInt8=function(P,O){return P=P>>>0,O||R(P,1,this.length),this[P]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(P,O){return P=P>>>0,O||R(P,2,this.length),this[P]|this[P+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(P,O){return P=P>>>0,O||R(P,2,this.length),this[P]<<8|this[P+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(P,O){return P=P>>>0,O||R(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(P,O){return P=P>>>0,O||R(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},v.prototype.readBigUInt64LE=gt(function(P){P=P>>>0,K(P,"offset");let O=this[P],$=this[P+7];(O===void 0||$===void 0)&&G(P,this.length-8);let Z=O+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,te=this[++P]+this[++P]*2**8+this[++P]*2**16+$*2**24;return BigInt(Z)+(BigInt(te)<<BigInt(32))}),v.prototype.readBigUInt64BE=gt(function(P){P=P>>>0,K(P,"offset");let O=this[P],$=this[P+7];(O===void 0||$===void 0)&&G(P,this.length-8);let Z=O*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],te=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+$;return(BigInt(Z)<<BigInt(32))+BigInt(te)}),v.prototype.readIntLE=function(P,O,$){P=P>>>0,O=O>>>0,$||R(P,O,this.length);let Z=this[P],te=1,X=0;for(;++X<O&&(te*=256);)Z+=this[P+X]*te;return te*=128,Z>=te&&(Z-=Math.pow(2,8*O)),Z},v.prototype.readIntBE=function(P,O,$){P=P>>>0,O=O>>>0,$||R(P,O,this.length);let Z=O,te=1,X=this[P+--Z];for(;Z>0&&(te*=256);)X+=this[P+--Z]*te;return te*=128,X>=te&&(X-=Math.pow(2,8*O)),X},v.prototype.readInt8=function(P,O){return P=P>>>0,O||R(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},v.prototype.readInt16LE=function(P,O){P=P>>>0,O||R(P,2,this.length);let $=this[P]|this[P+1]<<8;return $&32768?$|4294901760:$},v.prototype.readInt16BE=function(P,O){P=P>>>0,O||R(P,2,this.length);let $=this[P+1]|this[P]<<8;return $&32768?$|4294901760:$},v.prototype.readInt32LE=function(P,O){return P=P>>>0,O||R(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},v.prototype.readInt32BE=function(P,O){return P=P>>>0,O||R(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},v.prototype.readBigInt64LE=gt(function(P){P=P>>>0,K(P,"offset");let O=this[P],$=this[P+7];(O===void 0||$===void 0)&&G(P,this.length-8);let Z=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+($<<24);return(BigInt(Z)<<BigInt(32))+BigInt(O+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),v.prototype.readBigInt64BE=gt(function(P){P=P>>>0,K(P,"offset");let O=this[P],$=this[P+7];(O===void 0||$===void 0)&&G(P,this.length-8);let Z=(O<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(Z)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+$)}),v.prototype.readFloatLE=function(P,O){return P=P>>>0,O||R(P,4,this.length),r.read(this,P,!0,23,4)},v.prototype.readFloatBE=function(P,O){return P=P>>>0,O||R(P,4,this.length),r.read(this,P,!1,23,4)},v.prototype.readDoubleLE=function(P,O){return P=P>>>0,O||R(P,8,this.length),r.read(this,P,!0,52,8)},v.prototype.readDoubleBE=function(P,O){return P=P>>>0,O||R(P,8,this.length),r.read(this,P,!1,52,8)};function A(P,O,$,Z,te,X){if(!v.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>te||O<X)throw new RangeError('"value" argument is out of bounds');if($+Z>P.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(P,O,$,Z){if(P=+P,O=O>>>0,$=$>>>0,!Z){let ae=Math.pow(2,8*$)-1;A(this,P,O,$,ae,0)}let te=1,X=0;for(this[O]=P&255;++X<$&&(te*=256);)this[O+X]=P/te&255;return O+$},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(P,O,$,Z){if(P=+P,O=O>>>0,$=$>>>0,!Z){let ae=Math.pow(2,8*$)-1;A(this,P,O,$,ae,0)}let te=$-1,X=1;for(this[O+te]=P&255;--te>=0&&(X*=256);)this[O+te]=P/X&255;return O+$},v.prototype.writeUint8=v.prototype.writeUInt8=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,1,255,0),this[O]=P&255,O+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,2,65535,0),this[O]=P&255,this[O+1]=P>>>8,O+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,2,65535,0),this[O]=P>>>8,this[O+1]=P&255,O+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,4,4294967295,0),this[O+3]=P>>>24,this[O+2]=P>>>16,this[O+1]=P>>>8,this[O]=P&255,O+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,4,4294967295,0),this[O]=P>>>24,this[O+1]=P>>>16,this[O+2]=P>>>8,this[O+3]=P&255,O+4};function I(P,O,$,Z,te){F(O,Z,te,P,$,7);let X=Number(O&BigInt(4294967295));P[$++]=X,X=X>>8,P[$++]=X,X=X>>8,P[$++]=X,X=X>>8,P[$++]=X;let ae=Number(O>>BigInt(32)&BigInt(4294967295));return P[$++]=ae,ae=ae>>8,P[$++]=ae,ae=ae>>8,P[$++]=ae,ae=ae>>8,P[$++]=ae,$}function D(P,O,$,Z,te){F(O,Z,te,P,$,7);let X=Number(O&BigInt(4294967295));P[$+7]=X,X=X>>8,P[$+6]=X,X=X>>8,P[$+5]=X,X=X>>8,P[$+4]=X;let ae=Number(O>>BigInt(32)&BigInt(4294967295));return P[$+3]=ae,ae=ae>>8,P[$+2]=ae,ae=ae>>8,P[$+1]=ae,ae=ae>>8,P[$]=ae,$+8}v.prototype.writeBigUInt64LE=gt(function(P,O=0){return I(this,P,O,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=gt(function(P,O=0){return D(this,P,O,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(P,O,$,Z){if(P=+P,O=O>>>0,!Z){let qe=Math.pow(2,8*$-1);A(this,P,O,$,qe-1,-qe)}let te=0,X=1,ae=0;for(this[O]=P&255;++te<$&&(X*=256);)P<0&&ae===0&&this[O+te-1]!==0&&(ae=1),this[O+te]=(P/X>>0)-ae&255;return O+$},v.prototype.writeIntBE=function(P,O,$,Z){if(P=+P,O=O>>>0,!Z){let qe=Math.pow(2,8*$-1);A(this,P,O,$,qe-1,-qe)}let te=$-1,X=1,ae=0;for(this[O+te]=P&255;--te>=0&&(X*=256);)P<0&&ae===0&&this[O+te+1]!==0&&(ae=1),this[O+te]=(P/X>>0)-ae&255;return O+$},v.prototype.writeInt8=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,1,127,-128),P<0&&(P=255+P+1),this[O]=P&255,O+1},v.prototype.writeInt16LE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,2,32767,-32768),this[O]=P&255,this[O+1]=P>>>8,O+2},v.prototype.writeInt16BE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,2,32767,-32768),this[O]=P>>>8,this[O+1]=P&255,O+2},v.prototype.writeInt32LE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,4,2147483647,-2147483648),this[O]=P&255,this[O+1]=P>>>8,this[O+2]=P>>>16,this[O+3]=P>>>24,O+4},v.prototype.writeInt32BE=function(P,O,$){return P=+P,O=O>>>0,$||A(this,P,O,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[O]=P>>>24,this[O+1]=P>>>16,this[O+2]=P>>>8,this[O+3]=P&255,O+4},v.prototype.writeBigInt64LE=gt(function(P,O=0){return I(this,P,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=gt(function(P,O=0){return D(this,P,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function z(P,O,$,Z,te,X){if($+Z>P.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function re(P,O,$,Z,te){return O=+O,$=$>>>0,te||z(P,O,$,4,34028234663852886e22,-34028234663852886e22),r.write(P,O,$,Z,23,4),$+4}v.prototype.writeFloatLE=function(P,O,$){return re(this,P,O,!0,$)},v.prototype.writeFloatBE=function(P,O,$){return re(this,P,O,!1,$)};function Q(P,O,$,Z,te){return O=+O,$=$>>>0,te||z(P,O,$,8,17976931348623157e292,-17976931348623157e292),r.write(P,O,$,Z,52,8),$+8}v.prototype.writeDoubleLE=function(P,O,$){return Q(this,P,O,!0,$)},v.prototype.writeDoubleBE=function(P,O,$){return Q(this,P,O,!1,$)},v.prototype.copy=function(P,O,$,Z){if(!v.isBuffer(P))throw new TypeError("argument should be a Buffer");if($||($=0),!Z&&Z!==0&&(Z=this.length),O>=P.length&&(O=P.length),O||(O=0),Z>0&&Z<$&&(Z=$),Z===$||P.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("Index out of range");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),P.length-O<Z-$&&(Z=P.length-O+$);let te=Z-$;return this===P&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,$,Z):Uint8Array.prototype.set.call(P,this.subarray($,Z),O),te},v.prototype.fill=function(P,O,$,Z){if(typeof P=="string"){if(typeof O=="string"?(Z=O,O=0,$=this.length):typeof $=="string"&&(Z=$,$=this.length),Z!==void 0&&typeof Z!="string")throw new TypeError("encoding must be a string");if(typeof Z=="string"&&!v.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);if(P.length===1){let X=P.charCodeAt(0);(Z==="utf8"&&X<128||Z==="latin1")&&(P=X)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(O<0||this.length<O||this.length<$)throw new RangeError("Out of range index");if($<=O)return this;O=O>>>0,$=$===void 0?this.length:$>>>0,P||(P=0);let te;if(typeof P=="number")for(te=O;te<$;++te)this[te]=P;else{let X=v.isBuffer(P)?P:v.from(P,Z),ae=X.length;if(ae===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(te=0;te<$-O;++te)this[te+O]=X[te%ae]}return this};var L={};function q(P,O,$){L[P]=class extends ${constructor(){super(),Object.defineProperty(this,"message",{value:O.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${P}]`,this.stack,delete this.name}get code(){return P}set code(Z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Z,writable:!0})}toString(){return`${this.name} [${P}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(P){return P?`${P} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(P,O){return`The "${P}" argument must be of type number. Received type ${typeof O}`},TypeError),q("ERR_OUT_OF_RANGE",function(P,O,$){let Z=`The value of "${P}" is out of range.`,te=$;return Number.isInteger($)&&Math.abs($)>2**32?te=he(String($)):typeof $=="bigint"&&(te=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(te=he(te)),te+="n"),Z+=` It must be ${O}. Received ${te}`,Z},RangeError);function he(P){let O="",$=P.length,Z=P[0]==="-"?1:0;for(;$>=Z+4;$-=3)O=`_${P.slice($-3,$)}${O}`;return`${P.slice(0,$)}${O}`}function ee(P,O,$){K(O,"offset"),(P[O]===void 0||P[O+$]===void 0)&&G(O,P.length-($+1))}function F(P,O,$,Z,te,X){if(P>$||P<O){let ae=typeof O=="bigint"?"n":"",qe;throw X>3?O===0||O===BigInt(0)?qe=`>= 0${ae} and < 2${ae} ** ${(X+1)*8}${ae}`:qe=`>= -(2${ae} ** ${(X+1)*8-1}${ae}) and < 2 ** ${(X+1)*8-1}${ae}`:qe=`>= ${O}${ae} and <= ${$}${ae}`,new L.ERR_OUT_OF_RANGE("value",qe,P)}ee(Z,te,X)}function K(P,O){if(typeof P!="number")throw new L.ERR_INVALID_ARG_TYPE(O,"number",P)}function G(P,O,$){throw Math.floor(P)!==P?(K(P,$),new L.ERR_OUT_OF_RANGE($||"offset","an integer",P)):O<0?new L.ERR_BUFFER_OUT_OF_BOUNDS:new L.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${O}`,P)}var ne=/[^+/0-9A-Za-z-_]/g;function Te(P){if(P=P.split("=")[0],P=P.trim().replace(ne,""),P.length<2)return"";for(;P.length%4!==0;)P=P+"=";return P}function ie(P,O){O=O||1/0;let $,Z=P.length,te=null,X=[];for(let ae=0;ae<Z;++ae){if($=P.charCodeAt(ae),$>55295&&$<57344){if(!te){if($>56319){(O-=3)>-1&&X.push(239,191,189);continue}else if(ae+1===Z){(O-=3)>-1&&X.push(239,191,189);continue}te=$;continue}if($<56320){(O-=3)>-1&&X.push(239,191,189),te=$;continue}$=(te-55296<<10|$-56320)+65536}else te&&(O-=3)>-1&&X.push(239,191,189);if(te=null,$<128){if((O-=1)<0)break;X.push($)}else if($<2048){if((O-=2)<0)break;X.push($>>6|192,$&63|128)}else if($<65536){if((O-=3)<0)break;X.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((O-=4)<0)break;X.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return X}function oe(P){let O=[];for(let $=0;$<P.length;++$)O.push(P.charCodeAt($)&255);return O}function Pe(P,O){let $,Z,te,X=[];for(let ae=0;ae<P.length&&!((O-=2)<0);++ae)$=P.charCodeAt(ae),Z=$>>8,te=$%256,X.push(te),X.push(Z);return X}function de(P){return e.toByteArray(Te(P))}function be(P,O,$,Z){let te;for(te=0;te<Z&&!(te+$>=O.length||te>=P.length);++te)O[te+$]=P[te];return te}function pt(P,O){return P instanceof O||P!=null&&P.constructor!=null&&P.constructor.name!=null&&P.constructor.name===O.name}function Me(P){return P!==P}var Be=function(){let P="0123456789abcdef",O=new Array(256);for(let $=0;$<16;++$){let Z=$*16;for(let te=0;te<16;++te)O[Z+te]=P[$]+P[te]}return O}();function gt(P){return typeof BigInt>"u"?V:P}function V(){throw new Error("BigInt not supported")}}),vKe=Dc((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:IL().Buffer,Crypto:window.crypto}):e.exports={Buffer:IL().Buffer,Crypto:crypto}}),k1e={};uKe(k1e,{AVSCTap:()=>j6,ArweaveSigner:()=>tD,DataItem:()=>L6,MAX_TAG_BYTES:()=>F_,MIN_BINARY_SIZE:()=>nD,SIG_CONFIG:()=>Eg,SignatureConfig:()=>uu,Signer:()=>B1e,createData:()=>C1e,deserializeTags:()=>B_,indexToType:()=>rD,serializeTags:()=>iD,tagsExceedLimit:()=>N1e});var B1e=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,s){throw new Error("You must implement verify method on child")}},mKe=K1(eD(),1),uh=K1(I1e(),1);async function P1e(t){if(Array.isArray(t)){let n=(0,uh.concatBuffers)([(0,uh.stringToBuffer)("list"),(0,uh.stringToBuffer)(t.length.toString())]);return await O1e(t,await Nc().hash(n,"SHA-384"))}let e=t,r=(0,uh.concatBuffers)([(0,uh.stringToBuffer)("blob"),(0,uh.stringToBuffer)(e.byteLength.toString())]),s=(0,uh.concatBuffers)([await Nc().hash(r,"SHA-384"),await Nc().hash(e,"SHA-384")]);return await Nc().hash(s,"SHA-384")}async function O1e(t,e){if(t.length<1)return e;let r=(0,uh.concatBuffers)([e,await P1e(t[0])]),s=await Nc().hash(r,"SHA-384");return await O1e(t.slice(1),s)}var aL=K1(dKe(),1),gKe=aL.default.default?aL.default.default:aL.default,yKe=class extends gKe{getPublicKey(t){throw new Error("Unimplemented")}},bKe;function Nc(){return bKe??=new yKe}var uu;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(uu||(uu={}));var Eg={[uu.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[uu.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[uu.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[uu.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[uu.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[uu.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[uu.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},tD=class{signatureType=1;ownerLength=Eg[1].pubLength;signatureLength=Eg[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return mKe.default.toBuffer(this.pk)}sign(t){return Nc().sign(this.jwk,t)}static async verify(t,e,r){return await Nc().verify(t,e,r)}},rD={1:tD},bl=K1(eD(),1);async function kL(t){return P1e([(0,uh.stringToBuffer)("dataitem"),(0,uh.stringToBuffer)("1"),(0,uh.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function wKe(t,e){let r=await kL(t),s=await e.sign(r),n=await Nc().hash(s);return{signature:Re.from(s),id:Re.from(n)}}async function _Ke(t,e){let{signature:r,id:s}=await wKe(t,e);return t.getRaw().set(r,2),s}var j6=class{buf;pos;constructor(t=Re.alloc(F_),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let s=t[r];if(s?.name===void 0||s?.value===void 0)throw new Error(`Invalid tag format for ${s}, expected {name:string, value: string}`);this.writeString(s.name),this.writeString(s.value)}this.writeLong(0)}toBuffer(){let t=Re.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,s;if(t>=-1073741824&&t<1073741824){s=t>=0?t<<1:~t<<1|1;do e[this.pos]=s&127,s>>=7;while(s&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=Re.byteLength(t),r=this.buf;this.writeLong(e);let s=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let n,h,d,v;for(n=0,h=e;n<h;n++)d=t.charCodeAt(n),d<128?r[s++]=d:d<2048?(r[s++]=d>>6|192,r[s++]=d&63|128):(d&64512)===55296&&((v=t.charCodeAt(n+1))&64512)===56320?(d=65536+((d&1023)<<10)+(v&1023),n++,r[s++]=d>>18|240,r[s++]=d>>12&63|128,r[s++]=d>>6&63|128,r[s++]=d&63|128):(r[s++]=d>>12|224,r[s++]=d>>6&63|128,r[s++]=d&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,s,n,h,d;do s=r[this.pos++],n=s&128,t|=(s&127)<<e,e+=7;while(n&&e<28);if(n){h=t,d=268435456;do s=r[this.pos++],h+=(s&127)*d,d*=128;while(s&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),s=this.readString();t.push({name:r,value:s})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function iD(t){let e=new j6;return e.writeTags(t),e.toBuffer()}function N1e(t){let e=new j6;return e.writeTags(t),e.tagsExceedLimit()}function B_(t){return new j6(t).readTags()}function yd(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function MKe(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let s=t&255;e[r]=s,t=(t-s)/256}return Uint8Array.from(e)}function Yde(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let s=t&255;e[r]=s,t=(t-s)/256}return Uint8Array.from(e)}var xKe=K1(vKe(),1),ag=K1(IL(),1),F_=4096,nD=80,L6=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=yd(this.binary.subarray(0,2));if(uu?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return L6.verify(this.binary)}get id(){return(async()=>bl.default.encode(await this.rawId))()}set id(t){this._id=bl.default.toBuffer(t)}get rawId(){return(async()=>ag.Buffer.from(await xKe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return bl.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Eg[this.signatureType].sigLength}get owner(){return bl.default.encode(this.rawOwner)}get ownerLength(){return Eg[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):ag.Buffer.alloc(0)}get target(){return bl.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):ag.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=yd(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(yd(this.binary.subarray(t,t+8))==0)return[];let e=yd(this.binary.subarray(t+8,t+16));return B_(ag.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:bl.default.encode(t.name),value:bl.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yd(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yd(e),s=t+16+r;return this.binary.subarray(s,this.binary.length)}get data(){return bl.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await _Ke(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=ag.Buffer.from(await Nc().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:bl.default.encode(t.name),value:bl.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<nD)return!1;let e=new L6(t),r=e.signatureType,s=e.getTagsStart(),n=yd(t.subarray(s,s+8)),h=t.subarray(s+8,s+16),d=yd(h);if(d>F_)return!1;if(n>0)try{if(B_(ag.Buffer.from(t.subarray(s+16,s+16+d))).length!==n)return!1}catch{return!1}let v=rD[r],w=await kL(e);return await v.verify(e.rawOwner,w,e.rawSignature)}async getSignatureData(){return kL(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),s=this.binary[r]==1;return r+=s?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},SKe=K1(eD(),1);function C1e(t,e,r){let s=e.publicKey,n=r?.target?SKe.default.toBuffer(r.target):null,h=1+(n?.byteLength??0),d=r?.anchor?Re.from(r.anchor):null,v=1+(d?.byteLength??0),w=(r?.tags?.length??0)>0?iD(r.tags):null,g=16+(w?w.byteLength:0),y=Re.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+v+g+M,S=Re.alloc(x);if(S.set(MKe(e.signatureType),0),S.set(new Uint8Array(e.signatureLength).fill(0),2),s.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${s.byteLength}`);S.set(s,2+e.signatureLength);let E=2+e.signatureLength+e.ownerLength;if(S[E]=n?1:0,n){if(n.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${n.byteLength}`);S.set(n,E+1)}let T=E+h,k=T+1;if(S[T]=d?1:0,d){if(k+=d.byteLength,d.byteLength!==32)throw new Error("Anchor must be 32 bytes");S.set(d,T+1)}S.set(Yde(r?.tags?.length??0),k);let B=Yde(w?.byteLength??0);S.set(B,k+8),w&&S.set(w,k+16);let C=k+g;return S.set(y,C),new L6(S)}var aD={...k1e};globalThis.arbundles??=aD;var EKe=aD,AKe=aD;globalThis.Buffer||(globalThis.Buffer=A1e.Buffer);var{DataItem:RKe}=R1e;function TKe(t){return async({data:r,tags:s,target:n,anchor:h,createDataItem:d=v=>new RKe(v)})=>{let v=await t.signDataItem({data:r,tags:s,target:n,anchor:h}),w=d(A1e.Buffer.from(v));return{id:await w.id,raw:await w.getRaw()}}}var IKe=globalThis.GATEWAY_URL||void 0,kKe=globalThis.MU_URL||void 0,BKe=globalThis.CU_URL||void 0,PKe=globalThis.GRAPHQL_URL||void 0,{result:Txt,results:Ixt,message:kxt,spawn:Bxt,monitor:Pxt,unmonitor:Oxt,dryrun:Nxt,assign:Cxt}=Gs({GATEWAY_URL:IKe,MU_URL:kKe,CU_URL:BKe,GRAPHQL_URL:PKe}),$1e=E1e.createDataItemSigner;se();ue();fe();var Ive=Ni(Tve(),1),J_=Ive.default.init({host:"arweave.net",port:443,protocol:"https"});se();ue();fe();se();ue();fe();var mh=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},kve=class extends mh{},Bve=class extends mh{},Pve=class extends mh{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},Ove=class extends mh{},Y_=class extends mh{},Nve=class extends mh{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Rl=class extends mh{constructor(){super("Invalid contract configuration")}},Cve=class extends mh{constructor(){super("Invalid process configuration")}},$ve=class extends mh{};se();ue();fe();var Sh=Ni(H3e(),1);se();ue();fe();var Jg="3.11.0-alpha.10";var Lo=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,Sh.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:Jg},format:Sh.format.combine(Sh.format.timestamp(),Sh.format.json()),transports:[new Sh.transports.Console({format:Sh.format.combine(Sh.format.timestamp(),Sh.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};se();ue();fe();se();ue();fe();var W3e=t=>{let e=Object.entries(t).sort(([r,s],[n,h])=>r==="@"?-1:n==="@"?1:"priority"in s&&!("priority"in h)?-1:!("priority"in s)&&"priority"in h?1:s.priority!==void 0&&h.priority!==void 0?s.priority===h.priority?r<n?-1:r>n?1:0:s.priority-h.priority:r<n?-1:r>n?1:0);return Object.fromEntries(e.map(([r,s],n)=>[r,{...s,index:n}]))};se();ue();fe();function Ol(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}se();ue();fe();se();ue();fe();se();ue();fe();Df();var K3e="+",Z3e="/",V3e="-",G3e="_",J3e="=";function Dst(t){let e=t.length%4;return e&&(t+=J3e.repeat(4-e)),t.replaceAll(V3e,K3e).replaceAll(G3e,Z3e)}function Ust(t){return t.replaceAll(K3e,V3e).replaceAll(Z3e,G3e).replaceAll(J3e,"")}function fCt(t){let e=Dst(t);return Re.from(e,"base64")}function bu(t){let e=t.toString("base64");return Ust(e)}function uCt(t){return bu(Fo("sha256").update(Uint8Array.from(t)).digest())}function Y3e(t=32){let e=CP(t);return Array.from(e,r=>r.toString(16).padStart(2,"0")).join("").slice(0,t)}se();ue();fe();se();ue();fe();function cF(t){try{return JSON.parse(t)}catch{return t}}se();ue();fe();se();ue();fe();var pF=Ni(Q3e(),1);se();ue();fe();var jst=Object.defineProperty,zst=(t,e,r)=>e in t?jst(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$3=(t,e,r)=>(zst(t,typeof e!="symbol"?e+"":e,r),r),vF=class{constructor(e){$3(this,"value"),$3(this,"next"),this.value=e}},mF=class{constructor(){$3(this,"head"),$3(this,"tail"),$3(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(e){let r=new vF(e);return this.head&&this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),this._size++,this._size}pop(){if(!this.head)return;let e=this.head;return this.head=this.head.next,this._size--,e.value}get size(){return this._size}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}};function ewe(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let e=new mF,r=0,s=()=>{r--,e.size>0&&e.pop()()},n=async(v,w,g)=>{r++;let y=(async()=>v(...g))();w(y);try{await y}catch{}s()},h=(v,w,g)=>{e.push(n.bind(null,v,w,g)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.pop()()))()},d=(v,...w)=>new Promise(g=>{h(v,g,w)});return Object.defineProperties(d,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),d}se();ue();fe();var L3=class{static init(e){return e!==void 0&&"signer"in e?new gF(e):new oM(e)}},oM=class{process;constructor(e){if(e===void 0||Object.keys(e).length===0)this.process=new Zn({processId:ig});else if(Cd(e))this.process=e.process;else if($d(e))this.process=new Zn({processId:e.processId});else throw new Rl}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},gF=class extends oM{signer;constructor({signer:e,...r}){super(r),this.signer=Nd(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};se();ue();fe();se();ue();fe();var Hst="https://faucet.ario.permaweb.services";function bF({arioInstance:t,faucetApiUrl:e=Hst}){let r=new yF({faucetUrl:e,processId:t.process.processId});return new Proxy(t,{get(n,h){if(h==="faucet")return r;if(h in n){let d=n[h];return typeof d=="function"?d.bind(n):d}}})}var yF=class{faucetUrl;processId;constructor({faucetUrl:e,processId:r}){this.faucetUrl=e,this.processId=r}async captchaUrl(){let e=await fetch(`${this.faucetUrl}/api/captcha/url?process-id=${this.processId}`,{method:"GET"});if(!e.ok){let s=await e.json().catch(()=>({error:e.statusText}));throw new Error(s.error)}return await e.json()}async claimWithCaptchaResponse({captchaResponse:e,recipient:r,quantity:s}){let n=await fetch(`${this.faucetUrl}/api/claim/sync`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({processId:this.processId,recipient:r,quantity:s,captchaResponse:e})});if(!n.ok){let d=await n.json().catch(()=>({error:n.statusText}));throw new Error(d.error)}return await n.json()}async requestAuthToken({captchaResponse:e}){let r=await fetch(`${this.faucetUrl}/api/captcha/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({processId:this.processId,captchaResponse:e})});if(!r.ok){let n=await r.json().catch(()=>({error:r.statusText}));throw new Error(n.error)}return await r.json()}async claimWithAuthToken({authToken:e,recipient:r,quantity:s}){let n=await fetch(`${this.faucetUrl}/api/claim/async`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({recipient:r,qty:s,processId:this.processId})});if(!n.ok){let d=await n.json().catch(()=>({error:n.statusText}));throw new Error(d.error)}return await n.json()}async verifyAuthToken({authToken:e}){let r=await fetch(`${this.faucetUrl}/api/token/verify?process-id=${this.processId}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});if(!r.ok){let n=await r.json().catch(()=>({error:r.statusText}));throw new Error(n.error)}return await r.json()}};se();ue();fe();se();ue();fe();se();ue();fe();var go=[];for(sM=0;sM<256;++sM)go.push((sM+256).toString(16).slice(1));var sM;function twe(t,e=0){return(go[t[e+0]]+go[t[e+1]]+go[t[e+2]]+go[t[e+3]]+"-"+go[t[e+4]]+go[t[e+5]]+"-"+go[t[e+6]]+go[t[e+7]]+"-"+go[t[e+8]]+go[t[e+9]]+"-"+go[t[e+10]]+go[t[e+11]]+go[t[e+12]]+go[t[e+13]]+go[t[e+14]]+go[t[e+15]]).toLowerCase()}se();ue();fe();var fM,Wst=new Uint8Array(16);function wF(){if(!fM&&(fM=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!fM))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fM(Wst)}se();ue();fe();se();ue();fe();var Kst=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),_F={randomUUID:Kst};function Zst(t,e,r){if(_F.randomUUID&&!e&&!t)return _F.randomUUID();t=t||{};var s=t.random||(t.rng||wF)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){r=r||0;for(var n=0;n<16;++n)e[r+n]=s[n];return e}return twe(s)}var MF=Zst;se();ue();fe();var xF=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},SF=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("ARIOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMARIO(){return new D3(Math.floor(this.value*V$))}toString(){return`${this.value}`}},D3=class t extends xF{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toARIO(){return new SF(this.valueOf()/V$)}};se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();function U3(t,e){return function(){return t.apply(e,arguments)}}var{toString:Vst}=Object.prototype,{getPrototypeOf:AF}=Object,hM=(t=>e=>{let r=Vst.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Eh=t=>(t=t.toLowerCase(),e=>hM(e)===t),lM=t=>e=>typeof e===t,{isArray:Yg}=Array,q3=lM("undefined");function Gst(t){return t!==null&&!q3(t)&&t.constructor!==null&&!q3(t.constructor)&&rf(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var iwe=Eh("ArrayBuffer");function Jst(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&iwe(t.buffer),e}var Yst=lM("string"),rf=lM("function"),nwe=lM("number"),cM=t=>t!==null&&typeof t=="object",Xst=t=>t===!0||t===!1,uM=t=>{if(hM(t)!=="object")return!1;let e=AF(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Qst=Eh("Date"),eft=Eh("File"),tft=Eh("Blob"),rft=Eh("FileList"),ift=t=>cM(t)&&rf(t.pipe),nft=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||rf(t.append)&&((e=hM(t))==="formdata"||e==="object"&&rf(t.toString)&&t.toString()==="[object FormData]"))},aft=Eh("URLSearchParams"),[oft,sft,fft,uft]=["ReadableStream","Request","Response","Headers"].map(Eh),hft=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function F3(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,n;if(typeof t!="object"&&(t=[t]),Yg(t))for(s=0,n=t.length;s<n;s++)e.call(null,t[s],s,t);else{let h=r?Object.getOwnPropertyNames(t):Object.keys(t),d=h.length,v;for(s=0;s<d;s++)v=h[s],e.call(null,t[v],v,t)}}function awe(t,e){e=e.toLowerCase();let r=Object.keys(t),s=r.length,n;for(;s-- >0;)if(n=r[s],e===n.toLowerCase())return n;return null}var cv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,owe=t=>!q3(t)&&t!==cv;function EF(){let{caseless:t}=owe(this)&&this||{},e={},r=(s,n)=>{let h=t&&awe(e,n)||n;uM(e[h])&&uM(s)?e[h]=EF(e[h],s):uM(s)?e[h]=EF({},s):Yg(s)?e[h]=s.slice():e[h]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&F3(arguments[s],r);return e}var lft=(t,e,r,{allOwnKeys:s}={})=>(F3(e,(n,h)=>{r&&rf(n)?t[h]=U3(n,r):t[h]=n},{allOwnKeys:s}),t),cft=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),dft=(t,e,r,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},pft=(t,e,r,s)=>{let n,h,d,v={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),h=n.length;h-- >0;)d=n[h],(!s||s(d,t,e))&&!v[d]&&(e[d]=t[d],v[d]=!0);t=r!==!1&&AF(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},vft=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let s=t.indexOf(e,r);return s!==-1&&s===r},mft=t=>{if(!t)return null;if(Yg(t))return t;let e=t.length;if(!nwe(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},gft=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&AF(Uint8Array)),yft=(t,e)=>{let s=(t&&t[Symbol.iterator]).call(t),n;for(;(n=s.next())&&!n.done;){let h=n.value;e.call(t,h[0],h[1])}},bft=(t,e)=>{let r,s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},wft=Eh("HTMLFormElement"),_ft=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,s,n){return s.toUpperCase()+n}),rwe=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Mft=Eh("RegExp"),swe=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),s={};F3(r,(n,h)=>{let d;(d=e(n,h,t))!==!1&&(s[h]=d||n)}),Object.defineProperties(t,s)},xft=t=>{swe(t,(e,r)=>{if(rf(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let s=t[r];if(rf(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Sft=(t,e)=>{let r={},s=n=>{n.forEach(h=>{r[h]=!0})};return Yg(t)?s(t):s(String(t).split(e)),r},Eft=()=>{},Aft=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Rft(t){return!!(t&&rf(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var Tft=t=>{let e=new Array(10),r=(s,n)=>{if(cM(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[n]=s;let h=Yg(s)?[]:{};return F3(s,(d,v)=>{let w=r(d,n+1);!q3(w)&&(h[v]=w)}),e[n]=void 0,h}}return s};return r(t,0)},Ift=Eh("AsyncFunction"),kft=t=>t&&(cM(t)||rf(t))&&rf(t.then)&&rf(t.catch),fwe=((t,e)=>t?setImmediate:e?((r,s)=>(cv.addEventListener("message",({source:n,data:h})=>{n===cv&&h===r&&s.length&&s.shift()()},!1),n=>{s.push(n),cv.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",rf(cv.postMessage)),Bft=typeof queueMicrotask<"u"?queueMicrotask.bind(cv):typeof Ce<"u"&&Ce.nextTick||fwe,Tt={isArray:Yg,isArrayBuffer:iwe,isBuffer:Gst,isFormData:nft,isArrayBufferView:Jst,isString:Yst,isNumber:nwe,isBoolean:Xst,isObject:cM,isPlainObject:uM,isReadableStream:oft,isRequest:sft,isResponse:fft,isHeaders:uft,isUndefined:q3,isDate:Qst,isFile:eft,isBlob:tft,isRegExp:Mft,isFunction:rf,isStream:ift,isURLSearchParams:aft,isTypedArray:gft,isFileList:rft,forEach:F3,merge:EF,extend:lft,trim:hft,stripBOM:cft,inherits:dft,toFlatObject:pft,kindOf:hM,kindOfTest:Eh,endsWith:vft,toArray:mft,forEachEntry:yft,matchAll:bft,isHTMLForm:wft,hasOwnProperty:rwe,hasOwnProp:rwe,reduceDescriptors:swe,freezeMethods:xft,toObjectSet:Sft,toCamelCase:_ft,noop:Eft,toFiniteNumber:Aft,findKey:awe,global:cv,isContextDefined:owe,isSpecCompliantForm:Rft,toJSONObject:Tft,isAsyncFn:Ift,isThenable:kft,setImmediate:fwe,asap:Bft};se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();function Xg(t,e,r,s,n){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),r&&(this.config=r),s&&(this.request=s),n&&(this.response=n,this.status=n.status?n.status:null)}Tt.inherits(Xg,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:Tt.toJSONObject(this.config),code:this.code,status:this.status}}});var uwe=Xg.prototype,hwe={};["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=>{hwe[t]={value:t}});Object.defineProperties(Xg,hwe);Object.defineProperty(uwe,"isAxiosError",{value:!0});Xg.from=(t,e,r,s,n,h)=>{let d=Object.create(uwe);return Tt.toFlatObject(t,d,function(w){return w!==Error.prototype},v=>v!=="isAxiosError"),Xg.call(d,t.message,e,r,s,n),d.cause=t,d.name=t.name,h&&Object.assign(d,h),d};var Fr=Xg;se();ue();fe();var dM=null;function RF(t){return Tt.isPlainObject(t)||Tt.isArray(t)}function cwe(t){return Tt.endsWith(t,"[]")?t.slice(0,-2):t}function lwe(t,e,r){return t?t.concat(e).map(function(n,h){return n=cwe(n),!r&&h?"["+n+"]":n}).join(r?".":""):e}function Pft(t){return Tt.isArray(t)&&!t.some(RF)}var Oft=Tt.toFlatObject(Tt,{},null,function(e){return/^is[A-Z]/.test(e)});function Nft(t,e,r){if(!Tt.isObject(t))throw new TypeError("target must be an object");e=e||new(dM||FormData),r=Tt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,k){return!Tt.isUndefined(k[T])});let s=r.metaTokens,n=r.visitor||y,h=r.dots,d=r.indexes,w=(r.Blob||typeof Blob<"u"&&Blob)&&Tt.isSpecCompliantForm(e);if(!Tt.isFunction(n))throw new TypeError("visitor must be a function");function g(E){if(E===null)return"";if(Tt.isDate(E))return E.toISOString();if(!w&&Tt.isBlob(E))throw new Fr("Blob is not supported. Use a Buffer instead.");return Tt.isArrayBuffer(E)||Tt.isTypedArray(E)?w&&typeof Blob=="function"?new Blob([E]):Re.from(E):E}function y(E,T,k){let B=E;if(E&&!k&&typeof E=="object"){if(Tt.endsWith(T,"{}"))T=s?T:T.slice(0,-2),E=JSON.stringify(E);else if(Tt.isArray(E)&&Pft(E)||(Tt.isFileList(E)||Tt.endsWith(T,"[]"))&&(B=Tt.toArray(E)))return T=cwe(T),B.forEach(function(N,W){!(Tt.isUndefined(N)||N===null)&&e.append(d===!0?lwe([T],W,h):d===null?T:T+"[]",g(N))}),!1}return RF(E)?!0:(e.append(lwe(k,T,h),g(E)),!1)}let M=[],x=Object.assign(Oft,{defaultVisitor:y,convertValue:g,isVisitable:RF});function S(E,T){if(!Tt.isUndefined(E)){if(M.indexOf(E)!==-1)throw Error("Circular reference detected in "+T.join("."));M.push(E),Tt.forEach(E,function(B,C){(!(Tt.isUndefined(B)||B===null)&&n.call(e,B,Tt.isString(C)?C.trim():C,T,x))===!0&&S(B,T?T.concat(C):[C])}),M.pop()}}if(!Tt.isObject(t))throw new TypeError("data must be an object");return S(t),e}var Ld=Nft;function dwe(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function pwe(t,e){this._pairs=[],t&&Ld(t,this,e)}var vwe=pwe.prototype;vwe.append=function(e,r){this._pairs.push([e,r])};vwe.toString=function(e){let r=e?function(s){return e.call(this,s,dwe)}:dwe;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var pM=pwe;function Cft(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function j3(t,e,r){if(!e)return t;let s=r&&r.encode||Cft;Tt.isFunction(r)&&(r={serialize:r});let n=r&&r.serialize,h;if(n?h=n(e,r):h=Tt.isURLSearchParams(e)?e.toString():new pM(e,r).toString(s),h){let d=t.indexOf("#");d!==-1&&(t=t.slice(0,d)),t+=(t.indexOf("?")===-1?"?":"&")+h}return t}se();ue();fe();var TF=class{constructor(){this.handlers=[]}use(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Tt.forEach(this.handlers,function(s){s!==null&&e(s)})}},IF=TF;se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();var vM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};se();ue();fe();se();ue();fe();se();ue();fe();se();ue();fe();var mwe=typeof URLSearchParams<"u"?URLSearchParams:pM;se();ue();fe();var gwe=typeof FormData<"u"?FormData:null;se();ue();fe();var ywe=typeof Blob<"u"?Blob:null;var bwe={isBrowser:!0,classes:{URLSearchParams:mwe,FormData:gwe,Blob:ywe},protocols:["http","https","file","blob","url","data"]};var PF={};qo(PF,{hasBrowserEnv:()=>BF,hasStandardBrowserEnv:()=>$ft,hasStandardBrowserWebWorkerEnv:()=>Lft,navigator:()=>kF,origin:()=>Dft});se();ue();fe();var BF=typeof window<"u"&&typeof document<"u",kF=typeof navigator=="object"&&navigator||void 0,$ft=BF&&(!kF||["ReactNative","NativeScript","NS"].indexOf(kF.product)<0),Lft=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dft=BF&&window.location.href||"http://localhost";var Vn={...PF,...bwe};function OF(t,e){return Ld(t,new Vn.classes.URLSearchParams,Object.assign({visitor:function(r,s,n,h){return Vn.isNode&&Tt.isBuffer(r)?(this.append(s,r.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},e))}se();ue();fe();function Uft(t){return Tt.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function qft(t){let e={},r=Object.keys(t),s,n=r.length,h;for(s=0;s<n;s++)h=r[s],e[h]=t[h];return e}function Fft(t){function e(r,s,n,h){let d=r[h++];if(d==="__proto__")return!0;let v=Number.isFinite(+d),w=h>=r.length;return d=!d&&Tt.isArray(n)?n.length:d,w?(Tt.hasOwnProp(n,d)?n[d]=[n[d],s]:n[d]=s,!v):((!n[d]||!Tt.isObject(n[d]))&&(n[d]=[]),e(r,s,n[d],h)&&Tt.isArray(n[d])&&(n[d]=qft(n[d])),!v)}if(Tt.isFormData(t)&&Tt.isFunction(t.entries)){let r={};return Tt.forEachEntry(t,(s,n)=>{e(Uft(s),n,r,0)}),r}return null}var mM=Fft;function jft(t,e,r){if(Tt.isString(t))try{return(e||JSON.parse)(t),Tt.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}var NF={transitional:vM,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let s=r.getContentType()||"",n=s.indexOf("application/json")>-1,h=Tt.isObject(e);if(h&&Tt.isHTMLForm(e)&&(e=new FormData(e)),Tt.isFormData(e))return n?JSON.stringify(mM(e)):e;if(Tt.isArrayBuffer(e)||Tt.isBuffer(e)||Tt.isStream(e)||Tt.isFile(e)||Tt.isBlob(e)||Tt.isReadableStream(e))return e;if(Tt.isArrayBufferView(e))return e.buffer;if(Tt.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let v;if(h){if(s.indexOf("application/x-www-form-urlencoded")>-1)return OF(e,this.formSerializer).toString();if((v=Tt.isFileList(e))||s.indexOf("multipart/form-data")>-1){let w=this.env&&this.env.FormData;return Ld(v?{"files[]":e}:e,w&&new w,this.formSerializer)}}return h||n?(r.setContentType("application/json",!1),jft(e)):e}],transformResponse:[function(e){let r=this.transitional||NF.transitional,s=r&&r.forcedJSONParsing,n=this.responseType==="json";if(Tt.isResponse(e)||Tt.isReadableStream(e))return e;if(e&&Tt.isString(e)&&(s&&!this.responseType||n)){let d=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(v){if(d)throw v.name==="SyntaxError"?Fr.from(v,Fr.ERR_BAD_RESPONSE,this,null,this.response):v}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vn.classes.FormData,Blob:Vn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Tt.forEach(["delete","get","head","post","put","patch"],t=>{NF.headers[t]={}});var Qg=NF;se();ue();fe();se();ue();fe();var zft=Tt.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"]),wwe=t=>{let e={},r,s,n;return t&&t.split(`
216
216
  `).forEach(function(d){n=d.indexOf(":"),r=d.substring(0,n).trim().toLowerCase(),s=d.substring(n+1).trim(),!(!r||e[r]&&zft[r])&&(r==="set-cookie"?e[r]?e[r].push(s):e[r]=[s]:e[r]=e[r]?e[r]+", "+s:s)}),e};var _we=Symbol("internals");function z3(t){return t&&String(t).trim().toLowerCase()}function gM(t){return t===!1||t==null?t:Tt.isArray(t)?t.map(gM):String(t)}function Hft(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,s;for(;s=r.exec(t);)e[s[1]]=s[2];return e}var Wft=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function CF(t,e,r,s,n){if(Tt.isFunction(s))return s.call(this,e,r);if(n&&(e=r),!!Tt.isString(e)){if(Tt.isString(s))return e.indexOf(s)!==-1;if(Tt.isRegExp(s))return s.test(e)}}function Kft(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,s)=>r.toUpperCase()+s)}function Zft(t,e){let r=Tt.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+r,{value:function(n,h,d){return this[s].call(this,e,n,h,d)},configurable:!0})})}var ey=class{constructor(e){e&&this.set(e)}set(e,r,s){let n=this;function h(v,w,g){let y=z3(w);if(!y)throw new Error("header name must be a non-empty string");let M=Tt.findKey(n,y);(!M||n[M]===void 0||g===!0||g===void 0&&n[M]!==!1)&&(n[M||w]=gM(v))}let d=(v,w)=>Tt.forEach(v,(g,y)=>h(g,y,w));if(Tt.isPlainObject(e)||e instanceof this.constructor)d(e,r);else if(Tt.isString(e)&&(e=e.trim())&&!Wft(e))d(wwe(e),r);else if(Tt.isHeaders(e))for(let[v,w]of e.entries())h(w,v,s);else e!=null&&h(r,e,s);return this}get(e,r){if(e=z3(e),e){let s=Tt.findKey(this,e);if(s){let n=this[s];if(!r)return n;if(r===!0)return Hft(n);if(Tt.isFunction(r))return r.call(this,n,s);if(Tt.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=z3(e),e){let s=Tt.findKey(this,e);return!!(s&&this[s]!==void 0&&(!r||CF(this,this[s],s,r)))}return!1}delete(e,r){let s=this,n=!1;function h(d){if(d=z3(d),d){let v=Tt.findKey(s,d);v&&(!r||CF(s,s[v],v,r))&&(delete s[v],n=!0)}}return Tt.isArray(e)?e.forEach(h):h(e),n}clear(e){let r=Object.keys(this),s=r.length,n=!1;for(;s--;){let h=r[s];(!e||CF(this,this[h],h,e,!0))&&(delete this[h],n=!0)}return n}normalize(e){let r=this,s={};return Tt.forEach(this,(n,h)=>{let d=Tt.findKey(s,h);if(d){r[d]=gM(n),delete r[h];return}let v=e?Kft(h):String(h).trim();v!==h&&delete r[h],r[v]=gM(n),s[v]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let r=Object.create(null);return Tt.forEach(this,(s,n)=>{s!=null&&s!==!1&&(r[n]=e&&Tt.isArray(s)?s.join(", "):s)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
217
217
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){let s=new this(e);return r.forEach(n=>s.set(n)),s}static accessor(e){let s=(this[_we]=this[_we]={accessors:{}}).accessors,n=this.prototype;function h(d){let v=z3(d);s[v]||(Zft(n,d),s[v]=!0)}return Tt.isArray(e)?e.forEach(h):h(e),this}};ey.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Tt.reduceDescriptors(ey.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}});Tt.freezeMethods(ey);var $a=ey;function H3(t,e){let r=this||Qg,s=e||r,n=$a.from(s.headers),h=s.data;return Tt.forEach(t,function(v){h=v.call(r,h,n.normalize(),e?e.status:void 0)}),n.normalize(),h}se();ue();fe();function W3(t){return!!(t&&t.__CANCEL__)}se();ue();fe();function Mwe(t,e,r){Fr.call(this,t??"canceled",Fr.ERR_CANCELED,e,r),this.name="CanceledError"}Tt.inherits(Mwe,Fr,{__CANCEL__:!0});var Nl=Mwe;se();ue();fe();se();ue();fe();se();ue();fe();function K3(t,e,r){let s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new Fr("Request failed with status code "+r.status,[Fr.ERR_BAD_REQUEST,Fr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}se();ue();fe();function $F(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}se();ue();fe();se();ue();fe();function Vft(t,e){t=t||10;let r=new Array(t),s=new Array(t),n=0,h=0,d;return e=e!==void 0?e:1e3,function(w){let g=Date.now(),y=s[h];d||(d=g),r[n]=w,s[n]=g;let M=h,x=0;for(;M!==n;)x+=r[M++],M=M%t;if(n=(n+1)%t,n===h&&(h=(h+1)%t),g-d<e)return;let S=y&&g-y;return S?Math.round(x*1e3/S):void 0}}var xwe=Vft;se();ue();fe();function Gft(t,e){let r=0,s=1e3/e,n,h,d=(g,y=Date.now())=>{r=y,n=null,h&&(clearTimeout(h),h=null),t.apply(null,g)};return[(...g)=>{let y=Date.now(),M=y-r;M>=s?d(g,y):(n=g,h||(h=setTimeout(()=>{h=null,d(n)},s-M)))},()=>n&&d(n)]}var Swe=Gft;var ty=(t,e,r=3)=>{let s=0,n=xwe(50,250);return Swe(h=>{let d=h.loaded,v=h.lengthComputable?h.total:void 0,w=d-s,g=n(w),y=d<=v;s=d;let M={loaded:d,total:v,progress:v?d/v:void 0,bytes:w,rate:g||void 0,estimated:g&&v&&y?(v-d)/g:void 0,event:h,lengthComputable:v!=null,[e?"download":"upload"]:!0};t(M)},r)},LF=(t,e)=>{let r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},DF=t=>(...e)=>Tt.asap(()=>t(...e));se();ue();fe();se();ue();fe();var Ewe=Vn.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,Vn.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(Vn.origin),Vn.navigator&&/(msie|trident)/i.test(Vn.navigator.userAgent)):()=>!0;se();ue();fe();var Awe=Vn.hasStandardBrowserEnv?{write(t,e,r,s,n,h){let d=[t+"="+encodeURIComponent(e)];Tt.isNumber(r)&&d.push("expires="+new Date(r).toGMTString()),Tt.isString(s)&&d.push("path="+s),Tt.isString(n)&&d.push("domain="+n),h===!0&&d.push("secure"),document.cookie=d.join("; ")},read(t){let 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(){}};se();ue();fe();se();ue();fe();function UF(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}se();ue();fe();function qF(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Z3(t,e,r){let s=!UF(e);return t&&(s||r==!1)?qF(t,e):e}se();ue();fe();var Rwe=t=>t instanceof $a?{...t}:t;function Ah(t,e){e=e||{};let r={};function s(g,y,M,x){return Tt.isPlainObject(g)&&Tt.isPlainObject(y)?Tt.merge.call({caseless:x},g,y):Tt.isPlainObject(y)?Tt.merge({},y):Tt.isArray(y)?y.slice():y}function n(g,y,M,x){if(Tt.isUndefined(y)){if(!Tt.isUndefined(g))return s(void 0,g,M,x)}else return s(g,y,M,x)}function h(g,y){if(!Tt.isUndefined(y))return s(void 0,y)}function d(g,y){if(Tt.isUndefined(y)){if(!Tt.isUndefined(g))return s(void 0,g)}else return s(void 0,y)}function v(g,y,M){if(M in e)return s(g,y);if(M in t)return s(void 0,g)}let w={url:h,method:h,data:h,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,withXSRFToken:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:v,headers:(g,y,M)=>n(Rwe(g),Rwe(y),M,!0)};return Tt.forEach(Object.keys(Object.assign({},t,e)),function(y){let M=w[y]||n,x=M(t[y],e[y],y);Tt.isUndefined(x)&&M!==v||(r[y]=x)}),r}var yM=t=>{let e=Ah({},t),{data:r,withXSRFToken:s,xsrfHeaderName:n,xsrfCookieName:h,headers:d,auth:v}=e;e.headers=d=$a.from(d),e.url=j3(Z3(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),v&&d.set("Authorization","Basic "+btoa((v.username||"")+":"+(v.password?unescape(encodeURIComponent(v.password)):"")));let w;if(Tt.isFormData(r)){if(Vn.hasStandardBrowserEnv||Vn.hasStandardBrowserWebWorkerEnv)d.setContentType(void 0);else if((w=d.getContentType())!==!1){let[g,...y]=w?w.split(";").map(M=>M.trim()).filter(Boolean):[];d.setContentType([g||"multipart/form-data",...y].join("; "))}}if(Vn.hasStandardBrowserEnv&&(s&&Tt.isFunction(s)&&(s=s(e)),s||s!==!1&&Ewe(e.url))){let g=n&&h&&Awe.read(h);g&&d.set(n,g)}return e};var Jft=typeof XMLHttpRequest<"u",Twe=Jft&&function(t){return new Promise(function(r,s){let n=yM(t),h=n.data,d=$a.from(n.headers).normalize(),{responseType:v,onUploadProgress:w,onDownloadProgress:g}=n,y,M,x,S,E;function T(){S&&S(),E&&E(),n.cancelToken&&n.cancelToken.unsubscribe(y),n.signal&&n.signal.removeEventListener("abort",y)}let k=new XMLHttpRequest;k.open(n.method.toUpperCase(),n.url,!0),k.timeout=n.timeout;function B(){if(!k)return;let N=$a.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),H={data:!v||v==="text"||v==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:N,config:t,request:k};K3(function(U){r(U),T()},function(U){s(U),T()},H),k=null}"onloadend"in k?k.onloadend=B:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(B)},k.onabort=function(){k&&(s(new Fr("Request aborted",Fr.ECONNABORTED,t,k)),k=null)},k.onerror=function(){s(new Fr("Network Error",Fr.ERR_NETWORK,t,k)),k=null},k.ontimeout=function(){let W=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",H=n.transitional||vM;n.timeoutErrorMessage&&(W=n.timeoutErrorMessage),s(new Fr(W,H.clarifyTimeoutError?Fr.ETIMEDOUT:Fr.ECONNABORTED,t,k)),k=null},h===void 0&&d.setContentType(null),"setRequestHeader"in k&&Tt.forEach(d.toJSON(),function(W,H){k.setRequestHeader(H,W)}),Tt.isUndefined(n.withCredentials)||(k.withCredentials=!!n.withCredentials),v&&v!=="json"&&(k.responseType=n.responseType),g&&([x,E]=ty(g,!0),k.addEventListener("progress",x)),w&&k.upload&&([M,S]=ty(w),k.upload.addEventListener("progress",M),k.upload.addEventListener("loadend",S)),(n.cancelToken||n.signal)&&(y=N=>{k&&(s(!N||N.type?new Nl(null,t,k):N),k.abort(),k=null)},n.cancelToken&&n.cancelToken.subscribe(y),n.signal&&(n.signal.aborted?y():n.signal.addEventListener("abort",y)));let C=$F(n.url);if(C&&Vn.protocols.indexOf(C)===-1){s(new Fr("Unsupported protocol "+C+":",Fr.ERR_BAD_REQUEST,t));return}k.send(h||null)})};se();ue();fe();se();ue();fe();var Yft=(t,e)=>{let{length:r}=t=t?t.filter(Boolean):[];if(e||r){let s=new AbortController,n,h=function(g){if(!n){n=!0,v();let y=g instanceof Error?g:this.reason;s.abort(y instanceof Fr?y:new Nl(y instanceof Error?y.message:y))}},d=e&&setTimeout(()=>{d=null,h(new Fr(`timeout ${e} of ms exceeded`,Fr.ETIMEDOUT))},e),v=()=>{t&&(d&&clearTimeout(d),d=null,t.forEach(g=>{g.unsubscribe?g.unsubscribe(h):g.removeEventListener("abort",h)}),t=null)};t.forEach(g=>g.addEventListener("abort",h));let{signal:w}=s;return w.unsubscribe=()=>Tt.asap(v),w}},Iwe=Yft;se();ue();fe();var Xft=function*(t,e){let r=t.byteLength;if(!e||r<e){yield t;return}let s=0,n;for(;s<r;)n=s+e,yield t.slice(s,n),s=n},Qft=async function*(t,e){for await(let r of eut(t))yield*Xft(r,e)},eut=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}let e=t.getReader();try{for(;;){let{done:r,value:s}=await e.read();if(r)break;yield s}}finally{await e.cancel()}},FF=(t,e,r,s)=>{let n=Qft(t,e),h=0,d,v=w=>{d||(d=!0,s&&s(w))};return new ReadableStream({async pull(w){try{let{done:g,value:y}=await n.next();if(g){v(),w.close();return}let M=y.byteLength;if(r){let x=h+=M;r(x)}w.enqueue(new Uint8Array(y))}catch(g){throw v(g),g}},cancel(w){return v(w),n.return()}},{highWaterMark:2})};var wM=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Bwe=wM&&typeof ReadableStream=="function",tut=wM&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Pwe=(t,...e)=>{try{return!!t(...e)}catch{return!1}},rut=Bwe&&Pwe(()=>{let t=!1,e=new Request(Vn.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),kwe=64*1024,jF=Bwe&&Pwe(()=>Tt.isReadableStream(new Response("").body)),bM={stream:jF&&(t=>t.body)};wM&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!bM[e]&&(bM[e]=Tt.isFunction(t[e])?r=>r[e]():(r,s)=>{throw new Fr(`Response type '${e}' is not supported`,Fr.ERR_NOT_SUPPORT,s)})})})(new Response);var iut=async t=>{if(t==null)return 0;if(Tt.isBlob(t))return t.size;if(Tt.isSpecCompliantForm(t))return(await new Request(Vn.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(Tt.isArrayBufferView(t)||Tt.isArrayBuffer(t))return t.byteLength;if(Tt.isURLSearchParams(t)&&(t=t+""),Tt.isString(t))return(await tut(t)).byteLength},nut=async(t,e)=>{let r=Tt.toFiniteNumber(t.getContentLength());return r??iut(e)},Owe=wM&&(async t=>{let{url:e,method:r,data:s,signal:n,cancelToken:h,timeout:d,onDownloadProgress:v,onUploadProgress:w,responseType:g,headers:y,withCredentials:M="same-origin",fetchOptions:x}=yM(t);g=g?(g+"").toLowerCase():"text";let S=Iwe([n,h&&h.toAbortSignal()],d),E,T=S&&S.unsubscribe&&(()=>{S.unsubscribe()}),k;try{if(w&&rut&&r!=="get"&&r!=="head"&&(k=await nut(y,s))!==0){let H=new Request(e,{method:"POST",body:s,duplex:"half"}),Y;if(Tt.isFormData(s)&&(Y=H.headers.get("content-type"))&&y.setContentType(Y),H.body){let[U,j]=LF(k,ty(DF(w)));s=FF(H.body,kwe,U,j)}}Tt.isString(M)||(M=M?"include":"omit");let B="credentials"in Request.prototype;E=new Request(e,{...x,signal:S,method:r.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:"half",credentials:B?M:void 0});let C=await fetch(E),N=jF&&(g==="stream"||g==="response");if(jF&&(v||N&&T)){let H={};["status","statusText","headers"].forEach(J=>{H[J]=C[J]});let Y=Tt.toFiniteNumber(C.headers.get("content-length")),[U,j]=v&&LF(Y,ty(DF(v),!0))||[];C=new Response(FF(C.body,kwe,U,()=>{j&&j(),T&&T()}),H)}g=g||"text";let W=await bM[Tt.findKey(bM,g)||"text"](C,t);return!N&&T&&T(),await new Promise((H,Y)=>{K3(H,Y,{data:W,headers:$a.from(C.headers),status:C.status,statusText:C.statusText,config:t,request:E})})}catch(B){throw T&&T(),B&&B.name==="TypeError"&&/fetch/i.test(B.message)?Object.assign(new Fr("Network Error",Fr.ERR_NETWORK,t,E),{cause:B.cause||B}):Fr.from(B,B&&B.code,t,E)}});var zF={http:dM,xhr:Twe,fetch:Owe};Tt.forEach(zF,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var Nwe=t=>`- ${t}`,aut=t=>Tt.isFunction(t)||t===null||t===!1,_M={getAdapter:t=>{t=Tt.isArray(t)?t:[t];let{length:e}=t,r,s,n={};for(let h=0;h<e;h++){r=t[h];let d;if(s=r,!aut(r)&&(s=zF[(d=String(r)).toLowerCase()],s===void 0))throw new Fr(`Unknown adapter '${d}'`);if(s)break;n[d||"#"+h]=s}if(!s){let h=Object.entries(n).map(([v,w])=>`adapter ${v} `+(w===!1?"is not supported by the environment":"is not available in the build")),d=e?h.length>1?`since :
218
218
  `+h.map(Nwe).join(`
@@ -164,10 +164,6 @@ function aoProcessFromOptions(options) {
164
164
  }
165
165
  function readARIOFromOptions(options) {
166
166
  setLoggerIfDebug(options);
167
- console.log('options', {
168
- cuUrl: 'https://cu.ardrive.io', // default to ardrive cu for ARIO process
169
- ...options,
170
- });
171
167
  return index_js_1.ARIO.init({
172
168
  process: aoProcessFromOptions({
173
169
  cuUrl: 'https://cu.ardrive.io', // default to ardrive cu for ARIO process
@@ -17,4 +17,4 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.version = void 0;
19
19
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
20
- exports.version = '3.11.0-alpha.10';
20
+ exports.version = '3.11.0-alpha.11';
@@ -116,10 +116,6 @@ function aoProcessFromOptions(options) {
116
116
  }
117
117
  export function readARIOFromOptions(options) {
118
118
  setLoggerIfDebug(options);
119
- console.log('options', {
120
- cuUrl: 'https://cu.ardrive.io', // default to ardrive cu for ARIO process
121
- ...options,
122
- });
123
119
  return ARIO.init({
124
120
  process: aoProcessFromOptions({
125
121
  cuUrl: 'https://cu.ardrive.io', // default to ardrive cu for ARIO process
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '3.11.0-alpha.10';
17
+ export const version = '3.11.0-alpha.11';
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const version = "3.11.0-alpha.9";
16
+ export declare const version = "3.11.0-alpha.10";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "3.11.0-alpha.10",
3
+ "version": "3.11.0-alpha.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"