1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[137],{570:(e,t,r)=>{"use strict";r.d(t,{o:()=>b});var n=r(79175),a=r(64527),i=r(62270),o=r(82248),s=r(76825),l=r(94393),c=r(51049),u=r(44241),p=r(41903),h=r(97569),d=r(59551),f=r(80591),g=r(79463),m=r(32460),y=r(23151);let w={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},v=(0,l.V)((e,t)=>{let{size:r}=t;return{label:{"--input-label-size":(0,s.ny)(r),"--input-asterisk-color":void 0},error:{"--input-error-size":void 0===r?void 0:"calc(".concat((0,s.ny)(r)," - ").concat((0,o.D)(2),")")},description:{"--input-description-size":void 0===r?void 0:"calc(".concat((0,s.ny)(r)," - ").concat((0,o.D)(2),")")}}}),b=(0,h.P9)((e,t)=>{let r=(0,c.Y)("InputWrapper",w,e),{classNames:o,className:s,style:l,styles:h,unstyled:b,vars:S,size:x,variant:A,__staticSelector:E,inputContainer:I,inputWrapperOrder:T,label:k,error:C,description:_,labelProps:D,descriptionProps:B,errorProps:P,labelElement:M,children:N,withAsterisk:R,id:O,required:$,__stylesApiProps:L,mod:U,attributes:V,...F}=r,j=(0,u.I)({name:["InputWrapper",E],props:L||r,classes:y.A,className:s,style:l,classNames:o,styles:h,unstyled:b,attributes:V,vars:S,varsResolver:v}),q={size:x,variant:A,__staticSelector:E},z=(0,i.B)(O),K=(null==P?void 0:P.id)||"".concat(z,"-error"),G=(null==B?void 0:B.id)||"".concat(z,"-description"),H=!!C&&"boolean"!=typeof C,W=!!_,J="".concat(H?K:""," ").concat(W?G:""),X=J.trim().length>0?J.trim():void 0,Z=(null==D?void 0:D.id)||"".concat(z,"-label"),Y=k&&(0,n.jsx)(g.l,{labelElement:M,id:Z,htmlFor:z,required:"boolean"==typeof R?R:$,...q,...D,children:k},"label"),Q=W&&(0,n.jsx)(d.x,{...B,...q,size:(null==B?void 0:B.size)||q.size,id:(null==B?void 0:B.id)||G,children:_},"description"),ee=(0,n.jsx)(a.Fragment,{children:I(N)},"input"),et=H&&(0,a.createElement)(f.d,{...P,...q,size:(null==P?void 0:P.size)||q.size,key:"error",id:(null==P?void 0:P.id)||K},C),er=T.map(e=>{switch(e){case"label":return Y;case"input":return ee;case"description":return Q;case"error":return et;default:return null}});return(0,n.jsx)(m.D,{value:{getStyles:j,describedBy:X,inputId:z,labelId:Z,...function(e,t){let{hasDescription:r,hasError:n}=t,a=e.findIndex(e=>"input"===e),i=e.slice(0,a),o=e.slice(a+1),s=r&&i.includes("description")||n&&i.includes("error");return{offsetBottom:r&&o.includes("description")||n&&o.includes("error"),offsetTop:s}}(T,{hasDescription:W,hasError:H})},children:(0,n.jsx)(p.a,{ref:t,variant:A,size:x,mod:[{error:!!C},U],...j("root"),...F,children:er})})});b.classes=y.A,b.displayName="@mantine/core/InputWrapper"},1889:(e,t,r)=>{"use strict";r.d(t,{vv:()=>s.vv,TI:()=>s.TI,rh:()=>u,vT:()=>p});var n=r(92076);function a(e,t=e=>e){return(0,n.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,i)}function i(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,n]of e)if(!t.has(r)||!Object.is(n,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Object.is(e[r[n]],t[r[n]]))return!1;return!0}r(79142);var o=r(64527),s=r(15754),l=r(79175),c=o.createContext(void 0),u=({manager:e,children:t})=>{let[r,n]=o.useState(e.algodClient);o.useEffect(()=>{e.algodClient=r},[r,e]);let a=o.useRef(!1);return o.useEffect(()=>{a.current||(e.resumeSessions(),a.current=!0)},[e]),(0,l.jsx)(c.Provider,{value:{manager:e,algodClient:r,setAlgodClient:n},children:t})},p=()=>{let e=o.useContext(c);if(!e)throw Error("useWallet must be used within the WalletProvider");let{manager:t,algodClient:r,setAlgodClient:n}=e,i=a(t.store,e=>e.managerStatus),s=a(t.store,e=>e.wallets),l=a(t.store,e=>e.activeWallet),u=o.useCallback(e=>{let t=s[e.id];return{id:e.id,metadata:e.metadata,accounts:t?.accounts??[],activeAccount:t?.activeAccount??null,isConnected:!!t,isActive:e.id===l,canSignData:e.canSignData??!1,connect:t=>e.connect(t),disconnect:()=>e.disconnect(),setActive:()=>e.setActive(),setActiveAccount:t=>e.setActiveAccount(t)}},[s,l]),p=o.useMemo(()=>[...t.wallets.values()].map(u),[t,u]),h=l&&t.getWallet(l)||null,d=o.useMemo(()=>h?u(h):null,[h,u]),f=d?.accounts??null,g=f?.map(e=>e.address)??null,m=d?.activeAccount??null,y=m?.address??null;return{wallets:p,isReady:"ready"===i,algodClient:r,setAlgodClient:n,activeWallet:d,activeWalletAccounts:f,activeWalletAddresses:g,activeAccount:m,activeAddress:y,signData:(e,t)=>{if(!h)throw Error("No active wallet");return h.signData(e,t)},signTransactions:(e,t)=>{if(!h)throw Error("No active wallet");return h.signTransactions(e,t)},transactionSigner:(e,t)=>{if(!h)throw Error("No active wallet");return h.transactionSigner(e,t)}}}},4505:(e,t,r)=>{"use strict";r.d(t,{E:()=>c});var n=r(79175);r(64527);var a=r(51049),i=r(44241),o=r(41903),s=r(97569),l=r(23151);let c=(0,s.P9)((e,t)=>{let r=(0,a.Y)("InputPlaceholder",null,e),{classNames:s,className:c,style:u,styles:p,unstyled:h,vars:d,__staticSelector:f,variant:g,error:m,mod:y,attributes:w,...v}=r,b=(0,i.I)({name:["InputPlaceholder",f],props:r,classes:l.A,className:c,style:u,classNames:s,styles:p,unstyled:h,attributes:w,rootSelector:"placeholder"});return(0,n.jsx)(o.a,{...b("placeholder"),mod:[{error:!!m},y],component:"span",variant:g,ref:t,...v})});c.classes=l.A,c.displayName="@mantine/core/InputPlaceholder"},5853:(e,t,r)=>{"use strict";r.d(t,{H:()=>T,a:()=>k});var n=r(79142),a=r(83123),i=r(12021),o=r(31393),s=r(28775),l=r(43728),c=r(30905),u=r(35066),p=r(77251),h=r(9169),d=r
1(83123).hp,f=n.Ay$.ABIMethod,g=r(72726);let m=/transaction ([A-Z0-9]+): logic eval error: (.*). Details: .*pc=([0-9]+).*/,y=/inner tx (\d+) failed:.*?pc=([0-9]+)/;class w extends Error{static parseLogicError(e){let t=e.message,r=m.exec(t),n=y.exec(t);if(null!==r&&!(r.length<=3))return{txId:r[1],msg:r[2],desc:t,pc:parseInt(n?.[2]??r[3]??"0"),traces:e.traces}}constructor(e,t,r){super(),this.lines=5,this.teal_line=0,this.led=e,this.program=t;let n=r(e.pc);if(this.teal_line=void 0===n?0:n,this.message=`${this.led.msg}. at:${n}. ${this.led.desc}`,this.teal_line>0){let e=this.teal_line>this.lines?this.teal_line-this.lines:0,r=t.length>this.teal_line+this.lines?this.teal_line+this.lines:t.length,n=t.slice(e,r);n[n.length/2]+=" <--- Error",this.stack=n.join("\n")}}}var v=n.Ay$.ABIMethod,b=n.Ay$.AtomicTransactionComposer,S=n.Ay$.getApplicationAddress,x=n.Ay$.Indexer,A=n.Ay$.OnApplicationComplete,E=n.Ay$.ProgramSourceMap;function I(e,t,r,n){if(!e.includes(r))return;let a=t.bare_call_config[n];return!!a&&"NEVER"!==a||Object.values(t.hints).some(e=>{let t=e.call_config[n];return!!t&&"NEVER"!==t})}class T{constructor(e){this.handleCallErrors=async e=>{if(0n===this.appId){if(void 0===e.sentTransactions)return e;let t=e.sentTransactions.find(t=>e.message.includes(t.txID())),r=(e,t)=>{if(void 0===e||void 0===t||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0};if(!r(t?.applicationCall?.clearProgram,this._lastCompiled.clear)||!r(t?.applicationCall?.approvalProgram,this._lastCompiled?.approval))return e}else{let t=`app=${this._appId.toString()}`;if(!e.message.includes(t))return e}let t=await this.exposeLogicError(e);if(t instanceof w){let e=t.teal_line-t.lines-1,r=t.stack?.split("\n").map(t=>`${e+=1}: ${t}`).join("\n");s.T.logger.error(`${t.message} 2 3${r}`)}return t},this._appId=e.appId,this._appAddress=n.Ay$.getApplicationAddress(this._appId),this._appSpec=T.normaliseAppSpec(e.appSpec),this._appName=e.appName??this._appSpec.name,this._algorand=e.algorand,this._algorand.registerErrorTransformer(this.handleCallErrors),this._defaultSender="string"==typeof e.defaultSender?n.pVw.fromString(e.defaultSender):e.defaultSender,this._defaultSigner=e.defaultSigner,this._lastCompiled={},this._approvalSourceMap=e.approvalSourceMap,this._clearSourceMap=e.clearSourceMap,this._localStateMethods=e=>this.getStateMethods(()=>this.getLocalState(e),()=>this._appSpec.state.keys.local,()=>this._appSpec.state.maps.local),this._globalStateMethods=this.getStateMethods(()=>this.getGlobalState(),()=>this._appSpec.state.keys.global,()=>this._appSpec.state.maps.global),this._boxStateMethods=this.getBoxMethods(),this._paramsMethods={...this.getMethodCallParamsMethods(),bare:this.getBareParamsMethods()},this._createTransactionsMethods={...this.getMethodCallCreateTransactionMethods(),bare:this.getBareCreateTransactionMethods()},this._sendMethods={...this.getMethodCallSendMethods(),bare:this.getBareSendMethods()}}clone(e){return new T({appId:this._appId,appSpec:this._appSpec,algorand:this._algorand,appName:this._appName,defaultSender:this._defaultSender,defaultSigner:this._defaultSigner,approvalSourceMap:this._approvalSourceMap,clearSourceMap:this._clearSourceMap,...e})}static async fromCreatorAndName(e){let t=T.normaliseAppSpec(e.appSpec),r=(e.appLookupCache??await e.algorand.appDeployer.getCreatorAppsByName(e.creatorAddress,e.ignoreCache)).apps[e.appName??t.name];if(!r)throw Error(`App not found for creator ${e.creatorAddress} and name ${e.appName??t.name}`);return new T({...e,algorand:e.algorand,appId:r.appId})}static async fromNetwork(e){let t=await e.algorand.client.network(),r=T.normaliseAppSpec(e.appSpec),n=[t.genesisHash];t.isLocalNet&&n.push("localnet"),t.isTestNet&&n.push("testnet"),t.isMainNet&&n.push("mainnet");let a=Object.keys(r.networks??{}).findIndex(e=>n.includes(e));if(-1===a)throw Error(`No app ID found for network ${(0,u.vA)(n)} in the app spec`);let i=BigInt(r.networks[a].appID);return new T({...e,appId:i,appSpec:r})}static normaliseAppSpec(e){let t="string"==typeof e?JSON.parse(e):e;return"hints"in t?function(e){let t=Object.fromEntries(Object.values(e.hints).flatMap(e=>Object.entries(e.structs??{})).map(([e,t])=>{let r=t.elements.map(e=>({name:e[0],type:e[1]}));return[t.name,r]})),r=t=>e.hints[new f(t).getSignature()],a=(e,t)=>r(e)?.call_config!==void 0?o(r(e)?.call_config,t):[],i=t=>o(e.bare_call_config,t),o=(e,t)=>{let r=[];return e.close_out&&["ALL",t].includes(e.close_out)&&r.push("CloseOut"),e.delete_application&&["ALL",t].includes(e.delete_application)&&r.push("DeleteApplication"),e.no_op&&["ALL",t].includes(e.no_op)&&r.push("NoOp"),e.opt_in&&["ALL",t].includes(e.opt_in)&&r.push("OptIn"),e.update_application&&["ALL",t].includes(e.update_application)&&r.push("UpdateApplication"),r};return{arcs:[],name:e.contract.name,desc:e.contract.desc,structs:t,methods:e.contract.methods.map(e=>({name:e.name,desc:e.desc,args:e.args.map(t=>({name:t.name,type:t.type,desc:t.desc,struct:t.name?r(e)?.structs?.[t.name]?.name:void 0,defaultValue:((e,t)=>{if(t)return"abi-method"===t.source?{source:"method",data:t.data.name}:{source:"constant"===t.source?"literal":"global-state"===t.source?"global":"local",data:d.from("number"==typeof t.data?n.Ay$.ABIType.from("uint64").encode(t.data):t.data).toString("base64"),type:"string"===e?"AVMString":e}})(t.type,t.name?r(e)?.default_arguments?.[t.name]:void 0)})),returns:{type:e.returns.type,desc:e.returns.desc,struct:r(e)?.structs?.output?.name},events:[],readonly:r(e)?.read_only,actions:{create:a(e,"CREATE"),call:a(e,"CALL")}})),state:{schema:{global:{ints:e.state.global.num_uints,bytes:e.state.global.num_byte_slices},local:{ints:e.state.local.num_uints,bytes:e.state.local.num_byte_slices}},keys:{global:Object.fromEntries(Object.entries(e.schema.global.declared).map(e=>[e[0],{key:d.from(e[1].key,"utf-8").toString("base64"),keyType:"AVMString",valueType:"uint64"===e[1].type?"AVMUint64":"AVMBytes",desc:e[1].descr}])),local:Object.fromEntries(Object.entries(e.schema.local.declared).map(e=>[e[0],{key:d.from(e[1].key,"utf-8").toString("base64"),keyType:"AVMString",valueType:"uint64"===e[1].type?"AVMUint64":"AVMBytes",desc:e[1].descr}])),box:{}},maps:{global:{},local:{},box:{}}},source:e.source,bareActions:{create:i("CREATE"),call:i("CALL")},byteCode:void 0,compilerInfo:void 0,events:void 0,networks:void 0,scratchVariables:void 0,sourceInfo:void 0,templateVariables:void 0}}(t):t}get appId(){return this._appId}get appAddress(){return this._appAddress}get appName(){return this._appName}get appSpec(){return this._appSpec}get algorand(){return this._algorand}get params(){return this._paramsMethods}get createTransaction(){return this._createTransactionsMethods}get send(){return this._sendMethods}get state(){return{local:this._localStateMethods,global:this._globalStateMethods,box:this._boxStateMethods}}async fundAppAccount(e){return this.send.fundAppAccount(e)}async getGlobalState(){return await this._algorand.app.getGlobalState(this.appId)}async getLocalState(e){return await this._algorand.app.getLocalState(this.appId,e)}async getBoxNames(){return await this._algorand.app.getBoxNames(this.appId)}async getBoxValue(e){return await this._algorand.app.getBoxValue(this.appId,e)}async getBoxValueFromABIType(e,t){return await this._algorand.app.getBoxValueFromABIType({a
3ppId:this.appId,boxName:e,type:t})}async getBoxValues(e){let t=(await this.getBoxNames()).filter(e??(e=>!0)),r=await this._algorand.app.getBoxValues(this.appId,t.map(e=>e.nameRaw));return t.map((e,t)=>({name:e,value:r[t]}))}async getBoxValuesFromABIType(e,t){let r=(await this.getBoxNames()).filter(t??(e=>!0)),n=await this._algorand.app.getBoxValuesFromABIType({appId:this.appId,boxNames:r.map(e=>e.nameRaw),type:e});return r.map((e,t)=>({name:e,value:n[t]}))}async exposeLogicError(e,t){let r;if("cblocks"===this._appSpec.sourceInfo?.[t?"clear":"approval"]?.pcOffsetMethod){let e=await this._algorand.app.getById(this.appId);r=t?e.clearStateProgram:e.approvalProgram}return T.exposeLogicError(e,this._appSpec,{isClearStateProgram:t,approvalSourceMap:this._approvalSourceMap,clearSourceMap:this._clearSourceMap,program:r})}exportSourceMaps(){if(!this._approvalSourceMap||!this._clearSourceMap)throw Error("Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first");return{approvalSourceMap:this._approvalSourceMap,clearSourceMap:this._clearSourceMap}}importSourceMaps(e){this._approvalSourceMap=new E(e.approvalSourceMap),this._clearSourceMap=new E(e.clearSourceMap)}getABIMethod(e){return(0,h.n_)(e,this._appSpec)}async processMethodCallReturn(e,t){let r=await e;return{...r,return:(0,h.Px)(r.return,t,this._appSpec.structs)}}async compile(e){let t=await T.compile(this._appSpec,this._algorand.app,e);return t.compiledApproval&&(this._approvalSourceMap=t.compiledApproval.sourceMap,this._lastCompiled.approval=t.compiledApproval.compiledBase64ToBytes),t.compiledClear&&(this._clearSourceMap=t.compiledClear.sourceMap,this._lastCompiled.clear=t.compiledClear.compiledBase64ToBytes),t}static exposeLogicError(e,t,r){let{isClearStateProgram:n,approvalSourceMap:i,clearSourceMap:o,program:s}=r,l=n?o:i,c=w.parseLogicError(e);if(void 0===c||c?.pc===void 0)return e;let p=c?.pc,h=n?t.sourceInfo?.clear:t.sourceInfo?.approval,d=0;if(h?.pcOffsetMethod==="cblocks"){if(void 0===s)throw Error("Program bytes are required to calculate the ARC56 cblocks PC offset");d=function(e){let t,r,n=[...e],a=n.length;for(n.shift();n.length>0;){let e=n.shift();if(38===e||32===e){let i=38===e,o=n.shift();for(let e=0;e<o;e++)if(i){let e=n.shift();n.splice(0,e)}else for(;(128&n.shift())!=0;);if(i?t=a-n.length-1:r=a-n.length-1,38!==n[0]&&32!==n[0])break}}return Math.max(t??0,r??0)}(s),p=c.pc-d}let f=h?.sourceInfo.find(e=>e.pc.includes(p)),g=f?.errorMessage;if(t.source){let r=e=>l?.getLocationForPc?.(e)?.line;void 0===l&&(r=e=>{let t=h?.sourceInfo.find(t=>t.pc.includes(e-d))?.teal;if(void 0!==t)return t-1}),e=new w(c,a.hp.from(n?t.source.clear:t.source.approval,"base64").toString().split("\n"),r)}if(g){let r=(0,u.vA)(e).match(/(?<=app=)\d+/)?.[0]||"",n=(0,u.vA)(e).match(/(?<=transaction )\S+(?=:)/)?.[0],a=Error(`Runtime error when executing ${t.name} (appId: ${r}) in transaction ${n}: ${g}`);return a.cause=e,a}return e}static async compile(e,t,r){let{deployTimeParams:n,updatable:i,deletable:o}=r??{};if(!e.source){if(!e.byteCode?.approval||!e.byteCode?.clear)throw Error(`Attempt to compile app ${e.name} without source or byteCode`);return{approvalProgram:a.hp.from(e.byteCode.approval,"base64"),clearStateProgram:a.hp.from(e.byteCode.clear,"base64")}}let l=a.hp.from(e.source.approval,"base64").toString("utf-8"),c=await t.compileTealTemplate(l,n,{updatable:i,deletable:o}),u=a.hp.from(e.source.clear,"base64").toString("utf-8"),p=await t.compileTealTemplate(u,n);return s.T.debug&&await s.T.events.emitAsync(g.B.AppCompiled,{sources:[{compiledTeal:c,appName:e.name,fileName:"approval"},{compiledTeal:p,appName:e.name,fileName:"clear"}]}),{approvalProgram:c.compiledBase64ToBytes,compiledApproval:c,clearStateProgram:p.compiledBase64ToBytes,compiledClear:p}}async getABIArgsWithDefaultValues(e,t,r){let i=(0,h.n_)(e,this._appSpec);return await Promise.all(t?.map(async(e,t)=>{let o=i.args[t];if(!o)throw Error(`Unexpected arg at position ${t}. ${i.name} only expects ${i.args.length} args`);if(void 0!==e)return o.struct&&"object"==typeof e&&!Array.isArray(e)?(0,h.yT)(e,this._appSpec.structs[o.struct],this._appSpec.structs):e;let s=o.defaultValue;if(s)switch(s.source){case"literal":return(0,h.y4)(a.hp.from(s.data,"base64"),i.method.args[t].defaultValue?.type??i.method.args[t].type,this._appSpec.structs);case"method":{let e=this.getABIMethod(s.data),t=await this.send.c
3all({method:s.data,args:e.args.map(()=>void 0),sender:r});if(void 0===t.return)throw Error("Default value method call did not return a value");if("object"==typeof t.return&&!(t.return instanceof Uint8Array)&&!Array.isArray(t.return))return(0,h.yT)(t.return,this._appSpec.structs[e.returns.struct],this._appSpec.structs);return t.return}case"local":case"global":{let e=Object.values("global"===s.source?await this.getGlobalState():await this.getLocalState(r)).find(e=>e.keyBase64===s.data);if(!e)throw Error(`Preparing default value for argument ${o.name??`arg${t+1}`} resulted in the failure: The key '${s.data}' could not be found in ${s.source} storage`);return"valueRaw"in e?(0,h.y4)(e.valueRaw,i.method.args[t].defaultValue?.type??i.method.args[t].type,this._appSpec.structs):e.value}case"box":{let e=await this.getBoxValue(a.hp.from(s.data,"base64"));return(0,h.y4)(e,i.method.args[t].defaultValue?.type??i.method.args[t].type,this._appSpec.structs)}}if(!n.Ay$.abiTypeIsTransaction(o.type))throw Error(`No value provided for required argument ${o.name??`arg${t+1}`} in call to method ${i.name}`)})??[])}getBareParamsMethods(){return{update:async e=>this.getBareParams({...e,...await this.compile(e)},A.UpdateApplicationOC),optIn:e=>this.getBareParams(e,A.OptInOC),delete:e=>this.getBareParams(e,A.DeleteApplicationOC),clearState:e=>this.getBareParams(e,A.ClearStateOC),closeOut:e=>this.getBareParams(e,A.CloseOutOC),call:e=>this.getBareParams(e,e?.onComplete??A.NoOpOC)}}getBareCreateTransactionMethods(){return{update:async e=>this._algorand.createTransaction.appUpdate(await this.params.bare.update(e)),optIn:e=>this._algorand.createTransaction.appCall(this.params.bare.optIn(e)),delete:e=>this._algorand.createTransaction.appDelete(this.params.bare.delete(e)),clearState:e=>this._algorand.createTransaction.appCall(this.params.bare.clearState(e)),closeOut:e=>this._algorand.createTransaction.appCall(this.params.bare.closeOut(e)),call:e=>this._algorand.createTransaction.appCall(this.params.bare.call(e))}}getBareSendMethods(){return{update:async e=>{let t=await this.compile(e);return{...await this._algorand.send.appUpdate(await this.params.bare.update(e)),...t}},optIn:e=>this._algorand.send.appCall(this.params.bare.optIn(e)),delete:e=>this._algorand.send.appDelete(this.params.bare.delete(e)),clearState:e=>this._algorand.send.appCall(this.params.bare.clearState(e)),closeOut:e=>this._algorand.send.appCall(this.params.bare.closeOut(e)),call:e=>this._algorand.send.appCall(this.params.bare.call(e))}}getMethodCallParamsMethods(){return{fundAppAccount:e=>({...e,sender:this.getSender(e.sender),signer:this.getSigner(e.sender,e.signer),receiver:this.appAddress}),update:async e=>await this.getABIParams({...e,...await this.compile(e)},A.UpdateApplicationOC),optIn:async e=>await this.getABIParams(e,A.OptInOC),delete:async e=>await this.getABIParams(e,A.DeleteApplicationOC),closeOut:async e=>await this.getABIParams(e,A.CloseOutOC),call:async e=>await this.getABIParams(e,e.onComplete??A.NoOpOC)}}getMethodCallSendMethods(){return{fundAppAccount:e=>this._algorand.send.payment(this.params.fundAppAccount(e)),update:async e=>{let t=await this.compile(e);return{...await this.processMethodCallReturn(this._algorand.send.appUpdateMethodCall(await this.params.update({...e})),(0,h.n_)(e.method,this._appSpec)),...t}},optIn:async e=>this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.optIn(e)),(0,h.n_)(e.method,this._appSpec)),delete:async e=>this.processMethodCallReturn(this._algorand.send.appDeleteMethodCall(await this.params.delete(e)),(0,h.n_)(e.method,this._appSpec)),closeOut:async e=>this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.closeOut(e)),(0,h.n_)(e.method,this._appSpec)),call:async e=>{if((e.onComplete===A.NoOpOC||!e.onComplete)&&(0,h.n_)(e.method,this._appSpec).method.readonly){let t={...e};e.coverAppCallInnerTransactionFees&&e.maxFee&&(t.staticFee=e.maxFee,t.extraFee=void 0);try{let r=await this._algorand.newGroup().addAppCallMethodCall(await this.params.call(t)).simulate({allowUnnamedResources:e.populateAppCallResources??!0,skipSignatures:!0,extraOpcodeBudget:32e4});return this.processMethodCallReturn({...r,transaction:r.transactions.at(-1),confirmation:r.confirmations.at(-1),return:r.returns?.length?r.returns?.at(-1):void 0},(0,h.n_)(e.method,this._appSpec))}catch(t){if(e.coverAppCallInnerTransactionFees&&t&&t.message&&t.message.match(/fee too small/))throw Error("Fees were too small. You may need to increase the transaction maxFee.");throw t}}return this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.call(e)),(0,h.n_)(e.method,this._appSpec))}}}getMethodCallCreateTransactionMethods(){return{fundAppAccount:e=>this._algorand.createTransaction.payment(this.params.fundAppAccount(e)),update:async e=>this._algorand.createTransaction.appUpdateMethodCall(await this.params.update(e)),optIn:async e=>this._algorand.createTransaction.appCallMethodCall(await this.params.optIn(e)),delete:async e=>this._algorand.createTransaction.appDeleteMethodCall(await this.params.delete(e)),closeOut:async e=>this._algorand.createTransaction.appCallMethodCall(await this.params.closeOut(e)),call:async e=>this._algorand.createTransaction.appCallMethodCall(await this.params.call(e))}}getSender(e){if(!e&&!this._defaultSender)throw Error(`No sender provided and no default sender present in app client for call to app ${this._appName}`);return"string"==typeof e?n.pVw.fromString(e):e??this._defaultSender}getSigner(e,t){return t??(e&&e!==this._defaultSender?void 0:this._defaultSigner)}
3getBareParams(e,t){return{...e,appId:this._appId,sender:this.getSender(e?.sender),signer:this.getSigner(e?.sender,e?.signer),onComplete:t}}async getABIParams(e,t){let r=this.getSender(e.sender),n=(0,h.n_)(e.method,this._appSpec),a=await this.getABIArgsWithDefaultValues(e.method,e.args,r);return{...e,appId:this._appId,sender:r,signer:this.getSigner(e.sender,e.signer),method:n,onComplete:t,args:a}}getBoxMethods(){let e=this,t={getAll:async()=>Object.fromEntries(await Promise.all(Object.keys(e._appSpec.state.keys.box).map(async e=>[e,await t.getValue(e)]))),getValue:async t=>{let r=e._appSpec.state.keys.box[t],n=await e.getBoxValue(a.hp.from(r.key,"base64"));return(0,h.y4)(n,r.valueType,e._appSpec.structs)},getMapValue:async(t,r)=>{let n=e._appSpec.state.maps.box[t],i=a.hp.from(n.prefix??"","base64"),o=a.hp.concat([i,(0,h.qg)(r,n.keyType,e._appSpec.structs)]),s=a.hp.from(o).toString("base64"),l=await e.getBoxValue(a.hp.from(s,"base64"));return(0,h.y4)(l,n.valueType,e._appSpec.structs)},getMap:async t=>{let r=e._appSpec.state.maps.box[t],n=a.hp.from(r.prefix??"","base64"),i=await e.getBoxNames();return new Map(await Promise.all(i.filter(e=>(0,u.p0)(e.nameRaw,n)).map(async t=>[(0,h.y4)(t.nameRaw.slice(n.length),r.keyType,e._appSpec.structs),(0,h.y4)(await e.getBoxValue(t.nameRaw),r.valueType,e._appSpec.structs)])))}};return t}getStateMethods(e,t,r){let n=this,i={getAll:async()=>{let r=await e();return Object.fromEntries(await Promise.all(Object.keys(t()).map(async e=>[e,await i.getValue(e,r)])))},getValue:async(r,a)=>{let i=Object.values(a??await e()),o=t()[r];if(void 0===o)throw Error(`Attempted to get state value ${r}, but it does not exist`);let s=i.find(e=>e.keyBase64===o.key);return s&&"valueRaw"in s?(0,h.y4)(s.valueRaw,o.valueType,n._appSpec.structs):s?.value},getMapValue:async(t,i,o)=>{let s=Object.values(o??await e()),l=r()[t],c=a.hp.from(l.prefix??"","base64"),u=a.hp.concat([c,(0,h.qg)(i,l.keyType,n._appSpec.structs)]),p=a.hp.from(u).toString("base64"),d=s.find(e=>e.keyBase64===p);return d&&"valueRaw"in d?(0,h.y4)(d.valueRaw,l.valueType,n._appSpec.structs):d?.value},getMap:async t=>{let n=Object.values(await e()),i=r()[t],o=a.hp.from(i.prefix??"","base64");return new Map(n.filter(e=>(0,u.p0)(e.keyRaw,o)).map(e=>{let t=e.keyRaw.slice(o.length);return[(0,h.y4)(t,i.keyType,this._appSpec.structs),(0,h.y4)("valueRaw"in e?e.valueRaw:e.value,i.valueType,this._appSpec.structs)]}))}};return i}}class k{constructor(e,t){let{app:r,sender:a,params:i,deployTimeParams:o,...s}=e;if(this.algod=t,this.appSpec="string"==typeof r?JSON.parse(r):r,this._appName=s.name??this.appSpec.contract.name,this.deployTimeParams=o,"id"===s.resolveBy){if(s.id<0)throw Error(`Attempt to create application client with invalid app id of ${s.id}`);this._appId=s.id}else if(this._appId=0,this._creator=s.creatorAddress?.toString(),s.findExistingUsing instanceof x)this.indexer=s.findExistingUsing;else{if(s.findExistingUsing.creator!==this._creator)throw Error(`Attempt to create application client with invalid existingDeployments against a different creator (${s.findExistingUsing.creator}) instead of expected creator ${this._creator}`);this.existingDeployments=s.findExistingUsing}this._appAddress=n.Ay$.getApplicationAddress(this._appId).toString(),this.sender=a,this.params=i}async compile(e){let{deployTimeParams:t,updatable:r,deletable:n}=e??{},l=a.hp.from(this.appSpec.source.approval,"base64").toString("utf-8"),c=(0,o.MB)((0,o.LR)(l,t??this.deployTimeParams),{updatable:r,deletable:n}),u=await (0,i.ch)(c,this.algod);this._approvalSourceMap=u?.sourceMap;let p=a.hp.from(this.appSpec.source.clear,"base64").toString("utf-8"),h=(0,o.LR)(p,t??this.deployTimeParams),d=await (0,i.ch)(h,this.algod);return this._clearSourceMap=d?.sourceMap,s.T.debug&&await s.T.events.emitAsync(g.B.AppCompiled,{sources:[{compiledTeal:u,appName:this._appName,fileName:"approval"},{compiledTeal:d,appName:this._appName,fileName:"clear"}]}),{approvalCompiled:u,clearCompiled:d}}exportSourceMaps(){if(!this._approvalSourceMap||!this._clearSourceMap)throw Error("Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first");return{approvalSourceMap:this._approvalSourceMap,clearSourceMap:this._clearSourceMap}}importSourceMaps(e){this._approvalSourceMap=new E(e.approvalSourceMap),this._clearSourceMap=new E(e.clearSourceMap)}async deploy(e){let{schema:t,sender:r,version:n,allowUpdate:i,allowDelete:s,sendParams:l,createArgs:u,createOnCompleteAction:h,updateArgs:d,deleteArgs:f,...g}=e??{};if(0!==this._appId)throw Error(`Attempt to deploy app which already has an app id of ${this._appId}`);let m=r??this.sender;if(!m)throw Error("No sender provided, unable to deploy app");let y=m??this.sender;if(!this._creator)throw Error("Attempt to `deploy` a contract without specifying `resolveBy: 'creatorAndName'` in the constructor");if(this._creator!==(0,c.sE)(y))throw Error(`Attempt to deploy contract with a sender address (${(0,c.sE)(y)}) that differs from the given creator address for this application client: ${this._creator}`);let w=a.hp.from(this.appSpec.source.approval,"base64").toString("utf-8"),v={deployTimeParams:g.deployTimeParams,updatable:void 0!==i?i:I(w,this.appSpec,p.cQ,"update_application"),deletable:void 0!==s?s:I(w,this.appSpec,p.En,"delete_application")},{approvalCompiled:b,clearCompiled:S}=await this.compile(v);
3try{await this.getAppReference();let e=await (0,o.FG)({from:m,approvalProgram:b.compiledBase64ToBytes,clearStateProgram:S.compiledBase64ToBytes,metadata:{name:this._appName,version:n??"1.0",updatable:v.updatable,deletable:v.deletable},schema:{globalByteSlices:this.appSpec.state.global.num_byte_slices,globalInts:this.appSpec.state.global.num_uints,localByteSlices:this.appSpec.state.local.num_byte_slices,localInts:this.appSpec.state.local.num_uints,...t},transactionParams:this.params,...l??{},existingDeployments:this.existingDeployments,createArgs:await this.getCallArgs(u,m),createOnCompleteAction:h,updateArgs:await this.getCallArgs(d,m),deleteArgs:await this.getCallArgs(f,m),...g},this.algod,this.indexer);if("nothing"===e.operationPerformed)return e;if(!this.existingDeployments)throw Error("Expected existingDeployments to be present");let{transaction:r,confirmation:a,operationPerformed:i,...s}=e;return this.existingDeployments={creator:this.existingDeployments.creator,apps:{...this.existingDeployments.apps,[this._appName]:s}},{...e,compiledApproval:b,compiledClear:S}}catch(e){throw this.exposeLogicError(e)}}async create(e){let{sender:t,note:r,sendParams:n,deployTimeParams:a,updatable:o,deletable:s,onCompleteAction:l,schema:c,...u}=e??{};if(0!==this._appId)throw Error(`Attempt to create app which already has an app id of ${this._appId}`);let p=t??this.sender;if(!p)throw Error("No sender provided, unable to create app");let{approvalCompiled:h,clearCompiled:d}=await this.compile(e);try{let e=await (0,i.Ef)({from:p,approvalProgram:h.compiledBase64ToBytes,clearStateProgram:d.compiledBase64ToBytes,schema:{globalByteSlices:this.appSpec.state.global.num_byte_slices,globalInts:this.appSpec.state.global.num_uints,localByteSlices:this.appSpec.state.local.num_byte_slices,localInts:this.appSpec.state.local.num_uints,...c},onCompleteAction:l,args:await this.getCallArgs(u,p),note:r,transactionParams:this.params,...n??{}},this.algod);return e.confirmation&&(this._appId=e.confirmation.applicationIndex,this._appAddress=S(this._appId).toString()),{...e,compiledApproval:h,compiledClear:d}}catch(e){throw await this.exposeLogicError(e)}}async update(e){let{sender:t,note:r,sendParams:n,deployTimeParams:a,updatable:o,deletable:s,...l}=e??{};if(0===this._appId)throw Error("Attempt to update app which doesn't have an app id defined");let c=t??this.sender;if(!c)throw Error("No sender provided, unable to create app");let{approvalCompiled:u,clearCompiled:p}=await this.compile(e);try{return{...await (0,i.fy)({appId:this._appId,from:c,approvalProgram:u.compiledBase64ToBytes,clearStateProgram:p.compiledBase64ToBytes,args:await this.getCallArgs(l,c),note:r,transactionParams:this.params,...n??{}},this.algod),compiledApproval:u,compiledClear:p}}catch(e){throw await this.exposeLogicError(e)}}async call(e){if(e?.method&&!e.sendParams?.skipSending&&!e.sendParams?.atc&&this.appSpec.hints[this.getABIMethodSignature(this.getABIMethod(e.method))].read_only){let t=new b;await this.callOfType({...e,sendParams:{...e.sendParams,atc:t}},"no_op");let r=await t.simulate(this.algod);if(r.simulateResponse.txnGroups.some(e=>e.failureMessage))throw Error(r.simulateResponse.txnGroups.find(e=>e.failureMessage)?.failureMessage);let n=t.buildGroup();return{transaction:n[n.length-1].txn,confirmation:r.simulateResponse.txnGroups[0].txnResults.at(-1)?.txnResult,confirmations:r.simulateResponse.txnGroups[0].txnResults.map(e=>e.txnResult),transactions:n.map(e=>e.txn),return:r.methodResults?.length?r.methodResults[r.methodResults.length-1]:void 0}}return await this.callOfType(e,"no_op")}async optIn(e){return await this.callOfType(e,"opt_in")}async closeOut(e){return await this.callOfType(e,"close_out")}async clearState(e){return await this.callOfType(e,"clear_state")}async delete(e){return await this.callOfType(e,"delete_application")}async callOfType(e={},t){let{sender:r,note:n,sendParams:a,...o}=e,s=r??this.sender;if(!s)throw Error("No sender provided, unable to call app");let l=await this.getAppReference();if(0===l.appId)throw Error(`Attempt to call an app that can't be found '${this._appName}' for creator '${this._creator}'.`);try{return await (0,i.i4)({appId:l.appId,callType:t,from:s,args:await this.getCallArgs(o,s),note:n,transactionParams:this.params,...a??{}},this.algod)}catch(e){throw this.exposeLogicError(e)}}async fundAppAccount(e){let{amount:t,sender:r,note:n,sendParams:a}="microAlgos"in e?{amount:e}:e;if(!r&&!this.sender)throw Error("No sender provided, unable to call app");
3let i=await this.getAppReference();return(0,l.DT)(this.algod,r??this.sender,a??{},{receiver:i.appAddress,sender:(0,c.sE)(r??this.sender),amount:t,note:(0,c.HR)(n)},e=>e.payment,e=>e.payment,this.params)}async getGlobalState(){let e=await this.getAppReference();if(0===e.appId)throw Error("No app has been created yet, unable to get global state");return(0,i.qV)(e.appId,this.algod)}async getLocalState(e){let t=await this.getAppReference();if(0===t.appId)throw Error("No app has been created yet, unable to get global state");return(0,i.eF)(t.appId,e,this.algod)}async getBoxNames(){let e=await this.getAppReference();if(0===e.appId)throw Error("No app has been created yet, unable to get global state");return await (0,i.bP)(e.appId,this.algod)}async getBoxValue(e){let t=await this.getAppReference();if(0===t.appId)throw Error("No app has been created yet, unable to get global state");return await (0,i.Uf)(t.appId,e,this.algod)}async getBoxValueFromABIType(e,t){let r=await this.getAppReference();if(0===r.appId)throw Error("No app has been created yet, unable to get global state");return await (0,i.M4)({appId:r.appId,boxName:e,type:t},this.algod)}async getBoxValues(e){let t=await this.getAppReference();if(0===t.appId)throw Error("No app has been created yet, unable to get global state");let r=await this.getBoxNames();return await Promise.all(r.filter(e??(e=>!0)).map(async e=>({name:e,value:await (0,i.Uf)(t.appId,e,this.algod)})))}async getBoxValuesFromABIType(e,t){let r=await this.getAppReference();if(0===r.appId)throw Error("No app has been created yet, unable to get global state");let n=await this.getBoxNames();return await Promise.all(n.filter(t??(e=>!0)).map(async t=>({name:t,value:await (0,i.M4)({appId:r.appId,boxName:t,type:e},this.algod)})))}async getCallArgs(e,t){if(e)if(!e.method)return e;else{let r=this.getABIMethodParams(e.method);if(!r)throw Error(`Attempt to call ABI method ${e.method}, but it wasn't found`);let n=this.getABIMethodSignature(r);return{...e,method:r,methodArgs:await Promise.all(e.methodArgs.map(async(e,a)=>{if(void 0!==e)return e;let i=r.args[a].name,o=i&&this.appSpec.hints?.[n]?.default_arguments?.[i];if(!o)throw Error(`Argument at position ${a} with the name ${i} is undefined and does not have a default value strategy`);switch(o.source){case"constant":return o.data;case"abi-method":{let e=o.data,r=await this.callOfType({method:this.getABIMethodSignature(e),methodArgs:e.args.map(()=>void 0),sender:t},"no_op");return r.return?.returnValue}case"local-state":case"global-state":{let e="global-state"===o.source?await this.getGlobalState():await this.getLocalState(t),r=o.data;if(r in e)return e[r].value;throw Error(`Preparing default value for argument at position ${a} with the name ${i} resulted in the failure: The key '${r}' could not be found in ${o.source}`)}}}))}}}getABIMethodParams(e){if(!e.includes("(")){let t=this.appSpec.contract.methods.filter(t=>t.name===e);if(t.length>1)throw Error(`Received a call to method ${e} in contract ${this._appName}, but this resolved to multiple methods; please pass in an ABI signature instead: ${t.map(this.getABIMethodSignature).join(", ")}`);return t[0]}return this.appSpec.contract.methods.find(t=>this.getABIMethodSignature(t)===e)}getABIMethod(e){let t=this.getABIMethodParams(e);return t?new v(t):void 0}async getAppReference(){if(!this.existingDeployments&&this._creator&&(this.existingDeployments=await (0,o.jw)(this._creator,this.indexer)),this.existingDeployments&&0===this._appId){let e=this.existingDeployments.apps[this._appName];return e||{appId:0,appAddress:S(0).toString()}}return{appId:this._appId,appAddress:this._appAddress}}exposeLogicError(e,t){if(!t&&void 0==this._approvalSourceMap||t&&void 0==this._clearSourceMap)return e;let r=w.parseLogicError(e);return void 0!==r?new w(r,a.hp.from(t?this.appSpec.source.clear:this.appSpec.source.approval,"base64").toString().split("\n"),e=>(t?this._clearSourceMap:this._approvalSourceMap)?.getLocationForPc(e)?.line):e}getABIMethodSignature(e){return"getSignature"in e?e.getSignature():new v(e).getSignature()}}},6462:(e,t)=>{t.read=function(e,t,r,n,a){var i,o,s=8*a-n-1,l=(1<<s)-1,c=l>>1,u=-7,p=r?a-1:0,h=r?-1:1,d=e[t+p];for(p+=h,i=d&(1<<-u)-1,d>>=-u,u+=s;u>0;i=256*i+e[t+p],p+=h,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+e[t+p],p+=h,u-=8);if(0===i)i=1-c;else{if(i===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),i-=c}return(d?-1:1)*o*Math.pow(2,i-n)},t.write=function(e,t,r,n,a,i){var o,s,l,c=8*i-a-1,u=(1<<c)-1,p=u>>1,h=5960464477539062e-23*(23===a),d=n?0:i-1,f=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+p>=1?t+=h/l:t+=h*Math.pow(2,1-p),t*l>=2&&(o++,l/=2),o+p>=u?(s=0,o=u):o+p>=1?(s=(t*l-1)*Math.pow(2,a),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,a),o=0));a>=8;e[r+d]=255&s,d+=f,s/=256,a-=8);for(o=o<<a|s,c+=a;c>0;e[r+d]=255&o,d+=f,o/=256,c-=8);e[r+d-f]|=128*g}},8356:(e,t,r)=>{"use strict";function n(e){return e?e.map(e=>(function e(t){return"string"==typeof t?{value:t,label:t}:"value"in t&&!("label"in t)?{value:t.value,label:t.value,disabled:t.disabled}:"number"==typeof t?{value:t.toString(),label:t.toString()}:"group"in t?{group:t.group,items:t.items.map(t=>e(t))}:t})(e)):[]}r.d(t,{d:()=>n})},8808:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(63012).A)("outline","copy","Copy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]])},9006:function(e,t,r){var n;!function(a){"use strict";var i,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,l=Math.floor,c="[BigNumber Error] ",u=c+"Number primitive has more than 15 significant digits: ",p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function h(e){var t=0|e;return e>0||e===t?t:t-1}function d(e){for(var t,r,n=1,a=e.length,i=e[0]+"";n<a;){for(r=14-(t=e[n++]+"").length;r--;t="0"+t);i+=t}for(a=i.length;48===i.charCodeAt(--a););return i.slice(0,a+1||1)}function f(e,t){var r,n,a=e.c,i=t.c,o=e.s,s=t.s,l=e.e,c=t.e;if(!o||!s)return null;if(r=a&&!a[0],n=i&&!i[0],r||n)return r?n?0:-s:o;if(o!=s)return o;if(r=o<0,n=l==c,!a||!i)return n?0:!a^r?1:-1;if(!n)return l>c^r?1:-1;for(o=0,s=(l=a.length)<(c=i.length)?l:c;o<s;o++)if(a[o]!=i[o])return a[o]>i[o]^r?1:-1;return l==c?0:l>c^r?1:-1}function g(e,t,r,n){if(e<t||e>r||e!==l(e))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function m(e){var t=e.c.length-1;return h(e.e/14)==t&&e.c[t]%2!=0}function y(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var n,a;if(t<0){for(a=r+".";++t;a+=r);e=a+e}else if(n=e.length,++t>n){for(a=r,t-=n;--t;a+=r);e+=a}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(i=function e(t){var r,n,a,i,v,b,S,x,A,E=L.prototype={constructor:L,toString:null,valueOf:null},I=new L(1),T=20,k=4,C=-7,_=21,D=-1e7,B=1e7,P=!1,M=1,N=0,R={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},O="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function L(e,t){var r,n,a,i,s,c,p,h,d=this;if(!(d instanceof L))return new L(e,t);if(null==t){if(e&&!0===e._isBigNumber){d.s=e.s,!e.c||e.e>B?d.c=d.e=null:e.e<D?d.c=[d.e=0]:(d.e=e.e,d.c=e.c.slice());return}if((c="number"==typeof e)&&0*e==0){if(d.s=1/e<0?(e=-e,-1):1,e===~~e){for(i=0,s=e;s>=10;s/=10,i++);i>B?d.c=d.e=null:(d.e=i,d.c=[e]);return}h=String(e)}else{if(!o.test(h=String(e)))return A(d,h,c);
3d.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}(i=h.indexOf("."))>-1&&(h=h.replace(".","")),(s=h.search(/e/i))>0?(i<0&&(i=s),i+=+h.slice(s+1),h=h.substring(0,s)):i<0&&(i=h.length)}else{if(g(t,2,O.length,"Base"),10==t&&$)return j(d=new L(e),T+d.e+1,k);if(h=String(e),c="number"==typeof e){if(0*e!=0)return A(d,h,c,t);if(d.s=1/e<0?(h=h.slice(1),-1):1,L.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(u+e)}else d.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(r=O.slice(0,t),i=s=0,p=h.length;s<p;s++)if(0>r.indexOf(n=h.charAt(s))){if("."==n){if(s>i){i=p;continue}}else if(!a&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){a=!0,s=-1,i=0;continue}return A(d,String(e),c,t)}c=!1,(i=(h=x(h,t,10,d.s)).indexOf("."))>-1?h=h.replace(".",""):i=h.length}for(s=0;48===h.charCodeAt(s);s++);for(p=h.length;48===h.charCodeAt(--p););if(h=h.slice(s,++p)){if(p-=s,c&&L.DEBUG&&p>15&&(e>0x1fffffffffffff||e!==l(e)))throw Error(u+d.s*e);if((i=i-s-1)>B)d.c=d.e=null;else if(i<D)d.c=[d.e=0];else{if(d.e=i,d.c=[],s=(i+1)%14,i<0&&(s+=14),s<p){for(s&&d.c.push(+h.slice(0,s)),p-=14;s<p;)d.c.push(+h.slice(s,s+=14));s=14-(h=h.slice(s)).length}else s-=p;for(;s--;h+="0");d.c.push(+h)}}else d.c=[d.e=0]}function U(e,t,r,n){var a,i,o,s,l;if(null==r?r=k:g(r,0,8),!e.c)return e.toString();if(a=e.c[0],o=e.e,null==t)l=d(e.c),l=1==n||2==n&&(o<=C||o>=_)?y(l,o):w(l,o,"0");else if(i=(e=j(new L(e),t,r)).e,s=(l=d(e.c)).length,1==n||2==n&&(t<=i||i<=C)){for(;s<t;l+="0",s++);l=y(l,i)}else if(t-=o+(2===n&&i>o),l=w(l,i,"0"),i+1>s){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=i-s)>0)for(i+1==s&&(l+=".");t--;l+="0");return e.s<0&&a?"-"+l:l}function V(e,t){for(var r,n,a=1,i=new L(e[0]);a<e.length;a++)(n=new L(e[a])).s&&(r=f(i,n))!==t&&(0!==r||i.s!==t)||(i=n);return i}function F(e,t,r){for(var n=1,a=t.length;!t[--a];t.pop());for(a=t[0];a>=10;a/=10,n++);return(r=n+14*r-1)>B?e.c=e.e=null:r<D?e.c=[e.e=0]:(e.e=r,e.c=t),e}function j(e,t,r,n){var a,i,o,c,u,h,d,f=e.c;if(f){e:{for(a=1,c=f[0];c>=10;c/=10,a++);if((i=t-a)<0)i+=14,o=t,d=l((u=f[h=0])/p[a-o-1]%10);else if((h=s((i+1)/14))>=f.length)if(n){for(;f.length<=h;f.push(0));u=d=0,a=1,i%=14,o=i-14+1}else break e;else{for(a=1,u=c=f[h];c>=10;c/=10,a++);i%=14,d=(o=i-14+a)<0?0:l(u/p[a-o-1]%10)}if(n=n||t<0||null!=f[h+1]||(o<0?u:u%p[a-o-1]),n=r<4?(d||n)&&(0==r||r==(e.s<0?3:2)):d>5||5==d&&(4==r||n||6==r&&(i>0?o>0?u/p[a-o]:0:f[h-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=p[(14-t%14)%14],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=h,c=1,h--):(f.length=h+1,c=p[14-i],f[h]=o>0?l(u/p[a-o]%p[o])*c:0),n)for(;;)if(0==h){for(i=1,o=f[0];o>=10;o/=10,i++);for(o=f[0]+=c,c=1;o>=10;o/=10,c++);i!=c&&(e.e++,1e14==f[0]&&(f[0]=1));break}else{if(f[h]+=c,1e14!=f[h])break;f[h--]=0,c=1}for(i=f.length;0===f[--i];f.pop());}e.e>B?e.c=e.e=null:e.e<D&&(e.c=[e.e=0])}return e}function q(e){var t,r=e.e;return null===r?e.toString():(t=d(e.c),t=r<=C||r>=_?y(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return L.clone=e,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(e){var t,r;if(null!=e)if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,1e9,t),T=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),k=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-1e9,0,t),g(r[1],0,1e9,t),C=r[0],_=r[1]):(g(r,-1e9,1e9,t),C=-(_=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-1e9,-1,t),g(r[1],1,1e9,t),D=r[0],B=r[1];else if(g(r,-1e9,1e9,t),r)D=-(B=r<0?-r:r);else throw Error(c+t+" cannot be zero: "+r);if(e.hasOwnProperty(t="CRYPTO"))if(!!(r=e[t])===r)if(r)if("undefined"!=typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))P=r;else throw P=!r,Error(c+"crypto unavailable");else P=r;else throw Error(c+t+" not true or false: "+r);if(e.hasOwnProperty(t="MODULO_MODE")&&(g(r=e[t],0,9,t),M=r),e.hasOwnProperty(t="POW_PRECISION")&&(g(r=e[t],0,1e9,t),N=r),e.hasOwnProperty(t="FORMAT"))if("object"==typeof(r=e[t]))R=r;else throw Error(c+t+" not an object: "+r);if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\
3s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);$="0123456789"==r.slice(0,10),O=r}}else throw Error(c+"Object expected: "+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:k,EXPONENTIAL_AT:[C,_],RANGE:[D,B],CRYPTO:P,MODULO_MODE:M,POW_PRECISION:N,FORMAT:R,ALPHABET:O}},L.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!L.DEBUG)return!0;var t,r,n=e.c,a=e.e,i=e.s;e:if("[object Array]"==({}).toString.call(n)){if((1===i||-1===i)&&a>=-1e9&&a<=1e9&&a===l(a)){if(0===n[0]){if(0===a&&1===n.length)return!0;break e}if((t=(a+1)%14)<1&&(t+=14),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=1e14||r!==l(r))break e;if(0!==r)return!0}}}else if(null===n&&null===a&&(null===i||1===i||-1===i))return!0;throw Error(c+"Invalid BigNumber: "+e)},L.maximum=L.max=function(){return V(arguments,-1)},L.minimum=L.min=function(){return V(arguments,1)},r=0x20000000000000*Math.random()&2097151?function(){return l(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},L.random=function(e){var t,n,a,i,o,u=0,h=[],d=new L(I);if(null==e?e=T:g(e,0,1e9),i=s(e/14),P)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));u<i;)(o=131072*t[u]+(t[u+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[u]=n[0],t[u+1]=n[1]):(h.push(o%1e14),u+=2);u=i/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=7);u<i;)(o=(31&t[u])*0x1000000000000+0x10000000000*t[u+1]+0x100000000*t[u+2]+0x1000000*t[u+3]+(t[u+4]<<16)+(t[u+5]<<8)+t[u+6])>=9e15?crypto.randomBytes(7).copy(t,u):(h.push(o%1e14),u+=7);u=i/7}else throw P=!1,Error(c+"crypto unavailable");if(!P)for(;u<i;)(o=r())<9e15&&(h[u++]=o%1e14);for(i=h[--u],e%=14,i&&e&&(o=p[14-e],h[u]=l(i/o)*o);0===h[u];h.pop(),u--);if(u<0)h=[a=0];else{for(a=-1;0===h[0];h.splice(0,1),a-=14);for(u=1,o=h[0];o>=10;o/=10,u++);u<14&&(a-=14-u)}return d.e=a,d.c=h,d},L.sum=function(){for(var e=1,t=arguments,r=new L(t[0]);e<t.length;)r=r.plus(t[e++]);return r},x=function(){var e="0123456789";function t(e,t,r,n){for(var a,i,o=[0],s=0,l=e.length;s<l;){for(i=o.length;i--;o[i]*=t);for(o[0]+=n.indexOf(e.charAt(s++)),a=0;a<o.length;a++)o[a]>r-1&&(null==o[a+1]&&(o[a+1]=0),o[a+1]+=o[a]/r|0,o[a]%=r)}return o.reverse()}return function(r,n,a,i,o){var s,l,c,u,p,h,f,g,m=r.indexOf("."),y=T,v=k;for(m>=0&&(u=N,N=0,r=r.replace(".",""),h=(g=new L(n)).pow(r.length-m),N=u,g.c=t(w(d(h.c),h.e,"0"),10,a,e),g.e=g.c.length),c=u=(f=t(r,n,a,o?(s=O,e):(s=e,O))).length;0==f[--u];f.pop());if(!f[0])return s.charAt(0);if(m<0?--c:(h.c=f,h.e=c,h.s=i,f=(h=S(h,g,y,v,a)).c,p=h.r,c=h.e),m=f[l=c+y+1],u=a/2,p=p||l<0||null!=f[l+1],p=v<4?(null!=m||p)&&(0==v||v==(h.s<0?3:2)):m>u||m==u&&(4==v||p||6==v&&1&f[l-1]||v==(h.s<0?8:7)),l<1||!f[0])r=p?w(s.charAt(1),-y,s.charAt(0)):s.charAt(0);else{if(f.length=l,p)for(--a;++f[--l]>a;)f[l]=0,l||(++c,f=[1].concat(f));for(u=f.length;!f[--u];);for(m=0,r="";m<=u;r+=s.charAt(f[m++]));r=w(r,c,s.charAt(0))}return r}}(),S=function(){function e(e,t,r){var n,a,i,o,s=0,l=e.length,c=t%1e7,u=t/1e7|0;for(e=e.slice();l--;)n=u*(i=e[l]%1e7)+(o=e[l]/1e7|0)*c,s=((a=c*i+n%1e7*1e7+s)/r|0)+(n/1e7|0)+u*o,e[l]=a%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var a,i;if(r!=n)i=r>n?1:-1;else for(a=i=0;a<r;a++)if(e[a]!=t[a]){i=e[a]>t[a]?1:-1;break}return i}function r(e,t,r,n){for(var a=0;r--;)e[r]-=a,a=+(e[r]<t[r]),e[r]=a*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,a,i,o,s){var c,u,p,d,f,g,m,y,w,v,b,S,x,A,E,I,T,k=n.s==a.s?1:-1,C=n.c,_=a.c;if(!C||!C[0]||!_||!_[0])return new L(!n.s||!a.s||(C?_&&C[0]==_[0]:!_)?NaN:C&&0==C[0]||!_?0*k:k/0);for(w=(y=new L(k)).c=[],k=i+(u=n.e-a.e)+1,s||(s=1e14,u=h(n.e/14)-h(a.e/14),k=k/14|0),p=0;_[p]==(C[p]||0);p++);if(_[p]>(C[p]||0)&&u--,k<0)w.push(1),d=!0;else{for(A=C.length,I=_.length,p=0,k+=2,(f=l(s/(_[0]+1)))>1&&(_=e(_,f,s),C=e(C,f,s),I=_.length,A=C.length),x=I,b=(v=C.slice(0,I)).length;b<I;v[b++]=0);T=[0].concat(T=_.slice()),E=_[0],_[1]>=s/2&&E++;do{if(f=0,(c=t(_,v,I,b))<0){if(S=v[0],I!=b&&(S=S*s+(v[1]||0)),(f=l(S/E))>1)for(f>=s&&(f=s-1),m=(g=e(_,f,s)).length,b=v.length;1==t(g,v,m,b);)f--,r(g,I<m?T:_,m,s),m=g.length,c=1;
3else 0==f&&(c=f=1),m=(g=_.slice()).length;if(m<b&&(g=[0].concat(g)),r(v,g,b,s),b=v.length,-1==c)for(;1>t(_,v,I,b);)f++,r(v,I<b?T:_,b,s),b=v.length}else 0===c&&(f++,v=[0]);w[p++]=f,v[0]?v[b++]=C[x]||0:(v=[C[x]],b=1)}while((x++<A||null!=v[0])&&k--);d=null!=v[0],w[0]||w.splice(0,1)}if(1e14==s){for(p=1,k=w[0];k>=10;k/=10,p++);j(y,i+(y.e=p+14*u-1)+1,o,d)}else y.e=u,y.r=+d;return y}}(),n=/^(-?)0([xbo])(?=\w[\w.]*$)/i,a=/^([^.]+)\.$/,i=/^\.([^.]+)$/,v=/^-?(Infinity|NaN)$/,b=/^\s*\+(?=[\w.])|^\s+|\s+$/g,A=function(e,t,r,o){var s,l=r?t:t.replace(b,"");if(v.test(l))e.s=isNaN(l)?null:l<0?-1:1;else{if(!r&&(l=l.replace(n,function(e,t,r){return s="x"==(r=r.toLowerCase())?16:"b"==r?2:8,o&&o!=s?e:t}),o&&(s=o,l=l.replace(a,"$1").replace(i,"0.$1")),t!=l))return new L(l,s);if(L.DEBUG)throw Error(c+"Not a"+(o?" base "+o:"")+" number: "+t);e.s=null}e.c=e.e=null},E.absoluteValue=E.abs=function(){var e=new L(this);return e.s<0&&(e.s=1),e},E.comparedTo=function(e,t){return f(this,new L(e,t))},E.decimalPlaces=E.dp=function(e,t){var r,n,a;if(null!=e)return g(e,0,1e9),null==t?t=k:g(t,0,8),j(new L(this),e+this.e+1,t);if(!(r=this.c))return null;if(n=((a=r.length-1)-h(this.e/14))*14,a=r[a])for(;a%10==0;a/=10,n--);return n<0&&(n=0),n},E.dividedBy=E.div=function(e,t){return S(this,new L(e,t),T,k)},E.dividedToIntegerBy=E.idiv=function(e,t){return S(this,new L(e,t),0,1)},E.exponentiatedBy=E.pow=function(e,t){var r,n,a,i,o,u,p,h,d,f=this;if((e=new L(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+q(e));if(null!=t&&(t=new L(t)),u=e.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return d=new L(Math.pow(+q(f),u?e.s*(2-m(e)):+q(e))),t?d.mod(t):d;if(p=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new L(NaN);(n=!p&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(e.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||u&&f.c[1]>=24e7:f.c[0]<8e13||u&&f.c[0]<=9999975e7)))return i=f.s<0&&m(e)?-0:0,f.e>-1&&(i=1/i),new L(p?1/i:i);N&&(i=s(N/14+2))}for(u?(r=new L(.5),p&&(e.s=1),h=m(e)):h=(a=Math.abs(+q(e)))%2,d=new L(I);;){if(h){if(!(d=d.times(f)).c)break;i?d.c.length>i&&(d.c.length=i):n&&(d=d.mod(t))}if(a){if(0===(a=l(a/2)))break;h=a%2}else if(j(e=e.times(r),e.e+1,1),e.e>14)h=m(e);else{if(0==(a=+q(e)))break;h=a%2}f=f.times(f),i?f.c&&f.c.length>i&&(f.c.length=i):n&&(f=f.mod(t))}return n?d:(p&&(d=I.div(d)),t?d.mod(t):i?j(d,N,k,o):d)},E.integerValue=function(e){var t=new L(this);return null==e?e=k:g(e,0,8),j(t,t.e+1,e)},E.isEqualTo=E.eq=function(e,t){return 0===f(this,new L(e,t))},E.isFinite=function(){return!!this.c},E.isGreaterThan=E.gt=function(e,t){return f(this,new L(e,t))>0},E.isGreaterThanOrEqualTo=E.gte=function(e,t){return 1===(t=f(this,new L(e,t)))||0===t},E.isInteger=function(){return!!this.c&&h(this.e/14)>this.c.length-2},E.isLessThan=E.lt=function(e,t){return 0>f(this,new L(e,t))},E.isLessThanOrEqualTo=E.lte=function(e,t){return -1===(t=f(this,new L(e,t)))||0===t},E.isNaN=function(){return!this.s},E.isNegative=function(){return this.s<0},E.isPositive=function(){return this.s>0},E.isZero=function(){return!!this.c&&0==this.c[0]},E.minus=function(e,t){var r,n,a,i,o=this.s;if(t=(e=new L(e,t)).s,!o||!t)return new L(NaN);if(o!=t)return e.s=-t,this.plus(e);var s=this.e/14,l=e.e/14,c=this.c,u=e.c;if(!s||!l){if(!c||!u)return c?(e.s=-t,e):new L(u?this:NaN);if(!c[0]||!u[0])return u[0]?(e.s=-t,e):new L(c[0]?this:3==k?-0:0)}if(s=h(s),l=h(l),c=c.slice(),o=s-l){for((i=o<0)?(o=-o,a=c):(l=s,a=u),a.reverse(),t=o;t--;a.push(0));a.reverse()}else for(n=(i=(o=c.length)<(t=u.length))?o:t,o=t=0;t<n;t++)if(c[t]!=u[t]){i=c[t]<u[t];break}if(i&&(a=c,c=u,u=a,e.s=-e.s),(t=(n=u.length)-(r=c.length))>0)for(;t--;c[r++]=0);for(t=1e14-1;n>o;){if(c[--n]<u[n]){for(r=n;r&&!c[--r];c[r]=t);--c[r],c[n]+=1e14}c[n]-=u[n]}for(;0==c[0];c.splice(0,1),--l);return c[0]?F(e,c,l):(e.s=3==k?-1:1,e.c=[e.e=0],e)},E.modulo=E.mod=function(e,t){var r,n;return(e=new L(e,t),this.c&&e.s&&(!e.c||e.c[0]))?e.c&&(!this.c||this.c[0])?(9==M?(n=e.s,e.s=1,r=S(this,e,0,3),e.s=n,r.s*=n):r=S(this,e,0,M),(e=this.minus(r.times(e))).c[0]||1!=M||(e.s=this.s),e):new L(this):new L(NaN)},E.multipliedBy=E.times=function(e,t){var r,n,a,i,o,s,l,c,u,p,d,f,g,m=this.c,y=(e=new L(e,t)).c;if(!m||!y||!m[0]||!y[0])return this.s&&e.s&&(!m||m[0]||y)&&(!y||y[0]||m)?(e.s*=this.s,m&&y?(e.c=[0],e.e=0):e.c=e.e=null):e.c=e.e=e.s=null,e;for(n=h(this.e/14)+h(e.e/14),e.s*=this.s,(l=m.length)<(p=y.length)&&(g=m,m=y,y=g,a=l,l=p,p=a),a=l+p,g=[];a--;g.push(0));for(a=p;--a>=0;){for(r=0,d=y[a]%1e7,f=y[a]/1e7|0,i=a+(o=l);i>a;)s=f*(c=m[--o]%1e7)+(u=m[o]/1e7|0)*d,r=((c=d*c+s%1e7*1e7+g[i]+r)/1e14|0)+(s/1e7|0)+f*u,g[i--]=c%1e14;g[i]=r}return r?++n:g.splice(0,1),F(e,g,n)},E.negated=function(){var e=new L(this);return e.s=-e.s||null,e},E.plus=function(e,t){var r,n=this.s;if(t=(e=new L(e,t)).s,!n||!t)return new L(NaN);if(n!=t)return e.s=-t,this.minus(e);var a=this.e/14,i=e.e/14,o=this.c,s=e.c;if(!a||!i){if(!o||!s)return new L(n/0);if(!o[0]||!s[0])return s[0]?e:new L(o[0]?this:0*n)}if(a=h(a),i=h(i),o=o.slice(),n=a-i){for(n>0?(i=a,r=s):(n=-n,r=o),r.reverse();n--;r.push(0));r.reverse()}for((n=o.length)-(t=s.length)<0&&(r=s,s=o,o=r,t=n),n=0;t;)n=(o[--t]=o[t]+s[t]+n)/1e14|0,o[t]=1e14===o[t]?0:o[t]%1e14;return n&&(o=[n].concat(o),++i),F(e,o,i)},E.precision=E.sd=function(e,t){var r,n,a;if(null!=e&&!!e!==e)return g(e,1,1e9),null==t?t=k:g(t,0,8),j(new L(this),e,t);if(!(r=this.c))return null;if(n=14*(a=r.length-1)+1,a=r[a]){for(;a%10==0;a/=10,n--);for(a=r[0];a>=10;a/=10,n++);}return e&&this.e+1>n&&(n=this.e+1),n},E.shiftedBy=function(e){return g(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},E.squareRoot=E.sqrt=function(){var e,t,r,n,a,i=this.c,o=this.s,s=this.e,l=T+4,c=new L("0.5");
3if(1!==o||!i||!i[0])return new L(!o||o<0&&(!i||i[0])?NaN:i?this:1/0);if(0==(o=Math.sqrt(+q(this)))||o==1/0?(((t=d(i)).length+s)%2==0&&(t+="0"),o=Math.sqrt(+t),s=h((s+1)/2)-(s<0||s%2),r=new L(t=o==1/0?"5e"+s:(t=o.toExponential()).slice(0,t.indexOf("e")+1)+s)):r=new L(o+""),r.c[0]){for((o=(s=r.e)+l)<3&&(o=0);;)if(a=r,r=c.times(a.plus(S(this,a,l,1))),d(a.c).slice(0,o)===(t=d(r.c)).slice(0,o)){if(r.e<s&&--o,"9999"!=(t=t.slice(o-3,o+1))&&(n||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(j(r,r.e+T+2,1),e=!r.times(r).eq(this));break}if(!n&&(j(a,a.e+T+2,0),a.times(a).eq(this))){r=a;break}l+=4,o+=4,n=1}}return j(r,r.e+T+1,k,e)},E.toExponential=function(e,t){return null!=e&&(g(e,0,1e9),e++),U(this,e,t,1)},E.toFixed=function(e,t){return null!=e&&(g(e,0,1e9),e=e+this.e+1),U(this,e,t)},E.toFormat=function(e,t,r){var n;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=R;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=this.toFixed(e,t),this.c){var a,i=n.split("."),o=+r.groupSize,s=+r.secondaryGroupSize,l=r.groupSeparator||"",u=i[0],p=i[1],h=this.s<0,d=h?u.slice(1):u,f=d.length;if(s&&(a=o,o=s,s=a,f-=a),o>0&&f>0){for(a=f%o||o,u=d.substr(0,a);a<f;a+=o)u+=l+d.substr(a,o);s>0&&(u+=l+d.slice(a)),h&&(u="-"+u)}n=p?u+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?p.replace(RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):u}return(r.prefix||"")+n+(r.suffix||"")},E.toFraction=function(e){var t,r,n,a,i,o,s,l,u,h,f,g,m=this.c;if(null!=e&&(!(s=new L(e)).isInteger()&&(s.c||1!==s.s)||s.lt(I)))throw Error(c+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+q(s));if(!m)return new L(this);for(t=new L(I),u=r=new L(I),n=l=new L(I),g=d(m),i=t.e=g.length-this.e-1,t.c[0]=p[(o=i%14)<0?14+o:o],e=!e||s.comparedTo(t)>0?i>0?t:u:s,o=B,B=1/0,s=new L(g),l.c[0]=0;h=S(s,t,0,1),1!=(a=r.plus(h.times(n))).comparedTo(e);)r=n,n=a,u=l.plus(h.times(a=u)),l=a,t=s.minus(h.times(a=t)),s=a;return a=S(e.minus(r),n,0,1),l=l.plus(a.times(u)),r=r.plus(a.times(n)),l.s=u.s=this.s,i*=2,f=1>S(u,n,i,k).minus(this).abs().comparedTo(S(l,r,i,k).minus(this).abs())?[u,n]:[l,r],B=o,f},E.toNumber=function(){return+q(this)},E.toPrecision=function(e,t){return null!=e&&g(e,1,1e9),U(this,e,t,2)},E.toString=function(e){var t,r=this,n=r.s,a=r.e;return null===a?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=a<=C||a>=_?y(d(r.c),a):w(d(r.c),a,"0"):10===e&&$?t=w(d((r=j(new L(r),T+a+1,k)).c),r.e,"0"):(g(e,2,O.length,"Base"),t=x(w(d(r.c),a,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},E.valueOf=E.toJSON=function(){return q(this)},E._isBigNumber=!0,null!=t&&L.set(t),L}()).default=i.BigNumber=i,void 0===(n=(function(){return i}).call(t,r,t,e))||(e.exports=n)}(0)},9169:(e,t,r)=>{"use strict";r.d(t,{Px:()=>d,n_:()=>h,qg:()=>p,y4:()=>u,yT:()=>c});var n=r(79142),a=r(35066),i=r(83123).hp;class o extends n.Ay$.ABIMethod{constructor(e){super(e),this.method=e,this.args=e.args.map(e=>({...e,type:n.Ay$.abiTypeIsTransaction(e.type)||n.Ay$.abiTypeIsReference(e.type)?e.type:n.Ay$.ABIType.from(e.type)})),this.returns={...this.method.returns,type:"void"===this.method.returns.type?"void":n.Ay$.ABIType.from(this.method.returns.type)}}toJSON(){return this.method}}function s(e,t){return new n.Ay$.ABITupleType(e.map(e=>"string"==typeof e.type?t[e.type]?s(t[e.type],t):n.Ay$.ABIType.from(e.type):s(e.type,t)))}function l(e,t,r){return Object.fromEntries(t.map(({name:t,type:i},o)=>{let c;c="string"==typeof i?i in r?s(r[i],r):n.Ay$.ABIType.from(i):s(i,r);let u=(0,a.Kn)(e[o],c),p=(0,a.t9)(u,c);return[t,("string"!=typeof i||r[i])&&Array.isArray(p)?l(p,"string"==typeof i?r[i]:i,r):p]}))}function c(e,t,r){return t.map(({name:t,type:n})=>{let a=e[t];return"string"!=typeof n||r[n]?c(a,"string"==typeof n?r[n]:n,r):a})}function u(e,t,r){if("AVMBytes"===t||"object"!=typeof e)return e;if("AVMString"===t)return i.from(e).toString("utf-8");if("AVMUint64"===t)return n.Ay$.ABIType.from("uint64").decode(e);if(r[t])return l(s(r[t],r).decode(e),r[t],r);let o=n.Ay$.ABIType.from(t),c=(0,a.Kn)(o.decode(e),o);return(0,a.t9)(c,o)}function p(e,t,r){if("object"==typeof e&&e instanceof Uint8Array)return e;if("AVMUint64"===t)return n.Ay$.ABIType.from("uint64").encode(e);if("AVMBytes"===t||"AVMString"===t){if("string"==typeof e)return i.from(e,"utf-8");if("object"!=typeof e||!(e instanceof Uint8Array))throw Error(`Expected bytes value for ${t}, but got ${e}`);return e}if(r[t]){let n=s(r[t],r);if(!Array.isArray(e))return n.encode(c(e,r[t],r));n.encode(e)}return n.Ay$.ABIType.from(t).encode(e)}function h(e,t){let r;if(e.includes("(")){let a=t.methods.find(t=>new n.Ay$.ABIMethod(t).getSignature()===e);if(!a)throw Error(`Unable to find method ${e} in ${t.name} app.`);r=a}else{let a=t.methods.filter(t=>t.name===e);if(0===a.length)throw Error(`Unable to find method ${e} in ${t.name} app.`);if(a.length>1)throw Error(`Received a call to method ${e} in contract ${t.name}, but this resolved to multiple methods; please pass in an ABI signature instead: ${t.methods.map(e=>
3new n.Ay$.ABIMethod(e).getSignature()).join(", ")}`);r=a[0]}return new o(r)}function d(e,t,r){let o="method"in t?t.method:t,s=o.returns.struct??o.returns.type;if(e?.decodeError)throw e.decodeError;if(void 0!==s&&"void"!==s&&e?.returnValue!==void 0)return"AVMBytes"===s?e.rawReturnValue:"AVMString"===s?i.from(e.rawReturnValue).toString("utf-8"):"AVMUint64"===s?n.Ay$.ABIType.from("uint64").decode(e.rawReturnValue):r[s]?l(e.returnValue,r[s],r):(0,a.Kn)(e.returnValue,n.Ay$.ABIType.from(s))}},9517:(e,t,r)=>{"use strict";r.d(t,{Sj:()=>z,Hz:()=>H,VQ:()=>K,At:()=>F,HT:()=>W,BS:()=>G,W2:()=>L,cF:()=>function e(t){if(null==t||"string"==typeof t||"number"==typeof t||"bigint"==typeof t||"boolean"==typeof t)return t;if(Array.isArray(t))return t.map(e);if("object"==typeof t){let r=new Map;for(let[n,a]of Object.entries(t))r.set(n,e(a));return r}throw Error(`Invalid JSON encoding data: ${t}`)},_A:()=>function e(t){if(null==t)return t;if(t instanceof Uint8Array)return(0,N.if)(t);if(Array.isArray(t))return t.map(e);if(t instanceof Map){let r={};for(let[n,a]of t){if("string"!=typeof n)throw Error(`JSON map key must be a string: ${n}`);r[n]=e(a)}return r}return t},J_:()=>V,zx:()=>j,p6:()=>$});var n,a,i=new TextEncoder;function o(e,t,r){for(var n=t,a=n+r,i=[],o="";n<a;){var s=e[n++];if((128&s)==0)i.push(s);else if((224&s)==192){var l=63&e[n++];i.push((31&s)<<6|l)}else if((240&s)==224){var l=63&e[n++],c=63&e[n++];i.push((31&s)<<12|l<<6|c)}else if((248&s)==240){var l=63&e[n++],c=63&e[n++],u=(7&s)<<18|l<<12|c<<6|63&e[n++];u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u)}else i.push(s);i.length>=4096&&(o+=String.fromCharCode.apply(String,i),i.length=0)}return i.length>0&&(o+=String.fromCharCode.apply(String,i)),o}var s=new TextDecoder,l=function(e,t){this.type=e,this.data=t},c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),u=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,Object.create(t.prototype)),Object.defineProperty(n,"name",{configurable:!0,enumerable:!1,value:t.name}),n}return c(t,e),t}(Error);function p(e,t,r){var n=Math.floor(r/0x100000000);e.setUint32(t,n),e.setUint32(t+4,r)}function h(e,t,r){if(r===n.UNSAFE_NUMBER||r===n.SAFE_NUMBER){var a=e.getInt32(t),i=e.getUint32(t+4);if(r===n.SAFE_NUMBER&&(a<Math.floor(Number.MIN_SAFE_INTEGER/0x100000000)||a===Math.floor(Number.MIN_SAFE_INTEGER/0x100000000)&&0===i||a>(Number.MAX_SAFE_INTEGER-i)/0x100000000)){var o="".concat(a<0?"-":"","0x").concat(Math.abs(a).toString(16)).concat(i.toString(16).padStart(8,"0"));throw Error("Mode is IntMode.SAFE_NUMBER and value is not a safe integer: ".concat(o))}return 0x100000000*a+i}var s=e.getBigInt64(t);return r===n.MIXED&&s>=Number.MIN_SAFE_INTEGER&&s<=Number.MAX_SAFE_INTEGER?Number(s):s}!function(e){e[e.UNSAFE_NUMBER=0]="UNSAFE_NUMBER",e[e.SAFE_NUMBER=1]="SAFE_NUMBER",e[e.AS_ENCODED=2]="AS_ENCODED",e[e.MIXED=3]="MIXED",e[e.BIGINT=4]="BIGINT"}(n||(n={}));var d={type:-1,encode:function(e){var t,r,n,a;return e instanceof Date?function(e){var t=e.sec,r=e.nsec;if(t>=0&&r>=0&&t<=0x3ffffffff)if(0===r&&t<=0xffffffff){var n=new Uint8Array(4),a=new DataView(n.buffer);return a.setUint32(0,t),n}else{var i=t/0x100000000,n=new Uint8Array(8),a=new DataView(n.buffer);return a.setUint32(0,r<<2|3&i),a.setUint32(4,0|t),n}var n=new Uint8Array(12),a=new DataView(n.buffer);return a.setUint32(0,r),p(a,4,t),n}((r=Math.floor((t=e.getTime())/1e3),a=Math.floor((n=(t-1e3*r)*1e6)/1e9),{sec:r+a,nsec:n-1e9*a})):null},decode:function(e){var t=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:var r=t.getUint32(0),a=0;return{sec:r,nsec:0};case 8:var i=t.getUint32(0),r=(3&i)*0x100000000+t.getUint32(4),a=i>>>2;return{sec:r,nsec:a};
3case 12:var r=h(t,4,n.UNSAFE_NUMBER),a=t.getUint32(0);return{sec:r,nsec:a};default:throw new u("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},f=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(d)}return e.prototype.register=function(e){var t=e.type,r=e.encode,n=e.decode;if(t>=0)this.encoders[t]=r,this.decoders[t]=n;else{var a=1+t;this.builtInEncoders[a]=r,this.builtInDecoders[a]=n}},e.prototype.tryToEncode=function(e,t){for(var r=0;r<this.builtInEncoders.length;r++){var n=this.builtInEncoders[r];if(null!=n){var a=n(e,t);if(null!=a){var i=-1-r;return new l(i,a)}}}for(var r=0;r<this.encoders.length;r++){var n=this.encoders[r];if(null!=n){var a=n(e,t);if(null!=a){var i=r;return new l(i,a)}}}return e instanceof l?e:null},e.prototype.decode=function(e,t,r){var n=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return n?n(e,t,r):new l(t,e)},e.defaultCodec=new e,e}(),g=r(52029),m=function(){function e(e){var t,r,n,a,i,o,s,l;this.extensionCodec=null!=(t=null==e?void 0:e.extensionCodec)?t:f.defaultCodec,this.context=null==e?void 0:e.context,this.forceBigIntToInt64=null!=(r=null==e?void 0:e.forceBigIntToInt64)&&r,this.maxDepth=null!=(n=null==e?void 0:e.maxDepth)?n:100,this.initialBufferSize=null!=(a=null==e?void 0:e.initialBufferSize)?a:2048,this.sortKeys=null!=(i=null==e?void 0:e.sortKeys)&&i,this.forceFloat32=null!=(o=null==e?void 0:e.forceFloat32)&&o,this.ignoreUndefined=null!=(s=null==e?void 0:e.ignoreUndefined)&&s,this.forceIntegerToFloat=null!=(l=null==e?void 0:e.forceIntegerToFloat)&&l,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return e.prototype.reinitializeState=function(){this.pos=0},e.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},e.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},e.prototype.doEncode=function(e,t){if(t>this.maxDepth)throw Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)},e.prototype.resizeBuffer=function(e){var t=new ArrayBuffer(e),r=new Uint8Array(t),n=new DataView(t);r.set(this.bytes),this.view=n,this.bytes=r},e.prototype.encodeNil=function(){this.writeU8(192)},e.prototype.encodeBoolean=function(e){!1===e?this.writeU8(194):this.writeU8(195)},e.prototype.encodeNumber=function(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<0x100000000?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-0x80000000?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)},e.prototype.encodeNumberAsFloat=function(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.encodeBigInt=function(e){if(this.forceBigIntToInt64)this.encodeBigIntAsInt64(e);else if(e>=0)if(e<0x100000000||this.forceIntegerToFloat)this.encodeNumber(Number(e));else if(e<BigInt("0x10000000000000000"))this.encodeBigIntAsInt64(e);else throw Error("Bigint is too large for uint64: ".concat(e));else if(e>=-0x80000000||this.forceIntegerToFloat)this.encodeNumber(Number(e));else if(e>=BigInt(-1)*BigInt("0x8000000000000000"))this.encodeBigIntAsInt64(e);else throw Error("Bigint is too small for int64: ".concat(e))},e.prototype.encodeBigIntAsInt64=function(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<0x100000000)this.writeU8(219),this.writeU32(e);else throw Error("Too long string: ".concat(e," bytes in UTF-8"))},e.prototype.encodeString=function(e){var t=function(e){for(var t=e.length,r=0,n=0;n<t;){var a=e.charCodeAt(n++);if((0xffffff80&a)==0){r++;continue}if((0xfffff800&a)==0)r+=2;else{if(a>=55296&&a<=56319&&n<t){var i=e.charCodeAt(n);(64512&i)==56320&&(++n,a=((1023&a)<<10)+(1023&i)+65536)}(0xffff0000&a)==0?r+=3:r+=4}}return r}(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,r){if(e.length>50)i.encodeInto(e,t.subarray(r));else!function(e,t,r){for(var n=e.length,a=r,i=0;i<n;){var o=e.charCodeAt(i++);if((0xffffff80&o)==0){t[a++]=o;continue}if((0xfffff800&o)==0)t[a++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&i<n){var s=e.charCodeAt(i);(64512&s)==56320&&(++i,o=((1023&o)<<10)+(1023&s)+65536)}(0xffff0000&o)==0?t[a++]=o>>12&15|224:(t[a++]=o>>18&7|240,t[a++]=o>>12&63|128),t[a++]=o>>6&63|128}t[a++]=63&o|128}}(e,t,r)}(e,this.bytes,this.pos),this.pos+=t},e.prototype.encodeObject=function(e,t){var r=this.extensionCodec.tryToEncode(e,this.context);if(null!=r)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(e instanceof g.t8)this.encodeBinaryAsString(e);else if("bigint"==typeof e)this.encodeBigInt(e);else if(e instanceof Map)this.encodeMap(e,t);else if("object"==typeof e)this.encodeMapObject(e,t);else throw Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)))},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<0x100000000)this.writeU8(198),this.writeU32(t);else throw Error("Too large binary: ".concat(t));var r=(0,g.CT)(e);this.writeU8a(r)},e.prototype.encodeBinaryAsString=function(e){var t=e.rawBinaryValue;this.writeStringHeader(t.byteLength);var r=(0,g.CT)(t);this.writeU8a(r)},e.prototype.encodeArray=function(e,t){var r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<0x100000000)this.writeU8(221),this.writeU32(r);else throw Error("Too large array: ".concat(r));for(var n=0;n<e.length;n++){var a=e[n];this.doEncode(a,t+1)}},e.prototype.countWithoutUndefined=function(e,t){for(var r=0,n=0;n<t.length;n++){var a=t[n];void 0!==e.get(a)&&r++}return r},e.prototype.sortMapKeys=function(e){for(var t=[],r=[],n=[],a=[],i=0;i<e.length;i++){var o=e[i];if("number"==typeof o){if(isNaN(o))throw Error("Cannot sort map keys with NaN value");t.push(o)}else if("bigint"==typeof o)t.push(o);else if("string"==typeof o)r.push(o);else if(ArrayBuffer.isView(o))a.push((0,g.CT)(o));else if(o instanceof g.t8)n.push(o);else throw Error("Unsupported map key type: ".concat(Object.prototype.toString.apply(o)))}return t.sort(function(e,t){return e<t?-1:+(e>t)}),r.sort(),n.sort(function(e,t){return(0,g._T)((0,g.CT)(e.rawBinaryValue),(0,g.CT)(t.rawBinaryValue))}),a.sort(g._T),[].concat(t,r,n,a)},e.prototype.encodeMapObject=function(e,t){this.encodeMap(new Map(Object.entries(e)),t)},e.prototype.encodeMap=function(e,t){var r=Array.from(e.keys());this.sortKeys&&(r=this.sortMapKeys(r));var n=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(n<16)this.writeU8(128+n);else if(n<65536)this.writeU8(222),this.writeU16(n);else if(n<0x100000000)this.writeU8(223),this.writeU32(n);else throw Error("Too large map object: ".concat(n));for(var a=0,i=r;a<i.length;a++){var o=i[a],s=e.get(o);if(!(this.ignoreUndefined&&void 0===s)){if("string"==typeof o)this.encodeString(o);else if("number"==typeof o)this.encodeNumber(o);else if("bigint"==typeof o)this.encodeBigInt(o);else if(ArrayBuffer.isView(o))this.encodeBinary(o);else if(o instanceof g.t8)this.encodeBinaryAsString(o);else throw Error("Unsupported map key type: ".concat(Object.prototype.toString.apply(o)));this.doEncode(s,t+1)}}},e.prototype.encodeExtension=function(e){var t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<0x100000000)this.writeU8(201),this.writeU32(t);else throw Error("Too large extension object: ".concat(t));this.writeI8(e.type),this.writeU8a(e.data)},e.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},e.prototype.writeU8a=function(e){var t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t},e.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},e.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},e.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},e.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},e.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},e.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},e.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},e.prototype.writeU64=function(e){var t,r;this.ensureBufferSizeToWrite(8),t=this.view,r=this.pos,t.setUint32(r,e/0x100000000),t.setUint32(r+4,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),p(this.view,this.pos,e),this.pos+=8},e.prototype.writeBigUint64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8},e.prototype.writeBigInt64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8},e}();function y(e){return"".concat(e<0?"-":"","0x").concat(Math.abs(e).toString(16).padStart(2,"0"))}var w=function(){function e(e,t){void 0===e&&(e=16),void 0===t&&(t=16),this.maxKeyLength=e,this.maxLengthPerKey=t,this.hit=0,this.miss=0,this.caches=[];for(var r=0;r<this.maxKeyLength;r++)this.caches.push([])}return e.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,r){var n=this.caches[r-1];t:for(var a=0;a<n.length;a++){for(var i=n[a],o=i.bytes,s=0;s<r;s++)if(o[s]!==e[t+s])continue t;return i.str}return null},e.prototype.store=function(e,t){var r=this.caches[e.length-1],n={bytes:e,str:t};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=n:r.push(n)},e.prototype.decode=function(e,t,r){var n=this.find(e,t,r);if(null!=n)return this.hit++,n;this.miss++;var a=o(e,t,r),i=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(i,a),a},e}(),v=function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;
3i&&(i=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},b=function(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,a){var i,o,s;i=n,o=a,s=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){i({value:e,done:s})},o)})}}},S=function(e){return this instanceof S?(this.v=e,this):new S(e)},x=function(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,a=r.apply(e,t||[]),i=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(e){a[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||s(e,t)})})}function s(e,t){try{var r;(r=a[e](t)).value instanceof S?Promise.resolve(r.value.v).then(l,c):u(i[0][2],r)}catch(e){u(i[0][3],e)}}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}},A="array",E="map_key",I="map_value",T=function(){function e(e){this.useMap=e,this.stack=[],this.stackHeadPosition=-1}return Object.defineProperty(e.prototype,"length",{get:function(){return this.stackHeadPosition+1},enumerable:!1,configurable:!0}),e.prototype.top=function(){return this.stack[this.stackHeadPosition]},e.prototype.pushArrayState=function(e){var t=this.getUninitializedStateFromPool();t.type=A,t.position=0,t.size=e,t.array=Array(e)},e.prototype.pushMapState=function(e){var t=this.getUninitializedStateFromPool();t.type=E,t.readCount=0,t.size=e,t.map=this.useMap?new Map:{}},e.prototype.getUninitializedStateFromPool=function(){return this.stackHeadPosition++,this.stackHeadPosition===this.stack.length&&this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null}),this.stack[this.stackHeadPosition]},e.prototype.release=function(e){if(this.stack[this.stackHeadPosition]!==e)throw Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===A){var t=e;t.size=0,t.array=void 0,t.position=0,t.type=void 0}if(e.type===E||e.type===I){var t=e;t.size=0,t.map=void 0,t.readCount=0,t.type=void 0}this.stackHeadPosition--},e.prototype.reset=function(){this.stack.length=0,this.stackHeadPosition=-1},e}(),k=new DataView(new ArrayBuffer(0)),C=new Uint8Array(k.buffer);try{k.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var _=RangeError,D=new _("Insufficient data"),B=new w,P=function(){function e(e){var t,r,a,i,o,s,l,c,u,p,h,d;if(this.totalPos=0,this.pos=0,this.view=k,this.bytes=C,this.headByte=-1,this.extensionCodec=null!=(t=null==e?void 0:e.extensionCodec)?t:f.defaultCodec,this.context=null==e?void 0:e.context,this.intMode=null!=(r=null==e?void 0:e.intMode)?r:(null==e?void 0:e.useBigInt64)?n.AS_ENCODED:n.UNSAFE_NUMBER,this.rawBinaryStringValues=null!=(a=null==e?void 0:e.rawBinaryStringValues)&&a,this.rawBinaryStringKeys=null!=(i=null==e?void 0:e.rawBinaryStringKeys)&&i,this.useRawBinaryStringClass=null!=(o=null==e?void 0:e.useRawBinaryStringClass)&&o,this.useMap=null!=(s=null==e?void 0:e.useMap)&&s,this.supportObjectNumberKeys=null!=(l=null==e?void 0:e.supportObjectNumberKeys)&&l,this.maxStrLength=null!=(c=null==e?void 0:e.maxStrLength)?c:0xffffffff,this.maxBinLength=null!=(u=null==e?void 0:e.maxBinLength)?u:0xffffffff,this.maxArrayLength=null!=(p=null==e?void 0:e.maxArrayLength)?p:0xffffffff,this.maxMapLength=null!=(h=null==e?void 0:e.maxMapLength)?h:0xffffffff,this.maxExtLength=null!=(d=null==e?void 0:e.maxExtLength)?d:0xffffffff,this.keyDecoder=(null==e?void 0:e.keyDecoder)!==void 0?e.keyDecoder:B,this.rawBinaryStringKeys&&!this.useMap)throw Error("rawBinaryStringKeys is only supported when useMap is true");this.stack=new T(this.useMap)}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.reset()},e.prototype.setBuffer=function(e){this.bytes=(0,g.CT)(e),this.view=(0,g.od)(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining(1)){var t=this.bytes.subarray(this.pos),r=(0,g.CT)(e),n=new Uint8Array(t.length+r.length);n.set(t),n.set(r,t.length),this.setBuffer(n)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},e.prototype.createExtraByteError=function(e){var t=this.view,r=this.pos;return RangeError("Extra ".concat(t.byteLength-r," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return v(this,function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:if(!this.hasRemaining(1))return[3,3];return[4,this.doDecodeSync()];case 2:return t.sent(),[3,1];case 3:return[2]}})},e.prototype.decodeAsync=function(e){var t,r,n,a,i,o,s,l,c,u,p;return l=this,c=void 0,u=void 0,p=function(){var l,c,u,p,h,d,f;return v(this,function(g){switch(g.label){case 0:l=!1,g.label=1;
3case 1:g.trys.push([1,6,7,12]),t=!0,r=b(e),g.label=2;case 2:return[4,r.next()];case 3:if(a=(n=g.sent()).done)return[3,5];if(s=n.value,t=!1,u=s,l)throw this.createExtraByteError(this.totalPos);this.appendBuffer(u);try{c=this.doDecodeSync(),l=!0}catch(e){if(!(e instanceof _))throw e}this.totalPos+=this.pos,g.label=4;case 4:return t=!0,[3,2];case 5:return[3,12];case 6:return i={error:g.sent()},[3,12];case 7:if(g.trys.push([7,,10,11]),!(!t&&!a&&(o=r.return)))return[3,9];return[4,o.call(r)];case 8:g.sent(),g.label=9;case 9:return[3,11];case 10:if(i)throw i.error;return[7];case 11:return[7];case 12:if(l){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,c]}throw p=this,h=p.headByte,d=p.pos,f=p.totalPos,RangeError("Insufficient data in parsing ".concat(y(h)," at ").concat(f," (").concat(d," in the current buffer)"))}})},new(u||(u=Promise))(function(e,t){function r(e){try{a(p.next(e))}catch(e){t(e)}}function n(e){try{a(p.throw(e))}catch(e){t(e)}}function a(t){var a;t.done?e(t.value):((a=t.value)instanceof u?a:new u(function(e){e(a)})).then(r,n)}a((p=p.apply(l,c||[])).next())})},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return x(this,arguments,function(){var r,n,a,i,o,s,l,c,u,p,h;return v(this,function(d){switch(d.label){case 0:r=t,n=-1,d.label=1;case 1:d.trys.push([1,13,14,19]),a=!0,i=b(e),d.label=2;case 2:return[4,S(i.next())];case 3:if(c=(o=d.sent()).done)return[3,12];if(h=o.value,a=!1,s=h,t&&0===n)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),r&&(n=this.readArraySize(),r=!1,this.complete()),d.label=4;case 4:d.trys.push([4,9,,10]),d.label=5;case 5:return[4,S(this.doDecodeSync())];case 6:return[4,d.sent()];case 7:if(d.sent(),0==--n)return[3,8];return[3,5];case 8:return[3,10];case 9:if(!((l=d.sent())instanceof _))throw l;return[3,10];case 10:this.totalPos+=this.pos,d.label=11;case 11:return a=!0,[3,2];case 12:return[3,19];case 13:return u={error:d.sent()},[3,19];case 14:if(d.trys.push([14,,17,18]),!(!a&&!c&&(p=i.return)))return[3,16];return[4,S(p.call(i))];case 15:d.sent(),d.label=16;case 16:return[3,18];case 17:if(u)throw u.error;return[7];case 18:return[7];case 19:return[2]}})})},e.prototype.doDecodeSync=function(){r:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=this.convertNumber(e-256);else if(e<192)if(e<128)t=this.convertNumber(e);else if(e<144){var r=e-128;if(0!==r){this.pushMapState(r),this.complete();continue}t=this.useMap?new Map:{}}else if(e<160){var r=e-144;if(0!==r){this.pushArrayState(r),this.complete();continue}t=[]}else{var n=e-160;t=this.decodeString(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.convertNumber(this.readU8());else if(205===e)t=this.convertNumber(this.readU16());else if(206===e)t=this.convertNumber(this.readU32());else if(207===e)t=this.readU64();else if(208===e)t=this.convertNumber(this.readI8());else if(209===e)t=this.convertNumber(this.readI16());else if(210===e)t=this.convertNumber(this.readI32());else if(211===e)t=this.readI64();else if(217===e){var n=this.lookU8();t=this.decodeString(n,1)}else if(218===e){var n=this.lookU16();t=this.decodeString(n,2)}else if(219===e){var n=this.lookU32();t=this.decodeString(n,4)}else if(220===e){var r=this.readU16();if(0!==r){this.pushArrayState(r),this.complete();continue}t=[]}else if(221===e){var r=this.readU32();if(0!==r){this.pushArrayState(r),this.complete();continue}t=[]}else if(222===e){var r=this.readU16();if(0!==r){this.pushMapState(r),this.complete();continue}t={}}else if(223===e){var r=this.readU32();if(0!==r){this.pushMapState(r),this.complete();continue}t={}}else if(196===e){var r=this.lookU8();t=this.decodeBinary(r,1)}else if(197===e){var r=this.lookU16();t=this.decodeBinary(r,2)}else if(198===e){var r=this.lookU32();t=this.decodeBinary(r,4)}else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e){var r=this.lookU8();t=this.decodeExtension(r,1)}else if(200===e){var r=this.lookU16();t=this.decodeExtension(r,2)}else if(201===e){var r=this.lookU32();t=this.decodeExtension(r,4)}else throw new u("Unrecognized type byte: ".concat(y(e)));this.complete();for(var a=this.stack;a.length>0;){var i,o,s,l=a.top();if(l.type===A)if(l.array[l.position]=t,l.position++,l.position===l.size)t=l.array,a.release(l);else continue r;else if(l.type===E){if(i=t,o=this.useMap,s=this.supportObjectNumberKeys,o?!("string"==typeof i||"number"==typeof i||"bigint"==typeof i||i instanceof Uint8Array)&&!(i instanceof g.t8):"string"!=typeof i&&(!s||"number"!=typeof i)){var c=this.useMap?"string, number, bigint, or Uint8Array":this.supportObjectNumberKeys?"string or number":"string";throw new u("The type of key must be ".concat(c," but got ").concat(typeof t))}if(!this.useMap&&"__proto__"===t)throw new u("The key __proto__ is not allowed");l.key=t,l.type=I;continue r}else if(this.useMap?l.map.set(l.key,t):l.map[l.key]=t,l.readCount++,l.readCount===l.size)t=l.map,a.release(l);else{l.key=null,l.type=E;continue r}}return t}},e.prototype.readHeadByte=function(){return -1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new u("Unrecognized array type byte: ".concat(y(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new u("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.pushMapState(e)},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new u("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.pushArrayState(e)},e.prototype.decodeString=function(e,t){if(this.stateIsMapKey()?this.rawBinaryStringKeys:this.rawBinaryStringValues){var r=this.decodeBinary(e,t);return this.useRawBinaryStringClass?new g.t8(r):r}return this.decodeUtf8String(e,t)},e.prototype.decodeUtf8String=function(e,t){if(e>this.maxStrLength)throw new u("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+t+e)throw D;var r,n,a=this.pos+t;return n=this.stateIsMapKey()&&(null==(r=this.keyDecoder)?void 0:r.canBeCached(e))?this.keyDecoder.decode(this.bytes,a,e):function(e,t,r){var n;return r>200?(n=e.subarray(t,t+r),s.decode(n)):o(e,t,r)}(this.bytes,a,e),this.pos+=t+e,n},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&this.stack.top().type===E},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new u("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw D;var r=this.pos+t,n=this.bytes.subarray(r,r+e);return this.pos+=t+e,n},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new u("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var r=this.view.getInt8(this.pos+t),n=this.decodeBinary(e,t+1);return this.extensionCodec.decode(n,r,this.context)},e.prototype.convertNumber=function(e){return this.intMode===n.BIGINT?BigInt(e):Number(e)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e=function(e,t,r){if(r===n.UNSAFE_NUMBER||r===n.SAFE_NUMBER){var a=e.getUint32(t),i=e.getUint32(t+4);if(r===n.SAFE_NUMBER&&a>(Number.MAX_SAFE_INTEGER-i)/0x100000000){var o="0x".concat(a.toString(16)).concat(i.toString(16).padStart(8,"0"));throw Error("Mode is IntMode.SAFE_NUMBER and value is not a safe integer: ".concat(o))}return 0x100000000*a+i}var s=e.getBigUint64(t);
3return r===n.MIXED&&s<=Number.MAX_SAFE_INTEGER?Number(s):s}(this.view,this.pos,this.intMode);return this.pos+=8,e},e.prototype.readI64=function(){var e=h(this.view,this.pos,this.intMode);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}();function M(e,t){return new P(t).decode(e)}var N=r(30841),R=r(73716),O=r(46085);function $(e){return new m({sortKeys:!0}).encodeSharedRef(e)}function L(e){let t=function(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(!e[t]||0===e[t].length))return{containsEmpty:!0,firstEmptyKey:t};return{containsEmpty:!1,firstEmptyKey:void 0}}(e);if(t.containsEmpty)throw Error("The object contains empty or 0 values. First empty or 0 value encountered during encoding: "+t.firstEmptyKey);return $(e)}function U(e){switch(e){case R.A.UNSAFE:return n.UNSAFE_NUMBER;case R.A.SAFE:return n.SAFE_NUMBER;case R.A.MIXED:return n.MIXED;case R.A.BIGINT:return n.BIGINT;default:throw Error(`Invalid intDecoding: ${e}`)}}function V(e,t){return M(e,{intMode:t?.intDecoding?U(t?.intDecoding):n.BIGINT})}function F(e){return V(e,{intDecoding:R.A.MIXED})}function j(e,t){return M(e,{intMode:t?.intDecoding?U(t?.intDecoding):n.BIGINT,useMap:!0})}!function(e){e[e.MAP_VALUE=0]="MAP_VALUE",e[e.ARRAY_ELEMENT=1]="ARRAY_ELEMENT"}(a||(a={}));class q{constructor({parent:e,segment:t,baseObjectBytes:r}){this.resolvedCache=null,this.resolvedCachePresent=!1,this.parent=e,this.segment=t,this.baseObjectBytes=r}withMapValue(e){return new q({parent:this,segment:{kind:a.MAP_VALUE,key:e}})}withArrayElement(e){return new q({parent:this,segment:{kind:a.ARRAY_ELEMENT,key:e}})}getRawStringAtCurrentLocation(){let e=this.resolve();if(e instanceof g.t8)return e.rawBinaryValue;throw Error(`Invalid type. Expected RawBinaryString, got ${e} (${typeof e})`)}getRawStringKeysAndValuesAtCurrentLocation(){let e=this.resolve();if(!(e instanceof Map))throw Error(`Invalid type. Expected Map, got ${e} (${typeof e})`);let t=new Map;for(let[r,n]of e)if(r instanceof g.t8)t.set(r.rawBinaryValue,n);else throw Error(`Invalid type for map key. Expected RawBinaryString, got ${r} (${typeof r})`);return t}resolve(){let e;if(this.resolvedCachePresent)return this.resolvedCache;if(e=this.parent?this.parent.resolve():M(this.baseObjectBytes,{intMode:n.BIGINT,useMap:!0,rawBinaryStringKeys:!0,rawBinaryStringValues:!0,useRawBinaryStringClass:!0}),!this.segment)return this.resolvedCache=e,this.resolvedCachePresent=!0,e;if(this.segment.kind===a.MAP_VALUE){if(!(e instanceof Map))throw Error(`Invalid type. Expected Map, got ${e} (${typeof e})`);if("string"==typeof this.segment.key||this.segment.key instanceof Uint8Array||this.segment.key instanceof g.t8){let t=this.segment.key instanceof g.t8?this.segment.key.rawBinaryValue:(0,N.aS)(this.segment.key),r="string"==typeof this.segment.key||this.segment.key instanceof g.t8;for(let[n,a]of e){let e;if(r?n instanceof g.t8&&(e=n.rawBinaryValue):n instanceof Uint8Array&&(e=n),e&&(0,O.af)(t,e)){this.resolvedCache=a;break}}}else this.resolvedCache=e.get(this.segment.key);return this.resolvedCachePresent=!0,this.resolvedCache}if(this.segment.kind===a.ARRAY_ELEMENT){if(!Array.isArray(e))throw Error(`Invalid type. Expected Array, got ${e} (${typeof e})`);return this.resolvedCache=e[this.segment.key],this.resolvedCachePresent=!0,this.resolvedCache}throw Error(`Invalid segment kind: ${this.segment.kind}`)}getPathString(){let e=this.parent?this.parent.getPathString():"root";return this.segment?this.segment.kind===a.MAP_VALUE?`${e} -> map key "${this.segment.key}" (${typeof this.segment.key})`:this.segment.kind===a.ARRAY_ELEMENT?`${e} -> array index ${this.segment.key} (${typeof this.segment.key})`:`${e} -> unknown segment kind ${this.segment.kind}`:e}}class z{}function K(e,t){let r=j(e),n=new q({baseObjectBytes:e});return t.fromEncodingData(t.encodingSchema.fromPreparedMsgpack(r,n))}function G(e){return $(e.getEncodingSchema().prepareMsgpack(e.toEncodingData()))}function H(e,t){let r=(0,O.Ol)(e,{intDecoding:R.A.BIGINT});return t.fromEncodingData(t.encodingSchema.fromPreparedJSON(r))}function W(e,t){let{space:r,...n}=t??{},a=e.getEncodingSchema().prepareJSON(e.toEncodingData(),n);return(0,O.e4)(a,void 0,r)}},10062:(e,t,r)=>{"use strict";r.d(t,{r:()=>s});var n=r(79175);r(64527);var a=r(68325),i=r(97569),o=r(36346);let s=(0,i.P9)((e,t)=>{let{withinPortal:r=!0,children:i,...s}=e;return"test"!==(0,a.bv)()&&r?(0,n.jsx)(o.Z,{ref:t,...s,children:i}):(0,n.jsx)(n.Fragment,{children:i})});s.displayName="@mantine/core/OptionalPortal"},12021:(e,t,r)=>{"use strict";r.d(t,{Ef:()=>u,M4:()=>w,Uf:()=>y,ar:()=>h,bP:()=>m,ch:()=>b,eF:()=>g,fy:()=>p,i4:()=>d,qV:()=>f,sO:()=>v});var n=r(79142),a=r(43728),i=r(30905),o=r(70377),s=r(35066);r(83123).hp;var l=n.Ay$.ABIMethod,c=n.Ay$.OnApplicationComplete;async function u(e,t){let r=h(e.onCompleteAction);if(r===n.Ay$.OnApplicationComplete.ClearStateOC)throw Error("Cannot create an app with on-complete action of ClearState");let o=e.args?.method?await (0,a.iI)(t,e.from,e.args,e,{sender:(0,i.sE)(e.from),onComplete:r,approvalProgram:e.approvalProgram,clearStateProgram:e.clearStateProgram,method:e.args.method instanceof l?e.args.method:new l(e.args.method),extraProgramPages:e.schema.extraPages,schema:e.schema},e=>e.appCreateMethodCall,e=>e.appCreateMethodCall):await (0,a.iI)(t,e.from,e.args,e,{sender:(0,i.sE)(e.from),onComplete:r,approvalProgram:e.approvalProgram,clearStateProgram:e.clearStateProgram,extraProgramPages:e.schema.extraPages,schema:e.schema},e=>e.appCreate,e=>e.appCreate);
3return{...o,appId:"appId"in o?Number(o.appId):0,appAddress:"appAddress"in o?o.appAddress.toString():""}}async function p(e,t){return e.args?.method?await (0,a.iI)(t,e.from,e.args,e,{appId:BigInt(e.appId),sender:(0,i.sE)(e.from),onComplete:n.Ay$.OnApplicationComplete.UpdateApplicationOC,approvalProgram:e.approvalProgram,clearStateProgram:e.clearStateProgram,method:e.args.method instanceof l?e.args.method:new l(e.args.method)},e=>e.appUpdateMethodCall,e=>e.appUpdateMethodCall):await (0,a.iI)(t,e.from,e.args,e,{appId:BigInt(e.appId),sender:(0,i.sE)(e.from),onComplete:n.Ay$.OnApplicationComplete.UpdateApplicationOC,approvalProgram:e.approvalProgram,clearStateProgram:e.clearStateProgram},e=>e.appUpdate,e=>e.appUpdate)}function h(e){switch(e){case void 0:case"no_op":case c.NoOpOC:return c.NoOpOC;case"opt_in":case c.OptInOC:return c.OptInOC;case"close_out":case c.CloseOutOC:return c.CloseOutOC;case"clear_state":case c.ClearStateOC:return c.ClearStateOC;case"update_application":case c.UpdateApplicationOC:return c.UpdateApplicationOC;case"delete_application":case c.DeleteApplicationOC:return c.DeleteApplicationOC}}async function d(e,t){let r=h(e.callType);if(r===n.Ay$.OnApplicationComplete.UpdateApplicationOC)throw Error("Cannot execute an app call with on-complete action of Update");if(e.args?.method&&r===n.Ay$.OnApplicationComplete.ClearStateOC)throw Error("Cannot execute an ABI method call with on-complete action of ClearState");return e.args?.method?await (0,a.iI)(t,e.from,e.args,e,{appId:BigInt(e.appId),sender:(0,i.sE)(e.from),onComplete:r,method:e.args.method instanceof l?e.args.method:new l(e.args.method)},e=>e.appCallMethodCall,e=>e.appCallMethodCall):await (0,a.iI)(t,e.from,e.args,e,{appId:BigInt(e.appId),sender:(0,i.sE)(e.from),onComplete:r},e=>e.appCall,e=>e.appCall)}async function f(e,t){return await new o.r(t).getGlobalState(BigInt(e))}async function g(e,t,r){return new o.r(r).getLocalState(BigInt(e),(0,i.sE)(t))}async function m(e,t){return new o.r(t).getBoxNames(BigInt(e))}async function y(e,t,r){return new o.r(r).getBoxValue(BigInt(e),"string"!=typeof t&&"name"in t?t.nameRaw:t)}async function w(e,t){return new o.r(t).getBoxValueFromABIType({appId:BigInt(e.appId),boxName:"string"!=typeof e.boxName&&"name"in e.boxName?e.boxName.nameRaw:e.boxName,type:e.type})}async function v(e,t){return await t.getApplicationByID((0,s.Ro)(e)).do()}async function b(e,t){return await new o.r(t).compileTeal(e)}},12929:(e,t,r)=>{"use strict";r.d(t,{eu:()=>c,vf:()=>y,xk:()=>f,od:()=>a,zf:()=>A,HM:()=>p,lb:()=>h,pZ:()=>v,KN:()=>I,rT:()=>E,D4:()=>m,nY:()=>i,ac:()=>x,qc:()=>s,XD:()=>T,co:()=>w,o1:()=>b,sm:()=>S});var n=r(9517);class a extends n.Sj{defaultValue(){return!1}isDefaultValue(e){return!1===e}prepareMsgpack(e){if("boolean"==typeof e)return e;throw Error("Invalid boolean")}fromPreparedMsgpack(e,t){if("boolean"==typeof e)return e;throw Error("Invalid boolean")}prepareJSON(e,t){if("boolean"==typeof e)return e;throw Error("Invalid boolean")}fromPreparedJSON(e){if("boolean"==typeof e)return e;throw Error("Invalid boolean")}}class i extends n.Sj{defaultValue(){return""}isDefaultValue(e){return""===e}prepareMsgpack(e){if("string"==typeof e)return e;throw Error(`Invalid string: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if("string"==typeof e)return e;throw Error(`Invalid string: (${typeof e}) ${e}`)}prepareJSON(e,t){if("string"==typeof e)return e;throw Error(`Invalid string: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return e;throw Error(`Invalid string: (${typeof e}) ${e}`)}}var o=r(46085);class s extends n.Sj{defaultValue(){return BigInt(0)}isDefaultValue(e){return"bigint"==typeof e?e===BigInt(0):"number"==typeof e&&0===e}prepareMsgpack(e){return(0,o.Bw)(e)}fromPreparedMsgpack(e,t){return(0,o.Bw)(e)}prepareJSON(e,t){return(0,o.Bw)(e)}fromPreparedJSON(e){return(0,o.Bw)(e)}}var l=r(68724);class c extends n.Sj{defaultValue(){return l.pV.zeroAddress()}isDefaultValue(e){return l.pV.zeroAddress().equals(e)}prepareMsgpack(e){if(e instanceof l.pV)return e.publicKey;throw Error(`Invalid address: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){return new l.pV(e)}prepareJSON(e,t){if(e instanceof l.pV)return e.toString();throw Error(`Invalid address: (${typeof e}) ${e}`)}fromPreparedJSON(e){return l.pV.fromString(e)}}var u=r(30841);class p extends n.Sj{defaultValue(){return new Uint8Array}isDefaultValue(e){return e instanceof Uint8Array&&0===e.byteLength}prepareMsgpack(e){if(e instanceof Uint8Array)return e;throw Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array)return e;throw Error(`Invalid byte array: (${typeof e}) ${e}`)}prepareJSON(e,t){if(e instanceof Uint8Array)return(0,u.if)(e);throw Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedJSON(e){if(null==e)return this.defaultValue();if("string"==typeof e)return(0,u.Kp)(e);throw Error(`Invalid byte array: (${typeof e}) ${e}`)}}class h extends n.Sj{constructor(e){super(),this.length=e}defaultValue(){return new Uint8Array(this.length)}isDefaultValue(e){return e instanceof Uint8Array&&e.byteLength===this.length&&e.every(e=>0===e)}prepareMsgpack(e){if(e instanceof Uint8Array){if(e.byteLength===this.length)return e;throw Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw Error("Invalid byte array")}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array){if(e.byteLength===this.length)return e;throw Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw Error("Invalid byte array")}prepareJSON(e){if(e instanceof Uint8Array){if(e.byteLength===this.length)return(0,u.if)(e);throw Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw Error("Invalid byte array")}fromPreparedJSON(e){if("string"==typeof e){let t=(0,u.Kp)(e);if(t.byteLength===this.length)return t;throw Error(`Invalid byte array length: wanted ${this.length}, got ${t.byteLength}`)}throw Error("Invalid base64 byte array")}}var d=r(43795);class f extends n.Sj{defaultValue(){return new Uint8Array(32)}isDefaultValue(e){return e instanceof Uint8Array&&32===e.byteLength&&e.every(e=>0===e)}prepareMsgpack(e){if(e instanceof Uint8Array&&32===e.byteLength)return e;throw Error(`Invalid block hash: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array&&32===e.byteLength)return e;throw Error(`Invalid block hash: (${typeof e}) ${e}`)}prepareJSON(e,t){if(e instanceof Uint8Array&&32===e.byteLength)return`blk-${d.encode(e).slice(0,52)}`;throw Error(`Invalid block hash: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e&&56===e.length&&e.startsWith("blk-"))return Uint8Array.from(d.decode.asBytes(e.slice(4)));throw Error(`Invalid block hash: (${typeof e}) ${e}`)}}var g=r(52029);class m extends n.Sj{defaultValue(){return new Uint8Array}isDefaultValue(e){return e instanceof Uint8Array&&0===e.byteLength}prepareMsgpack(e){if(e instanceof Uint8Array)return new g.t8(e);throw Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){return t.getRawStringAtCurrentLocation()}prepareJSON(e,t){if(e instanceof Uint8Array){let r=(0,u.Ar)(e);if(!t.lossyBinaryStringConversion&&!(0,o.af)((0,u.aS)(r),e))throw Error(`Invalid UTF-8 byte array encountered. Encode with lossyBinaryStringConversion enabled to bypass this check. Base64 value: ${(0,u.if)(e)}`);return r}throw Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return(0,u.aS)(e);throw Error(`Invalid byte array: (${typeof e}) ${e}`)}}class y extends n.Sj{constructor(e){super(),this.itemSchema=e}defaultValue(){return[]}isDefaultValue(e){return Array.isArray(e)&&0===e.length}prepareMsgpack(e){if(Array.isArray(e))return e.map(e=>this.itemSchema.prepareMsgpack(e));throw Error("ArraySchema data must be an array")}fromPreparedMsgpack(e,t){if(Array.isArray(e))return e.map((e,r)=>this.itemSchema.fromPreparedMsgpack(e,t.withArrayElement(r)));throw Error(`ArraySchema encoded data must be an array: ${e} (${typeof e})`)}prepareJSON(e,t){if(Array.isArray(e))return e.map(e=>this.itemSchema.prepareJSON(e,t));throw Error("ArraySchema data must be an array")}fromPreparedJSON(e){if(Array.isArray(e))return e.map(e=>this.itemSchema.fromPreparedJSON(e));throw Error(`ArraySchema encoded data must be an array: ${e} (${typeof e})`)}}function w(e){return e.map(e=>({...e,omitEmpty:!0}))}class v extends n.Sj{constructor(e){super(),this.entries=e,this.checkEntries()}pushEntries(...e){this.entries.push(...e),this.checkEntries()}checkEntries(){for(let e of this.entries)if(e.embedded){if(""!==e.key)throw Error("Embedded entries must have an empty key");if(!(e.valueSchema instanceof v))throw Error("Embedded entry valueSchema must be a NamedMapSchema")}let e=new Set;for(let t of this.getEntries()){if(e.has(t.key))throw Error(`Duplicate key: ${t.key}`);e.add(t.key)}}getEntries(){let e=[];for(let t of this.entries)if(t.embedded){let r=t.valueSchema;e.push(...r.getEntries())}else e.push(t);return e}defaultValue(){let e=new Map;for(let t of this.getEntries())e.set(t.key,t.valueSchema.defaultValue());return e}isDefaultValue(e){if(!(e instanceof Map))return!1;for(let t of this.getEntries())if(!t.valueSchema.isDefaultValue(e.get(t.key)))return!1;return!0}prepareMsgpack(e){if(!(e instanceof Map))throw Error(`NamedMapSchema data must be a Map. Got (${typeof e}) ${e}`);let t=new Map;for(let r of this.getEntries()){let n=e.get(r.key);r.omitEmpty&&r.valueSchema.isDefaultValue(n)||t.set(r.key,r.valueSchema.prepareMsgpack(n))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw Error("NamedMapSchema data must be a Map");let r=new Map;for(let n of this.getEntries())if(e.has(n.key))r.set(n.key,n.valueSchema.fromPreparedMsgpack(e.get(n.key),t.withMapValue(n.key)));else if(n.omitEmpty)r.set(n.key,n.valueSchema.defaultValue());else throw Error(`Missing key: ${n.key}`);return r}prepareJSON(e,t){if(!(e instanceof Map))throw Error("NamedMapSchema data must be a Map");let r={};for(let n of this.getEntries()){let a=e.get(n.key);n.omitEmpty&&n.valueSchema.isDefaultValue(a)||(r[n.key]=n.valueSchema.prepareJSON(a,t))}return r}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw Error("NamedMapSchema data must be an object");let t=new Map;for(let r of this.getEntries())if(Object.prototype.hasOwnProperty.call(e,r.key))t.set(r.key,r.valueSchema.fromPreparedJSON(e[r.key]));else if(r.omitEmpty)t.set(r.key,r.valueSchema.defaultValue());else throw Error(`Missing key: ${r.key}`);return t}}function b(...e){let t=new Map;for(let r of e)for(let[e,n]of r){if(t.has(e))throw Error(`Duplicate key: ${e}`);t.set(e,n)}return t}function S(e,t){let r=new Map;for(let[n,a]of e){let[e,i]=t(n,a);r.set(e,i)}return r}class x extends n.Sj{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw Error(`Uint64MapSchema data must be a Map. Got (${typeof e}) ${e}`);let t=new Map;for(let[r,n]of e){let e=(0,o.Bw)(r);if(t.has(e))throw Error(`Duplicate key: ${e}`);t.set(e,this.valueSchema.prepareMsgpack(n))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw Error("Uint64MapSchema data must be a Map");let r=new Map;for(let[n,a]of e){let e=(0,o.Bw)(n);if(r.has(e))throw Error(`Duplicate key: ${e}`);r.set(e,this.valueSchema.fromPreparedMsgpack(a,t.withMapValue(n)))}return r}prepareJSON(e,t){if(!(e instanceof Map))throw Error(`Uint64MapSchema data must be a Map. Got (${typeof e}) ${e}`);let r=new Map;for(let[n,a]of e){let e=(0,o.Bw)(n);if(r.has(e))throw Error(`Duplicate key: ${e}`);r.set(e,this.valueSchema.prepareJSON(a,t))}let n={};for(let[e,t]of r)n[e.toString()]=t;return n}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw Error("Uint64MapSchema data must be an object");let t=new Map;for(let[r,n]of Object.entries(e)){let e=BigInt(r);if(t.has(e))throw Error(`Duplicate key: ${e}`);t.set(e,this.valueSchema.fromPreparedJSON(n))}return t}}n.Sj;class A extends n.Sj{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw Error(`ByteArrayMapSchema data must be a Map. Got (${typeof e}) ${e}`);let t=new Map;for(let[r,n]of e){if(!(r instanceof Uint8Array))throw Error(`Invalid key: ${r} (${typeof r})`);t.set(r,this.valueSchema.prepareMsgpack(n))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw Error("ByteArrayMapSchema data must be a Map");let r=new Map;for(let[n,a]of e){if(!(n instanceof Uint8Array))throw Error(`Invalid key: ${n} (${typeof n})`);r.set(n,this.valueSchema.fromPreparedMsgpack(a,t.withMapValue(n)))}return r}prepareJSON(e,t){if(!(e instanceof Map))throw Error(`ByteArrayMapSchema data must be a Map. Got (${typeof e}) ${e}`);let r=new Map;for(let[n,a]of e){if(!(n instanceof Uint8Array))throw Error(`Invalid key: ${n} (${typeof n})`);let e=(0,u.if)(n);if(r.has(e))throw Error(`Duplicate key (base64): ${e}`);r.set(e,this.valueSchema.prepareJSON(a,t))}let n={};for(let[e,t]of r)n[e]=t;return n}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw Error("ByteArrayMapSchema data must be an object");let t=new Map;for(let[r,n]of Object.entries(e))t.set((0,u.Kp)(r),this.valueSchema.fromPreparedJSON(n));return t}}class E extends n.Sj{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw Error(`SpecialCaseBinaryStringMapSchema data must be a Map. Got (${typeof e}) ${e}`);let t=new Map;for(let[r,n]of e){if(!(r instanceof Uint8Array))throw Error(`Invalid key: ${r} (${typeof r})`);t.set(new g.t8(r),this.valueSchema.prepareMsgpack(n))}return t}fromPreparedMsgpack(e,t){let r=new Map;for(let[e,n]of t.getRawStringKeysAndValuesAtCurrentLocation())r.set(e,this.valueSchema.fromPreparedMsgpack(function e(t){if(t instanceof g.t8)return(0,u.Ar)(t.rawBinaryValue);if(t instanceof Map){let r=new Map;for(let[n,a]of t)r.set(e(n),e(a));return r}return Array.isArray(t)?t.map(e):t}(n),t.withMapValue(new g.t8(e))));return r}prepareJSON(e,t){if(!(e instanceof Map))throw Error(`SpecialCaseBinaryStringMapSchema data must be a Map. Got (${typeof e}) ${e}`);let r=new Map;for(let[n,a]of e){if(!(n instanceof Uint8Array))throw Error(`Invalid key: ${n}`);let e=(0,u.Ar)(n);if(!t.lossyBinaryStringConversion&&!(0,o.af)((0,u.aS)(e),n))throw Error(`Invalid UTF-8 byte array encountered. Encode with lossyBinaryStringConversion enabled to bypass this check. Base64 value: ${(0,u.if)(n)}`);r.set(e,this.valueSchema.prepareJSON(a,t))}let n={};for(let[e,t]of r)n[e]=t;return n}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw Error("SpecialCaseBinaryStringMapSchema data must be an object");let t=new Map;for(let[r,n]of Object.entries(e))t.set((0,u.aS)(r),this.valueSchema.fromPreparedJSON(n));return t}}class I extends n.Sj{constructor(e){super(),this.valueSchema=e}defaultValue(){}isDefaultValue(e){return void 0===e||this.valueSchema.isDefaultValue(e)}prepareMsgpack(e){if(void 0!==e)return this.valueSchema.prepareMsgpack(e)}fromPreparedMsgpack(e,t){if(null!=e)return this.valueSchema.fromPreparedMsgpack(e,t)}prepareJSON(e,t){return void 0===e?null:this.valueSchema.prepareJSON(e,t)}fromPreparedJSON(e){if(null!=e)return this.valueSchema.fromPreparedJSON(e)}}class T extends n.Sj{defaultValue(){}isDefaultValue(e){return void 0===e}prepareMsgpack(e){return e}fromPreparedMsgpack(e,t){return e}prepareJSON(e,t){return(0,n._A)(e)}fromPreparedJSON(e){return(0,n.cF)(e)}}},15552:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(63012).A)("outline","wallet","Wallet",[["path",{d:"M17 8v-3a1 1 0 0 0 -1 -1h-10a2 2 0 0 0 0 4h12a1 1 0 0 1 1 1v3m0 4v3a1 1 0 0 1 -1 1h-12a2 2 0 0 1 -2 -2v-12",key:"svg-0"}
3],["path",{d:"M20 12v4h-4a2 2 0 0 1 0 -4h4",key:"svg-1"}]])},18198:(e,t,r)=>{"use strict";var n=r(64527),a=r(96774),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=a.useSyncExternalStore,s=n.useRef,l=n.useEffect,c=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var p=s(null);if(null===p.current){var h={hasValue:!1,value:null};p.current=h}else h=p.current;var d=o(e,(p=c(function(){function e(e){if(!l){if(l=!0,o=e,e=n(e),void 0!==a&&h.hasValue){var t=h.value;if(a(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var r=n(e);return void 0!==a&&a(t,r)?(o=e,t):(o=e,s=r)}var o,s,l=!1,c=void 0===r?null:r;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,r,n,a]))[0],p[1]);return l(function(){h.hasValue=!0,h.value=d},[d]),u(d),d}},18392:(e,t,r)=>{"use strict";r.d(t,{i:()=>s});var n=r(79175),a=r(80452);r(64527);var i=r(51049);let o={timeout:1e3};function s(e){let{children:t,timeout:r,value:s,...l}=(0,i.Y)("CopyButton",o,e),c=(0,a.i)({timeout:r});return(0,n.jsx)(n.Fragment,{children:t({copy:()=>c.copy(s),copied:c.copied,...l})})}s.displayName="@mantine/core/CopyButton"},21424:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(63012).A)("outline","at","At",[["path",{d:"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M16 12v1.5a2.5 2.5 0 0 0 5 0v-1.5a9 9 0 1 0 -5.5 8.28",key:"svg-1"}]])},21567:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var n={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"}},22956:(e,t,r)=>{"use strict";r.d(t,{O:()=>l});var n=r(79175);r(64527);var a=r(35058),i=r(49771),o=r(63859);let s={__staticSelector:"InputBase",withAria:!0},l=(0,a.v)((e,t)=>{let{inputProps:r,wrapperProps:a,...l}=(0,o.I)("InputBase",s,e);return(0,n.jsx)(i.p.Wrapper,{...a,children:(0,n.jsx)(i.p,{...r,...l,ref:t})})});l.classes={...i.p.classes,...i.p.Wrapper.classes},l.displayName="@mantine/core/InputBase"},23151:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var n={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"}},23932:(e,t,r)=>{"use strict";r.d(t,{s:()=>c});var n=r(79175);r(64527);var a=r(51049),i=r(44241),o=r(41903),s=r(97569),l={root:"m_515a97f8"};let c=(0,s.P9)((e,t)=>{let r=(0,a.Y)("VisuallyHidden",null,e),{classNames:s,className:c,style:u,styles:p,unstyled:h,vars:d,attributes:f,...g}=r,m=(0,i.I)({name:"VisuallyHidden",classes:l,props:r,className:c,style:u,classNames:s,styles:p,unstyled:h,attributes:f});return(0,n.jsx)(o.a,{component:"span",ref:t,...m("root"),...g})});c.classes=l,c.displayName="@mantine/core/VisuallyHidden"},24392:(e,t,r)=>{"use strict";r.d(t,{k:()=>h});var n=r(79175);r(64527);var a=r(76825),i=r(94393),o=r(51049),s=r(44241),l=r(41903),c=r(97569),u=r(21567);let p=(0,i.V)((e,t)=>{let{radius:r,color:n,gradient:i,variant:o,autoContrast:s,size:l}=t,c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:i,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":(0,a.YC)(l,"section-height"),"--section-padding-x":(0,a.YC)(l,"section-padding-x"),"--section-fz":(0,a.ny)(l),"--section-radius":void 0===r?void 0:(0,a.nJ)(r),"--section-bg":n||o?c.background:void 0,"--section-color":c.color,"--section-bd":n||o?c.border:void 0}}}),h=(0,c.P9)((e,t)=>{let r=(0,o.Y)("ActionIconGroupSection",null,e),{className:a,style:i,classNames:c,styles:h,unstyled:d,vars:f,variant:g,gradient:m,radius:y,autoContrast:w,attributes:v,...b}=r,S=(0,s.I)({name:"ActionIconGroupSection",props:r,classes:u.A,className:a,style:i,classNames:c,styles:h,unstyled:d,attributes:v,vars:f,varsResolver:p,rootSelector:"groupSection"});return(0,n.jsx)(l.a,{...S("groupSection"),ref:t,variant:g,...b})});h.classes=u.A,h.displayName="@mantine/core/ActionIconGroupSection"},25129:(e,t,r)=>{"use strict";r.d(t,{s:()=>d,G:()=>f});var n=r(79175),a=r(64527);let i=/input|select|textarea|button|object/,o="a, input, select, textarea, button, object, [tabindex]";function s(e){let t=e.getAttribute("tabindex");return null===t&&(t=void 0),parseInt(t,10)}function l(e){let t=e.nodeName.toLowerCase(),r=!Number.isNaN(s(e));return(i.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&function(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||"hidden"===e.getAttribute("type"))return!1;let t=e;for(;t&&t!==document.body&&11!==t.nodeType;){if("none"===t.style.display)return!1;t=t.parentNode}return!0}(e)}function c(e){let t=s(e);return(Number.isNaN(t)||t>=0)&&l(e)}var u=r(64858),p=r(28847),h=r(23932);function d(e){let{children:t,active:r=!0,refProp:n="ref",innerRef:i}=e,s=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,a.useRef)(null),r=e=>{let t=e.querySelector("[data-autofocus]");
3if(!t){let r=Array.from(e.querySelectorAll(o));!(t=r.find(c)||r.find(l)||null)&&l(e)&&(t=e)}t&&t.focus({preventScroll:!0})},n=(0,a.useCallback)(n=>{e&&null!==n&&t.current!==n&&(n?(setTimeout(()=>{n.getRootNode()&&r(n)}),t.current=n):t.current=null)},[e]);return(0,a.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));let n=e=>{"Tab"===e.key&&t.current&&function(e,t){let r=Array.from(e.querySelectorAll(o)).filter(c);if(!r.length)return t.preventDefault();let n=r[t.shiftKey?0:r.length-1],a=e.getRootNode(),i=n===a.activeElement||e===a.activeElement,s=a.activeElement;if("INPUT"===s.tagName&&"radio"===s.getAttribute("type")&&(i=r.filter(e=>"radio"===e.getAttribute("type")&&e.getAttribute("name")===s.getAttribute("name")).includes(n)),!i)return;t.preventDefault();let l=r[t.shiftKey?r.length-1:0];l&&l.focus()}(t.current,e)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]),n}(r),h=(0,u.pc)(s,i);return(0,p.v)(t)?(0,a.cloneElement)(t,{[n]:h}):t}function f(e){return(0,n.jsx)(h.s,{tabIndex:-1,"data-autofocus":!0,...e})}d.displayName="@mantine/core/FocusTrap",f.displayName="@mantine/core/FocusTrapInitialFocus",d.InitialFocus=f},25361:(e,t,r)=>{"use strict";r.d(t,{DZ:()=>h,Eg:()=>d,Fs:()=>v,Gp:()=>y,I$:()=>o,Jl:()=>k,NC:()=>C,Om:()=>f,Qq:()=>u,Uc:()=>w,WT:()=>S,W_:()=>E,XJ:()=>s,XZ:()=>g,ak:()=>b,b1:()=>m,bh:()=>A,bm:()=>I,e3:()=>l,sZ:()=>p,tT:()=>x,wt:()=>c,x:()=>T});var n=r(12929),a=r(67769),i=r(72705);class o{constructor(e){this.type=e.type,this.bytes=e.bytes,this.uint=e.uint}getEncodingSchema(){return o.encodingSchema}toEncodingData(){return new Map([["tt",this.type],["tb",this.bytes],["ui",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded TealValue: ${e}`);return new o({type:Number(e.get("tt")),bytes:e.get("tb"),uint:e.get("ui")})}}o.encodingSchema=new n.pZ((0,n.co)([{key:"tt",valueSchema:new n.qc},{key:"tb",valueSchema:new n.KN(new n.D4)},{key:"ui",valueSchema:new n.KN(new n.qc)}]));class s{constructor(e){this.numUints=e.numUints,this.numByteSlices=e.numByteSlices}getEncodingSchema(){return s.encodingSchema}toEncodingData(){return new Map([["nui",this.numUints],["nbs",this.numByteSlices]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded StateSchema: ${e}`);return new s({numUints:Number(e.get("nui")),numByteSlices:Number(e.get("nbs"))})}}s.encodingSchema=new n.pZ((0,n.co)([{key:"nui",valueSchema:new n.qc},{key:"nbs",valueSchema:new n.qc}]));class l{constructor(e){this.approvalProgram=e.approvalProgram,this.clearStateProgram=e.clearStateProgram,this.globalState=e.globalState,this.localStateSchema=e.localStateSchema,this.globalStateSchema=e.globalStateSchema,this.extraProgramPages=e.extraProgramPages}getEncodingSchema(){return l.encodingSchema}toEncodingData(){return new Map([["approv",this.approvalProgram],["clearp",this.clearStateProgram],["gs",(0,n.sm)(this.globalState,(e,t)=>[e,t.toEncodingData()])],["lsch",this.localStateSchema.toEncodingData()],["gsch",this.globalStateSchema.toEncodingData()],["epp",this.extraProgramPages]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AppParams: ${e}`);return new l({approvalProgram:e.get("approv"),clearStateProgram:e.get("clearp"),globalState:(0,n.sm)(e.get("gs"),(e,t)=>[e,o.fromEncodingData(t)]),localStateSchema:s.fromEncodingData(e.get("lsch")),globalStateSchema:s.fromEncodingData(e.get("gsch")),extraProgramPages:Number(e.get("epp"))})}}l.encodingSchema=new n.pZ((0,n.co)([{key:"approv",valueSchema:new n.HM},{key:"clearp",valueSchema:new n.HM},{key:"gs",valueSchema:new n.rT(o.encodingSchema)},{key:"lsch",valueSchema:s.encodingSchema},{key:"gsch",valueSchema:s.encodingSchema},{key:"epp",valueSchema:new n.qc}]));class c{constructor(e){this.schema=e.schema,this.keyValue=e.keyValue}getEncodingSchema(){return c.encodingSchema}toEncodingData(){return new Map([["hsch",this.schema.toEncodingData()],["tkv",(0,n.sm)(this.keyValue,(e,t)=>[e,t.toEncodingData()])]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AppLocal
3State: ${e}`);return new c({schema:s.fromEncodingData(e.get("hsch")),keyValue:(0,n.sm)(e.get("tkv"),(e,t)=>[e,o.fromEncodingData(t)])})}}c.encodingSchema=new n.pZ((0,n.co)([{key:"hsch",valueSchema:s.encodingSchema},{key:"tkv",valueSchema:new n.rT(o.encodingSchema)}]));class u{constructor(e){this.localState=e.localState,this.deleted=e.deleted}getEncodingSchema(){return u.encodingSchema}toEncodingData(){return new Map([["LocalState",this.localState?this.localState.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AppLocalStateDelta: ${e}`);return new u({localState:e.get("LocalState")?c.fromEncodingData(e.get("LocalState")):void 0,deleted:e.get("Deleted")})}}u.encodingSchema=new n.pZ((0,n.co)([{key:"LocalState",valueSchema:new n.KN(c.encodingSchema)},{key:"Deleted",valueSchema:new n.od}]));class p{constructor(e){this.params=e.params,this.deleted=e.deleted}getEncodingSchema(){return p.encodingSchema}toEncodingData(){return new Map([["Params",this.params?this.params.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AppParamsDelta: ${e}`);return new p({params:e.get("Params")?l.fromEncodingData(e.get("Params")):void 0,deleted:e.get("Deleted")})}}p.encodingSchema=new n.pZ((0,n.co)([{key:"Params",valueSchema:new n.KN(l.encodingSchema)},{key:"Deleted",valueSchema:new n.od}]));class h{constructor(e){this.id=e.id,this.address=e.address,this.params=e.params,this.state=e.state}getEncodingSchema(){return h.encodingSchema}toEncodingData(){return new Map([["Aidx",this.id],["Addr",this.address],["Params",this.params.toEncodingData()],["State",this.state.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AppResourceRecord: ${e}`);return new h({id:e.get("Aidx"),address:e.get("Addr"),params:p.fromEncodingData(e.get("Params")),state:u.fromEncodingData(e.get("State"))})}}h.encodingSchema=new n.pZ((0,n.co)([{key:"Aidx",valueSchema:new n.qc},{key:"Addr",valueSchema:new n.eu},{key:"Params",valueSchema:p.encodingSchema},{key:"State",valueSchema:u.encodingSchema}]));class d{constructor(e){this.amount=e.amount,this.frozen=e.frozen}getEncodingSchema(){return d.encodingSchema}toEncodingData(){return new Map([["a",this.amount],["f",this.frozen]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AssetHolding: ${e}`);return new d({amount:e.get("a"),frozen:e.get("f")})}}d.encodingSchema=new n.pZ((0,n.co)([{key:"a",valueSchema:new n.qc},{key:"f",valueSchema:new n.od}]));class f{constructor(e){this.holding=e.holding,this.deleted=e.deleted}getEncodingSchema(){return f.encodingSchema}toEncodingData(){return new Map([["Holding",this.holding?this.holding.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AssetHoldingDelta: ${e}`);return new f({holding:e.get("Holding")?d.fromEncodingData(e.get("Holding")):void 0,deleted:e.get("Deleted")})}}f.encodingSchema=new n.pZ((0,n.co)([{key:"Holding",valueSchema:new n.KN(d.encodingSchema)},{key:"Deleted",valueSchema:new n.od}]));class g{constructor(e){this.total=e.total,this.decimals=e.decimals,this.defaultFrozen=e.defaultFrozen,this.unitName=e.unitName,this.assetName=e.assetName,this.url=e.url,this.metadataHash=e.metadataHash,this.manager=e.manager,this.reserve=e.reserve,this.freeze=e.freeze,this.clawback=e.clawback}getEncodingSchema(){return g.encodingSchema}toEncodingData(){return new Map([["t",this.total],["dc",this.decimals],["df",this.defaultFrozen],["un",this.unitName],["an",this.assetName],["au",this.url],["am",this.metadataHash],["m",this.manager],["r",this.reserve],["f",this.freeze],["c",this.clawback]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AssetParams: ${e}`);return new g({total:e.get("t"),decimals:e.get("dc"),defaultFrozen:e.get("df"),unitName:e.get("un"),assetName:e.get("an"),url:e.get("au"),metadataHash:e.get("am"),manager:e.get("m"),reserve:e.get("r"),freeze:e.get("f"),clawback:e.get("
3c")})}}g.encodingSchema=new n.pZ((0,n.co)([{key:"t",valueSchema:new n.qc},{key:"dc",valueSchema:new n.qc},{key:"df",valueSchema:new n.od},{key:"un",valueSchema:new n.KN(new n.D4)},{key:"an",valueSchema:new n.KN(new n.D4)},{key:"au",valueSchema:new n.KN(new n.D4)},{key:"am",valueSchema:new n.lb(32)},{key:"m",valueSchema:new n.KN(new n.eu)},{key:"r",valueSchema:new n.KN(new n.eu)},{key:"f",valueSchema:new n.KN(new n.eu)},{key:"c",valueSchema:new n.KN(new n.eu)}]));class m{constructor(e){this.params=e.params,this.deleted=e.deleted}getEncodingSchema(){return m.encodingSchema}toEncodingData(){return new Map([["Params",this.params?this.params.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AssetParamsDelta: ${e}`);return new m({params:e.get("Params")?g.fromEncodingData(e.get("Params")):void 0,deleted:e.get("Deleted")})}}m.encodingSchema=new n.pZ((0,n.co)([{key:"Params",valueSchema:new n.KN(g.encodingSchema)},{key:"Deleted",valueSchema:new n.od}]));class y{constructor(e){this.id=e.id,this.address=e.address,this.params=e.params,this.holding=e.holding}getEncodingSchema(){return y.encodingSchema}toEncodingData(){return new Map([["Aidx",this.id],["Addr",this.address],["Params",this.params.toEncodingData()],["Holding",this.holding.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AssetResourceRecord: ${e}`);return new y({id:e.get("Aidx"),address:e.get("Addr"),params:m.fromEncodingData(e.get("Params")),holding:f.fromEncodingData(e.get("Holding"))})}}y.encodingSchema=new n.pZ((0,n.co)([{key:"Aidx",valueSchema:new n.qc},{key:"Addr",valueSchema:new n.eu},{key:"Params",valueSchema:m.encodingSchema},{key:"Holding",valueSchema:f.encodingSchema}]));class w{constructor(e){this.voteID=e.voteID,this.selectionID=e.selectionID,this.stateProofID=e.stateProofID,this.voteFirstValid=e.voteFirstValid,this.voteLastValid=e.voteLastValid,this.voteKeyDilution=e.voteKeyDilution}getEncodingSchema(){return w.encodingSchema}toEncodingData(){return new Map([["VoteID",this.voteID],["SelectionID",this.selectionID],["StateProofID",this.stateProofID],["VoteFirstValid",this.voteFirstValid],["VoteLastValid",this.voteLastValid],["VoteKeyDilution",this.voteKeyDilution]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded VotingData: ${e}`);return new w({voteID:e.get("VoteID"),selectionID:e.get("SelectionID"),stateProofID:e.get("StateProofID"),voteFirstValid:e.get("VoteFirstValid"),voteLastValid:e.get("VoteLastValid"),voteKeyDilution:e.get("VoteKeyDilution")})}}w.encodingSchema=new n.pZ((0,n.co)([{key:"VoteID",valueSchema:new n.lb(32)},{key:"SelectionID",valueSchema:new n.lb(32)},{key:"StateProofID",valueSchema:new n.lb(64)},{key:"VoteFirstValid",valueSchema:new n.qc},{key:"VoteLastValid",valueSchema:new n.qc},{key:"VoteKeyDilution",valueSchema:new n.qc}]));class v{constructor(e){this.status=e.status,this.microAlgos=e.microAlgos,this.rewardsBase=e.rewardsBase,this.rewardedMicroAlgos=e.rewardedMicroAlgos,this.authAddr=e.authAddr,this.incentiveEligible=e.incentiveEligible,this.totalAppSchema=e.totalAppSchema,this.totalExtraAppPages=e.totalExtraAppPages,this.totalAppParams=e.totalAppParams,this.totalAppLocalStates=e.totalAppLocalStates,this.totalAssetParams=e.totalAssetParams,this.totalAssets=e.totalAssets,this.totalBoxes=e.totalBoxes,this.totalBoxBytes=e.totalBoxBytes,this.lastProposed=e.lastProposed,this.lastHeartbeat=e.lastHeartbeat}getEncodingSchema(){return v.encodingSchema}toEncodingData(){return new Map([["Status",this.status],["MicroAlgos",this.microAlgos],["RewardsBase",this.rewardsBase],["RewardedMicroAlgos",this.rewardedMicroAlgos],["AuthAddr",this.authAddr],["IncentiveEligible",this.incentiveEligible],["TotalAppSchema",this.totalAppSchema.toEncodingData()],["TotalExtraAppPages",this.totalExtraAppPages],["TotalAppParams",this.totalAppParams],["TotalAppLocalStates",this.totalAppLocalStates],["TotalAssetParams",this.totalAssetParams],["TotalAssets",this.totalAssets],["TotalBoxes",this.totalBoxes],["TotalBoxBytes",this.totalBoxBytes],["LastProposed",this.lastProposed],["LastHeartbeat",this.lastHeartbeat]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AccountBaseData: ${e}`);return new v({status:Number(e.get("Status")),microAlgos:e.get("MicroAlgos"),rewardsBase:e.get("RewardsBase"),rewardedMicroAlgos:e.get("RewardedMicroAlgos"),authAddr:e.get("AuthAddr"),incentiveEligible:e.get("IncentiveEligible"),totalAppSchema:s.fromEncodingData(e.get("TotalAppSchema")),totalExtraAppPages:Number(e.get("TotalExtraAppPages")),totalAppParams:e.get("TotalAppParams"),totalAppLocal
3States:e.get("TotalAppLocalStates"),totalAssetParams:e.get("TotalAssetParams"),totalAssets:e.get("TotalAssets"),totalBoxes:e.get("TotalBoxes"),totalBoxBytes:e.get("TotalBoxBytes"),lastProposed:e.get("LastProposed"),lastHeartbeat:e.get("LastHeartbeat")})}}v.encodingSchema=new n.pZ((0,n.co)([{key:"Status",valueSchema:new n.qc},{key:"MicroAlgos",valueSchema:new n.qc},{key:"RewardsBase",valueSchema:new n.qc},{key:"RewardedMicroAlgos",valueSchema:new n.qc},{key:"AuthAddr",valueSchema:new n.eu},{key:"IncentiveEligible",valueSchema:new n.od},{key:"TotalAppSchema",valueSchema:s.encodingSchema},{key:"TotalExtraAppPages",valueSchema:new n.qc},{key:"TotalAppParams",valueSchema:new n.qc},{key:"TotalAppLocalStates",valueSchema:new n.qc},{key:"TotalAssetParams",valueSchema:new n.qc},{key:"TotalAssets",valueSchema:new n.qc},{key:"TotalBoxes",valueSchema:new n.qc},{key:"TotalBoxBytes",valueSchema:new n.qc},{key:"LastProposed",valueSchema:new n.qc},{key:"LastHeartbeat",valueSchema:new n.qc}]));class b{constructor(e){this.accountBaseData=e.accountBaseData,this.votingData=e.votingData}getEncodingSchema(){return b.encodingSchema}toEncodingData(){return(0,n.o1)(this.accountBaseData.toEncodingData(),this.votingData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AccountData: ${e}`);return new b({accountBaseData:v.fromEncodingData(e),votingData:w.fromEncodingData(e)})}}b.encodingSchema=new n.pZ((0,n.co)([{key:"",valueSchema:v.encodingSchema,embedded:!0},{key:"",valueSchema:w.encodingSchema,embedded:!0}]));class S{constructor(e){this.addr=e.addr,this.accountData=e.accountData}getEncodingSchema(){return S.encodingSchema}toEncodingData(){return(0,n.o1)(new Map([["Addr",this.addr]]),this.accountData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded BalanceRecord: ${e}`);return new S({addr:e.get("Addr"),accountData:b.fromEncodingData(e)})}}S.encodingSchema=new n.pZ((0,n.co)([{key:"Addr",valueSchema:new n.eu},{key:"",valueSchema:b.encodingSchema,embedded:!0}]));class x{constructor(e){this.accounts=e.accounts,this.appResources=e.appResources,this.assetResources=e.assetResources}getEncodingSchema(){return x.encodingSchema}toEncodingData(){return new Map([["Accts",this.accounts.map(e=>e.toEncodingData())],["AppResources",0===this.appResources.length?void 0:this.appResources.map(e=>e.toEncodingData())],["AssetResources",0===this.assetResources.length?void 0:this.assetResources.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AccountDeltas: ${e}`);return new x({accounts:(e.get("Accts")??[]).map(S.fromEncodingData),appResources:(e.get("AppResources")??[]).map(h.fromEncodingData),assetResources:(e.get("AssetResources")??[]).map(y.fromEncodingData)})}}x.encodingSchema=new n.pZ((0,n.co)([{key:"Accts",valueSchema:new n.vf(S.encodingSchema)},{key:"AppResources",valueSchema:new n.KN(new n.vf(h.encodingSchema))},{key:"AssetResources",valueSchema:new n.KN(new n.vf(y.encodingSchema))}]));class A{constructor(e){this.data=e.data,this.oldData=e.oldData}getEncodingSchema(){return A.encodingSchema}toEncodingData(){return new Map([["Data",this.data],["OldData",this.oldData]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded KvValueDelta: ${e}`);return new A({data:e.get("Data"),oldData:e.get("OldData")})}}A.encodingSchema=new n.pZ((0,n.co)([{key:"Data",valueSchema:new n.KN(new n.HM)},{key:"OldData",valueSchema:new n.KN(new n.HM)}]));class E{constructor(e){this.lastValid=e.lastValid,this.intra=e.intra}getEncodingSchema(){return E.encodingSchema}toEncodingData(){return new Map([["LastValid",this.lastValid],["Intra",this.intra]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded IncludedTransactions: ${e}`);return new E({lastValid:e.get("LastValid"),intra:Number(e.get("Intra"))})}}E.encodingSchema=new n.pZ((0,n.co)([{key:"LastValid",valueSchema:new n.qc},{key:"Intra",valueSchema:new n.qc}]));class I{constructor(e){this.creatableType=e.creatableType,this.created=e.created,this.creator=e.creator,this.ndeltas=e.ndeltas}getEncodingSchema(){return I.encodingSchema}toEncodingData(){return new Map([["Ctype",this.creatableType],["Created",this.created],["Creator",this.creator],["Ndeltas",this.ndeltas]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded ModifiedCreatable: ${e}`);return new I({creatableType:Number(e.get("Ctype")),created:e.get("Created"),
3creator:e.get("Creator"),ndeltas:Number(e.get("Ndeltas"))})}}I.encodingSchema=new n.pZ((0,n.co)([{key:"Ctype",valueSchema:new n.qc},{key:"Created",valueSchema:new n.od},{key:"Creator",valueSchema:new n.eu},{key:"Ndeltas",valueSchema:new n.qc}]));class T{constructor(e){this.money=e.money,this.rewardUnits=e.rewardUnits}getEncodingSchema(){return T.encodingSchema}toEncodingData(){return new Map([["mon",this.money],["rwd",this.rewardUnits]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AlgoCount: ${e}`);return new T({money:e.get("mon"),rewardUnits:e.get("rwd")})}}T.encodingSchema=new n.pZ((0,n.co)([{key:"mon",valueSchema:new n.qc},{key:"rwd",valueSchema:new n.qc}]));class k{constructor(e){this.online=e.online,this.offline=e.offline,this.notParticipating=e.notParticipating,this.rewardsLevel=e.rewardsLevel}getEncodingSchema(){return k.encodingSchema}toEncodingData(){return new Map([["online",this.online.toEncodingData()],["offline",this.offline.toEncodingData()],["notpart",this.notParticipating.toEncodingData()],["rwdlvl",this.rewardsLevel]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded AccountTotals: ${e}`);return new k({online:T.fromEncodingData(e.get("online")),offline:T.fromEncodingData(e.get("offline")),notParticipating:T.fromEncodingData(e.get("notpart")),rewardsLevel:e.get("rwdlvl")})}}k.encodingSchema=new n.pZ((0,n.co)([{key:"online",valueSchema:T.encodingSchema},{key:"offline",valueSchema:T.encodingSchema},{key:"notpart",valueSchema:T.encodingSchema},{key:"rwdlvl",valueSchema:new n.qc}]));class C{constructor(e){this.accounts=e.accounts,this.kvMods=e.kvMods,this.txids=e.txids,this.txleases=e.txleases,this.creatables=e.creatables,this.blockHeader=e.blockHeader,this.stateProofNext=e.stateProofNext,this.prevTimestamp=e.prevTimestamp,this.totals=e.totals}getEncodingSchema(){return C.encodingSchema}toEncodingData(){return new Map([["Accts",this.accounts.toEncodingData()],["KvMods",0===this.kvMods.size?void 0:(0,n.sm)(this.kvMods,(e,t)=>[e,t.toEncodingData()])],["Txids",(0,n.sm)(this.txids,(e,t)=>[e,t.toEncodingData()])],["Txleases",this.txleases.toEncodingData()],["Creatables",0===this.creatables.size?void 0:(0,n.sm)(this.creatables,(e,t)=>[e,t.toEncodingData()])],["Hdr",this.blockHeader.toEncodingData()],["StateProofNext",this.stateProofNext],["PrevTimestamp",this.prevTimestamp],["Totals",this.totals.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded LedgerStateDelta: ${e}`);return new C({accounts:x.fromEncodingData(e.get("Accts")),kvMods:(0,n.sm)(e.get("KvMods")??new Map,(e,t)=>[e,A.fromEncodingData(t)]),txids:(0,n.sm)(e.get("Txids"),(e,t)=>[e,E.fromEncodingData(t)]),txleases:i.N.fromEncodingData(e.get("Txleases")),creatables:(0,n.sm)(e.get("Creatables")??new Map,(e,t)=>[e,I.fromEncodingData(t)]),blockHeader:a.Tw.fromEncodingData(e.get("Hdr")),stateProofNext:e.get("StateProofNext"),prevTimestamp:e.get("PrevTimestamp"),totals:k.fromEncodingData(e.get("Totals"))})}}C.encodingSchema=new n.pZ((0,n.co)([{key:"Accts",valueSchema:x.encodingSchema},{key:"KvMods",valueSchema:new n.KN(new n.rT(A.encodingSchema))},{key:"Txids",valueSchema:new n.zf(E.encodingSchema)},{key:"Txleases",valueSchema:new n.KN(new n.XD)},{key:"Creatables",valueSchema:new n.KN(new n.ac(I.encodingSchema))},{key:"Hdr",valueSchema:a.Tw.encodingSchema},{key:"StateProofNext",valueSchema:new n.qc},{key:"PrevTimestamp",valueSchema:new n.qc},{key:"Totals",valueSchema:k.encodingSchema}]))},27392:(e,t,r)=>{"use strict";r.d(t,{ZX:()=>I,kX:()=>k,w7:()=>T});var n=r(43795),a=r(68724),i=r(9517),o=r(12929),s=r(87131),l=r(63979),c=r(44735);class u{constructor(e){this.sig=e.sig,this.pk=e.pk,this.pk2=e.pk2,this.pk1Sig=e.pk1Sig,this.pk2Sig=e.pk2Sig}getEncodingSchema(){return u.encodingSchema}toEncodingData(){return new Map([["s",this.sig],["p",this.pk],["p2",this.pk2],["p1s",this.pk1Sig],["p2s",this.pk2Sig]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded HeartbeatProof: ${e}`);return new u({sig:e.get("s"),pk:e.get("p"),pk2:e.get("p2"),pk1Sig:e.get("p1s"),pk2Sig:e.get("p2s")})}}u.encodingSchema=new o.pZ((0,o.co)([{key:"s",valueSchema:new o.lb(64)},{key:"p",valueSchema:new o.lb(32)},{key:"p2",valueSchema:new o.lb(32)},{key:"p1s",valueSchema:new o.lb(64)},{key:"p2s",valueSchema:new o.lb(64)}]));class p{constructor(e){this.address=e.address,this.proof=e.proof,this.seed=e.seed,this.voteID=e.voteID,this.keyDilution=e.keyDilution}getEncodingSchema(){return p.encodingSchema}toEncodingData(){return new Map([["a",this.address],["prf",this.proof.toEncodingData()],["sd",this.seed],["vid",this.voteID],["kd",this.keyDilution]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded Heartbeat: ${e}`);return new p({address:e.get("a"),proof:u.fromEncodingData(e.get("prf")),seed:e.get("sd"),voteID:e.get("vid"),keyDilution:e.get("kd")})}}p.encodingSchema=new o.pZ((0,o.co)([{key:"a",valueSchema:new o.eu},{key:"prf",valueSchema:u.encodingSchema},{key:"sd",valueSchema:new o.HM},{key:"vid",valueSchema:new o.lb(32)},{key:"kd",valueSchema:new o.qc}]));var h=r(46085);function d(e){return e.every(e=>0===e)}function f(e,t,r){let n;if(null!=e){if(e instanceof Uint8Array&&(n=e),null==n||n.byteLength!==r)throw Error(`${t} must be a ${r} byte Uint8Array`);return n}}function g(e){if(null==e)throw Error("Address must not be null or undefined");if("string"==typeof e)return a.pV.fromString(e);if(e instanceof a.pV)return e;throw Error(`Not an address: ${e}`)}function m(e){let t;if(null!=e){if(e instanceof a.pV)t=e;else if("string"==typeof e)t=a.pV.fromString(e);else throw Error(`Not an address: ${e}`);if(d(t.publicKey))throw Error("Invalid use of the zero address. To omit this value, pass in undefined");return t}}function y(e){if(void 0!==e){if(e instanceof Uint8Array)return e;throw Error(`Not a Uint8Array: ${e}`)}}function w(e){if(e instanceof Uint8Array)return e;throw Error(`Not a Uint8Array: ${e}`)}function v(e){if(void 0!==e)return h.Bw(e)}function b(e){if(!0===e||!1===e)return e;throw Error(`Not a boolean: ${e}`)}function S(e){if(Array.isArray(e))return e.slice();throw Error(`Not an array: ${e}`)}function x(e,t,r){let n=y(e);
3if(void 0!==n){if(n.byteLength!==t)throw Error(`${r} must be ${t} bytes long, was ${n.byteLength}`);if(!d(n))return n}}function A(e){if(null!=e&&"object"==typeof e){let{appIndex:t,name:r}=e;return{appIndex:h.Bw(t),name:w(r)}}throw Error(`Not a box reference: ${e}`)}let E=new TextEncoder().encode("TX");class I{constructor(e){if(!(0,l.BP)(e.type))throw Error(`Invalid transaction type: ${e.type}`);if(this.type=e.type,this.sender=g(e.sender),this.note=w(e.note??new Uint8Array),this.lease=x(e.lease,32,"lease"),this.rekeyTo=m(e.rekeyTo),this.group=void 0,this.firstValid=h.Bw(e.suggestedParams.firstValid),this.lastValid=h.Bw(e.suggestedParams.lastValid),e.suggestedParams.genesisID){if("string"!=typeof e.suggestedParams.genesisID)throw Error("Genesis ID must be a string if present");this.genesisID=e.suggestedParams.genesisID}this.genesisHash=y(e.suggestedParams.genesisHash);let t=[];if(e.paymentParams&&t.push(l.D_.pay),e.keyregParams&&t.push(l.D_.keyreg),e.assetConfigParams&&t.push(l.D_.acfg),e.assetTransferParams&&t.push(l.D_.axfer),e.assetFreezeParams&&t.push(l.D_.afrz),e.appCallParams&&t.push(l.D_.appl),e.stateProofParams&&t.push(l.D_.stpf),e.heartbeatParams&&t.push(l.D_.hb),1!==t.length)throw Error(`Transaction has wrong number of type fields present (${t.length}): ${t}`);if(this.type!==t[0])throw Error(`Transaction has type ${this.type} but fields present for ${t[0]}`);if(e.paymentParams&&(this.payment={receiver:g(e.paymentParams.receiver),amount:h.Bw(e.paymentParams.amount),closeRemainderTo:m(e.paymentParams.closeRemainderTo)}),e.keyregParams){if(this.keyreg={voteKey:f(e.keyregParams.voteKey,"voteKey",32),selectionKey:f(e.keyregParams.selectionKey,"selectionKey",32),stateProofKey:f(e.keyregParams.stateProofKey,"stateProofKey",64),voteFirst:v(e.keyregParams.voteFirst),voteLast:v(e.keyregParams.voteLast),voteKeyDilution:v(e.keyregParams.voteKeyDilution),nonParticipation:b(e.keyregParams.nonParticipation??!1)},this.keyreg.nonParticipation&&(this.keyreg.voteKey||this.keyreg.selectionKey||this.keyreg.stateProofKey||void 0!==this.keyreg.voteFirst||void 0!==this.keyreg.voteLast||void 0!==this.keyreg.voteKeyDilution))throw Error("nonParticipation is true but participation params are present.");if(!this.keyreg.nonParticipation&&(this.keyreg.voteKey||this.keyreg.selectionKey||this.keyreg.stateProofKey||void 0!==this.keyreg.voteFirst||void 0!==this.keyreg.voteLast||void 0!==this.keyreg.voteKeyDilution)&&!(this.keyreg.voteKey&&this.keyreg.selectionKey&&void 0!==this.keyreg.voteFirst&&void 0!==this.keyreg.voteLast&&void 0!==this.keyreg.voteKeyDilution))throw Error("Online key registration missing at least one of the following fields: voteKey, selectionKey, voteFirst, voteLast, voteKeyDilution")}if(e.assetConfigParams&&(this.assetConfig={assetIndex:h.Bw(e.assetConfigParams.assetIndex??0),total:h.Bw(e.assetConfigParams.total??0),decimals:h.Fo(e.assetConfigParams.decimals??0),defaultFrozen:b(e.assetConfigParams.defaultFrozen??!1),manager:m(e.assetConfigParams.manager),reserve:m(e.assetConfigParams.reserve),freeze:m(e.assetConfigParams.freeze),clawback:m(e.assetConfigParams.clawback),unitName:e.assetConfigParams.unitName,assetName:e.assetConfigParams.assetName,assetURL:e.assetConfigParams.assetURL,assetMetadataHash:x(e.assetConfigParams.assetMetadataHash,32,"assetMetadataHash")}),e.assetTransferParams&&(this.assetTransfer={assetIndex:h.Bw(e.assetTransferParams.assetIndex),amount:h.Bw(e.assetTransferParams.amount),assetSender:m(e.assetTransferParams.assetSender),receiver:g(e.assetTransferParams.receiver),closeRemainderTo:m(e.assetTransferParams.closeRemainderTo)}),e.assetFreezeParams&&(this.assetFreeze={assetIndex:h.Bw(e.assetFreezeParams.assetIndex),freezeAccount:g(e.assetFreezeParams.freezeTarget),frozen:b(e.assetFreezeParams.frozen)}),e.appCallParams){let{onComplete:t}=e.appCallParams;if(!(0,l.Lh)(t))throw Error(`Invalid onCompletion value: ${t}`);this.applicationCall={appIndex:h.Bw(e.appCallParams.appIndex),onComplete:t,numLocalInts:h.Fo(e.appCallParams.numLocalInts??0),numLocalByteSlices:h.Fo(e.appCallParams.numLocalByteSlices??0),numGlobalInts:h.Fo(e.appCallParams.numGlobalInts??0),numGlobalByteSlices:h.Fo(e.appCallParams.numGlobalByteSlices??0),extraPages:h.Fo(e.appCallParams.extraPages??0),approvalProgram:w(e.appCallParams.approvalProgram??new Uint8Array),clearProgram:w(e.appCallParams.clearProgram??new Uint8Array),appArgs:S(e.appCallParams.appArgs??[]).map(w),accounts:S(e.appCallParams.accounts??[]).map(g),foreignApps:S(e.appCallParams.foreignApps??[]).map(h.Bw),foreignAssets:S(e.appCallParams.foreignAssets??[]).map(h.Bw),boxes:S(e.appCallParams.boxes??[]).map(A)}}if(e.stateProofParams&&(this.stateProof={stateProofType:h.Fo(e.stateProofParams.stateProofType??0),stateProof:e.stateProofParams.stateProof,message:e.stateProofParams.message}),e.heartbeatParams&&(this.heartbeat=new p({address:e.heartbeatParams.address,proof:e.heartbeatParams.proof,seed:e.heartbeatParams.seed,voteID:e.heartbeatParams.voteID,keyDilution:e.heartbeatParams.keyDilution})),this.fee=h.Bw(e.suggestedParams.fee),!b(e.suggestedParams.flatFee??!1)){let t=h.Bw(e.suggestedParams.minFee);this.fee*=BigInt(this.estimateSize()),this.fee<t&&(this.fee=t)}}getEncodingSchema(){return I.encodingSchema}toEncodingData(){let e=new Map([["type",this.type],["fv",this.first
3Valid],["lv",this.lastValid],["snd",this.sender],["gen",this.genesisID],["gh",this.genesisHash],["fee",this.fee],["note",this.note],["lx",this.lease],["rekey",this.rekeyTo],["grp",this.group]]);if(this.payment)return e.set("amt",this.payment.amount),e.set("rcv",this.payment.receiver),e.set("close",this.payment.closeRemainderTo),e;if(this.keyreg)return e.set("votekey",this.keyreg.voteKey),e.set("selkey",this.keyreg.selectionKey),e.set("sprfkey",this.keyreg.stateProofKey),e.set("votefst",this.keyreg.voteFirst),e.set("votelst",this.keyreg.voteLast),e.set("votekd",this.keyreg.voteKeyDilution),e.set("nonpart",this.keyreg.nonParticipation),e;if(this.assetConfig){e.set("caid",this.assetConfig.assetIndex);let t=new Map([["t",this.assetConfig.total],["dc",this.assetConfig.decimals],["df",this.assetConfig.defaultFrozen],["m",this.assetConfig.manager],["r",this.assetConfig.reserve],["f",this.assetConfig.freeze],["c",this.assetConfig.clawback],["un",this.assetConfig.unitName],["an",this.assetConfig.assetName],["au",this.assetConfig.assetURL],["am",this.assetConfig.assetMetadataHash]]);return e.set("apar",t),e}if(this.assetTransfer)return e.set("xaid",this.assetTransfer.assetIndex),e.set("aamt",this.assetTransfer.amount),e.set("arcv",this.assetTransfer.receiver),e.set("aclose",this.assetTransfer.closeRemainderTo),e.set("asnd",this.assetTransfer.assetSender),e;if(this.assetFreeze)return e.set("faid",this.assetFreeze.assetIndex),e.set("afrz",this.assetFreeze.frozen),e.set("fadd",this.assetFreeze.freezeAccount),e;if(this.applicationCall)return e.set("apid",this.applicationCall.appIndex),e.set("apan",this.applicationCall.onComplete),e.set("apaa",this.applicationCall.appArgs),e.set("apat",this.applicationCall.accounts),e.set("apas",this.applicationCall.foreignAssets),e.set("apfa",this.applicationCall.foreignApps),e.set("apbx",function(e,t,r){let n=BigInt(r),a=t.map(BigInt);return e.map(e=>(function(e,t,r){let n=BigInt(e.appIndex),a=e.name,i=n===BigInt(0)||n===r,o=t.indexOf(n)+1;if(0===o&&!i)throw Error(`Box ref with appId ${n} not in foreign-apps`);return new Map([["i",o],["n",a]])})(e,a,n))}(this.applicationCall.boxes,this.applicationCall.foreignApps,this.applicationCall.appIndex)),e.set("apap",this.applicationCall.approvalProgram),e.set("apsu",this.applicationCall.clearProgram),e.set("apls",new Map([["nui",this.applicationCall.numLocalInts],["nbs",this.applicationCall.numLocalByteSlices]])),e.set("apgs",new Map([["nui",this.applicationCall.numGlobalInts],["nbs",this.applicationCall.numGlobalByteSlices]])),e.set("apep",this.applicationCall.extraPages),e;if(this.stateProof)return e.set("sptype",this.stateProof.stateProofType),e.set("sp",this.stateProof.stateProof?this.stateProof.stateProof.toEncodingData():void 0),e.set("spmsg",this.stateProof.message?this.stateProof.message.toEncodingData():void 0),e;if(this.heartbeat){let t=new p({address:this.heartbeat.address,proof:this.heartbeat.proof,seed:this.heartbeat.seed,voteID:this.heartbeat.voteID,keyDilution:this.heartbeat.keyDilution});return e.set("hb",t.toEncodingData()),e}throw Error(`Unexpected transaction type: ${this.type}`)}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded logic sig account: ${e}`);let t={minFee:BigInt(0),flatFee:!0,fee:e.get("fee")??0,firstValid:e.get("fv")??0,lastValid:e.get("lv")??0,genesisHash:e.get("gh"),genesisID:e.get("gen")},r=e.get("type");if(!(0,l.BP)(r))throw Error(`Unrecognized transaction type: ${r}`);let n={type:r,sender:e.get("snd")??a.pV.zeroAddress(),note:e.get("note"),lease:e.get("lx"),suggestedParams:t};if(e.get("rekey")&&(n.rekeyTo=e.get("rekey")),n.type===l.D_.pay){let t={amount:e.get("amt")??0,receiver:e.get("rcv")??a.pV.zeroAddress()};e.get("close")&&(t.closeRemainderTo=e.get("close")),n.paymentParams=t}else if(n.type===l.D_.keyreg)n.keyregParams={voteKey:e.get("votekey"),selectionKey:e.get("selkey"),stateProofKey:e.get("sprfkey"),voteFirst:e.get("votefst"),voteLast:e.get("votelst"),voteKeyDilution:e.get("votekd"),nonParticipation:e.get("nonpart")};else if(n.type===l.D_.acfg){let t={assetIndex:e.get("caid")};if(e.get("apar")){let r=e.get("apar");t.total=r.get("t"),t.decimals=r.get("dc"),t.defaultFrozen=r.get("df"),t.unitName=r.get("un"),t.assetName=r.get("an"),t.assetURL=r.get("au"),t.assetMetadataHash=r.get("am"),r.get("m")&&(t.manager=r.get("m")),r.get("r")&&(t.reserve=r.get("r")),r.get("f")&&(t.freeze=r.get("f")),r.get("
3c")&&(t.clawback=r.get("c"))}n.assetConfigParams=t}else if(n.type===l.D_.axfer){let t={assetIndex:e.get("xaid")??0,amount:e.get("aamt")??0,receiver:e.get("arcv")??a.pV.zeroAddress()};e.get("aclose")&&(t.closeRemainderTo=e.get("aclose")),e.get("asnd")&&(t.assetSender=e.get("asnd")),n.assetTransferParams=t}else if(n.type===l.D_.afrz)n.assetFreezeParams={assetIndex:e.get("faid")??0,freezeTarget:e.get("fadd")??a.pV.zeroAddress(),frozen:e.get("afrz")??!1};else if(n.type===l.D_.appl){let t={appIndex:e.get("apid")??0,onComplete:h.Fo(e.get("apan")??0),appArgs:e.get("apaa"),accounts:e.get("apat"),foreignAssets:e.get("apas"),foreignApps:e.get("apfa"),approvalProgram:e.get("apap"),clearProgram:e.get("apsu"),extraPages:e.get("apep")},r=e.get("apls");r&&(t.numLocalInts=r.get("nui"),t.numLocalByteSlices=r.get("nbs"));let a=e.get("apgs");a&&(t.numGlobalInts=a.get("nui"),t.numGlobalByteSlices=a.get("nbs"));let i=e.get("apbx");i&&(t.boxes=i.map(e=>{let r=h.Fo(e.get("i")??0),n=w(e.get("n")??new Uint8Array);if(0===r)return{appIndex:0,name:n};if(!t.foreignApps||r>t.foreignApps.length)throw Error(`Cannot find foreign app index ${r} in ${t.foreignApps}`);return{appIndex:t.foreignApps[r-1],name:n}})),n.appCallParams=t}else if(n.type===l.D_.stpf)n.stateProofParams={stateProofType:e.get("sptype"),stateProof:e.get("sp")?c.ol.fromEncodingData(e.get("sp")):void 0,message:e.get("spmsg")?c.Ps.fromEncodingData(e.get("spmsg")):void 0};else if(n.type===l.D_.hb){let t=p.fromEncodingData(e.get("hb"));n.heartbeatParams={address:t.address,proof:t.proof,seed:t.seed,voteID:t.voteID,keyDilution:t.keyDilution}}else{let e=n.type;throw Error(`Unexpected transaction type: ${e}`)}let i=new I(n);if(e.get("grp")){let t=w(e.get("grp"));if(32!==t.byteLength)throw Error(`Invalid group length: ${t.byteLength}`);i.group=t}return i}estimateSize(){return this.toByte().length+75}bytesToSign(){let e=this.toByte();return h.zI(E,e)}toByte(){return i.BS(this)}rawSignTxn(e){let t=this.bytesToSign();return s._S(t,e)}signTxn(e){let t=s.$Y(e),r=new a.pV(t.publicKey),n=this.rawSignTxn(e);return this.attachSignature(r,n)}attachSignature(e,t){if(!s.n5(t.length))throw Error("Invalid signature length");let r=new Map([["sig",t],["txn",this.toEncodingData()]]),n=g(e);this.sender.equals(n)||r.set("sgnr",n);let a=new o.pZ((0,o.co)([{key:"txn",valueSchema:I.encodingSchema},{key:"sig",valueSchema:new o.lb(64)},{key:"sgnr",valueSchema:new o.KN(new o.eu)}]));return i.p6(a.prepareMsgpack(r))}rawTxID(){let e=this.toByte(),t=h.zI(E,e);return Uint8Array.from(s.uj(t))}txID(){let e=this.rawTxID();return n.encode(e).slice(0,52)}}function T(e){return i.BS(e)}function k(e){return i.VQ(e,I)}I.encodingSchema=new o.pZ((0,o.co)([{key:"type",valueSchema:new o.nY},{key:"snd",valueSchema:new o.eu},{key:"lv",valueSchema:new o.qc},{key:"gen",valueSchema:new o.KN(new o.nY)},{key:"gh",valueSchema:new o.KN(new o.lb(32))},{key:"fee",valueSchema:new o.qc},{key:"fv",valueSchema:new o.qc},{key:"note",valueSchema:new o.HM},{key:"lx",valueSchema:new o.KN(new o.lb(32))},{key:"rekey",valueSchema:new o.KN(new o.eu)},{key:"grp",valueSchema:new o.KN(new o.lb(32))},{key:"amt",valueSchema:new o.KN(new o.qc)},{key:"rcv",valueSchema:new o.KN(new o.eu)},{key:"close",valueSchema:new o.KN(new o.eu)},{key:"votekey",valueSchema:new o.KN(new o.lb(32))},{key:"selkey",valueSchema:new o.KN(new o.lb(32))},{key:"sprfkey",valueSchema:new o.KN(new o.lb(64))},{key:"votefst",valueSchema:new o.KN(new o.qc)},{key:"votelst",valueSchema:new o.KN(new o.qc)},{key:"votekd",valueSchema:new o.KN(new o.qc)},{key:"nonpart",valueSchema:new o.KN(new o.od)},{key:"caid",valueSchema:new o.KN(new o.qc)},{key:"apar",valueSchema:new o.KN(new o.pZ((0,o.co)([{key:"t",valueSchema:new o.qc},{key:"dc",valueSchema:new o.qc},{key:"df",valueSchema:new o.od},{key:"m",valueSchema:new o.KN(new o.eu)},{key:"r",valueSchema:new o.KN(new o.eu)},{key:"f",valueSchema:new o.KN(new o.eu)},{key:"c",valueSchema:new o.KN(new o.eu)},{key:"un",valueSchema:new o.KN(new o.nY)},{key:"an",valueSchema:new o.KN(new o.nY)},{key:"au",valueSchema:new o.KN(new o.nY)},{key:"am",valueSchema:new o.KN(new o.lb(32))}])))},{key:"xaid",valueSchema:new o.KN(new o.qc)},{key:"aamt",valueSchema:new o.KN(new o.qc)},{key:"arcv",valueSchema:new o.KN(new o.eu)},{key:"aclose",valueSchema:new o.KN(new o.eu)},{key:"asnd",valueSchema:new o.KN(new o.eu)},{key:"faid",valueSchema:new o.KN(new o.qc)},{key:"afrz",valueSchema:new o.KN(new o.od)},{key:"fadd",valueSchema:new o.KN(new o.eu)},{key:"apid",valueSchema:new o.KN(new o.qc)},{key:"apan",valueSchema:new o.KN(new o.qc)},{key:"apaa",valueSchema:new o.KN(new o.vf(new o.HM))},{key:"apat",valueSchema:new o.KN(new o.vf(new o.eu))},{key:"apas",valueSchema:new o.KN(new o.vf(new o.qc))},{key:"apfa",valueSchema:new o.KN(new o.vf(new o.qc))},{key:"apbx",valueSchema:new o.KN(new o.vf(new o.pZ((0,o.co)([{key:"i",valueSchema:new o.qc},{key:"n",valueSchema:new o.HM}
3]))))},{key:"apap",valueSchema:new o.KN(new o.HM)},{key:"apsu",valueSchema:new o.KN(new o.HM)},{key:"apls",valueSchema:new o.KN(new o.pZ((0,o.co)([{key:"nui",valueSchema:new o.qc},{key:"nbs",valueSchema:new o.qc}])))},{key:"apgs",valueSchema:new o.KN(new o.pZ((0,o.co)([{key:"nui",valueSchema:new o.qc},{key:"nbs",valueSchema:new o.qc}])))},{key:"apep",valueSchema:new o.KN(new o.qc)},{key:"sptype",valueSchema:new o.KN(new o.qc)},{key:"sp",valueSchema:new o.KN(c.ol.encodingSchema)},{key:"spmsg",valueSchema:new o.KN(c.Ps.encodingSchema)},{key:"hb",valueSchema:new o.KN(p.encodingSchema)}]))},28176:(e,t,r)=>{"use strict";r.d(t,{Gn:()=>s,N$:()=>o,Xh:()=>i,Zv:()=>u,oO:()=>c,y9:()=>l});var n=r(12929),a=r(46085);let i=new n.pZ((0,n.co)([{key:"pk",valueSchema:new n.lb(32)},{key:"s",valueSchema:new n.KN(new n.lb(64))}]));function o(e){if(!(e instanceof Map))throw Error(`Invalid decoded EncodedSubsig: ${e}`);let t={pk:e.get("pk")};return e.get("s")&&(t.s=e.get("s")),t}function s(e){let t=new Map([["pk",e.pk]]);return e.s&&t.set("s",e.s),t}let l=new n.pZ((0,n.co)([{key:"v",valueSchema:new n.qc},{key:"thr",valueSchema:new n.qc},{key:"subsig",valueSchema:new n.vf(i)}]));function c(e){if(!(e instanceof Map))throw Error(`Invalid decoded EncodedMultiSig: ${e}`);return{v:(0,a.Fo)(e.get("v")),thr:(0,a.Fo)(e.get("thr")),subsig:e.get("subsig").map(o)}}function u(e){return new Map([["v",e.v],["thr",e.thr],["subsig",e.subsig.map(s)]])}},28775:(e,t,r)=>{"use strict";r.d(t,{T:()=>s});class n{constructor(){this.listenerWrapperMap=new WeakMap,this.listenerMap={},this.off=this.removeListener}async emitAsync(e,t){for(let r of this.listenerMap[e]??[])await r(t,e)}on(e,t){return this.listenerMap[e]||(this.listenerMap[e]=[]),this.listenerMap[e].push(t),this}once(e,t){let r=async(e,n)=>{try{return await t(e,n)}finally{this.removeListener(n,r)}};return this.listenerWrapperMap.set(t,r),this.on(e,r)}removeListener(e,t){let r=this.listenerWrapperMap.get(t);return r?(this.listenerWrapperMap.delete(t),this.listenerMap[e]?.indexOf(r)!==-1&&this.listenerMap[e].splice(this.listenerMap[e].indexOf(r),1)):this.listenerMap[e]?.indexOf(t)!==-1&&this.listenerMap[e].splice(this.listenerMap[e].indexOf(t),1),this}}let a={error:console.error,warn:console.warn,info:console.info,verbose:()=>{},debug:console.debug};console.error,console.warn,console.info,console.error,console.warn,console.info,console.trace,console.debug,console.error,console.warn;let i={error:function(e){},warn:function(e){},info:function(e){},verbose:function(e){},debug:function(e){}};class o{get populateAppCallResources(){return this.config.populateAppCallResources}get logger(){return this.config.logger}get debug(){return this.config.debug}get projectRoot(){return this.config.projectRoot}get traceAll(){return this.config.traceAll}get traceBufferSizeMb(){return this.config.traceBufferSizeMb}get maxSearchDepth(){return this.config.maxSearchDepth}get events(){return this.config.events}getLogger(e){return e?i:this.logger}withDebug(e){let t=this.config.debug;try{this.config.debug=!0,e()}finally{this.config.debug=t}}constructor(){this.config={logger:a,debug:!1,projectRoot:null,traceAll:!1,traceBufferSizeMb:256,maxSearchDepth:10,populateAppCallResources:!0,events:new n}}configure(e){this.config={...this.config,...e}}}let s=new o},28825:(e,t,r)=>{"use strict";r.d(t,{FX:()=>l,jH:()=>s,lU:()=>o});var n=r(79175),a=r(64527),i=r(40156);let o=(0,a.createContext)({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function s(){return(0,a.useContext)(o)}function l(e){let{children:t,initialDirection:r="ltr",detectDirection:s=!0}=e,[l,c]=(0,a.useState)(r),u=e=>{c(e),document.documentElement.setAttribute("dir",e)};return(0,i.o)(()=>{if(s){let e=document.documentElement.getAttribute("dir");("rtl"===e||"ltr"===e)&&u(e)}},[]),(0,n.jsx)(o.Provider,{value:{dir:l,toggleDirection:()=>u("ltr"===l?"rtl":"ltr"),setDirection:u},children:t})}},28847:(e,t,r)=>{"use strict";r.d(t,{v:()=>a});var n=r(64527);function a(e){return!Array.isArray(e)&&null!==e&&"object"==typeof e&&e.type!==n.Fragment}},29640:(e,t,r)=>{"use strict";r.d(t,{M:()=>y});var n=r(79175);r(64527);var a=r(76825),i=r(94393),o=r(51049),s=r(44241),l=r(41903),c=r(35058),u=r(2798),p=r(66643),h=r(39363),d=r
3(93720),f=r(24392),g=r(21567);let m=(0,i.V)((e,t)=>{let{size:r,radius:n,variant:i,gradient:o,color:s,autoContrast:l}=t,c=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:i||"filled",autoContrast:l});return{root:{"--ai-size":(0,a.YC)(r,"ai-size"),"--ai-radius":void 0===n?void 0:(0,a.nJ)(n),"--ai-bg":s||i?c.background:void 0,"--ai-hover":s||i?c.hover:void 0,"--ai-hover-color":s||i?c.hoverColor:void 0,"--ai-color":c.color,"--ai-bd":s||i?c.border:void 0}}}),y=(0,c.v)((e,t)=>{let r=(0,o.Y)("ActionIcon",null,e),{className:a,unstyled:i,variant:c,classNames:d,styles:f,style:y,loading:w,loaderProps:v,size:b,color:S,radius:x,__staticSelector:A,gradient:E,vars:I,children:T,disabled:k,"data-disabled":C,autoContrast:_,mod:D,attributes:B,...P}=r,M=(0,s.I)({name:["ActionIcon",A],props:r,className:a,style:y,classes:g.A,classNames:d,styles:f,unstyled:i,attributes:B,vars:I,varsResolver:m});return(0,n.jsxs)(h.N,{...M("root",{active:!k&&!w&&!C}),...P,unstyled:i,variant:c,size:b,disabled:k||w,ref:t,mod:[{loading:w,disabled:k||C},D],children:[(0,n.jsx)(p.e,{mounted:!!w,transition:"slide-down",duration:150,children:e=>(0,n.jsx)(l.a,{component:"span",...M("loader",{style:e}),"aria-hidden":!0,children:(0,n.jsx)(u.a,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...v})})}),(0,n.jsx)(l.a,{component:"span",mod:{loading:w},...M("icon"),children:T})]})});y.classes=g.A,y.displayName="@mantine/core/ActionIcon",y.Group=d.p,y.GroupSection=f.k},30076:(e,t,r)=>{"use strict";r.d(t,{l:()=>f});var n=r(79175);r(64527);var a=r(76825),i=r(94393),o=r(90461),s=r(51049),l=r(44241),c=r(41903),u=r(97569),p=r(35655);let h={error:null},d=(0,i.V)((e,t)=>{let{size:r,color:n}=t;return{chevron:{"--combobox-chevron-size":(0,a.YC)(r,"combobox-chevron-size"),"--combobox-chevron-color":n?(0,o.r)(n,e):void 0}}}),f=(0,u.P9)((e,t)=>{let r=(0,s.Y)("ComboboxChevron",h,e),{size:a,error:i,style:o,className:u,classNames:f,styles:g,unstyled:m,vars:y,mod:w,...v}=r,b=(0,l.I)({name:"ComboboxChevron",classes:p.A,props:r,style:o,className:u,classNames:f,styles:g,unstyled:m,vars:y,varsResolver:d,rootSelector:"chevron"});return(0,n.jsx)(c.a,{component:"svg",...v,...b("chevron"),size:a,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:i},w],ref:t,children:(0,n.jsx)("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});f.classes=p.A,f.displayName="@mantine/core/ComboboxChevron"},30175:(e,t,r)=>{"use strict";r.d(t,{q:()=>l});var n,a=r(35066),i=r(99267);let o="ALGOKIT_DISPENSER_ACCESS_TOKEN";!function(e){e[e.Algo=0]="Algo"}(n||(n={}));let s={[n.Algo]:{assetId:0,decimals:6,description:"Algo"}};class l{constructor(e){let t=i?.env?.[o];if(e?.authToken)this._authToken=e.authToken;else if(t)this._authToken=t;else throw Error(`Can't init AlgoKit TestNet Dispenser API client because neither environment variable ${o} or the authToken were provided.`);this._requestTimeout=e?.requestTimeout||15}get authToken(){return this._authToken}get requestTimeout(){return this._requestTimeout}async processDispenserRequest(e,t,r=null,n="POST"){let i={method:n,headers:{Authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e3*this.requestTimeout)};r&&(i.body=(0,a.vA)(r));let o=await fetch(`https://api.dispenser.algorandfoundation.tools/${t}`,i);if(!o.ok){let e=`Error processing dispenser API request: ${o.status}`,t=null;try{t=await o.json()}catch{}throw t&&t.code?e=t.code:400===o.status&&(e=(await o.json()).message),Error(e)}return o}
3async fund(e,t){let r=await this.processDispenserRequest(this.authToken,`fund/${s[n.Algo].assetId}`,{receiver:"string"==typeof e?e:e.toString(),amount:Number(t),assetID:s[n.Algo].assetId},"POST"),a=await r.json();return{txId:a.txID,amount:a.amount}}async refund(e){await this.processDispenserRequest(this.authToken,"refund",{refundTransactionID:e},"POST")}async getLimit(){let e=await this.processDispenserRequest(this.authToken,`fund/${s[n.Algo].assetId}/limit`,null,"GET");return{amount:(await e.json()).amount}}}},30437:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(63012).A)("outline","logout","Logout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]])},30841:(e,t,r)=>{"use strict";r.d(t,{Ar:()=>s,Kp:()=>i,My:()=>c,aS:()=>l,aT:()=>u,if:()=>o});var n=r(46085),a=r(83123).hp;function i(e){if((0,n.Ll)())return new Uint8Array(a.from(e,"base64"));let t=atob(e);return Uint8Array.from(t,e=>e.codePointAt(0))}function o(e){return(0,n.Ll)()?a.from(e).toString("base64"):btoa(Array.from(e,e=>String.fromCodePoint(e)).join(""))}function s(e){return new TextDecoder().decode(e)}function l(e){return"string"==typeof e?new TextEncoder().encode(e):e}function c(e){return(0,n.Ll)()?a.from(e).toString("hex"):Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}function u(e){if((0,n.Ll)())return a.from(e,"hex");let t=e;e.length%2!=0&&(t=e.padStart(1,"0"));let r=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)r[e]=parseInt(t.slice(2*e,2*e+2),16);return r}},30905:(e,t,r)=>{"use strict";r.d(t,{HR:()=>c,J9:()=>h,S_:()=>d,YB:()=>m,jS:()=>u,sE:()=>p,uf:()=>y});var n=r(79142),a=r(83123),i=r(28775),o=r(72726),s=r(35066),l=r(68687);function c(e){if(null!=e&&void 0!==e){if("object"==typeof e&&e.constructor===Uint8Array)return e;if("object"==typeof e&&"dAppName"in e){let t=`${e.dAppName}:${e.format}${"string"==typeof e.data?e.data:(0,s.vA)(e.data)}`;return new TextEncoder().encode(t)}{let t="string"==typeof e?e:(0,s.vA)(e);return new TextEncoder().encode(t)}}}function u(e){if(null!=e){if("object"==typeof e&&e.constructor===Uint8Array){if(0===e.length||e.length>32)throw Error(`Received invalid lease; expected something with length between 1 and 32, but received bytes with length ${e.length}`);if(32===e.length)return e;let t=new Uint8Array(32);return t.set(e,0),t}if("string"==typeof e){if(0===e.length||e.length>32)throw Error(`Received invalid lease; expected something with length between 1 and 32, but received '${e}' with length ${e.length}`);let t=new TextEncoder,r=new Uint8Array(32);return r.set(t.encode(e),0),r}throw Error(`Unknown lease type received of ${typeof e}`)}}n.Ay$.AtomicTransactionComposer;let p=function(e){return"string"==typeof e?e:"addr"in e?e.addr.toString():e.address().toString()},h=async(e,t)=>{if("txn"in e)return e;if(void 0===t)throw Error("Default sender must be provided when passing in a transaction object that does not contain its own signer");return e instanceof Promise?{txn:(await e).transaction,signer:d(t)}:"transaction"in e?{txn:e.transaction,signer:d(e.signer)}:{txn:e,signer:d(t)}},d=(e=>{let t=new Map,r=function(r){return t.has(r)?t.get(r):t.set(r,e.call(this,r))&&t.get(r)};return r.cache=t,r})(function(e){return"signer"in e?e.signer:"lsig"in e?n.Ay$.makeLogicSigAccountTransactionSigner(e):n.Ay$.makeBasicAccountTransactionSigner(e)});async function f(e,t,r,a){let i=new n.Ay$.modelsv2.SimulateRequest({txnGroups:[],allowUnnamedResources:!0,allowEmptySignatures:!0,fixSigners:!0}),o=n.Ay$.makeEmptyTransactionSigner(),s=e.clone(),l=[];if(s.transactions.forEach((e,t)=>{if(e.signer=o,r.coverAppCallInnerTransactionFees&&e.txn.type===n.D_l.appl){if(!a?.suggestedParams)throw Error("Please provide additionalAtcContext.suggestedParams when coverAppCallInnerTransactionFees is enabled");let r=a?.maxFees?.get(t)?.microAlgo;void 0===r?l.push(t):e.txn.fee=r}}),r.coverAppCallInnerTransactionFees&&l.length>0)throw Error(`Please provide a maxFee for each app call transaction when coverAppCallInnerTransactionFees is enabled. Required for transaction ${l.join(", ")}`);
3let c=BigInt(a?.suggestedParams.fee??0n),u=BigInt(a?.suggestedParams.minFee??1000n),p=(await s.simulate(t,i)).simulateResponse.txnGroups[0];if(p.failureMessage){if(r.coverAppCallInnerTransactionFees&&p.failureMessage.match(/fee too small/))throw Error("Fees were too small to resolve execution info via simulate. You may need to increase an app call transaction maxFee.");throw Error(`Error resolving execution info via simulate in transaction ${p.failedAt}: ${p.failureMessage}`)}return{groupUnnamedResourcesAccessed:r.populateAppCallResources?p.unnamedResourcesAccessed:void 0,txns:p.txnResults.map((t,a)=>{let i=e.transactions[a].txn,o=0n;if(r.coverAppCallInnerTransactionFees){let e=c*BigInt(i.toByte().length+75),r=(e<u?u:e)-i.fee;if(i.type===n.D_l.appl){let e=(t,r=0n)=>t.reverse().reduce((t,r)=>{let n=(r.innerTxns&&r.innerTxns.length>0?e(r.innerTxns,t):t)+(u-r.txn.txn.fee);return n<0n?0n:n},r);o=e(t.txnResult.innerTxns??[])+r}else o=r}return{unnamedResourcesAccessed:r.populateAppCallResources?t.unnamedResourcesAccessed:void 0,requiredFeeDelta:o}})}}async function g(e,t,r,a){let i=await f(e,t,r,a),o=e.buildGroup(),[s,l]=r.coverAppCallInnerTransactionFees?i.txns.map((e,t)=>{let r=o[t].txn,i=a?.maxFees?.get(t)?.microAlgo,s=void 0!==i&&i===r.fee,l=e.requiredFeeDelta>0n&&(s||r.type!==n.Ay$.TransactionType.appl)?1000n:1n;return{...e,groupIndex:t,surplusFeePriorityLevel:e.requiredFeeDelta>0n?e.requiredFeeDelta*l:-1n}}).sort((e,t)=>e.surplusFeePriorityLevel>t.surplusFeePriorityLevel?-1:+(e.surplusFeePriorityLevel<t.surplusFeePriorityLevel)).reduce((e,{groupIndex:t,requiredFeeDelta:r})=>{if(r>0n){let n=e[0],a=e[1],i=r-n;return i<=0n?n=-i:(a.set(t,i),n=0n),[n,a]}return e},[i.txns.reduce((e,{requiredFeeDelta:t})=>t<0n?e+-t:e,0n),new Map]):[0n,new Map];if(i.txns.forEach(({unnamedResourcesAccessed:e},t)=>{if(r.populateAppCallResources&&void 0!==e&&o[t].txn.type===n.D_l.appl){if(e.boxes||e.extraBoxRefs)throw Error("Unexpected boxes at the transaction level");if(e.appLocals)throw Error("Unexpected app local at the transaction level");if(e.assetHoldings)throw Error("Unexpected asset holding at the transaction level");o[t].txn.applicationCall={...o[t].txn.applicationCall,accounts:[...o[t].txn?.applicationCall?.accounts??[],...e.accounts??[]],foreignApps:[...o[t].txn?.applicationCall?.foreignApps??[],...e.apps??[]],foreignAssets:[...o[t].txn?.applicationCall?.foreignAssets??[],...e.assets??[]],boxes:[...o[t].txn?.applicationCall?.boxes??[],...e.boxes??[]]};let r=o[t].txn.applicationCall?.accounts?.length??0;if(r>4)throw Error(`Account reference limit of 4 exceeded in transaction ${t}`);let n=o[t].txn.applicationCall?.foreignAssets?.length??0;if(r+n+(o[t].txn.applicationCall?.foreignApps?.length??0)+(o[t].txn.applicationCall?.boxes?.length??0)>8)throw Error(`Resource reference limit of 8 exceeded in transaction ${t}`)}if(r.coverAppCallInnerTransactionFees){let e=l.get(t);if(void 0!==e){if(o[t].txn.type!==n.Ay$.TransactionType.appl)throw Error(`An additional fee of ${e} \xb5ALGO is required for non app call transaction ${t}`);let r=o[t].txn.fee+e,i=a?.maxFees?.get(t)?.microAlgo;if(void 0===i||r>i)throw Error(`Calculated transaction fee ${r} \xb5ALGO is greater than max of ${i??"undefined"} for transaction ${t}`);o[t].txn.fee=r}}}),r.populateAppCallResources){let e=(e,t,r)=>{let a=e=>{if(e.txn.type!==n.Ay$.TransactionType.appl)return!1;let t=e.txn.applicationCall?.accounts?.length??0,r=e.txn.applicationCall?.foreignAssets?.length??0;return t+r+(e.txn.applicationCall?.foreignApps?.length??0)+(e.txn.applicationCall?.boxes?.length??0)<8};if("assetHolding"===r||"appLocal"===r){let{account:i}=t,o=e.findIndex(e=>!!a(e)&&(e.txn.applicationCall?.accounts?.map(e=>e.toString()).includes(i.toString())||e.txn.applicationCall?.foreignApps?.map(e=>n.Ay$.getApplicationAddress(e).toString()).includes(i.toString())||Object.values(e.txn).some(e=>(0,n.e4x)(e,(e,t)=>t instanceof n.pVw?t.toString():t)?.includes(i.toString()))));if(o>-1){if("assetHolding"===r){let{asset:r}=t;e[o].txn.applicationCall={...e[o].txn.applicationCall,foreignAssets:[...e[o].txn?.applicationCall?.foreignAssets??[],r]}}else{let{app:r}=t;e[o].txn.applicationCall={...e[o].txn.applicationCall,foreignApps:[...e[o].txn?.applicationCall?.foreignApps??[],r]}}return}if((o=e.findIndex(e=>{if(!a(e)||(e.txn.applicationCall?.accounts?.length??0)>=4)return!1;if("assetHolding"===r){let{asset:r}=t;return e.txn.applicationCall?.foreignAssets?.includes(r)}{let{app:r}=t;return e.txn.applicationCall?.foreignApps?.includes(r)||e.txn.applicationCall?.appIndex===r}}))>-1){let{account:r}=t;e[o].txn.applicationCall={...e[o].txn.applicationCall,accounts:[...e[o].txn?.applicationCall?.accounts??[],r]};return}}if("box"===r){let{app:r,name:n}=t,i=e.findIndex(e=>!!a(e)&&(e.txn.applicationCall?.foreignApps?.includes(r)||e.txn.applicationCall?.appIndex===r));if(i>-1){e[i].txn.applicationCall={...e[i].txn.applicationCall,boxes:[...e[i].txn?.applicationCall?.boxes??[],{appIndex:r,name:n}]};return}}let i=e.findIndex(e=>{if(e.txn.type!==n.Ay$.TransactionType.appl)return!1;let a=e.txn.applicationCall?.accounts?.length??0;if("account"===r)return a<4;let i=e.txn.applicationCall?.foreignAssets?.length??0,o=e.txn.applicationCall?.foreignApps?.length??0,s=e.txn.applicationCall?.boxes?.length??0;return"assetHolding"===r||"appLocal"===r?a+i+o+s<7&&a<4:"box"===r&&BigInt(t.app)!==BigInt(0)?a+i+o+s<7:a+i+o+s<8});if(-1===i)throw Error("No more transactions below reference limit. Add another app call to the group.");
3if("account"===r)e[i].txn.applicationCall={...e[i].txn.applicationCall,accounts:[...e[i].txn?.applicationCall?.accounts??[],t]};else if("app"===r)e[i].txn.applicationCall={...e[i].txn.applicationCall,foreignApps:[...e[i].txn?.applicationCall?.foreignApps??[],"bigint"==typeof t?t:BigInt(t)]};else if("box"===r){let{app:r,name:n}=t;e[i].txn.applicationCall={...e[i].txn.applicationCall,boxes:[...e[i].txn?.applicationCall?.boxes??[],{appIndex:r,name:n}]},"0"!==r.toString()&&(e[i].txn.applicationCall={...e[i].txn.applicationCall,foreignApps:[...e[i].txn?.applicationCall?.foreignApps??[],r]})}else if("assetHolding"===r){let{asset:r,account:n}=t;e[i].txn.applicationCall={...e[i].txn.applicationCall,foreignAssets:[...e[i].txn?.applicationCall?.foreignAssets??[],r],accounts:[...e[i].txn?.applicationCall?.accounts??[],n]}}else if("appLocal"===r){let{app:r,account:n}=t;e[i].txn.applicationCall={...e[i].txn.applicationCall,foreignApps:[...e[i].txn?.applicationCall?.foreignApps??[],r],accounts:[...e[i].txn?.applicationCall?.accounts??[],n]}}else"asset"===r&&(e[i].txn.applicationCall={...e[i].txn.applicationCall,foreignAssets:[...e[i].txn?.applicationCall?.foreignAssets??[],"bigint"==typeof t?t:BigInt(t)]})},t=i.groupUnnamedResourcesAccessed;if(t&&(t.appLocals?.forEach(r=>{e(o,r,"appLocal"),t.accounts=t.accounts?.filter(e=>e!==r.account),t.apps=t.apps?.filter(e=>BigInt(e)!==BigInt(r.app))}),t.assetHoldings?.forEach(r=>{e(o,r,"assetHolding"),t.accounts=t.accounts?.filter(e=>e!==r.account),t.assets=t.assets?.filter(e=>BigInt(e)!==BigInt(r.asset))}),t.accounts?.forEach(t=>{e(o,t,"account")}
3),t.boxes?.forEach(r=>{e(o,r,"box"),t.apps=t.apps?.filter(e=>BigInt(e)!==BigInt(r.app))}),t.assets?.forEach(t=>{e(o,t,"asset")}),t.apps?.forEach(t=>{e(o,t,"app")}),t.extraBoxRefs))for(let r=0;r<t.extraBoxRefs;r+=1)e(o,new n.Ay$.modelsv2.BoxReference({app:0,name:new Uint8Array(0)}),"box")}let c=new n.Ay$.AtomicTransactionComposer;return o.forEach(e=>{e.txn.group=void 0,c.addTransaction(e)}),c.methodCalls=e.methodCalls,c}let m=async function(e,t){let r,{atc:s,sendParams:c,additionalAtcContext:u,...p}=e;r=s;try{let e,h,d=r.buildGroup(),f=p?.populateAppCallResources??c?.populateAppCallResources??i.T.populateAppCallResources,m=p?.coverAppCallInnerTransactionFees;(f||m)&&d.map(e=>e.txn.type).includes(n.Ay$.TransactionType.appl)&&(r=await g(s,t,{...p,populateAppCallResources:f,coverAppCallInnerTransactionFees:m},u));let w=r.buildGroup().map(e=>e.txn);if(w.length>1&&(e=w[0].group?a.hp.from(w[0].group).toString("base64"):"",i.T.getLogger(p?.suppressLog??c?.suppressLog).verbose(`Sending group of ${w.length} transactions (${e})`,{transactionsToSend:w}),i.T.getLogger(p?.suppressLog??c?.suppressLog).debug(`Transaction IDs (${e})`,w.map(e=>e.txID()))),i.T.debug&&i.T.traceAll){let e=await (0,l.B)(r,t);await i.T.events.emitAsync(o.B.TxnGroupSimulated,{simulateResponse:e})}let v=await r.execute(t,p?.maxRoundsToWaitForConfirmation??c?.maxRoundsToWaitForConfirmation??5);w.length>1?i.T.getLogger(p?.suppressLog??c?.suppressLog).verbose(`Group transaction (${e}) sent with ${w.length} transactions`):i.T.getLogger(p?.suppressLog??c?.suppressLog).verbose(`Sent transaction ID ${w[0].txID()} ${w[0].type} from ${w[0].sender.toString()}`),c?.skipWaiting||(h=await Promise.all(w.map(async e=>await t.pendingTransactionInformation(e.txID()).do())));let b=[...r.methodCalls.values()];return{groupId:e,confirmations:h,txIds:w.map(e=>e.txID()),transactions:w,returns:v.methodResults.map((e,t)=>y(e,b[t].returns.type))}}catch(n){let e=Error("object"==typeof n?n?.message:"Received error executing Atomic Transaction Composer");if(e.cause=n,"object"==typeof n&&(delete n.response?.headers,e.response=n.response,n.response&&"body"in n.response&&delete e.response.body,e.name=n.name),i.T.debug&&"object"==typeof n){e.traces=[],i.T.getLogger(p?.suppressLog??c?.suppressLog).error("Received error executing Atomic Transaction Composer and debug flag enabled; attempting simulation to get more information",e);let n=await (0,l.B)(r,t);if(i.T.debug&&!i.T.traceAll&&await i.T.events.emitAsync(o.B.TxnGroupSimulated,{simulateResponse:n}),n&&n.txnGroups[0].failedAt)for(let t of n.txnGroups[0].txnResults)e.traces.push({trace:t.execTrace?.toEncodingData(),appBudget:t.appBudgetConsumed,logicSigBudget:t.logicSigBudgetConsumed,logs:t.txnResult.logs,message:n.txnGroups[0].failureMessage})}else i.T.getLogger(p?.suppressLog??c?.suppressLog).error("Received error executing Atomic Transaction Composer, for more information enable the debug flag",e);throw e.sentTransactions=r.buildGroup().map(e=>e.txn),e}};function y(e,t){if(e.decodeError)return{decodeError:e.decodeError};let r=(0,s.Kn)(void 0!==e.returnValue&&"void"!==e.method.returns.type?(0,s.t9)(e.returnValue,e.method.returns.type):e.returnValue,t);return{method:e.method,rawReturnValue:e.rawReturnValue,decodeError:void 0,returnValue:r}}},31393:(e,t,r)=>{"use strict";r.d(t,{FG:()=>h,LR:()=>g,MB:()=>f,jw:()=>d});var n=r(79142),a=r(12021),i=r(43728),o=r(30905),s=r(91323);r(77251);var l=r(52530),c=r(70377),u=r(54724),p=r(63790);async function h(e,t,r){let h=new c.r(t),d=()=>new p.R({algod:t,getSigner:()=>(0,o.S_)(e.from),getSuggestedParams:async()=>e.transactionParams?{...e.transactionParams}:await t.getTransactionParams().do(),appManager:h}),f=new l.i(h,new s.f(d,new u.E(t,d),h),r),g={approvalProgram:e.approvalProgram,clearStateProgram:e.clearStateProgram,sender:(0,o.sE)(e.from),accountReferences:e.createArgs?.accounts?.map(e=>"string"==typeof e?e:n.Ay$.encodeAddress(e.publicKey)),appReferences:e.createArgs?.apps?.map(e=>BigInt(e)),assetReferences:e.createArgs?.assets?.map(e=>BigInt(e)),boxReferences:e.createArgs?.boxes?.map(i.cF)?.map(e=>({appId:BigInt(e.appIndex),name:e.name})),lease:e.createArgs?.lease,rekeyTo:e.createArgs?.rekeyTo?(0,o.sE)(e.createArgs?.rekeyTo):void 0,staticFee:e.fee,maxFee:e.maxFee,extraProgramPages:e.schema.extraPages,onComplete:(0,a.ar)(e.createOnCompleteAction),schema:e.schema},m={approvalProgram:e.approvalProgram,clearStateProgram:e.clearStateProgram,sender:(0,o.sE)(e.from),accountReferences:e.updateArgs?.accounts?.map(e=>"string"==typeof e?e:n.Ay$.encodeAddress(e.publicKey)),appReferences:e.updateArgs?.apps?.map(e=>BigInt(e)),assetReferences:e.updateArgs?.assets?.map(e=>BigInt(e)),boxReferences:e.updateArgs?.boxes?.map(i.cF)?.map(e=>({appId:BigInt(e.appIndex),name:e.name})),lease:e.updateArgs?.lease,rekeyTo:e.updateArgs?.rekeyTo?(0,o.sE)(e.updateArgs?.rekeyTo):void 0,staticFee:e.fee,maxFee:e.maxFee,onComplete:n.Ay$.OnApplicationComplete.UpdateApplicationOC},y={sender:(0,o.sE)(e.from),accountReferences:e.deleteArgs?.accounts?.map(e=>"string"==typeof e?e:n.Ay$.encodeAddress(e.publicKey)),appReferences:e.deleteArgs?.apps?.map(e=>BigInt(e)),assetReferences:e.deleteArgs?.assets?.map(e=>BigInt(e)),boxReferences:e.deleteArgs?.boxes?.map(i.cF)?.map(e=>({appId:BigInt(e.appIndex),name:e.name})),lease:e.deleteArgs?.lease,rekeyTo:e.deleteArgs?.rekeyTo?(0,o.sE)(e.deleteArgs?.rekeyTo):void 0,staticFee:e.fee,maxFee:e.maxFee,onComplete:n.Ay$.OnApplicationComplete.DeleteApplicationOC},w=new TextEncoder,v=await f.deploy({createParams:e.createArgs?.method?{...g,method:"txnCount"in e.createArgs.method?e.createArgs.method:new n.Ay$.ABIMethod(e.createArgs.method),args:(await (0,i.JT)(e.createArgs,e.from)).methodArgs}:{...g,args:"appArgs"in(e?.createArgs??{})?e.createArgs?.appArgs?.map(e=>"string"==typeof e?w.encode(e):e):void 0},updateParams:e.updateArgs?.method?{...m,method:"txnCount"in e.updateArgs.method?e.updateArgs.method:new n.Ay$.ABIMethod(e.updateArgs.method),args:(await (0,i.JT)(e.updateArgs,e.from)).methodArgs}:{...m,args:"appArgs"in(e?.updateArgs??{})?e.updateArgs?.appArgs?.map(e=>"string"==typeof e?w.encode(e):e):void 0},deleteParams:e.deleteArgs?.method?{...y,method:"txnCount"in e.deleteArgs.method?e.deleteArgs.method:new n.Ay$.ABIMethod(e.deleteArgs.method),args:(await (0,i.JT)(e.deleteArgs,e.from)).methodArgs}:{...y,args:"appArgs"in(e?.deleteArgs??{})?e.deleteArgs?.appArgs?.map(e=>"string"==typeof e?w.encode(e):e):void 0},metadata:e.metadata,deployTimeParams:e.deployTimeParams,onSchemaBreak:e.onSchemaBreak,onUpdate:e.onUpdate,existingDeployments:e.existingDeployments?{creator:n.pVw.fromString(e.existingDeployments.creator),apps:Object.fromEntries(Object.entries(e.existingDeployments.apps).map(([e,t])=>[e,{...t,appAddress:n.pVw.fromString(t.appAddress),appId:BigInt(t.appId),createdRound:BigInt(t.createdRound),updatedRound:BigInt(t.updatedRound)}]))}
3:void 0,maxRoundsToWaitForConfirmation:e.maxRoundsToWaitForConfirmation,populateAppCallResources:e.populateAppCallResources,suppressLog:e.suppressLog});return{...v,appAddress:v.appAddress.toString(),appId:Number(v.appId),createdRound:Number(v.createdRound),updatedRound:Number(v.updatedRound)}}async function d(e,t){let r=await new l.i(void 0,void 0,t).getCreatorAppsByName((0,o.sE)(e));return{creator:r.creator.toString(),apps:Object.fromEntries(Object.entries(r.apps).map(([e,t])=>[e,{...t,appAddress:t.appAddress.toString(),appId:Number(t.appId),createdRound:Number(t.createdRound),updatedRound:Number(t.updatedRound)}]))}}function f(e,t){return c.r.replaceTealTemplateDeployTimeControlParams(e,t)}function g(e,t){return c.r.replaceTealTemplateParams(e,t)}},32460:(e,t,r)=>{"use strict";r.d(t,{D:()=>n,e:()=>a}),r(64527),r(79175);let[n,a]=(0,r(63415).e)({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0})},33210:(e,t,r)=>{"use strict";r.d(t,{BA:()=>c,O$:()=>u,Zj:()=>l});var n=r(9517),a=r(27392),i=r(93593),o=r(59310),s=r(12929);class l{constructor({txn:e,sig:t,msig:r,lsig:n,sgnr:a}){this.txn=e,this.sig=t,this.msig=r,this.lsig=n,this.sgnr=a;let i=0;if(t&&(i+=1),r&&(i+=1),n&&(i+=1),i>1)throw Error(`SignedTransaction must not have more than 1 signature. Got ${i}`)}getEncodingSchema(){return l.encodingSchema}toEncodingData(){return new Map([["txn",this.txn.toEncodingData()],["sig",this.sig],["msig",this.msig?(0,o.Zv)(this.msig):void 0],["lsig",this.lsig?this.lsig.toEncodingData():void 0],["sgnr",this.sgnr]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded SignedTransaction: ${e}`);return new l({txn:a.ZX.fromEncodingData(e.get("txn")),sig:e.get("sig"),msig:e.get("msig")?(0,o.oO)(e.get("msig")):void 0,lsig:e.get("lsig")?i.Gx.fromEncodingData(e.get("lsig")):void 0,sgnr:e.get("sgnr")})}}function c(e){return(0,n.VQ)(e,l)}function u(e){let t=new l({txn:e});return(0,n.BS)(t)}l.encodingSchema=new s.pZ((0,s.co)([{key:"txn",valueSchema:a.ZX.encodingSchema},{key:"sig",valueSchema:new s.KN(new s.lb(64))},{key:"msig",valueSchema:new s.KN(o.y9)},{key:"lsig",valueSchema:new s.KN(i.Gx.encodingSchema)},{key:"sgnr",valueSchema:new s.KN(new s.eu)}]))},33279:(e,t,r)=>{"use strict";r.d(t,{J:()=>g});var n=r(79175),a=r(82248);r(64527);var i=r(76825),o=r(94393),s=r(51049),l=r(44241),c=r(35058),u=r(39363),p=r(71255),h={root:"m_86a44da5","root--subtle":"m_220c80f2"};let d={variant:"subtle"},f=(0,o.V)((e,t)=>{let{size:r,radius:n,iconSize:o}=t;return{root:{"--cb-size":(0,i.YC)(r,"cb-size"),"--cb-radius":void 0===n?void 0:(0,i.nJ)(n),"--cb-icon-size":(0,a.D)(o)}}}),g=(0,c.v)((e,t)=>{let r=(0,s.Y)("CloseButton",d,e),{iconSize:a,children:i,vars:o,radius:c,className:g,classNames:m,style:y,styles:w,unstyled:v,"data-disabled":b,disabled:S,variant:x,icon:A,mod:E,attributes:I,__staticSelector:T,...k}=r,C=(0,l.I)({name:T||"CloseButton",props:r,className:g,style:y,classes:h,classNames:m,styles:w,unstyled:v,attributes:I,vars:o,varsResolver:f});return(0,n.jsxs)(u.N,{ref:t,...k,unstyled:v,variant:x,disabled:S,mod:[{disabled:S||b},E],...C("root",{variant:x,active:!S&&!b}),children:[A||(0,n.jsx)(p.U,{}),i]})});g.classes=h,g.displayName="@mantine/core/CloseButton"},35066:(e,t,r)=>{"use strict";r.d(t,{Bj:()=>c,Kn:()=>function e(t,r){if(!r.toString().includes("byte")||t instanceof Uint8Array)return t;if((r instanceof n.UN0||r instanceof n.Bxj)&&r.childType instanceof n.FRG&&Array.isArray(t))return new Uint8Array(t);if((r instanceof n.UN0||r instanceof n.Bxj)&&Array.isArray(t)){let n=[];for(let a=0;a<t.length;a++)n.push(e(t[a],r.childType));return n}if(r instanceof n.tIK&&Array.isArray(t)){let n=[];for(let a=0;a<t.length&&a<r.childTypes.length;a++)n.push(e(t[a],r.childTypes[a]));return n}return t},Le:()=>p,NX:()=>d,Qd:()=>s,Ro:()=>i,ln:()=>l,p0:()=>u,t9:()=>f,vA:()=>h});var n=r(79142),a=r(77251);let i=e=>{if("number"==typeof e)return e;if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new o(`Cannot convert ${e} to a Number as it is larger than the maximum safe integer the Number type can hold.`);if(e<BigInt(Number.MIN_SAFE_INTEGER))throw new o(`Cannot convert ${e} to a Number as it is smaller than the minimum safe integer the Number type can hold.`);return Number(e)};
3class o extends Error{}let s=(e,t,r)=>e>t?BigInt(Math.max(Number(e-t),Number(r))):null;function*l(e,t){for(let r=0;r<e.length;r+=t)yield e.slice(r,r+t)}let c=e=>{let t=new Map,r=function(r){return t.has(r)?t.get(r):t.set(r,e.call(this,r))&&t.get(r)};return r.cache=t,r},u=(e,t)=>{if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0},p=(e,t)=>{if("bigint"==typeof t)try{return i(t)}catch{return t.toString()}return t},h=(e,t=p,r)=>JSON.stringify(e,t,r),d=(e,t)=>Math.floor((e.length+(t?.length??0)-1)/a.tK),f=(e,t)=>{if("bigint"==typeof e)if(t instanceof n.PX5)return t.bitSize<53?Number(e):e;else return e;return Array.isArray(e)&&(t instanceof n.UN0||t instanceof n.Bxj)?e.map(e=>f(e,t.childType)):Array.isArray(e)&&t instanceof n.tIK?e.map((e,r)=>f(e,t.childTypes[r])):e}},35655:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var n={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"}},35988:(e,t,r)=>{"use strict";r.d(t,{UE:()=>en,ll:()=>Z,rD:()=>eo,UU:()=>ee,jD:()=>er,mG:()=>ea,ER:()=>ei,cY:()=>Y,BN:()=>Q,Ej:()=>et});let n=["top","right","bottom","left"],a=Math.min,i=Math.max,o=Math.round,s=Math.floor,l=e=>({x:e,y:e}),c={left:"right",right:"left",bottom:"top",top:"bottom"},u={start:"end",end:"start"};function p(e,t){return"function"==typeof e?e(t):e}function h(e){return e.split("-")[0]}function d(e){return e.split("-")[1]}function f(e){return"x"===e?"y":"x"}function g(e){return"y"===e?"height":"width"}let m=new Set(["top","bottom"]);function y(e){return m.has(h(e))?"y":"x"}function w(e){return e.replace(/start|end/g,e=>u[e])}let v=["left","right"],b=["right","left"],S=["top","bottom"],x=["bottom","top"];function A(e){return e.replace(/left|right|bottom|top/g,e=>c[e])}function E(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function I(e){let{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function T(e,t,r){let n,{reference:a,floating:i}=e,o=y(t),s=f(y(t)),l=g(s),c=h(t),u="y"===o,p=a.x+a.width/2-i.width/2,m=a.y+a.height/2-i.height/2,w=a[l]/2-i[l]/2;switch(c){case"top":n={x:p,y:a.y-i.height};break;case"bottom":n={x:p,y:a.y+a.height};break;case"right":n={x:a.x+a.width,y:m};break;case"left":n={x:a.x-i.width,y:m};break;default:n={x:a.x,y:a.y}}switch(d(t)){case"start":n[s]-=w*(r&&u?-1:1);break;case"end":n[s]+=w*(r&&u?-1:1)}return n}let k=async(e,t,r)=>{let{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}
3=r,s=i.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(t)),c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:p}=T(c,n,l),h=n,d={},f=0;for(let r=0;r<s.length;r++){let{name:i,fn:g}=s[r],{x:m,y:y,data:w,reset:v}=await g({x:u,y:p,initialPlacement:n,placement:h,strategy:a,middlewareData:d,rects:c,platform:o,elements:{reference:e,floating:t}});u=null!=m?m:u,p=null!=y?y:p,d={...d,[i]:{...d[i],...w}},v&&f<=50&&(f++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(c=!0===v.rects?await o.getElementRects({reference:e,floating:t,strategy:a}):v.rects),{x:u,y:p}=T(c,h,l)),r=-1)}return{x:u,y:p,placement:h,strategy:a,middlewareData:d}};async function C(e,t){var r;void 0===t&&(t={});let{x:n,y:a,platform:i,rects:o,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:f=0}=p(t,e),g=E(f),m=s[d?"floating"===h?"reference":"floating":h],y=I(await i.getClippingRect({element:null==(r=await (null==i.isElement?void 0:i.isElement(m)))||r?m:m.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),w="floating"===h?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,v=await (null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await (null==i.isElement?void 0:i.isElement(v))&&await (null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},S=I(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:v,strategy:l}):w);return{top:(y.top-S.top+g.top)/b.y,bottom:(S.bottom-y.bottom+g.bottom)/b.y,left:(y.left-S.left+g.left)/b.x,right:(S.right-y.right+g.right)/b.x}}function _(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function D(e){return n.some(t=>e[t]>=0)}function B(e){let t=a(...e.map(e=>e.left)),r=a(...e.map(e=>e.top));return{x:t,y:r,width:i(...e.map(e=>e.right))-t,height:i(...e.map(e=>e.bottom))-r}}let P=new Set(["left","top"]);async function M(e,t){let{placement:r,platform:n,elements:a}=e,i=await (null==n.isRTL?void 0:n.isRTL(a.floating)),o=h(r),s=d(r),l="y"===y(r),c=P.has(o)?-1:1,u=i&&l?-1:1,f=p(t,e),{mainAxis:g,crossAxis:m,alignmentAxis:w}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof w&&(m="end"===s?-1*w:w),l?{x:m*u,y:g*c}:{x:g*c,y:m*u}}var N=r(65047);function R(e){let t=(0,N.L9)(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,a=(0,N.sb)(e),i=a?e.offsetWidth:r,s=a?e.offsetHeight:n,l=o(r)!==i||o(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function O(e){return(0,N.vq)(e)?e:e.contextElement}function $(e){let t=O(e);if(!(0,N.sb)(t))return l(1);let r=t.getBoundingClientRect(),{width:n,height:a,$:i}=R(t),s=(i?o(r.width):r.width)/n,c=(i?o(r.height):r.height)/a;return s&&Number.isFinite(s)||(s=1),c&&Number.isFinite(c)||(c=1),{x:s,y:c}}let L=l(0);function U(e){let t=(0,N.zk)(e);return(0,N.Tc)()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:L}function V(e,t,r,n){var a;void 0===t&&(t=!1),void 0===r&&(r=!1);let i=e.getBoundingClientRect(),o=O(e),s=l(1);t&&(n?(0,N.vq)(n)&&(s=$(n)):s=$(e));let c=(void 0===(a=r)&&(a=!1),n&&(!a||n===(0,N.zk)(o))&&a)?U(o):l(0),u=(i.left+c.x)/s.x,p=(i.top+c.y)/s.y,h=i.width/s.x,d=i.height/s.y;if(o){let e=(0,N.zk)(o),t=n&&(0,N.vq)(n)?(0,N.zk)(n):n,r=e,a=(0,N._m)(r);for(;a&&n&&t!==r;){let e=$(a),t=a.getBoundingClientRect(),n=(0,N.L9)(a),i=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,p*=e.y,h*=e.x,d*=e.y,u+=i,p+=o,r=(0,N.zk)(a),a=(0,N._m)(r)}}return I({width:h,height:d,x:u,y:p})}function F(e,t){let r=(0,N.CP)(e).scrollLeft;return t?t.left+r:V((0,N.ep)(e)).left+r}function j(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-F(e,r),y:r.top+t.scrollTop}}let q=new Set(["absolute","fixed"]);function z(e,t,r){let n;if("viewport"===t)n=function(e,t){let r=(0,N.zk)(e),n=(0,N.ep)(e),a=r.visualVie
3wport,i=n.clientWidth,o=n.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;let e=(0,N.Tc)();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}let c=F(n);if(c<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(n.clientWidth-t.clientWidth-a);o<=25&&(i-=o)}else c<=25&&(i+=c);return{width:i,height:o,x:s,y:l}}(e,r);else if("document"===t)n=function(e){let t=(0,N.ep)(e),r=(0,N.CP)(e),n=e.ownerDocument.body,a=i(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=i(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),s=-r.scrollLeft+F(e),l=-r.scrollTop;return"rtl"===(0,N.L9)(n).direction&&(s+=i(t.clientWidth,n.clientWidth)-a),{width:a,height:o,x:s,y:l}}((0,N.ep)(e));else if((0,N.vq)(t))n=function(e,t){let r=V(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=(0,N.sb)(e)?$(e):l(1),o=e.clientWidth*i.x,s=e.clientHeight*i.y;return{width:o,height:s,x:a*i.x,y:n*i.y}}(t,r);else{let r=U(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return I(n)}function K(e){return"static"===(0,N.L9)(e).position}function G(e,t){if(!(0,N.sb)(e)||"fixed"===(0,N.L9)(e).position)return null;if(t)return t(e);let r=e.offsetParent;return(0,N.ep)(e)===r&&(r=r.ownerDocument.body),r}function H(e,t){let r=(0,N.zk)(e);if((0,N.Tf)(e))return r;if(!(0,N.sb)(e)){let t=(0,N.$4)(e);for(;t&&!(0,N.eu)(t);){if((0,N.vq)(t)&&!K(t))return t;t=(0,N.$4)(t)}return r}let n=G(e,t);for(;n&&(0,N.Lv)(n)&&K(n);)n=G(n,t);return n&&(0,N.eu)(n)&&K(n)&&!(0,N.sQ)(n)?r:n||(0,N.gJ)(e)||r}let W=async function(e){let t=this.getOffsetParent||H,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=(0,N.sb)(t),a=(0,N.ep)(t),i="fixed"===r,o=V(e,!0,i,t),s={scrollLeft:0,scrollTop:0},c=l(0);if(n||!n&&!i)if(("body"!==(0,N.mq)(t)||(0,N.ZU)(a))&&(s=(0,N.CP)(t)),n){let e=V(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&(c.x=F(a));i&&!n&&a&&(c.x=F(a));let u=!a||n||i?l(0):j(a,s);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},J={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e,i="fixed"===a,o=(0,N.ep)(n),s=!!t&&(0,N.Tf)(t.floating);if(n===o||s&&i)return r;let c={scrollLeft:0,scrollTop:0},u=l(1),p=l(0),h=(0,N.sb)(n);if((h||!h&&!i)&&(("body"!==(0,N.mq)(n)||(0,N.ZU)(o))&&(c=(0,N.CP)(n)),(0,N.sb)(n))){let e=V(n);u=$(n),p.x=e.x+n.clientLeft,p.y=e.y+n.clientTop}let d=!o||h||i?l(0):j(o,c);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+p.x+d.x,y:r.y*u.y-c.scrollTop*u.y+p.y+d.y}},getDocumentElement:N.ep,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,s=[..."clippingAncestors"===r?(0,N.Tf)(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=(0,N.v9)(e,[],!1).filter(e=>(0,N.vq)(e)&&"body"!==(0,N.mq)(e)),a=null,i="fixed"===(0,N.L9)(e).position,o=i?(0,N.$4)(e):e;for(;(0,N.vq)(o)&&!(0,N.eu)(o);){let t=(0,N.L9)(o),r=(0,N.sQ)(o);r||"fixed"!==t.position||(a=null),(i?!r&&!a:!r&&"static"===t.position&&!!a&&q.has(a.position)||(0,N.ZU)(o)&&!r&&function e(t,r){let n=(0,N.$4)(t);return!(n===r||!(0,N.vq)(n)||(0,N.eu)(n))&&("fixed"===(0,N.L9)(n).position||e(n,r))}(e,o))?n=n.filter(e=>e!==o):a=t,o=(0,N.$4)(o)}return t.set(e,n),n}(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((e,r)=>{let n=z(t,r,o);return e.top=i(n.top,e.top),e.right=a(n.right,e.right),e.bottom=a(n.bottom,e.bottom),e.left=i(n.left,e.left),e},z(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:H,getElementRects:W,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=R(e);return{width:t,height:r}},getScale:$,isElement:N.vq,isRTL:function(e){return"rtl"===(0,N.L9)(e).direction}};function X(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Z(e,t,r,n){let o;void 0===n&&(n={});let{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:p="function"==typeof IntersectionObserver,animationFrame:h=!1}=n,d=O(e),f=l||c?[...d?(0,N.v9)(d):[],...(0,N.v9)(t)]:[];
3f.forEach(e=>{l&&e.addEventListener("scroll",r,{passive:!0}),c&&e.addEventListener("resize",r)});let g=d&&p?function(e,t){let r,n=null,o=(0,N.ep)(e);function l(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function c(u,p){void 0===u&&(u=!1),void 0===p&&(p=1),l();let h=e.getBoundingClientRect(),{left:d,top:f,width:g,height:m}=h;if(u||t(),!g||!m)return;let y=s(f),w=s(o.clientWidth-(d+g)),v={rootMargin:-y+"px "+-w+"px "+-s(o.clientHeight-(f+m))+"px "+-s(d)+"px",threshold:i(0,a(1,p))||1},b=!0;function S(t){let n=t[0].intersectionRatio;if(n!==p){if(!b)return c();n?c(!1,n):r=setTimeout(()=>{c(!1,1e-7)},1e3)}1!==n||X(h,e.getBoundingClientRect())||c(),b=!1}try{n=new IntersectionObserver(S,{...v,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(S,v)}n.observe(e)}(!0),l}(d,r):null,m=-1,y=null;u&&(y=new ResizeObserver(e=>{let[n]=e;n&&n.target===d&&y&&(y.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=y)||e.observe(t)})),r()}),d&&!h&&y.observe(d),y.observe(t));let w=h?V(e):null;return h&&function t(){let n=V(e);w&&!X(w,n)&&r(),w=n,o=requestAnimationFrame(t)}(),r(),()=>{var e;f.forEach(e=>{l&&e.removeEventListener("scroll",r),c&&e.removeEventListener("resize",r)}),null==g||g(),null==(e=y)||e.disconnect(),y=null,h&&cancelAnimationFrame(o)}}let Y=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:a,y:i,placement:o,middlewareData:s}=t,l=await M(t,e);return o===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},Q=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...u}=p(e,t),d={x:r,y:n},g=await C(t,u),m=y(h(o)),w=f(m),v=d[w],b=d[m];if(s){let e="y"===w?"top":"left",t="y"===w?"bottom":"right",r=v+g[e],n=v-g[t];v=i(r,a(v,n))}if(l){let e="y"===m?"top":"left",t="y"===m?"bottom":"right",r=b+g[e],n=b-g[t];b=i(r,a(b,n))}let S=c.fn({...t,[w]:v,[m]:b});return{...S,data:{x:S.x-r,y:S.y-n,enabled:{[w]:s,[m]:l}}}}}},ee=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n,a,i,o;let{placement:s,middlewareData:l,rects:c,initialPlacement:u,platform:m,elements:E}=t,{mainAxis:I=!0,crossAxis:T=!0,fallbackPlacements:k,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:D="none",flipAlignment:B=!0,...P}=p(e,t);if(null!=(r=l.arrow)&&r.alignmentOffset)return{};let M=h(s),N=y(u),R=h(u)===u,O=await (null==m.isRTL?void 0:m.isRTL(E.floating)),$=k||(R||!B?[A(u)]:function(e){let t=A(e);return[w(e),t,w(t)]}(u)),L="none"!==D;!k&&L&&$.push(...function(e,t,r,n){let a=d(e),i=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?b:v;return t?v:b;case"left":case"right":return t?S:x;default:return[]}}(h(e),"start"===r,n);return a&&(i=i.map(e=>e+"-"+a),t&&(i=i.concat(i.map(w)))),i}(u,B,D,O));let U=[u,...$],V=await C(t,P),F=[],j=(null==(n=l.flip)?void 0:n.overflows)||[];if(I&&F.push(V[M]),T){let e=function(e,t,r){void 0===r&&(r=!1);let n=d(e),a=f(y(e)),i=g(a),o="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=A(o)),[o,A(o)]}(s,c,O);F.push(V[e[0]],V[e[1]])}if(j=[...j,{placement:s,overflows:F}],!F.every(e=>e<=0)){let e=((null==(a=l.flip)?void 0:a.index)||0)+1,t=U[e];if(t&&("alignment"!==T||N===y(t)||j.every(e=>y(e.placement)!==N||e.overflows[0]>0)))return{data:{index:e,overflows:j},reset:{placement:t}};let r=null==(i=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!r)switch(_){case"bestFit":{let e=null==(o=j.filter(e=>{if(L){let t=y(e.placement);return t===N||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=u}if(s!==r)return{reset:{placement:r}}}return{}}}},et=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;let o,s,{placement:l,rects:c,platform:u,elements:f}=t,{apply:g=()=>{},...m}=p(e,t),w=await C(t,m),v=h(l),b=d(l),S="y"===y(l),{width:x,height:A}=c.floating;"top"===v||"bottom"===v?(o=v,s=b===(await (null==u.isRTL?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(s=v,o="end"===b?"top":"bottom");let E=A-w.top-w.bottom,I=x-w.left-w.right,T=a(A-w[o],E),k=a(x-w[s],I),_=!t.middlewareData.shift,D=T,B=k;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(B=I),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(D=E),_&&!b){let e=i(w.left,0),t=i(w.right,0),r=i(w.top,0),n=i(w.bottom,0);S?B=x-2*(0!==e||0!==t?e+t:i(w.left,w.right)):D=A-2*(0!==r||0!==n?r+n:i(w.top,w.bottom))}await g({...t,availableWidth:B,availableHeight:D});let P=await u.getDimensions(f.floating);return x!==P.width||A!==P.height?{reset:{rects:!0}}:{}}}},er=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...a}=p(e,t);switch(n){case"referenceHidden":{let e=_(await C(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:D(e)}}}case"escaped":{let e=_(await C(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:D(e)}}}default:return{}}}}},en=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:s,platform:l,elements:c,middlewareData:u}=t,{element:h,padding:m=0}=p(e,t)||{};if(null==h)return{};let w=E(m),v={x:r,y:n},b=f(y(o)),S=g(b),x=await l.getDimensions(h),A="y"===b,I=A?"clientHeight":"clientWidth",T=s.reference[S]+s.reference[b]-v[b]-s.floating[S],k=v[b]-s.reference[b],C=await (null==l.getOffsetParent?void 0:l.getOffsetParent(h)),_=C?C[I]:0;_&&await (null==l.isElement?void 0:l.isElement(C))||(_=c.floating[I]||s.floating[S]);
3let D=_/2-x[S]/2-1,B=a(w[A?"top":"left"],D),P=a(w[A?"bottom":"right"],D),M=_-x[S]-P,N=_/2-x[S]/2+(T/2-k/2),R=i(B,a(N,M)),O=!u.arrow&&null!=d(o)&&N!==R&&s.reference[S]/2-(N<B?B:P)-x[S]/2<0,$=O?N<B?N-B:N-M:0;return{[b]:v[b]+$,data:{[b]:R,centerOffset:N-R-$,...O&&{alignmentOffset:$}},reset:O}}}),ea=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){let{placement:r,elements:n,rects:o,platform:s,strategy:l}=t,{padding:c=2,x:u,y:d}=p(e,t),f=Array.from(await (null==s.getClientRects?void 0:s.getClientRects(n.reference))||[]),g=function(e){let t=e.slice().sort((e,t)=>e.y-t.y),r=[],n=null;for(let e=0;e<t.length;e++){let a=t[e];!n||a.y-n.y>n.height/2?r.push([a]):r[r.length-1].push(a),n=a}return r.map(e=>I(B(e)))}(f),m=I(B(f)),w=E(c),v=await s.getElementRects({reference:{getBoundingClientRect:function(){if(2===g.length&&g[0].left>g[1].right&&null!=u&&null!=d)return g.find(e=>u>e.left-w.left&&u<e.right+w.right&&d>e.top-w.top&&d<e.bottom+w.bottom)||m;if(g.length>=2){if("y"===y(r)){let e=g[0],t=g[g.length-1],n="top"===h(r),a=e.top,i=t.bottom,o=n?e.left:t.left,s=n?e.right:t.right;return{top:a,bottom:i,left:o,right:s,width:s-o,height:i-a,x:o,y:a}}let e="left"===h(r),t=i(...g.map(e=>e.right)),n=a(...g.map(e=>e.left)),o=g.filter(r=>e?r.left===n:r.right===t),s=o[0].top,l=o[o.length-1].bottom;return{top:s,bottom:l,left:n,right:t,width:t-n,height:l-s,x:n,y:s}}return m}},floating:n.floating,strategy:l});return o.reference.x!==v.reference.x||o.reference.y!==v.reference.y||o.reference.width!==v.reference.width||o.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},ei=function(e){return void 0===e&&(e={}),{options:e,fn(t){let{x:r,y:n,placement:a,rects:i,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=p(e,t),u={x:r,y:n},d=y(a),g=f(d),m=u[g],w=u[d],v=p(s,t),b="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){let e="y"===g?"height":"width",t=i.reference[g]-i.floating[e]+b.mainAxis,r=i.reference[g]+i.reference[e]-b.mainAxis;m<t?m=t:m>r&&(m=r)}if(c){var S,x;let e="y"===g?"width":"height",t=P.has(h(a)),r=i.reference[d]-i.floating[e]+(t&&(null==(S=o.offset)?void 0:S[d])||0)+(t?0:b.crossAxis),n=i.reference[d]+i.reference[e]+(t?0:(null==(x=o.offset)?void 0:x[d])||0)-(t?b.crossAxis:0);w<r?w=r:w>n&&(w=n)}return{[g]:m,[d]:w}}}},eo=(e,t,r)=>{let n=new Map,a={platform:J,...r},i={...a.platform,_c:n};return k(e,t,{...a,platform:i})}},36121:(e,t,r)=>{"use strict";r.d(t,{S:()=>s});var n=r(46085),a=r(85414);class i{constructor(e){this.body=e.body,this.text=e.text,this.format=e.format,this.headers=e.headers,this.status=e.status,this.ok=e.ok}getJSONText(){if(void 0===this.text)throw Error(`Response body does not contain JSON data. Format is ${this.format}`);return this.text}parseBodyAsJSON(e){if(void 0===this.text)throw Error(`Response body does not contain JSON data. Format is ${this.format}`);return s.parseJSON(this.text,this.status,e)}}function o(e){return Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{})}class s{constructor(e,t,r,n={}){void 0!==t?this.bc=new a.x(e,t,r,n):this.bc=e}static parseJSON(e,t,r){try{if(!e)return null;return n.Ol(e,r)}catch(r){throw r.rawResponse=e||null,r.statusCode=t,r}}static serializeData(e,t){if(!e)return new Uint8Array(0);if("application/json"===t["content-type"])return new TextEncoder().encode(n.e4(e));if("string"==typeof e)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;throw Error("provided data is neither a string nor a Uint8Array and content-type is not application/json")}static prepareResponse(e,t){let r,{body:n}=e;return"application/msgpack"!==t&&(r=n&&new TextDecoder().decode(n)||""),new i({...e,format:t,text:r,ok:2===Math.trunc(e.status/100)})}static prepareResponseError(e){return e.response&&(e.response=s.prepareResponse(e.response,"application/json"),e.status=e.response.status),e}async get({relativePath:e,query:t,requestHeaders:r,customOptions:n}){let a=void 0!==t&&Object.prototype.hasOwnProperty.call(t,"format")&&"msgpack"===t.format?"application/msgpack":"application/json",i={...r??{},accept:a};try{let r=await this.bc.get(e,t?function(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(!e[t]||0===e[t].length)&&delete e[t];return e}(t):void 0,i,n);return s.prepareResponse(r,a)}catch(e){throw s.prepareResponseError(e)}}async post({relativePath:e,data:t,query:r,requestHeaders:n,customOptions:a}){let i={"content-type":"application/json",...o(n??{})};try{let n=await this.bc.post(e,s.serializeData(t,i),r,i,a);return s.prepareResponse(n,"application/json")}catch(e){throw s.prepareResponseError(e)}}async delete({relativePath:e,data:t,requestHeaders:r,customOptions:n}){let a={"content-type":"application/json",...o(r??{})};try{let r=await this.bc.delete(e,void 0!==t?s.serializeData(t,a):void 0,void 0,a,n);return s.prepareResponse(r,"application/json")}catch(e){throw s.prepareResponseError(e)}}}},36346:(e,t,r)=>{"use strict";r.d(t,{Z:()=>h});var n=r(79175),a=r(64527),i=r(40446),o=r(40156),s=r(64858),l=r(51049),c=r(97569);function u(e){let t=document.createElement("div");return t.setAttribute("data-portal","true"),"string"==typeof e.className&&t.classList.add(...e.className.split(" ").filter(
3Boolean)),"object"==typeof e.style&&Object.assign(t.style,e.style),"string"==typeof e.id&&t.setAttribute("id",e.id),t}let p={reuseTargetNode:!0},h=(0,c.P9)((e,t)=>{let{children:r,target:c,reuseTargetNode:h,...d}=(0,l.Y)("Portal",p,e),[f,g]=(0,a.useState)(!1),m=(0,a.useRef)(null);return((0,o.o)(()=>(g(!0),m.current=function(e){let{target:t,reuseTargetNode:r,...n}=e;if(t)return"string"==typeof t?document.querySelector(t)||u(n):t;if(r){let e=document.querySelector("[data-mantine-shared-portal-node]");if(e)return e;let t=u(n);return t.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(t),t}return u(n)}({target:c,reuseTargetNode:h,...d}),(0,s.bl)(t,m.current),c||h||!m.current||document.body.appendChild(m.current),()=>{c||h||!m.current||document.body.removeChild(m.current)}),[c]),f&&m.current)?(0,i.createPortal)((0,n.jsx)(n.Fragment,{children:r}),m.current):null});h.displayName="@mantine/core/Portal"},38293:(e,t,r)=>{var n,a=r(99267);!function(){"use strict";var t="input is invalid type",i="object"==typeof window,o=i?window:{};o.JS_SHA512_NO_WINDOW&&(i=!1);var s=!i&&"object"==typeof self;!o.JS_SHA512_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node?o=r.g:s&&(o=self);var l=!o.JS_SHA512_NO_COMMON_JS&&e.exports,c=r.amdO,u=!o.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,p="0123456789abcdef".split(""),h=[-0x80000000,8388608,32768,128],d=[24,16,8,0],f=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817],g=["hex","array","digest","arrayBuffer"],m=[];(o.JS_SHA512_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),u&&(o.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,t){return function(r){return new S(t,!0).update(r)[e]()}},w=function(e){var t=y("hex",e);t.create=function(){return new S(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<g.length;++r){var n=g[r];t[n]=y(n,e)}return t},v=function(e,t){return function(r,n){return new x(r,t,!0).update(n)[e]()}},b=function(e){var t=v("hex",e);t.create=function(t){return new x(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<g.length;++r){var n=g[r];t[n]=v(n,e)}return t};function S(e,t){t?(m[0]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=m[16]=m[17]=m[18]=m[19]=m[20]=m[21]=m[22]=m[23]=m[24]=m[25]=m[26]=m[27]=m[28]=m[29]=m[30]=m[31]=m[32]=0,this.blocks=m):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],384==e?(this.h0h=0xcbbb9d5d,this.h0l=0xc1059ed8,this.h1h=0x629a292a,this.h1l=0x367cd507,this.h2h=0x9159015a,this.h2l=0x3070dd17,this.h3h=0x152fecd8,this.h3l=0xf70e5939,this.h4h=0x67332667,this.h4l=0xffc00b31,this.h5h=0x8eb44a87,this.h5l=0x68581511,this.h6h=0xdb0c2e0d,this.h6l=0x64f98fa7,this.h7h=0x47b5481d,this.h7l=0xbefa4fa4):256==e?(this.h0h=0x22312194,this.h0l=0xf
3c2bf72c,this.h1h=0x9f555fa3,this.h1l=0xc84c64c2,this.h2h=0x2393b86b,this.h2l=0x6f53b151,this.h3h=0x96387719,this.h3l=0x5940eabd,this.h4h=0x96283ee2,this.h4l=0xa88effe3,this.h5h=0xbe5e1e25,this.h5l=0x53863992,this.h6h=0x2b0199fc,this.h6l=0x2c85b8aa,this.h7h=0xeb72ddc,this.h7l=0x81c52ca2):224==e?(this.h0h=0x8c3d37c8,this.h0l=0x19544da2,this.h1h=0x73e19966,this.h1l=0x89dcd4d6,this.h2h=0x1dfab7ae,this.h2l=0x32ff9c82,this.h3h=0x679dd514,this.h3l=0x582f9fcf,this.h4h=0xf6d2b69,this.h4l=0x7bd44da8,this.h5h=0x77e36f73,this.h5l=0x4c48942,this.h6h=0x3f9d85a8,this.h6l=0x6a1d36c8,this.h7h=0x1112e6ad,this.h7l=0x91d692a1):(this.h0h=0x6a09e667,this.h0l=0xf3bcc908,this.h1h=0xbb67ae85,this.h1l=0x84caa73b,this.h2h=0x3c6ef372,this.h2l=0xfe94f82b,this.h3h=0xa54ff53a,this.h3l=0x5f1d36f1,this.h4h=0x510e527f,this.h4l=0xade682d1,this.h5h=0x9b05688c,this.h5l=0x2b3e6c1f,this.h6h=0x1f83d9ab,this.h6l=0xfb41bd6b,this.h7h=0x5be0cd19,this.h7l=0x137e2179),this.bits=e,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function x(e,r,n){var a,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);else if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!u||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);a=!0}var o=e.length;if(!a){for(var s,l=[],o=e.length,c=0,p=0;p<o;++p)(s=e.charCodeAt(p))<128?l[c++]=s:(s<2048?l[c++]=192|s>>6:(s<55296||s>=57344?l[c++]=224|s>>12:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++p)),l[c++]=240|s>>18,l[c++]=128|s>>12&63),l[c++]=128|s>>6&63),l[c++]=128|63&s);e=l}e.length>128&&(e=new S(r,!0).update(e).array());for(var h=[],d=[],p=0;p<128;++p){var f=e[p]||0;h[p]=92^f,d[p]=54^f}S.call(this,r,n),this.update(d),this.oKeyPad=h,this.inner=!0,this.sharedMemory=n}S.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"===n){if(null===e)throw Error(t);else if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!u||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}for(var a,i,o=0,s=e.length,l=this.blocks;o<s;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=l[16]=l[17]=l[18]=l[19]=l[20]=l[21]=l[22]=l[23]=l[24]=l[25]=l[26]=l[27]=l[28]=l[29]=l[30]=l[31]=l[32]=0),r)for(i=this.start;o<s&&i<128;++o)l[i>>2]|=e[o]<<d[3&i++];else for(i=this.start;o<s&&i<128;++o)(a=e.charCodeAt(o))<128?l[i>>2]|=a<<d[3&i++]:(a<2048?l[i>>2]|=(192|a>>6)<<d[3&i++]:(a<55296||a>=57344?l[i>>2]|=(224|a>>12)<<d[3&i++]:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++o)),l[i>>2]|=(240|a>>18)<<d[3&i++],l[i>>2]|=(128|a>>12&63)<<d[3&i++]),l[i>>2]|=(128|a>>6&63)<<d[3&i++]),l[i>>2]|=(128|63&a)<<d[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=128?(this.block=l[32],this.start=i-128,this.hash(),this.hashed=!0):this.start=i}return this.bytes>0xffffffff&&(this.hBytes+=this.bytes/0x100000000|0,this.bytes=this.bytes%0x100000000),this},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[32]=this.block,e[t>>2]|=h[3&t],this.block=e[32],t>=112&&(this.hashed||this.hash(),e[0]=this.block,e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=e[16]=e[17]=e[18]=e[19]=e[20]=e[21]=e[22]=e[23]=e[24]=e[25]=e[26]=e[27]=e[28]=e[29]=e[30]=e[31]=e[32]=0),e[30]=this.hBytes<<3|this.bytes>>>29,e[31]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var e,t,r,n,a,i,o,s,l,c,u,p,h,d,g,m,y,w,v,b,S,x,A,E,I,T=this.h0h,k=this.h0l,C=this.h1h,_=this.h1l,D=this.h2h,B=this.h2l,P=this.h3h,M=this.h3l,N=this.h4h,R=this.h4l,O=this.h5h,$=this.h5l,L=this.h6h,U=this.h6l,V=this.h7h,F=this.h7l,j=this.blocks;for(e=32;e<160;e+=2)t=((b=j[e-30])>>>1|(S=j[e-29])<<31)^(b>>>8|S<<24)^b>>>7,r=(S>>>1|b<<31)^(S>>>8|b<<24)^(S>>>7|b<<25),n=((b=j[e-4])>>>19|(S=j[e-3])<<13)^(S>>>29|b<<3)^b>>>6,a=(S>>>19|b<<13)^(b>>>29|S<<3)^(S>>>6|b<<26),b=j[e-32],S=j[e-31],x=j[e-14],i=(65535&(A=j[e-13]))+(65535&S)+(65535&r)+(65535&a),s=(65535&x)+(65535&b)+(65535&t)+(65535&n)+((o=(A>>>16)+(S>>>16)+(r>>>16)+(a>>>16)+(i>>>16))>>>16),l=(x>>>16)+(b>>>16)+(t>>>16)+(n>>>16)+(s>>>16),j[e]=l<<16|65535&s,j[e+1]=o<<16|65535&i;var q=T,z=k,K=C,G=_,H=D,W=B,J=P,X=M,Z=N,Y=R,Q=O,ee=$,et=L,er=U,en=V,ea=F;for(e=0,m=K&H,y=G&W;e<160;e+=8)t=(q>>>28|z<<4)^(z>>>2|q<<30)^(z>>>7|q<<25),r=(z>>>28|q<<4)^(q>>>2|z<<30)^(q>>>7|z<<25),n=(Z>>>14|Y<<18)^(Z>>>
318|Y<<14)^(Y>>>9|Z<<23),a=(Y>>>14|Z<<18)^(Y>>>18|Z<<14)^(Z>>>9|Y<<23),c=q&K,u=z&G,w=c^q&H^m,v=u^z&W^y,E=Z&Q^~Z&et,I=Y&ee^~Y&er,b=j[e],S=j[e+1],x=f[e],i=(65535&(A=f[e+1]))+(65535&S)+(65535&I)+(65535&a)+(65535&ea),s=(65535&x)+(65535&b)+(65535&E)+(65535&n)+(65535&en)+((o=(A>>>16)+(S>>>16)+(I>>>16)+(a>>>16)+(ea>>>16)+(i>>>16))>>>16),b=(l=(x>>>16)+(b>>>16)+(E>>>16)+(n>>>16)+(en>>>16)+(s>>>16))<<16|65535&s,S=o<<16|65535&i,i=(65535&v)+(65535&r),s=(65535&w)+(65535&t)+((o=(v>>>16)+(r>>>16)+(i>>>16))>>>16),x=(l=(w>>>16)+(t>>>16)+(s>>>16))<<16|65535&s,A=o<<16|65535&i,i=(65535&X)+(65535&S),s=(65535&J)+(65535&b)+((o=(X>>>16)+(S>>>16)+(i>>>16))>>>16),en=(l=(J>>>16)+(b>>>16)+(s>>>16))<<16|65535&s,ea=o<<16|65535&i,i=(65535&A)+(65535&S),s=(65535&x)+(65535&b)+((o=(A>>>16)+(S>>>16)+(i>>>16))>>>16),t=((J=(l=(x>>>16)+(b>>>16)+(s>>>16))<<16|65535&s)>>>28|(X=o<<16|65535&i)<<4)^(X>>>2|J<<30)^(X>>>7|J<<25),r=(X>>>28|J<<4)^(J>>>2|X<<30)^(J>>>7|X<<25),n=(en>>>14|ea<<18)^(en>>>18|ea<<14)^(ea>>>9|en<<23),a=(ea>>>14|en<<18)^(ea>>>18|en<<14)^(en>>>9|ea<<23),p=J&q,h=X&z,w=p^J&K^c,v=h^X&G^u,E=en&Z^~en&Q,I=ea&Y^~ea&ee,b=j[e+2],S=j[e+3],x=f[e+2],i=(65535&(A=f[e+3]))+(65535&S)+(65535&I)+(65535&a)+(65535&er),s=(65535&x)+(65535&b)+(65535&E)+(65535&n)+(65535&et)+((o=(A>>>16)+(S>>>16)+(I>>>16)+(a>>>16)+(er>>>16)+(i>>>16))>>>16),b=(l=(x>>>16)+(b>>>16)+(E>>>16)+(n>>>16)+(et>>>16)+(s>>>16))<<16|65535&s,S=o<<16|65535&i,i=(65535&v)+(65535&r),s=(65535&w)+(65535&t)+((o=(v>>>16)+(r>>>16)+(i>>>16))>>>16),x=(l=(w>>>16)+(t>>>16)+(s>>>16))<<16|65535&s,A=o<<16|65535&i,i=(65535&W)+(65535&S),s=(65535&H)+(65535&b)+((o=(W>>>16)+(S>>>16)+(i>>>16))>>>16),et=(l=(H>>>16)+(b>>>16)+(s>>>16))<<16|65535&s,er=o<<16|65535&i,i=(65535&A)+(65535&S),s=(65535&x)+(65535&b)+((o=(A>>>16)+(S>>>16)+(i>>>16))>>>16),t=((H=(l=(x>>>16)+(b>>>16)+(s>>>16))<<16|65535&s)>>>28|(W=o<<16|65535&i)<<4)^(W>>>2|H<<30)^(W>>>7|H<<25),r=(W>>>28|H<<4)^(H>>>2|W<<30)^(H>>>7|W<<25),n=(et>>>14|er<<18)^(et>>>18|er<<14)^(er>>>9|et<<23),a=(er>>>14|et<<18)^(er>>>18|et<<14)^(et>>>9|er<<23),d=H&J,g=W&X,w=d^H&q^p,v=g^W&z^h,E=et&en^~et&Z,I=er&ea^~er&Y,b=j[e+4],S=j[e+5],x=f[e+4],i=(65535&(A=f[e+5]))+(65535&S)+(65535&I)+(65535&a)+(65535&ee),s=(65535&x)+(65535&b)+(65535&E)+(65535&n)+(65535&Q)+((o=(A>>>16)+(S>>>16)+(I>>>16)+(a>>>16)+(ee>>>16)+(i>>>16))>>>16),b=(l=(x>>>16)+(b>>>16)+(E>>>16)+(n>>>16)+(Q>>>16)+(s>>>16))<<16|65535&s,S=o<<16|65535&i,i=(65535&v)+(65535&r),s=(65535&w)+(65535&t)+((o=(v>>>16)+(r>>>16)+(i>>>16))>>>16),x=(l=(w>>>16)+(t>>>16)+(s>>>16))<<16|65535&s,A=o<<16|65535&i,i=(65535&G)+(65535&S),s=(65535&K)+(65535&b)+((o=(G>>>16)+(S>>>16)+(i>>>16))>>>16),Q=(l=(K>>>16)+(b>>>16)+(s>>>16))<<16|65535&s,ee=o<<16|65535&i,i=(65535&A)+(65535&S),s=(65535&x)+(65535&b)+((o=(A>>>16)+(S>>>16)+(i>>>16))>>>16),t=((K=(l=(x>>>16)+(b>>>16)+(s>>>16))<<16|65535&s)>>>28|(G=o<<16|65535&i)<<4)^(G>>>2|K<<30)^(G>>>7|K<<25),r=(G>>>28|K<<4)^(K>>>2|G<<30)^(K>>>7|G<<25),n=(Q>>>14|ee<<18)^(Q>>>18|ee<<14)^(ee>>>9|Q<<23),a=(ee>>>14|Q<<18)^(ee>>>18|Q<<14)^(Q>>>9|ee<<23),m=K&H,y=G&W,w=m^K&J^d,v=y^G&X^g,E=Q&et^~Q&en,I=ee&er^~ee&ea,b=j[e+6],S=j[e+7],x=f[e+6],i=(65535&(A=f[e+7]))+(65535&S)+(65535&I)+(65535&a)+(65535&Y),s=(65535&x)+(65535&b)+(65535&E)+(65535&n)+(65535&Z)+((o=(A>>>16)+(S>>>16)+(I>>>16)+(a>>>16)+(Y>>>16)+(i>>>16))>>>16),b=(l=(x>>>16)+(b>>>16)+(E>>>16)+(n>>>16)+(Z>>>16)+(s>>>16))<<16|65535&s,S=o<<16|65535&i,i=(65535&v)+(65535&r),s=(65535&w)+(65535&t)+((o=(v>>>16)+(r>>>16)+(i>>>16))>>>16),x=(l=(w>>>16)+(t>>>16)+(s>>>16))<<16|65535&s,A=o<<16|65535&i,i=(65535&z)+(65535&S),s=(65535&q)+(65535&b)+((o=(z>>>16)+(S>>>16)+(i>>>16))>>>16),Z=(l=(q>>>16)+(b>>>16)+(s>>>16))<<16|65535&s,Y=o<<16|65535&i,i=(65535&A)+(65535&S),s=(65535&x)+(65535&b)+((o=(A>>>16)+(S>>>16)+(i>>>16))>>>16),q=(l=(x>>>16)+(b>>>16)+(s>>>16))<<16|65535&s,z=o<<16|65535&i;i=(65535&k)+(65535&z),s=(65535&T)+(65535&q)+((o=(k>>>16)+(z>>>16)+(i>>>16))>>>16),l=(T>>>16)+(q>>>16)+(s>>>16),this.h0h=l<<16|65535&s,this.h0l=o<<16|65535&i,i=(65535&_)+(65535&G),s=(65535&C)+(65535&K)+((o=(_>>>16)+(G>>>16)+(i>>>16))>>>16),l=(C>>>16)+(K>>>16)+(s>>>16),this.h1h=l<<16|65535&s,this.h1l=o<<16|65535&i,i=(65535&B)+(65535&W),s=(65535&D)+(65535&H)+((o=(B>>>16)+(W>>>16)+(i>>>16))>>>16),l=(D>>>16)+(H>>>16)+(s>>>16),this.h2h=l<<16|65535&s,this.h2l=o<<16|65535&i,i=(65535&M)+(65535&X),s=(65535&P)+(65535&J)+((o=(M>>>16)+(X>>>16)+(i>>>16))>>>16),l=(P>>>16)+(J>>>16)+(s>>>16),this.h3h=l<<16|65535&s,this.h3l=o<<16|65535&i,i=(65535&R)+(65535&Y),s=(65535&N)+(65535&Z)+((o=(R>>>16)+(Y>>>16)+(i>>>16))>>>16),l=(N>>>16)+(Z>>>16)+(s>>>16),this.h4h=l<<16|65535&s,this.h4l=o<<16|65535&i,i=(65535&$)+(65535&ee),s=(65535&O)+(65535&Q)+((o=($>>>16)+(ee>>>16)+(i>>>16))>>>16),l=(O>>>16)+(Q>>>16)+(s>>>16),this.h5h=l<<16|65535&s,this.h5l=o<<16|65535&i,i=(65535&U)+(65535&er),s=(65535&L)+(65535&et)+((o=(U>>>16)+(er>>>16)+(i>>>16))>>>16),l=(L>>>16)+(et>>>16)+(s>>>16),this.h6h=l<<16|65535&s,this.h6l=o<<16|65535&i,i=(65535&F)+(65535&ea),s=(65535&V)+(65535&en)+((o=(F>>>16)+(ea>>>16)+(i>>>16))>>>16),l=(V>>>16)+(en>>>16)+(s>>>16),this.h7h=l<<16|65535&s,this.h7l=o<<16|65535&i},S.prototype.hex=function(){this.finalize();var e=this.h0h,t=this.h0l,r=this.h1h,n=this.h1l,a=this.h2h,i=this.h2l,o=this.h3h,s=this.h3l,l=this.h4h,c=this.h4l,u=this.h5h,h=this.h5l,d=this.h6h,f=this.h6l,g=this.h7h,m=this.h7l,y=this.bits,w=p[e>>28&15]+p[e>>24&15]+p[e>>20&15]+p[e>>16&15]+p[e>>12&15]+p[e>>8&15]+p[e>>4&15]+p[15&e]+p[t>>28&15]+p[t>>24&15]+p[t>>20&15]+p[t>>16&15]+p[t>>12&15]+p[t>>8&15]+p[t>>4&15]+p[15&t]+p[r>>28&15]+p[r>>24&15]+p[r>>20&15]+p[r>>16&15]+p[r>>12&15]+p[r>>8&15]+p[r>>4&15]+p[15&r]+p[n>>28&15]+p[n>>24&15]+p[n>>20&15]+p[n>>16&15]+p[n>>12&15]+p[n>>8&15]+p[n>>4&15]+p[15&n]+p[a>>28&15]+p[a>>
324&15]+p[a>>20&15]+p[a>>16&15]+p[a>>12&15]+p[a>>8&15]+p[a>>4&15]+p[15&a]+p[i>>28&15]+p[i>>24&15]+p[i>>20&15]+p[i>>16&15]+p[i>>12&15]+p[i>>8&15]+p[i>>4&15]+p[15&i]+p[o>>28&15]+p[o>>24&15]+p[o>>20&15]+p[o>>16&15]+p[o>>12&15]+p[o>>8&15]+p[o>>4&15]+p[15&o];return y>=256&&(w+=p[s>>28&15]+p[s>>24&15]+p[s>>20&15]+p[s>>16&15]+p[s>>12&15]+p[s>>8&15]+p[s>>4&15]+p[15&s]),y>=384&&(w+=p[l>>28&15]+p[l>>24&15]+p[l>>20&15]+p[l>>16&15]+p[l>>12&15]+p[l>>8&15]+p[l>>4&15]+p[15&l]+p[c>>28&15]+p[c>>24&15]+p[c>>20&15]+p[c>>16&15]+p[c>>12&15]+p[c>>8&15]+p[c>>4&15]+p[15&c]+p[u>>28&15]+p[u>>24&15]+p[u>>20&15]+p[u>>16&15]+p[u>>12&15]+p[u>>8&15]+p[u>>4&15]+p[15&u]+p[h>>28&15]+p[h>>24&15]+p[h>>20&15]+p[h>>16&15]+p[h>>12&15]+p[h>>8&15]+p[h>>4&15]+p[15&h]),512==y&&(w+=p[d>>28&15]+p[d>>24&15]+p[d>>20&15]+p[d>>16&15]+p[d>>12&15]+p[d>>8&15]+p[d>>4&15]+p[15&d]+p[f>>28&15]+p[f>>24&15]+p[f>>20&15]+p[f>>16&15]+p[f>>12&15]+p[f>>8&15]+p[f>>4&15]+p[15&f]+p[g>>28&15]+p[g>>24&15]+p[g>>20&15]+p[g>>16&15]+p[g>>12&15]+p[g>>8&15]+p[g>>4&15]+p[15&g]+p[m>>28&15]+p[m>>24&15]+p[m>>20&15]+p[m>>16&15]+p[m>>12&15]+p[m>>8&15]+p[m>>4&15]+p[15&m]),w},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var e=this.h0h,t=this.h0l,r=this.h1h,n=this.h1l,a=this.h2h,i=this.h2l,o=this.h3h,s=this.h3l,l=this.h4h,c=this.h4l,u=this.h5h,p=this.h5l,h=this.h6h,d=this.h6l,f=this.h7h,g=this.h7l,m=this.bits,y=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o];return m>=256&&y.push(s>>24&255,s>>16&255,s>>8&255,255&s),m>=384&&y.push(l>>24&255,l>>16&255,l>>8&255,255&l,c>>24&255,c>>16&255,c>>8&255,255&c,u>>24&255,u>>16&255,u>>8&255,255&u,p>>24&255,p>>16&255,p>>8&255,255&p),512==m&&y.push(h>>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d,f>>24&255,f>>16&255,f>>8&255,255&f,g>>24&255,g>>16&255,g>>8&255,255&g),y},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var e=this.bits,t=new ArrayBuffer(e/8),r=new DataView(t);return r.setUint32(0,this.h0h),r.setUint32(4,this.h0l),r.setUint32(8,this.h1h),r.setUint32(12,this.h1l),r.setUint32(16,this.h2h),r.setUint32(20,this.h2l),r.setUint32(24,this.h3h),e>=256&&r.setUint32(28,this.h3l),e>=384&&(r.setUint32(32,this.h4h),r.setUint32(36,this.h4l),r.setUint32(40,this.h5h),r.setUint32(44,this.h5l)),512==e&&(r.setUint32(48,this.h6h),r.setUint32(52,this.h6l),r.setUint32(56,this.h7h),r.setUint32(60,this.h7l)),t},S.prototype.clone=function(){var e=new S(this.bits,!1);return this.copyTo(e),e},S.prototype.copyTo=function(e){var t=0,r=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(t=0;t<r.length;++t)e[r[t]]=this[r[t]];for(t=0;t<this.blocks.length;++t)e.blocks[t]=this.blocks[t]},x.prototype=new S,x.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}},x.prototype.clone=function(){var e=new x([],this.bits,!1);this.copyTo(e),e.inner=this.inner;for(var t=0;t<this.oKeyPad.length;++t)e.oKeyPad[t]=this.oKeyPad[t];return e};var A=w(512);A.sha512=A,A.sha384=w(384),A.sha512_256=w(256),A.sha512_224=w(224),A.sha512.hmac=b(512),A.sha384.hmac=b(384),A.sha512_256.hmac=b(256),A.sha512_224.hmac=b(224),l?e.exports=A:(o.sha512=A.sha512,o.sha384=A.sha384,o.sha512_256=A.sha512_256,o.sha512_224=A.sha512_224,c&&(void 0===(n=(function(){return A}).call(A,r,A,e))||(e.exports=n)))}()},38305:(e,t,r)=>{var n=r(43080).stringify,a=r(93694);e.exports=function(e){return{parse:a(e),stringify:n}},e.exports.parse=a(),e.exports.stringify=n},41710:(e,t,r)=>{"use strict";let n;r.d(t,{Ay:()=>Z});var a=r(64527),i=r(96774),o=Object.prototype.hasOwnProperty;let s=new WeakMap,l=()=>{},c=l(),u=Object,p=e=>e===c,h=(e,t)=>({...e,...t}),d={},f={},g="undefined",m=typeof window!=g,y=typeof document!=g,w=m&&"Deno"in window,v=(e,t)=>
3{let r=s.get(e);return[()=>!p(t)&&e.get(t)||d,n=>{if(!p(t)){let a=e.get(t);t in f||(f[t]=a),r[5](t,h(a,n),a||d)}},r[6],()=>!p(t)&&t in f?f[t]:!p(t)&&e.get(t)||d]},b=!0,[S,x]=m&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[l,l],A={initFocus:e=>(y&&document.addEventListener("visibilitychange",e),S("focus",e),()=>{y&&document.removeEventListener("visibilitychange",e),x("focus",e)}),initReconnect:e=>{let t=()=>{b=!0,e()},r=()=>{b=!1};return S("online",t),S("offline",r),()=>{x("online",t),x("offline",r)}}},E=!a.useId,I=!m||w,T=I?a.useEffect:a.useLayoutEffect,k="undefined"!=typeof navigator&&navigator.connection,C=!I&&k&&(["slow-2g","2g"].includes(k.effectiveType)||k.saveData),_=new WeakMap,D=(e,t)=>e==="[object ".concat(t,"]"),B=0,P=e=>{let t,r,n=typeof e,a=u.prototype.toString.call(e),i=D(a,"Date"),o=D(a,"RegExp"),s=D(a,"Object");if(u(e)!==e||i||o)t=i?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=_.get(e))return t;if(t=++B+"~",_.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=P(e[r])+",";_.set(e,t)}if(s){t="#";let n=u.keys(e).sort();for(;!p(r=n.pop());)p(e[r])||(t+=r+":"+P(e[r])+",");_.set(e,t)}}return t},M=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?P(e):"",t]},N=0,R=()=>++N;async function O(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,a,i,o]=t,l=h({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{}),u=l.populateCache,d=l.rollbackOnError,f=l.optimisticData,g=l.throwOnError;if("function"==typeof a){let e=[];for(let t of n.keys())!/^\$(inf|sub)\$/.test(t)&&a(n.get(t)._k)&&e.push(t);return Promise.all(e.map(m))}return m(a);async function m(e){let r,[a]=M(e);if(!a)return;let[o,h]=v(n,a),[m,y,w,b]=s.get(n),S=()=>{let t=m[a];return("function"==typeof l.revalidate?l.revalidate(o().data,e):!1!==l.revalidate)&&(delete w[a],delete b[a],t&&t[0])?t[0](2).then(()=>o().data):o().data};if(t.length<3)return S();let x=i,A=!1,E=R();y[a]=[E,0];let I=!p(f),T=o(),k=T.data,C=T._c,_=p(C)?k:C;if(I&&h({data:f="function"==typeof f?f(_,k):f,_c:_}),"function"==typeof x)try{x=x(_)}catch(e){r=e,A=!0}if(x&&"function"==typeof x.then){let e;if(x=await x.catch(e=>{r=e,A=!0}),E!==y[a][0]){if(A)throw r;return x}A&&I&&(e=r,"function"==typeof d?d(e):!1!==d)&&(u=!0,h({data:_,_c:c}))}if(u&&!A&&("function"==typeof u?h({data:u(x,_),error:c,_c:c}):h({data:x,error:c,_c:c})),y[a][1]=R(),Promise.resolve(S()).then(()=>{h({_c:c})}),A){if(g)throw r;return}return x}}let $=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},L=(e,t)=>{if(!s.has(e)){let r=h(A,t),n=Object.create(null),a=O.bind(c,e),i=l,o=Object.create(null),u=(e,t)=>{let r=o[e]||[];return o[e]=r,r.push(t),()=>r.splice(r.indexOf(t),1)},p=(t,r,n)=>{e.set(t,r);let a=o[t];if(a)for(let e of a)e(r,n)},d=()=>{if(!s.has(e)&&(s.set(e,[n,Object.create(null),Object.create(null),Object.create(null),a,p,u]),!I)){let t=r.initFocus(setTimeout.bind(c,$.bind(c,n,0))),a=r.initReconnect(setTimeout.bind(c,$.bind(c,n,1)));i=()=>{t&&t(),a&&a(),s.delete(e)}}};return d(),[e,a,d,i]}return[e,s.get(e)[4]]},[U,V]=L(new Map),F=h({onLoadingSlow:l,onSuccess:l,onError:l,onErrorRetry:(e,t,r,n,a)=>{let i=r.errorRetryCount,o=a.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;(p(i)||!(o>i))&&setTimeout(n,s,a)},onDiscarded:l,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:C?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:C?5e3:3e3,compare:function e(t,r){var n,a;if(t===r)return!0;if(t&&r&&(n=t.constructor)===r.constructor){if(n===Date)return t.getTime()===r.getTime();if(n===RegExp)return t.toString()===r.toString();if(n===Array){if((a=t.length)===r.length)for(;a--&&e(t[a],r[a]););return -1===a}if(!n||"object"==typeof t){for(n in a=0,t)if(o.call(t,n)&&++a&&!o.call(r,n)||!(n in r)||!e(t[n],r[n]))return!1;return Object.keys(r).length===a}}return t!=t&&r!=r},isPaused:()=>!1,cache:U,mutate:V,fallback:{}},{isOnline:()=>b,isVisible:()=>{let e=y&&document.visibilityState;
3return p(e)||"hidden"!==e}}),j=(e,t)=>{let r=h(e,t);if(t){let{use:n,fallback:a}=e,{use:i,fallback:o}=t;n&&i&&(r.use=n.concat(i)),a&&o&&(r.fallback=h(a,o))}return r},q=(0,a.createContext)({}),z=m&&window.__SWR_DEVTOOLS_USE__,K=(z?window.__SWR_DEVTOOLS_USE__:[]).concat(e=>(t,r,n)=>{let a=r&&((...e)=>{let[n]=M(t),[,,,a]=s.get(U);if(n.startsWith("$inf$"))return r(...e);let i=a[n];return p(i)?r(...e):(delete a[n],i)});return e(t,a,n)});z&&(window.__SWR_DEVTOOLS_REACT__=a);let G=()=>{},H=G();new WeakMap;let W=a.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),J={dedupe:!0},X=Promise.resolve(c);u.defineProperty(e=>{let{value:t}=e,r=(0,a.useContext)(q),n="function"==typeof t,i=(0,a.useMemo)(()=>n?t(r):t,[n,r,t]),o=(0,a.useMemo)(()=>n?i:j(r,i),[n,r,i]),s=i&&i.provider,l=(0,a.useRef)(c);s&&!l.current&&(l.current=L(s(o.cache||U),i));let u=l.current;return u&&(o.cache=u[0],o.mutate=u[1]),T(()=>{if(u)return u[2]&&u[2](),u[3]},[]),(0,a.createElement)(q.Provider,h(e,{value:o}))},"defaultValue",{value:F});let Z=(n=(e,t,r)=>{let{cache:n,compare:o,suspense:l,fallbackData:u,revalidateOnMount:d,revalidateIfStale:f,refreshInterval:y,refreshWhenHidden:w,refreshWhenOffline:b,keepPreviousData:S}=r,[x,A,k,C]=s.get(n),[_,D]=M(e),B=(0,a.useRef)(!1),P=(0,a.useRef)(!1),N=(0,a.useRef)(_),$=(0,a.useRef)(t),L=(0,a.useRef)(r),U=()=>L.current.isVisible()&&L.current.isOnline(),[V,F,j,q]=v(n,_),z=(0,a.useRef)({}).current,K=p(u)?p(r.fallback)?c:r.fallback[_]:u,G=(e,t)=>{for(let r in z)if("data"===r){if(!o(e[r],t[r])&&(!p(e[r])||!o(ea,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},H=(0,a.useMemo)(()=>{let e=!!_&&!!t&&(p(d)?!L.current.isPaused()&&!l&&!1!==f:d),r=t=>{let r=h(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=V(),a=q(),i=r(n),o=n===a?i:r(a),s=i;return[()=>{let e=r(V());return G(e,s)?(s.data=e.data,s.isLoading=e.isLoading,s.isValidating=e.isValidating,s.error=e.error,s):(s=e,e)},()=>o]},[n,_]),Z=(0,i.useSyncExternalStore)((0,a.useCallback)(e=>j(_,(t,r)=>{G(r,t)||e()}),[n,_]),H[0],H[1]),Y=!B.current,Q=x[_]&&x[_].length>0,ee=Z.data,et=p(ee)?K&&"function"==typeof K.then?W(K):K:ee,er=Z.error,en=(0,a.useRef)(et),ea=S?p(ee)?p(en.current)?et:en.current:ee:et,ei=(!Q||!!p(er))&&(Y&&!p(d)?d:!L.current.isPaused()&&(l?!p(et)&&f:p(et)||f)),eo=!!(_&&t&&Y&&ei),es=p(Z.isValidating)?eo:Z.isValidating,el=p(Z.isLoading)?eo:Z.isLoading,ec=(0,a.useCallback)(async e=>{let t,n,a=$.current;if(!_||!a||P.current||L.current.isPaused())return!1;let i=!0,s=e||{},l=!k[_]||!s.dedupe,u=()=>E?!P.current&&_===N.current&&B.current:_===N.current,h={isValidating:!1,isLoading:!1},d=()=>{F(h)},f=()=>{let e=k[_];e&&e[1]===n&&delete k[_]},g={isValidating:!0};p(V().data)&&(g.isLoading=!0);try{if(l&&(F(g),r.loadingTimeout&&p(V().data)&&setTimeout(()=>{i&&u()&&L.current.onLoadingSlow(_,r)},r.loadingTimeout),k[_]=[a(D),R()]),[t,n]=k[_],t=await t,l&&setTimeout(f,r.dedupingInterval),!k[_]||k[_][1]!==n)return l&&u()&&L.current.onDiscarded(_),!1;h.error=c;let e=A[_];if(!p(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return d(),l&&u()&&L.current.onDiscarded(_),!1;let s=V().data;h.data=o(s,t)?s:t,l&&u()&&L.current.onSuccess(t,_,r)}catch(r){f();let e=L.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(h.error=r,l&&u())&&(e.onError(r,_,e),(!0===t||"function"==typeof t&&t(r))&&(!L.current.revalidateOnFocus||!L.current.revalidateOnReconnect||U())&&e.onErrorRetry(r,_,e,e=>{let t=x[_];t&&t[0]&&t[0](3,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0}))}return i=!1,d(),!0},[_,n]),eu=(0,a.useCallback)((...e)=>O(n,N.current,...e),[]);if(T(()=>{$.current=t,L.current=r,p(ee)||(en.current=ee)}),T(()=>{if(!_)return;let e=ec.bind(c,J),t=0;L.current.revalidateOnFocus&&(t=Date.now()+L.current.focusThrottleInterval);let r=((e,t,r)=>{let n=t[e]||(t[e]=[]);return n.push(r),()=>{let e=n.indexOf(r);e>=0&&(n[e]=n[n.length-1],n.pop())}})(_,x,(r,n={})=>{if(0==r){let r=Date.now();L.current.revalidateOnFocus&&r>t&&U()&&(t=r+L.current.focusThrottleInterval,e())}else if(1==r)L.current.revalidateOnReconnect&&U()&&e();else if(2==r)return ec();else if(3==r)return ec(n)});return P.current=!1,N.current=_,B.current=!0,F({_k:D}),ei&&!k[_]&&(p(et)||I?e():(e=>m&&typeof window.requestAnimationFrame!=g?window.requestAnimationFrame(e):setTimeout(e,1))(e)),()=>{P.current=!0,r()}},[_]),T(()=>{let e;function t(){let t="function"==typeof y?y(V().data):y;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!V().error&&(w||L.current.isVisible())&&(b||L.current.isOnline())?ec(J).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[y,w,b,_]),(0,a.useDebugValue)(ea),l){let e=_&&p(et);if(!E&&I&&e)throw Error("Fallback data is required when using Suspense in SSR.");e&&($.current=t,L.current=r,P.current=!1);let n=C[_];if(W(!p(n)&&e?eu(n):X),!p(er)&&e)throw er;let a=e?ec(J):X;!p(ea)&&e&&(a.status="fulfilled",a.value=!0),W(a)}return{mutate:eu,get data(){return z.data=!0,ea},get error(){return z.error=!0,er},get isValidating(){return z.isValidating=!0,es},get isLoading(){return z.isLoading=!0,el}}},function(...e){let t=(()=>{let e=(0,a.useContext)(q);return(0,a.useMemo)(()=>h(F,e),[e])})(),[r,i,o]="function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],s=j(t,o),l=n,{use:c}=s,u=(c||[]).concat(K);for(let e=u.length;e--;)l=u[e](l);return l(r,i||s.fetcher||null,s)})},43080:(e,t,r)=>{var n=r(9006),a=e.exports;!function(){"use strict";var e,t,r,i=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return i.lastIndex=0,i.test(e)?'"'+e.replace(i,function(e){var t=o[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}"function"!=typeof a.stringify&&(a.stringify=function(a,i,o){var l;if(e="",t="","number"==typeof o)for(l=0;l<o;l+=1)t+=" ";else"string"==typeof o&&(t=o);if(r=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw Error("JSON.stringify");return function a(i,o){var l,c,u,p,h,d=e,f=o[i],g=null!=f&&(f instanceof n||n.isBigNumber(f));switch(f&&"object"==typeof f&&"function"==typeof f.toJSON&&(f=f.toJSON(i)),"function"==typeof r&&(f=r.call(o,i,f)),typeof f){case"string":if(g)return f;return s(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":case"bigint":return String(f);case"object":if(!f)return"null";if(e+=t,h=[],"[object Array]"===Object.prototype.toString.apply(f)){for(l=0,p=f.length;l<p;l+=1)h[l]=a(l,f)||"null";return u=0===h.length?"[]":e?"[\n"+e+h.join(",\n"+e)+"\n"+d+"]":"["+h.join(",")+"]",e=d,u}if(r&&"object"==typeof r)for(l=0,p=r.length;l<p;l+=1)"string"==typeof r[l]&&(u=a(c=r[l],f))&&h.push(s(c)+(e?": ":":")+u);else Object.keys(f).forEach(function(t){var r=a(t,f);r&&h.push(s(t)+(e?": ":":")+r)});return u=0===h.length?"{}":e?"{\n"+e+h.join(",\n"+e)+"\n"+d+"}":"{"+h.join(",")+"}",e=d,u}}("",{"":a})})}()},43728:(e,t,r)=>{"use strict";r.d(t,{DT:()=>p,JT:()=>d,cF:()=>g,iI:()=>h});var n=r(79142),a=r(93266),i=r(91323),o=r(70377),s=r(54724),l=r(63790),c=r(30905),u=n.Ay$.ABIMethod;async function p(e,t,r,n,u,p,h){let d=new o.r(e),f=()=>new l.R({algod:e,getSigner:()=>(0,c.S_)(t),getSuggestedParams:async()=>h?{...h}:await e.getTransactionParams().do(),appManager:d}),g=new i.f(f,new s.E(e,f),d),m=new a.I(f);if(r.fee&&(n.staticFee=r.fee),r.maxFee&&(n.maxFee=r.maxFee),r.atc||r.skipSending){let e=await u(m)(n),a="transactions"in e?e.transactions:[e];if(r.atc){let n=r.atc.count();a.map((r,n)=>({txn:r,signer:"signers"in e?e.signers.get(n)??(0,c.S_)(t):(0,c.S_)(t)}
3)).forEach(e=>r.atc.addTransaction(e)),"transactions"in e&&e.methodCalls.forEach((e,t)=>r.atc.methodCalls.set(t+n,e))}return{transaction:a.at(-1),transactions:a}}return{...await p(g)({...r,...n})}}async function h(e,t,r,a,i,o,s,l){let u=new TextEncoder,h={...i,accountReferences:r?.accounts?.map(e=>"string"==typeof e?e:n.Ay$.encodeAddress(e.publicKey)),appReferences:r?.apps?.map(e=>BigInt(e)),assetReferences:r?.assets?.map(e=>BigInt(e)),boxReferences:r?.boxes?.map(g)?.map(e=>({appId:BigInt(e.appIndex),name:e.name})),lease:r?.lease,rekeyTo:r?.rekeyTo?(0,c.sE)(r?.rekeyTo):void 0,args:r?"methodArgs"in r?(await d(r,t)).methodArgs:r?.appArgs?.map(e=>"string"==typeof e?u.encode(e):e):void 0,note:(0,c.HR)(a?.note)};return await p(e,t,a,h,o,s,l)}async function d(e,t){let r=(0,c.S_)(t),n=await Promise.all(("methodArgs"in e?e.methodArgs:e)?.map(async(e,t)=>{if(void 0===e)throw Error(`Argument at position ${t} does not have a value`);return"object"!=typeof e||"txn"in e?e:e instanceof Promise?{txn:(await e).transaction,signer:r}:"transaction"in e?{txn:e.transaction,signer:"signer"in e?(0,c.S_)(e.signer):r}:"txID"in e?{txn:e,signer:r}:e}));return{method:"txnCount"in e.method?e.method:new u(e.method),sender:(0,c.sE)(t),signer:r,boxes:e.boxes?.map(g),lease:(0,c.jS)(e.lease),appForeignApps:e.apps,appForeignAssets:e.assets,appAccounts:e.accounts?.map(f),methodArgs:n,rekeyTo:e?.rekeyTo?"string"==typeof e.rekeyTo?e.rekeyTo:(0,c.sE)(e.rekeyTo):void 0}}function f(e){return"string"==typeof e?e:n.Ay$.encodeAddress(e.publicKey)}function g(e){let t=new TextEncoder;if("object"==typeof e&&"appIndex"in e)return e;let r="object"==typeof e&&"appId"in e?e:{appId:0,name:e};return{appIndex:r.appId,name:"string"==typeof r.name?t.encode(r.name):"length"in r.name?r.name:n.Ay$.decodeAddress((0,c.sE)(r.name)).publicKey}}},43795:(e,t,r)=>{var n,a=r(99267);!function(){"use strict";var t="object"==typeof window?window:{};!t.HI_BASE32_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node&&(t=r.g);var i=!t.HI_BASE32_NO_COMMON_JS&&e.exports,o=r.amdO,s="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),l={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},c=[0,0,0,0,0,0,0,0],u=function(e,t){t.length>10&&(t="..."+t.substr(-10));var r=Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+e+" bytes: "+t+" <-");throw r.position=e,r},p=function(e){for(var t,r,n="",a=e.length,i=0,o=0;i<a;){if((t=e[i++])<=127){n+=String.fromCharCode(t);continue}t>191&&t<=223?(r=31&t,o=1):t<=239?(r=15&t,o=2):t<=247?(r=7&t,o=3):u(i,n);for(var s=0;s<o;++s)((t=e[i++])<128||t>191)&&u(i,n),r<<=6,r+=63&t;r>=55296&&r<=57343&&u(i,n),r>1114111&&u(i,n),r<=65535?n+=String.fromCharCode(r):(r-=65536,n+=String.fromCharCode((r>>10)+55296),n+=String.fromCharCode((1023&r)+56320))}return n},h=function(e){if(""===e)return[];if(!/^[A-Z2-7=]+$/.test(e))throw Error("Invalid base32 characters");e=e.replace(/=/g,"");for(var t,r,n,a,i,o,s,c,u=[],p=0,h=e.length,d=0,f=h>>3<<3;d<f;)t=l[e.charAt(d++)],r=l[e.charAt(d++)],n=l[e.charAt(d++)],a=l[e.charAt(d++)],i=l[e.charAt(d++)],o=l[e.charAt(d++)],s=l[e.charAt(d++)],c=l[e.charAt(d++)],u[p++]=(t<<3|r>>>2)&255,u[p++]=(r<<6|n<<1|a>>>4)&255,u[p++]=(a<<4|i>>>1)&255,u[p++]=(i<<7|o<<2|s>>>3)&255,u[p++]=(s<<5|c)&255;var g=h-f;return 2===g?(t=l[e.charAt(d++)],r=l[e.charAt(d++)],u[p++]=(t<<3|r>>>2)&255):4===g?(t=l[e.charAt(d++)],r=l[e.charAt(d++)],n=l[e.charAt(d++)],a=l[e.charAt(d++)],u[p++]=(t<<3|r>>>2)&255,u[p++]=(r<<6|n<<1|a>>>4)&255):5===g?(t=l[e.charAt(d++)],r=l[e.charAt(d++)],n=l[e.charAt(d++)],a=l[e.charAt(d++)],i=l[e.charAt(d++)],u[p++]=(t<<3|r>>>2)&255,u[p++]=(r<<6|n<<1|a>>>4)&255,u[p++]=(a<<4|i>>>1)&255):7===g&&(t=l[e.charAt(d++)],r=l[e.charAt(d++)],n=l[e.charAt(d++)],a=l[e.charAt(d++)],i=l[e.charAt(d++)],o=l[e.charAt(d++)],s=l[e.charAt(d++)],u[p++]=(t<<3|r>>>2)&255,u[p++]=(r<<6|n<<1|a>>>4)&255,u[p++]=(a<<4|i>>>1)&255,u[p++]=(i<<7|o<<2|s>>>3)&255),u},d=function(e){for(var t,r,n,a,i,o="",l=e.length,c=0,u=5*parseInt(l/5);c<u;)t=e.charCodeAt(c++),r=e.charCodeAt(c++),n=e.charCodeAt(c++),a=e.charCodeAt(c++),i=e.charCodeAt(c++),o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|n>>>4)&31]+s[(n<<1|a>>>7)&31]+s[a>>>2&31]+s[(a<<3|i>>>5)&31]+s[31&i];var p=l-u;return 1===p?o+=s[(t=e.charCodeAt(c))>>>3]+s[t<<2&31]+"======":2===p?(t=e.charCodeAt(c++),r=e.charCodeAt(c),o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[r<<4&31]+"===="):3===p?(t=e.charCodeAt(c++),r=e.charCodeAt(c++),n=e.charCodeAt(c),o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|n>>>
34)&31]+s[n<<1&31]+"==="):4===p&&(t=e.charCodeAt(c++),r=e.charCodeAt(c++),n=e.charCodeAt(c++),a=e.charCodeAt(c),o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|n>>>4)&31]+s[(n<<1|a>>>7)&31]+s[a>>>2&31]+s[a<<3&31]+"="),o},f=function(e){var t,r,n,a,i,o,l,u=!1,p="",h=0,d=0,f=e.length;if(""===e)return p;do{for(c[0]=c[5],c[1]=c[6],c[2]=c[7],l=d;h<f&&l<5;++h)(o=e.charCodeAt(h))<128?c[l++]=o:(o<2048?c[l++]=192|o>>6:(o<55296||o>=57344?c[l++]=224|o>>12:(o=65536+((1023&o)<<10|1023&e.charCodeAt(++h)),c[l++]=240|o>>18,c[l++]=128|o>>12&63),c[l++]=128|o>>6&63),c[l++]=128|63&o);d=l-5,h===f&&++h,h>f&&l<6&&(u=!0),t=c[0],l>4?(r=c[1],n=c[2],a=c[3],i=c[4],p+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|n>>>4)&31]+s[(n<<1|a>>>7)&31]+s[a>>>2&31]+s[(a<<3|i>>>5)&31]+s[31&i]):1===l?p+=s[t>>>3]+s[t<<2&31]+"======":2===l?(r=c[1],p+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[r<<4&31]+"===="):3===l?(r=c[1],n=c[2],p+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|n>>>4)&31]+s[n<<1&31]+"==="):(r=c[1],n=c[2],a=c[3],p+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|n>>>4)&31]+s[(n<<1|a>>>7)&31]+s[a>>>2&31]+s[a<<3&31]+"=")}while(!u);return p},g=function(e){for(var t,r,n,a,i,o="",l=e.length,c=0,u=5*parseInt(l/5);c<u;)t=e[c++],r=e[c++],n=e[c++],a=e[c++],i=e[c++],o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|n>>>4)&31]+s[(n<<1|a>>>7)&31]+s[a>>>2&31]+s[(a<<3|i>>>5)&31]+s[31&i];var p=l-u;return 1===p?o+=s[(t=e[c])>>>3]+s[t<<2&31]+"======":2===p?(t=e[c++],r=e[c],o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[r<<4&31]+"===="):3===p?(t=e[c++],r=e[c++],n=e[c],o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|n>>>4)&31]+s[n<<1&31]+"==="):4===p&&(t=e[c++],r=e[c++],n=e[c++],a=e[c],o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|n>>>4)&31]+s[(n<<1|a>>>7)&31]+s[a>>>2&31]+s[a<<3&31]+"="),o},m=function(e,t){if(!t)return p(h(e));if(""===e)return"";if(!/^[A-Z2-7=]+$/.test(e))throw Error("Invalid base32 characters");var r,n,a,i,o,s,c,u,d="",f=e.indexOf("=");-1===f&&(f=e.length);for(var g=0,m=f>>3<<3;g<m;)r=l[e.charAt(g++)],n=l[e.charAt(g++)],a=l[e.charAt(g++)],i=l[e.charAt(g++)],o=l[e.charAt(g++)],s=l[e.charAt(g++)],c=l[e.charAt(g++)],u=l[e.charAt(g++)],d+=String.fromCharCode((r<<3|n>>>2)&255)+String.fromCharCode((n<<6|a<<1|i>>>4)&255)+String.fromCharCode((i<<4|o>>>1)&255)+String.fromCharCode((o<<7|s<<2|c>>>3)&255)+String.fromCharCode((c<<5|u)&255);var y=f-m;return 2===y?d+=String.fromCharCode(((r=l[e.charAt(g++)])<<3|(n=l[e.charAt(g++)])>>>2)&255):4===y?(r=l[e.charAt(g++)],n=l[e.charAt(g++)],a=l[e.charAt(g++)],i=l[e.charAt(g++)],d+=String.fromCharCode((r<<3|n>>>2)&255)+String.fromCharCode((n<<6|a<<1|i>>>4)&255)):5===y?(r=l[e.charAt(g++)],n=l[e.charAt(g++)],a=l[e.charAt(g++)],i=l[e.charAt(g++)],o=l[e.charAt(g++)],d+=String.fromCharCode((r<<3|n>>>2)&255)+String.fromCharCode((n<<6|a<<1|i>>>4)&255)+String.fromCharCode((i<<4|o>>>1)&255)):7===y&&(r=l[e.charAt(g++)],n=l[e.charAt(g++)],a=l[e.charAt(g++)],i=l[e.charAt(g++)],o=l[e.charAt(g++)],s=l[e.charAt(g++)],c=l[e.charAt(g++)],d+=String.fromCharCode((r<<3|n>>>2)&255)+String.fromCharCode((n<<6|a<<1|i>>>4)&255)+String.fromCharCode((i<<4|o>>>1)&255)+String.fromCharCode((o<<7|s<<2|c>>>3)&255)),d},y={encode:function(e,t){var r="string"!=typeof e;return(r&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),r)?g(e):t?d(e):f(e)},decode:m};m.asBytes=h,i?e.exports=y:(t.base32=y,o&&(void 0===(n=(function(){return y}).call(y,r,y,e))||(e.exports=n)))}()},44735:(e,t,r)=>{"use strict";r.d(t,{Bn:()=>u,DT:()=>a,Nf:()=>c,O3:()=>l,Ps:()=>d,YS:()=>s,gN:()=>p,nL:()=>o,ol:()=>h,yb:()=>i});var n=r(12929);class a{constructor(e){this.hashType=e.hashType}getEncodingSchema(){return a.encodingSchema}toEncodingData(){return new Map([["t",this.hashType]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded HashFactory: ${e}`);return new a({hashType:Number(e.get("t"))})}}a.encodingSchema=new n.pZ((0,n.co)([{key:"t",valueSchema:new n.qc}]));class i{constructor(e){this.path=e.path,this.hashFactory=e.hashFactory,this.treeDepth=e.treeDepth}getEncodingSchema(){return i.encodingSchema}toEncodingData(){return new Map([["pth",this.path],["hsh",this.hashFactory.toEncodingData()],["td",this.treeDepth]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded MerkleArrayProof: ${e}`);return new i({path:e.get("pth"),hashFactory:a.fromEncodingData(e.get("hsh")),treeDepth:Number(e.get("td"))})}}i.encodingSchema=new n.pZ((0,n.co)([{key:"pth",valueSchema:new n.vf(new n.HM)},{key:"hsh",valueSchema:a.encodingSchema},{key:"td",valueSchema:new n.qc}]));class o{constructor(e){this.commitment=e.commitment,this.keyLifetime=e.keyLifetime}getEncodingSchema(){return o.encodingSchema}toEncodingData(){return new Map([["cmt",this.commitment],["lf",this.keyLifetime]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded MerkleSignatureVerifier: ${e}`);return new o({commitment:e.get("cmt"),keyLifetime:e.get("lf")})}}o.encodingSchema=new n.pZ((0,n.co)([{key:"cmt",valueSchema:new n.lb(64)}
3,{key:"lf",valueSchema:new n.qc}]));class s{constructor(e){this.pk=e.pk,this.weight=e.weight}getEncodingSchema(){return s.encodingSchema}toEncodingData(){return new Map([["p",this.pk.toEncodingData()],["w",this.weight]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded Participant: ${e}`);return new s({pk:o.fromEncodingData(e.get("p")),weight:e.get("w")})}}s.encodingSchema=new n.pZ((0,n.co)([{key:"p",valueSchema:o.encodingSchema},{key:"w",valueSchema:new n.qc}]));class l{constructor(e){this.publicKey=e.publicKey}getEncodingSchema(){return l.encodingSchema}toEncodingData(){return new Map([["k",this.publicKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded FalconVerifier: ${e}`);return new l({publicKey:e.get("k")})}}l.encodingSchema=new n.pZ((0,n.co)([{key:"k",valueSchema:new n.lb(1793)}]));class c{constructor(e){this.signature=e.signature,this.vectorCommitmentIndex=e.index,this.proof=e.proof,this.verifyingKey=e.verifyingKey}getEncodingSchema(){return c.encodingSchema}toEncodingData(){return new Map([["sig",this.signature],["idx",this.vectorCommitmentIndex],["prf",this.proof.toEncodingData()],["vkey",this.verifyingKey.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded FalconSignatureStruct: ${e}`);return new c({signature:e.get("sig"),index:e.get("idx"),proof:i.fromEncodingData(e.get("prf")),verifyingKey:l.fromEncodingData(e.get("vkey"))})}}c.encodingSchema=new n.pZ((0,n.co)([{key:"sig",valueSchema:new n.HM},{key:"idx",valueSchema:new n.qc},{key:"prf",valueSchema:i.encodingSchema},{key:"vkey",valueSchema:l.encodingSchema}]));class u{constructor(e){this.sig=e.sig,this.l=e.l}getEncodingSchema(){return u.encodingSchema}toEncodingData(){return new Map([["s",this.sig.toEncodingData()],["l",this.l]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded SigslotCommit: ${e}`);return new u({sig:c.fromEncodingData(e.get("s")),l:e.get("l")})}}u.encodingSchema=new n.pZ((0,n.co)([{key:"s",valueSchema:c.encodingSchema},{key:"l",valueSchema:new n.qc}]));class p{constructor(e){this.sigslot=e.sigslot,this.participant=e.participant}getEncodingSchema(){return p.encodingSchema}toEncodingData(){return new Map([["s",this.sigslot.toEncodingData()],["p",this.participant.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded Reveal: ${e}`);return new p({sigslot:u.fromEncodingData(e.get("s")),participant:s.fromEncodingData(e.get("p"))})}}p.encodingSchema=new n.pZ((0,n.co)([{key:"s",valueSchema:u.encodingSchema},{key:"p",valueSchema:s.encodingSchema}]));class h{constructor(e){this.sigCommit=e.sigCommit,this.signedWeight=e.signedWeight,this.sigProofs=e.sigProofs,this.partProofs=e.partProofs,this.merkleSignatureSaltVersion=e.merkleSignatureSaltVersion,this.reveals=e.reveals,this.positionsToReveal=e.positionsToReveal}getEncodingSchema(){return h.encodingSchema}toEncodingData(){return new Map([["c",this.sigCommit],["w",this.signedWeight],["S",this.sigProofs.toEncodingData()],["P",this.partProofs.toEncodingData()],["v",this.merkleSignatureSaltVersion],["r",(0,n.sm)(this.reveals,(e,t)=>[e,t.toEncodingData()])],["pr",this.positionsToReveal]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded StateProof: ${e}`);return new h({sigCommit:e.get("c"),signedWeight:e.get("w"),sigProofs:i.fromEncodingData(e.get("S")),partProofs:i.fromEncodingData(e.get("P")),merkleSignatureSaltVersion:Number(e.get("v")),reveals:(0,n.sm)(e.get("r"),(e,t)=>[e,p.fromEncodingData(t)]),positionsToReveal:e.get("pr")})}}h.encodingSchema=new n.pZ((0,n.co)([{key:"c",valueSchema:new n.HM},{key:"w",valueSchema:new n.qc},{key:"S",valueSchema:i.encodingSchema},{key:"P",valueSchema:i.encodingSchema},{key:"v",valueSchema:new n.qc},{key:"r",valueSchema:new n.ac(p.encodingSchema)},{key:"pr",valueSchema:new n.vf(new n.qc)}]));class d{constructor(e){this.blockHeadersCommitment=e.blockHeadersCommitment,this.votersCommitment=e.votersCommitment,this.lnProvenWeight=e.lnProvenWeight,this.firstAttestedRound=e.firstAttestedRound,this.lastAttestedRound=e.lastAttestedRound}getEncodingSchema(){return d.encodingSchema}toEncodingData(){return new Map([["b",this.blockHeadersCommitment],["v",this.votersCommitment],["P",this.lnProvenWeight],["f",this.firstAttestedRound],["l",this.lastAttestedRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded StateProofMessage: ${e}`);return new d({blockHeadersCommitment:e.get("b"),votersCommitment:e.get("v"),lnProvenWeight:e.get("P"),firstAttestedRound:e.get("f"),lastAttestedRound:e.get("l")})}static fromMap(e){return new d({blockHeadersCommitment:e.get("b"),votersCommitment:e.get("v"),lnProvenWeight:e.get("P"),firstAttestedRound:e.get("f"),lastAttestedRound:e.get("l")})}}d.encodingSchema=new n.pZ((0,n.co)([{key:"b",valueSchema:new n.HM},{key:"v",valueSchema:new n.HM},{key:"P",valueSchema:new n.qc},{key:"f",valueSchema:new n.qc},{key:"l",valueSchema:new n.qc}]))},46085:(e,t,r)=>{"use strict";r.d(t,{Bw:()=>m,Fo:()=>f,GE:()=>d,Ll:()=>p,Ol:()=>s,af:()=>c,e4:()=>l,lV:()=>h,wx:()=>g,zI:()=>u});var n=r(38305),a=r(73716),i=r(99267);let o=n({useNativeBigInt:!0,strict:!0});function s(e,{intDecoding:t}){if(t!==a.A.SAFE&&t!==a.A.UNSAFE&&t!==a.A.BIGINT&&t!==a.A.MIXED)throw Error(`Invalid intDecoding option: ${t}`);return o.parse(e,(e,r)=>{if(null!=r&&"object"==typeof r&&null==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,Object.prototype),"bigint"==typeof r){if(t===a.A.SAFE&&r>Number.MAX_SAFE_INTEGER)throw Error(`Integer exceeds maximum safe integer: ${r.toString()}. Try parsing with a different intDecoding option.`);return t===a.A.BIGINT||t===a.A.MIXED&&r>Number.MAX_SAFE_INTEGER?r:Number(r)}return"number"==typeof r&&t===a.A.BIGINT&&Number.isInteger(r)?BigInt(r):r})}function l(e,t,r){return o.stringify(e,t,r)}function c(e,t){return e.length===t.length&&Array.from(e).every((e,r)=>e===t[r])}function u(...e){let t=new Uint8Array(e.reduce((e,t)=>
3e+t.length,0)),r=0;for(let n=0;n<e.length;n++)t.set(e[n],r),r+=e[n].length;return t}function p(){return"object"==typeof i&&"object"==typeof i.versions&&void 0!==i.versions.node}function h(){let{navigator:e}=globalThis;return"object"==typeof e&&"ReactNative"===e.product}function d(e){if(void 0===e)throw Error("Value is undefined");if("bigint"==typeof e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e<BigInt(Number.MIN_SAFE_INTEGER))throw Error(`BigInt value ${e} is not a safe integer`);return Number(e)}if("number"==typeof e){if(Number.isSafeInteger(e))return e;throw Error(`Value ${e} is not a safe integer`)}throw Error(`Unexpected type ${typeof e}, ${e}`)}function f(e){let t=d(e);if(t<0)throw Error(`Value ${t} is negative`);return t}function g(e){if(void 0===e)throw Error("Value is undefined");if("bigint"==typeof e)return e;if("number"==typeof e){if(!Number.isSafeInteger(e))throw Error(`Value ${e} is not a safe integer`);return BigInt(e)}throw Error(`Unexpected type ${typeof e}, ${e}`)}function m(e){let t=g(e);if(t<0||t>BigInt("0xffffffffffffffff"))throw Error(`Value ${t} is not a uint64`);return t}},46812:(e,t,r)=>{"use strict";r.d(t,{E:()=>i});var n=r(64527),a=r(88852);function i(e){let{opened:t,shouldReturnFocus:r=!0}=e,i=(0,n.useRef)(null),o=()=>{if(i.current&&"focus"in i.current&&"function"==typeof i.current.focus){var e;null==(e=i.current)||e.focus({preventScroll:!0})}};return(0,a.C)(()=>{let e=-1,n=t=>{"Tab"===t.key&&window.clearTimeout(e)};return document.addEventListener("keydown",n),t?i.current=document.activeElement:r&&(e=window.setTimeout(o,10)),()=>{window.clearTimeout(e),document.removeEventListener("keydown",n)}},[t,r]),o}},49771:(e,t,r)=>{"use strict";r.d(t,{p:()=>A});var n=r(79175),a=r(82248);r(64527);var i=r(76825),o=r(94393),s=r(51049),l=r(44241),c=r(86280),u=r(41903),p=r(35058),h=r(77599),d=r(97657),f=r(59551),g=r(80591),m=r(79463),y=r(4505),w=r(32460),v=r(570),b=r(23151);let S={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0}
3,x=(0,o.V)((e,t,r)=>({wrapper:{"--input-margin-top":r.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":r.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":(0,i.YC)(t.size,"input-height"),"--input-fz":(0,i.ny)(t.size),"--input-radius":void 0===t.radius?void 0:(0,i.nJ)(t.radius),"--input-left-section-width":void 0!==t.leftSectionWidth?(0,a.D)(t.leftSectionWidth):void 0,"--input-right-section-width":void 0!==t.rightSectionWidth?(0,a.D)(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?(0,i.YC)(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),A=(0,p.v)((e,t)=>{let r=(0,s.Y)("Input",S,e),{classNames:a,className:i,style:o,styles:p,unstyled:d,required:f,__staticSelector:g,__stylesApiProps:m,size:y,wrapperProps:v,error:A,disabled:E,leftSection:I,leftSectionProps:T,leftSectionWidth:k,rightSection:C,rightSectionProps:_,rightSectionWidth:D,rightSectionPointerEvents:B,leftSectionPointerEvents:P,variant:M,vars:N,pointer:R,multiline:O,radius:$,id:L,withAria:U,withErrorStyles:V,mod:F,inputSize:j,attributes:q,__clearSection:z,__clearable:K,__defaultRightSection:G,...H}=r,{styleProps:W,rest:J}=(0,c.j)(H),X=(0,w.e)(),Z={offsetBottom:null==X?void 0:X.offsetBottom,offsetTop:null==X?void 0:X.offsetTop},Y=(0,l.I)({name:["Input",g],props:m||r,classes:b.A,className:i,style:o,classNames:a,styles:p,unstyled:d,attributes:q,stylesCtx:Z,rootSelector:"wrapper",vars:N,varsResolver:x}),Q=U?{required:f,disabled:E,"aria-invalid":!!A,"aria-describedby":null==X?void 0:X.describedBy,id:(null==X?void 0:X.inputId)||L}:{},ee=C||K&&z||G;return(0,n.jsx)(h.E,{value:{size:y||"sm"},children:(0,n.jsxs)(u.a,{...Y("wrapper"),...W,...v,mod:[{error:!!A&&V,pointer:R,disabled:E,multiline:O,"data-with-right-section":!!ee,"data-with-left-section":!!I},F],variant:M,size:y,children:[I&&(0,n.jsx)("div",{...T,"data-position":"left",...Y("section",{className:null==T?void 0:T.className,style:null==T?void 0:T.style}),children:I}),(0,n.jsx)(u.a,{component:"input",...J,...Q,ref:t,required:f,mod:{disabled:E,error:!!A&&V},variant:M,__size:j,...Y("input")}),ee&&(0,n.jsx)("div",{..._,"data-position":"right",...Y("section",{className:null==_?void 0:_.className,style:null==_?void 0:_.style}),children:ee})]})})});A.classes=b.A,A.Wrapper=v.o,A.Label=m.l,A.Error=g.d,A.Description=f.x,A.Placeholder=y.E,A.ClearButton=d.s,A.displayName="@mantine/core/Input"},50517:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(36121);class a{constructor(e,t,r,a,i={}){if("function"==typeof t.get)this.c=new n.S(t);else{let o;o="string"==typeof t?function(e,t=""){let r={};return""===t||(r[e]=t),r}(e,t):t,this.c=new n.S(o,r,a,i)}}}},52029:(e,t,r)=>{"use strict";function n(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}function a(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=n(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}function i(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){var a=e[n]-t[n];if(0!==a)return a}return e.length-t.length}r.d(t,{CT:()=>n,_T:()=>i,od:()=>a,t8:()=>o});var o=function(e){if(this.rawBinaryValue=e,!ArrayBuffer.isView(e))throw TypeError("RawBinaryString: rawBinaryValue must be an ArrayBufferView")}},52530:(e,t,r)=>{"use strict";r.d(t,{i:()=>u});var n=r(79142),a=r(28775),i=r(60718),o=r(35066),s=r(77251),l=r(63790),c=r(83123).hp;class u{constructor(e,t,r){this._appLookups=new Map,this._appManager=e,this._transactionSender=t,this._indexer=r}async deploy(e){let{metadata:t,deployTimeParams:r,onSchemaBreak:i,onUpdate:u,createParams:p,updateParams:h,deleteParams:d,existingDeployments:f,ignoreCache:g,...m}=e;if(p.note=h.note=l.R.arc2Note({dAppName:s.$G,data:t,format:"j"}),f&&f.creator.toString()!==p.sender.toString())throw Error(`Received invalid existingDeployments value for creator ${f.creator} when attempting to deploy for creator ${p.sender}`);if(!f&&!this._indexer)throw Error("Didn't receive an indexer client when this AppManager was created, but also didn't receive an existingDeployments cache - one of them must be provided");a.T.getLogger(m?.suppressLog).info(`Idempotently deploying app "${t.name}" from creator ${p.sender} using ${p.approvalProgram.length} bytes of ${"string"==typeof p.approvalProgram?"teal code":"AVM bytecode"} and ${p.clearStateProgram.length} bytes of ${"string"==typeof p.approvalProgram?"teal code":"AVM bytecode"}`);let y="string"==typeof p.approvalProgram?await this._appManager.compileTealTemplate(p.approvalProgram,r,t):void 0,w=y?y.compiledBase64ToBytes:p.approvalProgram,v="string"==typeof p.clearStateProgram?await this._appManager.compileTealTemplate(p.clearStateProgram,r):void 0,b=v?v.compiledBase64ToBytes:p.clearStateProgram,S=async()=>{let e=await ("method"in p?this._transactionSender.appCreateMethodCall({...p,approvalProgram:w,clearStateProgram:b,...m}):this._transactionSender.appCreate({...p,approvalProgram:w,clearStateProgram:b,...m})),r={appId:e.appId,appAddress:e.appAddress,...t,createdMetadata:t,createdRound:BigInt(e.confirmation.confirmedRound),updatedRound:BigInt(e.confirmation.confirmedRound),deleted:!1};return this.updateAppLookup(p.sender,r),{operationPerformed:"create",compiledApproval:y,compiledClear:v,...e,...r}},x=async e=>{a.T.getLogger(m?.suppressLog).info(`Updating existing ${t.name} app for ${p.sender} to version ${t.version}.`);let r=await ("method"in h?this._transactionSender.appUpdateMethodCall({appId:e.appId,approvalProgram:w,clearStateProgram:b,...h,...m}):this._transactionSender.appUpdate({appId:e.appId,approvalProgram:w,clearStateProgram:b,...h,...m})),n={appId:e.appId,appAddress:e.appAddress,createdMetadata:e.createdMetadata,createdRound:e.createdRound,updatedRound:BigInt(r.confirmation.confirmedRound),...t,deleted:!1};return this.updateAppLookup(p.sender,n),{operationPerformed:"update",compiledApproval:y,compiledClear:v,...r,...n}},A=async e=>{a.T.getLogger(m?.suppressLog).info(`Deploying a new ${t.name} app for ${p.sender}; deploying app with version ${t.version}.`),a.T.getLogger(m?.suppressLog).warn(`Deleting existing ${t.name} app with id ${e.appId} from ${d.sender} account.`);let r=this._transactionSender.newGroup();"method"in p?r.addAppCreateMethodCall({...p,approvalProgram:w,clearStateProgram:b}):r.addAppCreate({...p,approvalProgram:w,clearStateProgram:b});let i=await r.count();"method"in d?r.addAppDeleteMethodCall({appId:e.appId,...d}):r.addAppDelete({appId:e.appId,...d});let o=await r.send({...m}),s=o.confirmations.at(i-1),l=o.transactions.at(i-1),c=o.transactions.at(-1);a.T.getLogger(m?.suppressLog).warn(`Sent transactions ${l.txID()} to create app with id ${s.applicationIndex} and ${c.txID()} to delete app with id ${e.appId} from ${p.sender} account.`);let u={appId:BigInt(s.applicationIndex),appAddress:n.Ay$.getApplicationAddress(s.applicationIndex),...t,createdMetadata:t,createdRound:BigInt(s.confirmedRound),updatedRound:BigInt(s.confirmedRound),deleted:!1};return this.updateAppLookup(p.sender,u),{operationPerformed:"replace",...o,compiledApproval:y,compiledClear:v,transaction:l,confirmation:s,return:"method"in p?o.returns?.[0]:void 0,deleteReturn:"method"in d?o.returns?.at(-1):void 0,...u,deleteResult:{transaction:c,confirmation:o.confirmations.at(-1)}}},E=(f??await this.getCreatorAppsByName(p.sender,g)).apps[t.name];if(!E||E.deleted)return a.T.getLogger(m?.suppressLog).info(`App ${t.name}
3 not found in apps created by ${p.sender}; deploying app with version ${t.version}.`),await S();a.T.getLogger(m?.suppressLog).info(`Existing app ${t.name} found by creator ${p.sender}, with app id ${E.appId} and version ${E.version}.`);let I=await this._appManager.getById(E.appId),T=c.from(I.approvalProgram).toString("base64"),k=c.from(I.clearStateProgram).toString("base64"),C=(0,o.NX)(I.approvalProgram,I.clearStateProgram),_=c.from(w),D=c.from(b),B=_.toString("base64"),P=D.toString("base64"),M=(0,o.NX)(_,D);if(I.localInts<(p.schema?.localInts??0)||I.globalInts<(p.schema?.globalInts??0)||I.localByteSlices<(p.schema?.localByteSlices??0)||I.globalByteSlices<(p.schema?.globalByteSlices??0)||C<M){if(a.T.getLogger(m?.suppressLog).warn(`Detected a breaking app schema change in app ${E.appId}:`,{from:{globalInts:I.globalInts,globalByteSlices:I.globalByteSlices,localInts:I.localInts,localByteSlices:I.localByteSlices,extraProgramPages:C},to:{...p.schema,extraProgramPages:M}}),void 0===i||"fail"===i||i===s.Kz.Fail)throw Error("Schema break detected and onSchemaBreak=OnSchemaBreak.Fail, stopping deployment. If you want to try deleting and recreating the app then re-run with onSchemaBreak=OnSchemaBreak.ReplaceApp");return"append"===i||i===s.Kz.AppendApp?(a.T.getLogger(m?.suppressLog).info("onSchemaBreak=AppendApp, will attempt to create a new app"),await S()):(E.deletable?a.T.getLogger(m?.suppressLog).info("App is deletable and onSchemaBreak=ReplaceApp, will attempt to create new app and delete old app"):a.T.getLogger(m?.suppressLog).info("App is not deletable but onSchemaBreak=ReplaceApp, will attempt to delete app, delete will most likely fail"),await A(E))}if(B!==T||P!==k){if(a.T.getLogger(m?.suppressLog).info(`Detected a TEAL update in app ${E.appId} for creator ${p.sender}`),void 0===u||"fail"===u||u===s.tq.Fail)throw Error("Update detected and onUpdate=Fail, stopping deployment. Try a different onUpdate value to not fail.");if("append"===u||u===s.tq.AppendApp)return a.T.getLogger(m?.suppressLog).info("onUpdate=AppendApp, will attempt to create a new app"),await S();if("update"===u||u===s.tq.UpdateApp)return E.updatable?a.T.getLogger(m?.suppressLog).info("App is updatable and onUpdate=UpdateApp, updating app..."):a.T.getLogger(m?.suppressLog).warn("App is not updatable but onUpdate=UpdateApp, will attempt to update app, update will most likely fail"),await x(E);if("replace"===u||u===s.tq.ReplaceApp)return E.deletable?a.T.getLogger(m?.suppressLog).warn("App is deletable and onUpdate=ReplaceApp, creating new app and deleting old app..."):a.T.getLogger(m?.suppressLog).warn("App is not deletable and onUpdate=ReplaceApp, will attempt to create new app and delete old app, delete will most likely fail"),await A(E)}return a.T.getLogger(m?.suppressLog).debug("No detected changes in app, nothing to do."),{...E,operationPerformed:"nothing"}}updateAppLookup(e,t){let r="string"==typeof e?e:e.toString(),a=this._appLookups.get(r);a?a.apps[t.name]=t:this._appLookups.set(r,{creator:n.pVw.fromString(r),apps:{[t.name]:t}})}async getCreatorAppsByName(e,t){let r={},o="string"==typeof e?e:e.toString();if(!t&&this._appLookups.has(o))return this._appLookups.get(o);if(!this._indexer)throw Error("Didn't receive an indexer client when this AppManager was created, but received a call to getCreatorApps");let l=(await (0,i.fE)(this._indexer,e)).map(e=>({id:e.id,createdAtRound:e.createdAtRound,deleted:e.deleted})).sort((e,t)=>Number(e.createdAtRound-t.createdAtRound));(await Promise.all(l.map(async t=>{let r=await (0,i.Mf)(this._indexer,r=>r.minRound(t.createdAtRound).txType(n.Ay$.TransactionType.appl).applicationID(Number(t.id)).address(e).addressRole("sender").notePrefix(c.from(s.$G).toString("base64"))),a=r.transactions.filter(t=>t.applicationTransaction?.applicationId===0n&&t.sender.toString()===e.toString())[0],o=r.transactions.filter(t=>t.sender.toString()===e.toString()).sort((e,t)=>e.confirmedRound===t.confirmedRound?(t.intraRoundOffset-e.intraRoundOffset)/10:Number(t.confirmedRound-e.confirmedRound))[0];return a?.note?{createdApp:t,appCreationTransaction:a,latestAppUpdateTransaction:o}:null}))).filter(e=>null!==e).forEach(t=>{let{createdApp:i,appCreationTransaction:o,latestAppUpdateTransaction:l}=t,u=e=>{if(e&&e.startsWith(`${s.$G}:j{`))return JSON.parse(e.substring(s.$G.length+2))};try{let e=u(o.note?c.from(o.note).toString("utf-8"):void 0),t=u(l.note?c.from(l.note).toString("utf-8"):void 0);e?.name&&(r[e.name]={appId:i.id,appAddress:n.Ay$.getApplicationAddress(i.id),createdMetadata:e,createdRound:o.c
3onfirmedRound??0n,...t??e,updatedRound:l?.confirmedRound??0n,deleted:i.deleted??!1})}catch(t){a.T.logger.warn(`Received error trying to retrieve app with ${i.id} for creator ${e}; failing silently`,t);return}});let u={creator:"string"==typeof e?n.pVw.fromString(e):e,apps:r};return this._appLookups.set(e.toString(),u),u}}},52699:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,i=l(e),o=i[0],s=i[1],c=new a((o+s)*3/4-s),u=0,p=s>0?o-4:o;for(r=0;r<p;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,i=[],o=0,s=n-a;o<s;o+=16383)i.push(function(e,t,n){for(var a,i=[],o=t;o<n;o+=3)a=(e[o]<<16&0xff0000)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(r[a>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return i.join("")}(e,o,o+16383>s?s:o+16383));return 1===a?i.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===a&&i.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),i.join("")};for(var r=[],n=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=i.length;o<s;++o)r[o]=i[o],n[i.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},54724:(e,t,r)=>{"use strict";r.d(t,{E:()=>o});var n=r(28775),a=r(35066),i=r(63790);class o{constructor(e,t){this._algod=e,this._newGroup=t}async getById(e){let t=await this._algod.getAssetByID(Number(e)).do();return{assetId:BigInt(t.index),total:BigInt(t.params.total),decimals:Number(t.params.decimals),assetName:t.params.name,assetNameAsBytes:t.params.nameB64,unitName:t.params.unitName,unitNameAsBytes:t.params.unitNameB64,url:t.params.url,urlAsBytes:t.params.urlB64,creator:t.params.creator,manager:t.params.manager,clawback:t.params.clawback,freeze:t.params.freeze,reserve:t.params.reserve,defaultFrozen:t.params.defaultFrozen,metadataHash:t.params.metadataHash}}async getAccountInformation(e,t){let r=await this._algod.accountAssetInformation(e,Number(t)).do();return{assetId:BigInt(t),balance:BigInt(r.assetHolding?.amount??0),frozen:r.assetHolding?.isFrozen===!0,round:BigInt(r.round)}}async bulkOptIn(e,t,r){let o=[];for(let s of(0,a.ln)(t,i._)){let t=this._newGroup();for(let n of s)t.addAssetOptIn({...r,sender:e,assetId:BigInt(n)});let a=await t.send(r);n.T.getLogger(r?.suppressLog).info(`Successfully opted in ${e} for assets ${s.join(", ")} with transaction IDs ${a.txIds.join(", ")} 4 Grouped under ${a.groupId} in round ${a.confirmations?.[0]?.confirmedRound}.`),s.forEach((e,t)=>{o.push({assetId:BigInt(e),transactionId:a.txIds[t]})})}return o}async bulkOptOut(e,t,r){let o=[];for(let s of(0,a.ln)(t,i._)){let t=this._newGroup(),a=[],i=[];for(let t of s)if(r?.ensureZeroBalance!==!1)try{let r=await this.getAccountInformation(e,t);0n!==r.balance&&i.push(BigInt(t))}catch{a.push(BigInt(t))}if(a.length>0||i.length>0)throw Error(`Account ${e}${a.length>0?` is not opted-in to Asset${a.length>1?"s":""} ${a.join(", ")}`:""}${i.length>0?` has non-zero balance for Asset${i.length>1?"s":""} ${i.join(", ")}`:""}; can't opt-out.`);for(let n of s)t.addAssetOptOut({...r,creator:(await this.getById(BigInt(n))).creator,sender:e,assetId:BigInt(n)});let l=await t.send(r);n.T.getLogger(r?.suppressLog).info(`Successfully opted ${e} out of assets ${s.join(", ")} with transaction IDs ${l.txIds.join(", ")} 5 Grouped under ${l.groupId} in round ${l.confirmations?.[0]?.confirmedRound}.`),s.forEach((e,t)=>{o.push({assetId:BigInt(e),transactionId:l.txIds[t]})})}return o}}},54805:(e,t,r)=>{"use strict";r.d(t,{BN:()=>d,ER:()=>f,Ej:()=>m,UE:()=>v,UU:()=>g,cY:()=>h,jD:()=>y,mG:()=>w,we:()=>p});var n=r(35988),a=r(64527),i=r(40446),o="undefined"!=typeof document?a.useLayoutEffect:function(){};function s(e,t){let r,n,a;if(e===t)return!0;
vendor: 2,629 bytes, line 5
5if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!s(e[n],t[n]))return!1;return!0}if((r=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!=n--;){let r=a[n];if(("_owner"!==r||!e.$$typeof)&&!s(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function l(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function c(e,t){let r=l(e);return Math.round(t*r)/r}function u(e){let t=a.useRef(e);return o(()=>{t.current=e}),t}function p(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:p=[],platform:h,elements:{reference:d,floating:f}={},transform:g=!0,whileElementsMounted:m,open:y}=e,[w,v]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[b,S]=a.useState(p);s(b,p)||S(p);let[x,A]=a.useState(null),[E,I]=a.useState(null),T=a.useCallback(e=>{e!==D.current&&(D.current=e,A(e))},[]),k=a.useCallback(e=>{e!==B.current&&(B.current=e,I(e))},[]),C=d||x,_=f||E,D=a.useRef(null),B=a.useRef(null),P=a.useRef(w),M=null!=m,N=u(m),R=u(h),O=u(y),$=a.useCallback(()=>{if(!D.current||!B.current)return;let e={placement:t,strategy:r,middleware:b};R.current&&(e.platform=R.current),(0,n.rD)(D.current,B.current,e).then(e=>{let t={...e,isPositioned:!1!==O.current};L.current&&!s(P.current,t)&&(P.current=t,i.flushSync(()=>{v(t)}))})},[b,t,r,R,O]);o(()=>{!1===y&&P.current.isPositioned&&(P.current.isPositioned=!1,v(e=>({...e,isPositioned:!1})))},[y]);let L=a.useRef(!1);o(()=>(L.current=!0,()=>{L.current=!1}),[]),o(()=>{if(C&&(D.current=C),_&&(B.current=_),C&&_){if(N.current)return N.current(C,_,$);$()}},[C,_,$,N,M]);let U=a.useMemo(()=>({reference:D,floating:B,setReference:T,setFloating:k}),[T,k]),V=a.useMemo(()=>({reference:C,floating:_}),[C,_]),F=a.useMemo(()=>{let e={position:r,left:0,top:0};if(!V.floating)return e;let t=c(V.floating,w.x),n=c(V.floating,w.y);return g?{...e,transform:"translate("+t+"px, "+n+"px)",...l(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,g,V.floating,w.x,w.y]);return a.useMemo(()=>({...w,update:$,refs:U,elements:V,floatingStyles:F}),[w,$,U,V,F])}let h=(e,t)=>({...(0,n.cY)(e),options:[e,t]}),d=(e,t)=>({...(0,n.BN)(e),options:[e,t]}),f=(e,t)=>({...(0,n.ER)(e),options:[e,t]}),g=(e,t)=>({...(0,n.UU)(e),options:[e,t]}),m=(e,t)=>({...(0,n.Ej)(e),options:[e,t]}),y=(e,t)=>({...(0,n.jD)(e),options:[e,t]}),w=(e,t)=>({...(0,n.mG)(e),options:[e,t]}),v=(e,t)=>
5({...(e=>({name:"arrow",options:e,fn(t){let{element:r,padding:a}="function"==typeof e?e(t):e;return r&&({}).hasOwnProperty.call(r,"current")?null!=r.current?(0,n.UE)({element:r.current,padding:a}).fn(t):{}:r?(0,n.UE)({element:r,padding:a}).fn(t):{}}}))(e),options:[e,t]})},55300:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(63012).A)("outline","zoom-money","ZoomMoney",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}],["path",{d:"M12 7h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3h-2.5",key:"svg-2"}],["path",{d:"M10 13v1m0 -8v1",key:"svg-3"}]])},55495:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(63012).A)("outline","link","Link",[["path",{d:"M9 15l6 -6",key:"svg-0"}],["path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464",key:"svg-1"}],["path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463",key:"svg-2"}]])},59310:(e,t,r)=>{"use strict";r.d(t,{BP:()=>n.BP,DB:()=>n.DB,D_:()=>n.D_,Gn:()=>a.Gn,Lh:()=>n.Lh,N$:()=>a.N$,Xh:()=>a.Xh,Zv:()=>a.Zv,oO:()=>a.oO,y9:()=>a.y9});var n=r(63979),a=r(28176)},59551:(e,t,r)=>{"use strict";r.d(t,{x:()=>f});var n=r(79175),a=r(82248);r(64527);var i=r(76825),o=r(94393),s=r(51049),l=r(44241),c=r(41903),u=r(97569),p=r(32460),h=r(23151);
5let d=(0,o.V)((e,t)=>{let{size:r}=t;return{description:{"--input-description-size":void 0===r?void 0:"calc(".concat((0,i.ny)(r)," - ").concat((0,a.D)(2),")")}}}),f=(0,u.P9)((e,t)=>{let r=(0,s.Y)("InputDescription",null,e),{classNames:a,className:i,style:o,styles:u,unstyled:f,vars:g,size:m,__staticSelector:y,__inheritStyles:w=!0,attributes:v,variant:b,...S}=(0,s.Y)("InputDescription",null,r),x=(0,p.e)(),A=(0,l.I)({name:["InputWrapper",y],props:r,classes:h.A,className:i,style:o,classNames:a,styles:u,unstyled:f,attributes:v,rootSelector:"description",vars:g,varsResolver:d}),E=w&&(null==x?void 0:x.getStyles)||A;return(0,n.jsx)(c.a,{component:"p",ref:t,variant:b,size:m,...E("description",(null==x?void 0:x.getStyles)?{className:i,style:o}:void 0),...S})});f.classes=h.A,f.displayName="@mantine/core/InputDescription"},60718:(e,t,r)=>{"use strict";r.d(t,{Mf:()=>i,fE:()=>a});var n=r(79142);async function a(e,t,r,n){return await o(e=>{if("message"in e)throw{status:404,...e};return e.applications},a=>{let i=e.lookupAccountCreatedApplications(t).includeAll(r).limit(n??1e3);return a&&(i=i.nextToken(a)),i})}async function i(e,t,r){let a=0n,i=await o(e=>{if("message"in e)throw{status:404,...e};return e.currentRound>a&&(a=e.currentRound),e.transactions},n=>{let a=t(e.searchForTransactions()).limit(r??1e3);return n&&(a=a.nextToken(n)),a});return new n.Ay$.indexerModels.TransactionsResponse({currentRound:a,nextToken:void 0,transactions:i})}async function o(e,t){let r,n=[];for(;;){let a=t(r),i=await a.do(),o=e(i);if(null==o||0===o.length||(n.push(...o),!(r=i.nextToken)))break}return n}},61597:(e,t,r)=>{"use strict";var n=r(64527),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=n.useState,o=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!a(e,r)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=i({inst:{value:r,getSnapshot:t}}),a=n[0].inst,u=n[1];return s(function(){a.value=r,a.getSnapshot=t,c(a)&&u({inst:a})},[e,r,t]),o(function(){return c(a)&&u({inst:a}),e(function(){c(a)&&u({inst:a})})},[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u},63415:(e,t,r)=>{"use strict";r.d(t,{e:()=>i});var n=r(79175),a=r(64527);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(0,a.createContext)(e);return[e=>{let{children:r,value:a}=e;return(0,n.jsx)(t.Provider,{value:a,children:r})},()=>(0,a.useContext)(t)]}},63790:(e,t,r)=>{"use strict";r.d(t,{R:()=>y,_:()=>f});var n=r(79142),a=r(28775),i=r(30905),o=r(35066),s=r(70377),l=r(72726),c=r(79450),u=r(83123).hp,p=n.Ay$.AtomicTransactionComposer,h=n.Ay$.isTransactionWithSigner,d=n.Ay$.modelsv2;let f=16;class g extends Error{constructor(e,t){super(`An error transformer returned a non-error value: ${t}. The original error before any transformation: ${e}`)}}class m extends Error{constructor(e,t){super(`An error transformer threw an error: ${t}. The original error before any transformation: ${e} `,{cause:t})}}class y{async transformError(e){if(!(e instanceof Error))return e;let t=e;for(let r of this.errorTransformers)try{if(!((t=await r(t))instanceof Error))return new g(e,t)}catch(t){return new m(e,t)}return t}constructor(e){this.atc=new n.Ay$.AtomicTransactionComposer,this.txnMaxFees=new Map,this.txns=[],this.defaultValidityWindow=10n,this.defaultValidityWindowIsExplicit=!1,this.algod=e.algod,this.getSuggestedParams=e.getSuggestedParams??(()=>e.algod.getTransactionParams().do()),this.getSigner=e.getSigner,this.defaultValidityWindow=e.defaultValidityWindow??this.defaultValidityWindow,this.defaultValidityWindowIsExplicit=void 0!==e.defaultValidityWindow,this.appManager=e.appManager??new s.r(e.algod),this.errorTransformers=e.errorTransformers??[]}registerErrorTransformer(e){return this.errorTransformers.push(e),this}addTransaction(e,t){return this.txns.push({txn:e,signer:t??this.getSigner(e.sender),type:"txnWithSigner"}),this}addPayment(e){return this.txns.push({...e,type:"pay"}),this}addAssetCreate(e){return this.txns.push({...e,type:"assetCreate"}),this}addAssetConfig(e){return this.txns.push({...e,type:"assetConfig"}),this}addAssetFreeze(e){return this.txns.push({...e,type:"assetFreeze"}),this}addAssetDestroy(e){return this.txns.push({...e,type:"assetDestroy"}),this}addAssetTransfer(e){return this.txns.push({...e,type:"assetTransfer"}),this}addAssetOptIn(e){return this.txns.push({...e,type:"assetOptIn"}),this}addAssetOptOut(e){return this.txns.push({...e,type:"assetOptOut"}),this}addAppCreate(e){return this.txns.push({...e,type:"appCall"}),this}addAppUpdate(e){return this.txns.push({...e,type:"appCall",onComplete:n.Ay$.OnApplicationComplete.UpdateApplicationOC}),this}addAppDelete(e){return this.txns.push({...e,type:"appCall",onComplete:n.Ay$.OnApplicationComplete.DeleteApplicationOC}),this}addAppCall(e){return this.txns.push({...e,type:"appCall"}),this}addAppCreateMethodCall(e){return this.txns.push({...e,type:"methodCall"}),this}addAppUpdateMethodCall(e){return this.txns.push({...e,type:"methodCall",onComplete:n.Ay$.OnApplicationComplete.UpdateApplicationOC}),this}addAppDeleteMethodCall(e){return this.txns.push({...e,type:"methodCall",onComplete:n.Ay$.OnApplicationComplete.DeleteApplicationOC}),this}addAppCallMethodCall(e){return this.txns.push({...e,type:"methodCall"}),this}addOnlineKeyRegistration(e){return this.txns.push({...e,type:"keyReg"}),this}addOfflineKeyRegistration(e){return this.txns.push({...e,type:"keyReg"}),this}addAtc(e){return this.txns.push({atc:e,type:"atc"}),this}buildAtc(e){return e.buildGroup().map((t,r)=>(t.txn.group=void 0,e.methodCalls.get(r))?{...t,context:{abiMethod:e.methodCalls.get(r)}}:{...t,context:{}})}commonTxnBuildStep(e,t,r){let a;r.suggestedParams={...r.suggestedParams},t.lease&&(r.lease=(0,i.jS)(t.lease)),t.rekeyTo&&(r.rekeyTo="str
5ing"==typeof(a=t.rekeyTo)?n.pVw.fromString(a):a);let o=new TextEncoder;if(t.note&&(r.note="string"==typeof t.note?o.encode(t.note):t.note),t.firstValidRound&&(r.suggestedParams.firstValid=t.firstValidRound),t.lastValidRound)r.suggestedParams.lastValid=t.lastValidRound;else{let e=t.validityWindow?BigInt(t.validityWindow):!this.defaultValidityWindowIsExplicit&&(0,c.C)(r.suggestedParams.genesisID??"unknown")?1000n:this.defaultValidityWindow;r.suggestedParams.lastValid=BigInt(r.suggestedParams.firstValid)+e}if(void 0!==t.staticFee&&void 0!==t.extraFee)throw Error("Cannot set both staticFee and extraFee");void 0!==t.staticFee&&(r.suggestedParams.fee=t.staticFee.microAlgo,r.suggestedParams.flatFee=!0);let s=e(r);if(t.extraFee&&(s.fee+=t.extraFee.microAlgo),void 0!==t.maxFee&&s.fee>t.maxFee.microAlgo)throw Error(`Transaction fee ${s.fee} \xb5ALGO is greater than maxFee ${t.maxFee}`);return{txn:s,context:{maxFee:void 0!==t.maxFee&&t.maxFee.microAlgo>(t.staticFee?.microAlgo??0n)?t.maxFee:t.staticFee}}}async buildMethodCall(e,t,r){let a=[],i=[],l=e=>Array.isArray(e)?0==e.length||e.every(l):"bigint"==typeof e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Uint8Array;for(let o=(e.args??[]).length-1;o>=0;o--){let s=e.args[o];if(void 0===s){if(n.Ay$.abiTypeIsTransaction(e.method.args[o].type)&&i.length>0){let e=i.splice(-1,1)[0];a.push(e);continue}throw Error(`No value provided for argument ${o+1} within call to ${e.method.name}`)}if(l(s)||h(s)){a.push(s);continue}if("method"in s){let e=await this.buildMethodCall(s,t,r);a.push(...e.slice(-1)),i.push(...e.slice(0,-1).reverse());continue}let c=await s;a.push({txn:c,signer:r?e.signer?"signer"in e.signer?e.signer.signer:e.signer:this.getSigner(c.sender):y.NULL_SIGNER})}let c=new n.Ay$.AtomicTransactionComposer,u=new Map;i.reverse().forEach(({context:e,...t})=>{c.addTransaction(t);let r=c.count()-1;e.abiMethod&&c.methodCalls.set(r,e.abiMethod),void 0!==e.maxFee&&u.set(r,e.maxFee)}),a.filter(e=>{if("object"==typeof e&&"context"in e){let{context:t,...r}=e;return h(r)}return h(e)}).reverse().forEach((e,t)=>{if("object"==typeof e&&"context"in e&&e.context){let r=c.count()+t;e.context.abiMethod&&c.methodCalls.set(r,e.context.abiMethod),void 0!==e.context.maxFee&&u.set(r,e.context.maxFee)}});let p=Number("appId"in e?e.appId:0n),d="approvalProgram"in e?"string"==typeof e.approvalProgram?(await this.appManager.compileTeal(e.approvalProgram)).compiledBase64ToBytes:e.approvalProgram:void 0,f="clearStateProgram"in e?"string"==typeof e.clearStateProgram?(await this.appManager.compileTeal(e.clearStateProgram)).compiledBase64ToBytes:e.clearStateProgram:void 0,g={appID:p,sender:e.sender,suggestedParams:t,onComplete:e.onComplete??n.Ay$.OnApplicationComplete.NoOpOC,appAccounts:e.accountReferences,appForeignApps:e.appReferences?.map(e=>Number(e)),appForeignAssets:e.assetReferences?.map(e=>Number(e)),boxes:e.boxReferences?.map(s.r.getBoxReference),approvalProgram:d,clearProgram:f,extraPages:0===p?"extraProgramPages"in e&&void 0!==e.extraProgramPages?e.extraProgramPages:d?(0,o.NX)(d,f):0:void 0,numLocalInts:0===p?"schema"in e?e.schema?.localInts??0:0:void 0,numLocalByteSlices:0===p?"schema"in e?e.schema?.localByteSlices??0:0:void 0,numGlobalInts:0===p?"schema"in e?e.schema?.globalInts??0:0:void 0,numGlobalByteSlices:0===p?"schema"in e?e.schema?.globalByteSlices??0:0:void 0,method:e.method,signer:r?e.signer?"signer"in e.signer?e.signer.signer:e.signer:this.getSigner(e.sender):y.NULL_SIGNER,methodArgs:a.map(e=>{if("object"==typeof e&&"context"in e){let{context:t,...r}=e;return r}return e}).reverse(),note:void 0,lease:void 0,rekeyTo:void 0},m=this.commonTxnBuildStep(e=>(c.addMethodCall(e),c.buildGroup()[c.count()-1].txn),e,g);return this.buildAtc(c).map(({context:e,...t},r)=>{let n=r===c.count()-1?m.context.maxFee:u.get(r),a={...e,maxFee:n};return{...t,context:a}})}buildPayment(e,t){return this.commonTxnBuildStep(n.Ay$.makePaymentTxnWithSuggestedParamsFromObject,e,{sender:e.sender,receiver:e.receiver,amount:e.amount.microAlgo,closeRemainderTo:e.closeRemainderTo,suggestedParams:t})}buildAssetCreate(e,t){return this.commonTxnBuildStep(n.Ay$.makeAssetCreateTxnWithSuggestedParamsFromObject,e,{sender:e.sender,total:e.total,decimals:e.decimals??0,assetName:e.assetName,unitName:e.unitName,assetURL:e.url,defaultFrozen:e.defaultFrozen??!1,assetMetadataHash:"string"==typeof e.metadataHash?u.from(e.metadataHash,"utf-8"):e.metadataHash,manager:e.manager,reserve:e.reserve,freeze:e.freeze,clawback:e.clawback,suggestedParams:t})}buildAssetConfig(e,t){return this.commonTxnBuildStep(n.Ay$.makeAssetConfigTxnWithSuggestedParamsFromObject,e,{sender:e.sender,assetIndex:e.assetId,suggestedParams:t,manager:e.manager,reserve:e.reserve,freeze:e.freeze,clawback:e.clawback,strictEmptyAddressChecking:!1})}buildAssetDestroy(e,t){return this.commonTxnBuildStep(n.Ay$.makeAssetDestroyTxnWithSuggestedParamsFromObject,e,{sender:e.sender,assetIndex:e.assetId,suggestedParams:t})}buildAssetFreeze(e,t){return this.commonTxnBuildStep(n.Ay$.makeAssetFreezeTxnWithSuggestedParamsFromObject,e,{sender:e.sender,assetIndex:e.assetId,freezeTarget:e.account,frozen:e.frozen,suggestedParams:t})}buildAssetTransfer(e,t){return this.commonTxnBuildStep(n.Ay$.makeAssetTransferTxnWithSuggestedParamsFromObject,e,{sender:e.sender,receiver:e.receiver,assetIndex:e.assetId,amount:e.amount,suggestedParams:t,closeRemainderTo:e.closeAssetTo,assetSender:e.clawbackTarget})}
5async buildAppCall(e,t){let r="appId"in e?e.appId:0n,a="approvalProgram"in e?"string"==typeof e.approvalProgram?(await this.appManager.compileTeal(e.approvalProgram)).compiledBase64ToBytes:e.approvalProgram:void 0,i="clearStateProgram"in e?"string"==typeof e.clearStateProgram?(await this.appManager.compileTeal(e.clearStateProgram)).compiledBase64ToBytes:e.clearStateProgram:void 0,l={sender:e.sender,suggestedParams:t,appArgs:e.args,onComplete:e.onComplete??n.Ay$.OnApplicationComplete.NoOpOC,accounts:e.accountReferences,foreignApps:e.appReferences?.map(e=>Number(e)),foreignAssets:e.assetReferences?.map(e=>Number(e)),boxes:e.boxReferences?.map(s.r.getBoxReference),approvalProgram:a,clearProgram:i};if(0n!==r)return this.commonTxnBuildStep(n.Ay$.makeApplicationCallTxnFromObject,e,{...l,appIndex:r});if(void 0===l.approvalProgram||void 0===l.clearProgram)throw Error("approvalProgram and clearStateProgram are required for application creation");return this.commonTxnBuildStep(n.Ay$.makeApplicationCreateTxnFromObject,e,{...l,extraPages:"extraProgramPages"in e&&void 0!==e.extraProgramPages?e.extraProgramPages:(0,o.NX)(a,i),numLocalInts:"schema"in e?e.schema?.localInts??0:0,numLocalByteSlices:"schema"in e?e.schema?.localByteSlices??0:0,numGlobalInts:"schema"in e?e.schema?.globalInts??0:0,numGlobalByteSlices:"schema"in e?e.schema?.globalByteSlices??0:0,approvalProgram:a,clearProgram:i})}buildKeyReg(e,t){return"voteKey"in e?this.commonTxnBuildStep(n.Ay$.makeKeyRegistrationTxnWithSuggestedParamsFromObject,e,{sender:e.sender,voteKey:e.voteKey,selectionKey:e.selectionKey,voteFirst:e.voteFirst,voteLast:e.voteLast,voteKeyDilution:e.voteKeyDilution,suggestedParams:t,nonParticipation:!1,stateProofKey:e.stateProofKey}):this.commonTxnBuildStep(n.Ay$.makeKeyRegistrationTxnWithSuggestedParamsFromObject,e,{sender:e.sender,suggestedParams:t,nonParticipation:e.preventAccountFromEverParticipatingAgain})}async buildTxn(e,t){switch(e.type){case"pay":return[this.buildPayment(e,t)];case"assetCreate":return[this.buildAssetCreate(e,t)];case"appCall":return[await this.buildAppCall(e,t)];case"assetConfig":return[this.buildAssetConfig(e,t)];case"assetDestroy":return[this.buildAssetDestroy(e,t)];case"assetFreeze":return[this.buildAssetFreeze(e,t)];case"assetTransfer":return[this.buildAssetTransfer(e,t)];case"assetOptIn":return[this.buildAssetTransfer({...e,receiver:e.sender,amount:0n},t)];case"assetOptOut":return[this.buildAssetTransfer({...e,receiver:e.sender,amount:0n,closeAssetTo:e.creator},t)];case"keyReg":return[this.buildKeyReg(e,t)];default:throw Error("Unsupported txn type")}}async buildTxnWithSigner(e,t){if("txnWithSigner"===e.type)return[{...e,context:{}}];if("atc"===e.type)return this.buildAtc(e.atc);if("methodCall"===e.type)return await this.buildMethodCall(e,t,!0);let r=e.signer?"signer"in e.signer?e.signer.signer:e.signer:this.getSigner(e.sender);return(await this.buildTxn(e,t)).map(({txn:e,context:t})=>({txn:e,signer:r,context:t}))}
5async buildTransactions(){let e=await this.getSuggestedParams(),t=[],r=new Map,n=new Map;for(let a of this.txns)["txnWithSigner","atc","methodCall"].includes(a.type)?("txnWithSigner"===a.type?[a]:"atc"===a.type?this.buildAtc(a.atc):"methodCall"===a.type?await this.buildMethodCall(a,e,!1):[]).forEach(e=>{t.push(e.txn);let a=t.length-1;e.signer&&e.signer!==y.NULL_SIGNER&&n.set(a,e.signer),"context"in e&&e.context.abiMethod&&r.set(a,e.context.abiMethod)}):t.push(...(await this.buildTxn(a,e)).map(e=>e.txn));return{transactions:t,methodCalls:r,signers:n}}async count(){return(await this.buildTransactions()).transactions.length}async build(){if(this.atc.getStatus()===n.Ay$.AtomicTransactionComposerStatus.BUILDING){let e=await this.getSuggestedParams(),t=[];for(let r of this.txns)t.push(...await this.buildTxnWithSigner(r,e));let r=new Map;t.forEach(({context:e,...t},n)=>{this.atc.addTransaction(t),e.abiMethod&&r.set(n,e.abiMethod),void 0!==e.maxFee&&this.txnMaxFees.set(n,e.maxFee)}),this.atc.methodCalls=r}return{atc:this.atc,transactions:this.atc.buildGroup(),methodCalls:this.atc.methodCalls}}async rebuild(){return this.atc=new n.Ay$.AtomicTransactionComposer,await this.build()}async send(e){let t=(await this.build()).transactions,r=e?.maxRoundsToWaitForConfirmation,n=void 0===r||e?.coverAppCallInnerTransactionFees?await this.get
5SuggestedParams():void 0;if(void 0===r){let e=t.reduce((e,t)=>t.txn.lastValid>e?t.txn.lastValid:BigInt(e),0n),{firstValid:a}=n;r=Number(BigInt(e)-BigInt(a))+1}try{return await (0,i.YB)({atc:this.atc,suppressLog:e?.suppressLog,maxRoundsToWaitForConfirmation:r,populateAppCallResources:e?.populateAppCallResources,coverAppCallInnerTransactionFees:e?.coverAppCallInnerTransactionFees,additionalAtcContext:e?.coverAppCallInnerTransactionFees?{maxFees:this.txnMaxFees,suggestedParams:n}:void 0},this.algod)}catch(e){throw await this.transformError(e)}}async execute(e){return this.send(e)}async simulate(e){let{skipSignatures:t=!1,...r}=e??{},n=t?new p:this.atc;if(t){r.allowEmptySignatures=!0,r.fixSigners=!0;let e=await this.buildTransactions();for(let t of e.transactions)n.addTransaction({txn:t,signer:y.NULL_SIGNER});n.methodCalls=e.methodCalls}else await this.build();let{methodResults:o,simulateResponse:s}=await n.simulate(this.algod,new d.SimulateRequest({txnGroups:[],...r,...a.T.debug?{allowEmptySignatures:!0,fixSigners:!0,allowMoreLogging:!0,execTraceConfig:new d.SimulateTraceConfig({enable:!0,scratchChange:!0,stackChange:!0,stateChange:!0})}:void 0})),c=s?.txnGroups[0];if(c?.failureMessage){let e=Error(`Transaction failed at transaction(s) ${c.failedAt?.join(", ")||"unknown"} in the group. ${c.failureMessage}`);throw a.T.debug&&await a.T.events.emitAsync(l.B.TxnGroupSimulated,{simulateResponse:s}),await this.transformError(e)}
5a.T.debug&&a.T.traceAll&&await a.T.events.emitAsync(l.B.TxnGroupSimulated,{simulateResponse:s});let h=n.buildGroup().map(e=>e.txn),f=[...n.methodCalls.values()];return{confirmations:s.txnGroups[0].txnResults.map(e=>e.txnResult),transactions:h,txIds:h.map(e=>e.txID()),groupId:u.from(h[0].group??new Uint8Array).toString("base64"),simulateResponse:s,returns:o.map((e,t)=>(0,i.uf)(e,f[t].returns.type))}}static arc2Note(e){let t=`${e.dAppName}:${e.format}${"string"==typeof e.data?e.data:(0,o.vA)(e.data)}`;return new TextEncoder().encode(t)}}y.NULL_SIGNER=n.Ay$.makeEmptyTransactionSigner()},63859:(e,t,r)=>{"use strict";r.d(t,{I:()=>i}),r(64527),r(79175);var n=r(51049),a=r(86280);function i(e,t,r){let i=(0,n.Y)(e,t,r),{label:o,description:s,error:l,required:c,classNames:u,styles:p,className:h,unstyled:d,__staticSelector:f,__stylesApiProps:g,errorProps:m,labelProps:y,descriptionProps:w,wrapperProps:v,id:b,size:S,style:x,inputContainer:A,inputWrapperOrder:E,withAsterisk:I,variant:T,vars:k,mod:C,attributes:_,...D}=i,{styleProps:B,rest:P}=(0,a.j)(D),M={label:o,description:s,error:l,required:c,classNames:u,className:h,__staticSelector:f,__stylesApiProps:g||i,errorProps:m,labelProps:y,descriptionProps:w,unstyled:d,styles:p,size:S,style:x,inputContainer:A,inputWrapperOrder:E,withAsterisk:I,variant:T,id:b,mod:C,attributes:_,...v};return{...P,classNames:u,styles:p,unstyled:d,wrapperProps:{...M,...B},inputProps:{required:c,classNames:u,styles:p,unstyled:d,size:S,__staticSelector:f,__stylesApiProps:g||i,error:l,variant:T,id:b,attributes:_}}}},63871:(e,t,r)=>{"use strict";r.d(t,{Y:()=>o}),r(64527),r(79175);var n=r(53615),a=r(60500),i=r(12513);function o(e){let{classNames:t,styles:r,props:o,stylesCtx:s}=e,l=(0,n.xd)();return{resolvedClassNames:(0,a.J)({theme:l,classNames:t,props:o,stylesCtx:s||void 0}),resolvedStyles:(0,i.N)({theme:l,styles:r,props:o,stylesCtx:s||void 0})}}},63979:(e,t,r)=>{"use strict";var n,a;function i(e){return e===n.pay||e===n.keyreg||e===n.acfg||e===n.axfer||e===n.afrz||e===n.appl||e===n.stpf||e===n.hb}function o(e){return e===a.NoOpOC||e===a.OptInOC||e===a.CloseOutOC||e===a.ClearStateOC||e===a.UpdateApplicationOC||e===a.DeleteApplicationOC}r.d(t,{BP:()=>i,DB:()=>a,D_:()=>n,Lh:()=>o}),function(e){e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl",e.stpf="stpf",e.hb="hb"}(n||(n={})),function(e){e[e.NoOpOC=0]="NoOpOC",e[e.OptInOC=1]="OptInOC",e[e.CloseOutOC=2]="CloseOutOC",e[e.ClearStateOC=3]="ClearStateOC",e[e.UpdateApplicationOC=4]="UpdateApplicationOC",e[e.DeleteApplicationOC=5]="DeleteApplicationOC"}(a||(a={}))},64711:(e,t,r)=>{"use strict";r.d(t,{I:()=>a});let n={app:100,modal:200,popover:300,overlay:400,max:9999};function a(e){return n[e]}},65003:(e,t,r)=>{!function(e){"use strict";var t,n=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},a=function(){throw Error("no PRNG")},i=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=n(),l=n([1]),c=n([56129,1]),u=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),p=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),h=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),f=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function g(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function m(e,t,r,n,a){var i,o=0;for(i=0;i<a;i++)o|=e[t+i]^r[n+i];return(1&o-1>>>8)-1}function y(e,t,r,n){return m(e,t,r,n,16)}function w(e,t,r,n){return m(e,t,r,n,32)}function v(e,t,r,n){!function(e,t,r,n){for(var a,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,l=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,u=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,d=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,f=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,w=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,b=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,S=i,x=o,A=s,E=l,I=c,T=u,k=p,C=h,_=d,D=f,B=g,P=m,M=y,N=w,R=v,O=b,$=0;$<20;$+=2)I^=(a=S+M|0)<<7|a>>>25,_^=(a=I+S|0)<<9|a>>>23,M^=(a=_+I|0)<<13|a>>>19,S^=(a=M+_|0)<<18|a>>>14,D^=(a=T+x|0)<<7|a>>>25,N^=(a=D+T|0)<<9|a>>>23,x^=(a=N+D|0)<<13|a>>>19,T^=(a=x+N|0)<<18|a>>>14,R^=(a=B+k|0)<<7|a>>>25,A^=(a=R+B|0)<<9|a>>>23,k^=(a=A+R|0)<<13|a>>>19,B^=(a=k+A|0)<<18|a>>>14,E^=(a=O+P|0)<<7|a>>>25,C^=(a=E+O|0)<<9|a>>>23,P^=(a=C+E|0)<<13|a>>>19,O^=(a=P+C|0)<<18|a>>>14,x^=(a=S+E|0)<<7|a>>>25,A^=(a=x+S|0)<<9|a>>>23,E^=(a=A+x|0)<<13|a>>>19,S^=(a=E+A|0)<<18|a>>>14,k^=(a=T+I|0)<<7|a>>>25,C^=(a=k+T|0)<<9|a>>>23,I^=(a=C+k|0)<<13|a>>>19,T^=(a=I+C|0)<<18|a>>>14,P^=(a=B+D|0)<<7|a>>>25,_^=(a=P+B|0)<<9|a>>>23,D^=(a=_+P|0)<<13|a>>>19,B^=(a=D+_|0)<<18|a>>>14,M^=(a=O+R|0)<<7|a>>>
525,N^=(a=M+O|0)<<9|a>>>23,R^=(a=N+M|0)<<13|a>>>19,O^=(a=R+N|0)<<18|a>>>14;S=S+i|0,x=x+o|0,A=A+s|0,E=E+l|0,I=I+c|0,T=T+u|0,k=k+p|0,C=C+h|0,_=_+d|0,D=D+f|0,B=B+g|0,P=P+m|0,M=M+y|0,N=N+w|0,R=R+v|0,O=O+b|0,e[0]=S>>>0&255,e[1]=S>>>8&255,e[2]=S>>>16&255,e[3]=S>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=E>>>0&255,e[13]=E>>>8&255,e[14]=E>>>16&255,e[15]=E>>>24&255,e[16]=I>>>0&255,e[17]=I>>>8&255,e[18]=I>>>16&255,e[19]=I>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=k>>>0&255,e[25]=k>>>8&255,e[26]=k>>>16&255,e[27]=k>>>24&255,e[28]=C>>>0&255,e[29]=C>>>8&255,e[30]=C>>>16&255,e[31]=C>>>24&255,e[32]=_>>>0&255,e[33]=_>>>8&255,e[34]=_>>>16&255,e[35]=_>>>24&255,e[36]=D>>>0&255,e[37]=D>>>8&255,e[38]=D>>>16&255,e[39]=D>>>24&255,e[40]=B>>>0&255,e[41]=B>>>8&255,e[42]=B>>>16&255,e[43]=B>>>24&255,e[44]=P>>>0&255,e[45]=P>>>8&255,e[46]=P>>>16&255,e[47]=P>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=O>>>0&255,e[61]=O>>>8&255,e[62]=O>>>16&255,e[63]=O>>>24&255}(e,t,r,n)}function b(e,t,r,n){!function(e,t,r,n){for(var a,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,l=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,u=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,d=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,f=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,w=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,b=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,S=i,x=o,A=s,E=l,I=c,T=u,k=p,C=h,_=d,D=f,B=g,P=m,M=y,N=w,R=v,O=b,$=0;$<20;$+=2)I^=(a=S+M|0)<<7|a>>>25,_^=(a=I+S|0)<<9|a>>>23,M^=(a=_+I|0)<<13|a>>>19,S^=(a=M+_|0)<<18|a>>>14,D^=(a=T+x|0)<<7|a>>>25,N^=(a=D+T|0)<<9|a>>>23,x^=(a=N+D|0)<<13|a>>>19,T^=(a=x+N|0)<<18|a>>>14,R^=(a=B+k|0)<<7|a>>>25,A^=(a=R+B|0)<<9|a>>>23,k^=(a=A+R|0)<<13|a>>>19,B^=(a=k+A|0)<<18|a>>>14,E^=(a=O+P|0)<<7|a>>>25,C^=(a=E+O|0)<<9|a>>>23,P^=(a=C+E|0)<<13|a>>>19,O^=(a=P+C|0)<<18|a>>>14,x^=(a=S+E|0)<<7|a>>>25,A^=(a=x+S|0)<<9|a>>>23,E^=(a=A+x|0)<<13|a>>>19,S^=(a=E+A|0)<<18|a>>>14,k^=(a=T+I|0)<<7|a>>>25,C^=(a=k+T|0)<<9|a>>>23,I^=(a=C+k|0)<<13|a>>>19,T^=(a=I+C|0)<<18|a>>>14,P^=(a=B+D|0)<<7|a>>>25,_^=(a=P+B|0)<<9|a>>>23,D^=(a=_+P|0)<<13|a>>>19,B^=(a=D+_|0)<<18|a>>>14,M^=(a=O+R|0)<<7|a>>>25,N^=(a=M+O|0)<<9|a>>>23,R^=(a=N+M|0)<<13|a>>>19,O^=(a=R+N|0)<<18|a>>>14;e[0]=S>>>0&255,e[1]=S>>>8&255,e[2]=S>>>16&255,e[3]=S>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=B>>>0&255,e[9]=B>>>8&255,e[10]=B>>>16&255,e[11]=B>>>24&255,e[12]=O>>>0&255,e[13]=O>>>8&255,e[14]=O>>>16&255,e[15]=O>>>24&255,e[16]=k>>>0&255,e[17]=k>>>8&255,e[18]=k>>>16&255,e[19]=k>>>24&255,e[20]=C>>>0&255,e[21]=C>>>8&255,e[22]=C>>>16&255,e[23]=C>>>24&255,e[24]=_>>>0&255,e[25]=_>>>8&255,e[26]=_>>>16&255,e[27]=_>>>24&255,e[28]=D>>>0&255,e[29]=D>>>8&255,e[30]=D>>>16&255,e[31]=D>>>24&255}(e,t,r,n)}var S=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function x(e,t,r,n,a,i,o){var s,l,c=new Uint8Array(16),u=new Uint8Array(64);for(l=0;l<16;l++)c[l]=0;for(l=0;l<8;l++)c[l]=i[l];for(;a>=64;){for(v(u,c,o,S),l=0;l<64;l++)e[t+l]=r[n+l]^u[l];for(l=8,s=1;l<16;l++)s=s+(255&c[l])|0,c[l]=255&s,s>>>=8;a-=64,t+=64,n+=64}if(a>0)for(v(u,c,o,S),l=0;l<a;l++)e[t+l]=r[n+l]^u[l];return 0}function A(e,t,r,n,a){var i,o,s=new Uint8Array(16),l=new Uint8Array(64);for(o=0;o<16;o++)s[o]=0;for(o=0;o<8;o++)s[o]=n[o];for(;r>=64;){for(v(l,s,a,S),o=0;o<64;o++)e[t+o]=l[o];for(o=8,i=1;o<16;o++)i=i+(255&s[o])|0,s[o]=255&i,i>>>=8;r-=64,t+=64}if(r>0)for(v(l,s,a,S),o=0;o<r;o++)e[t+o]=l[o];return 0}function E(e,t,r,n,a){var i=new Uint8Array(32);b(i,n,a,S);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=n[s+16];return A(e,t,r,o,i)}function I(e,t,r,n,a,i,o){var s=new Uint8Array(32);b(s,i,o,S);for(var l=new Uint8Array(8),c=0;c<8;c++)l[c]=i[c+16];return x(e,t,r,n,a,l,s)}var T=function(e){var t,r,n,a,i,o,s,l;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=(t>>>13|r<<3)&8191,n=255&e[4]|(255&e[5])<<8,this.r[2]=(r>>>10|n<<6)&7939,a=255&e[6]|(255&e[7])<<8,this.r[3]=(n>>>7|a<<9)&8191,i=255&e[8]|(255&e[9])<<8,this.r[4]=(a>>>4|i<<12)&255,this.r[5]=i>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=(i>>>14|o<<2)&8191,s=255&e[12]|(255&e[13])<<8,this.r[7]=(o>>>11|s<<5)&8065,l=255&e[14]|(255&e[15])<<8,this.r[8]=(s>>>8|l<<8)&8191,this.r[9]=l>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function k(e,t,r,n,a,i){var o=new T(i);return o.update(r,n,a),o.finish(e,t),0}function C(e,t,r,n,a,i){var o=new Uint8Array(16);return k(o,0,r,n,a,i),y(e,t,o,0)}function _(e,t,r,n,a){var i;if(r<32)return -1;for(I(e,0,t,0,r,n,a),k(e,16,e,32,r-32,e),i=0;i<16;i++)e[i]=0;return 0}function D(e,t,r,n,a){var i,o=new Uint8Array(32);if(r<32||(E(o,0,32,n,a),0!==C(t,16,t,32,r-32,o)))return -1;for(I(e,0,t,0,r,n,a),i=0;i<32;i++)e[i]=0;return 0}function B(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function P(e){var t,r,n=1;for(t=0;t<16;t++)n=Math.floor((r=e[t]+n+65535)/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function M(e,t,r){for(var n,a=~(r-1),i=0;i<16;i++)n=a&(e[i]^t[i]),e[i]^=n,t[i]^=n}function N(e,t){var r,a,i,o=n(),s=n();for(r=0;r<16;r++)s[r]=t[r];for(P(s),P(s),P(s),a=0;a<2;a++){for(r=1,o[0]=s[0]-65517;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,M(s,o,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}
5function R(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return N(r,e),N(n,t),w(r,0,n,0)}function O(e){var t=new Uint8Array(32);return N(t,e),1&t[0]}function $(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function L(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function U(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function V(e,t,r){var n,a,i=0,o=0,s=0,l=0,c=0,u=0,p=0,h=0,d=0,f=0,g=0,m=0,y=0,w=0,v=0,b=0,S=0,x=0,A=0,E=0,I=0,T=0,k=0,C=0,_=0,D=0,B=0,P=0,M=0,N=0,R=0,O=r[0],$=r[1],L=r[2],U=r[3],V=r[4],F=r[5],j=r[6],q=r[7],z=r[8],K=r[9],G=r[10],H=r[11],W=r[12],J=r[13],X=r[14],Z=r[15];i+=(n=t[0])*O,o+=n*$,s+=n*L,l+=n*U,c+=n*V,u+=n*F,p+=n*j,h+=n*q,d+=n*z,f+=n*K,g+=n*G,m+=n*H,y+=n*W,w+=n*J,v+=n*X,b+=n*Z,o+=(n=t[1])*O,s+=n*$,l+=n*L,c+=n*U,u+=n*V,p+=n*F,h+=n*j,d+=n*q,f+=n*z,g+=n*K,m+=n*G,y+=n*H,w+=n*W,v+=n*J,b+=n*X,S+=n*Z,s+=(n=t[2])*O,l+=n*$,c+=n*L,u+=n*U,p+=n*V,h+=n*F,d+=n*j,f+=n*q,g+=n*z,m+=n*K,y+=n*G,w+=n*H,v+=n*W,b+=n*J,S+=n*X,x+=n*Z,l+=(n=t[3])*O,c+=n*$,u+=n*L,p+=n*U,h+=n*V,d+=n*F,f+=n*j,g+=n*q,m+=n*z,y+=n*K,w+=n*G,v+=n*H,b+=n*W,S+=n*J,x+=n*X,A+=n*Z,c+=(n=t[4])*O,u+=n*$,p+=n*L,h+=n*U,d+=n*V,f+=n*F,g+=n*j,m+=n*q,y+=n*z,w+=n*K,v+=n*G,b+=n*H,S+=n*W,x+=n*J,A+=n*X,E+=n*Z,u+=(n=t[5])*O,p+=n*$,h+=n*L,d+=n*U,f+=n*V,g+=n*F,m+=n*j,y+=n*q,w+=n*z,v+=n*K,b+=n*G,S+=n*H,x+=n*W,A+=n*J,E+=n*X,I+=n*Z,p+=(n=t[6])*O,h+=n*$,d+=n*L,f+=n*U,g+=n*V,m+=n*F,y+=n*j,w+=n*q,v+=n*z,b+=n*K,S+=n*G,x+=n*H,A+=n*W,E+=n*J,I+=n*X,T+=n*Z,h+=(n=t[7])*O,d+=n*$,f+=n*L,g+=n*U,m+=n*V,y+=n*F,w+=n*j,v+=n*q,b+=n*z,S+=n*K,x+=n*G,A+=n*H,E+=n*W,I+=n*J,T+=n*X,k+=n*Z,d+=(n=t[8])*O,f+=n*$,g+=n*L,m+=n*U,y+=n*V,w+=n*F,v+=n*j,b+=n*q,S+=n*z,x+=n*K,A+=n*G,E+=n*H,I+=n*W,T+=n*J,k+=n*X,C+=n*Z,f+=(n=t[9])*O,g+=n*$,m+=n*L,y+=n*U,w+=n*V,v+=n*F,b+=n*j,S+=n*q,x+=n*z,A+=n*K,E+=n*G,I+=n*H,T+=n*W,k+=n*J,C+=n*X,_+=n*Z,g+=(n=t[10])*O,m+=n*$,y+=n*L,w+=n*U,v+=n*V,b+=n*F,S+=n*j,x+=n*q,A+=n*z,E+=n*K,I+=n*G,T+=n*H,k+=n*W,C+=n*J,_+=n*X,D+=n*Z,m+=(n=t[11])*O,y+=n*$,w+=n*L,v+=n*U,b+=n*V,S+=n*F,x+=n*j,A+=n*q,E+=n*z,I+=n*K,T+=n*G,k+=n*H,C+=n*W,_+=n*J,D+=n*X,B+=n*Z,y+=(n=t[12])*O,w+=n*$,v+=n*L,b+=n*U,S+=n*V,x+=n*F,A+=n*j,E+=n*q,I+=n*z,T+=n*K,k+=n*G,C+=n*H,_+=n*W,D+=n*J,B+=n*X,P+=n*Z,w+=(n=t[13])*O,v+=n*$,b+=n*L,S+=n*U,x+=n*V,A+=n*F,E+=n*j,I+=n*q,T+=n*z,k+=n*K,C+=n*G,_+=n*H,D+=n*W,B+=n*J,P+=n*X,M+=n*Z,v+=(n=t[14])*O,b+=n*$,S+=n*L,x+=n*U,A+=n*V,E+=n*F,I+=n*j,T+=n*q,k+=n*z,C+=n*K,_+=n*G,D+=n*H,B+=n*W,P+=n*J,M+=n*X,N+=n*Z,b+=(n=t[15])*O,S+=n*$,x+=n*L,A+=n*U,E+=n*V,I+=n*F,T+=n*j,k+=n*q,C+=n*z,_+=n*K,D+=n*G,B+=n*H,P+=n*W,M+=n*J,N+=n*X,R+=n*Z,i+=38*S,o+=38*x,s+=38*A,l+=38*E,c+=38*I,u+=38*T,p+=38*k,h+=38*C,d+=38*_,f+=38*D,g+=38*B,m+=38*P,y+=38*M,w+=38*N,v+=38*R,a=Math.floor((n=i+(a=1)+65535)/65536),i=n-65536*a,a=Math.floor((n=o+a+65535)/65536),o=n-65536*a,a=Math.floor((n=s+a+65535)/65536),s=n-65536*a,a=Math.floor((n=l+a+65535)/65536),l=n-65536*a,a=Math.floor((n=c+a+65535)/65536),c=n-65536*a,a=Math.floor((n=u+a+65535)/65536),u=n-65536*a,a=Math.floor((n=p+a+65535)/65536),p=n-65536*a,a=Math.floor((n=h+a+65535)/65536),h=n-65536*a,a=Math.floor((n=d+a+65535)/65536),d=n-65536*a,a=Math.floor((n=f+a+65535)/65536),f=n-65536*a,a=Math.floor((n=g+a+65535)/65536),g=n-65536*a,a=Math.floor((n=m+a+65535)/65536),m=n-65536*a,a=Math.floor((n=y+a+65535)/65536),y=n-65536*a,a=Math.floor((n=w+a+65535)/65536),w=n-65536*a,a=Math.floor((n=v+a+65535)/65536),v=n-65536*a,a=Math.floor((n=b+a+65535)/65536),b=n-65536*a,i+=a-1+37*(a-1),a=Math.floor((n=i+(a=1)+65535)/65536),i=n-65536*a,a=Math.floor((n=o+a+65535)/65536),o=n-65536*a,a=Math.floor((n=s+a+65535)/65536),s=n-65536*a,a=Math.floor((n=l+a+65535)/65536),l=n-65536*a,a=Math.floor((n=c+a+65535)/65536),c=n-65536*a,a=Math.floor((n=u+a+65535)/65536),u=n-65536*a,a=Math.floor((n=p+a+65535)/65536),p=n-65536*a,a=Math.floor((n=h+a+65535)/65536),h=n-65536*a,a=Math.floor((n=d+a+65535)/65536),d=n-65536*a,a=Math.floor((n=f+a+65535)/65536),f=n-65536*a,a=Math.floor((n=g+a+65535)/65536),g=n-65536*a,a=Math.floor((n=m+a+65535)/65536),m=n-65536*a,a=Math.floor((n=y+a+65535)/65536),y=n-65536*a,a=Math.floor((n=w+a+65535)/65536),w=n-65536*a,a=Math.floor((n=v+a+65535)/65536),v=n-65536*a,a=Math.floor((n=b+a+65535)/65536),b=n-65536*a,i+=a-1+37*(a-1),e[0]=i,e[1]=o,e[2]=s,e[3]=l,e[4]=c,e[5]=u,e[6]=p,e[7]=h,e[8]=d,e[9]=f,e[10]=g,e[11
5]=m,e[12]=y,e[13]=w,e[14]=v,e[15]=b}function F(e,t){V(e,t,t)}function j(e,t){var r,a=n();for(r=0;r<16;r++)a[r]=t[r];for(r=253;r>=0;r--)F(a,a),2!==r&&4!==r&&V(a,a,t);for(r=0;r<16;r++)e[r]=a[r]}function q(e,t){var r,a=n();for(r=0;r<16;r++)a[r]=t[r];for(r=250;r>=0;r--)F(a,a),1!==r&&V(a,a,t);for(r=0;r<16;r++)e[r]=a[r]}function z(e,t,r){var a,i,o=new Uint8Array(32),s=new Float64Array(80),l=n(),u=n(),p=n(),h=n(),d=n(),f=n();for(i=0;i<31;i++)o[i]=t[i];for(o[31]=127&t[31]|64,o[0]&=248,$(s,r),i=0;i<16;i++)u[i]=s[i],h[i]=l[i]=p[i]=0;for(i=254,l[0]=h[0]=1;i>=0;--i)M(l,u,a=o[i>>>3]>>>(7&i)&1),M(p,h,a),L(d,l,p),U(l,l,p),L(p,u,h),U(u,u,h),F(h,d),F(f,l),V(l,p,l),V(p,u,d),L(d,l,p),U(l,l,p),F(u,l),U(p,h,f),V(l,p,c),L(l,l,h),V(p,p,l),V(l,h,f),V(h,u,s),F(u,d),M(l,u,a),M(p,h,a);for(i=0;i<16;i++)s[i+16]=l[i],s[i+32]=p[i],s[i+48]=u[i],s[i+64]=h[i];var g=s.subarray(32),m=s.subarray(16);return j(g,g),V(m,m,g),N(e,m),0}function K(e,t){return z(e,t,o)}function G(e,t){return a(t,32),K(e,t)}function H(e,t,r){var n=new Uint8Array(32);return z(n,r,t),b(e,i,n,S)}T.prototype.blocks=function(e,t,r){for(var n,a,i,o,s,l,c,u,p,h,d,f,g,m,y,w,v,b,S,x=2048*!this.fin,A=this.h[0],E=this.h[1],I=this.h[2],T=this.h[3],k=this.h[4],C=this.h[5],_=this.h[6],D=this.h[7],B=this.h[8],P=this.h[9],M=this.r[0],N=this.r[1],R=this.r[2],O=this.r[3],$=this.r[4],L=this.r[5],U=this.r[6],V=this.r[7],F=this.r[8],j=this.r[9];r>=16;)A+=8191&(n=255&e[t+0]|(255&e[t+1])<<8),E+=(n>>>13|(a=255&e[t+2]|(255&e[t+3])<<8)<<3)&8191,I+=(a>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6)&8191,T+=(i>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9)&8191,k+=(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12)&8191,C+=s>>>1&8191,_+=(s>>>14|(l=255&e[t+10]|(255&e[t+11])<<8)<<2)&8191,D+=(l>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5)&8191,B+=(c>>>8|(u=255&e[t+14]|(255&e[t+15])<<8)<<8)&8191,P+=u>>>5|x,p=(h=(p=0)+A*M+5*j*E+5*F*I+5*V*T+5*U*k)>>>13,h&=8191,h+=5*L*C,h+=5*$*_,h+=5*O*D,h+=5*R*B,h+=5*N*P,p+=h>>>13,h&=8191,p=(d=p+A*N+E*M+5*j*I+5*F*T+5*V*k)>>>13,d&=8191,d+=5*U*C,d+=5*L*_,d+=5*$*D,d+=5*O*B,d+=5*R*P,p+=d>>>13,d&=8191,p=(f=p+A*R+E*N+I*M+5*j*T+5*F*k)>>>13,f&=8191,f+=5*V*C,f+=5*U*_,f+=5*L*D,f+=5*$*B,f+=5*O*P,p+=f>>>13,f&=8191,p=(g=p+A*O+E*R+I*N+T*M+5*j*k)>>>13,g&=8191,g+=5*F*C,g+=5*V*_,g+=5*U*D,g+=5*L*B,g+=5*$*P,p+=g>>>13,g&=8191,p=(m=p+A*$+E*O+I*R+T*N+k*M)>>>13,m&=8191,m+=5*j*C,m+=5*F*_,m+=5*V*D,m+=5*U*B,m+=5*L*P,p+=m>>>13,m&=8191,p=(y=p+A*L+E*$+I*O+T*R+k*N)>>>13,y&=8191,y+=C*M,y+=5*j*_,y+=5*F*D,y+=5*V*B,y+=5*U*P,p+=y>>>13,y&=8191,p=(w=p+A*U+E*L+I*$+T*O+k*R)>>>13,w&=8191,w+=C*N,w+=_*M,w+=5*j*D,w+=5*F*B,w+=5*V*P,p+=w>>>13,w&=8191,p=(v=p+A*V+E*U+I*L+T*$+k*O)>>>13,v&=8191,v+=C*R,v+=_*N,v+=D*M,v+=5*j*B,v+=5*F*P,p+=v>>>13,v&=8191,p=(b=p+A*F+E*V+I*U+T*L+k*$)>>>13,b&=8191,b+=C*O,b+=_*R,b+=D*N,b+=B*M,b+=5*j*P,p+=b>>>13,b&=8191,p=(S=p+A*j+E*F+I*V+T*U+k*L)>>>13,S&=8191,S+=C*$,S+=_*O,S+=D*R,S+=B*N,S+=P*M,p+=S>>>13,S&=8191,h=8191&(p=(p=(p<<2)+p|0)+h|0),p>>>=13,d+=p,A=h,E=d,I=f,T=g,k=m,C=y,_=w,D=v,B=b,P=S,t+=16,r-=16;this.h[0]=A,this.h[1]=E,this.h[2]=I,this.h[3]=T,this.h[4]=k,this.h[5]=C,this.h[6]=_,this.h[7]=D,this.h[8]=B,this.h[9]=P},T.prototype.finish=function(e,t){var r,n,a,i,o=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=r,r=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,i=1;i<10;i++)o[i]=this.h[i]+r,r=o[i]>>>13,o[i]&=8191;for(o[9]-=8192,n=(1^r)-1,i=0;i<10;i++)o[i]&=n;for(i=0,n=~n;i<10;i++)this.h[i]=this.h[i]&n|o[i];for(i=1,this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>
5>>8|this.h[9]<<5)&65535,a=this.h[0]+this.pad[0],this.h[0]=65535&a;i<8;i++)a=(this.h[i]+this.pad[i]|0)+(a>>>16)|0,this.h[i]=65535&a;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},T.prototype.update=function(e,t,r){var n,a;if(this.leftover){for((a=16-this.leftover)>r&&(a=r),n=0;n<a;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=a,t+=a,this.leftover+=a,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(a=r-r%16,this.blocks(e,t,a),t+=a,r-=a),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var W=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817];function J(e,t,r,n){for(var a,i,o,s,l,c,u,p,h,d,f,g,m,y,w,v,b,S,x,A,E,I,T,k,C,_,D=new Int32Array(16),B=new Int32Array(16),P=e[0],M=e[1],N=e[2],R=e[3],O=e[4],$=e[5],L=e[6],U=e[7],V=t[0],F=t[1],j=t[2],q=t[3],z=t[4],K=t[5],G=t[6],H=t[7],J=0;n>=128;){for(x=0;x<16;x++)A=8*x+J,D[x]=r[A+0]<<24|r[A+1]<<16|r[A+2]<<8|r[A+3],B[x]=r[A+4]<<24|r[A+5]<<16|r[A+6]<<8|r[A+7];for(x=0;x<80;x++)if(a=P,i=M,o=N,s=R,l=O,c=$,u=L,p=U,h=V,d=F,f=j,g=q,m=z,y=K,w=G,v=H,E=U,T=65535&(I=H),k=I>>>16,C=65535&E,_=E>>>16,E=(O>>>14|z<<18)^(O>>>18|z<<14)^(z>>>9|O<<23),T+=65535&(I=(z>>>14|O<<18)^(z>>>18|O<<14)^(O>>>9|z<<23)),k+=I>>>16,C+=65535&E,_+=E>>>16,E=O&$^~O&L,T+=65535&(I=z&K^~z&G),k+=I>>>16,C+=65535&E,_+=E>>>16,E=W[2*x],T+=65535&(I=W[2*x+1]),k+=I>>>16,C+=65535&E,_+=E>>>16,E=D[x%16],T+=65535&(I=B[x%16]),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,b=65535&C|_<<16,S=65535&T|k<<16,E=b,T=65535&(I=S),k=I>>>16,C=65535&E,_=E>>>16,E=(P>>>28|V<<4)^(V>>>2|P<<30)^(V>>>7|P<<25),T+=65535&(I=(V>>>28|P<<4)^(P>>>2|V<<30)^(P>>>7|V<<25)),k+=I>>>16,C+=65535&E,_+=E>>>16,E=P&M^P&N^M&N,T+=65535&(I=V&F^V&j^F&j),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,p=65535&C|_<<16,v=65535&T|k<<16,E=s,T=65535&(I=g),k=I>>>16,C=65535&E,_=E>>>16,E=b,T+=65535&(I=S),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,s=65535&C|_<<16,g=65535&T|k<<16,M=a,N=i,R=o,O=s,$=l,L=c,U=u,P=p,F=h,j=d,q=f,z=g,K=m,G=y,H=w,V=v,x%16==15)for(A=0;A<16;A++)E=D[A],T=65535&(I=B[A]),k=I>>>16,C=65535&E,_=E>>>16,E=D[(A+9)%16],T+=65535&(I=B[(A+9)%16]),k+=I>>>16,C+=65535&E,_+=E>>>16,E=((b=D[(A+1)%16])>>>1|(S=B[(A+1)%16])<<31)^(b>>>8|S<<24)^b>>>7,T+=65535&(I=(S>>>1|b<<31)^(S>>>8|b<<24)^(S>>>7|b<<25)),k+=I>>>16,C+=65535&E,_+=E>>>16,E=((b=D[(A+14)%16])>>>19|(S=B[(A+14)%16])<<13)^(S>>>29|b<<3)^b>>>6,T+=65535&(I=(S>>>19|b<<13)^(b>>>29|S<<3)^(S>>>6|b<<26)),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,D[A]=65535&C|_<<16,B[A]=65535&T|k<<16;E=P,T=65535&(I=V),k=I>>>16,C=65535&E,_=E>>>16,E=e[0],T+=65535&(I=t[0]),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,e[0]=P=65535&C|_<<16,t[0]=V=65535&T|k<<16,E=M,T=65535&(I=F),k=I>>>16,C=65535&E,_=E>>>16,E=e[1],T+=65535&(I=t[1]),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,e[1]=M=65535&C|_<<16,t[1]=F=65535&T|k<<16,E=N,T=65535&(I=j),k=I>>>16,C=65535&E,_=E>>>16,E=e[2],T+=65535&(I=t[2]),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,e[2]=N=65535&C|_<<16,t[2]=j=65535&T|k<<16,E=R,T=65535&(I=q),k=I>>>16,C=65535&E,_=E>>>16,E=e[3],T+=65535&(I=t[3]),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,e[3]=R=65535&C|_<<16,t[3]=q=65535&T|k<<16,E=O,T=65535&(I=z),k=I>>>16,C=65535&E,_=E>>>16,E=e[4],T+=65535&(I=t[4]),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,e[4]=O=65535&C|_<<16,t[4]=z=65535&T|k<<16,E=$,T=65535&(I=K),k=I>>>16,C=65535&E,_=E>>>16,E=e[5],T+=65535&(I=t[5]),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,e[5]=$=65535&C|_<<16,t[5]=K=65535&T|k<<16,E=L,T=65535&(I=G),k=I>>>16,C=65535&E,_=E>>>16,E=e[6],T+=65535&(I=t[6]),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,e[6]=L=65535&C|_<<16,t[6]=G=65535&T|k<<16,E=U,T=65535&(I=H),k=I>>>16,C=65535&E,_=E>>>16,E=e[7],T+=65535&(I=t[7]),k+=I>>>16,C+=65535&E,_+=E>>>16,k+=T>>>16,C+=k>>>16,_+=C>>>16,e[7]=U=65535&C|_<<16,t[7]=H=65535&T|k<<16,J+=128,n-=128}return n}function X(e,t,r){var n,a=new Int32Array(8),i=new Int32Array(8),o=new Uint8Array(256),s=r;
5for(a[0]=0x6a09e667,a[1]=0xbb67ae85,a[2]=0x3c6ef372,a[3]=0xa54ff53a,a[4]=0x510e527f,a[5]=0x9b05688c,a[6]=0x1f83d9ab,a[7]=0x5be0cd19,i[0]=0xf3bcc908,i[1]=0x84caa73b,i[2]=0xfe94f82b,i[3]=0x5f1d36f1,i[4]=0xade682d1,i[5]=0x2b3e6c1f,i[6]=0xfb41bd6b,i[7]=0x137e2179,J(a,i,t,r),r%=128,n=0;n<r;n++)o[n]=t[s-r+n];for(o[r]=128,o[(r=256-(r<112)*128)-9]=0,g(o,r-8,s/0x20000000|0,s<<3),J(a,i,o,r),n=0;n<8;n++)g(e,8*n,a[n],i[n]);return 0}function Z(e,t){var r=n(),a=n(),i=n(),o=n(),s=n(),l=n(),c=n(),u=n(),h=n();U(r,e[1],e[0]),U(h,t[1],t[0]),V(r,r,h),L(a,e[0],e[1]),L(h,t[0],t[1]),V(a,a,h),V(i,e[3],t[3]),V(i,i,p),V(o,e[2],t[2]),L(o,o,o),U(s,a,r),U(l,o,i),L(c,o,i),L(u,a,r),V(e[0],s,l),V(e[1],u,c),V(e[2],c,l),V(e[3],s,u)}function Y(e,t,r){var n;for(n=0;n<4;n++)M(e[n],t[n],r)}function Q(e,t){var r=n(),a=n(),i=n();j(i,t[2]),V(r,t[0],i),V(a,t[1],i),N(e,a),e[31]^=O(r)<<7}function ee(e,t,r){var n,a;for(B(e[0],s),B(e[1],l),B(e[2],l),B(e[3],s),a=255;a>=0;--a)Y(e,t,n=r[a/8|0]>>(7&a)&1),Z(t,e),Z(e,e),Y(e,t,n)}function et(e,t){var r=[n(),n(),n(),n()];B(r[0],h),B(r[1],d),B(r[2],l),V(r[3],h,d),ee(e,r,t)}function er(e,t,r){var i,o=new Uint8Array(64),s=[n(),n(),n(),n()];for(r||a(t,32),X(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,et(s,o),Q(e,s),i=0;i<32;i++)t[i+32]=e[i];return 0}var en=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ea(e,t){var r,n,a,i;for(n=63;n>=32;--n){for(r=0,a=n-32,i=n-12;a<i;++a)t[a]+=r-16*t[n]*en[a-(n-32)],r=Math.floor((t[a]+128)/256),t[a]-=256*r;t[a]+=r,t[n]=0}for(a=0,r=0;a<32;a++)t[a]+=r-(t[31]>>4)*en[a],r=t[a]>>8,t[a]&=255;for(a=0;a<32;a++)t[a]-=r*en[a];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function ei(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ea(e,r)}function eo(e,t,r,a){var i,o,s=new Uint8Array(64),l=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),p=[n(),n(),n(),n()];for(X(s,a,32),s[0]&=248,s[31]&=127,s[31]|=64,i=0;i<r;i++)e[64+i]=t[i];for(i=0;i<32;i++)e[32+i]=s[32+i];for(X(c,e.subarray(32),r+32),ei(c),et(p,c),Q(e,p),i=32;i<64;i++)e[i]=a[i];for(X(l,e,r+64),ei(l),i=0;i<64;i++)u[i]=0;for(i=0;i<32;i++)u[i]=c[i];for(i=0;i<32;i++)for(o=0;o<32;o++)u[i+o]+=l[i]*s[o];return ea(e.subarray(32),u),r+64}function es(e,t,r,a){var i,o,c,p,h,d,g,m,y=new Uint8Array(32),v=new Uint8Array(64),b=[n(),n(),n(),n()],S=[n(),n(),n(),n()];if(r<64||(i=n(),o=n(),c=n(),p=n(),h=n(),d=n(),g=n(),(B(S[2],l),$(S[1],a),F(c,S[1]),V(p,c,u),U(c,c,S[2]),L(p,S[2],p),F(h,p),F(d,h),V(g,d,h),V(i,g,c),V(i,i,p),q(i,i),V(i,i,c),V(i,i,p),V(i,i,p),V(S[0],i,p),F(o,S[0]),V(o,o,p),R(o,c)&&V(S[0],S[0],f),F(o,S[0]),V(o,o,p),R(o,c))?-1:(O(S[0])===a[31]>>7&&U(S[0],s,S[0]),V(S[3],S[0],S[1]),0)))return -1;for(m=0;m<r;m++)e[m]=t[m];for(m=0;m<32;m++)e[m+32]=a[m];if(X(v,e,r),ei(v),ee(b,S,v),et(S,t.subarray(32)),Z(b,S),Q(y,b),r-=64,w(t,0,y,0)){for(m=0;m<r;m++)e[m]=0;return -1}for(m=0;m<r;m++)e[m]=t[m+64];return r}function el(e,t){if(32!==e.length)throw Error("bad key size");if(24!==t.length)throw Error("bad nonce size")}function ec(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw TypeError("unexpected type, use Uint8Array")}function eu(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:b,crypto_stream_xor:I,crypto_stream:E,crypto_stream_salsa20_xor:x,crypto_stream_salsa20:A,crypto_onetimeauth:k,crypto_onetimeauth_verify:C,crypto_verify_16:y,crypto_verify_32:w,crypto_secretbox:_,crypto_secretbox_open:D,crypto_scalarmult:z,crypto_scalarmult_base:K,
5crypto_box_beforenm:H,crypto_box_afternm:_,crypto_box:function(e,t,r,n,a,i){var o=new Uint8Array(32);return H(o,a,i),_(e,t,r,n,o)},crypto_box_open:function(e,t,r,n,a,i){var o=new Uint8Array(32);return H(o,a,i),D(e,t,r,n,o)},crypto_box_keypair:G,crypto_hash:X,crypto_sign:eo,crypto_sign_keypair:er,crypto_sign_open:es,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:64,crypto_sign_PUBLICKEYBYTES:32,crypto_sign_SECRETKEYBYTES:64,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:n,D:u,L:en,pack25519:N,unpack25519:$,M:V,A:L,S:F,Z:U,pow2523:q,add:Z,set25519:B,modL:ea,scalarmult:ee,scalarbase:et},e.randomBytes=function(e){var t=new Uint8Array(e);return a(t,e),t},e.secretbox=function(e,t,r){ec(e,t,r),el(r,t);for(var n=new Uint8Array(32+e.length),a=new Uint8Array(n.length),i=0;i<e.length;i++)n[i+32]=e[i];return _(a,n,n.length,t,r),a.subarray(16)},e.secretbox.open=function(e,t,r){ec(e,t,r),el(r,t);for(var n=new Uint8Array(16+e.length),a=new Uint8Array(n.length),i=0;i<e.length;i++)n[i+16]=e[i];return n.length<32||0!==D(a,n,n.length,t,r)?null:a.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(ec(e,t),32!==e.length)throw Error("bad n size");if(32!==t.length)throw Error("bad p size");var r=new Uint8Array(32);return z(r,e,t),r},e.scalarMult.base=function(e){if(ec(e),32!==e.length)throw Error("bad n size");var t=new Uint8Array(32);return K(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,a){var i=e.box.before(n,a);return e.secretbox(t,r,i)},e.box.before=function(e,t){ec(e,t);if(32!==e.length)throw Error("bad public key size");if(32!==t.length)throw Error("bad secret key size");var r=new Uint8Array(32);return H(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,a){var i=e.box.before(n,a);return e.secretbox.open(t,r,i)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return G(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(ec(e),32!==e.length)throw Error("bad secret key size");var t=new Uint8Array(32);return K(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(ec(e,t),64!==t.length)throw Error("bad secret key size");var r=new Uint8Array(64+e.length);return eo(r,e,e.length,t),r},e.sign.open=function(e,t){if(ec(e,t),32!==t.length)throw Error("bad public key size");var r=new Uint8Array(e.length),n=es(r,e,e.length,t);if(n<0)return null;for(var a=new Uint8Array(n),i=0;i<a.length;i++)a[i]=r[i];return a},e.sign.detached=function(t,r){for(var n=e.sign(t,r),a=new Uint8Array(64),i=0;i<a.length;i++)a[i]=n[i];return a},e.sign.detached.verify=function(e,t,r){if(ec(e,t,r),64!==t.length)throw Error("bad signature size");if(32!==r.length)throw Error("bad public key size");var n,a=new Uint8Array(64+e.length),i=new Uint8Array(64+e.length);for(n=0;n<64;n++)a[n]=t[n];for(n=0;n<e.length;n++)a[n+64]=e[n];return es(i,a,a.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return er(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(ec(e),64!==e.length)throw Error("bad secret key size");for(var t=new Uint8Array(32),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(ec(e),32!==e.length)throw Error("bad seed size");for(var t=new Uint8Array(32),r=new Uint8Array(64),n=0;n<32;n++)r[n]=e[n];return er(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=32,e.sign.secretKeyLength=64,e.sign.seedLength=32,e.sign.signatureLength=64,e.hash=function(e){ec(e);var t=new Uint8Array(64);return X(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return ec(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===m(e,0,t,0,e.length)},e.setPRNG=function(e){a=e},(t="undefined"!=typeof self?self.crypto||self.msCrypto:null)&&t.getRandomValues?e.setPRNG(function(e,r){var n,a=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(a.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=a[n];eu(a)}):(t=r(98308))&&t.randomBytes&&e.setPRNG(function(e,r){var n,a=t.randomBytes(r);for(n=0;n<r;n++)e[n]=a[n];eu(a)})}(e.exports?e.exports:self.nacl=self.nacl||{})},65047:(e,t,r)=>{"use strict";function n(){return"undefined"!=typeof window}function a(e){return s(e)?(e.nodeName||"").toLowerCase():"#document"}function i(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function o(e){var t;return null==(t=(s(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function s(e){return!!n()&&(e instanceof Node||e instanceof i(e).Node)}function l(e){return!!n()&&(e instanceof Element||e instanceof i(e).Element)}function c(e){return!!n()&&(e instanceof HTMLElement||e instanceof i(e).HTMLElement)}function u(e){return!!n()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof i(e).ShadowRoot)}r.d(t,{$4:()=>k,CP:()=>T,L9:()=>I,Lv:()=>f,Ng:()=>u,Tc:()=>x,Tf:()=>m,ZU:()=>h,_m:()=>C,ep:()=>o,eu:()=>E,gJ:()=>S,mq:()=>a,sQ:()=>b,sb:()=>c,v9:()=>function e(t,r,n){var a;void 0===r&&(r=[]),void 0===n&&(n=!0);let o=function e(t){let r=k(t);return E(r)?t.ownerDocument?t.ownerDocument.body:t.body:c(r)&&h(r)?r:e(r)}(t),s=o===(null==(a=t.ownerDocument)?void 0:a.body),l=i(o);if(s){let t=C(l);
5return r.concat(l,l.visualViewport||[],h(o)?o:[],t&&n?e(t):[])}return r.concat(o,e(o,[],n))},vq:()=>l,zk:()=>i});let p=new Set(["inline","contents"]);function h(e){let{overflow:t,overflowX:r,overflowY:n,display:a}=I(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!p.has(a)}let d=new Set(["table","td","th"]);function f(e){return d.has(a(e))}let g=[":popover-open",":modal"];function m(e){return g.some(t=>{try{return e.matches(t)}catch(e){return!1}})}let y=["transform","translate","scale","rotate","perspective"],w=["transform","translate","scale","rotate","perspective","filter"],v=["paint","layout","strict","content"];function b(e){let t=x(),r=l(e)?I(e):e;return y.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||w.some(e=>(r.willChange||"").includes(e))||v.some(e=>(r.contain||"").includes(e))}function S(e){let t=k(e);for(;c(t)&&!E(t);){if(b(t))return t;if(m(t))break;t=k(t)}return null}function x(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let A=new Set(["html","body","#document"]);function E(e){return A.has(a(e))}function I(e){return i(e).getComputedStyle(e)}function T(e){return l(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function k(e){if("html"===a(e))return e;let t=e.assignedSlot||e.parentNode||u(e)&&e.host||o(e);return u(t)?t.host:t}function C(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}},65111:(e,t,r)=>{"use strict";r.d(t,{E:()=>f});var n=r(79175),a=r(82248);r(64527);var i=r(76825),o=r(94393),s=r(51049),l=r(44241),c=r(41903),u=r(97569),p={root:"m_18320242","skeleton-fade":"m_299c329c"};let h={visible:!0,animate:!0},d=(0,o.V)((e,t)=>{let{width:r,height:n,radius:o,circle:s}=t;return{root:{"--skeleton-height":(0,a.D)(n),"--skeleton-width":s?(0,a.D)(n):(0,a.D)(r),"--skeleton-radius":s?"1000px":void 0===o?void 0:(0,i.nJ)(o)}}}),f=(0,u.P9)((e,t)=>{let r=(0,s.Y)("Skeleton",h,e),{classNames:a,className:i,style:o,styles:u,unstyled:f,vars:g,width:m,height:y,circle:w,visible:v,radius:b,animate:S,mod:x,attributes:A,...E}=r,I=(0,l.I)({name:"Skeleton",classes:p,props:r,className:i,style:o,classNames:a,styles:u,unstyled:f,attributes:A,vars:g,varsResolver:d});return(0,n.jsx)(c.a,{ref:t,...I("root"),mod:[{visible:v,animate:S},x],...E})});f.classes=p,f.displayName="@mantine/core/Skeleton"},67769:(e,t,r)=>{"use strict";r.d(t,{$T:()=>i,$o:()=>f,Eh:()=>l,TG:()=>s,Tw:()=>p,WA:()=>u,WU:()=>h,XI:()=>c,Xt:()=>o,Y7:()=>g,dJ:()=>d,eB:()=>y,pN:()=>m});var n=r(12929),a=r(33210);class i{constructor(e){this.stateProofVotersCommitment=e.stateProofVotersCommitment,this.stateProofOnlineTotalWeight=e.stateProofOnlineTotalWeight,this.stateProofNextRound=e.stateProofNextRound}getEncodingSchema(){return i.encodingSchema}toEncodingData(){return new Map([["v",this.stateProofVotersCommitment],["t",this.stateProofOnlineTotalWeight],["n",this.stateProofNextRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded StateProofTrackingData: ${e}`);return new i({stateProofVotersCommitment:e.get("v"),stateProofOnlineTotalWeight:e.get("t"),stateProofNextRound:e.get("n")})}}i.encodingSchema=new n.pZ((0,n.co)([{key:"v",valueSchema:new n.HM},{key:"t",valueSchema:new n.qc},{key:"n",valueSchema:new n.qc}]));class o{constructor(e){this.nativeSha512_256Commitment=e.nativeSha512_256Commitment,this.sha256Commitment=e.sha256Commitment}getEncodingSchema(){return o.encodingSchema}toEncodingData(){return new Map([["txn",this.nativeSha512_256Commitment],["txn256",this.sha256Commitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded TxnCommitments: ${e}`);return new o({nativeSha512_256Commitment:e.get("txn"),sha256Commitment:e.get("txn256")})}}o.encodingSchema=new n.pZ((0,n.co)([{key:"txn",valueSchema:new n.lb(32)},{key:"txn256",valueSchema:new n.lb(32)}]));class s{constructor(e){this.feeSink=e.feeSink,this.rewardsPool=e.rewardsPool,this.rewardsLevel=e.rewardsLevel,this.rewardsRate=e.rewardsRate,this.rewardsResidue=e.rewardsResidue,this.rewardsRecalculationRound=e.rewardsRecalculationRound}getEncodingSchema(){return s.encodingSchema}toEncodingData(){return new Map([["fees",this.feeSink],["rwd",this.rewardsPool],["earn",this.rewardsLevel],["rate",this.rewardsRate],["frac",this.rewardsResidue],["rwcalr",this.rewardsRecalculationRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded RewardState: ${e}`);return new s({feeSink:e.get("fees"),rewardsPool:e.get("rwd"),rewardsLevel:e.get("earn"),rewardsRate:e.get("rate"),rewardsResidue:e.get("frac"),rewardsRecalculationRound:e.get("rwcalr")})}}s.encodingSchema=new n.pZ((0,n.co)([{key:"fees",valueSchema:new n.eu},{key:"rwd",valueSchema:new n.eu},{key:"earn",valueSchema:new n.qc},{key:"rate",valueSchema:new n.qc},{key:"frac",valueSchema:new n.qc},{key:"rwcalr",valueSchema:new n.qc}]));class l{constructor(e){this.currentProtocol=e.currentProtocol,this.nextProtocol=e.nextProtocol,this.nextProtocolApprovals=e.nextProtocolApprovals,this.nextProtocolVoteBefore=e.nextProtocolVoteBefore,this.nextProtocolSwitchOn=e.nextProtocolSwitchOn}getEncodingSchema(){return l.encodingSchema}toEncodingData(){return new Map([["proto",this.currentProtocol],["nextproto",this.nextProtocol],["nextyes",this.nextProtocolApprovals],["nextbefore",this.nextProtocolVoteBefore],["nextswitch",this.nextProtocolSwitchOn]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded UpgradeState: ${e}`);return new l({currentProtocol:e.get("proto"),nextProtocol:e.get("nextproto"),nextProtocolApprovals:e.get("nextyes"),nextProtocolVoteBefore:e.get("nextbefore"),nextProtocolSwitchOn:e.get("nextswitch")})}}l.encodingSchema=new n.pZ((0,n.co)([{key:"proto",valueSchema:new n.nY},{key:"nextproto",valueSchema:new n.nY},{key:"nextyes",valueSchema:new n.qc},{key:"nextbefore",valueSchema:new n.qc},{key:"nextswitch",valueSchema:new n.qc}]));class c{constructor(e){this.upgradePropose=e.upgradePropose,this.upgradeDelay=e.upgradeDelay,this.upgradeApprove=e.upgradeApprove}getEncodingSchema(){return c.encodingSchema}toEncodingData(){return new Map([["upgradeprop",this.upgradePropose],["upgradedelay",this.upgradeDelay],["upgradeyes",this.upgradeApprove]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded UpgradeVote: ${e}`);return new c({upgradePropose:e.get("upgradeprop"),upgradeDelay:e.get("upgradedelay"),upgradeApprove:e.get("upgradeyes")})}}c.encodingSchema=new n.pZ((0,n.co)([{key:"upgradeprop",valueSchema:new n.nY},{key:"upgradedelay",valueSchema:new n.qc},{key:"upgradeyes",valueSchema:new n.od}
5]));class u{constructor(e){this.expiredParticipationAccounts=e.expiredParticipationAccounts,this.absentParticipationAccounts=e.absentParticipationAccounts}getEncodingSchema(){return u.encodingSchema}toEncodingData(){return new Map([["partupdrmv",this.expiredParticipationAccounts],["partupdabs",this.absentParticipationAccounts]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded ParticipationUpdates: ${e}`);return new u({expiredParticipationAccounts:e.get("partupdrmv"),absentParticipationAccounts:e.get("partupdabs")})}}u.encodingSchema=new n.pZ((0,n.co)([{key:"partupdrmv",valueSchema:new n.vf(new n.eu)},{key:"partupdabs",valueSchema:new n.vf(new n.eu)}]));class p{constructor(e){this.round=e.round,this.branch=e.branch,this.seed=e.seed,this.txnCommitments=e.txnCommitments,this.timestamp=e.timestamp,this.genesisID=e.genesisID,this.genesisHash=e.genesisHash,this.proposer=e.proposer,this.feesCollected=e.feesCollected,this.bonus=e.bonus,this.proposerPayout=e.proposerPayout,this.rewardState=e.rewardState,this.upgradeState=e.upgradeState,this.upgradeVote=e.upgradeVote,this.txnCounter=e.txnCounter,this.stateproofTracking=e.stateproofTracking,this.participationUpdates=e.participationUpdates}getEncodingSchema(){return p.encodingSchema}toEncodingData(){let e=new Map([["rnd",this.round],["prev",this.branch],["seed",this.seed],["ts",this.timestamp],["gen",this.genesisID],["gh",this.genesisHash],["prp",this.proposer],["fc",this.feesCollected],["bi",this.bonus],["pp",this.proposerPayout],["tc",this.txnCounter],["spt",(0,n.sm)(this.stateproofTracking,(e,t)=>[e,t.toEncodingData()])]]);return(0,n.o1)(e,this.txnCommitments.toEncodingData(),this.rewardState.toEncodingData(),this.upgradeState.toEncodingData(),this.upgradeVote.toEncodingData(),this.participationUpdates.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded BlockHeader: ${e}`);return new p({round:e.get("rnd"),branch:e.get("prev"),seed:e.get("seed"),txnCommitments:o.fromEncodingData(e),timestamp:e.get("ts"),genesisID:e.get("gen"),genesisHash:e.get("gh"),proposer:e.get("prp"),feesCollected:e.get("fc"),bonus:e.get("bi"),proposerPayout:e.get("pp"),rewardState:s.fromEncodingData(e),upgradeState:l.fromEncodingData(e),upgradeVote:c.fromEncodingData(e),txnCounter:e.get("tc"),stateproofTracking:(0,n.sm)(e.get("spt"),(e,t)=>[Number(e),i.fromEncodingData(t)]),participationUpdates:u.fromEncodingData(e)})}}p.encodingSchema=new n.pZ((0,n.co)([{key:"rnd",valueSchema:new n.qc},{key:"prev",valueSchema:new n.xk},{key:"seed",valueSchema:new n.HM},{key:"",valueSchema:o.encodingSchema,embedded:!0},{key:"ts",valueSchema:new n.qc},{key:"gen",valueSchema:new n.nY},{key:"gh",valueSchema:new n.lb(32)},{key:"prp",valueSchema:new n.eu},{key:"fc",valueSchema:new n.qc},{key:"bi",valueSchema:new n.qc},{key:"pp",valueSchema:new n.qc},{key:"",valueSchema:s.encodingSchema,embedded:!0},{key:"",valueSchema:l.encodingSchema,embedded:!0},{key:"",valueSchema:c.encodingSchema,embedded:!0},{key:"tc",valueSchema:new n.qc},{key:"spt",valueSchema:new n.ac(i.encodingSchema)},{key:"",valueSchema:u.encodingSchema,embedded:!0}]));class h{constructor(e){this.action=e.action,this.bytes=e.bytes,this.uint=e.uint}getEncodingSchema(){return h.encodingSchema}toEncodingData(){return new Map([["at",this.action],["bs",this.bytes],["ui",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded ValueDelta: ${e}`);return new h({action:Number(e.get("at")),bytes:e.get("bs"),uint:e.get("ui")})}}h.encodingSchema=new n.pZ((0,n.co)([{key:"at",valueSchema:new n.qc},{key:"bs",valueSchema:new n.D4},{key:"ui",valueSchema:new n.qc}]));class d{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new n.pZ([]),this.encodingSchemaValue.pushEntries(...(0,n.co)([{key:"gd",valueSchema:new n.KN(new n.rT(h.encodingSchema))},{key:"ld",valueSchema:new n.KN(new n.ac(new n.rT(h.encodingSchema)))},{key:"sa",valueSchema:new n.KN(new n.vf(new n.eu))},{key:"lg",valueSchema:new n.KN(new n.vf(new n.D4))},{key:"itx",valueSchema:new n.KN(new n.vf(g.encodingSchema))}]))),this.encodingSchemaValue}constructor(e){this.globalDelta=e.globalDelta??new Map,this.localDeltas=e.localDeltas??new Map,this.sharedAccts=e.sharedAccts??[],this.logs=e.logs??[],this.innerTxns=e.innerTxns??[]}getEncodingSchema(){return d.encodingSchema}toEncodingData(){return new Map([["gd",(0,n.sm)(this.globalDelta,(e,t)=>[e,t.toEncodingData()])],["ld",(0,n.sm)(this.localDeltas,(e,t)=>[e,(0,n.sm)(t,(e,t)=>[e,t.toEncodingData()])])],["sa",this.sharedAccts],["lg",this.logs],["itx",this.innerTxns.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded EvalDelta: ${e}`);return new d({globalDelta:e.get("gd")?(0,n.sm)(e.get("gd"),(e,t)=>[e,h.fromEncodingData(t)]):void 0,localDeltas:e.get("ld")?(0,n.sm)(e.get("ld"),(e,t)=>[Number(e),(0,n.sm)(t,(e,t)=>[e,h.fromEncodingData(t)])]):void 0,sharedAccts:e.get("sa"),logs:e.get("lg"),innerTxns:(e.get("itx")??[]).map(g.fromEncodingData)})}}class f{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new n.pZ([]),this.encodingSchemaValue.pushEntries(...(0,n.co)([{key:"ca",valueSchema:new n.KN(new n.qc)},{key:"aca",valueSchema:new n.KN(new n.qc)},{key:"rs",valueSchema:new n.KN(new n.qc)},{key:"rr",valueSchema:new n.KN(new n.qc)},{key:"rc",valueSchema:new n.KN(new n.qc)},{key:"dt",valueSchema:new n.KN(d.encodingSchema)},{key:"caid",valueSchema:new n.KN(new n.qc)},{key:"apid",valueSchema:new n.KN(new n.qc)}]))),this.encodingSchemaValue}
5constructor(e){this.closingAmount=e.closingAmount,this.assetClosingAmount=e.assetClosingAmount,this.senderRewards=e.senderRewards,this.receiverRewards=e.receiverRewards,this.closeRewards=e.closeRewards,this.evalDelta=e.evalDelta,this.configAsset=e.configAsset,this.applicationID=e.applicationID}getEncodingSchema(){return f.encodingSchema}toEncodingData(){return new Map([["ca",this.closingAmount],["aca",this.assetClosingAmount],["rs",this.senderRewards],["rr",this.receiverRewards],["rc",this.closeRewards],["dt",this.evalDelta?this.evalDelta.toEncodingData():void 0],["caid",this.configAsset],["apid",this.applicationID]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded ApplyData: ${e}`);return new f({closingAmount:e.get("ca"),assetClosingAmount:e.get("aca"),senderRewards:e.get("rs"),receiverRewards:e.get("rr"),closeRewards:e.get("rc"),evalDelta:e.get("dt")?d.fromEncodingData(e.get("dt")):void 0,configAsset:e.get("caid"),applicationID:e.get("apid")})}}class g{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new n.pZ([]),this.encodingSchemaValue.pushEntries(...(0,n.co)([{key:"",valueSchema:a.Zj.encodingSchema,embedded:!0},{key:"",valueSchema:f.encodingSchema,embedded:!0}]))),this.encodingSchemaValue}constructor(e){this.signedTxn=e.signedTxn,this.applyData=e.applyData}getEncodingSchema(){return g.encodingSchema}toEncodingData(){return(0,n.o1)(this.signedTxn.toEncodingData(),this.applyData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded SignedTxnWithAD: ${e}`);return new g({signedTxn:a.Zj.fromEncodingData(e),applyData:f.fromEncodingData(e)})}}class m{constructor(e){this.signedTxn=e.signedTxn,this.hasGenesisID=e.hasGenesisID,this.hasGenesisHash=e.hasGenesisHash}getEncodingSchema(){return m.encodingSchema}toEncodingData(){let e=new Map([["hgi",this.hasGenesisID],["hgh",this.hasGenesisHash]]);return(0,n.o1)(e,this.signedTxn.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded SignedTxnInBlock: ${e}`);return new m({signedTxn:g.fromEncodingData(e),hasGenesisID:e.get("hgi"),hasGenesisHash:e.get("hgh")})}}m.encodingSchema=new n.pZ((0,n.co)([{key:"",valueSchema:g.encodingSchema,embedded:!0},{key:"hgi",valueSchema:new n.od},{key:"hgh",valueSchema:new n.od}]));class y{constructor(e){this.header=e.header,this.payset=e.payset}getEncodingSchema(){return y.encodingSchema}toEncodingData(){let e=new Map([["txns",this.payset.map(e=>e.toEncodingData())]]);return(0,n.o1)(e,this.header.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded BlockHeader: ${e}`);return new y({header:p.fromEncodingData(e),payset:e.get("txns").map(m.fromEncodingData)})}}y.encodingSchema=new n.pZ((0,n.co)([{key:"",valueSchema:p.encodingSchema,embedded:!0},{key:"txns",valueSchema:new n.vf(m.encodingSchema)}]))},68687:(e,t,r)=>{"use strict";r.d(t,{B:()=>i});var n=r(79142),a=n.Ay$.modelsv2;async function i(e,t,r){let i=e.buildGroup().map(e=>n.Ay$.encodeUnsignedSimulateTransaction(e.txn)),o=new a.SimulateRequest({...r??{allowEmptySignatures:!0,fixSigners:!0,allowMoreLogging:!0,execTraceConfig:new a.SimulateTraceConfig({enable:!0,scratchChange:!0,stackChange:!0,stateChange:!0})},txnGroups:[new a.SimulateRequestTransactionGroup({txns:i.map(e=>(0,n.VQj)(e,n.ZjB))})]});return await t.simulateTransactions(o).do()}},68724:(e,t,r)=>{"use strict";r.d(t,{$m:()=>g,FS:()=>f,Hj:()=>w,QS:()=>l,jX:()=>m,pV:()=>d,t4:()=>u,vR:()=>c});var n=r(43795),a=r(87131),i=r(46085),o=r(96898),s=r(30841);let l=36,c=4,u="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",p="address seems to be malformed";function h(e){return Uint8Array.from(a.uj(e).slice(a.Sj-c,a.Sj))}class d{constructor(e){if(!(e instanceof Uint8Array))throw Error(`${p}: ${e} is not Uint8Array, type ${typeof e}`);if(e.length!==l-c)throw Error(`${p}: 0x${(0,s.My)(e)}, length ${e.length}`);this.publicKey=e}equals(e){return e instanceof d&&i.af(this.publicKey,e.publicKey)}checksum(){return h(this.publicKey)}toString(){return n.encode(i.zI(this.publicKey,this.checksum())).slice(0,58)}static fromString(e){if("string"!=typeof e)throw Error(`${p}: expected string, got ${typeof e}, ${e}`);if(58!==e.length)throw Error(`${p}: expected length 58, got ${e.length}: ${e}`);let t=n.decode.asBytes(e);if(t.length!==l)throw Error(`${p}: expected byte length ${l}, got ${t.length}`);let r=new Uint8Array(t.slice(0,l-c)),o=new Uint8Array(t.slice(a.Xx,l)),s=h(r);if(!i.af(s,o))throw Error("wrong checksum for address");return new d(r)}static zeroAddress(){return new d(new Uint8Array(l-c))}}function f(e){return d.fromString(e)}function g(e){try{d.fromString(e)}catch(e){return!1}return!0}function m(e){return new d(e).toString()}let y=new TextEncoder().encode("appID");function w(e){let t=i.zI(y,(0,o.z)(e)),r=a.uj(t);return new d(Uint8Array.from(r))}},69982:(e,t,r)=>{"use strict";r.d(t,{j:()=>S});var n=r(79142);r(50517);var a=r(85414);r(36121);var i=r(28775),o=r(83123).hp;class s extends a.x{async callWithRetry(e){let t,r=1;do try{t=await e()}catch(t){if(r>=s.MAX_TRIES||!(s.RETRY_ERROR_CODES.includes(t.code)||s.RETRY_STATUS_CODES.includes(Number(t.status))||"response"in t&&s.RETRY_STATUS_CODES.includes(Number(t.response.status))))throw t;let e=1==r?0:Math.min(1e3*Math.pow(2,r-1),s.MAX_BACKOFF_MS);e>0&&await new Promise(t=>setTimeout(t,e)),i.T.logger.warn(`algosdk request failed ${r} times. Retrying in ${e}ms: ${t}`)}while(!t&&++r<=s.MAX_TRIES);return t}async get(e,t,r={}){let a=await this.callWithRetry(()=>super.get(e,t,r));if(e.startsWith("/v2/accounts/")&&e.endsWith("/created-applications")&&200===a.status&&t?.["include-all"]?.toString()==="true")try{let e=(0,n.OlY)(o.from(a.body).toString(),{intDecoding:n.$23.MIXED});if(e.applications){for(let t of e.applications)t.params&&(null===t.params["approval-program"]&&(t.params["approval-program"]=""),null===t.params["clear-state-program"]&&(t.params["clear-state-program"]=""));a.body=o.from((0,n.e4x)(e))}}catch(e){i.T.logger.warn("Failed to fix indexer response for created applications",e)}return a}
5async post(e,t,r,n={}){return await this.callWithRetry(()=>super.post(e,t,r,n))}async delete(e,t,r,n={}){return await this.callWithRetry(()=>super.delete(e,t,r,n))}}s.MAX_TRIES=5,s.MAX_BACKOFF_MS=1e4,s.RETRY_STATUS_CODES=[408,413,429,500,502,503,504],s.RETRY_ERROR_CODES=["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN","EPROTO"];var l=r(5853),c=r(77251),u=r(9169),p=r(83123).hp,h=n.Ay$.ProgramSourceMap,d=n.Ay$.OnApplicationComplete;class f{constructor(e){this.createTransaction={bare:{create:async e=>this._algorand.createTransaction.appCreate(await this.params.bare.create(e))},create:async e=>this._algorand.createTransaction.appCreateMethodCall(await this.params.create(e))},this.send={bare:{create:async e=>{let t=e?.updatable??this._updatable,r=e?.deletable??this._deletable,n=e?.deployTimeParams??this._deployTimeParams,a=await this.compile({deployTimeParams:n,updatable:t,deletable:r}),i=await this.handleCallErrors(async()=>({...await this._algorand.send.appCreate(await this.params.bare.create({...e,updatable:t,deletable:r,deployTimeParams:n})),return:void 0}));return{appClient:this.getAppClientById({appId:i.appId}),result:{...i,...a}}}},create:async e=>{let t=e?.updatable??this._updatable,r=e?.deletable??this._deletable,n=e?.deployTimeParams??this._deployTimeParams,a=await this.compile({deployTimeParams:n,updatable:t,deletable:r}),i=await this.handleCallErrors(async()=>this.parseMethodCallReturn(this._algorand.send.appCreateMethodCall(await this.params.create({...e,updatable:t,deletable:r,deployTimeParams:n})),(0,u.n_)(e.method,this._appSpec)));return{appClient:this.getAppClientById({appId:i.appId}),result:{...i,...a}}}},this._appSpec=l.H.normaliseAppSpec(e.appSpec),this._appName=e.appName??this._appSpec.name,this._algorand=e.algorand,this._version=e.version??"1.0",this._defaultSender="string"==typeof e.defaultSender?n.pVw.fromString(e.defaultSender):e.defaultSender,this._defaultSigner=e.defaultSigner,this._deployTimeParams=e.deployTimeParams,this._updatable=e.updatable,this._deletable=e.deletable,this._paramsMethods=this.getParamsMethods()}get appName(){return this._appName}get appSpec(){return this._appSpec}get algorand(){return this._algorand}get params(){return this._paramsMethods}async deploy(e){let t=e.updatable??this._updatable??this.getDeployTimeControl("updatable"),r=e.deletable??this._deletable??this.getDeployTimeControl("deletable"),n=e.deployTimeParams??this._deployTimeParams,a=this.getAppClientById({appId:0n}),i=await a.compile({deployTimeParams:n,updatable:t,deletable:r}),o=await this._algorand.appDeployer.deploy({...e,createParams:await (e.createParams&&"method"in e.createParams?this.params.create({...e.createParams,updatable:t,deletable:r,deployTimeParams:n}):this.params.bare.create({...e.createParams,updatable:t,deletable:r,deployTimeParams:n})),updateParams:e.updateParams&&"method"in e.updateParams?this.params.deployUpdate(e.updateParams):this.params.bare.deployUpdate(e.updateParams),deleteParams:e.deleteParams&&"method"in e.deleteParams?this.params.deployDelete(e.deleteParams):this.params.bare.deployDelete(e.deleteParams),metadata:{name:e.appName??this._appName,version:this._version,updatable:t,deletable:r}}),s=this.getAppClientById({appId:o.appId,appName:e.appName}),l={...o,...i};return{appClient:s,result:{...l,return:"return"in l?"update"===l.operationPerformed?e.updateParams&&"method"in e.updateParams?(0,u.Px)(l.return,(0,u.n_)(e.updateParams.method,this._appSpec),this._appSpec.structs):void 0:e.createParams&&"method"in e.createParams?(0,u.Px)(l.return,(0,u.n_)(e.createParams.method,this._appSpec),this._appSpec.structs):void 0:void 0,deleteReturn:"deleteReturn"in l&&e.deleteParams&&"method"in e.deleteParams?(0,u.Px)(l.deleteReturn,(0,u.n_)(e.deleteParams.method,this._appSpec),this._appSpec.structs):void 0}}}getAppClientById(e){return new l.H({...e,algorand:this._algorand,appSpec:this._appSpec,appName:e.appName??this._appName,defaultSender:e.defaultSender??this._defaultSender,defaultSigner:e.defaultSigner??this._defaultSigner,approvalSourceMap:e.approvalSourceMap??this._approvalSourceMap,clearSourceMap:e.clearSourceMap??this._clearSourceMap})}getAppClientByCreatorAndName(e){return l.H.fromCreatorAndName({...e,algorand:this._algorand,appSpec:this._appSpec,appName:e.appName??this._appName,defaultSender:e.defaultSender??this._defaultSender,approvalSourceMap:e.approvalSourceMap??this._approvalSourceMap,clearSourceMap:e.clearSourceMap??this._clearSourceMap})}
5exposeLogicError(e,t){return l.H.exposeLogicError(e,this._appSpec,{isClearStateProgram:t,approvalSourceMap:this._approvalSourceMap,clearSourceMap:this._clearSourceMap})}exportSourceMaps(){if(!this._approvalSourceMap||!this._clearSourceMap)throw Error("Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first");return{approvalSourceMap:this._approvalSourceMap,clearSourceMap:this._clearSourceMap}}importSourceMaps(e){this._approvalSourceMap=new h(e.approvalSourceMap),this._clearSourceMap=new h(e.clearSourceMap)}getDeployTimeControl(e){let t=this._appSpec.source?.approval?p.from(this._appSpec.source.approval,"base64").toString("utf-8"):void 0;if(t&&t.includes("updatable"===e?c.cQ:c.En))return this._appSpec.bareActions.call.includes("updatable"===e?"UpdateApplication":"DeleteApplication")||Object.values(this._appSpec.methods).some(t=>t.actions.call.includes("updatable"===e?"UpdateApplication":"DeleteApplication"))}getParamsMethods(){return{create:async e=>{let t=await this.compile({...e,deployTimeParams:e.deployTimeParams??this._deployTimeParams});return this.getABIParams({...e,deployTimeParams:e.deployTimeParams??this._deployTimeParams,schema:e.schema??{globalByteSlices:this._appSpec.state.schema.global.bytes,globalInts:this._appSpec.state.schema.global.ints,localByteSlices:this._appSpec.state.schema.local.bytes,localInts:this._appSpec.state.schema.local.ints},approvalProgram:t.approvalProgram,clearStateProgram:t.clearStateProgram},e.onComplete??d.NoOpOC)},deployUpdate:e=>this.getABIParams(e,d.UpdateApplicationOC),deployDelete:e=>this.getABIParams(e,d.DeleteApplicationOC),bare:{create:async e=>this.getBareParams({...e,deployTimeParams:e?.deployTimeParams??this._deployTimeParams,schema:e?.schema??{globalByteSlices:this._appSpec.state.schema.global.bytes,globalInts:this._appSpec.state.schema.global.ints,localByteSlices:this._appSpec.state.schema.local.bytes,localInts:this._appSpec.state.schema.local.ints},...await this.compile({...e,deployTimeParams:e?.deployTimeParams??this._deployTimeParams})},e?.onComplete??d.NoOpOC),deployUpdate:e=>this.getBareParams(e,d.UpdateApplicationOC),deployDelete:e=>this.getBareParams(e,d.DeleteApplicationOC)}}}async handleCallErrors(e){try{return await e()}catch(e){throw this.exposeLogicError(e)}}async compile(e){let t=await l.H.compile(this._appSpec,this._algorand.app,e);return t.compiledApproval&&(this._approvalSourceMap=t.compiledApproval.sourceMap),t.compiledClear&&(this._clearSourceMap=t.compiledClear.sourceMap),t}getBareParams(e,t){return{...e,sender:this.getSender(e?.sender),signer:this.getSigner(e?.sender,e?.signer),onComplete:t}}getABIParams(e,t){return{...e,sender:this.getSender(e.sender),signer:this.getSigner(e.sender,e.signer),method:(0,u.n_)(e.method,this._appSpec),args:this.getCreateABIArgsWithDefaultValues(e.method,e.args),onComplete:t}}getCreateABIArgsWithDefaultValues(e,t){let r=(0,u.n_)(e,this._appSpec);return t?.map((e,t)=>{let n=r.args[t];if(void 0!==e)return n.struct&&"object"==typeof e&&!Array.isArray(e)?(0,u.yT)(e,this._appSpec.structs[n.struct],this._appSpec.structs):e;let a=n.defaultValue;if(a)if("literal"===a.source)return(0,u.y4)(p.from(a.data,"base64"),r.method.args[t].type,this._appSpec.structs);else throw Error(`Can't provide default value for ${a.source} for a contract creation call`);throw Error(`No value provided for required argument ${n.name??`arg${t+1}`} in call to method ${r.name}`)})}getSender(e){if(!e&&!this._defaultSender)throw Error(`No sender provided and no default sender present in app factory for call to app ${this._appName}`);return"string"==typeof e?n.pVw.fromString(e):e??this._defaultSender}getSigner(e,t){return t??(e&&e!==this._defaultSender?void 0:this._defaultSigner)}async parseMethodCallReturn(e,t){let r=await e;return{...r,return:(0,u.Px)(r.return,t,this._appSpec.structs)}}}var g=r(30175),m=r(79450),y=r(83123).hp,w=r(99267),v=n.Ay$.Kmd,b=n.Ay$.Indexer;class S{constructor(e,t){let r="algod"in e?e:{algod:S.getAlgodClient(e.algodConfig),indexer:e.indexerConfig?S.getIndexerClient(e.indexerConfig):void 0,kmd:e.kmdConfig?S.getKmdClient(e.kmdConfig):void 0};this._algod=r.algod,this._indexer=r.indexer,this._kmd=r.kmd,this._algorand=t}get algod(){return this._algod}get indexer(){if(!this._indexer)throw Error("Attempt to use Indexer client in AlgoKit instance with no Indexer configured");return this._indexer}get indexerIfPresent(){return this._indexer}get kmd(){if(!this._kmd)throw Error("Attempt to use Kmd client in AlgoKit instance with no Kmd configured");return this._kmd}async network(){this._getNetworkPromise||(this._getNetworkPromise=this._algod.getTransactionParams().do());let e=await this._getNetworkPromise;return{isTestNet:["testnet-v1.0","testnet-v1","testnet"].includes(e.genesisID??"unknown"),isMainNet:["mainnet-v1.0","mainnet-v1","mainnet"].includes(e.genesisID??"unknown"),isLocalNet:S.genesisIdIsLocalNet(e.genesisID??"unknown"),genesisId:e.genesisID??"unknown",genesisHash:e.genesisHash?y.from(e.genesisHash).toString("base64"):"unknown"}}static genesisIdIsLocalNet(e){return(0,m.C)(e)}async isLocalNet(){return(await this.network()).isLocalNet}async isTestNet(){return(await this.network()).isTestNet}async isMainNet(){return(await this.network()).isMainNet}getTestNetDispenser(e){return new g.q(e)}getTestNetDispenserFromEnvironment(e){return new g.q(e?{...e,authToken:""}:void 0)}getAppFactory(e){if(!this._algorand)throw Error("Attempt to get app factory from a ClientManager without an Algorand client");return new f({...e,algorand:this._algorand})}getAppClientByCreatorAndName(e){if(!this._algorand)throw Error("Attempt to get app client from a ClientManager without an Algorand client");return l.H.fromCreatorAndName({...e,algorand:this._algorand})}getAppClientById(e){if(!this._algorand)throw Error("Attempt to get app client from a ClientManager without an Algorand client");return new l.H({...e,algorand:this._algorand})}async getAppClientByNetwork(e){if(!this._algorand)throw Error("Attempt to get app client from a ClientManager without an Algorand client");return l.H.fromNetwork({...e,algorand:this._algorand})}async getTypedAppClientByCreatorAndName(e,t){if(!this._algorand)throw Error("Attempt to get app client from a ClientManager without an Algorand client");return e.fromCreatorAndName({...t,algorand:this._algorand})}getTypedAppClientById(e,t){if(!this._algorand)throw Error("Attempt to get app client from a ClientManager without an Algorand client");return new e({...t,algorand:this._algorand})}getTypedAppClientByNetwork(e,t){if(!this._algorand)throw Error("Attempt to get app client from a ClientManager without an Algorand client");return e.fromNetwork({...t,algorand:this._algorand})}getTypedAppFactory(e,t){if(!this._algorand)throw Error("Attempt to get app factory from a ClientManager without an Algorand client");return new e({...t,algorand:this._algorand})}static getConfigFromEnvironmentOrLocalNet(){if(!w||!w.env)throw Error("Attempt to get default client configuration from a non Node.js context; supply the config instead");let[e,t,r]=w.env.ALGOD_SERVER?[S.getAlgodConfigFromEnvironment(),w.env.INDEXER_SERVER?S.getIndexerConfigFromEnvironment():void 0,w.env.ALGOD_SERVER.includes("mainnet")||w.env.ALGOD_SERVER.includes("testnet")?void 0:{...S.getAlgodConfigFromEnvironment(),port:w?.env?.KMD_PORT??"4002"}]:[S.getDefaultLocalNetConfig("algod"),S.getDefaultLocalNetConfig("indexer"),S.getDefaultLocalNetConfig("kmd")];return{algodConfig:e,indexerConfig:t,kmdConfig:r}}static getAlgodConfigFromEnvironment(){if(!w||!w.env)throw Error("Attempt to get default algod configuration from a non Node.js context; supply the config instead");if(!w.env.ALGOD_SERVER)throw Error("Attempt to get default algod configuration without specifying ALGOD_SERVER in the environment variables");return{server:w.env.ALGOD_SERVER,port:w.env.ALGOD_PORT,token:w.env.ALGOD_TOKEN}}static getIndexerConfigFromEnvironment(){if(!w||!w.env)throw Error("Attempt to get default indexer configuration from a non Node.js context; supply the config instead");if(!w.env.INDEXER_SERVER)throw Error("Attempt to get default indexer configuration without specifying INDEXER_SERVER in the environment variables");return{server:w.env.INDEXER_SERVER,port:w.env.INDEXER_PORT,token:w.env.INDEXER_TOKEN}}static getAlgoNodeConfig(e,t){return{server:`https://${e}-${"algod"===t?"api":"idx"}.algonode.cloud/`,port:443}}static getDefaultLocalNetConfig(e){return{server:"http://localhost",port:"algod"===e?4001:"indexer"===e?8980:"kmd"===e?4002:e,token:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}static getAlgodClient(e){let{token:t,server:r,port:a}
5=e,i=new s("string"==typeof t?{"X-Algo-API-Token":t}:t??{},r,a);return new n.Ay$.Algodv2(i,r)}static getAlgodClientFromEnvironment(){return S.getAlgodClient(S.getAlgodConfigFromEnvironment())}static getIndexerClient(e){let{token:t,server:r,port:n}=e;return new b(new s("string"==typeof t?{"X-Indexer-API-Token":t}:t??{},r,n))}static getIndexerClientFromEnvironment(){return S.getIndexerClient(S.getIndexerConfigFromEnvironment())}static getKmdClient(e){let{token:t,server:r,port:n}=e;return new v(t,r,n)}static getKmdClientFromEnvironment(){return S.getKmdClient({...S.getAlgodConfigFromEnvironment(),port:w?.env?.KMD_PORT??"4002"})}}},70377:(e,t,r)=>{"use strict";r.d(t,{r:()=>s});var n=r(79142),a=r(30905),i=r(77251),o=r(83123).hp;class s{constructor(e){this._compilationResults={},this._algod=e}async compileTeal(e){if(this._compilationResults[e])return this._compilationResults[e];let t=await this._algod.compile(e).sourcemap(!0).do(),r={teal:e,compiled:t.result,compiledHash:t.hash,compiledBase64ToBytes:new Uint8Array(o.from(t.result,"base64")),sourceMap:new n.o32(JSON.parse(n.Ay$.encodeJSON(t.sourcemap)))};return this._compilationResults[e]=r,r}async compileTealTemplate(e,t,r){let n=s.stripTealComments(e);return n=s.replaceTealTemplateParams(n,t),r&&(n=s.replaceTealTemplateDeployTimeControlParams(n,r)),await this.compileTeal(n)}getCompilationResult(e){return this._compilationResults[e]}async getById(e){let t=await this._algod.getApplicationByID(Number(e)).do();return{appId:BigInt(t.id),appAddress:n.Ay$.getApplicationAddress(t.id),approvalProgram:t.params.approvalProgram,clearStateProgram:t.params.clearStateProgram,creator:t.params.creator,localInts:Number(t.params.localStateSchema?.numUint??0),localByteSlices:Number(t.params.localStateSchema?.numByteSlice??0),globalInts:Number(t.params.globalStateSchema?.numUint??0),globalByteSlices:Number(t.params.globalStateSchema?.numByteSlice??0),extraProgramPages:Number(t.params.extraProgramPages??0),globalState:s.decodeAppState(t.params.globalState??[])}}async getGlobalState(e){return(await this.getById(e)).globalState}async getLocalState(e,t){let r=await this._algod.accountApplicationInformation(t,e).do();if(!r.appLocalState?.keyValue)throw Error("Couldn't find local state");return s.decodeAppState(r.appLocalState.keyValue)}async getBoxNames(e){return(await this._algod.getApplicationBoxes(e).do()).boxes.map(e=>({nameRaw:e.name,nameBase64:o.from(e.name).toString("base64"),name:o.from(e.name).toString("utf-8")}))}async getBoxValue(e,t){let r="object"==typeof t&&"nameRaw"in t?t.nameRaw:t,n=s.getBoxReference(r).name;return(await this._algod.getApplicationBoxByName(Number(e),n).do()).value}async getBoxValues(e,t){return await Promise.all(t.map(async t=>await this.getBoxValue(e,t)))}async getBoxValueFromABIType(e){let{appId:t,boxName:r,type:n}=e,a=await this.getBoxValue(t,r);return n.decode(a)}async getBoxValuesFromABIType(e){let{appId:t,boxNames:r,type:n}=e;return await Promise.all(r.map(async e=>await this.getBoxValueFromABIType({appId:t,boxName:e,type:n})))}static getBoxReference(e){let t="object"==typeof e&&"appId"in e?e:{appId:0n,name:e};return{appIndex:t.appId,name:"string"==typeof t.name?new TextEncoder().encode(t.name):"length"in t.name?t.name:t.name.addr.publicKey}}static decodeAppState(e){let t={};for(let r of e){let e,n,a=o.from(r.key).toString("base64"),i=r.key,s=o.from(r.key).toString("utf-8"),l=r.value,c="action"in l?l.action:l.type;switch(c){case 1:e="string"==typeof l.bytes?l.bytes:l.bytes?o.from(l.bytes).toString("base64"):"",n=o.from(e,"base64"),t[s]={keyRaw:i,keyBase64:a,valueRaw:new Uint8Array(n),valueBase64:e,value:n.toString("utf-8")};break;case 2:{let e=l.uint??0;t[s]={keyRaw:i,keyBase64:a,value:BigInt(e)};break}default:throw Error(`Received unknown state data type of ${c}`)}}return t}static getABIReturn(e,t){if(!t||!e||"void"===t.returns.type)return;let r={txID:"",method:t,rawReturnValue:new Uint8Array};return(0,a.uf)(n.Ay$.AtomicTransactionComposer.parseMethodResponse(t,r,e),t.returns.type)}static replaceTealTemplateDeployTimeControlParams(e,t){if(void 0!==t.updatable){if(!e.includes(i.cQ))throw Error(`Deploy-time updatability control requested for app deployment, but ${i.cQ} not present in TEAL code`);e=u(e,i.cQ,(+!!t.updatable).toString())}if(void 0!==t.deletable){if(!e.includes(i.En))throw Error(`Deploy-time deletability control requested for app deployment, but ${i.En} not present in TEAL code`);e=u(e,i.En,(+!!t.deletable).toString())}return e}static replaceTealTemplateParams(e,t){if(void 0!==t)for(let r in t){let n=t[r],a=`TMPL_${r.replace(/^TMPL_/,"")}`;("number"==typeof n||"bigint"==typeof n)&&(e=e.replace(RegExp(`(?<=bytes )${a}`,"g"),`0x${n.toString(16).padStart(16,"0")}`)),e=u(e,a,"string"==typeof n?`0x${o.from(n,"utf-8").toString("hex")}`:ArrayBuffer.isView(n)?`0x${o.from(n).toString("hex")}`:n.toString())}return e}static stripTealComments(e){return e.split("\n").map(e=>(e=>{let t=l(e,"//");return void 0===t?e:e.slice(0,t).trimEnd()})(e)).join("\n")}}let l=(e,t,r=0,n)=>{let a=void 0===n?e.length:n,i=r,o=!1,s=!1;for(;i<a;){let r=e[i];if((" "===r||"("===r)&&!o&&c(e,i))s=!0;else if((" "===r||")"===r)&&!o&&s)s=!1;else if("\\"===r&&o)i+=1;else if('"'===r)o=!o;else if(!o&&!s&&e.startsWith(t,i))return i;i+=1}},c=(e,t)=>{try{let r=e.slice(0,t).split(/\s+/),n=r[r.length-1];return["base64","b64"].includes(n)}catch{return!1}};function u(e,t,r){let n=[],a=r.length-t.length;for(let i of e.split("\n")){let e=l(i,"//"),o=void 0===e?i.length:e,s=i.substring(0,o),c=i.substring(o),u=0;for(;;){let e=p(s,t,u);if(void 0===e)break;u=e+t.length;let n=s.substring(0,e),i=s.substring(u);s=`${n}${r}${i}`,u+=a}n.push(s+c)}return n.join("\n")}let p=(e,t,r=0,n)=>{let a=e.length,i=r;for(;i<a;){let r=l(e,t,i,a);if(void 0===r)break;let n=r+t.length;if((0===r||!h(e[r-1]))&&(n>=e.length||!h(e[n])))return r;i=n}};function h(e){return 1===e.length&&(/\w/.test(e)||"_"===e)}},71255:(e,t,r)=>{"use strict";r.d(t,{U:()=>a});var n=r(79175);let a=(0,r(64527).forwardRef)((e,t)=>{let{size:r="var(--cb-icon-size, 70%)",style:a,...i}=e;return(0,n.jsx)("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...a,width:r,height:r},ref:t,...i,children:(0,n.jsx)("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});a.displayName="@mantine/core/CloseIcon"},72402:(e,t,r)=>{"use strict";r.d(t,{i:()=>u});
5class n{constructor(e){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=[],t=[];for(let r of this.options.deps)e.push(r.prevState),t.push(r.state);return this.lastSeenDepValues=t,{prevDepVals:e,currDepVals:t,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let{prevDepVals:r,currDepVals:n,prevVal:a}=this.getDepVals();this.state=this.options.fn({prevDepVals:r,currDepVals:n,prevVal:a}),null==(t=(e=this.options).onUpdate)||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let e of this.options.deps)e instanceof n&&e.checkIfRecalculationNeededDeeply();let e=!1,t=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let n=0;n<r.length;n++)if(r[n]!==t[n]){e=!0;break}e&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{for(let e of(this.unregisterFromGraph(),this._subscriptions))e()}),this.subscribe=e=>{var t,r;this.listeners.add(e);let n=null==(r=(t=this.options).onSubscribe)?void 0:r.call(t,e,this);return()=>{this.listeners.delete(e),null==n||n()}},this.options=e,this.state=e.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(e=this.options.deps){for(let t of e)if(t instanceof n)t.registerOnGraph(),this.registerOnGraph(t.options.deps);else if(t instanceof u){let e=a.get(t);e||(e=new Set,a.set(t,e)),e.add(this);let r=i.get(this);r||(r=new Set,i.set(this,r)),r.add(t)}}unregisterFromGraph(e=this.options.deps){for(let t of e)if(t instanceof n)this.unregisterFromGraph(t.options.deps);else if(t instanceof u){let e=a.get(t);e&&e.delete(this);let r=i.get(this);r&&r.delete(t)}}}let a=new WeakMap,i=new WeakMap,o={current:[]},s=!1,l=new Set,c=new Map;class u{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t,r;this.listeners.add(e);let n=null==(r=null==(t=this.options)?void 0:t.onSubscribe)?void 0:r.call(t,e,this);return()=>{this.listeners.delete(e),null==n||n()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,r,u;(this.prevState=this.state,null==(t=this.options)?void 0:t.updateFn)?this.state=this.options.updateFn(this.prevState)(e):"function"==typeof e?this.state=e(this.prevState):this.state=e,null==(u=null==(r=this.options)?void 0:r.onUpdate)||u.call(r),function(e){if(l.add(e),!s)try{for(s=!0;l.size>0;){let e=Array.from(l);for(let t of(l.clear(),e)){let e=c.get(t)??t.prevState;t.prevState=e,function(e){e.listeners.forEach(t=>t({prevVal:e.prevState,currentVal:e.state}))}(t)}for(let t of e){let e=a.get(t);e&&(o.current.push(t),function e(t){for(let r of Array.from(t).sort((e,t)=>e instanceof n&&e.options.deps.includes(t)?1:t instanceof n&&t.options.deps.includes(e)?-1:0)){if(o.current.includes(r))continue;o.current.push(r),r.recompute();let t=i.get(r);if(t)for(let r of t){let t=a.get(r);t&&e(t)}}}(e))}for(let t of e){let e=a.get(t);if(e)for(let t of e)!function(e){e.listeners.forEach(t=>t({prevVal:e.prevState,currentVal:e.state}))}(t)}}}finally{s=!1,o.current=[],c.clear()}}(this)}}},72705:(e,t,r)=>{"use strict";r.d(t,{N:()=>a});var n=r(12929);class a{constructor(e){this.data=e}getEncodingSchema(){return a.encodingSchema}toEncodingData(){return this.data}static fromEncodingData(e){return new a(e)}}a.encodingSchema=new n.XD},72726:(e,t,r)=>{"use strict";var n;r.d(t,{B:()=>n}),function(e){e.TxnGroupSimulated="TxnGroupSimulated",e.AppCompiled="AppCompiled"}(n||(n={}))},73716:(e,t,r)=>{"use strict";var n;r.d(t,{A:()=>a}),function(e){e.UNSAFE="unsafe",e.SAFE="safe",e.MIXED="mixed",e.BIGINT="bigint"}(n||(n={}));let a=n},74751:(e,t,r)=>{"use strict";r.d(t,{SK:()=>_,yR:()=>T,sO:()=>n.sO,XB:()=>i,qV:()=>n.qV,J9:()=>k.J9,YB:()=>k.YB,mH:()=>C});var n=r(12021),a=r(5853);function i(e,t){return new a.a(e,t)}r(31393),r(43728);var o=r(79142),s=r(28775),l=r(35066);let c="DISPENSER";class u{get params(){return this._params}get signingAccounts(){return this._signingAccounts}get addr(){return this._addr}get signer(){return this._signer}constructor(e,t){this._params=e,this._signingAccounts=t,this._addr=o.Ay$.multisigAddress(e),this._signer=o.Ay$.makeMultiSigAccountTransactionSigner(e,t.map(e=>e.sk))}sign(e){let t="sender"in e?void 0:e;for(let r of this._signingAccounts)t=t?o.Ay$.appendSignMultisigTransaction(t,this._params,r.sk).blob:o.Ay$.
5signMultisigTransaction(e,this._params,r.sk).blob;return t}}class p{get addr(){return this._sender}get sk(){return this._account.sk}get signer(){return this._signer}get sender(){return{addr:this._sender,sk:this._account.sk}}constructor(e,t){this._account=e,this._sender="string"==typeof t?o.pVw.fromString(t):t??e.addr,this._signer=o.Ay$.makeBasicAccountTransactionSigner(e)}}class h{get microAlgos(){return this.amountInMicroAlgo}get microAlgo(){return this.amountInMicroAlgo}get algos(){return o.Ay$.microalgosToAlgos(Number(this.amountInMicroAlgo))}get algo(){return o.Ay$.microalgosToAlgos(Number(this.amountInMicroAlgo))}constructor(e){this.amountInMicroAlgo="microAlgos"in e?BigInt(e.microAlgos):"microAlgo"in e?BigInt(e.microAlgo):"algos"in e?BigInt(o.Ay$.algosToMicroalgos(Number(e.algos))):BigInt(o.Ay$.algosToMicroalgos(Number(e.algo)))}toString(){return`${this.microAlgo.toLocaleString("en-US")} \xb5ALGO`}valueOf(){return Number(this.microAlgo)}static Algos(e){return new h({algos:e})}static Algo(e){return new h({algos:e})}static MicroAlgos(e){return new h({microAlgos:e})}static MicroAlgo(e){return new h({microAlgos:e})}}var d=r(63790),f=r(69982);class g{constructor(e){this._clientManager=e;try{this._kmd=e.kmd}catch{this._kmd=void 0}}async kmd(){if(void 0===this._kmd){if(await this._clientManager.isLocalNet()){let{kmdConfig:e}=f.j.getConfigFromEnvironmentOrLocalNet();if(e)return this._kmd=f.j.getKmdClient(e),this._kmd}this._kmd=null}if(!this._kmd)throw Error("Attempt to use Kmd client in AlgoKit instance with no Kmd configured");return this._kmd}async getWalletAccount(e,t,r){let n=await this.kmd(),a=(await n.listWallets()).wallets.filter(t=>t.name===e);if(0===a.length)return;let i=a[0].id,s=(await n.initWalletHandle(i,"")).wallet_handle_token,l=(await n.listKeys(s)).addresses,c=0;if(t)for(c=0;c<l.length;c++){let e=l[c];if(t(await this._clientManager.algod.accountInformation(e).do()))break}if(c>=l.length)return;
5let u=(await n.exportKey(s,"",l[c])).private_key,h=o.Ay$.secretKeyToMnemonic(u),d=new p(o.Ay$.mnemonicToSecretKey(h),r);return{account:d,addr:d.addr,signer:d.signer}}async getOrCreateWalletAccount(e,t){let r=await this.getWalletAccount(e);if(r)return r;let n=await this.kmd(),a=(await n.createWallet(e,"")).wallet.id,i=(await n.initWalletHandle(a,"")).wallet_handle_token;await n.generateKey(i);let o=await this.getWalletAccount(e);s.T.logger.info(`LocalNet account '${e}' doesn't yet exist; created account ${o.addr} with keys stored in KMD and funding with ${t?.algo??1e3} ALGO`);let l=await this.getLocalNetDispenserAccount();return await new d.R({algod:this._clientManager.algod,getSigner:()=>l.signer,getSuggestedParams:()=>this._clientManager.algod.getTransactionParams().do()}).addPayment({amount:t??h.Algo(1e3),receiver:o.addr,sender:l.addr}).send(),o}async getLocalNetDispenserAccount(){if(!await this._clientManager.isLocalNet())throw Error("Can't get LocalNet dispenser account from non LocalNet network");let e=await this.getWalletAccount("unencrypted-default-wallet",e=>"Offline"!==e.status&&e.amount>1e9);if(!e)throw Error("Error retrieving LocalNet dispenser account; couldn't find the default account in KMD");return e}}var m=r(99267),y=o.Ay$.LogicSigAccount;let w=e=>"string"==typeof e?o.pVw.fromString(e):e,v=(0,l.Bj)(function(e){return"signer"in e?e.signer:"lsig"in e?o.Ay$.makeLogicSigAccountTransactionSigner(e):o.Ay$.makeBasicAccountTransactionSigner(e)});class b{constructor(e){this._accounts={},this._clientManager=e,this._kmdAccountManager=new g(e)}_getComposer(e){return new d.R({algod:this._clientManager.algod,getSigner:this.getSigner.bind(this),getSuggestedParams:e??(()=>this._clientManager.algod.getTransactionParams().do())})}get kmd(){return this._kmdAccountManager}setDefaultSigner(e){return this._defaultSigner="signer"in e?e.signer:e,this}signerAccount(e){let t=v(e),r={addr:"addr"in e?e.addr:e.address(),signer:t};this._accounts[r.addr.toString()]=r;let n=o.pVw.fromString(r.addr.toString());return n.account=e,n.addr=r.addr,n.signer=t,n}setSignerFromAccount(e){return this.signerAccount(e),this}setSigner(e,t){return this._accounts[w(e).toString()]={addr:w(e),signer:t},this}setSigners(e,t=!0){return this._accounts=t?{...this._accounts,...e._accounts}:{...e._accounts,...this._accounts},this}getSigner(e){let t=this._accounts[w(e).toString()]?.signer??this._defaultSigner;if(!t)throw Error(`No signer found for address ${e}`);return t}getAccount(e){let t=this._accounts[w(e).toString()];if(!t)throw Error(`No signer found for address ${e}`);return t}async getInformation(e){let{round:t,lastHeartbeat:r,lastProposed:n,address:a,...i}=await this._clientManager.algod.accountInformation(e).do();return{...i,address:o.pVw.fromString(a),balance:h.MicroAlgo(Number(i.amount)),amountWithoutPendingRewards:h.MicroAlgo(Number(i.amountWithoutPendingRewards)),minBalance:h.MicroAlgo(Number(i.minBalance)),pendingRewards:h.MicroAlgo(Number(i.pendingRewards)),rewards:h.MicroAlgo(Number(i.rewards)),validAsOfRound:BigInt(t),totalAppsOptedIn:Number(i.totalAppsOptedIn),totalAssetsOptedIn:Number(i.totalAssetsOptedIn),totalCreatedApps:Number(i.totalCreatedApps),totalCreatedAssets:Number(i.totalCreatedAssets),appsTotalExtraPages:void 0!==i.appsTotalExtraPages?Number(i.appsTotalExtraPages):void 0,rewardBase:void 0!==i.rewardBase?Number(i.rewardBase):void 0,totalBoxBytes:void 0!==i.totalBoxBytes?Number(i.totalBoxBytes):void 0,totalBoxes:void 0!==i.totalBoxes?Number(i.totalBoxes):void 0,lastHeartbeatRound:void 0!==r?BigInt(r):void 0,lastProposedRound:void 0!==n?BigInt(n):void 0}}fromMnemonic(e,t){let r=o.Ay$.mnemonicToSecretKey(e);return this.signerAccount(new p(r,t))}rekeyed(e,t){return this.signerAccount({addr:w(e),signer:t.signer})}async fromEnvironment(e,t){if(!m||!m.env)throw Error("Attempt to get account with private key from a non Node.js context; this is not supported!");let r=m.env[`${e.toUpperCase()}_MNEMONIC`],n=m.env[`${e.toUpperCase()}_SENDER`];if(r){let e=o.Ay$.mnemonicToSecretKey(r);return this.signerAccount(new p(e,n))}if(await this._clientManager.isLocalNet()){let r=await this._kmdAccountManager.getOrCreateWalletAccount(e,t);return this.signerAccount(r.account)}throw Error(`Missing environment variable ${e.toUpperCase()}_MNEMONIC when looking for account ${e}`)}async fromKmd(e,t,r){let n=await this._kmdAccountManager.getWalletAccount(e,t,r);if(!n)throw Error(`Unable to find KMD account ${e}${t?" with predicate":""}`);return this.signerAccount(n.account)}multisig(e,t){return this.signerAccount(new u(e,t))}logicsig(e,t){return this.signerAccount(new y(e,t))}random(){return this.signerAccount(o.Ay$.generateAccount())}async dispenserFromEnvironment(){if(!m||!m.env)throw Error("Attempt to get dispenser from environment from a non Node.js context; this is not supported!");return m.env[`${c.toUpperCase()}_MNEMONIC`]?await this.fromEnvironment(c):await this.localNetDispenser()}async localNetDispenser(){let e=await this._kmdAccountManager.getLocalNetDispenserAccount();return this.signerAccount(e.account)}async rekeyAccount(e,t,r){let n=await this._getComposer().addPayment({...r,sender:w(e),receiver:w(e),amount:h.MicroAlgo(0),rekeyTo:w("object"==typeof t&&"addr"in t?t.addr:t)}).send(r);return"object"==typeof t&&"addr"in t&&this.rekeyed(e,t),s.T.getLogger(r?.suppressLog).info(`Rekeyed ${e} to ${t} via transaction ${n.txIds.at(-1)}`),{...n,transaction:n.transactions.at(-1),confirmation:n.confirmations.at(-1)}}async _getEnsureFundedAmount(e,t,r){let n=await this.getInformation(e),a=n.balance.microAlgo-n.minBalance.microAlgo,i=(0,l.Qd)(t.microAlgo,a,r?.microAlgo??0n);return null===i?void 0:h.MicroAlgo(i)}
5async ensureFunded(e,t,r,n){let a=w(e),i=await this._getEnsureFundedAmount(a,r,n?.minFundingIncrement);if(!i)return;let o=await this._getComposer().addPayment({...n,sender:w(t),receiver:a,amount:i}).send(n);return{...o,transaction:o.transactions[0],confirmation:o.confirmations[0],transactionId:o.txIds[0],amountFunded:i}}async ensureFundedFromEnvironment(e,t,r){let n=w(e),a=await this.dispenserFromEnvironment(),i=await this._getEnsureFundedAmount(n,t,r?.minFundingIncrement);if(!i)return;let o=await this._getComposer().addPayment({...r,sender:a,receiver:n,amount:i}).send(r);return{...o,transaction:o.transactions[0],confirmation:o.confirmations[0],transactionId:o.txIds[0],amountFunded:i}}async ensureFundedFromTestNetDispenserApi(e,t,r,n){if(!await this._clientManager.isTestNet())throw Error("Attempt to fund using TestNet dispenser API on non TestNet network.");let a=w(e),i=await this._getEnsureFundedAmount(a,r,n?.minFundingIncrement);if(!i)return;let o=await t.fund(a,i.microAlgo);return{amountFunded:h.MicroAlgo(o.amount),transactionId:o.txId}}}var S=r(93266),x=r(91323),A=r(52530),E=r(70377),I=r(54724);class T{constructor(e){this._cachedSuggestedParamsTimeout=3e3,this._defaultValidityWindow=void 0,this._errorTransformers=new Set,this._clientManager=new f.j(e,this),this._accountManager=new b(this._clientManager),this._appManager=new E.r(this._clientManager.algod),this._assetManager=new I.E(this._clientManager.algod,()=>this.newGroup()),this._transactionSender=new x.f(()=>this.newGroup(),this._assetManager,this._appManager),this._transactionCreator=new S.I(()=>this.newGroup()),this._appDeployer=new A.i(this._appManager,this._transactionSender,this._clientManager.indexerIfPresent)}setDefaultValidityWindow(e){return this._defaultValidityWindow=BigInt(e),this}setDefaultSigner(e){return this._accountManager.setDefaultSigner(e),this}setSignerFromAccount(e){return this._accountManager.setSignerFromAccount(e),this}setSigner(e,t){return this._accountManager.setSigner(e,t),this}setSuggestedParamsCache(e,t){return this._cachedSuggestedParams=e,this._cachedSuggestedParamsExpiry=t??new Date(+new Date+this._cachedSuggestedParamsTimeout),this}setSuggestedParamsCacheTimeout(e){return this._cachedSuggestedParamsTimeout=e,this}async getSuggestedParams(){return this._cachedSuggestedParams&&(!this._cachedSuggestedParamsExpiry||this._cachedSuggestedParamsExpiry>new Date)||(this._cachedSuggestedParams=await this._clientManager.algod.getTransactionParams().do(),this._cachedSuggestedParamsExpiry=new Date(new Date().getTime()+this._cachedSuggestedParamsTimeout)),{...this._cachedSuggestedParams}}get client(){return this._clientManager}get account(){return this._accountManager}get asset(){return this._assetManager}get app(){return this._appManager}get appDeployer(){return this._appDeployer}registerErrorTransformer(e){this._errorTransformers.add(e)}unregisterErrorTransformer(e){this._errorTransformers.delete(e)}newGroup(){return new d.R({algod:this.client.algod,getSigner:e=>this.account.getSigner(e),getSuggestedParams:()=>this.getSuggestedParams(),defaultValidityWindow:this._defaultValidityWindow,appManager:this._appManager,errorTransformers:[...this._errorTransformers]})}get send(){return this._transactionSender}get createTransaction(){return this._transactionCreator}static defaultLocalNet(){return new T({algodConfig:f.j.getDefaultLocalNetConfig("algod"),indexerConfig:f.j.getDefaultLocalNetConfig("indexer"),kmdConfig:f.j.getDefaultLocalNetConfig("kmd")})}static testNet(){return new T({algodConfig:f.j.getAlgoNodeConfig("testnet","algod"),indexerConfig:f.j.getAlgoNodeConfig("testnet","indexer"),kmdConfig:void 0})}static mainNet(){return new T({algodConfig:f.j.getAlgoNodeConfig("mainnet","algod"),indexerConfig:f.j.getAlgoNodeConfig("mainnet","indexer"),kmdConfig:void 0})}static fromClients(e){return new T(e)}static fromEnvironment(){return new T(f.j.getConfigFromEnvironmentOrLocalNet())}static fromConfig(e){return new T(e)}}var k=r(30905);r(30175),r(60718),Number.prototype.microAlgos=function(){return h.MicroAlgo(this)},Number.prototype.algos=function(){return h.Algo(this)},Number.prototype.microAlgo=function(){return h.MicroAlgo(this)},Number.prototype.algo=function(){return h.Algo(this)},BigInt.prototype.microAlgo=function(){return h.MicroAlgo(this)},BigInt.prototype.algo=function(){return h.Algo(this)};let C=e=>h.MicroAlgo(BigInt(e)*_.microAlgo),_=h.MicroAlgo(1e3);r(72726),r(83123).hp,r(99267),r(68687)},77251:(e,t,r)=>{"use strict";var n,a;r.d(t,{$G:()=>s,En:()=>o,Kz:()=>a,cQ:()=>i,tK:()=>l,tq:()=>n});let i="TMPL_UPDATABLE",o="TMPL_DELETABLE",s="ALGOKIT_DEPLOYER",l=2048;new Uint8Array([21,31,124,117]),function(e){e[e.Fail=0]="Fail",e[e.UpdateApp=1]="UpdateApp",e[e.ReplaceApp=2]="ReplaceApp",e[e.AppendApp=3]="AppendApp"}(n||(n={})),function(e){e[e.Fail=0]="Fail",e[e.ReplaceApp=1]="ReplaceApp",e[e.AppendApp=2]="AppendApp"}(a||(a={}))},77599:(e,t,r)=>{"use strict";r.d(t,{E:()=>n,z:()=>a}),r(64527),r(79175);let[n,a]=(0,r(63415).e)({size:"sm"})},78059:(e,t,r)=>{"use strict";r.d(t,{_b:()=>l,$e:()=>c,__:()=>i,E$:()=>o});var n=r(86058),a=r(64527);let i=function(e){let t=e,r=!1,n=new Set;return{getState:()=>t,updateState(e){t="function"==typeof e?e(t):e}
5,setState(e){this.updateState(e),n.forEach(e=>e(t))},initialize(e){r||(t=e,r=!0)},subscribe:e=>(n.add(e),()=>n.delete(e))}}({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return(0,a.useSyncExternalStore)(e.subscribe,()=>e.getState(),()=>e.getState())};function s(e,t){let r=e.getState(),n=function(e,t,r){let n=[],a=[],i={};for(let o of e){let e=o.position||t;i[e]=i[e]||0,i[e]+=1,i[e]<=r?a.push(o):n.push(o)}return{notifications:a,queue:n}}(t([...r.notifications,...r.queue]),r.defaultPosition,r.limit);e.setState({notifications:n.notifications,queue:n.queue,limit:r.limit,defaultPosition:r.defaultPosition})}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return s(t,t=>t.filter(t=>{if(t.id===e){var r;return null==(r=t.onClose)||r.call(t,t),!1}return!0})),e}let c={show:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,r=e.id||(0,n.z)();return s(t,t=>e.id&&t.some(t=>t.id===e.id)?t:[...t,{...e,id:r}]),r},hide:l,update:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return s(t,t=>t.map(t=>t.id===e.id?{...t,...e}:t)),e.id},clean:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;s(e,()=>[])},cleanQueue:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;s(e,t=>t.slice(0,e.getState().limit))},updateState:s}},78364:(e,t,r)=>{"use strict";r.d(t,{F:()=>H,J:()=>W});var n=r(79175),a=r(64527),i=r(71355),o=r(82248),s=r(94393),l=r(51049),c=r(44241),u=r(41903),p=r(97569),h=r(85411);let[d,f]=(0,h.F)("ScrollArea.Root component was not found in tree");function g(e){let t=(0,a.useRef)(e);return(0,a.useEffect)(()=>{t.current=e}),(0,a.useMemo)(()=>function(){for(var e,r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];return null==(e=t.current)?void 0:e.call(t,...n)},[])}var m=r(40156);function y(e,t){let r=g(t);(0,m.o)(()=>{let t=0;if(e){let n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}let w=(0,a.forwardRef)((e,t)=>{let{style:r,...i}=e,o=f(),[s,l]=(0,a.useState)(0),[c,u]=(0,a.useState)(0),p=!!(s&&c);return y(o.scrollbarX,()=>{var e;let t=(null==(e=o.scrollbarX)?void 0:e.offsetHeight)||0;o.onCornerHeightChange(t),u(t)}),y(o.scrollbarY,()=>{var e;let t=(null==(e=o.scrollbarY)?void 0:e.offsetWidth)||0;o.onCornerWidthChange(t),l(t)}),p?(0,n.jsx)("div",{...i,ref:t,style:{...r,width:s,height:c}}):null}),v=(0,a.forwardRef)((e,t)=>{let r=f(),a=!!(r.scrollbarX&&r.scrollbarY);return"scroll"!==r.type&&a?(0,n.jsx)(w,{...e,ref:t}):null});var b=r(64858);let S={scrollHideDelay:1e3,type:"hover"},x=(0,a.forwardRef)((e,t)=>{let{type:r,scrollHideDelay:i,scrollbars:o,getStyles:s,...c}=(0,l.Y)("ScrollAreaRoot",S,e),[p,h]=(0,a.useState)(null),[f,g]=(0,a.useState)(null),[m,y]=(0,a.useState)(null),[w,v]=(0,a.useState)(null),[x,A]=(0,a.useState)(null),[E,I]=(0,a.useState)(0),[T,k]=(0,a.useState)(0),[C,_]=(0,a.useState)(!1),[D,B]=(0,a.useState)(!1),P=(0,b.pc)(t,e=>h(e));return(0,n.jsx)(d,{value:{type:r,scrollHideDelay:i,scrollArea:p,viewport:f,onViewportChange:g,content:m,onContentChange:y,scrollbarX:w,onScrollbarXChange:v,scrollbarXEnabled:C,onScrollbarXEnabledChange:_,scrollbarY:x,onScrollbarYChange:A,scrollbarYEnabled:D,onScrollbarYEnabledChange:B,onCornerWidthChange:I,onCornerHeightChange:k,getStyles:s},children:(0,n.jsx)(u.a,{...c,ref:P,__vars:{"--sa-corner-width":"xy"!==o?"0px":"".concat(E,"px"),"--sa-corner-height":"xy"!==o?"0px":"".concat(T,"px")}})})});function A(e,t){let{delay:r,flushOnUnmount:n,leading:i}="number"==typeof t?{delay:t,flushOnUnmount:!1,leading:!1}:t,o=g(e),s=(0,a.useRef)(0),l=(0,a.useMemo)(()=>{let e=Object.assign(function(){for(var t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];window.clearTimeout(s.current);let l=e._isFirstCall;function c(){window.clearTimeout(s.current),s.current=0,e._isFirstCall=!0}if(e._isFirstCall=!1,i&&l){o(...n),e.flush=()=>{0!==s.current&&(c(),o(...n))},e.cancel=()=>{c()},s.current=window.setTimeout(()=>{c()},r);return}if(i&&!l){e.flush=()=>{0!==s.current&&(c(),o(...n))},e.cancel=()=>{c()},s.current=window.setTimeout(()=>{c()},r);return}let u=()=>{0!==s.current&&(c(),o(...n))};e.flush=u,e.cancel=()=>{c()},s.current=window.setTimeout(u,r)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return e},[o,r,i]);return(0,a.useEffect)(()=>()=>{n?l.flush():l.cancel()},[l,n]),l}x.displayName="@mantine/core/ScrollAreaRoot";var E=r(28825);function I(e,t){let r=e/t;return Number.isNaN(r)?0:r}function T(e){let t=I(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-r)*t,18)}function k(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function C(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"ltr",n=T(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,s=function(e,t){let[r,n]=t;return Math.min(n,Math.max(r,e))}(e,"ltr"===r?[0,o]:[-1*o,0]);return k([0,o],[0,i-n])(s)}var _=r(84115);function D(e,t){let{checkForDefaultPrevented:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n=>{null==e||e(n),!1!==r&&n.defaultPrevented||null==t||t(n)}}let[B,P]=(0,h.F)("ScrollAreaScrollbar was not found in tree"),M=(0,a.forwardRef)((e,t)=>{let{sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:p,onResize:h,...d}=e,m=f(),[w,v]=(0,a.useState)(null),S=(0,b.pc)(t,e=>v(e)),x=(0,a.useRef)(null),E=(0,a.useRef)(""),{viewport:I}=m,T=r.content-r.viewport,k=g(p),C=g(c),_=A(h,10),P=e=>{x.current&&u({x:e.clientX-x.current.left,y:e.clientY-x.current.top})};return(0,a.useEffect)(()=>{let e=e=>{let t=e.target;(null==w?void 0:w.contains(t))&&k(e,T)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[I,w,T,k]),(0,a.useEffect)(C,[r,C]),y(w,_),y(m.content,_),(0,n.jsx)(B,{value:{scrollbar:w,hasThumb:i,onThumbChange:g(o),onThumbPointerUp:g(s),onThumbPositionChange:C,onThumbPointerDown:g(l)},children:(0,n.jsx)("div",{...d,ref:S,"data-mantine-scrollbar":!0,style:{position:"absolute",...d.style},onPointerDown:D(e.onPointerDown,e=>{e.preventDefault(),0===e.button&&(e.target.setPointerCapture(e.pointerId),x.current=w.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",P(e))}),onPointerMove:D(e.onPointerMove,P),onPointerUp:D(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(e.preventDefault(),t.releasePointerCapture(e.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=E.current,x.current=null}})})}),N=(0,a.forwardRef)((e,t)=>{let{sizes:r,onSizesChange:i,style:o,...s}=e,l=f(),[c,u]=(0,a.useState)(),p=(0,a.useRef)(null),h=(0,b.pc)(t,p,l.onScrollbarXChange);return(0,a.useEffect)(()=>{p.current&&u(getComputedStyle(p.current))},[p]),(0,n.jsx)(M,{"data-orientation":"horizontal",...s,ref:h,sizes:r,style:{...o,"--sa-thumb-width":"".concat(T(r),"px")},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(l.viewport){let n=l.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),function(e,t){return e>0&&e<t}(n,r)&&t.preventDefault()}},onResize:()=>{p.current&&l.viewport&&c&&i({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:(0,_.R)(c.paddingLeft),paddingEnd:(0,_.R)(c.paddingRight)}})}})});N.displayName="@mantine/core/ScrollAreaScrollbarX";let R=(0,a.forwardRef)((e,t)=>{let{sizes:r,onSizesChange:i,style:o,...s}=e,l=f(),[c,u]=(0,a.useState)(),p=(0,a.useRef)(null),h=(0,b.pc)(t,p,l.onScrollbarYChange);return(0,a.useEffect)(()=>{p.current&&u(window.getComputedStyle(p.current))},[]),(0,n.jsx)(M,{...s,"data-orientation":"vertical",ref:h,sizes:r,style:{"--sa-thumb-height":"".concat(T(r),"px"),...o},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>
5e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(l.viewport){let n=l.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),function(e,t){return e>0&&e<t}(n,r)&&t.preventDefault()}},onResize:()=>{p.current&&l.viewport&&c&&i({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:(0,_.R)(c.paddingTop),paddingEnd:(0,_.R)(c.paddingBottom)}})}})});R.displayName="@mantine/core/ScrollAreaScrollbarY";let O=(0,a.forwardRef)((e,t)=>{let{orientation:r="vertical",...i}=e,{dir:o}=(0,E.jH)(),s=f(),l=(0,a.useRef)(null),c=(0,a.useRef)(0),[u,p]=(0,a.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=I(u.viewport,u.content),d={...i,sizes:u,onSizesChange:p,hasThumb:!!(h>0&&h<1),onThumbChange:e=>{l.current=e},onThumbPointerUp:()=>{c.current=0},onThumbPointerDown:e=>{c.current=e}},g=(e,t)=>(function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ltr",a=T(r),i=t||a/2,o=r.scrollbar.paddingStart+i,s=r.scrollbar.size-r.scrollbar.paddingEnd-(a-i),l=r.content-r.viewport;return k([o,s],"ltr"===n?[0,l]:[-1*l,0])(e)})(e,c.current,u,t);return"horizontal"===r?(0,n.jsx)(N,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){let e=C(s.viewport.scrollLeft,u,o);l.current.style.transform="translate3d(".concat(e,"px, 0, 0)")}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollLeft=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollLeft=g(e,o))}}):"vertical"===r?(0,n.jsx)(R,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){let e=C(s.viewport.scrollTop,u);0===u.scrollbar.size?l.current.style.setProperty("--thumb-opacity","0"):l.current.style.setProperty("--thumb-opacity","1"),l.current.style.transform="translate3d(0, ".concat(e,"px, 0)")}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollTop=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollTop=g(e))}}):null});O.displayName="@mantine/core/ScrollAreaScrollbarVisible";let $=(0,a.forwardRef)((e,t)=>{let r=f(),{forceMount:i,...o}=e,[s,l]=(0,a.useState)(!1),c="horizontal"===e.orientation,u=A(()=>{if(r.viewport){let e=r.viewport.offsetWidth<r.viewport.scrollWidth,t=r.viewport.offsetHeight<r.viewport.scrollHeight;l(c?e:t)}},10);return(y(r.viewport,u),y(r.content,u),i||s)?(0,n.jsx)(O,{"data-state":s?"visible":"hidden",...o,ref:t}):null});$.displayName="@mantine/core/ScrollAreaScrollbarAuto";let L=(0,a.forwardRef)((e,t)=>{let{forceMount:r,...i}=e,o=f(),[s,l]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{let{scrollArea:e}=o,t=0;if(e){let r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[o.scrollArea,o.scrollHideDelay]),r||s)?(0,n.jsx)($,{"data-state":s?"visible":"hidden",...i,ref:t}):null});L.displayName="@mantine/core/ScrollAreaScrollbarHover";let U=(0,a.forwardRef)((e,t)=>{let{forceMount:r,...i}=e,o=f(),s="horizontal"===e.orientation,[l,c]=(0,a.useState)("hidden"),u=A(()=>c("idle"),100);return((0,a.useEffect)(()=>{if("idle"===l){let e=window.setTimeout(()=>c("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,o.scrollHideDelay]),(0,a.useEffect)(()=>{let{viewport:e}=o,t=s?"scrollLeft":"scrollTop";if(e){let r=e[t],n=()=>{let n=e[t];r!==n&&(c("scrolling"),u()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[o.viewport,s,u]),r||"hidden"!==l)?(0,n.jsx)(O,{"data-state":"hidden"===l?"hidden":"visible",...i,ref:t,onPointerEnter:D(e.onPointerEnter,()=>c("interacting")),onPointerLeave:D(e.onPointerLeave,()=>c("idle"))}):null}),V=(0,a.forwardRef)((e,t)=>{let{forceMount:r,...i}=e,o=f(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=o,c="horizontal"===e.orientation;return(0,a.useEffect)(()=>(c?s(!0):l(!0),()=>{c?s(!1):l(!1)}),[c,s,l]),"hover"===o.type?(0,n.jsx)(L,{...i,ref:t,forceMount:r}):"scroll"===o.type?(0,n.jsx)(U,{...i,ref:t,forceMount:r}):"auto"===o.type?(0,n.jsx)($,{...i,ref:t,forceMount:r}):"always"===o.type?(0,n.jsx)(O,{...i,ref:t}):null});V.displayName="@mantine/core/ScrollAreaScrollbar";let F=(0,a.forwardRef)((e,t)=>{let{style:r,...i}=e,o=f(),s=P(),{onThumbPositionChange:l}=s,c=(0,b.pc)(t,e=>s.onThumbChange(e)),u=(0,a.useRef)(void 0),p=A(()=>{u.current&&(u.current(),u.current=void 0)},100);return(0,a.useEffect)(()=>{let{viewport:e}=o;if(e){let t=()=>{p(),u.current||(u.current=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r={left:e.scrollLeft,top:e.scrollTop},n=0;return!function a(){let i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,s=r.top!==i.top;
5(o||s)&&t(),r=i,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)}(e,l),l())};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),(0,n.jsx)("div",{"data-state":s.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...r},onPointerDownCapture:D(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;s.onThumbPointerDown({x:r,y:n})}),onPointerUp:D(e.onPointerUp,s.onThumbPointerUp)})});F.displayName="@mantine/core/ScrollAreaThumb";let j=(0,a.forwardRef)((e,t)=>{let{forceMount:r,...a}=e,i=P();return r||i.hasThumb?(0,n.jsx)(F,{ref:t,...a}):null});j.displayName="@mantine/core/ScrollAreaThumb";let q=(0,a.forwardRef)((e,t)=>{let{children:r,style:a,...i}=e,o=f(),s=(0,b.pc)(t,o.onViewportChange);return(0,n.jsx)(u.a,{...i,ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...a},children:(0,n.jsx)("div",{...o.getStyles("content"),ref:o.onContentChange,children:r})})});q.displayName="@mantine/core/ScrollAreaViewport";var z={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268",content:"m_b1336c6"};let K={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},G=(0,s.V)((e,t)=>{let{scrollbarSize:r,overscrollBehavior:n}=t;return{root:{"--scrollarea-scrollbar-size":(0,o.D)(r),"--scrollarea-over-scroll-behavior":n}}}),H=(0,p.P9)((e,t)=>{let r=(0,l.Y)("ScrollArea",K,e),{classNames:o,className:s,style:u,styles:p,unstyled:h,scrollbarSize:d,vars:f,type:g,scrollHideDelay:m,viewportProps:y,viewportRef:w,onScrollPositionChange:b,children:S,offsetScrollbars:A,scrollbars:E,onBottomReached:I,onTopReached:T,overscrollBehavior:k,attributes:C,..._}=r,[D,B]=(0,a.useState)(!1),[P,M]=(0,a.useState)(!1),[N,R]=(0,a.useState)(!1),O=(0,c.I)({name:"ScrollArea",props:r,classes:z,className:s,style:u,classNames:o,styles:p,unstyled:h,attributes:C,vars:f,varsResolver:G}),$=(0,a.useRef)(null),L=(0,i.SV)([w,$]);return(0,a.useEffect)(()=>{if(!$.current||"present"!==A)return;let e=$.current,t=new ResizeObserver(()=>{let{scrollHeight:t,clientHeight:r,scrollWidth:n,clientWidth:a}=e;M(t>r),R(n>a)});return t.observe(e),()=>t.disconnect()},[$,A]),(0,n.jsxs)(x,{getStyles:O,type:"never"===g?"always":g,scrollHideDelay:m,ref:t,scrollbars:E,...O("root"),..._,children:[(0,n.jsx)(q,{...y,...O("viewport",{style:null==y?void 0:y.style}),ref:L,"data-offset-scrollbars":!0===A?"xy":A||void 0,"data-scrollbars":E||void 0,"data-horizontal-hidden":"present"!==A||N?void 0:"true","data-vertical-hidden":"present"!==A||P?void 0:"true",onScroll:e=>{var t;null==y||null==(t=y.onScroll)||t.call(y,e),null==b||b({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop});let{scrollTop:r,scrollHeight:n,clientHeight:a}=e.currentTarget;r-(n-a)>=-.6&&(null==I||I()),0===r&&(null==T||T())},children:S}),("xy"===E||"x"===E)&&(0,n.jsx)(V,{...O("scrollbar"),orientation:"horizontal","data-hidden":"never"===g||"present"===A&&!N||void 0,forceMount:!0,onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),children:(0,n.jsx)(j,{...O("thumb")})}),("xy"===E||"y"===E)&&(0,n.jsx)(V,{...O("scrollbar"),orientation:"vertical","data-hidden":"never"===g||"present"===A&&!P||void 0,forceMount:!0,onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),children:(0,n.jsx)(j,{...O("thumb")})}),(0,n.jsx)(v,{...O("corner"),"data-hovered":D||void 0,"data-hidden":"never"===g||void 0})]})});H.displayName="@mantine/core/ScrollArea";let W=(0,p.P9)((e,t)=>{let{children:r,classNames:o,styles:s,scrollbarSize:c,scrollHideDelay:p,type:h,dir:d,offsetScrollbars:f,viewportRef:g,onScrollPositionChange:m,unstyled:y,variant:w,viewportProps:v,scrollbars:b,style:S,vars:x,onBottomReached:A,onTopReached:E,onOverflowChange:I,...T}=(0,l.Y)("ScrollAreaAutosize",K,e),k=(0,a.useRef)(null),C=(0,i.SV)([g,k]),[_,D]=(0,a.useState)(!1),B=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(!I)return;let e=k.current;if(!e)return;let t=()=>{let t=e.scrollHeight>e.clientHeight;t!==_&&(B.current?null==I||I(t):(B.current=!0,t&&(null==I||I(!0))),D(t))};t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[I,_]),(0,n.jsx)(u.a,{...T,ref:t,style:[{display:"flex",overflow:"auto"},S],children:(0,n.jsx)(u.a,{style:{display:"flex",flexDirection:"column",flex:1},children:(0,n.jsx)(H,{classNames:o,styles:s,scrollHideDelay:p,scrollbarSize:c,type:h,dir:d,offsetScrollbars:f,viewportRef:C,onScrollPositionChange:m,unstyled:y,variant:w,viewportProps:v,vars:x,scrollbars:b,onBottomReached:A,onTopReached:E,children:r})})})});H.classes=z,W.displayName="@mantine/core/ScrollAreaAutosize",W.classes=z,H.Autosize=W},79142:(e,t,r)=>{"use strict";r.d(t,{Bxj:()=>tX,UN0:()=>tJ,FRG:()=>tH,aEE:()=>t5,tIK:()=>tZ,PX5:()=>tq,pVw:()=>l.pV,aXL:()=>t9,$23:()=>eo.A,o32:()=>ti,ZjB:()=>Y.Zj,D_l:()=>to.D_,oUo:()=>p,VQj:()=>m.VQ,At$:()=>m.At,Xbp:()=>eR.X,Ay$:()=>ro,jX9:()=>l.jX,HjT:()=>l.Hj,q7Y:()=>tS,WZG:()=>tM,f2A:()=>tf,RdO:()=>f,J_k:()=>m.J_,OlY:()=>h.Ol,e4x:()=>h.e4});var n,a,i,o={};r.r(o),r.d(o,{ABIAddressType:()=>tK,ABIArrayDynamicType:()=>tX,ABIArrayStaticType:()=>tJ,ABIBoolType:()=>tG,ABIByteType:()=>tH,ABIContract:()=>t6,ABIInterface:()=>t3,ABIMethod:()=>t5,ABIReferenceType:()=>a,ABIStringType:()=>tW,ABITransactionType:()=>n,ABITupleType:()=>tZ,ABIType:()=>tj,ABIUfixedType:()=>tz,ABIUintType:()=>tq,ADDR_BYTE_SIZE:()=>tO,ALGORAND_ZERO_ADDRESS_STRING:()=>l.t4,AccountBaseData:()=>et.Fs,AccountData:()=>et.ak,AccountDeltas:()=>et.tT,AccountTotals:()=>et.Jl,Address:()=>l.pV,AlgoCount:()=>et.x,Algodv2:()=>
5ei,AppLocalState:()=>et.wt,AppLocalStateDelta:()=>et.Qq,AppParams:()=>et.e3,AppParamsDelta:()=>et.sZ,AppResourceRecord:()=>et.DZ,ApplyData:()=>e$.$o,AssetHolding:()=>et.Eg,AssetHoldingDelta:()=>et.Om,AssetParams:()=>et.XZ,AssetParamsDelta:()=>et.b1,AssetResourceRecord:()=>et.Gp,AtomicTransactionComposer:()=>t9,AtomicTransactionComposerStatus:()=>i,BalanceRecord:()=>et.WT,Block:()=>e$.eB,BlockHeader:()=>e$.Tw,ENCODED_MULTISIG_SCHEMA:()=>to.y9,ENCODED_SUBSIG_SCHEMA:()=>to.Xh,ERROR_INVALID_MICROALGOS:()=>ri,ERROR_MULTISIG_BAD_SENDER:()=>ra,EvalDelta:()=>e$.dJ,FalconSignatureStruct:()=>eL.Nf,FalconVerifier:()=>eL.O3,HashFactory:()=>eL.DT,INVALID_MICROALGOS_ERROR_MSG:()=>c,IncludedTransactions:()=>et.W_,Indexer:()=>eB,IntDecoding:()=>eo.A,Kmd:()=>es,KvValueDelta:()=>et.bh,LENGTH_ENCODE_BYTE_SIZE:()=>tU,LedgerStateDelta:()=>et.NC,LogicSig:()=>e0.Gx,LogicSigAccount:()=>e0.Hl,MAX_LEN:()=>tR,MULTISIG_BAD_SENDER_ERROR_MSG:()=>re,MerkleArrayProof:()=>eL.yb,MerkleSignatureVerifier:()=>eL.nL,ModifiedCreatable:()=>et.bm,OnApplicationComplete:()=>to.DB,Participant:()=>eL.YS,ParticipationUpdates:()=>e$.WA,ProgramSourceMap:()=>ti,Reveal:()=>eL.gN,RewardState:()=>e$.TG,SINGLE_BOOL_SIZE:()=>tL,SINGLE_BYTE_SIZE:()=>t$,SignedTransaction:()=>Y.Zj,SignedTxnInBlock:()=>e$.pN,SignedTxnWithAD:()=>e$.Y7,SigslotCommit:()=>eL.Bn,StateProof:()=>eL.ol,StateProofMessage:()=>eL.Ps,StateProofTrackingData:()=>e$.$T,StateSchema:()=>et.XJ,TealValue:()=>et.I$,Transaction:()=>th.ZX,TransactionType:()=>to.D_,TxnCommitments:()=>e$.Xt,UntypedValue:()=>eU.N,UpgradeState:()=>e$.Eh,UpgradeVote:()=>e$.XI,ValueDelta:()=>e$.WU,VotingData:()=>et.Uc,abiCheckTransactionType:()=>t0,abiTypeIsReference:()=>t1,abiTypeIsTransaction:()=>tQ,algosToMicroalgos:()=>p,appendSignMultisigTransaction:()=>te,appendSignRawMultisigSignature:()=>tt,assignGroupID:()=>eQ,base64ToBytes:()=>S.Kp,bigIntToBytes:()=>eM,bytesToBase64:()=>S.if,bytesToBigInt:()=>eN,bytesToHex:()=>S.My,bytesToString:()=>S.Ar,coerceToBytes:()=>S.aS,computeGroupID:()=>eY,createDryrun:()=>ts,createMultisigTransaction:()=>e3,decodeAddress:()=>l.FS,decodeJSON:()=>m.Hz,decodeMsgpack:()=>m.VQ,decodeObj:()=>m.At,decodeSignedTransaction:()=>Y.BA,decodeUint64:()=>eR.X,decodeUnsignedTransaction:()=>th.kX,dryrunTxnResultAppTrace:()=>tu,dryrunTxnResultLogicSigTrace:()=>tp,encodeAddress:()=>l.jX,encodeJSON:()=>m.HT,encodeMsgpack:()=>m.BS,encodeObj:()=>m.W2,encodeUint64:()=>eR.z,encodeUnsignedSimulateTransaction:()=>Y.O$,encodeUnsignedTransaction:()=>th.w7,encodedMultiSigFromEncodingData:()=>to.oO,encodedMultiSigToEncodingData:()=>to.Zv,encodedSubsigFromEncodingData:()=>to.N$,encodedSubsigToEncodingData:()=>to.Gn,generateAccount:()=>eO,getApplicationAddress:()=>l.Hj,getMethodByName:()=>t2,hexToBytes:()=>S.aT,indexerModels:()=>el,isOnApplicationComplete:()=>to.Lh,isTransactionType:()=>to.BP,isTransactionWithSigner:()=>tN,isValidAddress:()=>l.$m,logicSigFromByte:()=>e0.Q5,makeApplicationCallTxnFromObject:()=>tx,makeApplicationClearStateTxnFromObject:()=>tC,makeApplicationCloseOutTxnFromObject:()=>tk,makeApplicationCreateTxnFromObject:()=>tA,makeApplicationDeleteTxnFromObject:()=>tI,makeApplicationNoOpTxnFromObject:()=>t_,makeApplicationOptInTxnFromObject:()=>tT,makeApplicationUpdateTxnFromObject:()=>tE,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>tw,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>ty,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>tv,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>tb,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>tS,makeBaseAssetConfigTxn:()=>tm,makeBasicAccountTransactionSigner:()=>tD,makeEmptyTransactionSigner:()=>tM,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>tg,makeLogicSigAccountTransactionSigner:()=>tB,makeMultiSigAccountTransactionSigner:()=>tP,makePaymentTxnWithSuggestedParamsFromObject:()=>tf,masterDerivationKeyToMnemonic:()=>eX,mergeMultisigTransactions:()=>e9,microalgosToAlgos:()=>u,mnemonicFromSeed:()=>eK,mnemonicToMasterDerivationKey:()=>eJ,mnemonicToSecretKey:()=>eH,modelsv2:()=>f,msgpackRawDecode:()=>m.J_,msgpackRawDecodeAsMap:()=>m.zx,msgpackRawEncode:()=>m.p6,multisigAddress:()=>e1.B,parseJSON:()=>h.Ol,secretKeyToMnemonic:()=>eW,seedFromMnemonic:()=>eG,signBytes:()=>rr,signLogicSigTransaction:()=>e2,signLogicSigTransactionObject:()=>e5,signMultisigTransaction:()=>e7,signTransaction:()=>rt,stringifyJSON:()=>h.e4,tealSign:()=>e0.Ik,tealSignFromProgram:()=>e0.I8,verifyBytes:()=>rn,verifyMultisig:()=>e1.ce,verifyTealSign:()=>e0.ll,waitForConfirmation:()=>eP});var s=r(87131),l=r(68724);let c="Microalgos should be positive and less than 2^53 - 1.";function u(e){if(e<0||!Number.isSafeInteger(e))throw Error(c);return e/1e6}function p(e){return Math.round(1e6*e)}var h=r(46085),d=r(50517),f=r(52301);class g{constructor(e){this.c=e,this.query={}}executeRequest(e,t){return this.c.get({relativePath:this.path(),query:this.query,requestHeaders:e,customOptions:t})}async do(e,t){let r=await this.executeRequest(e,t);return this.prepare(r)}async doRaw(e,t){return(await this.executeRequest(e,t)).body}}var m=r(9517);class y extends g{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}`}exclude(e){return this.query.exclude=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),f.Account)}}class w extends g{constructor(e,t,r){super(e),this.account=t.toString(),this.assetID=BigInt(r)}path(){return`/v2/accounts/${this.account}/assets/${this.assetID}`}prepare(e){return(0,m.Hz)(e.getJSONText(),f.AccountAssetResponse)}}class v extends g{constructor(e,t,r){super(e),this.account=t.toString(),this.applicationID=BigInt(r)}path(){return`/v2/accounts/${this.account}/applications/${this.applicationID}`}prepare(e){return(0,m.Hz)(e.getJSONText(),f.AccountApplicationResponse)}}class b extends g{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/blocks/${this.round}`}headerOnly(e){return this.query["header-only"]=e,this}prepare(e){return(0,m.VQ)(e.body,f.BlockResponse)}}var S=r(30841);function x(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&((t={...e})["Content-Type"]="text/plain"),t}class A extends g{constructor(e,t){super(e),this.source=t}path(){return"/v2/teal/compile"}sourcemap(e=!0){return this.query.sourcemap=e,this}executeRequest(e,t){let r=x(e);return this.c.post({relativePath:this.path(),data:(0,S.aS)(this.source),query:this.query,requestHeaders:r,customOptions:t})}prepare(e){return(0,m.Hz)(e.getJSONText(),f.CompileResponse)}}class E extends g{constructor(e,t){super(e),this.blob=(0,m.BS)(t)}path(){return"/v2/teal/dryrun"}executeRequest(e,t){let r=x(e);return this.c.post({relativePath:this.path(),data:this.blob,requestHeaders:r,customOptions:t})}prepare(e){return(0,m.Hz)(e.getJSONText(),f.DryrunResponse)}}class I extends g{path(){return"/genesis"}prepare(e){return e.getJSONText()}}class T extends g{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}`}prepare(e){return(0,m.Hz)(e.getJSONText(),f.Asset)}}class k extends g{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/applications/${this.index}`}prepare(e){return(0,m.Hz)(e.getJSONText(),f.Application)}}class C extends g{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/hash`}prepare(e){return(0,m.Hz)(e.getJSONText(),f.BlockHashResponse)}}class _ extends g{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/txids`}prepare(e){return(0,m.Hz)(e.getJSONText(),f.BlockTxidsResponse)}}class D extends g{constructor(e,t,r){super(e),this.index=BigInt(t);let n=(0,S.if)(r);this.query.name=encodeURI(`b64:${n}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return(0,m.Hz)(e.getJSONText(),f.Box)}}class B extends g{constructor(e,t){super(e),this.index=BigInt(t),this.query.max=0}path(){return`/v2/applications/${this.index}/boxes`}max(e){return this.query.max=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),f.BoxesResponse)}}class P extends g{path(){return"/health"}prepare(e){}}class M extends g{constructor(e,t){super(e),this.txid=t,this.query.format="msgpack"}prepare(e){return(0,m.VQ)(e.body,f.PendingTransactionResponse)}path(){return`/v2/transactions/pending/${this.txid}`}max(e){return this.query.max=e,this}}class N extends g{constructor(e){super(e),this.query.format="msgpack"}path(){return"/v2/transactions/pending"}prepare(e){return(0,m.VQ)(e.body,f.PendingTransactionsResponse)}max(e){return this.query.max=e,this}}class R extends g{constructor(e,t){super(e),this.address=t.toString(),this.query.format="msgpack"}prepare(e){return(0,m.VQ)(e.body,f.PendingTransactionsResponse)}path(){return`/v2/accounts/${this.address}/transactions/pending`}max(e){return this.query.max=e,this}}class O extends g{constructor(e,t,r){super(e),this.txID=r,this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/transactions/${this.txID}/proof`}hashType(e){return this.query.hashtype=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),f.TransactionProof)}}function $(e){return e&&void 0!==e.byteLength}class L extends g{constructor(e,t){super(e);let r=t;if(Array.isArray(t)){if(!t.every($))throw TypeError("Array elements must be byte arrays");r=(0,h.zI)(...t)}else if(!$(r))throw TypeError("Argument must be byte array");this.txnBytesToPost=r}path(){return"/v2/transactions"}executeRequest(e,t){let r=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&((t={...e})["Content-Type"]="application/x-binary"),t}(e);return this.c.post({relativePath:this.path(),data:this.txnBytesToPost,requestHeaders:r,customOptions:t})}prepare(e){return(0,m.Hz)(e.getJSONText(),f.PostTransactionsResponse)}}class U extends g{path(){return"/v2/status"}prepare(e){return(0,m.Hz)(e.getJSONText(),f.NodeStatusResponse)}}class V extends g{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/status/wait-for-block-after/${this.round}`}prepare(e){return(0,m.Hz)(e.getJSONText(),f.NodeStatusResponse)}}class F extends g{path(){return"/v2/transactions/params"}prepare(e){let t=(0,m.Hz)(e.getJSONText(),f.TransactionParametersResponse);return{flatFee:!1,fee:t.fee,firstValid:t.lastRound,lastValid:t.lastRound+BigInt(1e3),genesisID:t.genesisId,genesisHash:t.genesisHash,minFee:t.minFee,consensusVersion:t.consensusVersion}}}class j extends g{path(){return"/v2/ledger/supply"}prepare(e){return(0,m.Hz)(e.getJSONText(),f.SupplyResponse)}}class q extends g{path(){return"/versions"}prepare(e){return(0,m.Hz)(e.getJSONText(),f.Version)}}class z extends g{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/lightheader/proof`}prepare(e){return(0,m.Hz)(e.getJSONText(),f.LightBlockHeaderProof)}}class K extends g{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/stateproofs/${this.round}`}prepare(e){return(0,m.Hz)(e.getJSONText(),f.StateProof)}}class G extends g{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/ledger/sync/${this.round}`}executeRequest(e,t){return this.c.post({relativePath:this.path(),data:null,requestHeaders:e,customOptions:t})}prepare(e){}}class H extends g{path(){return"/v2/ledger/sync"}prepare(e){return(0,m.Hz)(e.getJSONText(),f.GetSyncRoundResponse)}}class W extends g{constructor(e,t){super(e),this.offset=BigInt(t)}path(){return`/v2/devmode/blocks/offset/${this.offset}`}executeRequest(e,t){return this.c.post({relativePath:this.path(),data:null,requestHeaders:e,customOptions:t})}prepare(e){}}class J extends g{path(){return"/v2/devmode/blocks/offset"}prepare(e){return(0,m.Hz)(e.getJSONText(),f.GetBlockTimeStampOffsetResponse)}}class X extends g{constructor(e,t){super(e),this.source=t}path(){return"/v2/teal/disassemble"}executeRequest(e,t){let r=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&((t={...e})["Content-Type"]="text/plain"),t}(e);return this.c.post({relativePath:this.path(),data:(0,S.aS)(this.source),query:this.query,requestHeaders:r,customOptions:t})}prepare(e){return(0,m.Hz)(e.getJSONText(),f.DisassembleResponse)}}class Z extends g{constructor(e,t){super(e),this.query.format="msgpack",this.requestBytes=(0,m.BS)(t)}path(){return"/v2/transactions/simulate"}executeRequest(e,t){let r=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&((t={...e})["Content-Type"]="application/msgpack"),t}(e);return this.c.post({relativePath:this.path(),data:this.requestBytes,query:this.query,requestHeaders:r,customOptions:t})}prepare(e){return(0,m.VQ)(e.body,f.SimulateResponse)}}var Y=r(33210);class Q extends g{path(){return"/ready"}prepare(e){}}class ee extends g{path(){return"/v2/ledger/sync"}executeRequest(e,t){return this.c.delete({relativePath:this.path(),data:void 0,requestHeaders:e,customOptions:t})}prepare(e){}}var et=r(25361);class er extends g{constructor(e,t){super(e),this.id=t,this.query={format:"msgpack"}}path(){return`/v2/deltas/txn/group/${this.id}`}prepare(e){return(0,m.VQ)(e.body,et.NC)}}class en extends g{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/deltas/${this.round}`}prepare(e){return(0,m.VQ)(e.body,et.NC)}}class ea extends g{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/deltas/${this.round}/txn/group`}prepare(e){return(0,m.VQ)(e.body,f.TransactionGroupLedgerStateDeltasForRoundResponse)}}class ei extends d.A{constructor(e,t,r,n={}){super("X-Algo-API-Token",e,t,r,n)}healthCheck(){return new P(this.c)}versionsCheck(){return new q(this.c)}sendRawTransaction(e){return new L(this.c,e)}accountInformation(e){return new y(this.c,e)}accountAssetInformation(e,t){return new w(this.c,e,t)}accountApplicationInformation(e,t){return new v(this.c,e,t)}block(e){return new b(this.c,e)}getBlockHash(e){return new C(this.c,e)}getBlockTxids(e){return new _(this.c,e)}pendingTransactionInformation(e){return new M(this.c,e)}pendingTransactionsInformation(){return new N(this.c)}pendingTransactionByAddress(e){return new R(this.c,e)}status(){return new U(this.c)}statusAfterBlock(e){return new V(this.c,e)}getTransactionParams(){return new F(this.c)}supply(){return new j(this.c)}compile(e){return new A(this.c,e)}
5disassemble(e){return new X(this.c,e)}dryrun(e){return new E(this.c,e)}getAssetByID(e){return new T(this.c,e)}getApplicationByID(e){return new k(this.c,e)}getApplicationBoxByName(e,t){return new D(this.c,e,t)}getApplicationBoxes(e){return new B(this.c,e)}genesis(){return new I(this.c)}getTransactionProof(e,t){return new O(this.c,e,t)}getLightBlockHeaderProof(e){return new z(this.c,e)}getStateProof(e){return new K(this.c,e)}simulateRawTransactions(e){let t=[];if(Array.isArray(e))for(let r of e)t.push(m.VQ(r,Y.Zj));else t.push(m.VQ(e,Y.Zj));let r=new f.SimulateRequest({txnGroups:[new f.SimulateRequestTransactionGroup({txns:t})]});return this.simulateTransactions(r)}simulateTransactions(e){return new Z(this.c,e)}setBlockOffsetTimestamp(e){return new W(this.c,e)}getBlockOffsetTimestamp(){return new J(this.c)}setSyncRound(e){return new G(this.c,e)}unsetSyncRound(){return new ee(this.c)}getSyncRound(){return new H(this.c)}ready(){return new Q(this.c)}getLedgerStateDeltaForTransactionGroup(e){return new er(this.c,e)}getLedgerStateDelta(e){return new en(this.c,e)}getTransactionGroupLedgerStateDeltasForRound(e){return new ea(this.c,e)}}var eo=r(73716);class es extends d.A{constructor(e,t="http://127.0.0.1",r=7833,n={}){super("X-KMD-API-Token",e,t,r,n)}async get(e){return(await this.c.get({relativePath:e})).parseBodyAsJSON({intDecoding:eo.A.SAFE})}async delete(e,t){return(await this.c.delete({relativePath:e,data:t})).parseBodyAsJSON({intDecoding:eo.A.SAFE})}async post(e,t){return(await this.c.post({relativePath:e,data:t})).parseBodyAsJSON({intDecoding:eo.A.SAFE})}async versions(){return this.get("/versions")}async listWallets(){return this.get("/v1/wallets")}async createWallet(e,t,r=new Uint8Array,n="sqlite"){let a={wallet_name:e,wallet_driver_name:n,wallet_password:t,master_derivation_key:(0,S.if)(r)};return this.post("/v1/wallet",a)}async initWalletHandle(e,t){return this.post("/v1/wallet/init",{wallet_id:e,wallet_password:t})}async releaseWalletHandle(e){return this.post("/v1/wallet/release",{wallet_handle_token:e})}async renewWalletHandle(e){return this.post("/v1/wallet/renew",{wallet_handle_token:e})}async renameWallet(e,t,r){return this.post("/v1/wallet/rename",{wallet_id:e,wallet_password:t,wallet_name:r})}async getWallet(e){return this.post("/v1/wallet/info",{wallet_handle_token:e})}async exportMasterDerivationKey(e,t){let r=await this.post("/v1/master-key/export",{wallet_handle_token:e,wallet_password:t});return{master_derivation_key:(0,S.Kp)(r.master_derivation_key)}}async importKey(e,t){let r={wallet_handle_token:e,private_key:(0,S.if)(t)};return this.post("/v1/key/import",r)}async exportKey(e,t,r){let n=await this.post("/v1/key/export",{wallet_handle_token:e,address:r,wallet_password:t});return{private_key:(0,S.Kp)(n.private_key)}}async generateKey(e){return this.post("/v1/key",{wallet_handle_token:e,dis
5play_mnemonic:!1})}async deleteKey(e,t,r){return this.delete("/v1/key",{wallet_handle_token:e,address:r,wallet_password:t})}async listKeys(e){return this.post("/v1/key/list",{wallet_handle_token:e})}async signTransaction(e,t,r){let n={wallet_handle_token:e,wallet_password:t,transaction:(0,S.if)(r.toByte())},a=await this.post("/v1/transaction/sign",n);return(0,S.Kp)(a.signed_transaction)}async signTransactionWithSpecificPublicKey(e,t,r,n){let a=(0,S.aS)(n),i={wallet_handle_token:e,wallet_password:t,transaction:(0,S.if)(r.toByte()),public_key:(0,S.if)(a)},o=await this.post("/v1/transaction/sign",i);return(0,S.Kp)(o.signed_transaction)}async listMultisig(e){return this.post("/v1/multisig/list",{wallet_handle_token:e})}async importMultisig(e,t,r,n){return this.post("/v1/multisig/import",{wallet_handle_token:e,multisig_version:t,threshold:r,pks:n})}async exportMultisig(e,t){return this.post("/v1/multisig/export",{wallet_handle_token:e,address:t})}async signMultisigTransaction(e,t,r,n,a){let i=(0,S.aS)(n),o={wallet_handle_token:e,transaction:(0,S.if)(r.toByte()),public_key:(0,S.if)(i),partial_multisig:a,wallet_password:t};return this.post("/v1/multisig/sign",o)}async deleteMultisig(e,t,r){return this.delete("/v1/multisig",{wallet_handle_token:e,address:r,wallet_password:t})}}var el=r(9291);class ec extends g{path(){return"/health"}prepare(e){return(0,m.Hz)(e.getJSONText(),el.HealthCheck)}}class eu extends g{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}/balances`}limit(e){return this.query.limit=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.AssetBalancesResponse)}}function ep(e){return"string"==typeof e?e:(0,S.if)(e)}class eh extends g{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/transactions`}notePrefix(e){return this.query["note-prefix"]=ep(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.TransactionsResponse)}}class ed extends g{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}/transactions`}notePrefix(e){return this.query["note-prefix"]=ep(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e.toString(),this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.TransactionsResponse)}}class ef extends g{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}`}headerOnly(e){return this.query["header-only"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.Block)}}class eg extends g{constructor(e,t){super(e),this.txID=t}path(){return`/v2/transactions/${this.txID}`}prepare(e){return(0,m.Hz)(e.getJSONText(),el.TransactionResponse)}}class em extends g{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}`}round(e){return this.query.round=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.AccountResponse)}}class ey extends g{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/assets`}limit(e){return this.query.limit=e,this}
5round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetId(e){return this.query["asset-id"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.AssetHoldingsResponse)}}class ew extends g{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/created-assets`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetID(e){return this.query["asset-id"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.AssetsResponse)}}class ev extends g{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/apps-local-state`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.ApplicationLocalStatesResponse)}}class eb extends g{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/created-applications`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.ApplicationsResponse)}}class eS extends g{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.AssetResponse)}}class ex extends g{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/applications/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.ApplicationResponse)}}class eA extends g{constructor(e,t){super(e),this.appID=BigInt(t)}path(){return`/v2/applications/${this.appID}/logs`}limit(e){return this.query.limit=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}nextToken(e){return this.query.next=e,this}sender(e){return this.query["sender-address"]=e,this}txid(e){return this.query.txid=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.ApplicationLogsResponse)}}class eE extends g{constructor(e,t,r){super(e),this.index=BigInt(t);let n=(0,S.if)(r);this.query.name=encodeURI(`b64:${n}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return(0,m.Hz)(e.getJSONText(),el.Box)}}class eI extends g{path(){return"/v2/accounts"}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}limit(e){return this.query.limit=e,this}assetID(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}round(e){return this.query.round=e,this}authAddr(e){return this.query["auth-addr"]=e.toString(),this}applicationID(e){return this.query["application-id"]=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}onlineOnly(e){return this.query["online-only"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.AccountsResponse)}}class eT extends g{path(){return"/v2/block-headers"}absent(e){return this.query.absent=e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}expired(e){return this.query.expired=e,this}limit(e){return this.query.limit=e,this}maxRound(e){return this.query["max-round"]=e,this}minRound(e){return this.query["min-round"]=e,this}nextToken(e){return this.query.next=e,this}proposers(e){return this.query.proposers=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.BlockHeadersResponse)}}class ek extends g{path(){return"/v2/transactions"}notePrefix(e){return this.query["note-prefix"]=ep(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}groupid(e){return this.query["group-id"]=ep(e),this}
5round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e.toString(),this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}applicationID(e){return this.query["application-id"]=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.TransactionsResponse)}}class eC extends g{path(){return"/v2/assets"}limit(e){return this.query.limit=e,this}creator(e){return this.query.creator=e.toString(),this}name(e){return this.query.name=e,this}unit(e){return this.query.unit=e,this}index(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.AssetsResponse)}}class e_ extends g{path(){return"/v2/applications"}index(e){return this.query["application-id"]=e,this}creator(e){return this.query.creator=e.toString(),this}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.ApplicationsResponse)}}class eD extends g{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/applications/${this.index}/boxes`}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}prepare(e){return(0,m.Hz)(e.getJSONText(),el.BoxesResponse)}}class eB extends d.A{constructor(e,t="http://127.0.0.1",r=8080,n={}){super("X-Indexer-API-Token",e,t,r,n)}makeHealthCheck(){return new ec(this.c)}lookupAssetBalances(e){return new eu(this.c,e)}lookupAssetTransactions(e){return new ed(this.c,e)}lookupAccountTransactions(e){return new eh(this.c,e)}lookupBlock(e){return new ef(this.c,e)}lookupTransactionByID(e){return new eg(this.c,e)}lookupAccountByID(e){return new em(this.c,e)}lookupAccountAssets(e){return new ey(this.c,e)}lookupAccountCreatedAssets(e){return new ew(this.c,e)}lookupAccountAppLocalStates(e){return new ev(this.c,e)}lookupAccountCreatedApplications(e){return new eb(this.c,e)}lookupAssetByID(e){return new eS(this.c,e)}lookupApplications(e){return new ex(this.c,e)}lookupApplicationLogs(e){return new eA(this.c,e)}searchAccounts(){return new eI(this.c)}searchForBlockHeaders(){return new eT(this.c)}searchForTransactions(){return new ek(this.c)}searchForAssets(){return new eC(this.c)}searchForApplications(){return new e_(this.c)}searchForApplicationBoxes(e){return new eD(this.c,e)}lookupApplicationBoxByIDandName(e,t){return new eE(this.c,e,t)}}async function eP(e,t,r){let n=await e.status().do();if(void 0===n)throw Error("Unable to get node status");let a=n.lastRound+BigInt(1),i=a+BigInt(r),o=a;for(;o<i;){let r=!1;try{let n=await e.pendingTransactionInformation(t).do();if(n.confirmedRound)return n;if(n.poolError)throw r=!0,Error(`Transaction Rejected: ${n.poolError}`)}catch(e){if(r)throw e}await e.statusAfterBlock(o).do(),o+=BigInt(1)}throw Error(`Transaction not confirmed after ${r} rounds`)}function eM(e,t){let r=e.toString(16);r.length!==2*t&&(r=r.padStart(2*t,"0"));let n=new Uint8Array(r.length/2);for(let e=0,t=0;e<r.length/2;e++,t+=2)n[e]=parseInt(r.slice(t,t+2),16);return n}function eN(e){let t=BigInt(0),r=new DataView(e.buffer,e.byteOffset);for(let n=0;n<e.length;n++)t=BigInt(Number(r.getUint8(n)))+t*BigInt(256);return t}var eR=r(96898);function eO(){let e=s.YT();return{addr:new l.pV(e.publicKey),sk:e.secretKey}}var e$=r(67769),eL=r(44735),eU=r(72705);let eV=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","a
5head","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","
5initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","ric
5h","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"],eF="failed to decode mnemonic";function ej(e){let t=[],r=0,n=0;return e.forEach(function(e){r|=e<<n,(n+=8)>=11&&(t.push(2047&r),r>>=11,n-=11)}),n&&t.push(r),t}function eq(e){return e.map(e=>eV[e])}function ez(e){return eq(ej(s.uj(e)))[0]}function eK(e){if(e.length!==s.ne)throw RangeError(`Seed length must be ${s.ne}`);let t=eq(ej(e)),r=ez(e);return`${t.join(" ")} ${r}`}function eG(e){let t=e.split(" "),r=t.slice(0,24);for(let e of r)if(-1===eV.indexOf(e))throw Error("the mnemonic contains a word that is not in the wordlist");let n=t[t.length-1],a=function(e){let t=[],r=0,n=0;return e.forEach(function(e){for(r|=e<<n,n+=11;n>=8;)t.push(255&r),r>>=8,n-=8}),n&&t.push(r),new Uint8Array(t)}(r.map(e=>eV.indexOf(e)));if(33!==a.length||0!==a[a.length-1])throw Error(eF);if(ez(a=a.slice(0,a.length-1))===n)return a;throw Error(eF)}function eH(e){let t=eG(e),r=s.r9(t);
5return{addr:new l.pV(r.publicKey),sk:r.secretKey}}function eW(e){return eK(e.slice(0,s.ne))}function eJ(e){return eG(e)}function eX(e){return eK(e)}let eZ=new TextEncoder().encode("TG");function eY(e){let t=[];for(let r of e)t.push(r.rawTxID());let r=function(e){if(e.length>16)throw Error(`${e.length} transactions grouped together but max group size is 16`);if(0===e.length)throw Error("Cannot compute group ID of zero transactions");let t=(0,m.p6)({txlist:e});return h.zI(eZ,t)}(t),n=s.uj(r);return Uint8Array.from(n)}function eQ(e){let t=eY(e);for(let r of e)r.group=t;return e}var e0=r(93593),e1=r(88760);function e5(e,t){let r,n,a;if(t instanceof e0.Hl)r=t.lsig,n=t.address();else if((r=t).sig)n=new l.pV(e.sender.publicKey);else if(r.msig){let e={version:r.msig.v,threshold:r.msig.thr,pks:r.msig.subsig.map(e=>e.pk)};n=(0,e1.VC)(e)}else n=r.address();var i=r,o=n;if(!i.verify(o.publicKey))throw Error("Logic signature verification failed. Ensure the program and signature are valid.");s.O6(o.publicKey,e.sender.publicKey)||(a=o);let c=new Y.Zj({lsig:i,txn:e,sgnr:a});return{txID:e.txID(),blob:m.BS(c)}}function e2(e,t){return e5(e,t)}let e6="Cannot merge txs. Multisig preimages differ";function e3(e,{version:t,threshold:r,addrs:n}){let a,i=(0,e1.bW)(n),o=i.map(e=>({pk:e})),s=(0,e1.VC)({version:t,threshold:r,pks:i});e.sender.equals(s)||(a=s);let l=new Y.Zj({txn:e,msig:{v:t,thr:r,subsig:o},sgnr:a});return m.BS(l)}function e4(e,{rawSig:t,myPk:r},{version:n,threshold:a,pks:i}){let o=e3(e,{version:n,threshold:a,addrs:i.map(e=>new l.pV(e))}),c=m.VQ(o,Y.Zj),u=!1;if(c.msig.subsig.forEach((e,n)=>{s.O6(e.pk,r)&&(u=!0,c.msig.subsig[n].s=t)}),!u)throw Error("Key does not exist");return m.BS(c)}function e8(e,{version:t,threshold:r,pks:n},a){let i=s.$Y(a).publicKey;return e4(e,{rawSig:e.rawSignTxn(a),myPk:i},{version:t,threshold:r,pks:n})}function e9(e){if(e.length<2)throw Error("Not enough multisig transactions to merge. Need at least two");let t=m.VQ(e[0],Y.Zj);if(!t.msig)throw Error("Invalid multisig transaction, multisig structure missing at index 0");let r=t.txn.txID(),n=t.sgnr?t.sgnr.toString():void 0,a={version:t.msig.v,threshold:t.msig.thr,pks:t.msig.subsig.map(e=>e.pk)},i=(0,e1.VC)(a),o=t.msig.subsig.map(e=>({...e}));for(let a=1;a<e.length;a++){let s=m.VQ(e[a],Y.Zj);if(!s.msig)throw Error(`Invalid multisig transaction, multisig structure missing at index ${a}`);if(s.txn.txID()!==r)throw Error("Cannot merge txs. txIDs differ");if(n!==(s.sgnr?s.sgnr.toString():void 0))throw Error("Cannot merge txs. Auth addrs differ");if(s.msig.subsig.length!==t.msig.subsig.length)throw Error(e6);let l={version:s.msig.v,threshold:s.msig.thr,pks:s.msig.subsig.map(e=>e.pk)},c=(0,e1.VC)(l);if(!i.equals(c))throw Error(e6);s.msig.subsig.forEach((e,t)=>{if(!e.s)return;let r=o[t];if(r.s&&!h.af(e.s,r.s))throw Error("Cannot merge txs. subsigs are mismatched.");r.s=e.s})}let s={v:t.msig.v,thr:t.msig.thr,subsig:o},l=void 0!==n?t.sgnr:void 0,c=new Y.Zj({msig:s,txn:t.txn,sgnr:l});return m.BS(c)}function e7(e,{version:t,threshold:r,addrs:n},a){let i=e8(e,{version:t,threshold:r,pks:(0,e1.bW)(n)},a);return{txID:e.txID(),blob:i}}function te(e,{version:t,threshold:r,addrs:n},a){let i=(0,e1.bW)(n),o=m.VQ(e,Y.Zj),s=e8(o.txn,{version:t,threshold:r,pks:i},a);return{txID:o.txn.txID(),blob:e9([e,s])}}function tt(e,{version:t,threshold:r,addrs:n},a,i){let o=(0,e1.bW)(n),c=m.VQ(e,Y.Zj),u=function(e,t,r,n){if(!s.n5(n.length))throw Error("Cannot add multisig signature. Signature is not of the correct length.");return e4(e,{rawSig:n,myPk:("string"==typeof r?l.pV.fromString(r):r).publicKey},t)}(c.txn,{version:t,threshold:r,pks:o},a,i);return{txID:c.txn.txID(),blob:e9([e,u])}}let tr={},tn={};function ta(e){let t=[],r=0,n=0;for(let a=0;a<e.length;a+=1){let i=tr[e[a]];if(void 0===i)throw Error("Invalid character ("+e[a]+")");let o=32&i;if(i&=31,n+=i<<r,o)r+=5;else{let e=1&n;n>>>=1,e?t.push(0===n?-0x80000000:-n):t.push(n),n=r=0}}return t}"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split("").forEach(function(e,t){tr[e]=t,tn[t]=e});class ti{constructor({version:e,sources:t,names:r,mappings:n}){if(this.version=e,this.sources=t,this.names=r,this.mappings=n,3!==this.version)throw Error(`Only version 3 is supported, got ${this.version}`);if(void 0===this.mappings)throw Error("mapping undefined, cannot build source map without `mapping`");let a=this.mappings.split(";").map(ta);this.pcToLocation=new Map,this.sourceAndLineToPc=new Map;let i={line:0,column:0,sourceIndex:0,nameIndex:0};for(let[e,t]of a.entries()){if(t.length<4)continue;let r=t.length>4?t[4]:void 0,[,n,a,o]=t;i.sourceIndex+=n,i.line+=a,i.column+=o,void 0!==r&&(i.nameIndex+=r);let s=`${i.sourceIndex}:${i.line}`,l=this.sourceAndLineToPc.get(s);void 0===l&&(l=[],this.sourceAndLineToPc.set(s,l));let c={pc:e,column:i.column},u={line:i.line,column:i.column,sourceIndex:i.sourceIndex};void 0!==r&&(c.nameIndex=i.nameIndex,u.nameIndex=i.nameIndex),l.push(c),this.pcToLocation.set(e,u)}}getPcs(){return Array.from(this.pcToLocation.keys())}getLocationForPc(e){return this.pcToLocation.get(e)}getPcsOnSourceLine(e,t){let r=this.sourceAndLineToPc.get(`${e}:${t}`);return void 0===r?[]:r}}var to=r(59310);async function ts({client:e,txns:t,protocolVersion:r,latestTimestamp:n,round:a,sources:i}){let o=[],s=[],c=[],u=[],p=[];for(let e of t)if(e.txn.type===to.D_.appl)if(p.push(e.txn.sender.toString()),p.push(...e.txn.applicationCall.accounts.map(e=>e.toString())),c.push(...e.txn.applicationCall.foreignApps),p.push(...e.txn.applicationCall.foreignApps.map(l.Hj).map(e=>e.toString())),u.push(...e.txn.applicationCall.foreignAssets),e.txn.applicationCall.appIndex===BigInt(0))o.push(new f.Application({id:0x52414e44,params:new f.ApplicationParams({creator:e.txn.sender.toString(),approvalProgram:e.txn.applicationCall.approvalProgram,clearStateProgram:e.txn.applicationCall.clearProgram,localStateSchema:new f.ApplicationStateSchema({numUint:e.txn.applicationCall.numLocalInts,numByteSlice:e.txn.applicationCall.numLocalByteSlices}),globalStateSchema:new f.ApplicationStateSchema({numUint:e.txn.applicationCall.numGlobalInts,numByteSlice:e.txn.applicationCall.numGlobalByteSlices})})}));else{let{appIndex:t}=e.txn.applicationCall;c.push(t),p.push((0,l.Hj)(t).toString())}let h=[];for(let t of new Set(u))h.push(e.getAssetByID(t).do().then(e=>{p.push(e.params.creator)}));await Promise.all(h);let d=[];for(let t of new Set(c))d.push(e.getApplicationByID(t).do().then(e=>{o.push(e),p.push(e.params.creator.toString())}));await Promise.all(d);let g=[];for(let t of new Set(p))g.push(e.accountInformation(t).do().then(e=>{s.push(e)}));return await Promise.all(g),new f.DryrunRequest({txns:t.slice(),accounts:s,apps:o,latestTimestamp:n??0,round:a??0,protocolVersion:r??"",sources:i??[]})}function tl(e,t){return e.length>t&&t>0?`${e.slice(0,t)}...`:e}function tc(e,t,r){let n=r.maxValueWidth||30,a=[["pc#","ln#","source","scratch","stack"]];for(let i=0;i<e.length;i++){let{line:o,error:s,pc:l,scratch:c,stack:u}=e[i],p=void 0!==c?c:[],d=i>0&&void 0!==e[i-1].scratch?e[i-1].scratch:[],f=s?`!! ${s} !!`:t[o];a.push([l.toString().padEnd(3," "),o.toString().padEnd(3," "),tl(f,n),tl(function(e,t){if(0===t.length)return"";let r=null;for(let n=0;n<t.length;n++){if(n>e.length){r=n;continue}(0,h.e4)(e[n])!==(0,h.e4)(t[n])&&(r=n)}if(null==r)return"";let n=t[r];return n.bytes.length>0?`${r} = 0x${(0,S.My)(n.bytes)}`:`${r} = ${n.uint.toString()}`}(d,p),n),tl(function(e,t){let r=t?e.reverse():e;return`[${r.map(e=>{switch(e.type){case 1:return`0x${(0,S.My)(e.bytes)}`;case 2:return e.uint.toString();default:return""}}).join(", ")}]`}(u,r.topOfStackFirst),n)])}let i=a.reduce((e,t)=>
5{let r=Array(a[0].length).fill(0);for(let n=0;n<e.length;n++)r[n]=t[n].length>e[n]?t[n].length:e[n];return r},Array(a[0].length).fill(0));return`${a.map(e=>e.map((e,t)=>e.padEnd(i[t]+1," ")).join("|").trim()).join("\n")} 6`}function tu(e,t){if(!e.appCallTrace||!e.disassembly)return"";let r=t;return r=void 0!==t?t:{maxValueWidth:30,topOfStackFirst:!1},tc(e.appCallTrace,e.disassembly,r)}function tp(e,t){let r;return e.logicSigTrace&&e.logicSigDisassembly?(r=void 0!==t?t:{maxValueWidth:30,topOfStackFirst:!0},tc(e.logicSigTrace,e.logicSigDisassembly,r)):""}var th=r(27392),td=r(63979);function tf({sender:e,receiver:t,amount:r,closeRemainderTo:n,suggestedParams:a,note:i,lease:o,rekeyTo:s}){return new th.ZX({type:td.D_.pay,sender:e,note:i,lease:o,rekeyTo:s,suggestedParams:a,paymentParams:{receiver:t,amount:r,closeRemainderTo:n}})}function tg({sender:e,voteKey:t,selectionKey:r,stateProofKey:n,voteFirst:a,voteLast:i,voteKeyDilution:o,nonParticipation:s,suggestedParams:l,note:c,lease:u,rekeyTo:p}){return new th.ZX({type:td.D_.keyreg,sender:e,note:c,lease:u,rekeyTo:p,suggestedParams:l,keyregParams:{voteKey:t,selectionKey:r,stateProofKey:n,voteFirst:a,voteLast:i,voteKeyDilution:o,nonParticipation:s}})}function tm({sender:e,assetIndex:t,total:r,decimals:n,defaultFrozen:a,manager:i,reserve:o,freeze:s,clawback:l,unitName:c,assetName:u,assetURL:p,assetMetadataHash:h,note:d,lease:f,rekeyTo:g,suggestedParams:m}){return new th.ZX({type:td.D_.acfg,sender:e,note:d,lease:f,rekeyTo:g,suggestedParams:m,assetConfigParams:{assetIndex:t,total:r,decimals:n,defaultFrozen:a,manager:i,reserve:o,freeze:s,clawback:l,unitName:c,assetName:u,assetURL:p,assetMetadataHash:h}})}function ty({sender:e,total:t,decimals:r,defaultFrozen:n,manager:a,reserve:i,freeze:o,clawback:s,unitName:l,assetName:c,assetURL:u,assetMetadataHash:p,note:h,lease:d,rekeyTo:f,suggestedParams:g}){return tm({sender:e,total:t,decimals:r,defaultFrozen:n,manager:a,reserve:i,freeze:o,clawback:s,unitName:l,assetName:c,assetURL:u,assetMetadataHash:p,note:h,lease:d,rekeyTo:f,suggestedParams:g})}function tw({sender:e,assetIndex:t,manager:r,reserve:n,freeze:a,clawback:i,strictEmptyAddressChecking:o,note:s,lease:l,rekeyTo:c,suggestedParams:u}){if(!t)throw Error("assetIndex must be provided");if((o??!0)&&(null==r||null==n||null==a||null==i))throw Error("strictEmptyAddressChecking is enabled, but an address is empty. If this is intentional, set strictEmptyAddressChecking to false.");return tm({sender:e,assetIndex:t,manager:r,reserve:n,freeze:a,clawback:i,note:s,lease:l,rekeyTo:c,suggestedParams:u})}function tv({sender:e,assetIndex:t,note:r,lease:n,rekeyTo:a,suggestedParams:i}){if(!t)throw Error("assetIndex must be provided");return tm({sender:e,assetIndex:t,note:r,lease:n,rekeyTo:a,suggestedParams:i})}function tb({sender:e,assetIndex:t,freezeTarget:r,frozen:n,suggestedParams:a,note:i,lease:o,rekeyTo:s}){return new th.ZX({type:td.D_.afrz,sender:e,note:i,lease:o,rekeyTo:s,suggestedParams:a,assetFreezeParams:{assetIndex:t,freezeTarget:r,frozen:n}})}function tS({sender:e,receiver:t,amount:r,closeRemainderTo:n,assetSender:a,note:i,assetIndex:o,suggestedParams:s,rekeyTo:l,lease:c}){if(!o)throw Error("assetIndex must be provided");return new th.ZX({type:td.D_.axfer,sender:e,note:i,lease:c,rekeyTo:l,suggestedParams:s,assetTransferParams:{assetIndex:o,receiver:t,amount:r,assetSender:a,closeRemainderTo:n}})}function tx({sender:e,appIndex:t,onComplete:r,appArgs:n,accounts:a,foreignApps:i,foreignAssets:o,boxes:s,approvalProgram:l,clearProgram:c,numLocalInts:u,numLocalByteSlices:p,numGlobalInts:h,numGlobalByteSlices:d,extraPages:f,note:g,lease:m,rekeyTo:y,suggestedParams:w}){if(null==r)throw Error("onComplete must be provided");return new th.ZX({type:td.D_.appl,sender:e,note:g,lease:m,rekeyTo:y,suggestedParams:w,appCallParams:{appIndex:t,onComplete:r,appArgs:n,accounts:a,foreignAssets:o,foreignApps:i,boxes:s,approvalProgram:l,clearProgram:c,numLocalInts:u,numLocalByteSlices:p,numGlobalInts:h,numGlobalByteSlices:d,extraPages:f}})}function tA({sender:e,onComplete:t,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,approvalProgram:s,clearProgram:l,numLocalInts:c,numLocalByteSlices:u,numGlobalInts:p,numGlobalByteSlices:h,extraPages:d,note:f,lease:g,rekeyTo:m,suggestedParams:y}){if(!s||!l)throw Error("approvalProgram and clearProgram must be provided");
6if(null==t)throw Error("onComplete must be provided");return tx({sender:e,appIndex:0,onComplete:t,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,approvalProgram:s,clearProgram:l,numLocalInts:c,numLocalByteSlices:u,numGlobalInts:p,numGlobalByteSlices:h,extraPages:d,note:f,lease:g,rekeyTo:m,suggestedParams:y})}function tE({sender:e,appIndex:t,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,approvalProgram:s,clearProgram:l,note:c,lease:u,rekeyTo:p,suggestedParams:h}){if(!t)throw Error("appIndex must be provided");if(!s||!l)throw Error("approvalProgram and clearProgram must be provided");return tx({sender:e,appIndex:t,onComplete:td.DB.UpdateApplicationOC,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,approvalProgram:s,clearProgram:l,note:c,lease:u,rekeyTo:p,suggestedParams:h})}function tI({sender:e,appIndex:t,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,note:s,lease:l,rekeyTo:c,suggestedParams:u}){if(!t)throw Error("appIndex must be provided");return tx({sender:e,appIndex:t,onComplete:td.DB.DeleteApplicationOC,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,note:s,lease:l,rekeyTo:c,suggestedParams:u})}function tT({sender:e,appIndex:t,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,note:s,lease:l,rekeyTo:c,suggestedParams:u}){if(!t)throw Error("appIndex must be provided");return tx({sender:e,appIndex:t,onComplete:td.DB.OptInOC,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,note:s,lease:l,rekeyTo:c,suggestedParams:u})}function tk({sender:e,appIndex:t,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,note:s,lease:l,rekeyTo:c,suggestedParams:u}){if(!t)throw Error("appIndex must be provided");return tx({sender:e,appIndex:t,onComplete:td.DB.CloseOutOC,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,note:s,lease:l,rekeyTo:c,suggestedParams:u})}function tC({sender:e,appIndex:t,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,note:s,lease:l,rekeyTo:c,suggestedParams:u}){if(!t)throw Error("appIndex must be provided");return tx({sender:e,appIndex:t,onComplete:td.DB.ClearStateOC,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,note:s,lease:l,rekeyTo:c,suggestedParams:u})}function t_({sender:e,appIndex:t,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,note:s,lease:l,rekeyTo:c,suggestedParams:u}){if(!t)throw Error("appIndex must be provided");return tx({sender:e,appIndex:t,onComplete:td.DB.NoOpOC,appArgs:r,accounts:n,foreignApps:a,foreignAssets:i,boxes:o,note:s,lease:l,rekeyTo:c,suggestedParams:u})}function tD(e){return(t,r)=>{let n=[];for(let a of r)n.push(t[a].signTxn(e.sk));return Promise.resolve(n)}}function tB(e){return(t,r)=>{let n=[];for(let a of r){let{blob:r}=e5(t[a],e);n.push(r)}return Promise.resolve(n)}}function tP(e,t){return(r,n)=>{let a=[];for(let i of n){let n=r[i],o=[];for(let r of t){let{blob:t}=e7(n,e,r);o.push(t)}o.length>1?a.push(e9(o)):a.push(o[0])}return Promise.resolve(a)}}function tM(){return(e,t)=>{let r=[];for(let n of t)r.push((0,Y.O$)(e[n]));return Promise.resolve(r)}}function tN(e){return"object"==typeof e&&2===Object.keys(e).length&&"object"==typeof e.txn&&"function"==typeof e.signer}let tR=65535,tO=32,t$=1,tL=1,tU=2,tV=/^([a-z\d[\](),]+)\[(0|[1-9][\d]*)]$/,tF=/^ufixed([1-9][\d]*)x([1-9][\d]*)$/;class tj{static from(e){if(e.endsWith("[]"))return new tX(tj.from(e.slice(0,e.length-2)));if(e.endsWith("]")){let t=e.match(tV);if(!t||3!==t.length)throw Error(`malformed static array string: ${e}`);let r=parseInt(t[2],10);if(r>tR)throw Error(`array length exceeds limit ${tR}`);return new tJ(tj.from(t[1]),r)}if(e.startsWith("uint")){let t=e.slice(4,e.length);if(![...t].every(e=>"0123456789".includes(e)))throw Error(`malformed uint string: ${t}`);let r=parseInt(t,10);if(r>tR)throw Error(`malformed uint string: ${r}`);return new tq(r)}if("byte"===e)return new tH;if(e.startsWith("ufixed")){let t=e.match(tF);if(!t||3!==t.length)throw Error(`malformed ufixed type: ${e}`);return new tz(parseInt(t[1],10),parseInt(t[2],10))}if("bool"===e)return new tG;if("address"===e)return new tK;if("string"===e)return new tW;if(e.length>=2&&"("===e[0]&&")"===e[e.length-1]){let t=tZ.parseTupleContent(e.slice(1,e.length-1)),r=[];for(let e=0;e<t.length;e++){let n=tj.from(t[e]);r.push(n)}return new tZ(r)}
6throw Error(`cannot convert a string ${e} to an ABI type`)}}class tq extends tj{constructor(e){if(super(),e%8!=0||e<8||e>512)throw Error(`unsupported uint type bitSize: ${e}`);this.bitSize=e}toString(){return`uint${this.bitSize}`}equals(e){return e instanceof tq&&this.bitSize===e.bitSize}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw Error(`Cannot encode value as uint${this.bitSize}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw Error(`${e} is not a non-negative int or too big to fit in size uint${this.bitSize}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw Error(`${e} should be converted into a BigInt before it is encoded`);return eM(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw Error(`byte string must correspond to a uint${this.bitSize}`);return eN(e)}}class tz extends tj{constructor(e,t){if(super(),e%8!=0||e<8||e>512)throw Error(`unsupported ufixed type bitSize: ${e}`);if(t>160||t<1)throw Error(`unsupported ufixed type precision: ${t}`);this.bitSize=e,this.precision=t}toString(){return`ufixed${this.bitSize}x${this.precision}`}equals(e){return e instanceof tz&&this.bitSize===e.bitSize&&this.precision===e.precision}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw Error(`${e} is not a non-negative int or too big to fit in size ${this.toString()}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw Error(`${e} should be converted into a BigInt before it is encoded`);return eM(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw Error(`byte string must correspond to a ${this.toString()}`);return eN(e)}}class tK extends tj{toString(){return"address"}equals(e){return e instanceof tK}isDynamic(){return!1}byteLen(){return tO}encode(e){if("string"==typeof e)return(0,l.FS)(e).publicKey;if(e instanceof l.pV)return e.publicKey;if(e instanceof Uint8Array){if(32!==e.byteLength)throw Error("byte string must be 32 bytes long for an address");return e}throw Error(`Cannot encode value as ${this.toString()}: ${e}`)}decode(e){if(32!==e.byteLength)throw Error("byte string must be 32 bytes long for an address");return(0,l.jX)(e)}}class tG extends tj{toString(){return"bool"}equals(e){return e instanceof tG}isDynamic(){return!1}byteLen(){return tL}encode(e){if("boolean"!=typeof e)throw Error(`Cannot encode value as bool: ${e}`);return new Uint8Array(e?[128]:[0])}decode(e){if(1!==e.byteLength)throw Error("bool string must be 1 byte long");let t=e[0];if(128===t)return!0;if(0===t)return!1;throw Error("boolean could not be decoded from the byte string")}}class tH extends tj{toString(){return"byte"}equals(e){return e instanceof tH}isDynamic(){return!1}byteLen(){return t$}encode(e){if("number"!=typeof e&&"bigint"!=typeof e)throw Error(`Cannot encode value as byte: ${e}`);if("bigint"==typeof e&&(e=Number(e)),e<0||e>255)throw Error(`${e} cannot be encoded into a byte`);return new Uint8Array([e])}decode(e){if(1!==e.byteLength)throw Error("byte string must be 1 byte long");return e[0]}}class tW extends tj{toString(){return"string"}equals(e){return e instanceof tW}isDynamic(){return!0}byteLen(){throw Error(`${this.toString()} is a dynamic type`)}encode(e){let t;if("string"!=typeof e&&!(e instanceof Uint8Array))throw Error(`Cannot encode value as string: ${e}`);let r=eM((t="string"==typeof e?new TextEncoder().encode(e):e).length,tU),n=new Uint8Array(t.length+tU);return n.set(r),n.set(t,tU),n}decode(e){if(e.length<tU)throw Error(`byte string is too short to be decoded. Actual length is ${e.length}, but expected at least ${tU}`);let t=new DataView(e.buffer,e.byteOffset,tU).getUint16(0),r=e.slice(tU,e.length);if(t!==r.length)throw Error(`string length bytes do not match the actual length of string. Expected ${t}, got ${r.length}`);return new TextDecoder("utf-8").decode(r)}}class tJ extends tj{constructor(e,t){if(super(),t<0)throw Error(`static array must have a non negative length: ${t}`);this.childType=e,this.staticLength=t}toString(){return`${this.childType.toString()}[${this.staticLength}]`}equals(e){return e instanceof tJ&&this.staticLength===e.staticLength&&this.childType.equals(e.childType)}isDynamic(){return this.childType.isDynamic()}byteLen(){return this.childType.constructor===tG?Math.ceil(this.staticLength/8):this.staticLength*this.childType.byteLen()}encode(e){if(!Array.isArray(e)&&!(e instanceof Uint8Array))throw Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e.length!==this.staticLength)throw Error(`Value array does not match static array length. Expected ${this.staticLength}, got ${e.length}`);return this.toABITupleType().encode(e)}decode(e){return this.toABITupleType().decode(e)}toABITupleType(){return new tZ(Array(this.staticLength).fill(this.childType))}}class tX extends tj{constructor(e){super(),this.childType=e}toString(){return`${this.childType.toString()}[]`}equals(e){return e instanceof tX&&this.childType.equals(e.childType)}isDynamic(){return!0}byteLen(){throw Error(`${this.toString()} is a dynamic type`)}encode(e){if(!Array.isArray(e)&&!(e instanceof Uint8Array))throw Error(`Cannot encode value as ${this.toString()}: ${e}`);let t=this.toABITupleType(e.length),r=t.encode(e),n=eM(t.childTypes.length,tU);return(0,h.zI)(n,r)}decode(e){let t=new DataView(e.buffer,0,tU).getUint16(0);return this.toABITupleType(t).decode(e.slice(tU,e.length))}toABITupleType(e){return new tZ(Array(e).fill(this.childType))}}class tZ extends tj{constructor(e){if(super(),e.length>=tR)throw Error("tuple type child type number larger than maximum uint16 error");this.childTypes=e}toString(){let e=[];for(let t=0;t<this.childTypes.length;t++)e[t]=this.childTypes[t].toString();return`(${e.join(",")})`}equals(e){return e instanceof tZ&&this.childTypes.length===e.childTypes.length&&this.childTypes.every((t,r)=>t.equals(e.childTypes[r]))}isDynamic(){return this.childTypes.some(e=>e.isDynamic())}byteLen(){let e=0;for(let t=0;t<this.childTypes.length;t++)if(this.childTypes[t].constructor===tG){let r=tY(this.childTypes,t,1),n=r+1;t+=r,e+=Math.trunc((n+7)/8)}else e+=this.childTypes[t].byteLen();return e}encode(e){if(!Array.isArray(e)&&!(e instanceof Uint8Array))throw Error(`Cannot encode value as ${this.toString()}: ${e}`);let t=Array.from(e);if(e.length>tR)throw Error("length of tuple array should not exceed a uint16");let r=this.childTypes,n=[],a=[],i=new Map,o=0;for(;o<r.length;){let e=r[o];if(e.isDynamic())i.set(n.length,!0),n.push(new Uint8Array([0,0])),a.push(e.encode(t[o]));else{if(e.constructor===tG){let e=tY(r,o,-1),a=tY(r,o,1);if(e%8!=0)throw Error("expected before index should have number of bool mod 8 equal 0");a=Math.min(7,a);let i=function(e){let t=0;if(e.length>8)throw Error("value list passed in should be no greater than length 8");for(let r=0;r<e.length;r++){let n=e[r];if("boolean"!=typeof n)throw Error("non-boolean values cannot be compressed into a byte");n&&(t|=1<<7-r)}return t}(t.slice(o,o+a+1));n.push(eM(i,1)),o+=a}else{let r=e.encode(t[o]);n.push(r)}i.set(o,!1),a.push(new Uint8Array)}o+=1}let s=0;for(let e of n)s+=e.length;let l=0;for(let e=0;e<n.length;e++){if(i.get(e)){let t=s+l;if(t>tR)throw Error(`byte length of ${t} should not exceed a uint16`);n[e]=eM(t,tU)}l+=a[e].length}return(0,h.zI)(...n,...a)}
6decode(e){let t=this.childTypes,r=[],n=[],a=0,i=0,o=new DataView(e.buffer);for(;a<t.length;){let s=t[a];if(s.isDynamic()){if(e.slice(i,e.length).length<tU)throw Error("dynamic type in tuple is too short to be decoded");let t=o.getUint16(i);if(r.length>0&&(r[r.length-1].right=t,t<r[r.length-1].left))throw Error("dynamic index segment miscalculation: left is greater than right index");let a={left:t,right:-1};r.push(a),n.push(null),i+=tU}else if(s.constructor===tG){let t=tY(this.childTypes,a,-1),r=tY(this.childTypes,a,1);if(t%8!=0)throw Error("expected before bool number mod 8 === 0");r=Math.min(7,r);for(let t=0;t<=r;t++){let r=128>>t;(e[i]&r)>0?n.push(new Uint8Array([128])):n.push(new Uint8Array([0]))}a+=r,i+=1}else{let t=s.byteLen();n.push(e.slice(i,i+t)),i+=t}if(a!==t.length-1&&i>=e.length)throw Error("input byte not enough to decode");a+=1}if(r.length>0&&(r[r.length-1].right=e.length,i=e.length),i<e.length)throw Error("input byte not fully consumed");for(let e=0;e<r.length;e++){let t=r[e];if(t.left>t.right)throw Error("dynamic segment should display a [l, r] space with l <= r");if(e!==r.length-1&&t.right!==r[e+1].left)throw Error("dynamic segment should be consecutive")}let s=0;for(let a=0;a<t.length;a++)t[a].isDynamic()&&(n[a]=e.slice(r[s].left,r[s].right),s+=1);let l=[];for(let e=0;e<t.length;e++){let r=t[e].decode(n[e]);l.push(r)}return l}static parseTupleContent(e){if(0===e.length)return[];if(e.endsWith(",")||e.startsWith(","))throw Error("tuple string should not start with comma");if(e.includes(",,"))throw Error("tuple string should not have consecutive commas");let t=[],r=0,n="";for(let a of e)n+=a,"("===a?r+=1:")"===a?r-=1:","===a&&0===r&&(t.push(n.slice(0,n.length-1)),n="");if(0!==n.length&&t.push(n),0!==r)throw Error("tuple string has mismatched parentheses");return t}}function tY(e,t,r){let n=0;for(;;){let a=t+r*n;if(e[a].constructor===tG)if(a!==e.length-1&&1===r)n+=1;else if(a>0&&-1===r)n+=1;else break;else{n-=1;break}}return n}function tQ(e){return e===n.any||e===n.pay||e===n.keyreg||e===n.acfg||e===n.axfer||e===n.afrz||e===n.appl}function t0(e,t){return e===n.any||!!t.type&&t.type.toString()===e.toString()}function t1(e){return e===a.account||e===a.application||e===a.asset}!function(e){e.any="txn",e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl"}(n||(n={})),function(e){e.account="account",e.application="application",e.asset="asset"}(a||(a={}));class t5{constructor(e){if("string"!=typeof e.name||"object"!=typeof e.returns||!Array.isArray(e.args))throw Error("Invalid ABIMethod parameters");this.name=e.name,this.description=e.desc,this.args=e.args.map(({type:e,name:t,desc:r})=>tQ(e)||t1(e)?{type:e,name:t,description:r}:{type:tj.from(e),name:t,description:r}),this.returns={type:"void"===e.returns.type?e.returns.type:tj.from(e.returns.type),description:e.returns.desc},this.events=e.events,this.readonly=e.readonly}getSignature(){let e=this.args.map(e=>e.type.toString()).join(","),t=this.returns.type.toString();return`${this.name}(${e})${t}`}getSelector(){return new Uint8Array((0,s.uj)(this.getSignature()).slice(0,4))}txnCount(){let e=1;for(let t of this.args)"string"==typeof t.type&&tQ(t.type)&&(e+=1);return e}toJSON(){return{name:this.name,desc:this.description,args:this.args.map(({type:e,name:t,description:r})=>({type:e.toString(),name:t,desc:r})),returns:{type:this.returns.type.toString(),desc:this.returns.description},events:this.events,readonly:this.readonly}}static fromSignature(e){let{name:t,args:r,returns:n}=function(e){let t=e.indexOf("(");if(-1===t)throw Error(`Invalid method signature: ${e}`);let r=-1,n=0;for(let a=t;a<e.length;a++){let t=e[a];if("("===t)n+=1;else if(")"===t){if(0===n)break;if(0==(n-=1)){r=a;break}}}if(-1===r)throw Error(`Invalid method signature: ${e}`);return{name:e.slice(0,t),args:tZ.parseTupleContent(e.slice(t+1,r)),returns:e.slice(r+1)}}(e);return new t5({name:t,args:r.map(e=>({type:e})),returns:{type:n}})}}function t2(e,t){if(null===e||!Array.isArray(e)||!e.every(e=>e instanceof t5))throw Error("Methods list provided is null or not the correct type");let r=e.filter(e=>e.name===t);if(r.length>1)throw Error(`found ${r.length} methods with the same name ${r.map(e=>e.getSignature()).join(",")}`);
6if(0===r.length)throw Error(`found 0 methods with the name ${t}`);return r[0]}class t6{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods)||e.networks&&"object"!=typeof e.networks)throw Error("Invalid ABIContract parameters");this.name=e.name,this.description=e.desc,this.networks=e.networks?{...e.networks}:{},this.methods=e.methods.map(e=>new t5(e)),this.events=e.events}toJSON(){return{name:this.name,desc:this.description,networks:this.networks,methods:this.methods.map(e=>e.toJSON()),events:this.events}}getMethodByName(e){return t2(this.methods,e)}}class t3{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods))throw Error("Invalid ABIInterface parameters");this.name=e.name,this.description=e.desc,this.methods=e.methods.map(e=>new t5(e))}toJSON(){return{name:this.name,desc:this.description,methods:this.methods.map(e=>e.toJSON())}}getMethodByName(e){return t2(this.methods,e)}}let t4=new Uint8Array([21,31,124,117]);function t8(e,t,r){if(null!=r&&e===r)return 0;let n=+(null!=r);for(let r=0;r<t.length;r++)if(e===t[r])return r+n;return t.push(e),t.length-1+n}!function(e){e[e.BUILDING=0]="BUILDING",e[e.BUILT=1]="BUILT",e[e.SIGNED=2]="SIGNED",e[e.SUBMITTED=3]="SUBMITTED",e[e.COMMITTED=4]="COMMITTED"}(i||(i={}));class t9{constructor(){this.status=i.BUILDING,this.transactions=[],this.methodCalls=new Map,this.signedTxns=[],this.txIDs=[]}getStatus(){return this.status}count(){return this.transactions.length}clone(){let e=new t9;return e.transactions=this.transactions.map(({txn:e,signer:t})=>{let r=e.toEncodingData();return r.delete("grp"),{txn:th.ZX.fromEncodingData(r),signer:t}}),e.methodCalls=new Map(this.methodCalls),e}addTransaction(e){if(this.status!==i.BUILDING)throw Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length===t9.MAX_GROUP_SIZE)throw Error(`Adding an additional transaction exceeds the maximum atomic group size of ${t9.MAX_GROUP_SIZE}`);if(e.txn.group&&e.txn.group.some(e=>0!==e))throw Error("Cannot add a transaction with nonzero group ID");this.transactions.push(e)}addMethodCall({appID:e,method:t,methodArgs:r,sender:n,suggestedParams:o,onComplete:s,approvalProgram:l,clearProgram:c,numGlobalInts:u,numGlobalByteSlices:p,numLocalInts:d,numLocalByteSlices:f,extraPages:g,appAccounts:m,appForeignApps:y,appForeignAssets:w,boxes:v,note:b,lease:S,rekeyTo:x,signer:A}){if(this.status!==i.BUILDING)throw Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length+t.txnCount()>t9.MAX_GROUP_SIZE)throw Error(`Adding additional transactions exceeds the maximum atomic group size of ${t9.MAX_GROUP_SIZE}`);if(BigInt(e)===BigInt(0)){if(null==l||null==c||null==u||null==p||null==d||null==f)throw Error("One of the following required parameters for application creation is missing: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices")}else if(s===td.DB.UpdateApplicationOC){if(null==l||null==c)throw Error("One of the following required parameters for OnApplicationComplete.UpdateApplicationOC is missing: approvalProgram, clearProgram");if(null!=u||null!=p||null!=d||null!=f||null!=g)throw Error("One of the following application creation parameters were set on a non-creation call: numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages")}else if(null!=l||null!=c||null!=u||null!=p||null!=d||null!=f||null!=g)throw Error("One of the following application creation parameters were set on a non-creation call: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages");if(null==r&&(r=[]),r.length!==t.args.length)throw Error(`Incorrect number of method arguments. Expected ${t.args.length}, got ${r.length}`);let E=[],I=[],T=[],k=[],C=[],_=new Map;for(let e=0;e<r.length;e++){let n=t.args[e].type,a=r[e];if(tQ(n)){if(!tN(a)||!t0(n,a.txn))throw Error(`Expected ${n} TransactionWithSigner for argument at index ${e}`);if(a.txn.group&&a.txn.group.some(e=>0!==e))throw Error("Cannot add a transaction with nonzero group ID");T.push(a);continue}
6if(tN(a))throw Error(`Expected non-transaction value for argument at index ${e}`);if(t1(n)&&(_.set(k.length,E.length),k.push(n),C.push(a),n=new tq(8)),"string"==typeof n)throw Error(`Unknown ABI type: ${n}`);E.push(n),I.push(a)}let D=[],B=null==m?[]:m.map(e=>e.toString()),P=null==y?[]:y.map(h.Bw),M=null==w?[]:w.map(h.Bw);for(let t=0;t<k.length;t++){let r=k[t],i=C[t],o=0;switch(r){case a.account:{let e=new tK;o=t8(e.decode(e.encode(i)),B,n.toString());break}case a.application:{let t=new tq(64),r=t.decode(t.encode(i));if(r>Number.MAX_SAFE_INTEGER)throw Error(`Expected safe integer for application value, got ${r}`);o=t8(r,P,(0,h.Bw)(e));break}case a.asset:{let e=new tq(64),t=e.decode(e.encode(i));if(t>Number.MAX_SAFE_INTEGER)throw Error(`Expected safe integer for asset value, got ${t}`);o=t8(t,M);break}default:throw Error(`Unknown reference type: ${r}`)}D.push(o)}for(let e=0;e<D.length;e++)I[_.get(e)]=D[e];if(E.length>15){let e=E.slice(14),t=I.slice(14);E=E.slice(0,14),I=I.slice(0,14),E.push(new tZ(e)),I.push(t)}let N=[t.getSelector()];for(let e=0;e<E.length;e++)N.push(E[e].encode(I[e]));let R={txn:tx({sender:n,appIndex:e,appArgs:N,accounts:B,foreignApps:P,foreignAssets:M,boxes:v||[],onComplete:null==s?td.DB.NoOpOC:s,approvalProgram:l,clearProgram:c,numGlobalInts:u,numGlobalByteSlices:p,numLocalInts:d,numLocalByteSlices:f,extraPages:g,lease:S,note:b,rekeyTo:x,suggestedParams:o}),signer:A};this.transactions.push(...T,R),this.methodCalls.set(this.transactions.length-1,t)}buildGroup(){if(this.status===i.BUILDING){if(0===this.transactions.length)throw Error("Cannot build a group with 0 transactions");this.transactions.length>1&&eQ(this.transactions.map(e=>e.txn)),this.status=i.BUILT}return this.transactions}async gatherSignatures(){if(this.status>=i.SIGNED)return this.signedTxns;let e=this.buildGroup(),t=e.map(e=>e.txn),r=new Map;for(let t=0;t<e.length;t++){let{signer:n}=e[t];r.has(n)||r.set(n,[]),r.get(n).push(t)}let n=Array.from(r),a=await Promise.all(n.map(([e,r])=>e(t,r))),o=e.map(()=>null);for(let e=0;e<n.length;e++){let t=n[e][1],r=a[e];for(let e=0;e<t.length;e++)o[t[e]]=r[e]}if(!o.every(e=>null!=e))throw Error(`Missing signatures. Got ${o}`);let s=o.map((e,t)=>{try{return m.VQ(e,Y.Zj).txn.txID()}catch(e){throw Error(`Cannot decode signed transaction at index ${t}. ${e}`)}});return this.signedTxns=o,this.txIDs=s,this.status=i.SIGNED,o}async submit(e){if(this.status>i.SUBMITTED)throw Error("Transaction group cannot be resubmitted");let t=await this.gatherSignatures();return await e.sendRawTransaction(t).do(),this.status=i.SUBMITTED,this.txIDs}async simulate(e,t){if(this.status>i.SUBMITTED)throw Error("Simulated Transaction group has already been submitted to the network");let r=(await this.gatherSignatures()).map(e=>m.VQ(e,Y.Zj)),n=null==t?new f.SimulateRequest({txnGroups:[]}):t;n.txnGroups=[new f.SimulateRequestTransactionGroup({txns:r})];let a=await e.simulateTransactions(n).do(),o=[];for(let[e,t]of this.methodCalls){let r=this.txIDs[e],n=a.txnGroups[0].txnResults[e].txnResult,i={txID:r,rawReturnValue:new Uint8Array,method:t};o.push(t9.parseMethodResponse(t,i,n))}return{methodResults:o,simulateResponse:a}}async execute(e,t){if(this.status===i.COMMITTED)throw Error("Transaction group has already been executed successfully");let r=await this.submit(e);this.status=i.SUBMITTED;let n=this.transactions.findIndex((e,t)=>this.methodCalls.has(t)),a=await eP(e,r[-1===n?0:n],t);this.status=i.COMMITTED;let o=a.confirmedRound,s=[];for(let[t,i]of this.methodCalls){let o=r[t],l={txID:o,rawReturnValue:new Uint8Array,method:i};try{let r=t===n?a:await e.pendingTransactionInformation(o).do();l=t9.parseMethodResponse(i,l,r)}catch(e){l.decodeError=e}s.push(l)}return{confirmedRound:o,txIDs:r,methodResults:s}}static parseMethodResponse(e,t,r){try{if(t.txInfo=r,"void"!==e.returns.type){let n=r.logs||[];if(0===n.length)throw Error(`App call transaction did not log a return value ${(0,h.e4)(r)}`);let a=n[n.length-1];if(a.byteLength<4||!(0,h.af)(a.slice(0,4),t4))throw Error(`App call transaction did not log a ABI return value ${(0,h.e4)(r)}`);t.rawReturnValue=new Uint8Array(a.slice(4)),t.returnValue=e.returns.type.decode(t.rawReturnValue)}}catch(e){t.decodeError=e}return t}}t9.MAX_GROUP_SIZE=16;let t7=Uint8Array.from([77,88]),re="The transaction sender address and multisig preimage do not match.";function rt(e,t){return{txID:e.txID(),blob:e.signTxn(t)}}function rr(e,t){let r=h.zI(t7,e);return s._S(r,t)}function rn(e,t,r){let n=h.zI(t7,e),a="string"==typeof r?l.pV.fromString(r):r;return s.MX(n,t,a.publicKey)}let ra=Error(re),ri=Error(c),ro=o},79450:(e,t,r)=>{"use strict";function n(e){return"devnet-v1"===e||"sandnet-v1"===e||"dockernet-v1"===e}r.d(t,{C:()=>n})},79463:(e,t,r)=>{"use strict";r.d(t,{l:()=>f});var n=r(79175);r(64527);var a=r(76825),i=r(94393),o=r(51049),s=r(44241),l=r(41903),c=r(97569),u=r(32460),p=r(23151);let h={labelElement:"label"},d=(0,i.V)((e,t)=>{let{size:r}=t;return{label:{"--input-label-size":(0,a.ny)(r),"--input-asterisk-color":void 0}}}),f=(0,c.P9)((e,t)=>{let r=(0,o.Y)("InputLabel",h,e),{classNames:a,className:i,style:c,styles:f,unstyled:g,vars:m,labelElement:y,size:w,required:v,htmlFor:b,onMouseDown:S,children:x,__staticSelector:A,variant:E,mod:I,attributes:T,...k}=(0,o.Y)("InputLabel",h,r),C=(0,s.I)({name:["InputWrapper",A],props:r,classes:p.A,className:i,style:c,classNames:a,styles:f,unstyled:g,attributes:T,rootSelector:"label",vars:m,varsResolver:d}),_=(0,u.e)(),D=(null==_?void 0:_.getStyles)||C;return(0,n.jsxs)(l.a,{...D("label",(null==_?void 0:_.getStyles)?{className:i,style:c}:void 0),component:y,variant:E,size:w,ref:t,htmlFor:"label"===y?b:void 0,mod:[{required:v},I],onMouseDown:e=>{null==S||S(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...k,children:[x,v&&(0,n.jsx)("span",{...D("required"),"aria-hidden":!0,
6children:" *"})]})});f.classes=p.A,f.displayName="@mantine/core/InputLabel"},80452:(e,t,r)=>{"use strict";r.d(t,{i:()=>a});var n=r(64527);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{timeout:2e3},[t,r]=(0,n.useState)(null),[a,i]=(0,n.useState)(!1),[o,s]=(0,n.useState)(null);return{copy:t=>{"clipboard"in navigator?navigator.clipboard.writeText(t).then(()=>{window.clearTimeout(o),s(window.setTimeout(()=>i(!1),e.timeout)),i(!0)}).catch(e=>r(e)):r(Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{i(!1),r(null),window.clearTimeout(o)},error:t,copied:a}}},80591:(e,t,r)=>{"use strict";r.d(t,{d:()=>f});var n=r(79175),a=r(82248);r(64527);var i=r(76825),o=r(94393),s=r(51049),l=r(44241),c=r(41903),u=r(97569),p=r(32460),h=r(23151);let d=(0,o.V)((e,t)=>{let{size:r}=t;return{error:{"--input-error-size":void 0===r?void 0:"calc(".concat((0,i.ny)(r)," - ").concat((0,a.D)(2),")")}}}),f=(0,u.P9)((e,t)=>{let r=(0,s.Y)("InputError",null,e),{classNames:a,className:i,style:o,styles:u,unstyled:f,vars:g,size:m,attributes:y,__staticSelector:w,__inheritStyles:v=!0,variant:b,...S}=r,x=(0,l.I)({name:["InputWrapper",w],props:r,classes:h.A,className:i,style:o,classNames:a,styles:u,unstyled:f,attributes:y,rootSelector:"error",vars:g,varsResolver:d}),A=(0,p.e)(),E=v&&(null==A?void 0:A.getStyles)||x;return(0,n.jsx)(c.a,{component:"p",ref:t,variant:b,size:m,...E("error",(null==A?void 0:A.getStyles)?{className:i,style:o}:void 0),...S})});f.classes=h.A,f.displayName="@mantine/core/InputError"},82784:(e,t,r)=>{"use strict";r.d(t,{m:()=>p});var n=r(79175);r(64527);var a=r(51049),i=r(97569),o=r(8356),s=r(30076),l=r(22956);function c(e){let{data:t}=e;if("group"in t){let e=t.items.map(e=>(0,n.jsx)(c,{data:e},e.value));return(0,n.jsx)("optgroup",{label:t.group,children:e})}let{value:r,label:a,...i}=t;return(0,n.jsx)("option",{value:t.value,...i,children:t.label},t.value)}c.displayName="@mantine/core/NativeSelectOption";let u={rightSectionPointerEvents:"none"},p=(0,i.P9)((e,t)=>{let{data:r,children:i,size:p,error:h,rightSection:d,unstyled:f,...g}=(0,a.Y)("NativeSelect",u,e),m=(0,o.d)(r).map((e,t)=>(0,n.jsx)(c,{data:e},t));return(0,n.jsx)(l.O,{component:"select",ref:t,...g,__staticSelector:"NativeSelect",size:p,pointer:!0,error:h,unstyled:f,rightSection:d||(0,n.jsx)(s.l,{size:p,error:h,unstyled:f}),children:i||m})});p.classes=l.O.classes,p.displayName="@mantine/core/NativeSelect"},83123:(e,t,r)=>{"use strict";let n=r(52699),a=r(6462),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,a=t;if(("string"!=typeof a||""===a)&&(a="utf8"),!s.isEncoding(a))throw TypeError("Unknown encoding: "+a);let r=0|f(n,a),i=o(r),l=i.write(n,a);return l!==r&&(i=i.slice(0,l)),i}if(ArrayBuffer.isView(e)){var i=e;if($(i,Uint8Array)){let e=new Uint8Array(i);return h(e.buffer,e.byteOffset,e.byteLength)}return p(i)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let l=e.valueOf&&e.valueOf();if(null!=l&&l!==e)return s.from(l,t,r);let c=function(e){if(s.isBuffer(e)){let t=0|d(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?o(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(c)return c;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');
vendor: 22,529 bytes, line 6
6if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),o(e<0?0:0|d(e))}function p(e){let t=e.length<0?0:0|d(e.length),r=o(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),s.prototype),n}function d(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let a=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(e).length;default:if(a)return n?-1:N(e).length;t=(""+t).toLowerCase(),a=!0}}function g(e,t,r){let a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let a="";for(let n=t;n<r;++n)a+=L[e[n]];return a}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}(this,t,r);case"base64":var i,o,s;return i=this,o=t,s=r,0===o&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){let n=e.slice(t,r),a="";for(let e=0;e<n.length-1;e+=2)a+=String.fromCharCode(n[e]+256*n[e+1]);return a}(this,t,r);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function m(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,a){var i;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r*=1)!=i&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(a)return -1;else r=e.length-1;else if(r<0)if(!a)return -1;else r=0;if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,a);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(a)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return w(e,[t],r,n,a)}throw TypeError("val must be string, number or Buffer")}function w(e,t,r,n,a){let i,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,s/=2,l/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){let n=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===l)return n*o}else -1!==n&&(i-=i-n),n=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){let r=!0;for(let n=0;n<l;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return -1}function v(e,t,r){r=Math.min(e.length,r);let n=[],a=t;for(;a<r;){let t=e[a],i=null,o=t>239?4:t>223?3:t>191?2:1;if(a+o<=r){let r,n,s,l;switch(o){case 1:t<128&&(i=t);break;case 2:(192&(r=e[a+1]))==128&&(l=(31&t)<<6|63&r)>127&&(i=l);break;case 3:r=e[a+1],n=e[a+2],(192&r)==128&&(192&n)==128&&(l=(15&t)<<12|(63&r)<<6|63&n)>2047&&(l<55296||l>57343)&&(i=l);break;case 4:r=e[a+1],n=e[a+2],s=e[a+3],(192&r)==128&&(192&n)==128&&(192&s)==128&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s)>65535&&l<1114112&&(i=l)}}null===i?(i=65533,o=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),a+=o}var i=n;let o=i.length;if(o<=4096)return String.fromCharCode.apply(String,i);let s="",l=0;for(;l<o;)s+=String.fromCharCode.apply(String,i.slice(l,l+=4096));return s}function b(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function S(e,t,r,n,a,i){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function x(e,t,r,n,a){D(t,n,a,e,r,7);let i=Number(t&BigInt(0xffffffff));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function A(e,t,r,n,a){D(t,n,a,e,r,7);let i=Number(t&BigInt(0xffffffff));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function E(e,t,r,n,a,i){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function I(e,t,r,n,i){return t*=1,r>>>=0,i||E(e,t,r,4,34028234663852886e22,-34028234663852886e22),a.write(e,t,r,n,23,4),r+4}function T(e,t,r,n,i){return t*=1,r>>>=0,i||E(e,t,r,8,17976931348623157e292,-17976931348623157e292),a.write(e,t,r,n,52,8),r+8}t.hp=s,t.IS=50,s.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return(c(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},s.allocUnsafe=function(e){return u(e)},s.allocUnsafeSlow=function(e){return u(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if($(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let a=0,i=Math.min(r,n);a<i;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:+(n<r)},s.isEncoding=function(e){switch(String(e).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}},s.concat=function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;let n=s.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){let t=e[r];if($(t,Uint8Array))a+t.length>n.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(n,a)):Uint8Array.prototype.set.call(n,t,a);else if(s.isBuffer(t))t.copy(n,a);else throw TypeError('"list" argument must be an Array of Buffers');a+=t.length}return n},s.byteLength=f,s.prototype._isBuffer=!0,s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):g.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){let e="",r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,a){if($(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,a>>>=0,this===e)return 0;let i=a-n,o=r-t,l=Math.min(i,o),c=this.slice(n,a),u=e.slice(t,r);for(let e=0;e<l;++e)if(c[e]!==u[e]){i=c[e],o=u[e];break}return i<o?-1:+(o<i)},s.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},s.prototype.write=function(e,t,r,n){var a,i,o,s,l,c,u,p;if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let d=!1;for(;;)switch(n){case"hex":return function(e,t,r,n){let a;r=Number(r)||0;let i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;let o=t.length;for(n>o/2&&(n=o/2),a=0;a<n;++a){var s;let n=parseInt(t.substr(2*a,2),16);if((s=n)!=s)break;e[r+a]=n}return a}(this,e,t,r);case"utf8":case"utf-8":return a=t,i=r,O(N(e,this.length-a),this,a,i);case"ascii":case"latin1":case"binary":return o=t,s=r,O(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,o,s);case"base64":return l=t,c=r,O(R(e),this,l,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,p=r,O(function(e,t){let r,n,a=[];for(let i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,a.push(r%256),a.push(n);return a}(e,this.length-u),this,u,p);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);let n=this[e],a=1,i=0;for(;++i<t&&(a*=256);)n+=this[e+i]*a;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);let n=this[e+--t],a=1;for(;t>0&&(a*=256);)n+=this[e+--t]*a;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=U(function(e){B(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&P(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],a=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(a)<<BigInt(32))}),s.prototype.readBigUInt64BE=U(function(e){B(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&P(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],a=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(a)}),s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);let n=this[e],a=1,i=0;for(;++i<t&&(a*=256);)n+=this[e+i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);let n=t,a=1,i=this[e+--n];for(;n>0&&(a*=256);)i+=this[e+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=U(function(e){B(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&P(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])}),s.prototype.readBigInt64BE=U(function(e){B(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&P(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),a.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),a.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),a.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),a.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;S(this,e,t,r,n,0)}let a=1,i=0;for(this[t]=255&e;++i<r&&(a*=256);)this[t+i]=e/a&255;return t+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;S(this,e,t,r,n,0)}let a=r-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigUInt64LE=U(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=U(function(e,t=0){return A(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);S(this,e,t,r,n-1,-n)}let a=0,i=1,o=0;for(this[t]=255&e;++a<r&&(i*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/i|0)-o&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);S(this,e,t,r,n-1,-n)}let a=r-1,i=1,o=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/i|0)-o&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigInt64LE=U(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=U(function(e,t=0){return A(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeFloatLE=function(e,t,r){return I(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return I(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return T(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return T(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let a=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),a},s.prototype.fill=function(e,t,r,n){let a;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{let i=s.isBuffer(e)?e:s.from(e,n),o=i.length;if(0===o)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=i[a%o]}return this};let k={};function C(e,t,r){k[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function _(e){let t="",r=e.length,n=+("-"===e[0]);for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function D(e,t,r,n,a,i){if(e>r||e<t){let n,a="bigint"==typeof t?"n":"";throw n=i>3?0===t||t===BigInt(0)?`>= 0${a} and < 2${a} ** ${(i+1)*8}${a}`:`>= -(2${a} ** ${(i+1)*8-1}${a}) and < 2 ** ${(i+1)*8-1}${a}`:`>= ${t}${a} and <= ${r}${a}`,new k.ERR_OUT_OF_RANGE("value",n,e)}B(a,"offset"),(void 0===n[a]||void 0===n[a+i])&&P(a,n.length-(i+1))}function B(e,t){if("number"!=typeof e)throw new k.ERR_INVALID_ARG_TYPE(t,"number",e)}function P(e,t,r){if(Math.floor(e)!==e)throw B(e,r),new k.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new k.ERR_BUFFER_OUT_OF_BOUNDS;throw new k.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}C("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),C("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),C("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,a=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?a=_(String(r)):"bigint"==typeof r&&(a=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(a=_(a)),a+="n"),n+=` It must be ${t}. Received ${a}`},RangeError);let M=/[^+/0-9A-Za-z-_]/g;function N(e,t){let r;t=t||1/0;let n=e.length,a=null,i=[];for(let o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!a){if(r>56319||o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function R(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,r,n){let a;for(a=0;a<n&&!(a+r>=t.length)&&!(a>=e.length);++a)t[a+r]=e[a];return a}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let L=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let a=0;a<16;++a)t[n+a]=e[r]+e[a]}return t}();function U(e){return"undefined"==typeof BigInt?V:e}function V(){throw Error("BigInt not supported")}},84115:(e,t,r)=>{"use strict";function n(e){return e?parseInt(e,10):0}r.d(t,{R:()=>n})},85414:(e,t,r)=>{"use strict";r.d(t,{x:()=>a});
6class n extends Error{constructor(e,t){super(e),this.response=t,this.name="URLTokenBaseHTTPError",this.response=t}}class a{constructor(e,t,r,n={}){this.defaultHeaders=n;let a=new URL(t.endsWith("/")?t:`${t}/`);if(void 0!==r&&(a.port=r.toString()),0===a.protocol.length)throw Error("Invalid base server URL, protocol must be defined.");this.baseURL=a,this.tokenHeader=e}getURL(e,t){let r=new URL(e.startsWith("./")?e:e.startsWith("/")?`.${e}`:`./${e}`,this.baseURL);if(t)for(let[e,n]of Object.entries(t))r.searchParams.set(e,n.toString());return r.toString()}static formatFetchResponseHeaders(e){let t={};return e.forEach((e,r)=>{t[e]=r}),t}static async checkHttpError(e){let t,r;if(e.ok)return;try{t=new Uint8Array(await e.arrayBuffer());let n=JSON.parse(new TextDecoder().decode(t));n.message&&(r=n.message)}catch(e){}let i=`Network request error. Received status ${e.status} (${e.statusText})`;throw r&&(i+=`: ${r}`),new n(i,{body:t??new Uint8Array,status:e.status,headers:a.formatFetchResponseHeaders(e.headers)})}static async formatFetchResponse(e){return await this.checkHttpError(e),{body:new Uint8Array(await e.arrayBuffer()),status:e.status,headers:a.formatFetchResponseHeaders(e.headers)}}async get(e,t,r,n){let i={...this.tokenHeader,...this.defaultHeaders,...r??{}},o=await fetch(this.getURL(e,t),{headers:i,...n??{}});return a.formatFetchResponse(o)}async post(e,t,r,n,i){let o={...this.tokenHeader,...this.defaultHeaders,...n??{}},s=await fetch(this.getURL(e,r),{method:"POST",body:t,headers:o,...i??{}});return a.formatFetchResponse(s)}async delete(e,t,r,n,i){let o={...this.tokenHeader,...this.defaultHeaders,...n??{}},s=await fetch(this.getURL(e,r),{method:"DELETE",body:t,headers:o,...i??{}});return a.formatFetchResponse(s)}}},87131:(e,t,r)=>{"use strict";r.d(t,{$Y:()=>u,MX:()=>d,O6:()=>h,Sj:()=>g,Xx:()=>f,YT:()=>l,_S:()=>p,n5:()=>c,ne:()=>m,r9:()=>s,uj:()=>o});var n=r(65003),a=r(38293),i=r(46085);function o(e){return a.sha512_256.array(e)}function s(e){return n.sign.keyPair.fromSeed(e)}function l(){var e;return s((e=n.box.secretKeyLength,(0,i.lV)()&&console.warn("It looks like you're running in react-native. In order to perform common crypto operations you will need to polyfill common operations such as crypto.getRandomValues"),n.randomBytes(e)))}function c(e){return e===n.sign.signatureLength}function u(e){return n.sign.keyPair.fromSecretKey(e)}function p(e,t){return n.sign.detached(e,t)}function h(e,t){return n.verify(e,t)}function d(e,t,r){return n.sign.detached.verify(e,t,r)}let f=n.sign.publicKeyLength;n.sign.secretKeyLength;let g=32,m=32},88760:(e,t,r)=>{"use strict";r.d(t,{B:()=>u,VC:()=>l,bW:()=>s,ce:()=>c});var n=r(87131),a=r(68724),i=r(46085);let o=new Uint8Array([77,117,108,116,105,115,105,103,65,100,100,114]);function s(e){return e.map(e=>"string"==typeof e?a.pV.fromString(e).publicKey:e.publicKey)}function l({version:e,threshold:t,pks:r}){if(1!==e||e>255||e<0)throw Error("invalid multisig version");if(0===t||0===r.length||t>r.length||t>255)throw Error("bad multisig threshold");let i=a.QS-a.vR;if(i!==n.Xx)throw Error("nacl public key length is not 32 bytes");let s=new Uint8Array(o.length+2+i*r.length);s.set(o,0),s.set([e],o.length),s.set([t],o.length+1);for(let e=0;e<r.length;e++){if(r[e].length!==i)throw Error("bad multisig public key - wrong length");s.set(r[e],o.length+2+e*i)}return new a.pV(Uint8Array.from(n.uj(s)))}function c(e,t,r){let a,o=t.v,s=t.thr,c=t.subsig,u=c.map(e=>e.pk);if(t.subsig.length<s)return!1;try{a=l({version:o,threshold:s,pks:u}).publicKey}catch(e){return!1}if(!i.af(a,r))return!1;let p=0;for(let e of c)void 0!==e.s&&(p+=1);if(p<s)return!1;let h=0;for(let t of c)void 0!==t.s&&n.MX(e,t.s,t.pk)&&(h+=1);return!(h<s)}function u({version:e,threshold:t,addrs:r}){return function({version:e,threshold:t,addrs:r}){return l({version:e,threshold:t,pks:s(r)})}({version:e,threshold:t,addrs:r})}},88989:(e,t,r)=>{"use strict";r.d(t,{h:()=>m});var n=r(79175),a=r(82248);r(64527);var i=r(64711),o=r(76825),s=r(94393),l=r(94375),c=r(51049),u=r(44241),p=r(41903),h=r(35058),d={root:"m_9814e45f"};let f={zIndex:(0,i.I)("modal")},g=(0,s.V)((e,t)=>{let{gradient:r,color:n,backgroundOpacity:i,blur:s,radius:c,zIndex:u}=t;return{root:{"--overlay-bg":r||(void 0!==n||void 0!==i)&&(0,l.B)(n||"#000",null!=i?i:.6)||void 0,"--overlay-filter":s?"blur(".concat((0,a.D)(s),")"):void 0,"--overlay-radius":void 0===c?void 0:(0,o.nJ)(c),"--overlay-z-index":null==u?void 0:u.toString()}}}),m=(0,h.v)((e,t)=>{let r=(0,c.Y)("Overlay",f,e),{classNames:a,className:i,style:o,styles:s,unstyled:l,vars:h,fixed:m,center:y,children:w,radius:v,zIndex:b,gradient:S,blur:x,color:A,backgroundOpacity:E,mod:I,attributes:T,...k}=r,C=(0,u.I)({name:"Overlay",props:r,classes:d,className:i,style:o,classNames:a,styles:s,unstyled:l,attributes:T,vars:h,varsResolver:g});return(0,n.jsx)(p.a,{ref:t,...C("root"),mod:[{center:y,fixed:m},I],...k,children:w})});m.classes=d,m.displayName="@mantine/core/Overlay"},91323:(e,t,r)=>{"use strict";r.d(t,{f:()=>c});var n=r(79142),a=r(83123),i=r(28775),o=r(35066),s=r(70377);let l=({method:e,args:t})=>`${e.name}(${(t??[]).map(e=>"object"==typeof e?(0,o.vA)(e,(e,t)=>{let r=(0,o.Le)(e,t);return r instanceof Uint8Array?a.hp.from(r).toString("base64"):r}):e)})`;class c{constructor(e,t,r){this.payment=this._send(e=>e.addPayment,{preLog:(e,t)=>
6`Sending ${e.amount.microAlgo} \xb5ALGO from ${e.sender} to ${e.receiver} via transaction ${t.txID()}`}),this.assetCreate=async e=>{let t=await this._send(e=>e.addAssetCreate,{postLog:(e,t)=>`Created asset${e.assetName?` ${e.assetName}`:""}${e.unitName?` (${e.unitName})`:""} with ${e.total} units and ${e.decimals??0} decimals created by ${e.sender} with ID ${t.confirmation.assetIndex} via transaction ${t.txIds.at(-1)}`})(e);return{...t,assetId:BigInt(t.confirmation.assetIndex??0)}},this.assetConfig=this._send(e=>e.addAssetConfig,{preLog:(e,t)=>`Configuring asset with ID ${e.assetId} via transaction ${t.txID()}`}),this.assetFreeze=this._send(e=>e.addAssetFreeze,{preLog:(e,t)=>`Freezing asset with ID ${e.assetId} via transaction ${t.txID()}`}),this.assetDestroy=this._send(e=>e.addAssetDestroy,{preLog:(e,t)=>`Destroying asset with ID ${e.assetId} via transaction ${t.txID()}`}),this.assetTransfer=this._send(e=>e.addAssetTransfer,{preLog:(e,t)=>`Transferring ${e.amount} units of asset with ID ${e.assetId} from ${e.sender} to ${e.receiver} via transaction ${t.txID()}`}),this.assetOptIn=this._send(e=>e.addAssetOptIn,{preLog:(e,t)=>`Opting in ${e.sender} to asset with ID ${e.assetId} via transaction ${t.txID()}`}),this.assetOptOut=async e=>{if(e.ensureZeroBalance){let t=0n;try{t=(await this._assetManager.getAccountInformation(e.sender,e.assetId)).balance}catch{throw Error(`Account ${e.sender} is not opted-in to Asset ${e.assetId}; can't opt-out.`)}if(0n!==t)throw Error(`Account ${e.sender} does not have a zero balance for Asset ${e.assetId}; can't opt-out.`)}return e.creator=e.creator??(await this._assetManager.getById(e.assetId)).creator,await this._send(e=>e.addAssetOptOut,{preLog:(e,t)=>`Opting ${e.sender} out of asset with ID ${e.assetId} to creator ${e.creator} via transaction ${t.txID()}`})(e)},this.appCreate=this._sendAppCreateCall(e=>e.addAppCreate,{postLog:(e,t)=>`App created by ${e.sender} with ID ${t.confirmation.applicationIndex} via transaction ${t.txIds.at(-1)}`}),this.appUpdate=this._sendAppUpdateCall(e=>e.addAppUpdate,{postLog:(e,t)=>`App ${e.appId} updated ${e.args?` with ${e.args.map(e=>a.hp.from(e).toString("base64"))}`:""} by ${e.sender} via transaction ${t.txIds.at(-1)}`}),this.appDelete=this._sendAppCall(e=>e.addAppDelete,{postLog:(e,t)=>`App ${e.appId} deleted ${e.args?` with ${e.args.map(e=>a.hp.from(e).toString("base64"))}`:""} by ${e.sender} via transaction ${t.txIds.at(-1)}`}),this.appCall=this._sendAppCall(e=>e.addAppCall,{postLog:(e,t)=>`App ${e.appId} called ${e.args?` with ${e.args.map(e=>a.hp.from(e).toString("base64"))}`:""} by ${e.sender} via transaction ${t.txIds.at(-1)}`}),this.appCreateMethodCall=this._sendAppCreateCall(e=>e.addAppCreateMethodCall,{postLog:(e,t)=>`App created by ${e.sender} with ID ${t.confirmation.applicationIndex} via transaction ${t.txIds.at(-1)}`}),this.appUpdateMethodCall=this._sendAppUpdateCall(e=>e.addAppUpdateMethodCall,{postLog:(e,t)=>`App ${e.appId} updated with ${l(e)} by ${e.sender} via transaction ${t.txIds.at(-1)}`}),this.appDeleteMethodCall=this._sendAppCall(e=>e.addAppDeleteMethodCall,{postLog:(e,t)=>`App ${e.appId} deleted with ${l(e)} by ${e.sender} via transaction ${t.txIds.at(-1)}`}),this.appCallMethodCall=this._sendAppCall(e=>e.addAppCallMethodCall,{postLog:(e,t)=>`App ${e.appId} called with ${l(e)} by ${e.sender} via transaction ${t.txIds.at(-1)}`}),this.onlineKeyRegistration=this._send(e=>e.addOnlineKeyRegistration,{preLog:(e,t)=>`Registering online key for ${e.sender} via transaction ${t.txID()}`}),this.offlineKeyRegistration=this._send(e=>e.addOfflineKeyRegistration,{preLog:(e,t)=>`Registering offline key for ${e.sender} via transaction ${t.txID()}`}),this._newGroup=e,this._assetManager=t,this._appManager=r}newGroup(){return this._newGroup()}_send(e,t){return async r=>{let n=this._newGroup();if(e(n).apply(n,[r]),t?.preLog){let e=(await n.build()).transactions.at(-1).txn;i.T.getLogger(r?.suppressLog).debug(t.preLog(r,e))}let a=await n.send(r),o={transaction:a.transactions.at(-1),confirmation:a.confirmations.at(-1),txId:a.txIds.at(-1),...a};return t?.postLog&&i.T.getLogger(r?.suppressLog).debug(t.postLog(r,o)),o}}_sendAppCall(e,t){return async r=>{let n=await this._send(e,t)(r);return{...n,return:s.r.getABIReturn(n.confirmation,"method"in r?r.method:void 0)}}}_sendAppUpdateCall(e,t){return async r=>{let n=await this._sendAppCall(e,t)(r),a="string"==typeof r.approvalProgram?this._appManager.getCompilationResult(r.approvalProgram):void 0,i="string"==typeof r.clearStateProgram?this._appManager.getCompilationResult(r.clearStateProgram):void 0;return{...n,compiledApproval:a,compiledClear:i}}}_sendAppCreateCall(e,t){return async r=>{let a=await this._sendAppUpdateCall(e,t)(r);
6return{...a,appId:BigInt(a.confirmation.applicationIndex),appAddress:n.Ay$.getApplicationAddress(a.confirmation.applicationIndex)}}}}},92076:(e,t,r)=>{"use strict";e.exports=r(18198)},92158:(e,t,r)=>{"use strict";r.d(t,{$u:()=>w,EW:()=>y,F2:()=>m,Go:()=>h,O_:()=>d,Pg:()=>l,RS:()=>a,YE:()=>g,cX:()=>p,gR:()=>i,nr:()=>c,tZ:()=>f});var n=r(65047);function a(e){let t=e.activeElement;for(;(null==(r=t)||null==(r=r.shadowRoot)?void 0:r.activeElement)!=null;){var r;t=t.shadowRoot.activeElement}return t}function i(e,t){if(!e||!t)return!1;let r=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&(0,n.Ng)(r)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function o(){let e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function s(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:r}=e;return t+"/"+r}).join(" "):navigator.userAgent}function l(e){return!s().includes("jsdom/")&&(!u()&&0===e.width&&0===e.height||u()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function c(){return/apple/i.test(navigator.vendor)}function u(){let e=/android/i;return e.test(o())||e.test(s())}function p(){return o().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function h(e,t){let r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function d(e){return"nativeEvent"in e}function f(e){return e.matches("html,body")}function g(e){return(null==e?void 0:e.ownerDocument)||document}function m(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function y(e){return"composedPath"in e?e.composedPath()[0]:e.target}function w(e){return(0,n.sb)(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}},93266:(e,t,r)=>{"use strict";r.d(t,{I:()=>n});class n{constructor(e){this.payment=this._transaction(e=>e.addPayment),this.assetCreate=this._transaction(e=>e.addAssetCreate),this.assetConfig=this._transaction(e=>e.addAssetConfig),this.assetFreeze=this._transaction(e=>e.addAssetFreeze),this.assetDestroy=this._transaction(e=>e.addAssetDestroy),this.assetTransfer=this._transaction(e=>e.addAssetTransfer),this.assetOptIn=this._transaction(e=>e.addAssetOptIn),this.assetOptOut=this._transaction(e=>e.addAssetOptOut),this.appCreate=this._transaction(e=>e.addAppCreate),this.appUpdate=this._transaction(e=>e.addAppUpdate),this.appDelete=this._transaction(e=>e.addAppDelete),this.appCall=this._transaction(e=>e.addAppCall),this.appCreateMethodCall=this._transactions(e=>e.addAppCreateMethodCall),this.appUpdateMethodCall=this._transactions(e=>e.addAppUpdateMethodCall),this.appDeleteMethodCall=this._transactions(e=>e.addAppDeleteMethodCall),this.appCallMethodCall=this._transactions(e=>e.addAppCallMethodCall),this.onlineKeyRegistration=this._transaction(e=>e.addOnlineKeyRegistration),this.offlineKeyRegistration=this._transaction(e=>e.addOfflineKeyRegistration),this._newGroup=e}_transaction(e){return async t=>{let r=this._newGroup();return(await e(r).apply(r,[t]).buildTransactions()).transactions.at(-1)}}_transactions(e){return async t=>{let r=this._newGroup();return await e(r).apply(r,[t]).buildTransactions()}}}},93268:(e,t,r)=>{"use strict";r.d(t,{c:()=>f});var n=r(79175);r(64527);var a=r(76825),i=r(94393),o=r(90461),s=r(51049),l=r(44241),c=r(41903),u=r(97569),p={root:"m_3eebeb36",label:"m_9e365f20"};let h={orientation:"horizontal"},d=(0,i.V)((e,t)=>{let{color:r,variant:n,size:i}=t;return{root:{"--divider-color":r?(0,o.r)(r,e):void 0,"--divider-border-style":n,"--divider-size":(0,a.YC)(i,"divider-size")}}}),f=(0,u.P9)((e,t)=>{let r=(0,s.Y)("Divider",h,e),{classNames:a,className:i,style:o,styles:u,unstyled:f,vars:g,color:m,orientation:y,label:w,labelPosition:v,mod:b,attributes:S,...x}=r,A=(0,l.I)({name:"Divider",classes:p,props:r,className:i,style:o,classNames:a,styles:u,unstyled:f,attributes:S,vars:g,varsResolver:d});return(0,n.jsx)(c.a,{ref:t,mod:[{orientation:y,"with-label":!!w},b],...A("root"),...x,role:"separator",children:w&&(0,n.jsx)(c.a,{component:"span",mod:{position:v},...A("label"),children:w})})});f.classes=p,f.displayName="@mantine/core/Divider"},93593:(e,t,r)=>{"use strict";r.d(t,{Gx:()=>d,Hl:()=>f,I8:()=>v,Ik:()=>y,Q5:()=>g,ll:()=>w});var n=r(87131),a=r(68724),i=r(9517),o=r(12929),s=r(88760),l=r(46085),c=r(28176);let u=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;function p(e){if(!e||0===e.length)throw Error("empty program");if(e.every(e=>10===e||32<=e&&e<=126)){let t=new TextDecoder().decode(e);if((0,a.$m)(t))throw Error("requesting program bytes, get Algorand address");if(u.test(t))throw Error("program should not be b64 encoded");throw Error("program bytes are all ASCII printable characters, not looking like Teal byte code")}}let h=new TextEncoder().encode("Program");class d{constructor(e,t){if(t&&(!Array.isArray(t)||!t.every(e=>e.constructor===Uint8Array)))throw TypeError("Invalid arguments");let r=[];null!=t&&(r=t.map(e=>new Uint8Array(e))),p(e),this.logic=e,this.args=r,this.sig=void 0,this.msig=void 0}getEncodingSchema(){return d.encodingSchema}toEncodingData(){let e=new Map([["l",this.logic],["arg",this.args],["sig",this.sig]]);return this.msig&&e.set("msig",(0,c.Zv)(this.msig)),e}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded logic sig: ${e}`);let t=new d(e.get("l"),e.get("arg"));return t.sig=e.get("sig"),e.get("msig")&&(t.msig=(0,c.oO)(e.get("msig"))),t}verify(e){if(this.sig&&this.msig)return!1;try{p(this.logic)}catch(e){return!1}let t=l.zI(h,this.logic);if(!this.sig&&!this.msig){let r=n.uj(t);return l.af(r,e)}return this.sig?n.MX(t,this.sig,e):(0,s.ce)(t,this.msig,e)}address(){let e=l.zI(h,this.logic),t=n.uj(e);return new a.pV(Uint8Array.from(t))}sign(e,t){if(null==t)this.sig=this.signProgram(e);else{let r=(0,s.bW)(t.addrs).map(e=>({pk:e}));this.msig={v:t.version,thr:t.threshold,subsig:r};let[n,a]=this.singleSignMultisig(e,this.msig);
6this.msig.subsig[a].s=n}}appendToMultisig(e){if(void 0===this.msig)throw Error("no multisig present");let[t,r]=this.singleSignMultisig(e,this.msig);this.msig.subsig[r].s=t}signProgram(e){let t=l.zI(h,this.logic);return n._S(t,e)}singleSignMultisig(e,t){let r=-1,a=n.$Y(e).publicKey;for(let e=0;e<t.subsig.length;e++){let{pk:n}=t.subsig[e];if(l.af(n,a)){r=e;break}}if(-1===r)throw Error("invalid secret key");return[this.signProgram(e),r]}toByte(){return i.BS(this)}static fromByte(e){return i.VQ(e,d)}}d.encodingSchema=new o.pZ((0,o.co)([{key:"l",valueSchema:new o.HM},{key:"arg",valueSchema:new o.vf(new o.HM)},{key:"sig",valueSchema:new o.KN(new o.lb(64))},{key:"msig",valueSchema:new o.KN(c.y9)}]));class f{constructor(e,t){this.lsig=new d(e,t),this.sigkey=void 0}getEncodingSchema(){return f.encodingSchema}toEncodingData(){return new Map([["lsig",this.lsig.toEncodingData()],["sigkey",this.sigkey]])}static fromEncodingData(e){if(!(e instanceof Map))throw Error(`Invalid decoded logic sig account: ${e}`);let t=d.fromEncodingData(e.get("lsig")),r=new f(t.logic,t.args);return r.lsig=t,r.sigkey=e.get("sigkey"),r}toByte(){return i.BS(this)}static fromByte(e){return i.VQ(e,f)}isDelegated(){return!!(this.lsig.sig||this.lsig.msig)}verify(){let e=this.address();return this.lsig.verify(e.publicKey)}address(){if(this.lsig.sig&&this.lsig.msig)throw Error("LogicSig has too many signatures. At most one of sig or msig may be present");if(this.lsig.sig){if(!this.sigkey)throw Error("Signing key for delegated account is missing");return new a.pV(this.sigkey)}if(this.lsig.msig){let e={version:this.lsig.msig.v,threshold:this.lsig.msig.thr,pks:this.lsig.msig.subsig.map(e=>e.pk)};return(0,s.VC)(e)}return this.lsig.address()}signMultisig(e,t){this.lsig.sign(t,e)}appendToMultisig(e){this.lsig.appendToMultisig(e)}sign(e){this.lsig.sign(e),this.sigkey=n.$Y(e).publicKey}}function g(e){return i.VQ(e,d)}f.encodingSchema=new o.pZ((0,o.co)([{key:"lsig",valueSchema:d.encodingSchema},{key:"sigkey",valueSchema:new o.KN(new o.lb(32))}]));let m=new TextEncoder().encode("ProgData");function y(e,t,r){let i="string"==typeof r?a.pV.fromString(r):r,o=l.zI(i.publicKey,t),s=l.zI(m,o);return n._S(s,e)}function w(e,t,r,i){let o="string"==typeof t?a.pV.fromString(t):t,s=l.zI(o.publicKey,e),c=l.zI(m,s);return n.MX(c,r,i)}function v(e,t,r){return y(e,t,new d(r).address())}},93647:(e,t,r)=>{"use strict";r.d(t,{IG:()=>u,hr:()=>S,oQ:()=>c,dw:()=>s,nJ:()=>v,X6:()=>b,CE:()=>h,dE:()=>p,Hg:()=>l,ch:()=>o,uQ:()=>g,HF:()=>z,ex:()=>F,AZ:()=>y,Ux:()=>w,Sy:()=>N,hM:()=>T});var n,a,i=r(79142),o=(e=>(e[e.TOKEN_BASED=2]="TOKEN_BASED",e))(o||{}),s=(e=>(e[e.UNLIMITED=0]="UNLIMITED",e[e.DAY=86400]="DAY",e[e.MONTH=2592e3]="MONTH",e[e.QUARTER=7776e3]="QUARTER",e[e.SEMI_ANNUAL=15552e3]="SEMI_ANNUAL",e[e.ANNUAL=31536e3]="ANNUAL",e))(s||{}),l=(e=>(e[e.RAW=0]="RAW",e[e.PRETTY=1]="PRETTY",e))(l||{}),c=(e=>(e[e.PERCENTAGE=0]="PERCENTAGE",e[e.FIXED=1]="FIXED",e))(c||{}),u=(e=>(e.LOCALNET="localnet",e.TESTNET="testnet",e.MAINNET="mainnet",e))(u||{}),p=(e=>(e[e.CREATOR=0]="CREATOR",e[e.USER=1]="USER",e))(p||{}),h=(e=>(e[e.ENABLED=0]="ENABLED",e[e.DISABLED=1]="DISABLED",e))(h||{}),d=r(99267),f=r(83123).hp;let g=e=>{if(e===u.MAINNET)return 0x4af1c6cc;if(e===u.TESTNET)return 0x1cf6905d;{let e=Number(d.env.SUBTOPIA_REGISTRY_ID)||Number(d.env.NEXT_PUBLIC_SUBTOPIA_REGISTRY_ID);if(isNaN(e))throw Error("SUBTOPIA_REGISTRY_ID environment variable is not set or is not a number");return e}},m={index:0n,creator:i.pVw.fromString("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ"),name:"ALGO",decimals:6,unitName:"ALGO"},y="token_product_approval",w="token_product_clear",v="locker_approval",b="locker_clear",S=60,x=new Uint8Array(f.from("b_d"));var A=r(74751),E=r(83123).hp;async function I({client:e,account:t,assetID:r,timeout:n=S}){let a=new i.aXL;return a.addTransaction({txn:(0,i.q7Y)({sender:t.addr,receiver:t.addr,amount:0,suggestedParams:await C(e,1),assetIndex:r}),signer:t.signer}),await R(a.execute.bind(a),n,e,10)}function T(e,t,r=l.RAW,n){let a=BigInt(10**t);return r===l.RAW?e*a:e/a}async function k(e,t){if(0n===t)return m;let r=(await e.getAssetByID(t).do()).params;return{creator:i.pVw.fromString(r.creator),index:t,name:r.name??"N/A",decimals:r.decimals,unitName:r.unitName??"N/A"}}async function C(e,t){let r=await e.getTransactionParams().do();return r.flatFee=!0,r.fee=A.SK.microAlgos*BigInt(t),r}async function _(e,t){return Math.floor((e.length+t.length)/2048)}function D(e,t,r,n=null){if("create"!==r&&"destroy"!==r)throw Error("Action must be 'create' or 'destroy'");let a=2500+400*(("number"==typeof e?e:e.length)+t);if(null!==n)if(n instanceof i.Bxj)a+=800;else throw Error(`Unknown abi type: ${n}`);return"create"===r?a:-a}function B(e){let t=new i.PX5(64);return D(new Uint8Array([...E.from("cl-"),...e.publicKey]),t.byteLen(),"create")}function P(e,t,r){return 1e5*(1+e)+28500*t+5e4*r}async function M(e,t=0,r=0,n=0){return P(t||await _(e.approval,e.clear),r??e.globalNumUint,
6n??e.globalNumByteSlice)}!function(e){e[e.Fail=0]="Fail",e[e.UpdateApp=1]="UpdateApp",e[e.ReplaceApp=2]="ReplaceApp",e[e.AppendApp=3]="AppendApp"}(n||(n={})),function(e){e[e.Fail=0]="Fail",e[e.ReplaceApp=1]="ReplaceApp",e[e.AppendApp=2]="AppendApp"}(a||(a={}));function N(e){if(e===p.CREATOR)return E.from("cl-");if(e===p.USER)return E.from("ul-");throw Error(`Unknown locker type: ${e}`)}async function R(e,t,...r){return new Promise((n,a)=>{let i=setTimeout(()=>{a(Error(`Timeout error: exceeded ${t} seconds`))},1e3*t),o=e(...r);if(!o||"function"!=typeof o.then)return void a(Error("Function did not return a promise"));o.then(e=>{clearTimeout(i),n(e)}).catch(e=>{clearTimeout(i),a(e)})})}function O(e){let t={gs_1:"product_name",gs_2:"subscription_name",gs_3:"manager",gs_4:"price",gs_5:"total_subscribers",gs_6:"max_subscribers",gs_7:"coin_id",gs_8:"product_type",gs_9:"lifecycle",gs_10:"created_at",gs_11:"oracle_id",gs_12:"unit_name",gs_13:"image_url",gs_14:"duration",gs_15:"extra_slot_1",gs_16:"extra_slot_2"},r={};for(let n in e)t[n]&&("manager"===t[n]?r[t[n]]=new i.pVw(e[n].valueRaw):"duration"===t[n]||"product_type"===t[n]||"lifecycle"===t[n]?r[t[n]]=Number(e[n].value):r[t[n]]=e[n].value);return r}function $(e){return new Uint8Array(E.from(e,"utf-8"))}var L=r(83123).hp,U=Object.defineProperty,V=(e,t,r)=>((e,t,r)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class F{constructor({algodClient:e,creator:t,appID:r,appAddress:n,appSpec:a,oracleID:i,version:o,timeout:s}){V(this,"algodClient"),V(this,"creator"),V(this,"version"),V(this,"appID"),V(this,"appAddress"),V(this,"appSpec"),V(this,"oracleID"),V(this,"timeout"),this.algodClient=e,this.creator=t,this.appAddress=n,this.appID=r,this.appSpec=a,this.oracleID=i,this.version=o,this.timeout=s}static async init(e){var t,r,n,a;let{algodClient:o,creator:s,chainType:l,timeout:c=S,registryID:u}=e,p=u||g(l),h=(0,i.HjT)(p),d=await (0,A.sO)(p,o),f=BigInt((await (0,A.qV)(p,o)).oracle_id.value),m=new i.aXL;m.addMethodCall({appID:p,method:new i.aEE({name:"get_version",args:[],returns:{type:"string"}}),sender:s.addr,signer:(0,i.WZG)(),suggestedParams:await C(o,1)});let y=m.buildGroup().map(e=>i.Ay$.encodeUnsignedSimulateTransaction(e.txn)),w=new i.RdO.SimulateRequest({allowEmptySignatures:!0,allowMoreLogging:!0,txnGroups:[new i.RdO.SimulateRequestTransactionGroup({txns:y.map(e=>(0,i.J_k)(e))})]}),v=(await m.simulate(o,w)).methodResults[0].returnValue;return new F({algodClient:o,creator:s,appID:BigInt(p),appAddress:h,appSpec:{approval:d.params.approvalProgram,clear:d.params.clearStateProgram,globalNumUint:(null==(t=d.params.globalStateSchema)?void 0:t.numUint)||0,globalNumByteSlice:(null==(r=d.params.globalStateSchema)?void 0:r.numByteSlice)||0,localNumUint:(null==(n=d.params.localStateSchema)?void 0:n.numUint)||0,localNumByteSlice:(null==(a=d.params.localStateSchema)?void 0:a.numByteSlice)||0},oracleID:f,version:v,timeout:c})}async getProductVersion(e){let t=await this.algodClient.getApplicationBoxByName(this.appID,new Uint8Array([...L.from(e===o.TOKEN_BASED?"token_product_version":"product_version","utf-8")])).do();return new TextDecoder().decode(t.value)}async getLockerVersion(){let e=await this.algodClient.getApplicationBoxByName(this.appID,$("locker_version")).do();return new TextDecoder().decode(e.value)}async getProductCreationFee(e=0n){return(0,i.oUo)(.1)+(0,i.oUo)(.1)+await M(this.appSpec,1,9,7)+(e>0n?(0,i.oUo)(.1):0)}async getProductCreationPlatformFee(){let e=new i.aXL;e.addMethodCall({appID:this.oracleID,method:new i.aEE({name:"compute_platform_fee",args:[{type:"uint64",name:"whole_usd",desc:"Amount of USD in whole numbers (CENTS)"}],returns:{type:"uint64"}}),methodArgs:[500],sender:this.creator.addr,signer:(0,i.WZG)(),suggestedParams:await C(this.algodClient,1)});let t=e.buildGroup().map(e=>i.Ay$.encodeUnsignedSimulateTransaction(e.txn)),r=new i.RdO.SimulateRequest({allowEmptySignatures:!0,allowMoreLogging:!0,txnGroups:[new i.RdO.SimulateRequestTransactionGroup({txns:t.map(e=>(0,i.J_k)(e))})]});return BigInt((await e.simulate(this.algodClient,r)).methodResults[0].returnValue)}getLockerCreationFee(e){return(0,i.oUo)(.1)+P(0,1,1)+B(e)}getLockerTransferFee(e,t,r){let n=(0,i.oUo)(.1);return n=r>0n?n+(0,i.oUo)(.1):n,t?n+this.getLockerCreationFee(e):n}async createLocker(e){let{creator:t,lockerType:r}=e,n=this.getLockerCreationFee(t.addr),a=new i.aXL;a.addMethodCall({appID:this.appID,method:new i.aEE({name:"create_locker",args:[{name:"manager",type:"address"},{name:"locker_type",type:"uint64"},{name:"fee_txn",type:"pay"}],returns:{type:"uint64"}}),methodArgs:[t.addr,r.valueOf(),{txn:(0,i.f2A)({sender:t.addr,receiver:this.appAddress,amount:n,suggestedParams:await C(this.algodClient,0)}),signer:t.signer}],boxes:[{appIndex:this.appID,name:new Uint8Array([...N(r),...t.addr.publicKey])},{appIndex:this.appID,name:$(v)},{appIndex:this.appID,name:$(b)}],sender:t.addr,signer:t.signer,suggestedParams:await C(this.algodClient,4)});let o=await R(a.execute.bind(a),this.timeout,this.algodClient,10);return{txID:o.txIDs.pop(),lockerID:BigInt(o.methodResults[0].returnValue)}}static async getLocker({registryID:e,algodClient:t,ownerAddress:r,lockerType:n}){let a=await t.getApplicationBoxByName(e,new Uint8Array([...N(n),...r.publicKey])).do().catch(()=>null);return a?BigInt((0,i.Xbp)(a.value,"bigint")):null}async transferProduct(e){let{productID:t,newOwnerAddress:r}=e,n=await F.getLocker({registryID:this.appID,algodClient:this.algodClient,ownerAddress:this.creator.addr,lockerType:p.CREATOR}),a=await F.getLocker({registryID:this.appID,algodClient:this.algodClient,ownerAddress:r,lockerType:p.CREATOR});if(!n)throw Error("Locker not found");let o=[{appIndex:this.appID,name:new Uint8Array([...N(p.CREATOR),...this.creator.addr.publicKey])},{appIndex:this.appID,name:new Uint8Array([...N(p.CREATOR),...r.publicKey])}];a||o.push.apply(o,[{appIndex:this.appID,name:$(v)},{appIndex:this.appID,name:$(b)}]);let s=BigInt(O(await (0,A.qV)(t,this.algodClient)).coin_id),l=(a?10:11)+3*(s>0n),c=this.getLockerTransferFee(r,!a,s),u=new i.aXL;return u.addMethodCall({appID:this.appID,method:new i.aEE({name:"transfer_product",args:[{type:"application",name:"product",desc:"The product."},{type:"application",name:"old_locker",desc:"The old locker."},{type:"address",name:"new_manager",desc:"The new manager address."},{type:"pay",name:"transfer_fee_txn",desc:"The transfer fee transaction."}],returns:{type:"void"}}),methodArgs:[t,n,r,{txn:(0,i.f2A)({sender:this.creator.addr,receiver:this.appAddress,amount:c,suggestedParams:await C(this.algodClient,0)}),signer:this.creator.signer}],boxes:o,sender:this.creator.addr,signer:this.creator.signer,appForeignAssets:s?[s]:void 0,appForeignApps:a?[a]:void 0,suggestedParams:await C(this.algodClient,l)}),{txID:(await R(u.execute.bind(u),this.timeout,this.algodClient,10)).txIDs.pop()}}async createProduct(e){let{productName:t,productType:r,subscriptionName:n,price:a,lockerID:o,maxSubs:c=0n,coinID:u=0n,duration:p=s.UNLIMITED,unitName:h="STP",imageUrl:d="ipfs://bafybeicddz7kbuxajj6bob5bjqtweq6wchkdkiq4vvhwrwrne7iz4f25xi",parseWholeUnits:f=!1}=e,g=await k(this.algodClient,u);if(!this.oracleID)throw Error("'RegistryClient' is not initialized");let m=(await (0,A.qV)(this.oracleID,this.algodClient)).admin,v=(0,i.jX9)(m.valueRaw),b=await this.getProductCreationFee(u),S=await this.getProductCreationPlatformFee(),x=new i.aXL;x.addMethodCall({appID:this.appID,method:new i.aEE({name:"create_product",args:[{type:"string",name:"product_name",desc:"The name of the product (subtopia, netflix, etc)"},{type:"uint64",name:"product_type",desc:"The type of the Product."},{type:"string",name:"subscription_name",desc:"The subscription name of the product (pro, etc)"},{type:"uint64",name:"price",desc:"The price of the Product."},{type:"uint64",name:"max_subs",desc:"The maximum number of subscriptions."},{type:"asset",name:"coin",desc:"The coin of the Product."},{type:"string",name:"unit_name",desc:"The unit name of the Product."},{type:"string",name:"image_url",desc:"The image URL of the Product."},{type:"uint64",name:"duration"},{type:"address",name:"manager",desc:"The manager address."},{type:"application",name:"locker",desc:"The locker."},{type:"application",name:"oracle",desc:"The oracle."},{type:"pay",name:"fee_txn",desc:"The fee transaction."},{type:"pay",name:"platform_fee_txn",desc:"The platform fee transaction."}],returns:{type:"uint64"}}),methodArgs:[t,r,n,f?T(a,g.decimals,l.RAW):a,c,g.index,h,d,p,this.creator.addr,o,this.oracleID,{txn:(0,i.f2A)({sender:this.creator.addr,receiver:this.appAddress,amount:b,suggestedParams:await C(this.algodClient,0)}),signer:this.creator.signer},{txn:(0,i.f2A)({sender:this.creator.addr,receiver:v,amount:S,suggestedParams:await C(this.algodClient,0)}),signer:this.creator.signer}],boxes:[{appIndex:this.appID,name:new Uint8Array([...L.from("cl-","utf-8"),...this.creator.addr.publicKey])},{appIndex:this.appID,name:$(y)},{appIndex:this.appID,name:$(y)},{appIndex:this.appID,name:$(y)},{appIndex:this.appID,name:$(w)}],sender:this.creator.addr,signer:this.creator.signer,suggestedParams:await C(this.algodClient,u>0n?11:8)});let E=await R(x.execute.bind(x),this.timeout,this.algodClient,10);return{txID:E.txIDs.pop(),productID:BigInt(E.methodResults[0].returnValue)}}async deleteProduct(e){let{productID:t,lockerID:r}=e,n=new i.aXL;return n.addMethodCall({appID:this.appID,method:new i.aEE({name:"delete_product",args:[{type:"application",name:"product",desc:"The product."},{type:"application",name:"locker",desc:"The locker."}],returns:{type:"void"}}),methodArgs:[t,r],boxes:[{appIndex:this.appID,name:new Uint8Array([...L.from("cl-","utf-8"),...this.creator.addr.publicKey])}],sender:this.creator.addr,signer:this.creator.signer,suggestedParams:await C(this.algodClient,4)}),{txID:(await R(n.execute.bind(n),this.timeout,this.algodClient,10)).txIDs.pop()}}}var j=Object.defineProperty,q=(e,t,r)=>((e,t,r)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class z{constructor({algodClient:e,productName:t,subscriptionName:r,creator:n,appID:a,appAddress:i,appSpec:o,oracleID:s,price:l,coin:c,version:u,timeout:p,registryID:h}
6){q(this,"productName"),q(this,"subscriptionName"),q(this,"algodClient"),q(this,"creator"),q(this,"price"),q(this,"coin"),q(this,"oracleID"),q(this,"version"),q(this,"appID"),q(this,"appAddress"),q(this,"appSpec"),q(this,"timeout"),q(this,"registryID"),this.algodClient=e,this.productName=t,this.subscriptionName=r,this.creator=n,this.appID=a,this.appAddress=i,this.appSpec=o,this.oracleID=s,this.price=l,this.coin=c,this.version=u,this.timeout=p,this.registryID=h}static async init(e){var t,r,n,a;let{algodClient:o,chainType:s,registryID:l,productID:c,creator:u,timeout:p=S}=e,h=l||g(s),d=O(await (0,A.qV)(c,o).catch(e=>{throw Error(e)}));if(!d.oracle_id)throw Error("Oracle missing, cannot initialize");let f=BigInt(d.oracle_id),m=(0,i.HjT)(c),y=BigInt(d.price),w=await (0,A.sO)(c,o),v=d.product_name,b=d.subscription_name,x=new i.aXL;x.addMethodCall({appID:c,method:new i.aEE({name:"get_version",args:[],returns:{type:"string"}}),sender:u.addr,signer:(0,i.WZG)(),suggestedParams:await C(o,1)});let E=x.buildGroup().map(e=>i.Ay$.encodeUnsignedSimulateTransaction(e.txn)),I=new i.RdO.SimulateRequest({allowEmptySignatures:!0,allowMoreLogging:!0,txnGroups:[new i.RdO.SimulateRequestTransactionGroup({txns:E.map(e=>(0,i.J_k)(e))})]}),T=(await x.simulate(o,I)).methodResults[0].returnValue,_=await k(o,d.coin_id);return new z({algodClient:o,creator:u,appID:c,productName:v,subscriptionName:b,appAddress:m,appSpec:{approval:w.params.approvalProgram,clear:w.params.clearStateProgram,globalNumUint:(null==(t=w.params.globalStateSchema)?void 0:t.numUint)||0,globalNumByteSlice:(null==(r=w.params.globalStateSchema)?void 0:r.numByteSlice)||0,localNumUint:(null==(n=w.params.localStateSchema)?void 0:n.numUint)||0,localNumByteSlice:(null==(a=w.params.localStateSchema)?void 0:a.numByteSlice)||0},oracleID:f,price:y,coin:_,version:T,timeout:p,registryID:BigInt(h)})}async updateLifecycle(e){let{lifecycle:t}=e,r=new i.aXL;return r.addMethodCall({appID:this.appID,method:new i.aEE({name:"update_lifecycle",args:[{type:"uint64",name:"lifecycle",desc:"The new lifecycle."}],returns:{type:"void"}}),methodArgs:[t],sender:this.creator.addr,signer:this.creator.signer,suggestedParams:await C(this.algodClient,1)}),{txID:(await R(r.execute.bind(r),this.timeout,this.algodClient,10)).txIDs.pop()}}async enable(){return this.updateLifecycle({lifecycle:h.ENABLED})}async disable(){return this.updateLifecycle({lifecycle:h.DISABLED})}async getAppState(e=!0){let t=O(await (0,A.qV)(this.appID,this.algodClient).catch(e=>{throw Error(e)})),r=await this.getDiscount();return{productName:String(t.product_name),subscriptionName:String(t.subscription_name),manager:t.manager,price:e?T(BigInt(t.price),this.coin.decimals,l.PRETTY):BigInt(t.price),totalSubs:BigInt(t.total_subscribers),maxSubs:BigInt(t.max_subscribers),coinID:BigInt(t.coin_id),productType:t.product_type,lifecycle:t.lifecycle,createdAt:BigInt(t.created_at),duration:t.duration,oracleID:BigInt(t.oracle_id),unitName:String(t.unit_name),imageURL:String(t.image_url),discount:r}}async getSubscriptionPlatformFee(){if(0n===this.price)return new Promise(e=>e(0n));let e=new i.aXL;e.addMethodCall({appID:this.oracleID,method:new i.aEE({name:"compute_platform_fee",args:[{type:"uint64",name:"whole_usd",desc:"Amount of USD in whole numbers (CENTS)"}],returns:{type:"uint64"}}),methodArgs:[10],sender:this.creator.addr,signer:(0,i.WZG)(),suggestedParams:await C(this.algodClient,1)});let t=e.buildGroup().map(e=>i.Ay$.encodeUnsignedSimulateTransaction(e.txn)),r=new i.RdO.SimulateRequest({allowEmptySignatures:!0,allowMoreLogging:!0,txnGroups:[new i.RdO.SimulateRequestTransactionGroup({txns:t.map(e=>(0,i.J_k)(e))})]});return BigInt((await e.simulate(this.algodClient,r)).methodResults[0].returnValue)}async getLockerCreationFee(e){return(0,i.oUo)(.1)+P(0,1,1)+B(e)}async getDiscount(){var e;let t=new i.aXL;t.addMethodCall({appID:this.appID,method:new i.aEE({name:"get_discount",args:[],returns:{type:"(uint64,uint64,uint64,uint64,uint64)",desc:"An expression that returns the discount."},desc:"Returns the discount if exists."}),methodArgs:[],boxes:[{appIndex:this.appID,name:x}],sender:this.creator.addr,signer:(0,i.WZG)(),suggestedParams:await C(this.algodClient,1)});let r=t.buildGroup().map(e=>i.Ay$.encodeUnsignedSimulateTransaction(e.txn)),n=new i.RdO.SimulateRequest({allowEmptySignatures:!0,allowMoreLogging:!0,txnGroups:[new i.RdO.SimulateRequestTransactionGroup({txns:r.map(e=>(0,i.J_k)(e))})]}),a=null==(e=(await t.simulate(this.algodClient,n)).methodResults[0].returnValue)?void 0:e.valueOf();if(!a)return;let o=Array.isArray(a)?a.map(e=>BigInt(e)):[];if(5!==o.length)throw Error("Invalid subscription record");return{discountType:Number(o[0]),discountValue:o[1],expiresAt:0n===o[2]?null:o[2],createdAt:o[3],totalClaims:o[4]}}async createDiscount(e){let{discountType:t,discountValue:r,expires
6In:n,parseWholeUnits:a=!1}=e,o=new i.aXL;return o.addMethodCall({appID:this.appID,method:new i.aEE({name:"create_discount",args:[{type:"uint64",name:"discount_type",desc:"The type of discount (percentage or amount)."},{type:"uint64",name:"discount_value",desc:"The discount value in micro ALGOs."},{type:"uint64",name:"expires_in",desc:"The number of seconds to append to creation date"},{type:"pay",name:"fee_txn",desc:"The transaction fee."}],returns:{type:"void"}}),methodArgs:[t.valueOf(),a?T(r,this.coin.decimals,l.RAW):r,n,{txn:(0,i.f2A)({sender:this.creator.addr,receiver:this.appAddress,amount:function(){let e=new i.PX5(64).byteLen();return D(e,5*e,"create")}(),suggestedParams:await C(this.algodClient,0)}),signer:this.creator.signer}],boxes:[{appIndex:this.appID,name:x}],sender:this.creator.addr,signer:this.creator.signer,suggestedParams:await C(this.algodClient,2)}),{txID:(await R(o.execute.bind(o),this.timeout,this.algodClient,10)).txIDs.pop()}}async deleteDiscount(){let e=new i.aXL;return e.addMethodCall({appID:this.appID,method:new i.aEE({name:"delete_discount",args:[],returns:{type:"void"}}),methodArgs:[],boxes:[{appIndex:this.appID,name:x}],sender:this.creator.addr,signer:this.creator.signer,suggestedParams:await C(this.algodClient,2)}),{txID:(await R(e.execute.bind(e),this.timeout,this.algodClient,10)).txIDs.pop()}}async createSubscription(e){let{subscriber:t}=e,r=(await (0,A.qV)(this.oracleID,this.algodClient)).admin,n=(0,i.jX9)(r.valueRaw),a=await this.get
6SubscriptionPlatformFee(),o=await this.getAppState(!1),s=await F.getLocker({registryID:this.registryID,algodClient:this.algodClient,ownerAddress:o.manager,lockerType:p.CREATOR});if(!s)throw Error("Creator locker is not initialized");let l=(0,i.HjT)(s),u=this.price;o.discount&&(o.discount.discountType===c.PERCENTAGE?u-=u*o.discount.discountValue/100n:o.discount.discountType===c.FIXED&&(u-=o.discount.discountValue));let h=await this.getSubscription({algodClient:this.algodClient,subscriberAddress:t.addr}).catch(()=>null)!==null,d=await this.isSubscriber({subscriberAddress:t.addr}),f=new i.aXL;f.addMethodCall({appID:this.appID,method:new i.aEE({name:"create_subscription",args:[{type:"address",name:"subscriber",desc:"The subscriber's address."},{type:"application",name:"creator_locker",desc:"The locker of creator"},{type:"application",name:"oracle_id",desc:"The oracle app used."},{type:"pay",name:"fee_txn",desc:"The transaction fee paid to the app."},{type:"pay",name:"platform_fee_txn",desc:"The platform fee paid."},{type:"txn",name:"pay_txn",desc:"The payment transaction to fund the subscription."}],returns:{type:"uint64"}}),methodArgs:[t.addr,s,this.oracleID,{txn:(0,i.f2A)({sender:t.addr,receiver:this.appAddress,amount:h&&!d?0:function(e){let t=5*new i.PX5(64).byteLen();return D(e.publicKey,t,"create")}(t.addr)+(0,i.oUo)(.1),suggestedParams:await C(this.algodClient,0)}),signer:t.signer},{txn:(0,i.f2A)({sender:t.addr,receiver:n,amount:this.price>0?a:0,suggestedParams:await C(this.algodClient,0)}),signer:t.signer},0n===this.coin.index?{txn:(0,i.f2A)({sender:t.addr,receiver:l,amount:u,suggestedParams:await C(this.algodClient,0)}),signer:t.signer}:{txn:(0,i.q7Y)({sender:t.addr,receiver:l,amount:u,assetIndex:this.coin.index,suggestedParams:await C(this.algodClient,0)}),signer:t.signer}],boxes:[{appIndex:this.appID,name:t.addr.publicKey},{appIndex:this.appID,name:x}],sender:t.addr,signer:t.signer,suggestedParams:await C(this.algodClient,this.coin.index>0?6:5)});let g=await R(f.execute.bind(f),this.timeout,this.algodClient,10).catch(e=>{throw Error(e)});return{txID:g.txIDs.pop(),subscriptionID:BigInt(g.methodResults[0].returnValue)}}async transferSubscription(e){let{oldSubscriber:t,newSubscriberAddress:r,subscriptionID:n}=e,a=new i.aXL;return a.addMethodCall({appID:this.appID,method:new i.aEE({name:"transfer_subscription",args:[{type:"address",name:"new_subscriber",desc:"The new address to transfer the subscription to."},{type:"asset",name:"subscription",desc:"The subscription asset."}],returns:{type:"void"}}),boxes:[{appIndex:this.appID,name:t.addr.publicKey},{appIndex:this.appID,name:r.publicKey}],methodArgs:[r,n],sender:t.addr,signer:t.signer,suggestedParams:await C(this.algodClient,2)}),{txID:(await R(a.execute.bind(a),this.timeout,this.algodClient,10)).txIDs.pop()}}async claimSubscription(e){let{subscriber:t,subscriptionID:r}=e;await this.algodClient.accountAssetInformation(t.addr,r).do().catch(()=>null)||await I({client:this.algodClient,account:t,assetID:r});let n=new i.aXL;return n.addMethodCall({appID:this.appID,method:new i.aEE({name:"claim_subscription",args:[{type:"asset",name:"subscription",desc:"The subscription ASA ID."}],returns:{type:"void"}}),methodArgs:[r],boxes:[{appIndex:this.appID,name:t.addr.publicKey}],sender:t.addr,signer:t.signer,suggestedParams:await C(this.algodClient,2)}),{txID:(await R(n.execute.bind(n),this.timeout,this.algodClient,10)).txIDs.pop()}}async deleteSubscription(e){let{subscriber:t,subscriptionID:r}=e,n=!1,a=await this.algodClient.accountAssetInformation(t.addr,r).do().catch(()=>{n=!1});a&&a.assetHolding&&(n=a.assetHolding.amount>0);let o=new i.aXL;return o.addMethodCall({appID:this.appID,method:new i.aEE({name:"delete_subscription",args:[{type:"asset",name:"subscription",desc:"The subscription ASA ID."}],returns:{type:"uint64"}}),methodArgs:[r],boxes:[{appIndex:this.appID,name:t.addr.publicKey}],sender:t.addr,signer:t.signer,suggestedParams:await C(this.algodClient,n?4:3)}),{txID:(await R(o.execute.bind(o),this.timeout,this.algodClient,10)).txIDs.pop()}}async isSubscriber(e){let{subscriberAddress:t}=e,r=new i.aXL;r.addMethodCall({appID:this.appID,method:new i.aEE({name:"is_subscriber",args:[{type:"address",name:"subscriber",desc:"The subscriber address."}],returns:{type:"uint64"}}),methodArgs:[t],sender:this.creator.addr,signer:(0,i.WZG)(),boxes:[{appIndex:this.appID,name:t.publicKey}],suggestedParams:await C(this.algodClient,1)});let n=r.buildGroup().map(e=>i.Ay$.encodeUnsignedSimulateTransaction(e.txn)),a=new i.RdO.SimulateRequest({allowEmptySignatures:!0,allowMoreLogging:!0,txnGroups:[new i.RdO.SimulateRequestTransactionGroup({txns:n.map(e=>(0,i.J_k)(e))})]});return!!(await r.simulate(this.algodClient,a)).methodResults[0].returnValue}async getSubscription(e){var t;let{algodClient:r,subscriberAddress:n}=e,a=new i.aXL;a.addMethodCall({appID:this.appID,method:new i.aEE({name:"get_subscription",args:[{type:"address",name:"subscriber",desc:"The subscriber address."}],returns:{type:"(uint64,uint64,uint64,uint64,uint64)"}}),methodArgs:[n],sender:this.creator.addr,signer:(0,i.WZG)(),boxes:[{appIndex:this.appID,name:n.publicKey}],suggestedParams:await C(r,1)});let o=a.buildGroup().map(e=>i.Ay$.encodeUnsignedSimulateTransaction(e.txn)),s=new i.RdO.SimulateRequest({allowEmptySignatures:!0,allowMoreLogging:!0,txnGroups:[new i.RdO.SimulateRequestTransactionGroup({txns:o.map(e=>(0,i.J_k)(e))})]}),l=(null==(t=(await a.simulate(r,s)).methodResults[0].returnValue)?void 0:t.valueOf()).map(e=>BigInt(e));if(5!==l.length)throw Error("Invalid subscription record");return{subscriptionID:l[0],productType:Number(l[1]),createdAt:l[2],expiresAt:0n===l[3]?null:l[3],duration:Number(l[4])}}async getSubscribers({filterExpired:e=!1}={}){let t=(await this.algodClient.getApplicationBoxes(this.appID).do()).boxes.map(async e=>{let t=i.pVw.fromString((0,i.jX9)(e.name)),r=this.getSubscription({algodClient:this.algodClient,subscriberAddress:t});return{address:t,subscription:await r}}),r=await Promise.allSettled(t),n=r.filter(e=>"fulfilled"===e.status).map(e=>e.value),a=r.filter(e=>"rejected"===e.status).map(e=>e.reason);if(a.length>0)throw Error(`Errors occurred: ${a.join(", ")}`);return e?n.filter(e=>null===e.subscription.expiresAt||e.subscription.expiresAt>BigInt(Date.now()/1e3)):n}}},93694:(e,t,r)=>{var n=null;let a=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,i=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction)if("error"===e.constructorAction||"ignore"===e.constructorAction||"preserve"===e.constructorAction)t.constructorAction=e.constructorAction;else throw Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);if(void 0!==e.protoAction)if("error"===e.protoAction||"ignore"===e.protoAction||"preserve"===e.protoAction)t.protoAction=e.protoAction;else throw Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`)}var o,s,l,c,u={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:" "},p=function(e){throw{name:"SyntaxError",message:e,at:o,text:l}},h=function(e){return e&&e!==s&&p("Expected '"+e+"' instead of '"+s+"'"),s=l.charAt(o),o+=1,s},d=function(){var e,a="";for("-"===s&&(a="-",h("-"));s>="0"&&s<="9";)a+=s,h();if("."===s)for(a+=".";h()&&s>="0"&&s<="9";)a+=s;if("e"===s||"E"===s)for(a+=s,h(),("-"===s||"+"===s)&&(a+=s,h());s>="0"&&s<="9";)a+=s,h();
6if(isFinite(e=+a))return(null==n&&(n=r(9006)),a.length>15)?t.storeAsString?a:t.useNativeBigInt?BigInt(a):new n(a):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new n(e):e;p("Bad number")},f=function(){var e,t,r,n="";if('"'===s)for(var a=o;h();){if('"'===s)return o-1>a&&(n+=l.substring(a,o-1)),h(),n;if("\\"===s){if(o-1>a&&(n+=l.substring(a,o-1)),h(),"u"===s){for(t=0,r=0;t<4&&isFinite(e=parseInt(h(),16));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else if("string"==typeof u[s])n+=u[s];else break;a=o}}p("Bad string")},g=function(){for(;s&&s<=" ";)h()},m=function(){switch(s){case"t":return h("t"),h("r"),h("u"),h("e"),!0;case"f":return h("f"),h("a"),h("l"),h("s"),h("e"),!1;case"n":return h("n"),h("u"),h("l"),h("l"),null}p("Unexpected '"+s+"'")},y=function(){var e=[];if("["===s){if(h("["),g(),"]"===s)return h("]"),e;for(;s;){if(e.push(c()),g(),"]"===s)return h("]"),e;h(","),g()}}p("Bad array")},w=function(){var e,r=Object.create(null);if("{"===s){if(h("{"),g(),"}"===s)return h("}"),r;for(;s;){if(e=f(),g(),h(":"),!0===t.strict&&Object.hasOwnProperty.call(r,e)&&p('Duplicate key "'+e+'"'),!0===a.test(e)?"error"===t.protoAction?p("Object contains forbidden prototype property"):"ignore"===t.protoAction?c():r[e]=c():!0===i.test(e)?"error"===t.constructorAction?p("Object contains forbidden constructor property"):"ignore"===t.constructorAction?c():r[e]=c():r[e]=c(),g(),"}"===s)return h("}"),r;h(","),g()}}p("Bad object")};return c=function(){switch(g(),s){case"{":return w();case"[":return y();case'"':return f();case"-":return d();default:return s>="0"&&s<="9"?d():m()}},function(e,t){var r;return l=e+"",o=0,s=" ",r=c(),g(),s&&p("Syntax error"),"function"==typeof t?function e(r,n){var a,i=r[n];
6return i&&"object"==typeof i&&Object.keys(i).forEach(function(t){void 0!==(a=e(i,t))?i[t]=a:delete i[t]}),t.call(r,n,i)}({"":r},""):r}}},93720:(e,t,r)=>{"use strict";r.d(t,{p:()=>d});var n=r(79175),a=r(82248);r(64527);var i=r(94393),o=r(51049),s=r(44241),l=r(41903),c=r(97569),u=r(21567);let p={orientation:"horizontal"},h=(0,i.V)((e,t)=>{let{borderWidth:r}=t;return{group:{"--ai-border-width":(0,a.D)(r)}}}),d=(0,c.P9)((e,t)=>{let r=(0,o.Y)("ActionIconGroup",p,e),{className:a,style:i,classNames:c,styles:d,unstyled:f,orientation:g,vars:m,borderWidth:y,variant:w,mod:v,attributes:b,...S}=(0,o.Y)("ActionIconGroup",p,e),x=(0,s.I)({name:"ActionIconGroup",props:r,classes:u.A,className:a,style:i,classNames:c,styles:d,unstyled:f,attributes:b,vars:m,varsResolver:h,rootSelector:"group"});return(0,n.jsx)(l.a,{...x("group"),ref:t,variant:w,mod:[{"data-orientation":g},v],role:"group",...S})});d.classes=u.A,d.displayName="@mantine/core/ActionIconGroup"},96774:(e,t,r)=>{"use strict";e.exports=r(61597)},96898:(e,t,r)=>{"use strict";r.d(t,{X:()=>i,z:()=>a});var n=r(46085);function a(e){if(!("bigint"==typeof e||Number.isInteger(e))||e<0||e>BigInt("0xffffffffffffffff"))throw Error("Input is not a 64-bit unsigned integer");let t=new Uint8Array(8);return new DataView(t.buffer).setBigUint64(0,BigInt(e)),t}function i(e,t="safe"){if("safe"!==t&&"mixed"!==t&&"bigint"!==t)throw Error(`Unknown decodingMode option: ${t}`);if(0===e.byteLength||e.byteLength>8)throw Error(`Data has unacceptable length. Expected length is between 1 and 8, got ${e.byteLength}`);let r=new Uint8Array(8-e.byteLength),a=new DataView((0,n.zI)(r,e).buffer).getBigUint64(0),o=a>BigInt(Number.MAX_SAFE_INTEGER);if("safe"===t){if(o)throw Error(`Integer exceeds maximum safe integer: ${a.toString()}. Try decoding with "mixed" or "safe" decodingMode.`);return Number(a)}return"mixed"!==t||o?a:Number(a)}},97657:(e,t,r)=>{"use strict";r.d(t,{s:()=>c});var n=r(79175);r(64527);var a=r(63871),i=r(51049),o=r(97569),s=r(33279),l=r(77599);let c=(0,o.P9)((e,t)=>{let r=(0,i.Y)("InputClearButton",null,e),{size:o,variant:c,vars:u,classNames:p,styles:h,...d}=r,f=(0,l.z)(),{resolvedClassNames:g,resolvedStyles:m}=(0,a.Y)({classNames:p,styles:h,props:r});return(0,n.jsx)(s.J,{variant:c||"transparent",ref:t,size:o||(null==f?void 0:f.size)||"sm",classNames:g,styles:m,__staticSelector:"InputClearButton",...d})});c.displayName="@mantine/core/InputClearButton"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.