@mysten-incubation/sui-agent-pass 0.1.28 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deployments/mainnet.json +1 -1
- package/deployments/testnet.json +43 -21
- package/dist/agent.js +8 -1
- package/dist/chain.js +6 -0
- package/dist/describe.js +3 -0
- package/dist/plugin.js +49 -2
- package/docs/AGENT.md +3 -1
- package/docs/PLAYBOOK.md +13 -8
- package/package.json +1 -1
- package/skills/agent-pass/SKILL.md +13 -8
- package/web-dist/assets/{index-CiuC-y47.js → index-Elf_o7Cj.js} +2 -2
- package/web-dist/assets/{mount-CvSnQ6dg.js → mount-wnWN72B8.js} +1 -1
- package/web-dist/deployments/mainnet.json +1 -1
- package/web-dist/deployments/testnet.json +43 -21
- package/web-dist/index.html +1 -1
|
@@ -9,7 +9,7 @@ ${String(r)}`);Ly(t);for(let i=0;i<t.callbacks.length;i++){const c=r[i];c instan
|
|
|
9
9
|
`,t)}return mu}function vE(...e){return e=e.filter(t=>!xp.has(t)),e.length?(e.forEach(t=>dj(t)),Oc.register?.forEach(t=>bE(()=>t(...e))),function(){e.forEach(s=>fj(s)),Oc.unregister?.forEach(s=>bE(()=>s(...e)))}):()=>{}}let ju;function hj(){return ju||(ju=[...xp]),ju}function pj(e,t){return Oc[e]?.push(t)||(Oc[e]=[t]),function(){Oc[e]=Oc[e]?.filter(r=>t!==r)}}function bE(e){try{e()}catch(t){console.error(t)}}class mj extends Event{get detail(){return lj(this,mh,"f")}get type(){return"wallet-standard:app-ready"}constructor(t){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),mh.set(this,void 0),uj(this,mh,t,"f")}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}mh=new WeakMap;const gj=3834e3,yj=3834001,vj=4001e3,bj=616e4,wj=6160001,Tj=6160002;function tA(e){return Array.isArray(e)?"%5B"+e.map(tA).join("%2C%20")+"%5D":typeof e=="bigint"?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function Sj([e,t]){return`${e}=${tA(t)}`}function Ej(e){const t=Object.entries(e).map(Sj).join("&");return btoa(t)}var wE;(function(e){e[e.EscapeSequence=0]="EscapeSequence",e[e.Text=1]="Text",e[e.Variable=2]="Variable"})(wE||(wE={}));function _j(e,t={}){{let s=`Wallet Standard error #${e}; Decode this error by running \`npx @wallet-standard/errors decode -- ${e}`;return Object.keys(t).length&&(s+=` '${Ej(t)}'`),`${s}\``}}function kj(e,t){return e instanceof Error&&e.name==="WalletStandardError"?e.context.__code===t:!1}class ad extends Error{constructor(...[t,s]){let r,i;if(s){const{cause:u,...d}=s;u&&(i={cause:u}),Object.keys(d).length>0&&(r=d)}const c=_j(t,r);super(c,i),this.context={__code:t,...r},this.name="WalletStandardError"}}function Ip(...e){"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...e)}const ob="standard:connect",Aj="standard:disconnect",Rp="standard:events";var vc=function(e,t,s,r){if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?r:s==="a"?r.call(e):r?r.value:t.get(e)},bc=function(e,t,s,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,s):i?i.value=s:t.set(e,s),s},gh,yh,vh,bh,wh,Th;class id{get address(){return vc(this,gh,"f")}get publicKey(){return vc(this,yh,"f").slice()}get chains(){return vc(this,vh,"f").slice()}get features(){return vc(this,bh,"f").slice()}get label(){return vc(this,wh,"f")}get icon(){return vc(this,Th,"f")}constructor(t){gh.set(this,void 0),yh.set(this,void 0),vh.set(this,void 0),bh.set(this,void 0),wh.set(this,void 0),Th.set(this,void 0),new.target===id&&Object.freeze(this),bc(this,gh,t.address,"f"),bc(this,yh,t.publicKey.slice(),"f"),bc(this,vh,t.chains.slice(),"f"),bc(this,bh,t.features.slice(),"f"),bc(this,wh,t.label,"f"),bc(this,Th,t.icon,"f")}}gh=new WeakMap,yh=new WeakMap,vh=new WeakMap,bh=new WeakMap,wh=new WeakMap,Th=new WeakMap;const Oj="sui:devnet",Nj="sui:testnet",xj="sui:localnet",nA="sui:mainnet",Gu=[Oj,Nj,xj,nA],Cj=["sui:signTransaction","sui:signAndExecuteTransaction","sui:signPersonalMessage"];function Ij(e){const t=[...Gu],s=new Set(Gu);for(const r of e??[]){const i=`sui:${r}`;s.has(i)||(s.add(i),t.push(i))}return t}function Jy(e,t,s,r,i){return{address:t,label:s,signer:e,walletAccount:new id({address:t,label:s,publicKey:e.getPublicKey().toSuiBytes(),chains:[...Gu],features:[...Cj]})}}function Rj(e){return e.split(":")[1]}async function jj({type:e,signer:t,data:s,client:r}){switch(e){case"sign-personal-message":{if(!(s instanceof Uint8Array))throw new Error("sign-personal-message expects data to be a Uint8Array");const{bytes:i,signature:c}=await t.signPersonalMessage(s);return{type:e,bytes:i,signature:c}}case"sign-transaction":{if(!r)throw new Error("No client provided for sign-transaction");if(typeof s!="string")throw new Error("sign-transaction expects data to be a JSON string");const{bytes:i,signature:c}=await Yn.from(s).sign({client:r,signer:t});return{type:e,bytes:i,signature:c}}case"sign-and-execute-transaction":{if(!r)throw new Error("No client provided for sign-and-execute-transaction");if(typeof s!="string")throw new Error("sign-and-execute-transaction expects data to be a JSON string");const{bytes:i,signature:c}=await Yn.from(s).sign({client:r,signer:t}),u=await r.core.executeTransaction({transaction:Ge(i),signatures:[c],include:{effects:!0}}),d=u.Transaction??u.FailedTransaction;if(!d)throw new Error("Transaction execution returned empty result");if(!d.status.success)throw new Error(d.status.error?.message??"Transaction execution failed");return{type:e,bytes:i,signature:c,digest:d.digest,effects:d.effects?.bcs?Ke(d.effects.bcs):""}}}}const sA="x-sui-client-protocol-version",rA=138;function ga(e){let t=typeof e;if(t=="object"){if(Array.isArray(e))return"array";if(e===null)return"null"}return t}function Hh(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}let ia="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),jp=[];for(let e=0;e<ia.length;e++)jp[ia[e].charCodeAt(0)]=e;jp[45]=ia.indexOf("+");jp[95]=ia.indexOf("/");function aA(e){let t=e.length*3/4;e[e.length-2]=="="?t-=2:e[e.length-1]=="="&&(t-=1);let s=new Uint8Array(t),r=0,i=0,c,u=0;for(let d=0;d<e.length;d++){if(c=jp[e.charCodeAt(d)],c===void 0)switch(e[d]){case"=":i=0;case`
|
|
10
10
|
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:u=c,i=1;break;case 1:s[r++]=u<<2|(c&48)>>4,u=c,i=2;break;case 2:s[r++]=(u&15)<<4|(c&60)>>2,u=c,i=3;break;case 3:s[r++]=(u&3)<<6|c,i=0;break}}if(i==1)throw Error("invalid base64 string.");return s.subarray(0,r)}function iA(e){let t="",s=0,r,i=0;for(let c=0;c<e.length;c++)switch(r=e[c],s){case 0:t+=ia[r>>2],i=(r&3)<<4,s=1;break;case 1:t+=ia[i|r>>4],i=(r&15)<<2,s=2;break;case 2:t+=ia[i|r>>6],t+=ia[r&63],s=0;break}return s&&(t+=ia[i],t+="=",s==1&&(t+="=")),t}var qh;(function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=(s,r,i,c,u)=>{(t(r)?r[e.symbol]:r[e.symbol]=[]).push({no:i,wireType:c,data:u})},e.onWrite=(s,r,i)=>{for(let{no:c,wireType:u,data:d}of e.list(r))i.tag(c,u).raw(d)},e.list=(s,r)=>{if(t(s)){let i=s[e.symbol];return r?i.filter(c=>c.no==r):i}return[]},e.last=(s,r)=>e.list(s,r).slice(-1)[0];const t=s=>s&&Array.isArray(s[e.symbol])})(qh||(qh={}));function Mj(e,t){return Object.assign(Object.assign({},e),t)}var Wt;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Wt||(Wt={}));function Dj(){let e=0,t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,(i&128)==0)return this.assertBounds(),[e,t]}let s=this.buf[this.pos++];if(e|=(s&15)<<28,t=(s&112)>>4,(s&128)==0)return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<r,(i&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Z0(e,t,s){for(let c=0;c<28;c=c+7){const u=e>>>c,d=!(!(u>>>7)&&t==0),p=(d?u|128:u)&255;if(s.push(p),!d)return}const r=e>>>28&15|(t&7)<<4,i=t>>3!=0;if(s.push((i?r|128:r)&255),!!i){for(let c=3;c<31;c=c+7){const u=t>>>c,d=!!(u>>>7),p=(d?u|128:u)&255;if(s.push(p),!d)return}s.push(t>>>31&1)}}const Sh=65536*65536;function oA(e){let t=e[0]=="-";t&&(e=e.slice(1));const s=1e6;let r=0,i=0;function c(u,d){const p=Number(e.slice(u,d));i*=s,r=r*s+p,r>=Sh&&(i=i+(r/Sh|0),r=r%Sh)}return c(-24,-18),c(-18,-12),c(-12,-6),c(-6),[t,r,i]}function Qy(e,t){if(t>>>0<=2097151)return""+(Sh*t+(e>>>0));let s=e&16777215,r=(e>>>24|t<<8)>>>0&16777215,i=t>>16&65535,c=s+r*6777216+i*6710656,u=r+i*8147497,d=i*2,p=1e7;c>=p&&(u+=Math.floor(c/p),c%=p),u>=p&&(d+=Math.floor(u/p),u%=p);function m(g,y){let b=g?String(g):"";return y?"0000000".slice(b.length)+b:b}return m(d,0)+m(u,d)+m(c,1)}function TE(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let s=0;s<9;s++)t.push(e&127|128),e=e>>7;t.push(1)}}function Uj(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let s=5;(e&128)!==0&&s<10;s++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}let Ct;function Bj(){const e=new DataView(new ArrayBuffer(8));Ct=globalThis.BigInt!==void 0&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}Bj();function cA(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const lA=/^-?[0-9]+$/,Zh=4294967296,Zf=2147483648;class uA{constructor(t,s){this.lo=t|0,this.hi=s|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let t=this.hi*Zh+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class Bn extends uA{static from(t){if(Ct)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=Ct.C(t);case"number":if(t===0)return this.ZERO;t=Ct.C(t);case"bigint":if(!t)return this.ZERO;if(t<Ct.UMIN)throw new Error("signed value for ulong");if(t>Ct.UMAX)throw new Error("ulong too large");return Ct.V.setBigUint64(0,t,!0),new Bn(Ct.V.getInt32(0,!0),Ct.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!lA.test(t))throw new Error("string is no integer");let[s,r,i]=oA(t);if(s)throw new Error("signed value for ulong");return new Bn(r,i);case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new Bn(t,t/Zh)}throw new Error("unknown value "+typeof t)}toString(){return Ct?this.toBigInt().toString():Qy(this.lo,this.hi)}toBigInt(){return cA(Ct),Ct.V.setInt32(0,this.lo,!0),Ct.V.setInt32(4,this.hi,!0),Ct.V.getBigUint64(0,!0)}}Bn.ZERO=new Bn(0,0);class Ot extends uA{static from(t){if(Ct)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=Ct.C(t);case"number":if(t===0)return this.ZERO;t=Ct.C(t);case"bigint":if(!t)return this.ZERO;if(t<Ct.MIN)throw new Error("signed long too small");if(t>Ct.MAX)throw new Error("signed long too large");return Ct.V.setBigInt64(0,t,!0),new Ot(Ct.V.getInt32(0,!0),Ct.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!lA.test(t))throw new Error("string is no integer");let[s,r,i]=oA(t);if(s){if(i>Zf||i==Zf&&r!=0)throw new Error("signed long too small")}else if(i>=Zf)throw new Error("signed long too large");let c=new Ot(r,i);return s?c.negate():c;case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new Ot(t,t/Zh):new Ot(-t,-t/Zh).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return(this.hi&Zf)!==0}negate(){let t=~this.hi,s=this.lo;return s?s=~s+1:t+=1,new Ot(s,t)}toString(){if(Ct)return this.toBigInt().toString();if(this.isNegative()){let t=this.negate();return"-"+Qy(t.lo,t.hi)}return Qy(this.lo,this.hi)}toBigInt(){return cA(Ct),Ct.V.setInt32(0,this.lo,!0),Ct.V.setInt32(4,this.hi,!0),Ct.V.getBigInt64(0,!0)}}Ot.ZERO=new Ot(0,0);const SE={readUnknownField:!0,readerFactory:e=>new zj(e)};function Lj(e){return e?Object.assign(Object.assign({},SE),e):SE}class zj{constructor(t,s){this.varint64=Dj,this.uint32=Uj,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=s??new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let t=this.uint32(),s=t>>>3,r=t&7;if(s<=0||r<0||r>5)throw new Error("illegal tag: field no "+s+" wire type "+r);return[s,r]}skip(t){let s=this.pos;switch(t){case Wt.Varint:for(;this.buf[this.pos++]&128;);break;case Wt.Bit64:this.pos+=4;case Wt.Bit32:this.pos+=4;break;case Wt.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Wt.StartGroup:let i;for(;(i=this.tag()[1])!==Wt.EndGroup;)this.skip(i);break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(s,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return new Ot(...this.varint64())}uint64(){return new Bn(...this.varint64())}sint64(){let[t,s]=this.varint64(),r=-(t&1);return t=(t>>>1|(s&1)<<31)^r,s=s>>>1^r,new Ot(t,s)}bool(){let[t,s]=this.varint64();return t!==0||s!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new Bn(this.sfixed32(),this.sfixed32())}sfixed64(){return new Ot(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),s=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(s,s+t)}string(){return this.textDecoder.decode(this.bytes())}}function et(e,t){if(!e)throw new Error(t)}function $j(e,t){throw new Error("Unexpected object: "+e)}const Vj=34028234663852886e22,Pj=-34028234663852886e22,Gj=4294967295,Fj=2147483647,Hj=-2147483648;function Mu(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>Fj||e<Hj)throw new Error("invalid int 32: "+e)}function Yh(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>Gj||e<0)throw new Error("invalid uint 32: "+e)}function cb(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>Vj||e<Pj))throw new Error("invalid float 32: "+e)}const EE={writeUnknownFields:!0,writerFactory:()=>new Zj};function qj(e){return e?Object.assign(Object.assign({},EE),e):EE}class Zj{constructor(t){this.stack=[],this.textEncoder=t??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let i=0;i<this.chunks.length;i++)t+=this.chunks[i].length;let s=new Uint8Array(t),r=0;for(let i=0;i<this.chunks.length;i++)s.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],s}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),s=this.stack.pop();if(!s)throw new Error("invalid state, fork stack empty");return this.chunks=s.chunks,this.buf=s.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,s){return this.uint32((t<<3|s)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Yh(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Mu(t),TE(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let s=this.textEncoder.encode(t);return this.uint32(s.byteLength),this.raw(s)}float(t){cb(t);let s=new Uint8Array(4);return new DataView(s.buffer).setFloat32(0,t,!0),this.raw(s)}double(t){let s=new Uint8Array(8);return new DataView(s.buffer).setFloat64(0,t,!0),this.raw(s)}fixed32(t){Yh(t);let s=new Uint8Array(4);return new DataView(s.buffer).setUint32(0,t,!0),this.raw(s)}sfixed32(t){Mu(t);let s=new Uint8Array(4);return new DataView(s.buffer).setInt32(0,t,!0),this.raw(s)}sint32(t){return Mu(t),t=(t<<1^t>>31)>>>0,TE(t,this.buf),this}sfixed64(t){let s=new Uint8Array(8),r=new DataView(s.buffer),i=Ot.from(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(s)}fixed64(t){let s=new Uint8Array(8),r=new DataView(s.buffer),i=Bn.from(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(s)}int64(t){let s=Ot.from(t);return Z0(s.lo,s.hi,this.buf),this}sint64(t){let s=Ot.from(t),r=s.hi>>31,i=s.lo<<1^r,c=(s.hi<<1|s.lo>>>31)^r;return Z0(i,c,this.buf),this}uint64(t){let s=Bn.from(t);return Z0(s.lo,s.hi,this.buf),this}}const _E={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},kE={ignoreUnknownFields:!1};function Yj(e){return e?Object.assign(Object.assign({},kE),e):kE}function dA(e){return e?Object.assign(Object.assign({},_E),e):_E}function Wj(e,t){var s,r;let i=Object.assign(Object.assign({},e),t);return i.typeRegistry=[...(s=e?.typeRegistry)!==null&&s!==void 0?s:[],...(r=t?.typeRegistry)!==null&&r!==void 0?r:[]],i}const fA=Symbol.for("protobuf-ts/message-type");function Wh(e){let t=!1;const s=[];for(let r=0;r<e.length;r++){let i=e.charAt(r);i=="_"?t=!0:/\d/.test(i)?(s.push(i),t=!0):t?(s.push(i.toUpperCase()),t=!1):r==0?s.push(i.toLowerCase()):s.push(i)}return s.join("")}var ve;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(ve||(ve={}));var Er;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER"})(Er||(Er={}));var Xh;(function(e){e[e.NO=0]="NO",e[e.PACKED=1]="PACKED",e[e.UNPACKED=2]="UNPACKED"})(Xh||(Xh={}));function Xj(e){var t,s,r,i;return e.localName=(t=e.localName)!==null&&t!==void 0?t:Wh(e.name),e.jsonName=(s=e.jsonName)!==null&&s!==void 0?s:Wh(e.name),e.repeat=(r=e.repeat)!==null&&r!==void 0?r:Xh.NO,e.opt=(i=e.opt)!==null&&i!==void 0?i:e.repeat||e.oneof?!1:e.kind=="message",e}function Kj(e){if(typeof e!="object"||e===null||!e.hasOwnProperty("oneofKind"))return!1;switch(typeof e.oneofKind){case"string":return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case"undefined":return Object.keys(e).length==1;default:return!1}}class Jj{constructor(t){var s;this.fields=(s=t.fields)!==null&&s!==void 0?s:[]}prepare(){if(this.data)return;const t=[],s=[],r=[];for(let i of this.fields)if(i.oneof)r.includes(i.oneof)||(r.push(i.oneof),t.push(i.oneof),s.push(i.oneof));else switch(s.push(i.localName),i.kind){case"scalar":case"enum":(!i.opt||i.repeat)&&t.push(i.localName);break;case"message":i.repeat&&t.push(i.localName);break;case"map":t.push(i.localName);break}this.data={req:t,known:s,oneofs:Object.values(r)}}is(t,s,r=!1){if(s<0)return!0;if(t==null||typeof t!="object")return!1;this.prepare();let i=Object.keys(t),c=this.data;if(i.length<c.req.length||c.req.some(u=>!i.includes(u))||!r&&i.some(u=>!c.known.includes(u)))return!1;if(s<1)return!0;for(const u of c.oneofs){const d=t[u];if(!Kj(d))return!1;if(d.oneofKind===void 0)continue;const p=this.fields.find(m=>m.localName===d.oneofKind);if(!p||!this.field(d[d.oneofKind],p,r,s))return!1}for(const u of this.fields)if(u.oneof===void 0&&!this.field(t[u.localName],u,r,s))return!1;return!0}field(t,s,r,i){let c=s.repeat;switch(s.kind){case"scalar":return t===void 0?s.opt:c?this.scalars(t,s.T,i,s.L):this.scalar(t,s.T,s.L);case"enum":return t===void 0?s.opt:c?this.scalars(t,ve.INT32,i):this.scalar(t,ve.INT32);case"message":return t===void 0?!0:c?this.messages(t,s.T(),r,i):this.message(t,s.T(),r,i);case"map":if(typeof t!="object"||t===null)return!1;if(i<2)return!0;if(!this.mapKeys(t,s.K,i))return!1;switch(s.V.kind){case"scalar":return this.scalars(Object.values(t),s.V.T,i,s.V.L);case"enum":return this.scalars(Object.values(t),ve.INT32,i);case"message":return this.messages(Object.values(t),s.V.T(),r,i)}break}return!0}message(t,s,r,i){return r?s.isAssignable(t,i):s.is(t,i)}messages(t,s,r,i){if(!Array.isArray(t))return!1;if(i<2)return!0;if(r){for(let c=0;c<t.length&&c<i;c++)if(!s.isAssignable(t[c],i-1))return!1}else for(let c=0;c<t.length&&c<i;c++)if(!s.is(t[c],i-1))return!1;return!0}scalar(t,s,r){let i=typeof t;switch(s){case ve.UINT64:case ve.FIXED64:case ve.INT64:case ve.SFIXED64:case ve.SINT64:switch(r){case Er.BIGINT:return i=="bigint";case Er.NUMBER:return i=="number"&&!isNaN(t);default:return i=="string"}case ve.BOOL:return i=="boolean";case ve.STRING:return i=="string";case ve.BYTES:return t instanceof Uint8Array;case ve.DOUBLE:case ve.FLOAT:return i=="number"&&!isNaN(t);default:return i=="number"&&Number.isInteger(t)}}scalars(t,s,r,i){if(!Array.isArray(t))return!1;if(r<2)return!0;if(Array.isArray(t)){for(let c=0;c<t.length&&c<r;c++)if(!this.scalar(t[c],s,i))return!1}return!0}mapKeys(t,s,r){let i=Object.keys(t);switch(s){case ve.INT32:case ve.FIXED32:case ve.SFIXED32:case ve.SINT32:case ve.UINT32:return this.scalars(i.slice(0,r).map(c=>parseInt(c)),s,r);case ve.BOOL:return this.scalars(i.slice(0,r).map(c=>c=="true"?!0:c=="false"?!1:c),s,r);default:return this.scalars(i,s,r,Er.STRING)}}}function er(e,t){switch(t){case Er.BIGINT:return e.toBigInt();case Er.NUMBER:return e.toNumber();default:return e.toString()}}class Qj{constructor(t){this.info=t}prepare(){var t;if(this.fMap===void 0){this.fMap={};const s=(t=this.info.fields)!==null&&t!==void 0?t:[];for(const r of s)this.fMap[r.name]=r,this.fMap[r.jsonName]=r,this.fMap[r.localName]=r}}assert(t,s,r){if(!t){let i=ga(r);throw(i=="number"||i=="boolean")&&(i=r.toString()),new Error(`Cannot parse JSON ${i} for ${this.info.typeName}#${s}`)}}read(t,s,r){this.prepare();const i=[];for(const[c,u]of Object.entries(t)){const d=this.fMap[c];if(!d){if(!r.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${c}`);continue}const p=d.localName;let m;if(d.oneof){if(u===null&&(d.kind!=="enum"||d.T()[0]!=="google.protobuf.NullValue"))continue;if(i.includes(d.oneof))throw new Error(`Multiple members of the oneof group "${d.oneof}" of ${this.info.typeName} are present in JSON.`);i.push(d.oneof),m=s[d.oneof]={oneofKind:p}}else m=s;if(d.kind=="map"){if(u===null)continue;this.assert(Hh(u),d.name,u);const g=m[p];for(const[y,b]of Object.entries(u)){this.assert(b!==null,d.name+" map value",null);let E;switch(d.V.kind){case"message":E=d.V.T().internalJsonRead(b,r);break;case"enum":if(E=this.enum(d.V.T(),b,d.name,r.ignoreUnknownFields),E===!1)continue;break;case"scalar":E=this.scalar(b,d.V.T,d.V.L,d.name);break}this.assert(E!==void 0,d.name+" map value",b);let O=y;d.K==ve.BOOL&&(O=O=="true"?!0:O=="false"?!1:O),O=this.scalar(O,d.K,Er.STRING,d.name).toString(),g[O]=E}}else if(d.repeat){if(u===null)continue;this.assert(Array.isArray(u),d.name,u);const g=m[p];for(const y of u){this.assert(y!==null,d.name,null);let b;switch(d.kind){case"message":b=d.T().internalJsonRead(y,r);break;case"enum":if(b=this.enum(d.T(),y,d.name,r.ignoreUnknownFields),b===!1)continue;break;case"scalar":b=this.scalar(y,d.T,d.L,d.name);break}this.assert(b!==void 0,d.name,u),g.push(b)}}else switch(d.kind){case"message":if(u===null&&d.T().typeName!="google.protobuf.Value"){this.assert(d.oneof===void 0,d.name+" (oneof member)",null);continue}m[p]=d.T().internalJsonRead(u,r,m[p]);break;case"enum":if(u===null)continue;let g=this.enum(d.T(),u,d.name,r.ignoreUnknownFields);if(g===!1)continue;m[p]=g;break;case"scalar":if(u===null)continue;m[p]=this.scalar(u,d.T,d.L,d.name);break}}}enum(t,s,r,i){if(t[0]=="google.protobuf.NullValue"&&et(s===null||s==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${r}, enum ${t[0]} only accepts null.`),s===null)return 0;switch(typeof s){case"number":return et(Number.isInteger(s),`Unable to parse field ${this.info.typeName}#${r}, enum can only be integral number, got ${s}.`),s;case"string":let c=s;t[2]&&s.substring(0,t[2].length)===t[2]&&(c=s.substring(t[2].length));let u=t[1][c];return typeof u>"u"&&i?!1:(et(typeof u=="number",`Unable to parse field ${this.info.typeName}#${r}, enum ${t[0]} has no value for "${s}".`),u)}et(!1,`Unable to parse field ${this.info.typeName}#${r}, cannot parse enum value from ${typeof s}".`)}scalar(t,s,r,i){let c;try{switch(s){case ve.DOUBLE:case ve.FLOAT:if(t===null)return 0;if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""){c="empty string";break}if(typeof t=="string"&&t.trim().length!==t.length){c="extra whitespace";break}if(typeof t!="string"&&typeof t!="number")break;let u=Number(t);if(Number.isNaN(u)){c="not a number";break}if(!Number.isFinite(u)){c="too large or small";break}return s==ve.FLOAT&&cb(u),u;case ve.INT32:case ve.FIXED32:case ve.SFIXED32:case ve.SINT32:case ve.UINT32:if(t===null)return 0;let d;if(typeof t=="number"?d=t:t===""?c="empty string":typeof t=="string"&&(t.trim().length!==t.length?c="extra whitespace":d=Number(t)),d===void 0)break;return s==ve.UINT32?Yh(d):Mu(d),d;case ve.INT64:case ve.SFIXED64:case ve.SINT64:if(t===null)return er(Ot.ZERO,r);if(typeof t!="number"&&typeof t!="string")break;return er(Ot.from(t),r);case ve.FIXED64:case ve.UINT64:if(t===null)return er(Bn.ZERO,r);if(typeof t!="number"&&typeof t!="string")break;return er(Bn.from(t),r);case ve.BOOL:if(t===null)return!1;if(typeof t!="boolean")break;return t;case ve.STRING:if(t===null)return"";if(typeof t!="string"){c="extra whitespace";break}try{encodeURIComponent(t)}catch(p){p="invalid UTF8";break}return t;case ve.BYTES:if(t===null||t==="")return new Uint8Array(0);if(typeof t!="string")break;return aA(t)}}catch(u){c=u.message}this.assert(!1,i+(c?" - "+c:""),t)}}class e8{constructor(t){var s;this.fields=(s=t.fields)!==null&&s!==void 0?s:[]}write(t,s){const r={},i=t;for(const c of this.fields){if(!c.oneof){let m=this.field(c,i[c.localName],s);m!==void 0&&(r[s.useProtoFieldName?c.name:c.jsonName]=m);continue}const u=i[c.oneof];if(u.oneofKind!==c.localName)continue;const d=c.kind=="scalar"||c.kind=="enum"?Object.assign(Object.assign({},s),{emitDefaultValues:!0}):s;let p=this.field(c,u[c.localName],d);et(p!==void 0),r[s.useProtoFieldName?c.name:c.jsonName]=p}return r}field(t,s,r){let i;if(t.kind=="map"){et(typeof s=="object"&&s!==null);const c={};switch(t.V.kind){case"scalar":for(const[p,m]of Object.entries(s)){const g=this.scalar(t.V.T,m,t.name,!1,!0);et(g!==void 0),c[p.toString()]=g}break;case"message":const u=t.V.T();for(const[p,m]of Object.entries(s)){const g=this.message(u,m,t.name,r);et(g!==void 0),c[p.toString()]=g}break;case"enum":const d=t.V.T();for(const[p,m]of Object.entries(s)){et(m===void 0||typeof m=="number");const g=this.enum(d,m,t.name,!1,!0,r.enumAsInteger);et(g!==void 0),c[p.toString()]=g}break}(r.emitDefaultValues||Object.keys(c).length>0)&&(i=c)}else if(t.repeat){et(Array.isArray(s));const c=[];switch(t.kind){case"scalar":for(let p=0;p<s.length;p++){const m=this.scalar(t.T,s[p],t.name,t.opt,!0);et(m!==void 0),c.push(m)}break;case"enum":const u=t.T();for(let p=0;p<s.length;p++){et(s[p]===void 0||typeof s[p]=="number");const m=this.enum(u,s[p],t.name,t.opt,!0,r.enumAsInteger);et(m!==void 0),c.push(m)}break;case"message":const d=t.T();for(let p=0;p<s.length;p++){const m=this.message(d,s[p],t.name,r);et(m!==void 0),c.push(m)}break}(r.emitDefaultValues||c.length>0||r.emitDefaultValues)&&(i=c)}else switch(t.kind){case"scalar":i=this.scalar(t.T,s,t.name,t.opt,r.emitDefaultValues);break;case"enum":i=this.enum(t.T(),s,t.name,t.opt,r.emitDefaultValues,r.enumAsInteger);break;case"message":i=this.message(t.T(),s,t.name,r);break}return i}enum(t,s,r,i,c,u){if(t[0]=="google.protobuf.NullValue")return!c&&!i?void 0:null;if(s===void 0){et(i);return}if(!(s===0&&!c&&!i))return et(typeof s=="number"),et(Number.isInteger(s)),u||!t[1].hasOwnProperty(s)?s:t[2]?t[2]+t[1][s]:t[1][s]}message(t,s,r,i){return s===void 0?i.emitDefaultValues?null:void 0:t.internalJsonWrite(s,i)}scalar(t,s,r,i,c){if(s===void 0){et(i);return}const u=c||i;switch(t){case ve.INT32:case ve.SFIXED32:case ve.SINT32:return s===0?u?0:void 0:(Mu(s),s);case ve.FIXED32:case ve.UINT32:return s===0?u?0:void 0:(Yh(s),s);case ve.FLOAT:cb(s);case ve.DOUBLE:return s===0?u?0:void 0:(et(typeof s=="number"),Number.isNaN(s)?"NaN":s===Number.POSITIVE_INFINITY?"Infinity":s===Number.NEGATIVE_INFINITY?"-Infinity":s);case ve.STRING:return s===""?u?"":void 0:(et(typeof s=="string"),s);case ve.BOOL:return s===!1?u?!1:void 0:(et(typeof s=="boolean"),s);case ve.UINT64:case ve.FIXED64:et(typeof s=="number"||typeof s=="string"||typeof s=="bigint");let d=Bn.from(s);return d.isZero()&&!u?void 0:d.toString();case ve.INT64:case ve.SFIXED64:case ve.SINT64:et(typeof s=="number"||typeof s=="string"||typeof s=="bigint");let p=Ot.from(s);return p.isZero()&&!u?void 0:p.toString();case ve.BYTES:return et(s instanceof Uint8Array),s.byteLength?iA(s):u?"":void 0}}}function ev(e,t=Er.STRING){switch(e){case ve.BOOL:return!1;case ve.UINT64:case ve.FIXED64:return er(Bn.ZERO,t);case ve.INT64:case ve.SFIXED64:case ve.SINT64:return er(Ot.ZERO,t);case ve.DOUBLE:case ve.FLOAT:return 0;case ve.BYTES:return new Uint8Array(0);case ve.STRING:return"";default:return 0}}class t8{constructor(t){this.info=t}prepare(){var t;if(!this.fieldNoToField){const s=(t=this.info.fields)!==null&&t!==void 0?t:[];this.fieldNoToField=new Map(s.map(r=>[r.no,r]))}}read(t,s,r,i){this.prepare();const c=i===void 0?t.len:t.pos+i;for(;t.pos<c;){const[u,d]=t.tag(),p=this.fieldNoToField.get(u);if(!p){let b=r.readUnknownField;if(b=="throw")throw new Error(`Unknown field ${u} (wire type ${d}) for ${this.info.typeName}`);let E=t.skip(d);b!==!1&&(b===!0?qh.onRead:b)(this.info.typeName,s,u,d,E);continue}let m=s,g=p.repeat,y=p.localName;switch(p.oneof&&(m=m[p.oneof],m.oneofKind!==y&&(m=s[p.oneof]={oneofKind:y})),p.kind){case"scalar":case"enum":let b=p.kind=="enum"?ve.INT32:p.T,E=p.kind=="scalar"?p.L:void 0;if(g){let R=m[y];if(d==Wt.LengthDelimited&&b!=ve.STRING&&b!=ve.BYTES){let $=t.uint32()+t.pos;for(;t.pos<$;)R.push(this.scalar(t,b,E))}else R.push(this.scalar(t,b,E))}else m[y]=this.scalar(t,b,E);break;case"message":if(g){let R=m[y],$=p.T().internalBinaryRead(t,t.uint32(),r);R.push($)}else m[y]=p.T().internalBinaryRead(t,t.uint32(),r,m[y]);break;case"map":let[O,C]=this.mapEntry(p,t,r);m[y][O]=C;break}}}mapEntry(t,s,r){let i=s.uint32(),c=s.pos+i,u,d;for(;s.pos<c;){let[p,m]=s.tag();switch(p){case 1:t.K==ve.BOOL?u=s.bool().toString():u=this.scalar(s,t.K,Er.STRING);break;case 2:switch(t.V.kind){case"scalar":d=this.scalar(s,t.V.T,t.V.L);break;case"enum":d=s.int32();break;case"message":d=t.V.T().internalBinaryRead(s,s.uint32(),r);break}break;default:throw new Error(`Unknown field ${p} (wire type ${m}) in map entry for ${this.info.typeName}#${t.name}`)}}if(u===void 0){let p=ev(t.K);u=t.K==ve.BOOL?p.toString():p}if(d===void 0)switch(t.V.kind){case"scalar":d=ev(t.V.T,t.V.L);break;case"enum":d=0;break;case"message":d=t.V.T().create();break}return[u,d]}scalar(t,s,r){switch(s){case ve.INT32:return t.int32();case ve.STRING:return t.string();case ve.BOOL:return t.bool();case ve.DOUBLE:return t.double();case ve.FLOAT:return t.float();case ve.INT64:return er(t.int64(),r);case ve.UINT64:return er(t.uint64(),r);case ve.FIXED64:return er(t.fixed64(),r);case ve.FIXED32:return t.fixed32();case ve.BYTES:return t.bytes();case ve.UINT32:return t.uint32();case ve.SFIXED32:return t.sfixed32();case ve.SFIXED64:return er(t.sfixed64(),r);case ve.SINT32:return t.sint32();case ve.SINT64:return er(t.sint64(),r)}}}class n8{constructor(t){this.info=t}prepare(){if(!this.fields){const t=this.info.fields?this.info.fields.concat():[];this.fields=t.sort((s,r)=>s.no-r.no)}}write(t,s,r){this.prepare();for(const c of this.fields){let u,d,p=c.repeat,m=c.localName;if(c.oneof){const g=t[c.oneof];if(g.oneofKind!==m)continue;u=g[m],d=!0}else u=t[m],d=!1;switch(c.kind){case"scalar":case"enum":let g=c.kind=="enum"?ve.INT32:c.T;if(p)if(et(Array.isArray(u)),p==Xh.PACKED)this.packed(s,g,c.no,u);else for(const y of u)this.scalar(s,g,c.no,y,!0);else u===void 0?et(c.opt):this.scalar(s,g,c.no,u,d||c.opt);break;case"message":if(p){et(Array.isArray(u));for(const y of u)this.message(s,r,c.T(),c.no,y)}else this.message(s,r,c.T(),c.no,u);break;case"map":et(typeof u=="object"&&u!==null);for(const[y,b]of Object.entries(u))this.mapEntry(s,r,c,y,b);break}}let i=r.writeUnknownFields;i!==!1&&(i===!0?qh.onWrite:i)(this.info.typeName,t,s)}mapEntry(t,s,r,i,c){t.tag(r.no,Wt.LengthDelimited),t.fork();let u=i;switch(r.K){case ve.INT32:case ve.FIXED32:case ve.UINT32:case ve.SFIXED32:case ve.SINT32:u=Number.parseInt(i);break;case ve.BOOL:et(i=="true"||i=="false"),u=i=="true";break}switch(this.scalar(t,r.K,1,u,!0),r.V.kind){case"scalar":this.scalar(t,r.V.T,2,c,!0);break;case"enum":this.scalar(t,ve.INT32,2,c,!0);break;case"message":this.message(t,s,r.V.T(),2,c);break}t.join()}message(t,s,r,i,c){c!==void 0&&(r.internalBinaryWrite(c,t.tag(i,Wt.LengthDelimited).fork(),s),t.join())}scalar(t,s,r,i,c){let[u,d,p]=this.scalarInfo(s,i);(!p||c)&&(t.tag(r,u),t[d](i))}packed(t,s,r,i){if(!i.length)return;et(s!==ve.BYTES&&s!==ve.STRING),t.tag(r,Wt.LengthDelimited),t.fork();let[,c]=this.scalarInfo(s);for(let u=0;u<i.length;u++)t[c](i[u]);t.join()}scalarInfo(t,s){let r=Wt.Varint,i,c=s===void 0,u=s===0;switch(t){case ve.INT32:i="int32";break;case ve.STRING:u=c||!s.length,r=Wt.LengthDelimited,i="string";break;case ve.BOOL:u=s===!1,i="bool";break;case ve.UINT32:i="uint32";break;case ve.DOUBLE:r=Wt.Bit64,i="double";break;case ve.FLOAT:r=Wt.Bit32,i="float";break;case ve.INT64:u=c||Ot.from(s).isZero(),i="int64";break;case ve.UINT64:u=c||Bn.from(s).isZero(),i="uint64";break;case ve.FIXED64:u=c||Bn.from(s).isZero(),r=Wt.Bit64,i="fixed64";break;case ve.BYTES:u=c||!s.byteLength,r=Wt.LengthDelimited,i="bytes";break;case ve.FIXED32:r=Wt.Bit32,i="fixed32";break;case ve.SFIXED32:r=Wt.Bit32,i="sfixed32";break;case ve.SFIXED64:u=c||Ot.from(s).isZero(),r=Wt.Bit64,i="sfixed64";break;case ve.SINT32:i="sint32";break;case ve.SINT64:u=c||Ot.from(s).isZero(),i="sint64";break}return[r,i,c||u]}}function s8(e){const t=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},fA,{value:e});for(let s of e.fields){let r=s.localName;if(!s.opt)if(s.oneof)t[s.oneof]={oneofKind:void 0};else if(s.repeat)t[r]=[];else switch(s.kind){case"scalar":t[r]=ev(s.T,s.L);break;case"enum":t[r]=0;break;case"map":t[r]={};break}}return t}function Y0(e,t,s){let r,i=s,c;for(let u of e.fields){let d=u.localName;if(u.oneof){const p=i[u.oneof];if(p?.oneofKind==null)continue;if(r=p[d],c=t[u.oneof],c.oneofKind=p.oneofKind,r==null){delete c[d];continue}}else if(r=i[d],c=t,r==null)continue;switch(u.repeat&&(c[d].length=r.length),u.kind){case"scalar":case"enum":if(u.repeat)for(let m=0;m<r.length;m++)c[d][m]=r[m];else c[d]=r;break;case"message":let p=u.T();if(u.repeat)for(let m=0;m<r.length;m++)c[d][m]=p.create(r[m]);else c[d]===void 0?c[d]=p.create(r):p.mergePartial(c[d],r);break;case"map":switch(u.V.kind){case"scalar":case"enum":Object.assign(c[d],r);break;case"message":let m=u.V.T();for(let g of Object.keys(r))c[d][g]=m.create(r[g]);break}break}}}function r8(e,t,s){if(t===s)return!0;if(!t||!s)return!1;for(let r of e.fields){let i=r.localName,c=r.oneof?t[r.oneof][i]:t[i],u=r.oneof?s[r.oneof][i]:s[i];switch(r.kind){case"enum":case"scalar":let d=r.kind=="enum"?ve.INT32:r.T;if(!(r.repeat?AE(d,c,u):hA(d,c,u)))return!1;break;case"map":if(!(r.V.kind=="message"?OE(r.V.T(),Yf(c),Yf(u)):AE(r.V.kind=="enum"?ve.INT32:r.V.T,Yf(c),Yf(u))))return!1;break;case"message":let p=r.T();if(!(r.repeat?OE(p,c,u):p.equals(c,u)))return!1;break}}return!0}const Yf=Object.values;function hA(e,t,s){if(t===s)return!0;if(e!==ve.BYTES)return!1;let r=t,i=s;if(r.length!==i.length)return!1;for(let c=0;c<r.length;c++)if(r[c]!=i[c])return!1;return!0}function AE(e,t,s){if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(!hA(e,t[r],s[r]))return!1;return!0}function OE(e,t,s){if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(!e.equals(t[r],s[r]))return!1;return!0}const pA=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),a8=pA[fA]={};class Y{constructor(t,s,r){this.defaultCheckDepth=16,this.typeName=t,this.fields=s.map(Xj),this.options=r??{},a8.value=this,this.messagePrototype=Object.create(null,pA),this.refTypeCheck=new Jj(this),this.refJsonReader=new Qj(this),this.refJsonWriter=new e8(this),this.refBinReader=new t8(this),this.refBinWriter=new n8(this)}create(t){let s=s8(this);return t!==void 0&&Y0(this,s,t),s}clone(t){let s=this.create();return Y0(this,s,t),s}equals(t,s){return r8(this,t,s)}is(t,s=this.defaultCheckDepth){return this.refTypeCheck.is(t,s,!1)}isAssignable(t,s=this.defaultCheckDepth){return this.refTypeCheck.is(t,s,!0)}mergePartial(t,s){Y0(this,t,s)}fromBinary(t,s){let r=Lj(s);return this.internalBinaryRead(r.readerFactory(t),t.byteLength,r)}fromJson(t,s){return this.internalJsonRead(t,Yj(s))}fromJsonString(t,s){let r=JSON.parse(t);return this.fromJson(r,s)}toJson(t,s){return this.internalJsonWrite(t,dA(s))}toJsonString(t,s){var r;let i=this.toJson(t,s);return JSON.stringify(i,null,(r=s?.prettySpaces)!==null&&r!==void 0?r:0)}toBinary(t,s){let r=qj(s);return this.internalBinaryWrite(t,r.writerFactory(),r).finish()}internalJsonRead(t,s,r){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let i=r??this.create();return this.refJsonReader.read(t,i,s),i}throw new Error(`Unable to parse message ${this.typeName} from JSON ${ga(t)}.`)}internalJsonWrite(t,s){return this.refJsonWriter.write(t,s)}internalBinaryWrite(t,s,r){return this.refBinWriter.write(t,s,r),s}internalBinaryRead(t,s,r,i){let c=i??this.create();return this.refBinReader.read(t,c,r,s),c}}function i8(e,t){var s,r,i;let c=e;return c.service=t,c.localName=(s=c.localName)!==null&&s!==void 0?s:Wh(c.name),c.serverStreaming=!!c.serverStreaming,c.clientStreaming=!!c.clientStreaming,c.options=(r=c.options)!==null&&r!==void 0?r:{},c.idempotency=(i=c.idempotency)!==null&&i!==void 0?i:void 0,c}class vi{constructor(t,s,r){this.typeName=t,this.methods=s.map(i=>i8(i,this)),this.options=r??{}}}class gt extends Error{constructor(t,s="UNKNOWN",r){super(t),this.name="RpcError",Object.setPrototypeOf(this,new.target.prototype),this.code=s,this.meta=r??{}}toString(){const t=[this.name+": "+this.message];this.code&&(t.push(""),t.push("Code: "+this.code)),this.serviceName&&this.methodName&&t.push("Method: "+this.serviceName+"/"+this.methodName);let s=Object.entries(this.meta);if(s.length){t.push(""),t.push("Meta:");for(let[r,i]of s)t.push(` ${r}: ${i}`)}return t.join(`
|
|
11
11
|
`)}}function o8(e,t){if(!t)return e;let s={};Wf(e,s),Wf(t,s);for(let r of Object.keys(t)){let i=t[r];switch(r){case"jsonOptions":s.jsonOptions=Wj(e.jsonOptions,s.jsonOptions);break;case"binaryOptions":s.binaryOptions=Mj(e.binaryOptions,s.binaryOptions);break;case"meta":s.meta={},Wf(e.meta,s.meta),Wf(t.meta,s.meta);break;case"interceptors":s.interceptors=e.interceptors?e.interceptors.concat(i):i.concat();break}}return s}function Wf(e,t){if(!e)return;let s=t;for(let[r,i]of Object.entries(e))i instanceof Date?s[r]=new Date(i.getTime()):Array.isArray(i)?s[r]=i.concat():s[r]=i}var Ls;(function(e){e[e.PENDING=0]="PENDING",e[e.REJECTED=1]="REJECTED",e[e.RESOLVED=2]="RESOLVED"})(Ls||(Ls={}));class ei{constructor(t=!0){this._state=Ls.PENDING,this._promise=new Promise((s,r)=>{this._resolve=s,this._reject=r}),t&&this._promise.catch(s=>{})}get state(){return this._state}get promise(){return this._promise}resolve(t){if(this.state!==Ls.PENDING)throw new Error(`cannot resolve ${Ls[this.state].toLowerCase()}`);this._resolve(t),this._state=Ls.RESOLVED}reject(t){if(this.state!==Ls.PENDING)throw new Error(`cannot reject ${Ls[this.state].toLowerCase()}`);this._reject(t),this._state=Ls.REJECTED}resolvePending(t){this._state===Ls.PENDING&&this.resolve(t)}rejectPending(t){this._state===Ls.PENDING&&this.reject(t)}}class c8{constructor(){this._lis={nxt:[],msg:[],err:[],cmp:[]},this._closed=!1,this._itState={q:[]}}onNext(t){return this.addLis(t,this._lis.nxt)}onMessage(t){return this.addLis(t,this._lis.msg)}onError(t){return this.addLis(t,this._lis.err)}onComplete(t){return this.addLis(t,this._lis.cmp)}addLis(t,s){return s.push(t),()=>{let r=s.indexOf(t);r>=0&&s.splice(r,1)}}clearLis(){for(let t of Object.values(this._lis))t.splice(0,t.length)}get closed(){return this._closed!==!1}notifyNext(t,s,r){et((t?1:0)+(s?1:0)+(r?1:0)<=1,"only one emission at a time"),t&&this.notifyMessage(t),s&&this.notifyError(s),r&&this.notifyComplete()}notifyMessage(t){et(!this.closed,"stream is closed"),this.pushIt({value:t,done:!1}),this._lis.msg.forEach(s=>s(t)),this._lis.nxt.forEach(s=>s(t,void 0,!1))}notifyError(t){et(!this.closed,"stream is closed"),this._closed=t,this.pushIt(t),this._lis.err.forEach(s=>s(t)),this._lis.nxt.forEach(s=>s(void 0,t,!1)),this.clearLis()}notifyComplete(){et(!this.closed,"stream is closed"),this._closed=!0,this.pushIt({value:null,done:!0}),this._lis.cmp.forEach(t=>t()),this._lis.nxt.forEach(t=>t(void 0,void 0,!0)),this.clearLis()}[Symbol.asyncIterator](){return this._closed===!0?this.pushIt({value:null,done:!0}):this._closed!==!1&&this.pushIt(this._closed),{next:()=>{let t=this._itState;et(t,"bad state"),et(!t.p,"iterator contract broken");let s=t.q.shift();return s?"value"in s?Promise.resolve(s):Promise.reject(s):(t.p=new ei,t.p.promise)}}}pushIt(t){let s=this._itState;if(s.p){const r=s.p;et(r.state==Ls.PENDING,"iterator contract broken"),"value"in t?r.resolve(t):r.reject(t),delete s.p}else s.q.push(t)}}var l8=function(e,t,s,r){function i(c){return c instanceof s?c:new s(function(u){u(c)})}return new(s||(s=Promise))(function(c,u){function d(g){try{m(r.next(g))}catch(y){u(y)}}function p(g){try{m(r.throw(g))}catch(y){u(y)}}function m(g){g.done?c(g.value):i(g.value).then(d,p)}m((r=r.apply(e,t||[])).next())})};class mA{constructor(t,s,r,i,c,u,d){this.method=t,this.requestHeaders=s,this.request=r,this.headers=i,this.response=c,this.status=u,this.trailers=d}then(t,s){return this.promiseFinished().then(r=>t?Promise.resolve(t(r)):r,r=>s?Promise.resolve(s(r)):Promise.reject(r))}promiseFinished(){return l8(this,void 0,void 0,function*(){let[t,s,r,i]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:t,response:s,status:r,trailers:i}})}}var u8=function(e,t,s,r){function i(c){return c instanceof s?c:new s(function(u){u(c)})}return new(s||(s=Promise))(function(c,u){function d(g){try{m(r.next(g))}catch(y){u(y)}}function p(g){try{m(r.throw(g))}catch(y){u(y)}}function m(g){g.done?c(g.value):i(g.value).then(d,p)}m((r=r.apply(e,t||[])).next())})};class d8{constructor(t,s,r,i,c,u,d){this.method=t,this.requestHeaders=s,this.request=r,this.headers=i,this.responses=c,this.status=u,this.trailers=d}then(t,s){return this.promiseFinished().then(r=>t?Promise.resolve(t(r)):r,r=>s?Promise.resolve(s(r)):Promise.reject(r))}promiseFinished(){return u8(this,void 0,void 0,function*(){let[t,s,r]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:t,status:s,trailers:r}})}}function yt(e,t,s,r,i){var c,u,d,p;if(e=="unary"){let m=(g,y,b)=>t.unary(g,y,b);for(const g of((c=r.interceptors)!==null&&c!==void 0?c:[]).filter(y=>y.interceptUnary).reverse()){const y=m;m=(b,E,O)=>g.interceptUnary(y,b,E,O)}return m(s,i,r)}if(e=="serverStreaming"){let m=(g,y,b)=>t.serverStreaming(g,y,b);for(const g of((u=r.interceptors)!==null&&u!==void 0?u:[]).filter(y=>y.interceptServerStreaming).reverse()){const y=m;m=(b,E,O)=>g.interceptServerStreaming(y,b,E,O)}return m(s,i,r)}if(e=="clientStreaming"){let m=(g,y)=>t.clientStreaming(g,y);for(const g of((d=r.interceptors)!==null&&d!==void 0?d:[]).filter(y=>y.interceptClientStreaming).reverse()){const y=m;m=(b,E)=>g.interceptClientStreaming(y,b,E)}return m(s,r)}if(e=="duplex"){let m=(g,y)=>t.duplex(g,y);for(const g of((p=r.interceptors)!==null&&p!==void 0?p:[]).filter(y=>y.interceptDuplex).reverse()){const y=m;m=(b,E)=>g.interceptDuplex(y,b,E)}return m(s,r)}$j(e)}var we;(function(e){e[e.OK=0]="OK",e[e.CANCELLED=1]="CANCELLED",e[e.UNKNOWN=2]="UNKNOWN",e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.ALREADY_EXISTS=6]="ALREADY_EXISTS",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",e[e.ABORTED=10]="ABORTED",e[e.OUT_OF_RANGE=11]="OUT_OF_RANGE",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.DATA_LOSS=15]="DATA_LOSS"})(we||(we={}));var f8=function(e,t,s,r){function i(c){return c instanceof s?c:new s(function(u){u(c)})}return new(s||(s=Promise))(function(c,u){function d(g){try{m(r.next(g))}catch(y){u(y)}}function p(g){try{m(r.throw(g))}catch(y){u(y)}}function m(g){g.done?c(g.value):i(g.value).then(d,p)}m((r=r.apply(e,t||[])).next())})};function NE(e,t,s,r,i){if(r)for(let[c,u]of Object.entries(r))if(typeof u=="string")e.append(c,u);else for(let d of u)e.append(c,d);if(e.set("Content-Type",t==="text"?"application/grpc-web-text":"application/grpc-web+proto"),t=="text"&&e.set("Accept","application/grpc-web-text"),e.set("X-Grpc-Web","1"),typeof s=="number"){if(s<=0)throw new gt(`timeout ${s} ms exceeded`,we[we.DEADLINE_EXCEEDED]);e.set("grpc-timeout",`${s}m`)}else if(s){const c=s.getTime(),u=Date.now();if(c<=u)throw new gt(`deadline ${s} exceeded`,we[we.DEADLINE_EXCEEDED]);e.set("grpc-timeout",`${c-u}m`)}return e}function xE(e,t){let s=new Uint8Array(5+e.length);s[0]=nr.DATA;for(let r=e.length,i=4;i>0;i--)s[i]=r%256,r>>>=8;return s.set(e,5),t==="binary"?s:iA(s)}function tv(e,t,s){if(arguments.length===1){let p=e,m;try{m=p.type}catch{}switch(m){case"error":case"opaque":case"opaqueredirect":throw new gt(`fetch response type ${p.type}`,we[we.UNKNOWN])}return tv(g8(p.headers),p.status,p.statusText)}let r=e,i=t>=200&&t<300,c=yA(r),[u,d]=gA(r);return(u===void 0||u===we.OK)&&!i&&(u=y8(t),d=s),[u,d,c]}function CE(e){let t=m8(e),[s,r]=gA(t),i=yA(t);return[s??we.OK,r,i]}var nr;(function(e){e[e.DATA=0]="DATA",e[e.TRAILER=128]="TRAILER"})(nr||(nr={}));function IE(e,t,s){return f8(this,void 0,void 0,function*(){let r,i="",c=new Uint8Array(0),u=p8(t);if(h8(e)){let d=e.getReader();r={next:()=>d.read()}}else r=e[Symbol.asyncIterator]();for(;;){let d=yield r.next();if(d.value!==void 0){if(u==="text"){for(let m=0;m<d.value.length;m++)i+=String.fromCharCode(d.value[m]);let p=i.length-i.length%4;if(p===0)continue;c=RE(c,aA(i.substring(0,p))),i=i.substring(p)}else c=RE(c,d.value);for(;c.length>=5&&c[0]===nr.DATA;){let p=0;for(let m=1;m<5;m++)p=(p<<8)+c[m];if(c.length-5>=p)s(nr.DATA,c.subarray(5,5+p)),c=c.subarray(5+p);else break}}if(d.done){if(c.length===0)break;if(c[0]!==nr.TRAILER||c.length<5)throw new gt("premature EOF",we[we.DATA_LOSS]);s(nr.TRAILER,c.subarray(5));break}}})}const h8=e=>typeof e.getReader=="function";function RE(e,t){let s=new Uint8Array(e.length+t.length);return s.set(e),s.set(t,e.length),s}function p8(e){switch(e){case"application/grpc-web-text":case"application/grpc-web-text+proto":return"text";case"application/grpc-web":case"application/grpc-web+proto":return"binary";case void 0:case null:throw new gt("missing response content type",we[we.INTERNAL]);default:throw new gt("unexpected response content type: "+e,we[we.INTERNAL])}}function gA(e){let t,s,r=e["grpc-message"];if(r!==void 0){if(Array.isArray(r))return[we.INTERNAL,"invalid grpc-web message"];s=r}let i=e["grpc-status"];if(i!==void 0){if(Array.isArray(i))return[we.INTERNAL,"invalid grpc-web status"];if(t=parseInt(i,10),we[t]===void 0)return[we.INTERNAL,"invalid grpc-web status"]}return[t,s]}function yA(e){let t={};for(let[s,r]of Object.entries(e))switch(s){case"grpc-message":case"grpc-status":case"content-type":break;default:t[s]=r}return t}function m8(e){let t={};for(let s of String.fromCharCode.apply(String,e).trim().split(`\r
|
|
12
|
-
`)){if(s=="")continue;let[r,...i]=s.split(":");const c=i.join(":").trim();r=r.trim();let u=t[r];typeof u=="string"?t[r]=[u,c]:Array.isArray(u)?u.push(c):t[r]=c}return t}function g8(e){let t={};return e.forEach((s,r)=>{let i=t[r];typeof i=="string"?t[r]=[i,s]:Array.isArray(i)?i.push(s):t[r]=s}),t}function y8(e){switch(e){case 200:return we.OK;case 400:return we.INVALID_ARGUMENT;case 401:return we.UNAUTHENTICATED;case 403:return we.PERMISSION_DENIED;case 404:return we.NOT_FOUND;case 409:return we.ABORTED;case 412:return we.FAILED_PRECONDITION;case 429:return we.RESOURCE_EXHAUSTED;case 499:return we.CANCELLED;case 500:return we.UNKNOWN;case 501:return we.UNIMPLEMENTED;case 503:return we.UNAVAILABLE;case 504:return we.DEADLINE_EXCEEDED;default:return we.UNKNOWN}}class v8{constructor(t){this.defaultOptions=t}mergeOptions(t){return o8(this.defaultOptions,t)}makeUrl(t,s){let r=s.baseUrl;return r.endsWith("/")&&(r=r.substring(0,r.length-1)),`${r}/${t.service.typeName}/${t.name}`}clientStreaming(t){const s=new gt("Client streaming is not supported by grpc-web",we[we.UNIMPLEMENTED]);throw s.methodName=t.name,s.serviceName=t.service.typeName,s}duplex(t){const s=new gt("Duplex streaming is not supported by grpc-web",we[we.UNIMPLEMENTED]);throw s.methodName=t.name,s.serviceName=t.service.typeName,s}serverStreaming(t,s,r){var i,c,u,d,p;let m=r,g=(i=m.format)!==null&&i!==void 0?i:"text",y=(c=m.fetch)!==null&&c!==void 0?c:globalThis.fetch,b=(u=m.fetchInit)!==null&&u!==void 0?u:{},E=this.makeUrl(t,m),O=t.I.toBinary(s,m.binaryOptions),C=new ei,R=new c8,$=!0,x,W=new ei,oe,me=new ei;return y(E,Object.assign(Object.assign({},b),{method:"POST",headers:NE(new globalThis.Headers,g,m.timeout,m.meta),body:xE(O,g),signal:(d=r.abort)!==null&&d!==void 0?d:null})).then(G=>{let[J,w,A]=tv(G);if(C.resolve(A),J!=null&&J!==we.OK)throw new gt(w??we[J],we[J],A);return J!=null&&(x={code:we[J],detail:w??we[J]}),G}).then(G=>{if(!G.body)throw new gt("missing response body",we[we.INTERNAL]);return IE(G.body,G.headers.get("content-type"),(J,w)=>{switch(J){case nr.DATA:R.notifyMessage(t.O.fromBinary(w,m.binaryOptions)),$=!1;break;case nr.TRAILER:let A,N;[A,N,oe]=CE(w),x={code:we[A],detail:N??we[A]};break}})}).then(()=>{if(!oe&&!$)throw new gt("missing trailers",we[we.DATA_LOSS]);if(!x)throw new gt("missing status",we[we.INTERNAL]);if(x.code!=="OK")throw new gt(x.detail,x.code,oe);R.notifyComplete(),W.resolve(x),me.resolve(oe||{})}).catch(G=>{let J;G instanceof gt?J=G:G instanceof Error&&G.name==="AbortError"?J=new gt(G.message,we[we.CANCELLED]):J=new gt(G instanceof Error?G.message:""+G,we[we.INTERNAL]),J.methodName=t.name,J.serviceName=t.service.typeName,C.rejectPending(J),R.notifyError(J),W.rejectPending(J),me.rejectPending(J)}),new d8(t,(p=m.meta)!==null&&p!==void 0?p:{},s,C.promise,R,W.promise,me.promise)}unary(t,s,r){var i,c,u,d,p;let m=r,g=(i=m.format)!==null&&i!==void 0?i:"text",y=(c=m.fetch)!==null&&c!==void 0?c:globalThis.fetch,b=(u=m.fetchInit)!==null&&u!==void 0?u:{},E=this.makeUrl(t,m),O=t.I.toBinary(s,m.binaryOptions),C=new ei,R,$=new ei,x,W=new ei,oe,me=new ei;return y(E,Object.assign(Object.assign({},b),{method:"POST",headers:NE(new globalThis.Headers,g,m.timeout,m.meta),body:xE(O,g),signal:(d=r.abort)!==null&&d!==void 0?d:null})).then(G=>{let[J,w,A]=tv(G);if(C.resolve(A),J!=null&&J!==we.OK)throw new gt(w??we[J],we[J],A);return J!=null&&(x={code:we[J],detail:w??we[J]}),G}).then(G=>{if(!G.body)throw new gt("missing response body",we[we.INTERNAL]);return IE(G.body,G.headers.get("content-type"),(J,w)=>{switch(J){case nr.DATA:if(R)throw new gt("unary call received 2nd message",we[we.DATA_LOSS]);R=t.O.fromBinary(w,m.binaryOptions);break;case nr.TRAILER:let A,N;[A,N,oe]=CE(w),x={code:we[A],detail:N??we[A]};break}})}).then(()=>{if(!oe&&R)throw new gt("missing trailers",we[we.DATA_LOSS]);if(!x)throw new gt("missing status",we[we.INTERNAL]);if(!R&&x.code==="OK")throw new gt("expected error status",we[we.DATA_LOSS]);if(!R)throw new gt(x.detail,x.code,oe);if($.resolve(R),x.code!=="OK")throw new gt(x.detail,x.code,oe);W.resolve(x),me.resolve(oe||{})}).catch(G=>{let J;G instanceof gt?J=G:G instanceof Error&&G.name==="AbortError"?J=new gt(G.message,we[we.CANCELLED]):J=new gt(G instanceof Error?G.message:""+G,we[we.INTERNAL]),J.methodName=t.name,J.serviceName=t.service.typeName,C.rejectPending(J),$.rejectPending(J),W.rejectPending(J),me.rejectPending(J)}),new mA(t,(p=m.meta)!==null&&p!==void 0?p:{},s,C.promise,$.promise,W.promise,me.promise)}}const nv=Symbol.for("@mysten/sui/grpc/decoded-status-message");function b8(e){if(!e.includes("%"))return e;try{return decodeURIComponent(e)}catch{return e}}function vA(e){return nv in e?!1:(Object.defineProperty(e,nv,{value:!0,configurable:!0}),!0)}function jE(e){vA(e)&&(e.message=b8(e.message))}function w8(e){return nv in e}function sv(e,t){if(!(typeof e!="object"||e===null))try{return e[t]}catch{return}}function T8(e){const t=sv(e,"code");return typeof t=="string"&&typeof we[t]=="number"?t:sv(e,"name")==="TimeoutError"?we[we.DEADLINE_EXCEEDED]:we[we.CANCELLED]}function S8(e,t){if(typeof t=="string")return e===t;const s=sv(t,"message");return typeof s=="string"&&e===s}function bA(e,t){try{E8(e,t)}catch{}}function E8(e,t){if(e instanceof gt){if(t?.aborted&&(e.code===we[we.INTERNAL]||e.code===we[we.CANCELLED])){e.code=T8(t.reason),S8(e.message,t.reason)?vA(e):jE(e);return}jE(e)}}function ME(e,t){for(const s of e)s.then(void 0,r=>bA(r,t))}var lb=class extends v8{constructor(e){super({...e,meta:{[sA]:String(rA),...e.meta}})}unary(e,t,s){const r=super.unary(e,t,s);return ME([r.headers,r.response,r.status,r.trailers],s.abort),r}serverStreaming(e,t,s){const r=super.serverStreaming(e,t,s);return r.responses.onError(i=>bA(i,s.abort)),ME([r.headers,r.status,r.trailers],s.abort),r}};function _8(e){return{mergeOptions(t){const s=e.mergeOptions(t);return{...s,meta:{[sA]:String(rA),...s.meta}}},unary:e.unary.bind(e),serverStreaming:e.serverStreaming.bind(e),clientStreaming:e.clientStreaming.bind(e),duplex:e.duplex.bind(e)}}var k8=class wA{#e;#t;constructor({prefix:t,cache:s}={}){this.#e=t??[],this.#t=s??new Map}read(t,s){const r=[this.#e,...t].join(":");if(this.#t.has(r))return this.#t.get(r);const i=s();return this.#t.set(r,i),typeof i=="object"&&i!==null&&"then"in i?Promise.resolve(i).then(c=>(this.#t.set(r,c),c)).catch(c=>{throw this.#t.delete(r),c}):i}readSync(t,s){const r=[this.#e,...t].join(":");if(this.#t.has(r))return this.#t.get(r);const i=s();return this.#t.set(r,i),i}clear(t){const s=[...this.#e,...t??[]].join(":");if(!s){this.#t.clear();return}for(const r of this.#t.keys())r.startsWith(s)&&this.#t.delete(r)}scope(t){return new wA({prefix:[...this.#e,...Array.isArray(t)?t:[t]],cache:this.#t})}},TA=class{constructor({network:e,base:t,cache:s=t?.cache??new k8}){this.network=e,this.base=t??this,this.cache=s}$extend(...e){const t=Object.fromEntries(e.map(r=>[r.name,r.register(this)])),s=new Map;return new Proxy(this,{get(r,i,c){if(typeof i=="string"&&i in t)return t[i];const u=Reflect.get(r,i,c);return typeof u=="function"?i==="$extend"?u.bind(c):(s.has(i)||s.set(i,u.bind(r)),s.get(i)):u}})}};const A8={mainnet:"https://mainnet.mvr.mystenlabs.com",testnet:"https://testnet.mvr.mystenlabs.com"};var O8=class extends TA{constructor(e){super(e),this.core=this,this.mvr=new g5({cache:this.cache.scope("core.mvr"),url:e.mvr?.url??A8[this.network],pageSize:e.mvr?.pageSize,overrides:e.mvr?.overrides})}async getObject(e){const{objectId:t}=e,{objects:[s]}=await this.getObjects({objectIds:[t],signal:e.signal,include:e.include});if(s instanceof Error)throw s;return{object:s}}async getDynamicField(e){const t=uo.parseFromStr((await this.core.mvr.resolveType({type:e.name.type,signal:e.signal})).type),s=ib(e.parentId,t,e.name.bcs),{objects:[r]}=await this.getObjects({objectIds:[s],signal:e.signal,include:{previousTransaction:!0,content:!0}});if(r instanceof Error)throw r;const i=Ss(r.type),c=await r.content,u=i.typeParams[0],d=typeof u!="string"&&u.module==="dynamic_object_field"&&u.name==="Wrapper",p=c.slice(sl+e.name.bcs.length),m=typeof i.typeParams[1]=="string"?i.typeParams[1]:De(i.typeParams[1]);return{dynamicField:{$kind:d?"DynamicObject":"DynamicField",fieldId:r.objectId,digest:r.digest,version:r.version,type:r.type,previousTransaction:r.previousTransaction,name:{type:typeof u=="string"?u:De(u),bcs:e.name.bcs},value:{type:m,bcs:p},childId:d?M.Address.parse(p):void 0}}}async getDynamicObjectField(e){const t=`0x2::dynamic_object_field::Wrapper<${(await this.core.mvr.resolveType({type:e.name.type,signal:e.signal})).type}>`,{dynamicField:s}=await this.getDynamicField({parentId:e.parentId,name:{type:t,bcs:e.name.bcs},signal:e.signal}),{object:r}=await this.getObject({objectId:s.childId,signal:e.signal,include:e.include});return{object:r}}async waitForTransaction(e){const{signal:t,timeout:s=60*1e3,pollSchedule:r,include:i}=e,c="result"in e&&e.result?(e.result.Transaction??e.result.FailedTransaction).digest:e.digest,u=t?AbortSignal.any([AbortSignal.timeout(s),t]):AbortSignal.timeout(s),d=new Promise((b,E)=>{u.addEventListener("abort",()=>E(u.reason))});d.catch(()=>{});const p=r??[0,300,600,1500,3500],m=Date.now();let g=0;const y=p.length>0?p[p.length-1]-(p[p.length-2]??0):2e3;for(;;){if(g<p.length){const b=m+p[g]-Date.now();g++,b>0&&await Promise.race([new Promise(E=>setTimeout(E,b)),d])}else await Promise.race([new Promise(b=>setTimeout(b,y)),d]);u.throwIfAborted();try{return await this.getTransaction({digest:c,include:i,signal:u})}catch{}}}async signAndExecuteTransaction({transaction:e,signer:t,additionalSignatures:s=[],...r}){let i;e instanceof Uint8Array?i=e:(e.setSenderIfNotSet(t.toSuiAddress()),i=await e.build({client:this}));const{signature:c}=await t.signTransaction(i);return this.executeTransaction({transaction:i,signatures:[c,...s],...r})}};const N8=new Intl.PluralRules("en-US",{type:"ordinal"}),x8=new Map([["one","st"],["two","nd"],["few","rd"],["other","th"]]);function C8(e){return`${e}${x8.get(N8.select(e))}`}function SA(e){const{command:t,location:s,abortCode:r,cleverError:i}=e,c=[];if(t!=null?c.push(`MoveAbort in ${C8(t+1)} command`):c.push("MoveAbort"),i?.constantName){const u=i.value?`'${i.constantName}': ${i.value}`:`'${i.constantName}'`;c.push(u)}else c.push(`abort code: ${r}`);if(s?.package&&s?.module){const u=[`in '${[s.package.startsWith("0x")?s.package:`0x${s.package}`,s.module,s.functionName].filter(Boolean).join("::")}'`];i?.lineNumber!=null?u.push(`(line ${i.lineNumber})`):s.instruction!=null&&u.push(`(instruction ${s.instruction})`),c.push(u.join(" "))}return c.join(", ")}const DE=M.struct("MinimalEffectsWithError",{status:Pv}),I8=M.enum("MinimalTransactionEffectsWithError",{V1:DE,V2:DE}),R8=M.enum("MinimalExecutionStatusNoError",{Success:null,Failed:null}),UE=M.struct("MinimalEffectsNoError",{status:R8}),j8=M.enum("MinimalTransactionEffectsNoError",{V1:UE,V2:UE});function ns(e,t){return t!=null&&typeof t!="boolean"?`${e}(${JSON.stringify(t,(s,r)=>typeof r=="bigint"?r.toString():r)})`:e}function ub(e){const t=e.error,s=e.command!=null?Number(e.command):void 0;switch(t.$kind){case"MoveAbort":{const[r,i]=t.MoveAbort,c={package:r.module.address,module:r.module.name,function:r.function,functionName:r.functionName??void 0,instruction:r.instruction};return{$kind:"MoveAbort",message:SA({command:s,location:c,abortCode:String(i)}),command:s,MoveAbort:{abortCode:String(i),location:c}}}case"MoveObjectTooBig":return{$kind:"SizeError",message:ns("MoveObjectTooBig",t.MoveObjectTooBig),command:s,SizeError:{name:"ObjectTooBig",size:Number(t.MoveObjectTooBig.objectSize),maxSize:Number(t.MoveObjectTooBig.maxObjectSize)}};case"MovePackageTooBig":return{$kind:"SizeError",message:ns("MovePackageTooBig",t.MovePackageTooBig),command:s,SizeError:{name:"PackageTooBig",size:Number(t.MovePackageTooBig.objectSize),maxSize:Number(t.MovePackageTooBig.maxObjectSize)}};case"EffectsTooLarge":return{$kind:"SizeError",message:ns("EffectsTooLarge",t.EffectsTooLarge),command:s,SizeError:{name:"EffectsTooLarge",size:Number(t.EffectsTooLarge.currentSize),maxSize:Number(t.EffectsTooLarge.maxSize)}};case"WrittenObjectsTooLarge":return{$kind:"SizeError",message:ns("WrittenObjectsTooLarge",t.WrittenObjectsTooLarge),command:s,SizeError:{name:"WrittenObjectsTooLarge",size:Number(t.WrittenObjectsTooLarge.currentSize),maxSize:Number(t.WrittenObjectsTooLarge.maxSize)}};case"MoveVectorElemTooBig":return{$kind:"SizeError",message:ns("MoveVectorElemTooBig",t.MoveVectorElemTooBig),command:s,SizeError:{name:"MoveVectorElemTooBig",size:Number(t.MoveVectorElemTooBig.valueSize),maxSize:Number(t.MoveVectorElemTooBig.maxScaledSize)}};case"MoveRawValueTooBig":return{$kind:"SizeError",message:ns("MoveRawValueTooBig",t.MoveRawValueTooBig),command:s,SizeError:{name:"MoveRawValueTooBig",size:Number(t.MoveRawValueTooBig.valueSize),maxSize:Number(t.MoveRawValueTooBig.maxScaledSize)}};case"CommandArgumentError":return{$kind:"CommandArgumentError",message:ns("CommandArgumentError",t.CommandArgumentError),command:s,CommandArgumentError:{argument:t.CommandArgumentError.argIdx,name:t.CommandArgumentError.kind.$kind}};case"TypeArgumentError":return{$kind:"TypeArgumentError",message:ns("TypeArgumentError",t.TypeArgumentError),command:s,TypeArgumentError:{typeArgument:t.TypeArgumentError.argumentIdx,name:t.TypeArgumentError.kind.$kind}};case"PackageUpgradeError":{const r=t.PackageUpgradeError.upgradeError;return{$kind:"PackageUpgradeError",message:ns("PackageUpgradeError",t.PackageUpgradeError),command:s,PackageUpgradeError:{name:r.$kind,packageId:r.$kind==="UnableToFetchPackage"?r.UnableToFetchPackage.packageId:void 0,digest:r.$kind==="DigestDoesNotMatch"?Ke(r.DigestDoesNotMatch.digest):void 0}}}case"ExecutionCancelledDueToSharedObjectCongestion":return{$kind:"CongestedObjects",message:ns("ExecutionCancelledDueToSharedObjectCongestion",t.ExecutionCancelledDueToSharedObjectCongestion),command:s,CongestedObjects:{name:"ExecutionCanceledDueToConsensusObjectCongestion",objects:t.ExecutionCancelledDueToSharedObjectCongestion.congested_objects}};case"AddressDeniedForCoin":return{$kind:"CoinDenyListError",message:ns("AddressDeniedForCoin",t.AddressDeniedForCoin),command:s,CoinDenyListError:{name:"AddressDeniedForCoin",address:t.AddressDeniedForCoin.address,coinType:t.AddressDeniedForCoin.coinType}};case"CoinTypeGlobalPause":return{$kind:"CoinDenyListError",message:ns("CoinTypeGlobalPause",t.CoinTypeGlobalPause),command:s,CoinDenyListError:{name:"CoinTypeGlobalPause",coinType:t.CoinTypeGlobalPause.coinType}};case"CircularObjectOwnership":return{$kind:"ObjectIdError",message:ns("CircularObjectOwnership",t.CircularObjectOwnership),command:s,ObjectIdError:{name:"CircularObjectOwnership",objectId:t.CircularObjectOwnership.object}};case"InvalidGasObject":return{$kind:"ObjectIdError",message:"InvalidGasObject",command:s,ObjectIdError:{name:"InvalidGasObject",objectId:""}};case"InputObjectDeleted":return{$kind:"ObjectIdError",message:"InputObjectDeleted",command:s,ObjectIdError:{name:"InputObjectDeleted",objectId:""}};case"InvalidTransferObject":return{$kind:"ObjectIdError",message:"InvalidTransferObject",command:s,ObjectIdError:{name:"InvalidTransferObject",objectId:""}};case"NonExclusiveWriteInputObjectModified":return{$kind:"Unknown",message:ns("NonExclusiveWriteInputObjectModified",t.NonExclusiveWriteInputObjectModified),command:s,Unknown:null};case"InsufficientGas":case"InvariantViolation":case"FeatureNotYetSupported":case"InsufficientCoinBalance":case"CoinBalanceOverflow":case"PublishErrorNonZeroAddress":case"SuiMoveVerificationError":case"MovePrimitiveRuntimeError":case"VMVerificationOrDeserializationError":case"VMInvariantViolation":case"FunctionNotFound":case"ArityMismatch":case"TypeArityMismatch":case"NonEntryFunctionInvoked":case"UnusedValueWithoutDrop":case"InvalidPublicFunctionReturnType":case"PublishUpgradeMissingDependency":case"PublishUpgradeDependencyDowngrade":case"CertificateDenied":case"SuiMoveVerificationTimedout":case"SharedObjectOperationNotAllowed":case"ExecutionCancelledDueToRandomnessUnavailable":case"InvalidLinkage":case"InsufficientBalanceForWithdraw":return{$kind:"Unknown",message:t.$kind,command:s,Unknown:null};default:return{$kind:"Unknown",message:"Unknown error",command:s,Unknown:null}}}function M8(e,t=!1){return(t?Ji.fromKindBytes(e):Ji.fromBytes(e)).snapshot()}function D8(e){try{return M.TransactionData.parse(e).V1?.gasData.payment?.length===0}catch{return!1}}function U8(e){let t=null;try{t=I8.parse(e)}catch{const r=j8.parse(e);return(r.V1??r.V2).status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:{$kind:"Unknown",message:"ExecutionFailed",Unknown:null}}}const s=(t.V1??t.V2).status;return s.$kind==="Success"?{success:!0,error:null}:{success:!1,error:ub(s.Failure)}}function B8(e){const t=M.TransactionEffects.parse(e);switch(t.$kind){case"V1":return L8({bytes:e,effects:t.V1});case"V2":return z8({bytes:e,effects:t.V2});default:throw new Error(`Unknown transaction effects version: ${t.$kind}`)}}function L8({bytes:e,effects:t}){const s=new Map(t.modifiedAtVersions),r=new Map(t.sharedObjects.map(b=>[b.objectId,b])),i=(b,E)=>{const O=r.get(b.objectId);return{objectId:b.objectId,inputState:E.inputState,inputVersion:E.inputState==="Exists"?O?.version??s.get(b.objectId)??null:null,inputDigest:E.inputState==="Exists"?O?.digest??null:null,inputOwner:null,outputState:E.outputState,outputVersion:E.outputState==="DoesNotExist"?null:b.version,outputDigest:E.outputState==="DoesNotExist"?null:b.digest,outputOwner:E.outputOwner,idOperation:E.idOperation}},c=(b,E,O)=>b.map(([C,R])=>i(C,{inputState:E,outputState:"ObjectWrite",outputOwner:R,idOperation:O})),u=(b,E,O)=>b.map(C=>i(C,{inputState:E,outputState:"DoesNotExist",outputOwner:null,idOperation:O})),d=[...c(t.created,"DoesNotExist","Created"),...c(t.mutated,"Exists","None"),...c(t.unwrapped,"DoesNotExist","None"),...u(t.deleted,"Exists","Deleted"),...u(t.unwrappedThenDeleted,"DoesNotExist","Deleted"),...u(t.wrapped,"Exists","None")],p=t.gasObject[0].objectId,m=d.find(b=>b.objectId===p)??null,g=new Set(d.map(b=>b.objectId)),y=t.modifiedAtVersions.reduce((b,[,E])=>BigInt(E)>b?BigInt(E):b,0n);return{bcs:e,version:1,status:t.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:ub(t.status.Failure)},gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:m,eventsDigest:t.eventsDigest,dependencies:t.dependencies,lamportVersion:(y+1n).toString(),changedObjects:d,unchangedConsensusObjects:t.sharedObjects.filter(b=>!g.has(b.objectId)).map(b=>({kind:"ReadOnlyRoot",objectId:b.objectId,version:b.version,digest:b.digest})),auxiliaryDataDigest:null}}function z8({bytes:e,effects:t}){const s=t.changedObjects.map(([r,i])=>({objectId:r,inputState:i.inputState.$kind==="Exist"?"Exists":"DoesNotExist",inputVersion:i.inputState.Exist?.[0][0]??null,inputDigest:i.inputState.Exist?.[0][1]??null,inputOwner:i.inputState.Exist?.[1]??null,outputState:i.outputState.$kind==="NotExist"?"DoesNotExist":i.outputState.$kind,outputVersion:i.outputState.$kind==="PackageWrite"?i.outputState.PackageWrite?.[0]:i.outputState.$kind==="ObjectWrite"?t.lamportVersion:null,outputDigest:i.outputState.$kind==="PackageWrite"?i.outputState.PackageWrite?.[1]:i.outputState.$kind==="ObjectWrite"?i.outputState.ObjectWrite?.[0]??null:null,outputOwner:i.outputState.$kind==="ObjectWrite"?i.outputState.ObjectWrite[1]:null,idOperation:i.idOperation.$kind}));return{bcs:e,version:2,status:t.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:ub(t.status.Failure)},gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:t.gasObjectIndex===null?null:s[t.gasObjectIndex]??null,eventsDigest:t.eventsDigest,dependencies:t.dependencies,lamportVersion:t.lamportVersion,changedObjects:s,unchangedConsensusObjects:t.unchangedConsensusObjects.map(([r,i])=>({kind:i.$kind,objectId:r,version:i.$kind==="ReadOnlyRoot"?i.ReadOnlyRoot[0]:i[i.$kind],digest:i.$kind==="ReadOnlyRoot"?i.ReadOnlyRoot[1]:null})),auxiliaryDataDigest:t.auxDataDigest}}let BE=(function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e})({});var $8=class extends Y{constructor(){super("google.protobuf.Struct",[{no:1,name:"fields",kind:"map",K:9,V:{kind:"message",T:()=>pn}}])}internalJsonWrite(e,t){let s={};for(let[r,i]of Object.entries(e.fields))s[r]=pn.toJson(i);return s}internalJsonRead(e,t,s){if(!Hh(e))throw new globalThis.Error("Unable to parse message "+this.typeName+" from JSON "+ga(e)+".");s||(s=this.create());for(let[r,i]of globalThis.Object.entries(e))s.fields[r]=pn.fromJson(i);return s}};const LE=new $8;var V8=class extends Y{constructor(){super("google.protobuf.Value",[{no:1,name:"null_value",kind:"enum",oneof:"kind",T:()=>["google.protobuf.NullValue",BE]},{no:2,name:"number_value",kind:"scalar",oneof:"kind",T:1},{no:3,name:"string_value",kind:"scalar",oneof:"kind",T:9},{no:4,name:"bool_value",kind:"scalar",oneof:"kind",T:8},{no:5,name:"struct_value",kind:"message",oneof:"kind",T:()=>LE},{no:6,name:"list_value",kind:"message",oneof:"kind",T:()=>zE}])}internalJsonWrite(e,t){if(e.kind.oneofKind===void 0)throw new globalThis.Error;switch(e.kind.oneofKind){case void 0:throw new globalThis.Error;case"boolValue":return e.kind.boolValue;case"nullValue":return null;case"numberValue":let s=e.kind.numberValue;if(typeof s=="number"&&!Number.isFinite(s))throw new globalThis.Error;return s;case"stringValue":return e.kind.stringValue;case"listValue":let r=this.fields.find(c=>c.no===6);if(r?.kind!=="message")throw new globalThis.Error;return r.T().toJson(e.kind.listValue);case"structValue":let i=this.fields.find(c=>c.no===5);if(i?.kind!=="message")throw new globalThis.Error;return i.T().toJson(e.kind.structValue)}}internalJsonRead(e,t,s){switch(s||(s=this.create()),typeof e){case"number":s.kind={oneofKind:"numberValue",numberValue:e};break;case"string":s.kind={oneofKind:"stringValue",stringValue:e};break;case"boolean":s.kind={oneofKind:"boolValue",boolValue:e};break;case"object":e===null?s.kind={oneofKind:"nullValue",nullValue:BE.NULL_VALUE}:globalThis.Array.isArray(e)?s.kind={oneofKind:"listValue",listValue:zE.fromJson(e)}:s.kind={oneofKind:"structValue",structValue:LE.fromJson(e)};break;default:throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+ga(e))}return s}};const pn=new V8;var P8=class extends Y{constructor(){super("google.protobuf.ListValue",[{no:1,name:"values",kind:"message",repeat:2,T:()=>pn}])}internalJsonWrite(e,t){return e.values.map(s=>pn.toJson(s))}internalJsonRead(e,t,s){if(!globalThis.Array.isArray(e))throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+ga(e));s||(s=this.create());let r=e.map(i=>pn.fromJson(i));return s.values.push(...r),s}};const zE=new P8;let G8=(function(e){return e[e.DATATYPE_KIND_UNKNOWN=0]="DATATYPE_KIND_UNKNOWN",e[e.STRUCT=1]="STRUCT",e[e.ENUM=2]="ENUM",e})({}),ys=(function(e){return e[e.TYPE_UNKNOWN=0]="TYPE_UNKNOWN",e[e.ADDRESS=1]="ADDRESS",e[e.BOOL=2]="BOOL",e[e.U8=3]="U8",e[e.U16=4]="U16",e[e.U32=5]="U32",e[e.U64=6]="U64",e[e.U128=7]="U128",e[e.U256=8]="U256",e[e.VECTOR=9]="VECTOR",e[e.DATATYPE=10]="DATATYPE",e[e.TYPE_PARAMETER=11]="TYPE_PARAMETER",e})({}),Eh=(function(e){return e[e.VISIBILITY_UNKNOWN=0]="VISIBILITY_UNKNOWN",e[e.PRIVATE=1]="PRIVATE",e[e.PUBLIC=2]="PUBLIC",e[e.FRIEND=3]="FRIEND",e})({}),rv=(function(e){return e[e.REFERENCE_UNKNOWN=0]="REFERENCE_UNKNOWN",e[e.IMMUTABLE=1]="IMMUTABLE",e[e.MUTABLE=2]="MUTABLE",e})({}),Nc=(function(e){return e[e.ABILITY_UNKNOWN=0]="ABILITY_UNKNOWN",e[e.COPY=1]="COPY",e[e.DROP=2]="DROP",e[e.STORE=3]="STORE",e[e.KEY=4]="KEY",e})({});var F8=class extends Y{constructor(){super("sui.rpc.v2.Package",[{no:1,name:"storage_id",kind:"scalar",opt:!0,T:9},{no:2,name:"original_id",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"modules",kind:"message",repeat:2,T:()=>q8},{no:5,name:"type_origins",kind:"message",repeat:2,T:()=>nM},{no:6,name:"linkage",kind:"message",repeat:2,T:()=>rM}])}};const EA=new F8;var H8=class extends Y{constructor(){super("sui.rpc.v2.Module",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"contents",kind:"scalar",opt:!0,T:12},{no:3,name:"datatypes",kind:"message",repeat:2,T:()=>_A},{no:4,name:"functions",kind:"message",repeat:2,T:()=>OA}])}};const q8=new H8;var Z8=class extends Y{constructor(){super("sui.rpc.v2.DatatypeDescriptor",[{no:1,name:"type_name",kind:"scalar",opt:!0,T:9},{no:2,name:"defining_id",kind:"scalar",opt:!0,T:9},{no:3,name:"module",kind:"scalar",opt:!0,T:9},{no:4,name:"name",kind:"scalar",opt:!0,T:9},{no:5,name:"abilities",kind:"enum",repeat:1,T:()=>["sui.rpc.v2.Ability",Nc]},{no:6,name:"type_parameters",kind:"message",repeat:2,T:()=>kA},{no:7,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.DatatypeDescriptor.DatatypeKind",G8]},{no:8,name:"fields",kind:"message",repeat:2,T:()=>AA},{no:9,name:"variants",kind:"message",repeat:2,T:()=>K8}])}};const _A=new Z8;var Y8=class extends Y{constructor(){super("sui.rpc.v2.TypeParameter",[{no:1,name:"constraints",kind:"enum",repeat:1,T:()=>["sui.rpc.v2.Ability",Nc]},{no:2,name:"is_phantom",kind:"scalar",opt:!0,T:8}])}};const kA=new Y8;var W8=class extends Y{constructor(){super("sui.rpc.v2.FieldDescriptor",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"position",kind:"scalar",opt:!0,T:13},{no:3,name:"type",kind:"message",T:()=>db}])}};const AA=new W8;var X8=class extends Y{constructor(){super("sui.rpc.v2.VariantDescriptor",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"position",kind:"scalar",opt:!0,T:13},{no:3,name:"fields",kind:"message",repeat:2,T:()=>AA}])}};const K8=new X8;var J8=class extends Y{constructor(){super("sui.rpc.v2.OpenSignatureBody",[{no:1,name:"type",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.OpenSignatureBody.Type",ys]},{no:2,name:"type_name",kind:"scalar",opt:!0,T:9},{no:3,name:"type_parameter_instantiation",kind:"message",repeat:2,T:()=>db},{no:4,name:"type_parameter",kind:"scalar",opt:!0,T:13}])}};const db=new J8;var Q8=class extends Y{constructor(){super("sui.rpc.v2.FunctionDescriptor",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:5,name:"visibility",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.FunctionDescriptor.Visibility",Eh]},{no:6,name:"is_entry",kind:"scalar",opt:!0,T:8},{no:7,name:"type_parameters",kind:"message",repeat:2,T:()=>kA},{no:8,name:"parameters",kind:"message",repeat:2,T:()=>$E},{no:9,name:"returns",kind:"message",repeat:2,T:()=>$E}])}};const OA=new Q8;var eM=class extends Y{constructor(){super("sui.rpc.v2.OpenSignature",[{no:1,name:"reference",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.OpenSignature.Reference",rv]},{no:2,name:"body",kind:"message",T:()=>db}])}};const $E=new eM;var tM=class extends Y{constructor(){super("sui.rpc.v2.TypeOrigin",[{no:1,name:"module_name",kind:"scalar",opt:!0,T:9},{no:2,name:"datatype_name",kind:"scalar",opt:!0,T:9},{no:3,name:"package_id",kind:"scalar",opt:!0,T:9}])}};const nM=new tM;var sM=class extends Y{constructor(){super("sui.rpc.v2.Linkage",[{no:1,name:"original_id",kind:"scalar",opt:!0,T:9},{no:2,name:"upgraded_id",kind:"scalar",opt:!0,T:9},{no:3,name:"upgraded_version",kind:"scalar",opt:!0,T:4,L:0}])}};const rM=new sM;let Sc=(function(e){return e[e.OWNER_KIND_UNKNOWN=0]="OWNER_KIND_UNKNOWN",e[e.ADDRESS=1]="ADDRESS",e[e.OBJECT=2]="OBJECT",e[e.SHARED=3]="SHARED",e[e.IMMUTABLE=4]="IMMUTABLE",e[e.CONSENSUS_ADDRESS=5]="CONSENSUS_ADDRESS",e})({});var aM=class extends Y{constructor(){super("sui.rpc.v2.Owner",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Owner.OwnerKind",Sc]},{no:2,name:"address",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const av=new aM;let oi=(function(e){return e[e.ARGUMENT_KIND_UNKNOWN=0]="ARGUMENT_KIND_UNKNOWN",e[e.GAS=1]="GAS",e[e.INPUT=2]="INPUT",e[e.RESULT=3]="RESULT",e})({});var iM=class extends Y{constructor(){super("sui.rpc.v2.Argument",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Argument.ArgumentKind",oi]},{no:2,name:"input",kind:"scalar",opt:!0,T:13},{no:3,name:"result",kind:"scalar",opt:!0,T:13},{no:4,name:"subresult",kind:"scalar",opt:!0,T:13}])}};const Or=new iM;let tr=(function(e){return e[e.INPUT_KIND_UNKNOWN=0]="INPUT_KIND_UNKNOWN",e[e.PURE=1]="PURE",e[e.IMMUTABLE_OR_OWNED=2]="IMMUTABLE_OR_OWNED",e[e.SHARED=3]="SHARED",e[e.RECEIVING=4]="RECEIVING",e[e.FUNDS_WITHDRAWAL=5]="FUNDS_WITHDRAWAL",e})({}),oM=(function(e){return e[e.MUTABILITY_UNKNOWN=0]="MUTABILITY_UNKNOWN",e[e.IMMUTABLE=1]="IMMUTABLE",e[e.MUTABLE=2]="MUTABLE",e[e.NON_EXCLUSIVE_WRITE=3]="NON_EXCLUSIVE_WRITE",e})({}),xc=(function(e){return e[e.SOURCE_UNKNOWN=0]="SOURCE_UNKNOWN",e[e.SENDER=1]="SENDER",e[e.SPONSOR=2]="SPONSOR",e[e.SENDER_ALLOWANCE=3]="SENDER_ALLOWANCE",e})({});var cM=class extends Y{constructor(){super("sui.rpc.v2.Input",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Input.InputKind",tr]},{no:2,name:"pure",kind:"scalar",opt:!0,T:12},{no:3,name:"object_id",kind:"scalar",opt:!0,T:9},{no:4,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"digest",kind:"scalar",opt:!0,T:9},{no:6,name:"mutable",kind:"scalar",opt:!0,T:8},{no:7,name:"mutability",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Input.Mutability",oM]},{no:8,name:"funds_withdrawal",kind:"message",T:()=>dM},{no:1e3,name:"literal",kind:"message",T:()=>pn}])}};const lM=new cM;var uM=class extends Y{constructor(){super("sui.rpc.v2.FundsWithdrawal",[{no:1,name:"amount",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:3,name:"source",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.FundsWithdrawal.Source",xc]},{no:4,name:"funder",kind:"scalar",opt:!0,T:9},{no:5,name:"allowance",kind:"scalar",opt:!0,T:9}])}};const dM=new uM;var fM=class extends Y{constructor(){super("google.protobuf.Duration",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}internalJsonWrite(e,t){let s=Ot.from(e.seconds).toNumber();if(s>315576e6||s<-315576e6)throw new Error("Duration value out of range.");let r=e.seconds.toString();if(s===0&&e.nanos<0&&(r="-"+r),e.nanos!==0){let i=Math.abs(e.nanos).toString();i="0".repeat(9-i.length)+i,i.substring(3)==="000000"?i=i.substring(0,3):i.substring(6)==="000"&&(i=i.substring(0,6)),r+="."+i}return r+"s"}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse Duration from JSON "+ga(e)+". Expected string.");let r=e.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);if(r===null)throw new Error("Unable to parse Duration from JSON string. Invalid format.");s||(s=this.create());let[,i,c,u]=r,d=Ot.from(i+c);if(d.toNumber()>315576e6||d.toNumber()<-315576e6)throw new Error("Unable to parse Duration from JSON string. Value out of range.");if(s.seconds=d.toBigInt(),typeof u=="string"){let p=i+u+"0".repeat(9-u.length);s.nanos=parseInt(p)}return s}};const hM=new fM;var pM=class extends Y{constructor(){super("sui.rpc.v2.JwkId",[{no:1,name:"iss",kind:"scalar",opt:!0,T:9},{no:2,name:"kid",kind:"scalar",opt:!0,T:9}])}};const NA=new pM;var mM=class extends Y{constructor(){super("sui.rpc.v2.Jwk",[{no:1,name:"kty",kind:"scalar",opt:!0,T:9},{no:2,name:"e",kind:"scalar",opt:!0,T:9},{no:3,name:"n",kind:"scalar",opt:!0,T:9},{no:4,name:"alg",kind:"scalar",opt:!0,T:9}])}};const gM=new mM;var yM=class extends Y{constructor(){super("sui.rpc.v2.Bcs",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"value",kind:"scalar",opt:!0,T:12}])}};const Es=new yM;var vM=class extends Y{constructor(){super("sui.rpc.v2.Object",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"object_id",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"digest",kind:"scalar",opt:!0,T:9},{no:5,name:"owner",kind:"message",T:()=>av},{no:6,name:"object_type",kind:"scalar",opt:!0,T:9},{no:7,name:"has_public_transfer",kind:"scalar",opt:!0,T:8},{no:8,name:"contents",kind:"message",T:()=>Es},{no:9,name:"package",kind:"message",T:()=>EA},{no:10,name:"previous_transaction",kind:"scalar",opt:!0,T:9},{no:11,name:"storage_rebate",kind:"scalar",opt:!0,T:4,L:0},{no:100,name:"json",kind:"message",T:()=>pn},{no:101,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:102,name:"display",kind:"message",T:()=>TM}])}};const mo=new vM;var bM=class extends Y{constructor(){super("sui.rpc.v2.ObjectSet",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>mo}])}};const xA=new bM;var wM=class extends Y{constructor(){super("sui.rpc.v2.Display",[{no:1,name:"output",kind:"message",T:()=>pn},{no:2,name:"errors",kind:"message",T:()=>pn}])}};const TM=new wM;var SM=class extends Y{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const e=this.create(),t=Date.now();return e.seconds=Ot.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(Ot.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){const t=this.create(),s=e.getTime();return t.seconds=Ot.from(Math.floor(s/1e3)).toBigInt(),t.nanos=(s%1e3+(s<0&&s%1e3!==0?1e3:0))*1e6,t}internalJsonWrite(e,t){let s=Ot.from(e.seconds).toNumber()*1e3;if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(e.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let r="Z";if(e.nanos>0){let i=(e.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(s).toISOString().replace(".000Z",r)}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse Timestamp from JSON "+ga(e)+".");let r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return s||(s=this.create()),s.seconds=Ot.from(i/1e3).toBigInt(),s.nanos=0,r[7]&&(s.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),s}};const Nr=new SM;var EM=class extends Y{constructor(){super("sui.rpc.v2.ObjectReference",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"digest",kind:"scalar",opt:!0,T:9}])}};const CA=new EM;let la=(function(e){return e[e.TRANSACTION_EXPIRATION_KIND_UNKNOWN=0]="TRANSACTION_EXPIRATION_KIND_UNKNOWN",e[e.NONE=1]="NONE",e[e.EPOCH=2]="EPOCH",e[e.VALID_DURING=3]="VALID_DURING",e[e.VALIDITY=4]="VALIDITY",e})({}),_M=(function(e){return e[e.KIND_UNKNOWN=0]="KIND_UNKNOWN",e[e.PROGRAMMABLE_TRANSACTION=1]="PROGRAMMABLE_TRANSACTION",e[e.CHANGE_EPOCH=2]="CHANGE_EPOCH",e[e.GENESIS=3]="GENESIS",e[e.CONSENSUS_COMMIT_PROLOGUE_V1=4]="CONSENSUS_COMMIT_PROLOGUE_V1",e[e.AUTHENTICATOR_STATE_UPDATE=5]="AUTHENTICATOR_STATE_UPDATE",e[e.END_OF_EPOCH=6]="END_OF_EPOCH",e[e.RANDOMNESS_STATE_UPDATE=7]="RANDOMNESS_STATE_UPDATE",e[e.CONSENSUS_COMMIT_PROLOGUE_V2=8]="CONSENSUS_COMMIT_PROLOGUE_V2",e[e.CONSENSUS_COMMIT_PROLOGUE_V3=9]="CONSENSUS_COMMIT_PROLOGUE_V3",e[e.CONSENSUS_COMMIT_PROLOGUE_V4=10]="CONSENSUS_COMMIT_PROLOGUE_V4",e[e.PROGRAMMABLE_SYSTEM_TRANSACTION=11]="PROGRAMMABLE_SYSTEM_TRANSACTION",e})({}),kM=(function(e){return e[e.KIND_UNKNOWN=0]="KIND_UNKNOWN",e[e.CHANGE_EPOCH=1]="CHANGE_EPOCH",e[e.AUTHENTICATOR_STATE_CREATE=2]="AUTHENTICATOR_STATE_CREATE",e[e.AUTHENTICATOR_STATE_EXPIRE=3]="AUTHENTICATOR_STATE_EXPIRE",e[e.RANDOMNESS_STATE_CREATE=4]="RANDOMNESS_STATE_CREATE",e[e.DENY_LIST_STATE_CREATE=5]="DENY_LIST_STATE_CREATE",e[e.BRIDGE_STATE_CREATE=6]="BRIDGE_STATE_CREATE",e[e.BRIDGE_COMMITTEE_INIT=7]="BRIDGE_COMMITTEE_INIT",e[e.STORE_EXECUTION_TIME_OBSERVATIONS=8]="STORE_EXECUTION_TIME_OBSERVATIONS",e[e.ACCUMULATOR_ROOT_CREATE=9]="ACCUMULATOR_ROOT_CREATE",e[e.COIN_REGISTRY_CREATE=10]="COIN_REGISTRY_CREATE",e[e.DISPLAY_REGISTRY_CREATE=11]="DISPLAY_REGISTRY_CREATE",e[e.ADDRESS_ALIAS_STATE_CREATE=12]="ADDRESS_ALIAS_STATE_CREATE",e[e.WRITE_ACCUMULATOR_STORAGE_COST=13]="WRITE_ACCUMULATOR_STORAGE_COST",e})({}),AM=(function(e){return e[e.EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN=0]="EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",e[e.MOVE_ENTRY_POINT=1]="MOVE_ENTRY_POINT",e[e.TRANSFER_OBJECTS=2]="TRANSFER_OBJECTS",e[e.SPLIT_COINS=3]="SPLIT_COINS",e[e.MERGE_COINS=4]="MERGE_COINS",e[e.PUBLISH=5]="PUBLISH",e[e.MAKE_MOVE_VECTOR=6]="MAKE_MOVE_VECTOR",e[e.UPGRADE=7]="UPGRADE",e})({});var OM=class extends Y{constructor(){super("sui.rpc.v2.Transaction",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:5},{no:4,name:"kind",kind:"message",T:()=>DM},{no:5,name:"sender",kind:"scalar",opt:!0,T:9},{no:6,name:"gas_payment",kind:"message",T:()=>xM},{no:7,name:"expiration",kind:"message",T:()=>IM}])}};const fb=new OM;var NM=class extends Y{constructor(){super("sui.rpc.v2.GasPayment",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>CA},{no:2,name:"owner",kind:"scalar",opt:!0,T:9},{no:3,name:"price",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"budget",kind:"scalar",opt:!0,T:4,L:0}])}};const xM=new NM;var CM=class extends Y{constructor(){super("sui.rpc.v2.TransactionExpiration",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TransactionExpiration.TransactionExpirationKind",la]},{no:2,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"min_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"min_timestamp",kind:"message",T:()=>Nr},{no:5,name:"max_timestamp",kind:"message",T:()=>Nr},{no:6,name:"chain",kind:"scalar",opt:!0,T:9},{no:7,name:"nonce",kind:"scalar",opt:!0,T:13},{no:8,name:"allowed_proposers",kind:"message",T:()=>jM}])}};const IM=new CM;var RM=class extends Y{constructor(){super("sui.rpc.v2.AllowedProposers",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"proposers",kind:"scalar",repeat:1,T:13}])}};const jM=new RM;var MM=class extends Y{constructor(){super("sui.rpc.v2.TransactionKind",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TransactionKind.Kind",_M]},{no:2,name:"programmable_transaction",kind:"message",oneof:"data",T:()=>BM},{no:3,name:"change_epoch",kind:"message",oneof:"data",T:()=>RA},{no:4,name:"genesis",kind:"message",oneof:"data",T:()=>a9},{no:5,name:"consensus_commit_prologue",kind:"message",oneof:"data",T:()=>o9},{no:6,name:"authenticator_state_update",kind:"message",oneof:"data",T:()=>m9},{no:7,name:"end_of_epoch",kind:"message",oneof:"data",T:()=>v9},{no:8,name:"randomness_state_update",kind:"message",oneof:"data",T:()=>e9}])}};const DM=new MM;var UM=class extends Y{constructor(){super("sui.rpc.v2.ProgrammableTransaction",[{no:1,name:"inputs",kind:"message",repeat:2,T:()=>lM},{no:2,name:"commands",kind:"message",repeat:2,T:()=>zM}])}};const BM=new UM;var LM=class extends Y{constructor(){super("sui.rpc.v2.Command",[{no:1,name:"move_call",kind:"message",oneof:"command",T:()=>IA},{no:2,name:"transfer_objects",kind:"message",oneof:"command",T:()=>PM},{no:3,name:"split_coins",kind:"message",oneof:"command",T:()=>FM},{no:4,name:"merge_coins",kind:"message",oneof:"command",T:()=>qM},{no:5,name:"publish",kind:"message",oneof:"command",T:()=>YM},{no:6,name:"make_move_vector",kind:"message",oneof:"command",T:()=>XM},{no:7,name:"upgrade",kind:"message",oneof:"command",T:()=>JM}])}};const zM=new LM;var $M=class extends Y{constructor(){super("sui.rpc.v2.MoveCall",[{no:1,name:"package",kind:"scalar",opt:!0,T:9},{no:2,name:"module",kind:"scalar",opt:!0,T:9},{no:3,name:"function",kind:"scalar",opt:!0,T:9},{no:4,name:"type_arguments",kind:"scalar",repeat:2,T:9},{no:5,name:"arguments",kind:"message",repeat:2,T:()=>Or}])}};const IA=new $M;var VM=class extends Y{constructor(){super("sui.rpc.v2.TransferObjects",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>Or},{no:2,name:"address",kind:"message",T:()=>Or}])}};const PM=new VM;var GM=class extends Y{constructor(){super("sui.rpc.v2.SplitCoins",[{no:1,name:"coin",kind:"message",T:()=>Or},{no:2,name:"amounts",kind:"message",repeat:2,T:()=>Or}])}};const FM=new GM;var HM=class extends Y{constructor(){super("sui.rpc.v2.MergeCoins",[{no:1,name:"coin",kind:"message",T:()=>Or},{no:2,name:"coins_to_merge",kind:"message",repeat:2,T:()=>Or}])}};const qM=new HM;var ZM=class extends Y{constructor(){super("sui.rpc.v2.Publish",[{no:1,name:"modules",kind:"scalar",repeat:2,T:12},{no:2,name:"dependencies",kind:"scalar",repeat:2,T:9}])}};const YM=new ZM;var WM=class extends Y{constructor(){super("sui.rpc.v2.MakeMoveVector",[{no:1,name:"element_type",kind:"scalar",opt:!0,T:9},{no:2,name:"elements",kind:"message",repeat:2,T:()=>Or}])}};const XM=new WM;var KM=class extends Y{constructor(){super("sui.rpc.v2.Upgrade",[{no:1,name:"modules",kind:"scalar",repeat:2,T:12},{no:2,name:"dependencies",kind:"scalar",repeat:2,T:9},{no:3,name:"package",kind:"scalar",opt:!0,T:9},{no:4,name:"ticket",kind:"message",T:()=>Or}])}};const JM=new KM;var QM=class extends Y{constructor(){super("sui.rpc.v2.RandomnessStateUpdate",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"randomness_round",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"random_bytes",kind:"scalar",opt:!0,T:12},{no:4,name:"randomness_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const e9=new QM;var t9=class extends Y{constructor(){super("sui.rpc.v2.ChangeEpoch",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"storage_charge",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"computation_charge",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"storage_rebate",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"non_refundable_storage_fee",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"epoch_start_timestamp",kind:"message",T:()=>Nr},{no:8,name:"system_packages",kind:"message",repeat:2,T:()=>s9}])}};const RA=new t9;var n9=class extends Y{constructor(){super("sui.rpc.v2.SystemPackage",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"modules",kind:"scalar",repeat:2,T:12},{no:3,name:"dependencies",kind:"scalar",repeat:2,T:9}])}};const s9=new n9;var r9=class extends Y{constructor(){super("sui.rpc.v2.GenesisTransaction",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>mo}])}};const a9=new r9;var i9=class extends Y{constructor(){super("sui.rpc.v2.ConsensusCommitPrologue",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"round",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"commit_timestamp",kind:"message",T:()=>Nr},{no:4,name:"consensus_commit_digest",kind:"scalar",opt:!0,T:9},{no:5,name:"sub_dag_index",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"consensus_determined_version_assignments",kind:"message",T:()=>h9},{no:7,name:"additional_state_digest",kind:"scalar",opt:!0,T:9}])}};const o9=new i9;var c9=class extends Y{constructor(){super("sui.rpc.v2.VersionAssignment",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"start_version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const l9=new c9;var u9=class extends Y{constructor(){super("sui.rpc.v2.CanceledTransaction",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"version_assignments",kind:"message",repeat:2,T:()=>l9}])}};const d9=new u9;var f9=class extends Y{constructor(){super("sui.rpc.v2.ConsensusDeterminedVersionAssignments",[{no:1,name:"version",kind:"scalar",opt:!0,T:5},{no:3,name:"canceled_transactions",kind:"message",repeat:2,T:()=>d9}])}};const h9=new f9;var p9=class extends Y{constructor(){super("sui.rpc.v2.AuthenticatorStateUpdate",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"round",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"new_active_jwks",kind:"message",repeat:2,T:()=>jA},{no:4,name:"authenticator_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const m9=new p9;var g9=class extends Y{constructor(){super("sui.rpc.v2.ActiveJwk",[{no:1,name:"id",kind:"message",T:()=>NA},{no:2,name:"jwk",kind:"message",T:()=>gM},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0}])}};const jA=new g9;var y9=class extends Y{constructor(){super("sui.rpc.v2.EndOfEpochTransaction",[{no:1,name:"transactions",kind:"message",repeat:2,T:()=>w9}])}};const v9=new y9;var b9=class extends Y{constructor(){super("sui.rpc.v2.EndOfEpochTransactionKind",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.EndOfEpochTransactionKind.Kind",kM]},{no:2,name:"change_epoch",kind:"message",oneof:"data",T:()=>RA},{no:3,name:"authenticator_state_expire",kind:"message",oneof:"data",T:()=>S9},{no:4,name:"execution_time_observations",kind:"message",oneof:"data",T:()=>_9},{no:5,name:"bridge_chain_id",kind:"scalar",oneof:"data",T:9},{no:6,name:"bridge_object_version",kind:"scalar",oneof:"data",T:4,L:0},{no:7,name:"storage_cost",kind:"scalar",oneof:"data",T:4,L:0}])}};const w9=new b9;var T9=class extends Y{constructor(){super("sui.rpc.v2.AuthenticatorStateExpire",[{no:1,name:"min_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"authenticator_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const S9=new T9;var E9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionTimeObservations",[{no:1,name:"version",kind:"scalar",opt:!0,T:5},{no:2,name:"observations",kind:"message",repeat:2,T:()=>A9}])}};const _9=new E9;var k9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionTimeObservation",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ExecutionTimeObservation.ExecutionTimeObservationKind",AM]},{no:2,name:"move_entry_point",kind:"message",T:()=>IA},{no:3,name:"validator_observations",kind:"message",repeat:2,T:()=>N9}])}};const A9=new k9;var O9=class extends Y{constructor(){super("sui.rpc.v2.ValidatorExecutionTimeObservation",[{no:1,name:"validator",kind:"scalar",opt:!0,T:12},{no:2,name:"duration",kind:"message",T:()=>hM}])}};const N9=new O9;function VE(e){const t=BigInt(e);return{seconds:t/1000n,nanos:Number(t%1000n)*1e6}}function Xf(e){return(e.seconds*1000n+BigInt(Math.floor(e.nanos/1e6))).toString()}function x9(e){switch(e.$kind){case"Pure":return{kind:tr.PURE,pure:Ge(e.Pure.bytes)};case"Object":if(e.Object.$kind==="ImmOrOwnedObject")return{kind:tr.IMMUTABLE_OR_OWNED,objectId:e.Object.ImmOrOwnedObject.objectId,version:BigInt(e.Object.ImmOrOwnedObject.version),digest:e.Object.ImmOrOwnedObject.digest};if(e.Object.$kind==="SharedObject")return{kind:tr.SHARED,objectId:e.Object.SharedObject.objectId,version:BigInt(e.Object.SharedObject.initialSharedVersion),mutable:e.Object.SharedObject.mutable};if(e.Object.$kind==="Receiving")return{kind:tr.RECEIVING,objectId:e.Object.Receiving.objectId,version:BigInt(e.Object.Receiving.version),digest:e.Object.Receiving.digest};throw new Error(`Unknown Object kind: ${JSON.stringify(e.Object)}`);case"UnresolvedObject":const t=e.UnresolvedObject;return{objectId:t.objectId,version:t.version?BigInt(t.version):t.initialSharedVersion?BigInt(t.initialSharedVersion):void 0,digest:t.digest??void 0,mutable:t.mutable??void 0};case"UnresolvedPure":throw new Error("UnresolvedPure arguments must be resolved before converting to gRPC format");case"FundsWithdrawal":{const s=e.FundsWithdrawal;return{kind:tr.FUNDS_WITHDRAWAL,fundsWithdrawal:{amount:s.reservation.$kind==="MaxAmountU64"?BigInt(s.reservation.MaxAmountU64):void 0,coinType:s.typeArg.$kind==="Balance"?s.typeArg.Balance:void 0,...C9(s.withdrawFrom)}}}default:throw new Error(`Unknown CallArg kind: ${JSON.stringify(e)}`)}}function C9(e){switch(e.$kind){case"Sender":return{source:xc.SENDER};case"Sponsor":return{source:xc.SPONSOR};case"SenderAllowance":return{source:xc.SENDER_ALLOWANCE,funder:e.SenderAllowance.funder,allowance:e.SenderAllowance.allowance};default:throw new Error(`Unknown WithdrawFrom kind: ${JSON.stringify(e)}`)}}function I9(e){switch(e?.source){case xc.SPONSOR:return{$kind:"Sponsor",Sponsor:!0};case xc.SENDER_ALLOWANCE:if(!e.funder||!e.allowance)throw new Error(`SENDER_ALLOWANCE withdrawal is missing funder or allowance: ${JSON.stringify(e)}`);return{$kind:"SenderAllowance",SenderAllowance:{funder:e.funder,allowance:e.allowance}};default:return{$kind:"Sender",Sender:!0}}}function Jr(e){if("GasCoin"in e)return{kind:oi.GAS};if("Input"in e)return{kind:oi.INPUT,input:e.Input};if("Result"in e)return{kind:oi.RESULT,result:e.Result};if("NestedResult"in e)return{kind:oi.RESULT,result:e.NestedResult[0],subresult:e.NestedResult[1]};throw new Error(`Unknown Argument: ${JSON.stringify(e)}`)}function R9(e){switch(e.$kind){case"MoveCall":return{command:{oneofKind:"moveCall",moveCall:{package:e.MoveCall.package,module:e.MoveCall.module,function:e.MoveCall.function,typeArguments:e.MoveCall.typeArguments,arguments:e.MoveCall.arguments.map(Jr)}}};case"TransferObjects":return{command:{oneofKind:"transferObjects",transferObjects:{objects:e.TransferObjects.objects.map(Jr),address:Jr(e.TransferObjects.address)}}};case"SplitCoins":return{command:{oneofKind:"splitCoins",splitCoins:{coin:Jr(e.SplitCoins.coin),amounts:e.SplitCoins.amounts.map(Jr)}}};case"MergeCoins":return{command:{oneofKind:"mergeCoins",mergeCoins:{coin:Jr(e.MergeCoins.destination),coinsToMerge:e.MergeCoins.sources.map(Jr)}}};case"Publish":return{command:{oneofKind:"publish",publish:{modules:e.Publish.modules.map(t=>Ge(t)),dependencies:e.Publish.dependencies}}};case"MakeMoveVec":return{command:{oneofKind:"makeMoveVector",makeMoveVector:{elementType:e.MakeMoveVec.type??void 0,elements:e.MakeMoveVec.elements.map(Jr)}}};case"Upgrade":return{command:{oneofKind:"upgrade",upgrade:{modules:e.Upgrade.modules.map(t=>Ge(t)),dependencies:e.Upgrade.dependencies,package:e.Upgrade.package,ticket:Jr(e.Upgrade.ticket)}}};default:throw new Error(`Unknown Command kind: ${JSON.stringify(e)}`)}}function MA(e){const t={version:1,kind:{data:{oneofKind:"programmableTransaction",programmableTransaction:{inputs:e.inputs.map(x9),commands:e.commands.map(R9)}}}};e.sender&&(t.sender=e.sender);const s=e.gasData.owner??e.sender;if(t.gasPayment={objects:e.gasData.payment?e.gasData.payment.map(r=>({objectId:r.objectId,version:BigInt(r.version),digest:r.digest})):[],price:e.gasData.price?BigInt(e.gasData.price):void 0,budget:e.gasData.budget?BigInt(e.gasData.budget):void 0},s&&(t.gasPayment.owner=s),e.expiration){if("None"in e.expiration)t.expiration={kind:la.NONE};else if(e.expiration.$kind==="Epoch")t.expiration={kind:la.EPOCH,epoch:BigInt(e.expiration.Epoch)};else if(e.expiration.$kind==="ValidDuring"||e.expiration.$kind==="Validity"){const r=e.expiration.$kind==="ValidDuring"?e.expiration.ValidDuring:e.expiration.Validity,i=e.expiration.$kind==="Validity"?e.expiration.Validity.allowedProposers:null;t.expiration={kind:e.expiration.$kind==="ValidDuring"?la.VALID_DURING:la.VALIDITY,minEpoch:r.minEpoch!=null?BigInt(r.minEpoch):void 0,epoch:r.maxEpoch!=null?BigInt(r.maxEpoch):void 0,minTimestamp:r.minTimestamp!=null?VE(r.minTimestamp):void 0,maxTimestamp:r.maxTimestamp!=null?VE(r.maxTimestamp):void 0,chain:r.chain,nonce:r.nonce,allowedProposers:i?{epoch:BigInt(i.epoch),proposers:ik(i.proposers)}:void 0}}}return t}function j9(e,t,s){const r=DA(t);s?.onlyTransactionKind?e.applyResolvedData({...r,sender:null,gasData:{budget:null,owner:null,payment:null,price:null},expiration:null}):e.applyResolvedData(r)}function M9(e){const t=e.getData();return t.sender||(t.sender="0x0000000000000000000000000000000000000000000000000000000000000000"),MA(t)}function D9(e){switch(e.kind){case tr.PURE:return{$kind:"Pure",Pure:{bytes:Ke(e.pure)}};case tr.IMMUTABLE_OR_OWNED:return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{objectId:e.objectId,version:e.version.toString(),digest:e.digest}}};case tr.SHARED:return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{objectId:e.objectId,initialSharedVersion:e.version.toString(),mutable:e.mutable??!1}}};case tr.RECEIVING:return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{objectId:e.objectId,version:e.version.toString(),digest:e.digest}}};case tr.FUNDS_WITHDRAWAL:return{$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:{$kind:"MaxAmountU64",MaxAmountU64:e.fundsWithdrawal?.amount?.toString()??"0"},typeArg:{$kind:"Balance",Balance:e.fundsWithdrawal?.coinType??"0x2::sui::SUI"},withdrawFrom:I9(e.fundsWithdrawal)}};default:throw new Error(`Unknown Input kind: ${JSON.stringify(e)}`)}}function Qr(e){switch(e.kind){case oi.GAS:return{$kind:"GasCoin",GasCoin:!0};case oi.INPUT:return{$kind:"Input",Input:e.input};case oi.RESULT:return e.subresult!=null?{$kind:"NestedResult",NestedResult:[e.result,e.subresult]}:{$kind:"Result",Result:e.result};default:throw new Error(`Unknown Argument kind: ${JSON.stringify(e)}`)}}function U9(e){const t=e.command;if(!t)throw new Error("Command is missing");switch(t.oneofKind){case"moveCall":return{$kind:"MoveCall",MoveCall:{package:t.moveCall.package,module:t.moveCall.module,function:t.moveCall.function,typeArguments:t.moveCall.typeArguments??[],arguments:t.moveCall.arguments.map(Qr)}};case"transferObjects":return{$kind:"TransferObjects",TransferObjects:{objects:t.transferObjects.objects.map(Qr),address:Qr(t.transferObjects.address)}};case"splitCoins":return{$kind:"SplitCoins",SplitCoins:{coin:Qr(t.splitCoins.coin),amounts:t.splitCoins.amounts.map(Qr)}};case"mergeCoins":return{$kind:"MergeCoins",MergeCoins:{destination:Qr(t.mergeCoins.coin),sources:t.mergeCoins.coinsToMerge.map(Qr)}};case"publish":return{$kind:"Publish",Publish:{modules:t.publish.modules.map(s=>Ke(s)),dependencies:t.publish.dependencies??[]}};case"makeMoveVector":return{$kind:"MakeMoveVec",MakeMoveVec:{type:t.makeMoveVector.elementType??null,elements:t.makeMoveVector.elements.map(Qr)}};case"upgrade":return{$kind:"Upgrade",Upgrade:{modules:t.upgrade.modules.map(s=>Ke(s)),dependencies:t.upgrade.dependencies??[],package:t.upgrade.package,ticket:Qr(t.upgrade.ticket)}};default:throw new Error(`Unknown Command kind: ${JSON.stringify(t)}`)}}function DA(e){const t=e.kind?.data;if(t?.oneofKind!=="programmableTransaction")throw new Error("Only programmable transactions are supported");const s=t.programmableTransaction.inputs.map(D9),r=t.programmableTransaction.commands.map(U9);let i=null;if(e.expiration)switch(e.expiration.kind){case la.NONE:i={$kind:"None",None:!0};break;case la.EPOCH:i={$kind:"Epoch",Epoch:e.expiration.epoch.toString()};break;case la.VALID_DURING:i={$kind:"ValidDuring",ValidDuring:{minEpoch:e.expiration.minEpoch?.toString()??null,maxEpoch:e.expiration.epoch?.toString()??null,minTimestamp:e.expiration.minTimestamp?Xf(e.expiration.minTimestamp):null,maxTimestamp:e.expiration.maxTimestamp?Xf(e.expiration.maxTimestamp):null,chain:e.expiration.chain??"",nonce:e.expiration.nonce??0}};break;case la.VALIDITY:i={$kind:"Validity",Validity:{minEpoch:e.expiration.minEpoch?.toString()??null,maxEpoch:e.expiration.epoch?.toString()??null,minTimestamp:e.expiration.minTimestamp?Xf(e.expiration.minTimestamp):null,maxTimestamp:e.expiration.maxTimestamp?Xf(e.expiration.maxTimestamp):null,chain:e.expiration.chain??"",nonce:e.expiration.nonce??0,allowedProposers:e.expiration.allowedProposers?{epoch:e.expiration.allowedProposers.epoch?.toString()??"0",proposers:zv(e.expiration.allowedProposers.proposers)}:null}};break;default:throw new Error(`Unknown transaction expiration kind: ${e.expiration.kind}`)}return{version:2,sender:e.sender??null,expiration:i,gasData:{budget:e.gasPayment?.budget?.toString()??null,owner:e.gasPayment?.owner??null,payment:e.gasPayment?.objects?.map(c=>({objectId:c.objectId,version:c.version.toString(),digest:c.digest}))??null,price:e.gasPayment?.price?.toString()??null},inputs:s,commands:r}}async function B9({transactionData:e,client:t,epoch:s,originalTransactionData:r,isTransactionKindOnly:i,doGasSelection:c}){if(i||c||r.expiration||r.gasData.payment?.length!==0||e.expiration&&e.expiration.$kind!=="None")return;const[{chainIdentifier:u},d]=await Promise.all([t.core.getChainIdentifier(),s==null?t.core.getCurrentSystemState():null]),p=BigInt(s??d.systemState.epoch);e.expiration={$kind:"ValidDuring",ValidDuring:{minEpoch:String(p),maxEpoch:String(p+1n),minTimestamp:null,maxTimestamp:null,chain:u,nonce:Math.random()*4294967296>>>0}}}let L9=(function(e){return e[e.EXECUTION_ERROR_KIND_UNKNOWN=0]="EXECUTION_ERROR_KIND_UNKNOWN",e[e.INSUFFICIENT_GAS=1]="INSUFFICIENT_GAS",e[e.INVALID_GAS_OBJECT=2]="INVALID_GAS_OBJECT",e[e.INVARIANT_VIOLATION=3]="INVARIANT_VIOLATION",e[e.FEATURE_NOT_YET_SUPPORTED=4]="FEATURE_NOT_YET_SUPPORTED",e[e.OBJECT_TOO_BIG=5]="OBJECT_TOO_BIG",e[e.PACKAGE_TOO_BIG=6]="PACKAGE_TOO_BIG",e[e.CIRCULAR_OBJECT_OWNERSHIP=7]="CIRCULAR_OBJECT_OWNERSHIP",e[e.INSUFFICIENT_COIN_BALANCE=8]="INSUFFICIENT_COIN_BALANCE",e[e.COIN_BALANCE_OVERFLOW=9]="COIN_BALANCE_OVERFLOW",e[e.PUBLISH_ERROR_NON_ZERO_ADDRESS=10]="PUBLISH_ERROR_NON_ZERO_ADDRESS",e[e.SUI_MOVE_VERIFICATION_ERROR=11]="SUI_MOVE_VERIFICATION_ERROR",e[e.MOVE_PRIMITIVE_RUNTIME_ERROR=12]="MOVE_PRIMITIVE_RUNTIME_ERROR",e[e.MOVE_ABORT=13]="MOVE_ABORT",e[e.VM_VERIFICATION_OR_DESERIALIZATION_ERROR=14]="VM_VERIFICATION_OR_DESERIALIZATION_ERROR",e[e.VM_INVARIANT_VIOLATION=15]="VM_INVARIANT_VIOLATION",e[e.FUNCTION_NOT_FOUND=16]="FUNCTION_NOT_FOUND",e[e.ARITY_MISMATCH=17]="ARITY_MISMATCH",e[e.TYPE_ARITY_MISMATCH=18]="TYPE_ARITY_MISMATCH",e[e.NON_ENTRY_FUNCTION_INVOKED=19]="NON_ENTRY_FUNCTION_INVOKED",e[e.COMMAND_ARGUMENT_ERROR=20]="COMMAND_ARGUMENT_ERROR",e[e.TYPE_ARGUMENT_ERROR=21]="TYPE_ARGUMENT_ERROR",e[e.UNUSED_VALUE_WITHOUT_DROP=22]="UNUSED_VALUE_WITHOUT_DROP",e[e.INVALID_PUBLIC_FUNCTION_RETURN_TYPE=23]="INVALID_PUBLIC_FUNCTION_RETURN_TYPE",e[e.INVALID_TRANSFER_OBJECT=24]="INVALID_TRANSFER_OBJECT",e[e.EFFECTS_TOO_LARGE=25]="EFFECTS_TOO_LARGE",e[e.PUBLISH_UPGRADE_MISSING_DEPENDENCY=26]="PUBLISH_UPGRADE_MISSING_DEPENDENCY",e[e.PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE=27]="PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE",e[e.PACKAGE_UPGRADE_ERROR=28]="PACKAGE_UPGRADE_ERROR",e[e.WRITTEN_OBJECTS_TOO_LARGE=29]="WRITTEN_OBJECTS_TOO_LARGE",e[e.CERTIFICATE_DENIED=30]="CERTIFICATE_DENIED",e[e.SUI_MOVE_VERIFICATION_TIMEDOUT=31]="SUI_MOVE_VERIFICATION_TIMEDOUT",e[e.CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED=32]="CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED",e[e.INPUT_OBJECT_DELETED=33]="INPUT_OBJECT_DELETED",e[e.EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION=34]="EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION",e[e.ADDRESS_DENIED_FOR_COIN=35]="ADDRESS_DENIED_FOR_COIN",e[e.COIN_TYPE_GLOBAL_PAUSE=36]="COIN_TYPE_GLOBAL_PAUSE",e[e.EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE=37]="EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE",e[e.MOVE_VECTOR_ELEM_TOO_BIG=38]="MOVE_VECTOR_ELEM_TOO_BIG",e[e.MOVE_RAW_VALUE_TOO_BIG=39]="MOVE_RAW_VALUE_TOO_BIG",e[e.INVALID_LINKAGE=40]="INVALID_LINKAGE",e[e.INSUFFICIENT_FUNDS_FOR_WITHDRAW=41]="INSUFFICIENT_FUNDS_FOR_WITHDRAW",e[e.NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED=42]="NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED",e})({}),UA=(function(e){return e[e.COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN=0]="COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",e[e.TYPE_MISMATCH=1]="TYPE_MISMATCH",e[e.INVALID_BCS_BYTES=2]="INVALID_BCS_BYTES",e[e.INVALID_USAGE_OF_PURE_ARGUMENT=3]="INVALID_USAGE_OF_PURE_ARGUMENT",e[e.INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION=4]="INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION",e[e.INDEX_OUT_OF_BOUNDS=5]="INDEX_OUT_OF_BOUNDS",e[e.SECONDARY_INDEX_OUT_OF_BOUNDS=6]="SECONDARY_INDEX_OUT_OF_BOUNDS",e[e.INVALID_RESULT_ARITY=7]="INVALID_RESULT_ARITY",e[e.INVALID_GAS_COIN_USAGE=8]="INVALID_GAS_COIN_USAGE",e[e.INVALID_VALUE_USAGE=9]="INVALID_VALUE_USAGE",e[e.INVALID_OBJECT_BY_VALUE=10]="INVALID_OBJECT_BY_VALUE",e[e.INVALID_OBJECT_BY_MUT_REF=11]="INVALID_OBJECT_BY_MUT_REF",e[e.CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED=12]="CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED",e[e.INVALID_ARGUMENT_ARITY=13]="INVALID_ARGUMENT_ARITY",e[e.INVALID_TRANSFER_OBJECT=14]="INVALID_TRANSFER_OBJECT",e[e.INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT=15]="INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT",e[e.ARGUMENT_WITHOUT_VALUE=16]="ARGUMENT_WITHOUT_VALUE",e[e.CANNOT_MOVE_BORROWED_VALUE=17]="CANNOT_MOVE_BORROWED_VALUE",e[e.CANNOT_WRITE_TO_EXTENDED_REFERENCE=18]="CANNOT_WRITE_TO_EXTENDED_REFERENCE",e[e.INVALID_REFERENCE_ARGUMENT=19]="INVALID_REFERENCE_ARGUMENT",e[e.INVALID_TX_CONTEXT=20]="INVALID_TX_CONTEXT",e})({}),z9=(function(e){return e[e.PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN=0]="PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",e[e.UNABLE_TO_FETCH_PACKAGE=1]="UNABLE_TO_FETCH_PACKAGE",e[e.NOT_A_PACKAGE=2]="NOT_A_PACKAGE",e[e.INCOMPATIBLE_UPGRADE=3]="INCOMPATIBLE_UPGRADE",e[e.DIGEST_DOES_NOT_MATCH=4]="DIGEST_DOES_NOT_MATCH",e[e.UNKNOWN_UPGRADE_POLICY=5]="UNKNOWN_UPGRADE_POLICY",e[e.PACKAGE_ID_DOES_NOT_MATCH=6]="PACKAGE_ID_DOES_NOT_MATCH",e})({}),$9=(function(e){return e[e.TYPE_ARGUMENT_ERROR_KIND_UNKNOWN=0]="TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",e[e.TYPE_NOT_FOUND=1]="TYPE_NOT_FOUND",e[e.CONSTRAINT_NOT_SATISFIED=2]="CONSTRAINT_NOT_SATISFIED",e})({});var V9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionStatus",[{no:1,name:"success",kind:"scalar",opt:!0,T:8},{no:2,name:"error",kind:"message",T:()=>F9}])}};const P9=new V9;var G9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionError",[{no:1,name:"description",kind:"scalar",opt:!0,T:9},{no:2,name:"command",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ExecutionError.ExecutionErrorKind",L9]},{no:4,name:"abort",kind:"message",oneof:"errorDetails",T:()=>q9},{no:5,name:"size_error",kind:"message",oneof:"errorDetails",T:()=>J9},{no:6,name:"command_argument_error",kind:"message",oneof:"errorDetails",T:()=>aD},{no:7,name:"type_argument_error",kind:"message",oneof:"errorDetails",T:()=>lD},{no:8,name:"package_upgrade_error",kind:"message",oneof:"errorDetails",T:()=>oD},{no:9,name:"index_error",kind:"message",oneof:"errorDetails",T:()=>BA},{no:10,name:"object_id",kind:"scalar",oneof:"errorDetails",T:9},{no:11,name:"coin_deny_list_error",kind:"message",oneof:"errorDetails",T:()=>tD},{no:12,name:"congested_objects",kind:"message",oneof:"errorDetails",T:()=>sD}])}};const F9=new G9;var H9=class extends Y{constructor(){super("sui.rpc.v2.MoveAbort",[{no:1,name:"abort_code",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"location",kind:"message",T:()=>Y9},{no:3,name:"clever_error",kind:"message",T:()=>X9}])}};const q9=new H9;var Z9=class extends Y{constructor(){super("sui.rpc.v2.MoveLocation",[{no:1,name:"package",kind:"scalar",opt:!0,T:9},{no:2,name:"module",kind:"scalar",opt:!0,T:9},{no:3,name:"function",kind:"scalar",opt:!0,T:13},{no:4,name:"instruction",kind:"scalar",opt:!0,T:13},{no:5,name:"function_name",kind:"scalar",opt:!0,T:9}])}};const Y9=new Z9;var W9=class extends Y{constructor(){super("sui.rpc.v2.CleverError",[{no:1,name:"error_code",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"line_number",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"constant_name",kind:"scalar",opt:!0,T:9},{no:4,name:"constant_type",kind:"scalar",opt:!0,T:9},{no:5,name:"rendered",kind:"scalar",oneof:"value",T:9},{no:6,name:"raw",kind:"scalar",oneof:"value",T:12}])}};const X9=new W9;var K9=class extends Y{constructor(){super("sui.rpc.v2.SizeError",[{no:1,name:"size",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"max_size",kind:"scalar",opt:!0,T:4,L:0}])}};const J9=new K9;var Q9=class extends Y{constructor(){super("sui.rpc.v2.IndexError",[{no:1,name:"index",kind:"scalar",opt:!0,T:13},{no:2,name:"subresult",kind:"scalar",opt:!0,T:13}])}};const BA=new Q9;var eD=class extends Y{constructor(){super("sui.rpc.v2.CoinDenyListError",[{no:1,name:"address",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const tD=new eD;var nD=class extends Y{constructor(){super("sui.rpc.v2.CongestedObjects",[{no:1,name:"objects",kind:"scalar",repeat:2,T:9}])}};const sD=new nD;var rD=class extends Y{constructor(){super("sui.rpc.v2.CommandArgumentError",[{no:1,name:"argument",kind:"scalar",opt:!0,T:13},{no:2,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CommandArgumentError.CommandArgumentErrorKind",UA]},{no:3,name:"index_error",kind:"message",T:()=>BA}])}};const aD=new rD;var iD=class extends Y{constructor(){super("sui.rpc.v2.PackageUpgradeError",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.PackageUpgradeError.PackageUpgradeErrorKind",z9]},{no:2,name:"package_id",kind:"scalar",opt:!0,T:9},{no:3,name:"digest",kind:"scalar",opt:!0,T:9},{no:4,name:"policy",kind:"scalar",opt:!0,T:13},{no:5,name:"ticket_id",kind:"scalar",opt:!0,T:9}])}};const oD=new iD;var cD=class extends Y{constructor(){super("sui.rpc.v2.TypeArgumentError",[{no:1,name:"type_argument",kind:"scalar",opt:!0,T:13},{no:2,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TypeArgumentError.TypeArgumentErrorKind",$9]}])}};const lD=new cD;var uD=class extends Y{constructor(){super("sui.rpc.v2.GasCostSummary",[{no:1,name:"computation_cost",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"storage_cost",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"storage_rebate",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"non_refundable_storage_fee",kind:"scalar",opt:!0,T:4,L:0}])}};const LA=new uD;let _h=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.DOES_NOT_EXIST=1]="DOES_NOT_EXIST",e[e.EXISTS=2]="EXISTS",e})({}),Ec=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.DOES_NOT_EXIST=1]="DOES_NOT_EXIST",e[e.OBJECT_WRITE=2]="OBJECT_WRITE",e[e.PACKAGE_WRITE=3]="PACKAGE_WRITE",e[e.ACCUMULATOR_WRITE=4]="ACCUMULATOR_WRITE",e})({}),Au=(function(e){return e[e.ID_OPERATION_UNKNOWN=0]="ID_OPERATION_UNKNOWN",e[e.NONE=1]="NONE",e[e.CREATED=2]="CREATED",e[e.DELETED=3]="DELETED",e})({}),dD=(function(e){return e[e.ACCUMULATOR_OPERATION_UNKNOWN=0]="ACCUMULATOR_OPERATION_UNKNOWN",e[e.MERGE=1]="MERGE",e[e.SPLIT=2]="SPLIT",e})({}),fD=(function(e){return e[e.ACCUMULATOR_VALUE_UNKNOWN=0]="ACCUMULATOR_VALUE_UNKNOWN",e[e.INTEGER=1]="INTEGER",e[e.INTEGER_TUPLE=2]="INTEGER_TUPLE",e[e.EVENT_DIGEST=3]="EVENT_DIGEST",e})({}),Ki=(function(e){return e[e.UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN=0]="UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",e[e.READ_ONLY_ROOT=1]="READ_ONLY_ROOT",e[e.MUTATE_CONSENSUS_STREAM_ENDED=2]="MUTATE_CONSENSUS_STREAM_ENDED",e[e.READ_CONSENSUS_STREAM_ENDED=3]="READ_CONSENSUS_STREAM_ENDED",e[e.CANCELED=4]="CANCELED",e[e.PER_EPOCH_CONFIG=5]="PER_EPOCH_CONFIG",e})({});var hD=class extends Y{constructor(){super("sui.rpc.v2.TransactionEffects",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:5},{no:4,name:"status",kind:"message",T:()=>P9},{no:5,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"gas_used",kind:"message",T:()=>LA},{no:7,name:"transaction_digest",kind:"scalar",opt:!0,T:9},{no:8,name:"gas_object",kind:"message",T:()=>PE},{no:9,name:"events_digest",kind:"scalar",opt:!0,T:9},{no:10,name:"dependencies",kind:"scalar",repeat:2,T:9},{no:11,name:"lamport_version",kind:"scalar",opt:!0,T:4,L:0},{no:12,name:"changed_objects",kind:"message",repeat:2,T:()=>PE},{no:13,name:"unchanged_consensus_objects",kind:"message",repeat:2,T:()=>TD},{no:14,name:"auxiliary_data_digest",kind:"scalar",opt:!0,T:9},{no:15,name:"unchanged_loaded_runtime_objects",kind:"message",repeat:2,T:()=>CA}])}};const pD=new hD;var mD=class extends Y{constructor(){super("sui.rpc.v2.ChangedObject",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"input_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.InputObjectState",_h,"INPUT_OBJECT_STATE_"]},{no:3,name:"input_version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"input_digest",kind:"scalar",opt:!0,T:9},{no:5,name:"input_owner",kind:"message",T:()=>av},{no:6,name:"output_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.OutputObjectState",Ec,"OUTPUT_OBJECT_STATE_"]},{no:7,name:"output_version",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"output_digest",kind:"scalar",opt:!0,T:9},{no:9,name:"output_owner",kind:"message",T:()=>av},{no:12,name:"accumulator_write",kind:"message",T:()=>bD},{no:10,name:"id_operation",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.IdOperation",Au]},{no:11,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const PE=new mD;var gD=class extends Y{constructor(){super("sui.rpc.v2.EventDigestEntry",[{no:1,name:"event_index",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"digest",kind:"scalar",opt:!0,T:9}])}};const yD=new gD;var vD=class extends Y{constructor(){super("sui.rpc.v2.AccumulatorWrite",[{no:1,name:"address",kind:"scalar",opt:!0,T:9},{no:2,name:"accumulator_type",kind:"scalar",opt:!0,T:9},{no:3,name:"operation",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.AccumulatorWrite.AccumulatorOperation",dD]},{no:4,name:"value_kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.AccumulatorWrite.AccumulatorValue",fD]},{no:5,name:"integer_value",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"integer_tuple",kind:"scalar",repeat:1,T:4,L:0},{no:7,name:"event_digest_value",kind:"message",repeat:2,T:()=>yD}])}};const bD=new vD;var wD=class extends Y{constructor(){super("sui.rpc.v2.UnchangedConsensusObject",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.UnchangedConsensusObject.UnchangedConsensusObjectKind",Ki]},{no:2,name:"object_id",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"digest",kind:"scalar",opt:!0,T:9},{no:5,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const TD=new wD,SD=50;function GE(e){if(e.after!=null&&e.before!=null)throw new Error("Only one of `after` or `before` may be provided");const t=e.order?e.order==="descending":e.before!=null;if(e.after!=null&&t)throw new Error("`after` can not be combined with descending queries");if(e.before!=null&&!t)throw new Error("`before` can not be combined with ascending queries");return{descending:t,after:e.after??void 0,before:e.before??void 0,limit:e.limit??SD}}function ED(e,t){if(e?.$kind==="function"&&(t.after!=null||t.before!=null)&&(!e.module||!e.function))throw new Error("Paginating transactions filtered by function requires a fully qualified `package::module::function`")}async function _D(e,t,s){if(zA(t,["sender","function"],"transaction"),t.sender!=null)return{$kind:"sender",sender:ye(t.sender)};const[r,i,c,...u]=t.function.split("::");if(!r||u.length>0||i===""||c==="")throw new Error(`Invalid function filter "${t.function}": expected "package", "package::module", or "package::module::function"`);return{$kind:"function",package:ye((await e.resolvePackage({package:r,signal:s})).package),module:i,function:c}}async function kD(e,t,s){if(zA(t,["sender","emitModule","eventType"],"event"),t.sender!=null)return{$kind:"sender",sender:ye(t.sender)};if(t.emitModule!=null){const[c,u,...d]=t.emitModule.split("::");if(!c||!u||d.length>0)throw new Error(`Invalid emitModule filter "${t.emitModule}": expected "package::module"`);return{$kind:"emitModule",package:ye((await e.resolvePackage({package:c,signal:s})).package),module:u}}const r=t.eventType,i=r.split("::");if(i.length===2&&i.every(c=>c!==""))return{$kind:"eventTypeModule",package:ye((await e.resolvePackage({package:i[0],signal:s})).package),module:i[1]};if(i.length<3||i.some(c=>c===""))throw new Error(`Invalid eventType filter "${r}": expected "package::module" or a fully qualified type name`);return{$kind:"eventType",eventType:(await e.resolveType({type:r,signal:s})).type}}function zA(e,t,s){const r=t.filter(i=>e[i]!=null);if(r.length!==1)throw new Error(`A ${s} filter must specify exactly one of ${t.join(", ")}${r.length?` (got ${r.join(", ")})`:""}`)}var AD=class extends Y{constructor(){super("sui.rpc.v2.BalanceChange",[{no:1,name:"address",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:3,name:"amount",kind:"scalar",opt:!0,T:9}])}};const OD=new AD;var ND=class extends Y{constructor(){super("sui.rpc.v2.TransactionEvents",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"events",kind:"message",repeat:2,T:()=>hb}])}};const xD=new ND;var CD=class extends Y{constructor(){super("sui.rpc.v2.Event",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"module",kind:"scalar",opt:!0,T:9},{no:3,name:"sender",kind:"scalar",opt:!0,T:9},{no:4,name:"event_type",kind:"scalar",opt:!0,T:9},{no:5,name:"contents",kind:"message",T:()=>Es},{no:6,name:"json",kind:"message",T:()=>pn},{no:7,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"transaction_digest",kind:"scalar",opt:!0,T:9},{no:9,name:"transaction_index",kind:"scalar",opt:!0,T:4,L:0},{no:10,name:"event_index",kind:"scalar",opt:!0,T:13}])}};const hb=new CD;let Mp=(function(e){return e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.SECP256R1=2]="SECP256R1",e[e.MULTISIG=3]="MULTISIG",e[e.BLS12381=4]="BLS12381",e[e.ZKLOGIN=5]="ZKLOGIN",e[e.PASSKEY=6]="PASSKEY",e})({});var ID=class extends Y{constructor(){super("sui.rpc.v2.UserSignature",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Mp]},{no:3,name:"simple",kind:"message",oneof:"signature",T:()=>pb},{no:4,name:"multisig",kind:"message",oneof:"signature",T:()=>VD},{no:5,name:"zklogin",kind:"message",oneof:"signature",T:()=>VA},{no:6,name:"passkey",kind:"message",oneof:"signature",T:()=>PA}])}};const Dp=new ID;var RD=class extends Y{constructor(){super("sui.rpc.v2.SimpleSignature",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Mp]},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"public_key",kind:"scalar",opt:!0,T:12}])}};const pb=new RD;var jD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginPublicIdentifier",[{no:1,name:"iss",kind:"scalar",opt:!0,T:9},{no:2,name:"address_seed",kind:"scalar",opt:!0,T:9}])}};const $A=new jD;var MD=class extends Y{constructor(){super("sui.rpc.v2.MultisigMemberPublicKey",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Mp]},{no:2,name:"public_key",kind:"scalar",opt:!0,T:12},{no:3,name:"zklogin",kind:"message",T:()=>$A}])}};const DD=new MD;var UD=class extends Y{constructor(){super("sui.rpc.v2.MultisigMember",[{no:1,name:"public_key",kind:"message",T:()=>DD},{no:2,name:"weight",kind:"scalar",opt:!0,T:13}])}};const BD=new UD;var LD=class extends Y{constructor(){super("sui.rpc.v2.MultisigCommittee",[{no:1,name:"members",kind:"message",repeat:2,T:()=>BD},{no:2,name:"threshold",kind:"scalar",opt:!0,T:13}])}};const zD=new LD;var $D=class extends Y{constructor(){super("sui.rpc.v2.MultisigAggregatedSignature",[{no:1,name:"signatures",kind:"message",repeat:2,T:()=>GD},{no:2,name:"bitmap",kind:"scalar",opt:!0,T:13},{no:3,name:"legacy_bitmap",kind:"scalar",opt:!0,T:12},{no:4,name:"committee",kind:"message",T:()=>zD}])}};const VD=new $D;var PD=class extends Y{constructor(){super("sui.rpc.v2.MultisigMemberSignature",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Mp]},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"zklogin",kind:"message",T:()=>VA},{no:4,name:"passkey",kind:"message",T:()=>PA}])}};const GD=new PD;var FD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginAuthenticator",[{no:1,name:"inputs",kind:"message",T:()=>qD},{no:2,name:"max_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"signature",kind:"message",T:()=>pb},{no:4,name:"public_identifier",kind:"message",T:()=>$A},{no:5,name:"jwk_id",kind:"message",T:()=>NA}])}};const VA=new FD;var HD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginInputs",[{no:1,name:"proof_points",kind:"message",T:()=>YD},{no:2,name:"iss_base64_details",kind:"message",T:()=>XD},{no:3,name:"header_base64",kind:"scalar",opt:!0,T:9},{no:4,name:"address_seed",kind:"scalar",opt:!0,T:9}])}};const qD=new HD;var ZD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginProof",[{no:1,name:"a",kind:"message",T:()=>FE},{no:2,name:"b",kind:"message",T:()=>QD},{no:3,name:"c",kind:"message",T:()=>FE}])}};const YD=new ZD;var WD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginClaim",[{no:1,name:"value",kind:"scalar",opt:!0,T:9},{no:2,name:"index_mod_4",kind:"scalar",opt:!0,T:13}])}};const XD=new WD;var KD=class extends Y{constructor(){super("sui.rpc.v2.CircomG1",[{no:1,name:"e0",kind:"scalar",opt:!0,T:9},{no:2,name:"e1",kind:"scalar",opt:!0,T:9},{no:3,name:"e2",kind:"scalar",opt:!0,T:9}])}};const FE=new KD;var JD=class extends Y{constructor(){super("sui.rpc.v2.CircomG2",[{no:1,name:"e00",kind:"scalar",opt:!0,T:9},{no:2,name:"e01",kind:"scalar",opt:!0,T:9},{no:3,name:"e10",kind:"scalar",opt:!0,T:9},{no:4,name:"e11",kind:"scalar",opt:!0,T:9},{no:5,name:"e20",kind:"scalar",opt:!0,T:9},{no:6,name:"e21",kind:"scalar",opt:!0,T:9}])}};const QD=new JD;var eU=class extends Y{constructor(){super("sui.rpc.v2.PasskeyAuthenticator",[{no:1,name:"authenticator_data",kind:"scalar",opt:!0,T:12},{no:2,name:"client_data_json",kind:"scalar",opt:!0,T:9},{no:3,name:"signature",kind:"message",T:()=>pb}])}};const PA=new eU;var tU=class extends Y{constructor(){super("sui.rpc.v2.ValidatorCommittee",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"members",kind:"message",repeat:2,T:()=>GA}])}};const nU=new tU;var sU=class extends Y{constructor(){super("sui.rpc.v2.ValidatorCommitteeMember",[{no:1,name:"public_key",kind:"scalar",opt:!0,T:12},{no:2,name:"weight",kind:"scalar",opt:!0,T:4,L:0}])}};const GA=new sU;var rU=class extends Y{constructor(){super("sui.rpc.v2.ValidatorAggregatedSignature",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"bitmap",kind:"scalar",opt:!0,T:12}])}};const aU=new rU;var iU=class extends Y{constructor(){super("sui.rpc.v2.ExecutedTransaction",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"transaction",kind:"message",T:()=>fb},{no:3,name:"signatures",kind:"message",repeat:2,T:()=>Dp},{no:4,name:"effects",kind:"message",T:()=>pD},{no:5,name:"events",kind:"message",T:()=>xD},{no:6,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"timestamp",kind:"message",T:()=>Nr},{no:8,name:"balance_changes",kind:"message",repeat:2,T:()=>OD},{no:9,name:"objects",kind:"message",T:()=>xA},{no:10,name:"transaction_index",kind:"scalar",opt:!0,T:4,L:0}])}};const pa=new iU;var oU=class extends Y{constructor(){super("google.protobuf.FieldMask",[{no:1,name:"paths",kind:"scalar",repeat:2,T:9}])}internalJsonWrite(e,t){const s=/[A-Z]|(_([.0-9_]|$))/g;return e.paths.map(r=>{if(s.test(r))throw new Error('Unable to encode FieldMask to JSON. lowerCamelCase of path name "'+r+'" is irreversible.');return Wh(r)}).join(",")}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse FieldMask from JSON "+ga(e)+". Expected string.");if(s||(s=this.create()),e==="")return s;let r=i=>{if(i.includes("_"))throw new Error("Unable to parse FieldMask from JSON. Path names must be lowerCamelCase.");return i.replace(/[A-Z]/g,c=>"_"+c.toLowerCase())};return s.paths=e.split(",").map(r),s}};const Ln=new oU;let Ou=(function(e){return e[e.ENABLED=0]="ENABLED",e[e.DISABLED=1]="DISABLED",e})({});var cU=class extends Y{constructor(){super("sui.rpc.v2.ExecuteTransactionRequest",[{no:1,name:"transaction",kind:"message",T:()=>fb},{no:2,name:"signatures",kind:"message",repeat:2,T:()=>Dp},{no:3,name:"read_mask",kind:"message",T:()=>Ln}])}};const lU=new cU;var uU=class extends Y{constructor(){super("sui.rpc.v2.ExecuteTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>pa}])}};const dU=new uU;var fU=class extends Y{constructor(){super("sui.rpc.v2.SimulateTransactionRequest",[{no:1,name:"transaction",kind:"message",T:()=>fb},{no:2,name:"read_mask",kind:"message",T:()=>Ln},{no:3,name:"checks",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SimulateTransactionRequest.TransactionChecks",Ou]},{no:4,name:"do_gas_selection",kind:"scalar",opt:!0,T:8}])}};const hU=new fU;var pU=class extends Y{constructor(){super("sui.rpc.v2.SimulateTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>pa},{no:2,name:"command_outputs",kind:"message",repeat:2,T:()=>gU},{no:3,name:"suggested_gas_price",kind:"scalar",opt:!0,T:4,L:0}])}};const FA=new pU;var mU=class extends Y{constructor(){super("sui.rpc.v2.CommandResult",[{no:1,name:"return_values",kind:"message",repeat:2,T:()=>HE},{no:2,name:"mutated_by_ref",kind:"message",repeat:2,T:()=>HE}])}};const gU=new mU;var yU=class extends Y{constructor(){super("sui.rpc.v2.CommandOutput",[{no:1,name:"argument",kind:"message",T:()=>Or},{no:2,name:"value",kind:"message",T:()=>Es},{no:3,name:"json",kind:"message",T:()=>pn}])}};const HE=new yU,W0=new vi("sui.rpc.v2.TransactionExecutionService",[{name:"ExecuteTransaction",options:{},I:lU,O:dU},{name:"SimulateTransaction",options:{},I:hU,O:FA}]);let iv=(function(e){return e[e.ASCENDING=0]="ASCENDING",e[e.DESCENDING=1]="DESCENDING",e})({}),Nu=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.ITEM_LIMIT=1]="ITEM_LIMIT",e[e.SCAN_LIMIT=2]="SCAN_LIMIT",e[e.CHECKPOINT_BOUND=3]="CHECKPOINT_BOUND",e[e.CURSOR_BOUND=4]="CURSOR_BOUND",e[e.LEDGER_TIP=5]="LEDGER_TIP",e})({});var vU=class extends Y{constructor(){super("sui.rpc.v2.QueryOptions",[{no:1,name:"limit",kind:"scalar",opt:!0,T:13},{no:2,name:"after",kind:"scalar",opt:!0,T:12},{no:3,name:"before",kind:"scalar",opt:!0,T:12},{no:4,name:"ordering",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Ordering",iv,"ORDERING_"]}])}};const mb=new vU;var bU=class extends Y{constructor(){super("sui.rpc.v2.Watermark",[{no:1,name:"cursor",kind:"scalar",opt:!0,T:12},{no:2,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0}])}};const od=new bU;var wU=class extends Y{constructor(){super("sui.rpc.v2.QueryEnd",[{no:1,name:"reason",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.QueryEndReason",Nu,"QUERY_END_REASON_"]}])}};const gb=new wU;function TU(e){return{terms:[{literals:[e.$kind==="sender"?{negated:!1,predicate:{oneofKind:"sender",sender:{address:e.sender}}}:{negated:!1,predicate:{oneofKind:"moveCall",moveCall:{function:[e.package,e.module,e.function].filter(Boolean).join("::")}}}]}]}}function SU(e){return{terms:[{literals:[e.$kind==="sender"?{negated:!1,predicate:{oneofKind:"sender",sender:{address:e.sender}}}:e.$kind==="emitModule"?{negated:!1,predicate:{oneofKind:"emitModule",emitModule:{module:`${e.package}::${e.module}`}}}:{negated:!1,predicate:{oneofKind:"eventType",eventType:{eventType:e.$kind==="eventTypeModule"?`${e.package}::${e.module}`:e.eventType}}}]}]}}function EU(e){if(typeof e!="object"||e===null)return!1;const{code:t,message:s}=e;return typeof t!="string"||typeof s!="string"?!1:t===we[we.NOT_FOUND]?!0:t!==we[we.RESOURCE_EXHAUSTED]?!1:s==="name has expired"?!0:!w8(e)&&s==="name%20has%20expired"}var _U=class extends O8{#e;constructor({client:e,...t}){super(t),this.#e=e}async getObjects(e){const t=Bh(e.objectIds,50),s=[],r=["owner","object_type","digest","version","object_id"];e.include?.content&&r.push("contents"),e.include?.previousTransaction&&r.push("previous_transaction"),e.include?.objectBcs&&r.push("bcs"),e.include?.json&&r.push("json"),e.include?.display&&r.push("display");for(const i of t){const c=await this.#e.ledgerService.batchGetObjects({requests:i.map(u=>({objectId:u})),readMask:{paths:r}},{abort:e.signal});s.push(...c.response.objects.map((u,d)=>{if(u.result.oneofKind==="error"){const O=u.result.error;return O.code===we.NOT_FOUND?new hh("notExists",O.message,{cause:O,reason:"notFound",objectId:i[d]}):new hh(we[O.code]??"unknown",O.message,{cause:O,reason:"unknown",objectId:i[d]})}if(u.result.oneofKind!=="object")return new hh("unknown","Unexpected result type",{reason:"unknown",objectId:i[d]});const p=u.result.object.contents?.value??void 0,m=u.result.object.bcs?.value??void 0,g=u.result.object.objectType,y=g&&g.includes("::")?De(g):g??"",b=e.include?.json?u.result.object.json?pn.toJson(u.result.object.json):null:void 0,E=ZE(e.include?.display,u.result.object.display);return{objectId:u.result.object.objectId,version:u.result.object.version?.toString(),digest:u.result.object.digest,content:p,owner:Qi(u.result.object.owner),type:y,previousTransaction:u.result.object.previousTransaction??void 0,objectBcs:m,json:b,display:E}}))}return{objects:s}}async listOwnedObjects(e){const t=["owner","object_type","digest","version","object_id"];e.include?.content&&t.push("contents"),e.include?.previousTransaction&&t.push("previous_transaction"),e.include?.objectBcs&&t.push("bcs"),e.include?.json&&t.push("json"),e.include?.display&&t.push("display");const s=await this.#e.stateService.listOwnedObjects({owner:e.owner,objectType:e.type?(await this.mvr.resolveType({type:e.type,signal:e.signal})).type:void 0,pageToken:e.cursor?Ge(e.cursor):void 0,pageSize:e.limit,readMask:{paths:t}},{abort:e.signal});return{objects:s.response.objects.map(r=>({objectId:r.objectId,version:r.version?.toString(),digest:r.digest,content:r.contents?.value,owner:Qi(r.owner),type:r.objectType,previousTransaction:r.previousTransaction??void 0,objectBcs:r.bcs?.value,json:e.include?.json?r.json?pn.toJson(r.json):null:void 0,display:ZE(e.include?.display,r.display)})),cursor:s.response.nextPageToken?Ke(s.response.nextPageToken):null,hasNextPage:s.response.nextPageToken!==void 0}}async listCoins(e){const t=["owner","object_type","digest","version","object_id","balance"],s=e.coinType??Vh,r=await this.#e.stateService.listOwnedObjects({owner:e.owner,objectType:`0x2::coin::Coin<${(await this.mvr.resolveType({type:s,signal:e.signal})).type}>`,pageToken:e.cursor?Ge(e.cursor):void 0,pageSize:e.limit,readMask:{paths:t}},{abort:e.signal});return{objects:r.response.objects.map(i=>({objectId:i.objectId,version:i.version?.toString(),digest:i.digest,owner:Qi(i.owner),type:i.objectType,balance:i.balance?.toString()})),cursor:r.response.nextPageToken?Ke(r.response.nextPageToken):null,hasNextPage:r.response.nextPageToken!==void 0}}async getBalance(e){const t=e.coinType??Vh,s=await this.#e.stateService.getBalance({owner:e.owner,coinType:(await this.mvr.resolveType({type:t,signal:e.signal})).type},{abort:e.signal});return{balance:{balance:s.response.balance?.balance?.toString()??"0",coinType:s.response.balance?.coinType??t,coinBalance:s.response.balance?.coinBalance?.toString()??"0",addressBalance:s.response.balance?.addressBalance?.toString()??"0"}}}async getCoinMetadata(e){const t=(await this.mvr.resolveType({type:e.coinType,signal:e.signal})).type;let s;try{({response:s}=await this.#e.stateService.getCoinInfo({coinType:t},{abort:e.signal}))}catch(r){if(e.signal?.aborted)throw r;return{coinMetadata:null}}return s.metadata?{coinMetadata:{id:s.metadata.id??null,decimals:s.metadata.decimals??0,name:s.metadata.name??"",symbol:s.metadata.symbol??"",description:s.metadata.description??"",iconUrl:s.metadata.iconUrl??null}}:{coinMetadata:null}}async listBalances(e){const t=await this.#e.stateService.listBalances({owner:e.owner,pageToken:e.cursor?Ge(e.cursor):void 0,pageSize:e.limit},{abort:e.signal});return{hasNextPage:!!t.response.nextPageToken,cursor:t.response.nextPageToken?Ke(t.response.nextPageToken):null,balances:t.response.balances.map(s=>({balance:s.balance?.toString()??"0",coinType:s.coinType,coinBalance:s.coinBalance?.toString()??"0",addressBalance:s.addressBalance?.toString()??"0"}))}}async getTransaction(e){try{const{response:t}=await this.#e.ledgerService.getTransaction({digest:e.digest,readMask:{paths:Kf(e.include)}},{abort:e.signal});if(!t.transaction)throw new uE("notFound",e.digest);return X0(kh(t.transaction,{include:e.include}),e.include,()=>pa.toJson(t.transaction))}catch(t){throw t instanceof gt&&t.code===we[we.NOT_FOUND]?new uE("notFound",e.digest,{cause:t}):t}}async executeTransaction(e){const{response:t}=await this.#e.transactionExecutionService.executeTransaction({transaction:{bcs:{value:e.transaction}},signatures:e.signatures.map(s=>({bcs:{value:Ge(s)},signature:{oneofKind:void 0}})),readMask:{paths:Kf(e.include)}},{abort:e.signal});return X0(kh(t.transaction,{include:e.include}),e.include,()=>pa.toJson(t.transaction))}async simulateTransaction(e){const t=Kf(e.include,"transaction.");e.include?.commandResults&&t.push("command_outputs"),e.transaction instanceof Uint8Array||await e.transaction.prepareForSerialization({client:this});const s=e.doGasSelection??(e.transaction instanceof Uint8Array?D8(e.transaction):e.transaction.getData().gasData.payment?.length===0),{response:r}=await this.#e.transactionExecutionService.simulateTransaction({transaction:e.transaction instanceof Uint8Array?{bcs:{value:e.transaction}}:M9(e.transaction),readMask:{paths:t},doGasSelection:s,checks:e.checksEnabled===!1?Ou.DISABLED:Ou.ENABLED},{abort:e.signal});return X0(NU(r,{include:e.include}),e.include,()=>FA.toJson(r))}async getReferenceGasPrice(e){return{referenceGasPrice:(await this.#e.ledgerService.getEpoch({readMask:{paths:["reference_gas_price"]}},{abort:e?.signal})).response.epoch?.referenceGasPrice?.toString()??""}}async getProtocolConfig(e){const t=(await this.#e.ledgerService.getEpoch({readMask:{paths:["protocol_config"]}},{abort:e?.signal})).response.epoch?.protocolConfig;if(!t)throw new Error("Protocol config not found in response");const s={...t.featureFlags},r={};if(t.attributes)for(const[i,c]of Object.entries(t.attributes))r[i]=c??null;return{protocolConfig:{protocolVersion:t.protocolVersion?.toString()??null,featureFlags:s,attributes:r}}}async getCurrentSystemState(e){const t=(await this.#e.ledgerService.getEpoch({readMask:{paths:["system_state.version","system_state.epoch","system_state.protocol_version","system_state.reference_gas_price","system_state.epoch_start_timestamp_ms","system_state.safe_mode","system_state.safe_mode_storage_rewards","system_state.safe_mode_computation_rewards","system_state.safe_mode_storage_rebates","system_state.safe_mode_non_refundable_storage_fee","system_state.parameters","system_state.storage_fund","system_state.stake_subsidy"]}},{abort:e?.signal})).response.epoch,s=t?.systemState;if(!s)throw new Error("System state not found in response");const r=t?.start?.seconds?Number(t.start.seconds)*1e3+Math.floor((t.start.nanos||0)/1e6):s.epochStartTimestampMs?Number(s.epochStartTimestampMs):null;return{systemState:{systemStateVersion:s.version?.toString()??null,epoch:s.epoch?.toString()??null,protocolVersion:s.protocolVersion?.toString()??null,referenceGasPrice:s.referenceGasPrice?.toString()??null,epochStartTimestampMs:r.toString(),safeMode:s.safeMode??!1,safeModeStorageRewards:s.safeModeStorageRewards?.toString()??null,safeModeComputationRewards:s.safeModeComputationRewards?.toString()??null,safeModeStorageRebates:s.safeModeStorageRebates?.toString()??null,safeModeNonRefundableStorageFee:s.safeModeNonRefundableStorageFee?.toString()??null,parameters:{epochDurationMs:s.parameters?.epochDurationMs?.toString()??null,stakeSubsidyStartEpoch:s.parameters?.stakeSubsidyStartEpoch?.toString()??null,maxValidatorCount:s.parameters?.maxValidatorCount?.toString()??null,minValidatorJoiningStake:s.parameters?.minValidatorJoiningStake?.toString()??null,validatorLowStakeThreshold:s.parameters?.validatorLowStakeThreshold?.toString()??null,validatorLowStakeGracePeriod:s.parameters?.validatorLowStakeGracePeriod?.toString()??null},storageFund:{totalObjectStorageRebates:s.storageFund?.totalObjectStorageRebates?.toString()??null,nonRefundableBalance:s.storageFund?.nonRefundableBalance?.toString()??null},stakeSubsidy:{balance:s.stakeSubsidy?.balance?.toString()??null,distributionCounter:s.stakeSubsidy?.distributionCounter?.toString()??null,currentDistributionAmount:s.stakeSubsidy?.currentDistributionAmount?.toString()??null,stakeSubsidyPeriodLength:s.stakeSubsidy?.stakeSubsidyPeriodLength?.toString()??null,stakeSubsidyDecreaseRate:s.stakeSubsidy?.stakeSubsidyDecreaseRate??null}}}}async listDynamicFields(e){return this.#e.listDynamicFields(e)}async listTransactions(e){const t=Kf(e.include),s=e.filter?await _D(this.mvr,e.filter,e.signal):void 0,r=GE(e);ED(s,r);const i=this.#e.ledgerService.listTransactions({readMask:{paths:t},filter:s&&TU(s),options:qE(r,r.limit+1)},{abort:e.signal}),c=[];let u=null,d=null,p=null,m,g=!1;for await(const b of i.responses)b.watermark?.cursor&&(p=Ke(b.watermark.cursor)),b.transaction&&(c.length>=r.limit?g=!0:(u??=p,d=p,c.push(kh(b.transaction,{include:e.include})))),b.end&&(m=b.end);const y=g||m?.reason===Nu.SCAN_LIMIT||m?.reason===Nu.ITEM_LIMIT;return{transactions:c,hasNextPage:y,startCursor:u,endCursor:g?d:y?p??d:d}}async listEvents(e){const t=GE(e),s=this.#e.ledgerService.listEvents({readMask:{paths:["package_id","module","sender","event_type","contents","json","checkpoint","transaction_digest","event_index"]},filter:e.filter?SU(await kD(this.mvr,e.filter,e.signal)):void 0,options:qE(t,t.limit+1)},{abort:e.signal}),r=[];let i=null,c=null,u=null,d,p=!1;for await(const g of s.responses){if(g.watermark?.cursor&&(u=Ke(g.watermark.cursor)),g.event)if(r.length>=t.limit)p=!0;else{i??=u,c=u;const y=g.event;r.push({packageId:ye(y.packageId),module:y.module,sender:ye(y.sender),eventType:De(y.eventType),bcs:y.contents?.value??new Uint8Array,json:y.json?pn.toJson(y.json):null,checkpoint:y.checkpoint?.toString()??null,transactionDigest:y.transactionDigest,eventIndex:y.eventIndex})}g.end&&(d=g.end)}const m=p||d?.reason===Nu.SCAN_LIMIT||d?.reason===Nu.ITEM_LIMIT;return{events:r,hasNextPage:m,startCursor:i,endCursor:p?c:m?u??c:c}}async verifyZkLoginSignature(e){const t=Ge(e.bytes),s=e.intentScope==="PersonalMessage"?M.byteVector().serialize(t).toBytes():t,{response:r}=await this.#e.signatureVerificationService.verifySignature({message:{name:e.intentScope,value:s},signature:{bcs:{value:Ge(e.signature)},signature:{oneofKind:void 0}},address:e.address,jwks:[]},{abort:e.signal});return{success:r.isValid??!1,errors:r.reason?[r.reason]:[]}}async defaultNameServiceName(e){return{data:{name:(await this.#e.nameService.reverseLookupName({address:e.address},{abort:e.signal})).response.record?.name??null}}}async resolveNameServiceAddress(e){try{const{response:t}=await this.#e.nameService.lookupName({name:e.name},{abort:e.signal});return{address:t.record?.targetAddress??null}}catch(t){if(EU(t))return{address:null};throw t}}async getMoveFunction(e){const t=(await this.mvr.resolvePackage({package:e.packageId,signal:e.signal})).package,{response:s}=await this.#e.movePackageService.getFunction({packageId:t,moduleName:e.moduleName,name:e.name},{abort:e.signal});let r="unknown";switch(s.function?.visibility){case Eh.PUBLIC:r="public";break;case Eh.PRIVATE:r="private";break;case Eh.FRIEND:r="friend";break}return{function:{packageId:ye(t),moduleName:e.moduleName,name:s.function?.name,visibility:r,isEntry:s.function?.isEntry??!1,typeParameters:s.function?.typeParameters?.map(({constraints:i})=>({isPhantom:!1,constraints:i.map(c=>{switch(c){case Nc.COPY:return"copy";case Nc.DROP:return"drop";case Nc.STORE:return"store";case Nc.KEY:return"key";default:return"unknown"}})??[]}))??[],parameters:s.function?.parameters?.map(i=>KE(i))??[],returns:s.function?.returns?.map(i=>KE(i))??[]}}}async getChainIdentifier(e){return fh(Promise.resolve(this.cache.read(["chainIdentifier"],async()=>{const{response:t}=await this.#e.ledgerService.getServiceInfo({});if(!t.chainId)throw new Error("Chain identifier not found in service info");return{chainIdentifier:t.chainId}})),e?.signal)}resolveTransactionPlugin(){const e=this.#e;return async function(s,r,i){const c=s.snapshot();c.sender||(c.sender="0x0000000000000000000000000000000000000000000000000000000000000000");const u=MA(c),d=!r.onlyTransactionKind&&(c.gasData.budget==null||c.gasData.payment==null);let p;try{p=(await e.transactionExecutionService.simulateTransaction({transaction:u,doGasSelection:d,checks:r.onlyTransactionKind?Ou.DISABLED:Ou.ENABLED,readMask:{paths:["transaction.transaction.sender","transaction.transaction.gas_payment","transaction.transaction.expiration","transaction.transaction.kind","transaction.effects.status","transaction.effects.epoch"]}})).response}catch(m){throw m instanceof Error&&m.message?new Yy(m.message,{cause:m}):m}if(!r.onlyTransactionKind&&p.transaction?.effects?.status&&!p.transaction.effects.status.success){const m=p.transaction.effects.status.error?yb(p.transaction.effects.status.error):void 0;throw new Yy(`Transaction resolution failed: ${m?.message??"Transaction failed"}`,{executionError:m})}if(!p.transaction?.transaction)throw new Error("simulateTransaction did not return resolved transaction data");return j9(s,p.transaction.transaction,r),await B9({transactionData:s,client:e,epoch:p.transaction.effects?.epoch,originalTransactionData:c,isTransactionKindOnly:!!r.onlyTransactionKind,doGasSelection:d}),await i()}}};function qE(e,t){return{limit:t,ordering:e.descending?iv.DESCENDING:iv.ASCENDING,after:e.after?Ge(e.after):void 0,before:e.before?Ge(e.before):void 0}}function Kf(e,t=""){const s=["digest","transaction.digest","signatures","effects.status","timestamp","checkpoint"];return e?.transaction&&s.push("transaction.sender","transaction.gas_payment","transaction.expiration","transaction.kind"),e?.bcs&&s.push("transaction.bcs"),e?.balanceChanges&&s.push("balance_changes"),e?.effects&&s.push("effects"),e?.events&&s.push("events"),e?.objectTypes&&(s.push("effects.changed_objects.object_type"),s.push("effects.changed_objects.object_id")),t?s.map(r=>t+r):s}function X0(e,t,s){return t?.protoJson?{...e,protoJson:s()}:e}function ZE(e,t){if(e)return t===void 0?null:{output:t.output!==void 0?pn.toJson(t.output):null,errors:t.errors!==void 0?pn.toJson(t.errors):null}}function Qi(e){if(!e)return null;if(e.kind===Sc.IMMUTABLE)return{$kind:"Immutable",Immutable:!0};if(e.kind===Sc.ADDRESS)return{AddressOwner:e.address,$kind:"AddressOwner"};if(e.kind===Sc.OBJECT)return{$kind:"ObjectOwner",ObjectOwner:e.address};if(e.kind===Sc.SHARED)return{$kind:"Shared",Shared:{initialSharedVersion:e.version?.toString()}};if(e.kind===Sc.CONSENSUS_ADDRESS)return{$kind:"ConsensusAddressOwner",ConsensusAddressOwner:{startVersion:e.version?.toString(),owner:e.address}};throw new Error(`Unknown owner kind ${JSON.stringify(e,(t,s)=>typeof s=="bigint"?s.toString():s)}`)}function yb(e){const t=e.description??"Unknown error",s=e.command!=null?Number(e.command):void 0,r=e.errorDetails;switch(r?.oneofKind){case"abort":{const i=r.abort,c=i.cleverError;return{$kind:"MoveAbort",message:SA({command:s,location:i.location,abortCode:String(i.abortCode??0n),cleverError:c?{lineNumber:c.lineNumber!=null?Number(c.lineNumber):void 0,constantName:c.constantName,value:c.value?.oneofKind==="rendered"?c.value.rendered:void 0}:void 0}),command:s,MoveAbort:kU(i)}}case"sizeError":return{$kind:"SizeError",message:t,command:s,SizeError:{name:Hi(e.kind),size:Number(r.sizeError.size??0n),maxSize:Number(r.sizeError.maxSize??0n)}};case"commandArgumentError":return{$kind:"CommandArgumentError",message:t,command:s,CommandArgumentError:{argument:r.commandArgumentError.argument??0,name:Hi(r.commandArgumentError.kind)}};case"typeArgumentError":return{$kind:"TypeArgumentError",message:t,command:s,TypeArgumentError:{typeArgument:r.typeArgumentError.typeArgument??0,name:Hi(r.typeArgumentError.kind)}};case"packageUpgradeError":return{$kind:"PackageUpgradeError",message:t,command:s,PackageUpgradeError:{name:Hi(r.packageUpgradeError.kind),packageId:r.packageUpgradeError.packageId,digest:r.packageUpgradeError.digest}};case"indexError":return{$kind:"IndexError",message:t,command:s,IndexError:{index:r.indexError.index,subresult:r.indexError.subresult}};case"coinDenyListError":return{$kind:"CoinDenyListError",message:t,command:s,CoinDenyListError:{name:Hi(e.kind),coinType:r.coinDenyListError.coinType,address:r.coinDenyListError.address}};case"congestedObjects":return{$kind:"CongestedObjects",message:t,command:s,CongestedObjects:{name:Hi(e.kind),objects:r.congestedObjects.objects}};case"objectId":return{$kind:"ObjectIdError",message:t,command:s,ObjectIdError:{name:Hi(e.kind),objectId:r.objectId}};default:return{$kind:"Unknown",message:t,command:s,Unknown:null}}}function kU(e){return{abortCode:String(e.abortCode??0n),location:{...e.location},cleverError:e.cleverError?{errorCode:e.cleverError.errorCode!=null?Number(e.cleverError.errorCode):void 0,lineNumber:e.cleverError.lineNumber!=null?Number(e.cleverError.lineNumber):void 0,constantName:e.cleverError.constantName,constantType:e.cleverError.constantType,value:e.cleverError.value?.oneofKind==="rendered"?e.cleverError.value.rendered:e.cleverError.value?.oneofKind==="raw"?Ke(e.cleverError.value.raw):void 0}:void 0}}function Hi(e){if(e==null)return"Unknown";const t=UA[e];return!t||t.endsWith("_UNKNOWN")?"Unknown":t.split("_").map(s=>s.charAt(0)+s.slice(1).toLowerCase()).join("")}function YE(e){if(e==null)return null;switch(e){case Au.CREATED:return"Created";case Au.DELETED:return"Deleted";case Au.NONE:case Au.ID_OPERATION_UNKNOWN:return"None";default:return"Unknown"}}function WE(e){if(e==null)return null;switch(e){case _h.EXISTS:return"Exists";case _h.DOES_NOT_EXIST:return"DoesNotExist";case _h.UNKNOWN:return"Unknown";default:return"Unknown"}}function XE(e){if(e==null)return null;switch(e){case Ec.OBJECT_WRITE:return"ObjectWrite";case Ec.PACKAGE_WRITE:return"PackageWrite";case Ec.DOES_NOT_EXIST:return"DoesNotExist";case Ec.ACCUMULATOR_WRITE:return"AccumulatorWriteV1";case Ec.UNKNOWN:return"Unknown";default:return"Unknown"}}function AU(e){if(e==null)return null;switch(e){case Ki.UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN:return"Unknown";case Ki.READ_ONLY_ROOT:return"ReadOnlyRoot";case Ki.MUTATE_CONSENSUS_STREAM_ENDED:return"MutateConsensusStreamEnded";case Ki.READ_CONSENSUS_STREAM_ENDED:return"ReadConsensusStreamEnded";case Ki.CANCELED:return"Cancelled";case Ki.PER_EPOCH_CONFIG:return"PerEpochConfig";default:return"Unknown"}}function OU({effects:e}){if(!e)return null;const t=e.changedObjects.map(s=>({objectId:s.objectId,inputState:WE(s.inputState),inputVersion:s.inputVersion?.toString()??null,inputDigest:s.inputDigest??null,inputOwner:Qi(s.inputOwner),outputState:XE(s.outputState),outputVersion:s.outputVersion?.toString()??null,outputDigest:s.outputDigest??null,outputOwner:Qi(s.outputOwner),idOperation:YE(s.idOperation)}));return{bcs:e.bcs?.value,version:e.version??2,status:e.status?.success?{success:!0,error:null}:{success:!1,error:yb(e.status.error)},gasUsed:{computationCost:e.gasUsed?.computationCost?.toString(),storageCost:e.gasUsed?.storageCost?.toString(),storageRebate:e.gasUsed?.storageRebate?.toString(),nonRefundableStorageFee:e.gasUsed?.nonRefundableStorageFee?.toString()},transactionDigest:e.transactionDigest,gasObject:e.gasObject?{objectId:e.gasObject.objectId,inputState:WE(e.gasObject.inputState),inputVersion:e.gasObject.inputVersion?.toString()??null,inputDigest:e.gasObject.inputDigest??null,inputOwner:Qi(e.gasObject.inputOwner),outputState:XE(e.gasObject.outputState),outputVersion:e.gasObject.outputVersion?.toString()??null,outputDigest:e.gasObject.outputDigest??null,outputOwner:Qi(e.gasObject.outputOwner),idOperation:YE(e.gasObject.idOperation)}:null,eventsDigest:e.eventsDigest??null,dependencies:e.dependencies,lamportVersion:e.lamportVersion?.toString()??null,changedObjects:t,unchangedConsensusObjects:e.unchangedConsensusObjects.map(s=>({kind:AU(s.kind),objectId:s.objectId,version:s.version?.toString()??null,digest:s.digest??null})),auxiliaryDataDigest:e.auxiliaryDataDigest??null}}function kh(e,t){const s=t?.include,r={};s?.objectTypes&&e.effects?.changedObjects?.forEach(m=>{m.objectId&&m.objectType&&(r[m.objectId]=m.objectType)});let i;if(s?.transaction){const m=e.transaction;if(!m)throw new Error("Transaction data is required but missing from gRPC response");const g=DA(m);i={gasData:g.gasData,sender:g.sender,expiration:g.expiration,commands:g.commands,inputs:g.inputs,version:g.version}}const c=s?.bcs?e.transaction?.bcs?.value:void 0,u=s?.effects?OU({effects:e.effects}):void 0,d=e.effects?.status?.success?{success:!0,error:null}:{success:!1,error:e.effects?.status?.error?yb(e.effects.status.error):{$kind:"Unknown",message:"Transaction failed",Unknown:null}},p={digest:e.digest,epoch:e.effects?.epoch?.toString()??null,timestampMs:e.timestamp?Number(e.timestamp.seconds)*1e3+Math.floor(e.timestamp.nanos/1e6):null,checkpoint:e.checkpoint?.toString()??null,status:d,effects:u,objectTypes:s?.objectTypes?r:void 0,transaction:i,bcs:c,signatures:e.signatures?.map(m=>Ke(m.bcs?.value))??[],balanceChanges:s?.balanceChanges?e.balanceChanges?.map(m=>({coinType:m.coinType,address:m.address,amount:m.amount}))??[]:void 0,events:s?.events?e.events?.events.map(m=>({packageId:ye(m.packageId),module:m.module,sender:ye(m.sender),eventType:m.eventType,bcs:m.contents?.value??new Uint8Array,json:m.json?pn.toJson(m.json):null}))??[]:void 0};return d.success?{$kind:"Transaction",Transaction:p}:{$kind:"FailedTransaction",FailedTransaction:p}}function NU(e,t){const s=t?.include,r=kh(e.transaction,{include:s}),i=s?.commandResults&&e.commandOutputs?e.commandOutputs.map(c=>({returnValues:(c.returnValues??[]).map(u=>({bcs:u.value?.value??null})),mutatedReferences:(c.mutatedByRef??[]).map(u=>({bcs:u.value?.value??null}))})):void 0;return r.$kind==="Transaction"?{$kind:"Transaction",Transaction:r.Transaction,commandResults:i}:{$kind:"FailedTransaction",FailedTransaction:r.FailedTransaction,commandResults:i}}function KE(e){let t=null;return e.reference===rv.IMMUTABLE?t="immutable":e.reference===rv.MUTABLE&&(t="mutable"),{reference:t,body:ov(e.body)}}function ov(e){switch(e.type){case ys.TYPE_UNKNOWN:return{$kind:"unknown"};case ys.ADDRESS:return{$kind:"address"};case ys.BOOL:return{$kind:"bool"};case ys.U8:return{$kind:"u8"};case ys.U16:return{$kind:"u16"};case ys.U32:return{$kind:"u32"};case ys.U64:return{$kind:"u64"};case ys.U128:return{$kind:"u128"};case ys.U256:return{$kind:"u256"};case ys.VECTOR:return{$kind:"vector",vector:ov(e.typeParameterInstantiation[0])};case ys.DATATYPE:return{$kind:"datatype",datatype:{typeName:e.typeName,typeParameters:e.typeParameterInstantiation.map(t=>ov(t))}};case ys.TYPE_PARAMETER:return{$kind:"typeParameter",index:e.typeParameter};default:return{$kind:"unknown"}}}var xU=class{constructor(e){this._transport=e,this.typeName=W0.typeName,this.methods=W0.methods,this.options=W0.options}executeTransaction(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}simulateTransaction(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},CU=class extends Y{constructor(){super("sui.rpc.v2.TransactionFilter",[{no:1,name:"terms",kind:"message",repeat:2,T:()=>RU}])}};const Up=new CU;var IU=class extends Y{constructor(){super("sui.rpc.v2.TransactionTerm",[{no:1,name:"literals",kind:"message",repeat:2,T:()=>MU}])}};const RU=new IU;var jU=class extends Y{constructor(){super("sui.rpc.v2.TransactionLiteral",[{no:1,name:"negated",kind:"scalar",T:8},{no:2,name:"sender",kind:"message",oneof:"predicate",T:()=>qA},{no:3,name:"affected_address",kind:"message",oneof:"predicate",T:()=>PU},{no:4,name:"affected_object",kind:"message",oneof:"predicate",T:()=>FU},{no:5,name:"move_call",kind:"message",oneof:"predicate",T:()=>qU},{no:6,name:"emit_module",kind:"message",oneof:"predicate",T:()=>ZA},{no:7,name:"event_type",kind:"message",oneof:"predicate",T:()=>YA},{no:8,name:"event_stream_head",kind:"message",oneof:"predicate",T:()=>WA},{no:9,name:"package_write",kind:"message",oneof:"predicate",T:()=>KU}])}};const MU=new jU;var DU=class extends Y{constructor(){super("sui.rpc.v2.EventFilter",[{no:1,name:"terms",kind:"message",repeat:2,T:()=>BU}])}};const HA=new DU;var UU=class extends Y{constructor(){super("sui.rpc.v2.EventTerm",[{no:1,name:"literals",kind:"message",repeat:2,T:()=>zU}])}};const BU=new UU;var LU=class extends Y{constructor(){super("sui.rpc.v2.EventLiteral",[{no:1,name:"negated",kind:"scalar",T:8},{no:2,name:"sender",kind:"message",oneof:"predicate",T:()=>qA},{no:3,name:"emit_module",kind:"message",oneof:"predicate",T:()=>ZA},{no:4,name:"event_type",kind:"message",oneof:"predicate",T:()=>YA},{no:5,name:"event_stream_head",kind:"message",oneof:"predicate",T:()=>WA}])}};const zU=new LU;var $U=class extends Y{constructor(){super("sui.rpc.v2.SenderFilter",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const qA=new $U;var VU=class extends Y{constructor(){super("sui.rpc.v2.AffectedAddressFilter",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const PU=new VU;var GU=class extends Y{constructor(){super("sui.rpc.v2.AffectedObjectFilter",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9}])}};const FU=new GU;var HU=class extends Y{constructor(){super("sui.rpc.v2.MoveCallFilter",[{no:1,name:"function",kind:"scalar",opt:!0,T:9}])}};const qU=new HU;var ZU=class extends Y{constructor(){super("sui.rpc.v2.EmitModuleFilter",[{no:1,name:"module",kind:"scalar",opt:!0,T:9}])}};const ZA=new ZU;var YU=class extends Y{constructor(){super("sui.rpc.v2.EventTypeFilter",[{no:1,name:"event_type",kind:"scalar",opt:!0,T:9}])}};const YA=new YU;var WU=class extends Y{constructor(){super("sui.rpc.v2.EventStreamHeadFilter",[{no:1,name:"stream_id",kind:"scalar",opt:!0,T:9}])}};const WA=new WU;var XU=class extends Y{constructor(){super("sui.rpc.v2.PackageWriteFilter",[])}};const KU=new XU;var JU=class extends Y{constructor(){super("sui.rpc.v2.ProtocolConfig",[{no:1,name:"protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"feature_flags",kind:"map",K:9,V:{kind:"scalar",T:8}},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"configs",kind:"map",K:9,V:{kind:"message",T:()=>pn}}])}};const QU=new JU;var e7=class extends Y{constructor(){super("sui.rpc.v2.SystemState",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"validators",kind:"message",T:()=>f7},{no:5,name:"storage_fund",kind:"message",T:()=>u7},{no:6,name:"parameters",kind:"message",T:()=>a7},{no:7,name:"reference_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"validator_report_records",kind:"message",repeat:2,T:()=>s7},{no:9,name:"stake_subsidy",kind:"message",T:()=>c7},{no:10,name:"safe_mode",kind:"scalar",opt:!0,T:8},{no:11,name:"safe_mode_storage_rewards",kind:"scalar",opt:!0,T:4,L:0},{no:12,name:"safe_mode_computation_rewards",kind:"scalar",opt:!0,T:4,L:0},{no:13,name:"safe_mode_storage_rebates",kind:"scalar",opt:!0,T:4,L:0},{no:14,name:"safe_mode_non_refundable_storage_fee",kind:"scalar",opt:!0,T:4,L:0},{no:15,name:"epoch_start_timestamp_ms",kind:"scalar",opt:!0,T:4,L:0},{no:16,name:"extra_fields",kind:"message",T:()=>$s}])}};const t7=new e7;var n7=class extends Y{constructor(){super("sui.rpc.v2.ValidatorReportRecord",[{no:1,name:"reported",kind:"scalar",opt:!0,T:9},{no:2,name:"reporters",kind:"scalar",repeat:2,T:9}])}};const s7=new n7;var r7=class extends Y{constructor(){super("sui.rpc.v2.SystemParameters",[{no:1,name:"epoch_duration_ms",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"stake_subsidy_start_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"min_validator_count",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"max_validator_count",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"min_validator_joining_stake",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"validator_low_stake_threshold",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"validator_very_low_stake_threshold",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"validator_low_stake_grace_period",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"extra_fields",kind:"message",T:()=>$s}])}};const a7=new r7;var i7=class extends Y{constructor(){super("sui.rpc.v2.MoveTable",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"size",kind:"scalar",opt:!0,T:4,L:0}])}};const $s=new i7;var o7=class extends Y{constructor(){super("sui.rpc.v2.StakeSubsidy",[{no:1,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"distribution_counter",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"current_distribution_amount",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"stake_subsidy_period_length",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"stake_subsidy_decrease_rate",kind:"scalar",opt:!0,T:13},{no:6,name:"extra_fields",kind:"message",T:()=>$s}])}};const c7=new o7;var l7=class extends Y{constructor(){super("sui.rpc.v2.StorageFund",[{no:1,name:"total_object_storage_rebates",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"non_refundable_balance",kind:"scalar",opt:!0,T:4,L:0}])}};const u7=new l7;var d7=class extends Y{constructor(){super("sui.rpc.v2.ValidatorSet",[{no:1,name:"total_stake",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"active_validators",kind:"message",repeat:2,T:()=>p7},{no:3,name:"pending_active_validators",kind:"message",T:()=>$s},{no:4,name:"pending_removals",kind:"scalar",repeat:1,T:4,L:0},{no:5,name:"staking_pool_mappings",kind:"message",T:()=>$s},{no:6,name:"inactive_validators",kind:"message",T:()=>$s},{no:7,name:"validator_candidates",kind:"message",T:()=>$s},{no:8,name:"at_risk_validators",kind:"map",K:9,V:{kind:"scalar",T:4,L:0}},{no:9,name:"extra_fields",kind:"message",T:()=>$s}])}};const f7=new d7;var h7=class extends Y{constructor(){super("sui.rpc.v2.Validator",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"address",kind:"scalar",opt:!0,T:9},{no:3,name:"description",kind:"scalar",opt:!0,T:9},{no:4,name:"image_url",kind:"scalar",opt:!0,T:9},{no:5,name:"project_url",kind:"scalar",opt:!0,T:9},{no:7,name:"protocol_public_key",kind:"scalar",opt:!0,T:12},{no:8,name:"proof_of_possession",kind:"scalar",opt:!0,T:12},{no:10,name:"network_public_key",kind:"scalar",opt:!0,T:12},{no:12,name:"worker_public_key",kind:"scalar",opt:!0,T:12},{no:13,name:"network_address",kind:"scalar",opt:!0,T:9},{no:14,name:"p2p_address",kind:"scalar",jsonName:"p2pAddress",opt:!0,T:9},{no:15,name:"primary_address",kind:"scalar",opt:!0,T:9},{no:16,name:"worker_address",kind:"scalar",opt:!0,T:9},{no:18,name:"next_epoch_protocol_public_key",kind:"scalar",opt:!0,T:12},{no:19,name:"next_epoch_proof_of_possession",kind:"scalar",opt:!0,T:12},{no:21,name:"next_epoch_network_public_key",kind:"scalar",opt:!0,T:12},{no:23,name:"next_epoch_worker_public_key",kind:"scalar",opt:!0,T:12},{no:24,name:"next_epoch_network_address",kind:"scalar",opt:!0,T:9},{no:25,name:"next_epoch_p2p_address",kind:"scalar",jsonName:"nextEpochP2pAddress",opt:!0,T:9},{no:26,name:"next_epoch_primary_address",kind:"scalar",opt:!0,T:9},{no:27,name:"next_epoch_worker_address",kind:"scalar",opt:!0,T:9},{no:28,name:"metadata_extra_fields",kind:"message",T:()=>$s},{no:29,name:"voting_power",kind:"scalar",opt:!0,T:4,L:0},{no:30,name:"operation_cap_id",kind:"scalar",opt:!0,T:9},{no:31,name:"gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:32,name:"staking_pool",kind:"message",T:()=>g7},{no:33,name:"commission_rate",kind:"scalar",opt:!0,T:4,L:0},{no:34,name:"next_epoch_stake",kind:"scalar",opt:!0,T:4,L:0},{no:35,name:"next_epoch_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:36,name:"next_epoch_commission_rate",kind:"scalar",opt:!0,T:4,L:0},{no:37,name:"extra_fields",kind:"message",T:()=>$s}])}};const p7=new h7;var m7=class extends Y{constructor(){super("sui.rpc.v2.StakingPool",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"activation_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"deactivation_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"sui_balance",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"rewards_pool",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"pool_token_balance",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"exchange_rates",kind:"message",T:()=>$s},{no:8,name:"pending_stake",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"pending_total_sui_withdraw",kind:"scalar",opt:!0,T:4,L:0},{no:10,name:"pending_pool_token_withdraw",kind:"scalar",opt:!0,T:4,L:0},{no:11,name:"extra_fields",kind:"message",T:()=>$s}])}};const g7=new m7;var y7=class extends Y{constructor(){super("sui.rpc.v2.Epoch",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"committee",kind:"message",T:()=>nU},{no:3,name:"system_state",kind:"message",T:()=>t7},{no:4,name:"first_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"last_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"start",kind:"message",T:()=>Nr},{no:7,name:"end",kind:"message",T:()=>Nr},{no:8,name:"reference_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"protocol_config",kind:"message",T:()=>QU}])}};const v7=new y7;var b7=class extends Y{constructor(){super("sui.rpc.v2.CheckpointContents",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:5},{no:4,name:"transactions",kind:"message",repeat:2,T:()=>S7}])}};const w7=new b7;var T7=class extends Y{constructor(){super("sui.rpc.v2.CheckpointedTransactionInfo",[{no:1,name:"transaction",kind:"scalar",opt:!0,T:9},{no:2,name:"effects",kind:"scalar",opt:!0,T:9},{no:3,name:"signatures",kind:"message",repeat:2,T:()=>Dp},{no:4,name:"address_aliases_versions",kind:"message",repeat:2,T:()=>_7}])}};const S7=new T7;var E7=class extends Y{constructor(){super("sui.rpc.v2.AddressAliasesVersion",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const _7=new E7;let k7=(function(e){return e[e.CHECKPOINT_COMMITMENT_KIND_UNKNOWN=0]="CHECKPOINT_COMMITMENT_KIND_UNKNOWN",e[e.ECMH_LIVE_OBJECT_SET=1]="ECMH_LIVE_OBJECT_SET",e[e.CHECKPOINT_ARTIFACTS=2]="CHECKPOINT_ARTIFACTS",e})({});var A7=class extends Y{constructor(){super("sui.rpc.v2.CheckpointSummary",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"sequence_number",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"total_network_transactions",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"content_digest",kind:"scalar",opt:!0,T:9},{no:7,name:"previous_digest",kind:"scalar",opt:!0,T:9},{no:8,name:"epoch_rolling_gas_cost_summary",kind:"message",T:()=>LA},{no:9,name:"timestamp",kind:"message",T:()=>Nr},{no:10,name:"commitments",kind:"message",repeat:2,T:()=>XA},{no:11,name:"end_of_epoch_data",kind:"message",T:()=>x7},{no:12,name:"version_specific_data",kind:"scalar",opt:!0,T:12}])}};const O7=new A7;var N7=class extends Y{constructor(){super("sui.rpc.v2.EndOfEpochData",[{no:1,name:"next_epoch_committee",kind:"message",repeat:2,T:()=>GA},{no:2,name:"next_epoch_protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"epoch_commitments",kind:"message",repeat:2,T:()=>XA}])}};const x7=new N7;var C7=class extends Y{constructor(){super("sui.rpc.v2.CheckpointCommitment",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CheckpointCommitment.CheckpointCommitmentKind",k7]},{no:2,name:"digest",kind:"scalar",opt:!0,T:9}])}};const XA=new C7;var I7=class extends Y{constructor(){super("sui.rpc.v2.Checkpoint",[{no:1,name:"sequence_number",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"summary",kind:"message",T:()=>O7},{no:4,name:"signature",kind:"message",T:()=>aU},{no:5,name:"contents",kind:"message",T:()=>w7},{no:6,name:"transactions",kind:"message",repeat:2,T:()=>pa},{no:7,name:"objects",kind:"message",T:()=>xA}])}};const vb=new I7;var R7=class extends Y{constructor(){super("google.protobuf.Any",[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}])}pack(e,t){return{typeUrl:this.typeNameToUrl(t.typeName),value:t.toBinary(e)}}unpack(e,t,s){if(!this.contains(e,t))throw new Error("Cannot unpack google.protobuf.Any with typeUrl '"+e.typeUrl+"' as "+t.typeName+".");return t.fromBinary(e.value,s)}contains(e,t){return e.typeUrl.length?(typeof t=="string"?t:t.typeName)===this.typeUrlToName(e.typeUrl):!1}internalJsonWrite(e,t){if(e.typeUrl==="")return{};let s=this.typeUrlToName(e.typeUrl),r=dA(t),i=r.typeRegistry?.find(d=>d.typeName===s);if(!i)throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '"+e.typeUrl+"' to JSON. The specified type "+s+" is not available in the type registry.");let c=i.fromBinary(e.value,{readUnknownField:!1}),u=i.internalJsonWrite(c,r);return(s.startsWith("google.protobuf.")||!Hh(u))&&(u={value:u}),u["@type"]=e.typeUrl,u}internalJsonRead(e,t,s){if(!Hh(e))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+ga(e)+".");if(typeof e["@type"]!="string"||e["@type"]=="")return this.create();let r=this.typeUrlToName(e["@type"]),i=t?.typeRegistry?.find(u=>u.typeName==r);if(!i)throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type "+r+" is not available in the type registry.");let c;if(r.startsWith("google.protobuf.")&&e.hasOwnProperty("value"))c=i.fromJson(e.value,t);else{let u=Object.assign({},e);delete u["@type"],c=i.fromJson(u,t)}return s===void 0&&(s=this.create()),s.typeUrl=e["@type"],s.value=i.toBinary(c),s}typeNameToUrl(e){if(!e.length)throw new Error("invalid type name: "+e);return"type.googleapis.com/"+e}typeUrlToName(e){if(!e.length)throw new Error("invalid type url: "+e);let t=e.lastIndexOf("/"),s=t>0?e.substring(t+1):e;if(!s.length)throw new Error("invalid type url: "+e);return s}};const j7=new R7;var M7=class extends Y{constructor(){super("google.rpc.Status",[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",repeat:2,T:()=>j7}])}};const KA=new M7;var D7=class extends Y{constructor(){super("sui.rpc.v2.GetServiceInfoRequest",[])}};const U7=new D7;var B7=class extends Y{constructor(){super("sui.rpc.v2.GetServiceInfoResponse",[{no:1,name:"chain_id",kind:"scalar",opt:!0,T:9},{no:2,name:"chain",kind:"scalar",opt:!0,T:9},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"checkpoint_height",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"timestamp",kind:"message",T:()=>Nr},{no:6,name:"lowest_available_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"lowest_available_checkpoint_objects",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"server",kind:"scalar",opt:!0,T:9}])}};const L7=new B7;var z7=class extends Y{constructor(){super("sui.rpc.v2.GetObjectRequest",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"read_mask",kind:"message",T:()=>Ln}])}};const JA=new z7;var $7=class extends Y{constructor(){super("sui.rpc.v2.GetObjectResponse",[{no:1,name:"object",kind:"message",T:()=>mo}])}};const V7=new $7;var P7=class extends Y{constructor(){super("sui.rpc.v2.BatchGetObjectsRequest",[{no:1,name:"requests",kind:"message",repeat:2,T:()=>JA},{no:2,name:"read_mask",kind:"message",T:()=>Ln}])}};const G7=new P7;var F7=class extends Y{constructor(){super("sui.rpc.v2.BatchGetObjectsResponse",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>Z7}])}};const H7=new F7;var q7=class extends Y{constructor(){super("sui.rpc.v2.GetObjectResult",[{no:1,name:"object",kind:"message",oneof:"result",T:()=>mo},{no:2,name:"error",kind:"message",oneof:"result",T:()=>KA}])}};const Z7=new q7;var Y7=class extends Y{constructor(){super("sui.rpc.v2.GetTransactionRequest",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"read_mask",kind:"message",T:()=>Ln}])}};const W7=new Y7;var X7=class extends Y{constructor(){super("sui.rpc.v2.GetTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>pa}])}};const K7=new X7;var J7=class extends Y{constructor(){super("sui.rpc.v2.BatchGetTransactionsRequest",[{no:1,name:"digests",kind:"scalar",repeat:2,T:9},{no:2,name:"read_mask",kind:"message",T:()=>Ln}])}};const Q7=new J7;var eB=class extends Y{constructor(){super("sui.rpc.v2.BatchGetTransactionsResponse",[{no:1,name:"transactions",kind:"message",repeat:2,T:()=>sB}])}};const tB=new eB;var nB=class extends Y{constructor(){super("sui.rpc.v2.GetTransactionResult",[{no:1,name:"transaction",kind:"message",oneof:"result",T:()=>pa},{no:2,name:"error",kind:"message",oneof:"result",T:()=>KA}])}};const sB=new nB;var rB=class extends Y{constructor(){super("sui.rpc.v2.GetCheckpointRequest",[{no:1,name:"sequence_number",kind:"scalar",oneof:"checkpointId",T:4,L:0},{no:2,name:"digest",kind:"scalar",oneof:"checkpointId",T:9},{no:3,name:"read_mask",kind:"message",T:()=>Ln}])}};const aB=new rB;var iB=class extends Y{constructor(){super("sui.rpc.v2.GetCheckpointResponse",[{no:1,name:"checkpoint",kind:"message",T:()=>vb}])}};const oB=new iB;var cB=class extends Y{constructor(){super("sui.rpc.v2.GetEpochRequest",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"read_mask",kind:"message",T:()=>Ln}])}};const lB=new cB;var uB=class extends Y{constructor(){super("sui.rpc.v2.GetEpochResponse",[{no:1,name:"epoch",kind:"message",T:()=>v7}])}};const dB=new uB;var fB=class extends Y{constructor(){super("sui.rpc.v2.ListCheckpointsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"start_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"end_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"filter",kind:"message",T:()=>Up},{no:5,name:"options",kind:"message",T:()=>mb}])}};const hB=new fB;var pB=class extends Y{constructor(){super("sui.rpc.v2.ListCheckpointsResponse",[{no:1,name:"checkpoint",kind:"message",T:()=>vb},{no:2,name:"watermark",kind:"message",T:()=>od},{no:3,name:"end",kind:"message",T:()=>gb}])}};const mB=new pB;var gB=class extends Y{constructor(){super("sui.rpc.v2.ListTransactionsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"start_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"end_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"filter",kind:"message",T:()=>Up},{no:5,name:"options",kind:"message",T:()=>mb}])}};const yB=new gB;var vB=class extends Y{constructor(){super("sui.rpc.v2.ListTransactionsResponse",[{no:1,name:"transaction",kind:"message",T:()=>pa},{no:2,name:"watermark",kind:"message",T:()=>od},{no:3,name:"end",kind:"message",T:()=>gb}])}};const bB=new vB;var wB=class extends Y{constructor(){super("sui.rpc.v2.ListEventsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"start_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"end_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"filter",kind:"message",T:()=>HA},{no:5,name:"options",kind:"message",T:()=>mb}])}};const TB=new wB;var SB=class extends Y{constructor(){super("sui.rpc.v2.ListEventsResponse",[{no:1,name:"event",kind:"message",T:()=>hb},{no:2,name:"watermark",kind:"message",T:()=>od},{no:3,name:"end",kind:"message",T:()=>gb}])}};const EB=new SB,K0=new vi("sui.rpc.v2.LedgerService",[{name:"GetServiceInfo",options:{},I:U7,O:L7},{name:"GetObject",options:{},I:JA,O:V7},{name:"BatchGetObjects",options:{},I:G7,O:H7},{name:"GetTransaction",options:{},I:W7,O:K7},{name:"BatchGetTransactions",options:{},I:Q7,O:tB},{name:"GetCheckpoint",options:{},I:aB,O:oB},{name:"GetEpoch",options:{},I:lB,O:dB},{name:"ListCheckpoints",serverStreaming:!0,options:{},I:hB,O:mB},{name:"ListTransactions",serverStreaming:!0,options:{},I:yB,O:bB},{name:"ListEvents",serverStreaming:!0,options:{},I:TB,O:EB}]);var _B=class{constructor(e){this._transport=e,this.typeName=K0.typeName,this.methods=K0.methods,this.options=K0.options}getServiceInfo(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getObject(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}batchGetObjects(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getTransaction(e,t){const s=this.methods[3],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}batchGetTransactions(e,t){const s=this.methods[4],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getCheckpoint(e,t){const s=this.methods[5],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getEpoch(e,t){const s=this.methods[6],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listCheckpoints(e,t){const s=this.methods[7],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}listTransactions(e,t){const s=this.methods[8],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}listEvents(e,t){const s=this.methods[9],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}},kB=class extends Y{constructor(){super("sui.rpc.v2.GetPackageRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9}])}};const AB=new kB;var OB=class extends Y{constructor(){super("sui.rpc.v2.GetPackageResponse",[{no:1,name:"package",kind:"message",T:()=>EA}])}};const NB=new OB;var xB=class extends Y{constructor(){super("sui.rpc.v2.GetDatatypeRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"module_name",kind:"scalar",opt:!0,T:9},{no:3,name:"name",kind:"scalar",opt:!0,T:9}])}};const CB=new xB;var IB=class extends Y{constructor(){super("sui.rpc.v2.GetDatatypeResponse",[{no:1,name:"datatype",kind:"message",T:()=>_A}])}};const RB=new IB;var jB=class extends Y{constructor(){super("sui.rpc.v2.GetFunctionRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"module_name",kind:"scalar",opt:!0,T:9},{no:3,name:"name",kind:"scalar",opt:!0,T:9}])}};const MB=new jB;var DB=class extends Y{constructor(){super("sui.rpc.v2.GetFunctionResponse",[{no:1,name:"function",kind:"message",T:()=>OA}])}};const UB=new DB;var BB=class extends Y{constructor(){super("sui.rpc.v2.ListPackageVersionsRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12}])}};const LB=new BB;var zB=class extends Y{constructor(){super("sui.rpc.v2.ListPackageVersionsResponse",[{no:1,name:"versions",kind:"message",repeat:2,T:()=>PB},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const $B=new zB;var VB=class extends Y{constructor(){super("sui.rpc.v2.PackageVersion",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const PB=new VB,J0=new vi("sui.rpc.v2.MovePackageService",[{name:"GetPackage",options:{},I:AB,O:NB},{name:"GetDatatype",options:{},I:CB,O:RB},{name:"GetFunction",options:{},I:MB,O:UB},{name:"ListPackageVersions",options:{},I:LB,O:$B}]);var GB=class{constructor(e){this._transport=e,this.typeName=J0.typeName,this.methods=J0.methods,this.options=J0.options}getPackage(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getDatatype(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getFunction(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listPackageVersions(e,t){const s=this.methods[3],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},FB=class extends Y{constructor(){super("sui.rpc.v2.VerifySignatureRequest",[{no:1,name:"message",kind:"message",T:()=>Es},{no:2,name:"signature",kind:"message",T:()=>Dp},{no:3,name:"address",kind:"scalar",opt:!0,T:9},{no:4,name:"jwks",kind:"message",repeat:2,T:()=>jA}])}};const HB=new FB;var qB=class extends Y{constructor(){super("sui.rpc.v2.VerifySignatureResponse",[{no:1,name:"is_valid",kind:"scalar",opt:!0,T:8},{no:2,name:"reason",kind:"scalar",opt:!0,T:9}])}};const ZB=new qB,Q0=new vi("sui.rpc.v2.SignatureVerificationService",[{name:"VerifySignature",options:{},I:HB,O:ZB}]);var YB=class{constructor(e){this._transport=e,this.typeName=Q0.typeName,this.methods=Q0.methods,this.options=Q0.options}verifySignature(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}};let WB=(function(e){return e[e.METADATA_CAP_STATE_UNKNOWN=0]="METADATA_CAP_STATE_UNKNOWN",e[e.CLAIMED=1]="CLAIMED",e[e.UNCLAIMED=2]="UNCLAIMED",e[e.DELETED=3]="DELETED",e})({}),XB=(function(e){return e[e.SUPPLY_STATE_UNKNOWN=0]="SUPPLY_STATE_UNKNOWN",e[e.FIXED=1]="FIXED",e[e.BURN_ONLY=2]="BURN_ONLY",e})({}),KB=(function(e){return e[e.COIN_REGULATED_STATE_UNKNOWN=0]="COIN_REGULATED_STATE_UNKNOWN",e[e.REGULATED=1]="REGULATED",e[e.UNREGULATED=2]="UNREGULATED",e})({}),QA=(function(e){return e[e.DYNAMIC_FIELD_KIND_UNKNOWN=0]="DYNAMIC_FIELD_KIND_UNKNOWN",e[e.FIELD=1]="FIELD",e[e.OBJECT=2]="OBJECT",e})({});var JB=class extends Y{constructor(){super("sui.rpc.v2.GetCoinInfoRequest",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const QB=new JB;var eL=class extends Y{constructor(){super("sui.rpc.v2.GetCoinInfoResponse",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:2,name:"metadata",kind:"message",T:()=>sL},{no:3,name:"treasury",kind:"message",T:()=>aL},{no:4,name:"regulated_metadata",kind:"message",T:()=>oL}])}};const tL=new eL;var nL=class extends Y{constructor(){super("sui.rpc.v2.CoinMetadata",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"decimals",kind:"scalar",opt:!0,T:13},{no:3,name:"name",kind:"scalar",opt:!0,T:9},{no:4,name:"symbol",kind:"scalar",opt:!0,T:9},{no:5,name:"description",kind:"scalar",opt:!0,T:9},{no:6,name:"icon_url",kind:"scalar",opt:!0,T:9},{no:7,name:"metadata_cap_id",kind:"scalar",opt:!0,T:9},{no:8,name:"metadata_cap_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CoinMetadata.MetadataCapState",WB]}])}};const sL=new nL;var rL=class extends Y{constructor(){super("sui.rpc.v2.CoinTreasury",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"total_supply",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"supply_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CoinTreasury.SupplyState",XB]}])}};const aL=new rL;var iL=class extends Y{constructor(){super("sui.rpc.v2.RegulatedCoinMetadata",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_metadata_object",kind:"scalar",opt:!0,T:9},{no:3,name:"deny_cap_object",kind:"scalar",opt:!0,T:9},{no:4,name:"allow_global_pause",kind:"scalar",opt:!0,T:8},{no:5,name:"variant",kind:"scalar",opt:!0,T:13},{no:6,name:"coin_regulated_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.RegulatedCoinMetadata.CoinRegulatedState",KB]}])}};const oL=new iL;var cL=class extends Y{constructor(){super("sui.rpc.v2.GetBalanceRequest",[{no:1,name:"owner",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const lL=new cL;var uL=class extends Y{constructor(){super("sui.rpc.v2.GetBalanceResponse",[{no:1,name:"balance",kind:"message",T:()=>e3}])}};const dL=new uL;var fL=class extends Y{constructor(){super("sui.rpc.v2.ListBalancesRequest",[{no:1,name:"owner",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12}])}};const hL=new fL;var pL=class extends Y{constructor(){super("sui.rpc.v2.ListBalancesResponse",[{no:1,name:"balances",kind:"message",repeat:2,T:()=>e3},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const mL=new pL;var gL=class extends Y{constructor(){super("sui.rpc.v2.Balance",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:3,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"address_balance",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"coin_balance",kind:"scalar",opt:!0,T:4,L:0}])}};const e3=new gL;var yL=class extends Y{constructor(){super("sui.rpc.v2.ListDynamicFieldsRequest",[{no:1,name:"parent",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12},{no:4,name:"read_mask",kind:"message",T:()=>Ln}])}};const vL=new yL;var bL=class extends Y{constructor(){super("sui.rpc.v2.ListDynamicFieldsResponse",[{no:1,name:"dynamic_fields",kind:"message",repeat:2,T:()=>SL},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const wL=new bL;var TL=class extends Y{constructor(){super("sui.rpc.v2.DynamicField",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.DynamicField.DynamicFieldKind",QA]},{no:2,name:"parent",kind:"scalar",opt:!0,T:9},{no:3,name:"field_id",kind:"scalar",opt:!0,T:9},{no:4,name:"field_object",kind:"message",T:()=>mo},{no:5,name:"name",kind:"message",T:()=>Es},{no:6,name:"value",kind:"message",T:()=>Es},{no:7,name:"value_type",kind:"scalar",opt:!0,T:9},{no:8,name:"child_id",kind:"scalar",opt:!0,T:9},{no:9,name:"child_object",kind:"message",T:()=>mo}])}};const SL=new TL;var EL=class extends Y{constructor(){super("sui.rpc.v2.ListOwnedObjectsRequest",[{no:1,name:"owner",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12},{no:4,name:"read_mask",kind:"message",T:()=>Ln},{no:5,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const _L=new EL;var kL=class extends Y{constructor(){super("sui.rpc.v2.ListOwnedObjectsResponse",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>mo},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const AL=new kL,ey=new vi("sui.rpc.v2.StateService",[{name:"ListDynamicFields",options:{},I:vL,O:wL},{name:"ListOwnedObjects",options:{},I:_L,O:AL},{name:"GetCoinInfo",options:{},I:QB,O:tL},{name:"GetBalance",options:{},I:lL,O:dL},{name:"ListBalances",options:{},I:hL,O:mL}]);var OL=class{constructor(e){this._transport=e,this.typeName=ey.typeName,this.methods=ey.methods,this.options=ey.options}listDynamicFields(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listOwnedObjects(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getCoinInfo(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getBalance(e,t){const s=this.methods[3],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listBalances(e,t){const s=this.methods[4],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},NL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeCheckpointsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"filter",kind:"message",T:()=>Up}])}};const xL=new NL;var CL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeCheckpointsResponse",[{no:1,name:"cursor",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"checkpoint",kind:"message",T:()=>vb}])}};const IL=new CL;var RL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeTransactionsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"filter",kind:"message",T:()=>Up}])}};const jL=new RL;var ML=class extends Y{constructor(){super("sui.rpc.v2.SubscribeTransactionsResponse",[{no:1,name:"transaction",kind:"message",T:()=>pa},{no:2,name:"watermark",kind:"message",T:()=>od}])}};const DL=new ML;var UL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeEventsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"filter",kind:"message",T:()=>HA}])}};const BL=new UL;var LL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeEventsResponse",[{no:1,name:"event",kind:"message",T:()=>hb},{no:2,name:"watermark",kind:"message",T:()=>od}])}};const zL=new LL,ty=new vi("sui.rpc.v2.SubscriptionService",[{name:"SubscribeCheckpoints",serverStreaming:!0,options:{},I:xL,O:IL},{name:"SubscribeTransactions",serverStreaming:!0,options:{},I:jL,O:DL},{name:"SubscribeEvents",serverStreaming:!0,options:{},I:BL,O:zL}]);var $L=class{constructor(e){this._transport=e,this.typeName=ty.typeName,this.methods=ty.methods,this.options=ty.options}subscribeCheckpoints(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}subscribeTransactions(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}subscribeEvents(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}},VL=class extends Y{constructor(){super("sui.rpc.v2.LookupNameRequest",[{no:1,name:"name",kind:"scalar",opt:!0,T:9}])}};const PL=new VL;var GL=class extends Y{constructor(){super("sui.rpc.v2.LookupNameResponse",[{no:1,name:"record",kind:"message",T:()=>t3}])}};const FL=new GL;var HL=class extends Y{constructor(){super("sui.rpc.v2.ReverseLookupNameRequest",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const qL=new HL;var ZL=class extends Y{constructor(){super("sui.rpc.v2.ReverseLookupNameResponse",[{no:1,name:"record",kind:"message",T:()=>t3}])}};const YL=new ZL;var WL=class extends Y{constructor(){super("sui.rpc.v2.NameRecord",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"registration_nft_id",kind:"scalar",opt:!0,T:9},{no:4,name:"expiration_timestamp",kind:"message",T:()=>Nr},{no:5,name:"target_address",kind:"scalar",opt:!0,T:9},{no:6,name:"data",kind:"map",K:9,V:{kind:"scalar",T:9}}])}};const t3=new WL,ny=new vi("sui.rpc.v2.NameService",[{name:"LookupName",options:{},I:PL,O:FL},{name:"ReverseLookupName",options:{},I:qL,O:YL}]);var XL=class{constructor(e){this._transport=e,this.typeName=ny.typeName,this.methods=ny.methods,this.options=ny.options}lookupName(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}reverseLookupName(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},KL=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceClockRequest",[{no:1,name:"duration_ms",kind:"scalar",opt:!0,T:4,L:0}])}};const JL=new KL;var QL=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceClockResponse",[{no:1,name:"timestamp_ms",kind:"scalar",T:4,L:0},{no:2,name:"tx_digest",kind:"scalar",T:9}])}};const ez=new QL;var tz=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceCheckpointRequest",[])}};const nz=new tz;var sz=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceCheckpointResponse",[{no:1,name:"checkpoint_sequence_number",kind:"scalar",T:4,L:0},{no:2,name:"timestamp_ms",kind:"scalar",T:4,L:0}])}};const rz=new sz;var az=class extends Y{constructor(){super("sui.forking.v1alpha.GetStatusRequest",[])}};const iz=new az;var oz=class extends Y{constructor(){super("sui.forking.v1alpha.GetStatusResponse",[{no:1,name:"epoch",kind:"scalar",T:4,L:0},{no:2,name:"checkpoint_sequence_number",kind:"scalar",T:4,L:0},{no:3,name:"timestamp_ms",kind:"scalar",T:4,L:0},{no:4,name:"forked_at_checkpoint",kind:"scalar",T:4,L:0}])}};const cz=new oz,sy=new vi("sui.forking.v1alpha.ForkingService",[{name:"AdvanceClock",options:{},I:JL,O:ez},{name:"AdvanceCheckpoint",options:{},I:nz,O:rz},{name:"GetStatus",options:{},I:iz,O:cz}]);var lz=class{constructor(e){this._transport=e,this.typeName=sy.typeName,this.methods=sy.methods,this.options=sy.options}advanceClock(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}advanceCheckpoint(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getStatus(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}};const uz=Symbol.for("@mysten/SuiGrpcClient");var bb=class extends TA{get mvr(){return this.core.mvr}get[uz](){return!0}constructor(e){super({network:e.network});const{network:t,mvr:s,abort:r,transport:i,...c}=e,u=_8(i??new lb(c));this.transactionExecutionService=new xU(u),this.ledgerService=new _B(u),this.stateService=new OL(u),this.subscriptionService=new $L(u),this.movePackageService=new GB(u),this.signatureVerificationService=new YB(u),this.nameService=new XL(u),this.forkingService=new lz(u),this.core=new _U({client:this,base:this,network:e.network,mvr:e.mvr})}getObjects(e){return this.core.getObjects(e)}getObject(e){return this.core.getObject(e)}listCoins(e){return this.core.listCoins(e)}listOwnedObjects(e){return this.core.listOwnedObjects(e)}getBalance(e){return this.core.getBalance(e)}listBalances(e){return this.core.listBalances(e)}getCoinMetadata(e){return this.core.getCoinMetadata(e)}getTransaction(e){return this.core.getTransaction(e)}executeTransaction(e){return this.core.executeTransaction(e)}signAndExecuteTransaction(e){return this.core.signAndExecuteTransaction(e)}waitForTransaction(e){return this.core.waitForTransaction(e)}simulateTransaction(e){return this.core.simulateTransaction(e)}getReferenceGasPrice(e){return this.core.getReferenceGasPrice(e)}getCurrentSystemState(e){return this.core.getCurrentSystemState(e)}getProtocolConfig(e){return this.core.getProtocolConfig(e)}getChainIdentifier(e){return this.core.getChainIdentifier(e)}async listDynamicFields(e){const t=e.include?.value??!1,s=["field_id","name","value_type","kind","child_id"];t&&s.push("value");const r=await this.stateService.listDynamicFields({parent:e.parentId,pageToken:e.cursor?Ge(e.cursor):void 0,pageSize:e.limit,readMask:{paths:s}},{abort:e.signal});return{dynamicFields:r.response.dynamicFields.map(i=>{const c=i.kind===QA.OBJECT,u=c?`0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${i.name?.name}>,0x2::object::ID>`:`0x2::dynamic_field::Field<${i.name?.name},${i.valueType}>`;return{$kind:c?"DynamicObject":"DynamicField",fieldId:i.fieldId,name:{type:i.name?.name,bcs:i.name?.value},valueType:i.valueType,type:De(u),childId:i.childId,value:t?{type:i.valueType,bcs:i.value?.value??new Uint8Array}:void 0}}),cursor:r.response.nextPageToken?Ke(r.response.nextPageToken):null,hasNextPage:r.response.nextPageToken!==void 0}}getDynamicField(e){return this.core.getDynamicField(e)}getDynamicObjectField(e){return this.core.getDynamicObjectField(e)}listTransactions(e){return this.core.listTransactions(e)}listEvents(e){return this.core.listEvents(e)}getMoveFunction(e){return this.core.getMoveFunction(e)}resolveTransactionPlugin(){return this.core.resolveTransactionPlugin()}verifyZkLoginSignature(e){return this.core.verifyZkLoginSignature(e)}defaultNameServiceName(e){return this.core.defaultNameServiceName(e)}resolveNameServiceAddress(e){return this.core.resolveNameServiceAddress(e)}};const dz="Dev Wallet",JE="dev-wallet:networks",fz={devnet:"https://fullnode.devnet.sui.io:443",testnet:"https://fullnode.testnet.sui.io:443",localnet:"http://127.0.0.1:9000"};var hz=class{#e;#t;#r;#s;#a;#i;#o;#c;#n;#m;#h;#f;#p=null;#l;#g;#d;#y;#u;#b;#w;#k=!1;constructor(e){e.adapters.length===0&&console.warn("[dev-wallet] No adapters provided. The wallet will have no accounts."),this.#e=e.adapters,this.#h=e.persistNetworks??!1,this.#t=this.#D(e.networks??fz),this.#r={...e.faucets},this.#s={},this.#a=e.activeNetwork??Object.keys(this.#t)[0]??"",this.#i=e.name??dz,this.#o=e.icon??"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgd2lkdGg9IjY0IiBoZWlnaHQ9IjY0Ij4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0id2FsbGV0R3JhZCIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMTAwJSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0eWxlPSJzdG9wLWNvbG9yOiM2MzY2RjEiIC8+CiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6IzI1NjNFQiIgLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImZsYXBHcmFkIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjEwMCUiIHkyPSIxMDAlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3R5bGU9InN0b3AtY29sb3I6IzgxOENGOCIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdHlsZT0ic3RvcC1jb2xvcjojNEY0NkU1IiAvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICA8L2RlZnM+CiAgPCEtLSBTaGFkb3cgLS0+CiAgPHJlY3QgeD0iOSIgeT0iMjEiIHdpZHRoPSI1MCIgaGVpZ2h0PSIzNiIgcng9IjYiIHJ5PSI2IiBmaWxsPSIjMDAwIiBvcGFjaXR5PSIwLjEiIC8+CiAgPCEtLSBXYWxsZXQgYm9keSAtLT4KICA8cmVjdCB4PSI2IiB5PSIxOCIgd2lkdGg9IjUwIiBoZWlnaHQ9IjM2IiByeD0iNiIgcnk9IjYiIGZpbGw9InVybCgjd2FsbGV0R3JhZCkiIC8+CiAgPCEtLSBGbGFwIC0tPgogIDxwYXRoIGQ9Ik02IDI2IEw2IDIyIEM2IDE1IDggMTIgMTQgMTIgTDQ2IDEyIEM1MiAxMiA1NiAxNSA1NiAyMiBMNTYgMjYgWiIgZmlsbD0idXJsKCNmbGFwR3JhZCkiIC8+CiAgPCEtLSBDbGFzcCAtLT4KICA8cmVjdCB4PSI0MiIgeT0iMzAiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxMiIgcng9IjQiIHJ5PSI0IiBmaWxsPSIjNDMzOENBIiAvPgogIDwhLS0gR29sZCBjb2luIGluIGNsYXNwIC0tPgogIDxjaXJjbGUgY3g9IjQ4IiBjeT0iMzYiIHI9IjMuNSIgZmlsbD0iI0ZDRDM0RCIgLz4KICA8Y2lyY2xlIGN4PSI0OCIgY3k9IjM2IiByPSIyIiBmaWxsPSIjRjU5RTBCIiAvPgogIDwhLS0gRW1ib3NzZWQgRFcgdGV4dCAtLT4KICA8dGV4dCB4PSIyNiIgeT0iNDUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmIiBmb250LXdlaWdodD0iOTAwIiBmb250LXNpemU9IjE4IiBmaWxsPSIjMzczMEEzIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkb21pbmFudC1iYXNlbGluZT0ibWlkZGxlIiBsZXR0ZXItc3BhY2luZz0iMiI+RFc8L3RleHQ+CiAgPHRleHQgeD0iMjYiIHk9IjQ0IiBmb250LWZhbWlseT0iQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZiIgZm9udC13ZWlnaHQ9IjkwMCIgZm9udC1zaXplPSIxOCIgZmlsbD0iI0M3RDJGRSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGxlIiBsZXR0ZXItc3BhY2luZz0iMiI+RFc8L3RleHQ+Cjwvc3ZnPgo=",this.#c=e.autoApprove??!1,this.#n=e.autoConnect??!1,this.#m=e.clientFactory??((t,s)=>new bb({baseUrl:s,network:t})),this.#f=this.#A(),this.#l=Z4(),this.#g=[],this.#d=null,this.#y=new Set,this.#u=null,this.#b=new Set,this.#w=new Set,this.#C()}get version(){return"1.0.0"}get name(){return this.#i}get icon(){return this.#o}get chains(){return Ij(Object.keys(this.#t))}get accounts(){return this.#v()}setSelectedAccount(e){if(e!==null){const t=this.#f.find(s=>s.address.toLowerCase()===e.toLowerCase());if(t===void 0){const s=this.#f.map(r=>r.address).join(", ");throw new Error(`No dev-wallet account for address "${e}". Available: ${s||"(none)"}`)}this.#p=t.address}else this.#p=null;this.#l.emit("change",{accounts:this.#v()})}#v(){return this.#p===null?this.#f:this.#f.filter(e=>e.address.toLowerCase()===this.#p.toLowerCase())}get features(){return{"standard:connect":{version:"1.0.0",connect:this.#R},"standard:events":{version:"1.0.0",on:this.#I},"standard:disconnect":{version:"1.0.0",disconnect:this.#j},"sui:signPersonalMessage":{version:"1.1.0",signPersonalMessage:this.#L},"sui:signTransaction":{version:"2.0.0",signTransaction:this.#z},"sui:signAndExecuteTransaction":{version:"2.0.0",signAndExecuteTransaction:this.#$}}}get pendingRequest(){return this.#d}get adapters(){return this.#e}getAdapterForAccount(e){return this.#e.find(t=>t.getAccount(e)!==void 0)}get clients(){for(const e of Object.keys(this.#t))this.#S(e);return{...this.#s}}getClient(e){return this.#S(e)}get networkUrls(){return{...this.#t}}get faucetUrls(){return{...this.#r}}getFaucet(e){return this.#r[e]??null}get activeFaucet(){return this.getFaucet(this.#a)}get activeNetwork(){return this.#a}get activeClient(){return!this.#a||!this.#t[this.#a]?null:this.#S(this.#a)}get availableNetworks(){return Object.keys(this.#t)}setActiveNetwork(e){if(!this.#t[e])throw new Error(`No client for network "${e}". Available: ${this.availableNetworks.join(", ")}`);this.#a=e,this.#l.emit("change",{accounts:this.#v()})}addNetwork(e,t,s){let r;try{r=new URL(t)}catch{throw new Error(`Invalid URL: ${t}`)}if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error(`Invalid URL: must use http or https (got ${r.protocol})`);this.#t[e]=t,this.#s[e]=this.#m(e,t),s!=null&&(this.#r[e]=s),this.#O(),this.#l.emit("change",{accounts:this.#v()})}removeNetwork(e){delete this.#t[e],delete this.#r[e],delete this.#s[e],this.#a===e&&(this.#a=Object.keys(this.#t)[0]??""),this.#O(),this.#l.emit("change",{accounts:this.#v()})}register(){return typeof process<"u"&&console.warn("[@mysten-incubation/dev-wallet] DevWallet is intended for development only. Do not use in production."),Cp().register(this)}destroy(){this.#k=!0;for(const e of this.#g)e();this.#g=[];for(const e of this.#e)e.destroy();this.#d&&(this.#d.reject(new Error("Wallet destroyed.")),this.#d=null),this.#u&&(this.#u.reject(new Error("Wallet destroyed.")),this.#u=null),this.#y.clear(),this.#b.clear(),this.#w.clear(),this.#l.all.clear()}async approveRequest(){const e=this.#d;if(!e)throw new Error("No pending request to approve.");try{const t=await this.#N(e.type,e.account,e.chain,e.data);this.#d=null,this.#T(),e.resolve(t)}catch(t){this.#d=null,this.#T(),e.reject(t instanceof Error?t:new Error(String(t)))}}rejectRequest(e){const t=this.#d;if(!t)throw new Error("No pending request to reject.");this.#d=null,this.#T(),t.reject(new Error(e??"Request rejected by user."))}onRequestChange(e){return this.#y.add(e),()=>{this.#y.delete(e)}}get pendingConnect(){return this.#u}approveConnect(e){const t=this.#u;if(!t)throw new Error("No pending connect request to approve.");const s=e.length>0?this.#f.filter(r=>e.includes(r.address)):[...this.#f];this.#u=null,this.#E(),t.resolve({accounts:s})}rejectConnect(e){const t=this.#u;if(!t)throw new Error("No pending connect request to reject.");this.#u=null,this.#E(),t.reject(new Error(e??"Connection rejected by user."))}onConnectChange(e){return this.#b.add(e),()=>{this.#b.delete(e)}}#T(){const e=this.#d;for(const t of this.#y)t(e)}#E(){const e=this.#u;for(const t of this.#b)t(e)}onDAppConnected(e){return this.#w.add(e),()=>{this.#w.delete(e)}}#x(){for(const e of this.#w)try{e()}catch(t){console.error("[dev-wallet] onDAppConnected listener threw:",t)}}#A(){return this.#e.flatMap(e=>e.getAccounts().map(t=>t.walletAccount))}#C(){for(const e of this.#e){const t=e.onAccountsChanged(()=>{this.#f=this.#A(),this.#l.emit("change",{accounts:this.#v()})});this.#g.push(t)}}#I=(e,t)=>(this.#l.on(e,t),()=>this.#l.off(e,t));#R=async()=>(this.#x(),this.#n?{accounts:this.accounts}:this.#u?Promise.reject(new Error("A connect request is already pending.")):new Promise((e,t)=>{this.#u={id:crypto.randomUUID(),resolve:e,reject:t},this.#E()}));#j=async()=>{};#M(e){const t=Rj(e);if(!t)throw new Error(`Invalid chain identifier: ${e}`);return this.#S(t)}#D(e){if(!this.#h||typeof localStorage>"u")return{...e};try{const t=localStorage.getItem(JE);if(t){const s=JSON.parse(t);if(typeof s=="object"&&s!==null&&!Array.isArray(s))return s}}catch{}return{...e}}#O(){!this.#h||typeof localStorage>"u"||localStorage.setItem(JE,JSON.stringify(this.#t))}#S(e){if(!this.#s[e]){const t=this.#t[e];if(!t)throw new Error(`No client for network "${e}". Available: ${this.availableNetworks.join(", ")}`);this.#s[e]=this.#m(e,t)}return this.#s[e]}#U(e){for(const s of this.#e){const r=s.getAccount(e);if(r)return r.signer}const t=this.#e.flatMap(s=>s.getAccounts().map(r=>r.address));throw new Error(`No account found for address "${e}". Available addresses: ${t.join(", ")}`)}#B(e,t,s,r){return this.getAdapterForAccount(t.address)?.allowAutoSign===!1?!1:this.#c===!0?!0:typeof this.#c=="function"?this.#c({type:e,account:t,chain:s,data:r}):!1}async#N(e,t,s,r){return jj({type:e,signer:this.#U(t.address),data:r,client:e!=="sign-personal-message"?this.#M(s):void 0})}#_(e,t,s,r){return this.#k?Promise.reject(new Error("Wallet has been destroyed.")):this.#B(e,t,s,r)?this.#N(e,t,s,r):this.#d?Promise.reject(new Error("A signing request is already pending.")):new Promise((i,c)=>{this.#d={id:crypto.randomUUID(),type:e,account:t,chain:s,data:r,resolve:i,reject:c},this.#T()})}#L=async e=>this.#_("sign-personal-message",e.account,e.chain??"sui:unknown",e.message);#z=async e=>{const t=await e.transaction.toJSON();return this.#_("sign-transaction",e.account,e.chain,t)};#$=async e=>{const t=await e.transaction.toJSON();return this.#_("sign-and-execute-transaction",e.account,e.chain,t)}};const pz="modulepreload",mz=function(e,t){return new URL(e,t).href},QE={},gz=function(t,s,r){let i=Promise.resolve();if(s&&s.length>0){let m=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const u=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=d?.nonce||d?.getAttribute("nonce");i=m(s.map(g=>{if(g=mz(g,r),g in QE)return;QE[g]=!0;const y=g.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(r)for(let O=u.length-1;O>=0;O--){const C=u[O];if(C.href===g&&(!y||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${b}`))return;const E=document.createElement("link");if(E.rel=y?"stylesheet":pz,y||(E.as="script"),E.crossOrigin="",E.href=g,p&&E.setAttribute("nonce",p),document.head.appendChild(E),y)return new Promise((O,C)=>{E.addEventListener("load",O),E.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${g}`)))})}))}function c(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return i.then(u=>{for(const d of u||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})};async function yz(e){const{autoInitialize:t=!0,createInitialAccount:s=!1,mountUI:r=!0,dockStyle:i,container:c,onWalletCreated:u,...d}=e;if(t&&await Promise.all(d.adapters.map(y=>y.initialize())),s&&!d.adapters.some(y=>y.getAccounts().length>0)){const y=d.adapters.find(b=>b.createAccount&&b.getAccounts().length===0);y?.createAccount&&await y.createAccount({label:"Dev Account"})}const p=new hz(d);u?.(p);let m;if(r&&typeof document<"u"){const{mountDevWallet:y}=await gz(async()=>{const{mountDevWallet:b}=await import("./mount-CvSnQ6dg.js");return{mountDevWallet:b}},[],import.meta.url);m=y(p,{container:c,dockStyle:i})}const g=p.register();return{wallet:p,dispose(){m?.(),g(),p.destroy()}}}function vz(e){return{id:"dev-wallet-initializer",async initialize({networks:t,getClient:s}){const r={};for(const c of t)r[c]=`dapp-kit://${c}`;const{dispose:i}=await yz({adapters:e.adapters,networks:r,name:e.name,icon:e.icon,autoApprove:e.autoApprove,autoConnect:e.autoConnect,clientFactory:c=>s(c),autoInitialize:e.autoInitialize??!0,createInitialAccount:e.createInitialAccount??!0,mountUI:e.mountUI??!1,dockStyle:e.dockStyle,container:e.container,onWalletCreated:e.onWalletCreated});return{unregister:i}}}}var bz=class{constructor(){this.allowAutoSign=!0,this.#e=[],this.#t=new Set}#e;#t;getAccounts(){return[...this.#e]}getAccount(e){return this.#e.find(t=>t.address===e)}onAccountsChanged(e){return this.#t.add(e),()=>{this.#t.delete(e)}}destroy(){this.#e=[],this.#t.clear()}get _accounts(){return this.#e}setInitialAccounts(e){this.#e=e,this.notifyListeners()}addAccount(e){this.#e.push(e),this.notifyListeners()}removeAccountByAddress(e){const t=this.#e.findIndex(s=>s.address===e);return t===-1?!1:(this.#e.splice(t,1),this.notifyListeners(),!0)}replaceAccount(e,t){const s=this.#e.findIndex(r=>r.address===e);return s===-1?!1:(this.#e[s]=t,this.notifyListeners(),!0)}_performRename(e,t){const s=this.getAccount(e);return s?this.replaceAccount(e,Jy(s.signer,e,t)):!1}getDefaultLabel(){return`Account ${this.getAccounts().length+1}`}notifyListeners(){const e=this.getAccounts();for(const t of this.#t)t(e)}};const Ps={ED25519:0,Secp256k1:1,Secp256r1:2,MultiSig:3,ZkLogin:5,Passkey:6},wz={ED25519:32,Secp256k1:33,Secp256r1:33,Passkey:33},Bp={0:"ED25519",1:"Secp256k1",2:"Secp256r1",3:"MultiSig",5:"ZkLogin",6:"Passkey"};function n3(e,t){return M.IntentMessage(M.bytes(t.length)).serialize({intent:{scope:{[e]:!0},version:{V0:!0},appId:{Sui:!0}},value:t}).toBytes()}function mi(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}var ol=class{equals(e){return mi(this.toRawBytes(),e.toRawBytes())}toBase64(){return Ke(this.toRawBytes())}toString(){throw new Error("`toString` is not implemented on public keys. Use `toBase64()` or `toRawBytes()` instead.")}toSuiPublicKey(){return Ke(this.toSuiBytes())}verifyWithIntent(e,t,s){const r=po(n3(s,e),{dkLen:32});return this.verify(r,t)}verifyPersonalMessage(e,t){return this.verifyWithIntent(M.byteVector().serialize(e).toBytes(),t,"PersonalMessage")}verifyTransaction(e,t){return this.verifyWithIntent(e,t,"TransactionData")}verifyAddress(e){return this.toSuiAddress()===e}toSuiBytes(){const e=this.toRawBytes(),t=new Uint8Array(e.length+1);return t.set([this.flag()]),t.set(e,1),t}toSuiAddress(){return ye(il(po(this.toSuiBytes(),{dkLen:32})).slice(0,sl*2))}};function wb(e){const t=Ge(e),s=Bp[t[0]];switch(s){case"ED25519":case"Secp256k1":case"Secp256r1":const r=wz[s],i=t.slice(1,t.length-r);return{serializedSignature:e,signatureScheme:s,signature:i,publicKey:t.slice(1+i.length),bytes:t};default:throw new Error("Unsupported signature scheme")}}const Tz=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Xa=new Uint32Array(64);class Sz extends Hk{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(t,s){super(64,t,8,!1),this.A=s[0]|0,this.B=s[1]|0,this.C=s[2]|0,this.D=s[3]|0,this.E=s[4]|0,this.F=s[5]|0,this.G=s[6]|0,this.H=s[7]|0}get(){const{A:t,B:s,C:r,D:i,E:c,F:u,G:d,H:p}=this;return[t,s,r,i,c,u,d,p]}set(t,s,r,i,c,u,d,p){this.A=t|0,this.B=s|0,this.C=r|0,this.D=i|0,this.E=c|0,this.F=u|0,this.G=d|0,this.H=p|0}_cloneInto(t){return(t||=new this.constructor).set(...this.get()),this._cloneIntoMeta(t)}process(t,s){for(let y=0;y<16;y++,s+=4)Xa[y]=t.getUint32(s,!1);for(let y=16;y<64;y++){const b=Xa[y-15],E=Xa[y-2],O=br(b,7)^br(b,18)^b>>>3,C=br(E,17)^br(E,19)^E>>>10;Xa[y]=C+Xa[y-7]+O+Xa[y-16]|0}let{A:r,B:i,C:c,D:u,E:d,F:p,G:m,H:g}=this;for(let y=0;y<64;y++){const b=br(d,6)^br(d,11)^br(d,25),E=g+b+e5(d,p,m)+Tz[y]+Xa[y]|0,C=(br(r,2)^br(r,13)^br(r,22))+t5(r,i,c)|0;g=m,m=p,p=d,d=u+E|0,u=c,c=i,i=r,r=E+C|0}r=r+this.A|0,i=i+this.B|0,c=c+this.C|0,u=u+this.D|0,d=d+this.E|0,p=p+this.F|0,m=m+this.G|0,g=g+this.H|0,this.set(r,i,c,u,d,p,m,g)}roundClean(){Vs(Xa)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Vs(this.buffer)}}class Ez extends Sz{constructor(){super(32,n5)}}const s3=qR(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),_z=s3[0],kz=s3[1],Ka=new Uint32Array(80),Ja=new Uint32Array(80);class Az extends Hk{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(t,s){super(128,t,16,!1),this.Ah=s[0]|0,this.Al=s[1]|0,this.Bh=s[2]|0,this.Bl=s[3]|0,this.Ch=s[4]|0,this.Cl=s[5]|0,this.Dh=s[6]|0,this.Dl=s[7]|0,this.Eh=s[8]|0,this.El=s[9]|0,this.Fh=s[10]|0,this.Fl=s[11]|0,this.Gh=s[12]|0,this.Gl=s[13]|0,this.Hh=s[14]|0,this.Hl=s[15]|0}get(){const{Ah:t,Al:s,Bh:r,Bl:i,Ch:c,Cl:u,Dh:d,Dl:p,Eh:m,El:g,Fh:y,Fl:b,Gh:E,Gl:O,Hh:C,Hl:R}=this;return[t,s,r,i,c,u,d,p,m,g,y,b,E,O,C,R]}set(t,s,r,i,c,u,d,p,m,g,y,b,E,O,C,R){this.Ah=t|0,this.Al=s|0,this.Bh=r|0,this.Bl=i|0,this.Ch=c|0,this.Cl=u|0,this.Dh=d|0,this.Dl=p|0,this.Eh=m|0,this.El=g|0,this.Fh=y|0,this.Fl=b|0,this.Gh=E|0,this.Gl=O|0,this.Hh=C|0,this.Hl=R|0}_cloneInto(t){return(t||=new this.constructor).set(...this.get()),this._cloneIntoMeta(t)}process(t,s){for(let W=0;W<16;W++,s+=4)Ka[W]=t.getUint32(s),Ja[W]=t.getUint32(s+=4);for(let W=16;W<80;W++){const oe=Ka[W-15]|0,me=Ja[W-15]|0,G=ni(oe,me,1)^ni(oe,me,8)^aE(oe,me,7),J=si(oe,me,1)^si(oe,me,8)^iE(oe,me,7),w=Ka[W-2]|0,A=Ja[W-2]|0,N=ni(w,A,19)^_u(w,A,61)^aE(w,A,6),F=si(w,A,19)^ku(w,A,61)^iE(w,A,6),B=XR(J,F,Ja[W-7],Ja[W-16]),q=KR(B,G,N,Ka[W-7],Ka[W-16]);Ka[W]=q|0,Ja[W]=B|0}let{Ah:r,Al:i,Bh:c,Bl:u,Ch:d,Cl:p,Dh:m,Dl:g,Eh:y,El:b,Fh:E,Fl:O,Gh:C,Gl:R,Hh:$,Hl:x}=this;for(let W=0;W<80;W++){const oe=ni(y,b,14)^ni(y,b,18)^_u(y,b,41),me=si(y,b,14)^si(y,b,18)^ku(y,b,41),G=y&E^~y&C,J=b&O^~b&R,w=JR(x,me,J,kz[W],Ja[W]),A=QR(w,$,oe,G,_z[W],Ka[W]),N=w|0,F=ni(r,i,28)^_u(r,i,34)^_u(r,i,39),B=si(r,i,28)^ku(r,i,34)^ku(r,i,39),q=r&c^r&d^c&d,z=i&u^i&p^u&p;$=C|0,x=R|0,C=E|0,R=O|0,E=y|0,O=b|0,{h:y,l:b}=Ks(m|0,g|0,A|0,N|0),m=d|0,g=p|0,d=c|0,p=u|0,c=r|0,u=i|0;const D=nb(N,B,z);r=sb(D,A,F,q),i=D|0}({h:r,l:i}=Ks(this.Ah|0,this.Al|0,r|0,i|0)),{h:c,l:u}=Ks(this.Bh|0,this.Bl|0,c|0,u|0),{h:d,l:p}=Ks(this.Ch|0,this.Cl|0,d|0,p|0),{h:m,l:g}=Ks(this.Dh|0,this.Dl|0,m|0,g|0),{h:y,l:b}=Ks(this.Eh|0,this.El|0,y|0,b|0),{h:E,l:O}=Ks(this.Fh|0,this.Fl|0,E|0,O|0),{h:C,l:R}=Ks(this.Gh|0,this.Gl|0,C|0,R|0),{h:$,l:x}=Ks(this.Hh|0,this.Hl|0,$|0,x|0),this.set(r,i,c,u,d,p,m,g,y,b,E,O,C,R,$,x)}roundClean(){Vs(Ka,Ja)}destroy(){this.destroyed=!0,Vs(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Oz extends Az{constructor(){super(64,s5)}}const Tb=tb(()=>new Ez,Pk(1)),cd=tb(()=>new Oz,Pk(3));function r3(e,t,s=()=>{}){if(!Array.isArray(e))throw new TypeError(`"${t}" expected array, got type=${typeof e}`);for(let r=0;r<e.length;r++)s(e[r],`${t}[${r}]`);return e}const Mt=(e,t,s)=>Un(e,t,s),a3=as;function Nz(e,t=""){if(typeof e!="string"){const s=t&&`"${t}" `;throw new TypeError(s+"expected string, got type="+typeof e)}return e}function Cc(e,t="object"){if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(t==="object"?"expected valid options object":`"${t}" expected object, got type=${typeof e}`);return e}function Du(e,t){if(typeof e!="function")throw new TypeError(`"${t}" is invalid: expected function, got ${typeof e}`);return e}const Sb=il,Sr=(...e)=>PR(...e),Kh=e=>Qv(e),ld=Hy,ud=e=>GR(e),Jh=BigInt(0),e_=BigInt(1),xz=e=>e?`"${e}" `:"";function xr(e,t=""){if(typeof e!="boolean")throw new TypeError(xz(t)+"expected boolean, got type="+typeof e);return e}function Eb(e){if(typeof e=="bigint"){if(!ro(e))throw new RangeError("positive bigint expected, got "+e)}else a3(e);return e}function Hc(e,t=""){if(typeof e!="number"){const s=t&&`"${t}" `;throw new TypeError(s+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){const s=t&&`"${t}" `;throw new RangeError(s+"expected safe integer, got "+e)}}function Jf(e){const t=Eb(e).toString(16);return t.length&1?"0"+t:t}function i3(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?Jh:BigInt("0x"+e)}function qc(e){return i3(il(e))}function Fu(e){return i3(il(Qh(Un(e)).reverse()))}function _b(e,t){if(as(t),t===0)throw new Error("zero output length is invalid");e=Eb(e);const s=t*2,r=e.toString(16);if(r.length>s)throw new RangeError("number is too large");return Qv(r.padStart(s,"0"))}function o3(e,t){return _b(e,t).reverse()}function Qh(e){return Uint8Array.from(Mt(e))}function ro(e){return typeof e=="bigint"&&Jh<=e}function c3(e,t,s){return ro(e)&&ro(t)&&ro(s)&&t<=e&&e<s}function ep(e,t,s,r){if(!c3(t,s,r))throw new RangeError("expected valid "+e+": "+s+" <= n < "+r+", got "+t)}function kb(e){if(e<Jh)throw new Error("expected non-negative bigint, got "+e);return e===Jh?0:e.toString(2).length}const Ab=e=>(Hc(e,"n"),(e_<<BigInt(e))-e_);function Cz(e,t,s){if(as(e,"hashLen"),as(t,"qByteLen"),typeof s!="function")throw new TypeError("hmacFn must be a function");const r=R=>new Uint8Array(R),i=Uint8Array.of(),c=Uint8Array.of(0),u=Uint8Array.of(1),d=1e3;let p=r(e),m=r(e),g=0;const y=()=>{p.fill(1),m.fill(0),g=0},b=(...R)=>s(m,Sr(p,...R)),E=(R=i)=>{m=b(c,R),p=b(),R.length!==0&&(m=b(u,R),p=b())},O=()=>{if(g++>=d)throw new Error("drbg: tried max amount of iterations");let R=0;const $=[];for(;R<t;){p=b();const x=p.slice();$.push(x),R+=p.length}return Sr(...$)};return(R,$)=>{y(),E(R);let x;for(;(x=$(O()))===void 0;)E();return y(),x}}function _r(e,t={},s={},r="object"){Cc(e,r),Cc(t,"fields"),Cc(s,"optFields");function i(u,d,p){const m=r==="object"?`param "${String(u)}"`:`"${r}.${String(u)}"`,g=e[u];if(!Object.hasOwn(e,u)&&(p?g!==void 0:d!=="function"))throw new TypeError(`${m} is invalid: expected own property`);if(p&&g===void 0)return;const y=typeof g;if(y!==d||g===null)throw new TypeError(`${m} is invalid: expected ${d}, got ${y}`)}const c=(u,d)=>Object.entries(u).forEach(([p,m])=>i(p,m,d));c(t,!1),c(s,!0)}const dn=BigInt(0),vt=BigInt(1),ci=BigInt(2),l3=BigInt(3),Ob=BigInt(4),u3=BigInt(5),Iz=BigInt(7),d3=BigInt(8),Rz=BigInt(9),jz=BigInt(15),f3=BigInt(16),Mz=BigInt("0x10000000000000000");function Ht(e,t){if(t<=dn)throw new Error("mod: expected positive modulus, got "+t);const s=e%t;return s>=dn?s:t+s}function h3(e,t,s){if(s<=vt)throw new Error("pow: expected modulus > 1, got "+s);if(typeof t!="bigint")throw new TypeError("invalid exponent: expected bigint, got "+typeof t);if(t<dn)throw new Error("invalid exponent, negatives unsupported");if(t===dn)return vt;if(t===vt)return e;let r=e%s;if(r<dn&&(r+=s),t<Mz){let d=vt;for(;t>dn;)t&vt&&(d=d*r%s),r=r*r%s,t>>=vt;return d}const i=[];for(;t>dn;)i.push(Number(t&jz)),t>>=Ob;const c=new Array(16);c[0]=vt,c[1]=r;for(let d=2;d<16;d++)c[d]=c[d-1]*r%s;let u=c[i[i.length-1]];for(let d=i.length-2;d>=0;d--){u=u*u%s,u=u*u%s,u=u*u%s,u=u*u%s;const p=i[d];p!==0&&(u=u*c[p]%s)}return u}function Ft(e,t,s){if(s<=vt)throw new Error("pow2: expected modulus > 1, got "+s);if(t<dn)throw new Error("pow2: expected non-negative exponent, got "+t);let r=e;for(;t-- >dn;)r*=r,r%=s;return r}function t_(e,t){if(e===dn)throw new Error("invert: expected non-zero number");if(t<=vt)throw new Error("invert: expected modulus > 1, got "+t);let s=Ht(e,t),r=t,i=dn,c=vt;for(;s!==dn;){const d=r/s,p=r-s*d,m=i-c*d;r=s,s=p,i=c,c=m}if(r!==vt)throw new Error("invert: does not exist");return Ht(i,t)}function Dz(e,t){if(t<=vt)throw new Error("invertCt: expected prime modulus > 1, got "+t);const s=Ht(e,t);if(s===dn)throw new Error("invertCt: expected non-zero number");const r=h3(s,t-ci,t);if(Ht(s*r,t)!==vt)throw new Error("invertCt: does not exist");return r}function Nb(e,t,s){const r=e;if(!r.eql(r.sqr(t),s))throw new Error("Cannot find square root")}function xb(e,t){if((e&vt)===dn)throw new Error(t+": expected odd modulus, got "+e)}function p3(e,t){const s=e,r=(s.ORDER+vt)/Ob,i=s.pow(t,r);return Nb(s,i,t),i}function Uz(e,t){const s=e,r=(s.ORDER-u3)/d3,i=s.mul(t,ci),c=s.pow(i,r),u=s.mul(t,c),d=s.mul(s.mul(u,ci),c),p=s.mul(u,s.sub(d,s.ONE));return Nb(s,p,t),p}function Bz(e){const t=Lp(e),s=m3(e),r=s(t,t.neg(t.ONE)),i=s(t,r),c=s(t,t.neg(r)),u=(e+Iz)/f3;return((d,p)=>{const m=d;let g=m.pow(p,u),y=m.mul(g,r);const b=m.mul(g,i),E=m.mul(g,c),O=m.eql(m.sqr(y),p),C=m.eql(m.sqr(b),p);g=m.cmov(g,y,O),y=m.cmov(E,b,C);const R=m.eql(m.sqr(y),p),$=m.cmov(g,y,R);return Nb(m,$,p),$})}function m3(e){if(e<l3)throw new Error("sqrt is not defined for small field");xb(e,"tonelliShanks");let t=e-vt,s=0;for(;t%ci===dn;)t/=ci,s++;let r=ci;const i=Lp(e);for(;tp(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(s===1)return p3;let c=i.pow(r,t);const u=(t+vt)/ci;return function(p,m){const g=p;if(g.is0(m))return m;if(tp(g,m)!==1)throw new Error("Cannot find square root");let y=s,b=g.mul(g.ONE,c),E=g.pow(m,t),O=g.pow(m,u);for(;!g.eql(E,g.ONE);){if(g.is0(E))throw new Error("Cannot find square root: probably non-prime P");let C=1,R=g.sqr(E);for(;!g.eql(R,g.ONE);)if(C++,R=g.sqr(R),C===y)throw new Error("Cannot find square root");const $=vt<<BigInt(y-C-1),x=g.pow(b,$);y=C,b=g.sqr(x),E=g.mul(E,b),O=g.mul(O,x)}return O}}function Lz(e){return xb(e,"Fp.sqrt"),e%Ob===l3?p3:e%d3===u3?Uz:e%f3===Rz?Bz(e):m3(e)}const zz=(e,t)=>(Ht(e,t)&vt)===vt,$z=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Hu(e){if(Cc(e,"field"),typeof e.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof e.ORDER);Hc(e.BYTES,"BYTES"),Hc(e.BITS,"BITS");for(const t of $z)Du(e[t],"field."+t);if(e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=vt)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function g3(e,t,s=!1){Hu(e),r3(t,"nums"),xr(s,"passZero");const r=e,i=new Array(t.length).fill(s?r.ZERO:void 0),c=t.reduce((d,p,m)=>r.is0(p)?d:(i[m]=d,r.mul(d,p)),r.ONE),u=r.inv(c);return t.reduceRight((d,p,m)=>r.is0(p)?d:(i[m]=r.mul(d,i[m]),r.mul(d,p)),u),i}function tp(e,t){Hu(e);const s=e;xb(s.ORDER,"FpLegendre");const r=(s.ORDER-vt)/ci,i=s.pow(t,r),c=s.eql(i,s.ONE),u=s.eql(i,s.ZERO),d=s.eql(i,s.neg(s.ONE));if(!c&&!u&&!d)throw new Error("invalid Legendre symbol result");return c?1:u?0:-1}function Vz(e,t){if(t!==void 0&&a3(t),e<=dn)throw new Error("invalid n length: expected positive n, got "+e);if(t!==void 0&&t<1)throw new Error("invalid n length: expected positive bit length, got "+t);const s=kb(e);if(t!==void 0&&t<s)throw new Error(`invalid n length: expected nBitLength (${t}) >= bitLen(n) (${s})`);const r=t!==void 0?t:s,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}const n_=new WeakMap;class s_{ORDER;BITS;BYTES;isLE;ZERO=dn;ONE=vt;_lengths;_mod;constructor(t,s={}){if(t<=vt)throw new Error("invalid field: expected ORDER > 1, got "+t);let r;this.isLE=!1,s!=null&&typeof s=="object"&&(typeof s.BITS=="number"&&(r=s.BITS),typeof s.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:s.sqrt,enumerable:!0}),typeof s.isLE=="boolean"&&(this.isLE=s.isLE),s.allowedLengths&&(this._lengths=Object.freeze(s.allowedLengths.slice())),typeof s.modFromBytes=="boolean"&&(this._mod=s.modFromBytes));const{nBitLength:i,nByteLength:c}=Vz(t,r);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=i,this.BYTES=c,Object.freeze(this)}create(t){return Ht(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof t);return dn<=t&&t<this.ORDER}is0(t){return t===dn}isValidNot0(t){return!this.is0(t)&&this.isValid(t)}isOdd(t){return(t&vt)===vt}neg(t){return Ht(-t,this.ORDER)}eql(t,s){return t===s}sqr(t){return Ht(t*t,this.ORDER)}add(t,s){return Ht(t+s,this.ORDER)}sub(t,s){return Ht(t-s,this.ORDER)}mul(t,s){return Ht(t*s,this.ORDER)}pow(t,s){return h3(t,s,this.ORDER)}div(t,s){return Ht(t*t_(s,this.ORDER),this.ORDER)}sqrN(t){return t*t}addN(t,s){return t+s}subN(t,s){return t-s}mulN(t,s){return t*s}inv(t){return t_(t,this.ORDER)}sqrt(t){let s=n_.get(this);return s||n_.set(this,s=Lz(this.ORDER)),s(this,t)}toBytes(t){return this.isLE?o3(t,this.BYTES):_b(t,this.BYTES)}fromBytes(t,s=!1){Mt(t);const{_lengths:r,BYTES:i,isLE:c,ORDER:u,_mod:d}=this;if(r){if(t.length<1||!r.includes(t.length)||t.length>i)throw new Error("Field.fromBytes: expected "+r+" bytes, got "+t.length);const m=new Uint8Array(i);m.set(t,c?0:m.length-t.length),t=m}if(t.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);let p=c?Fu(t):qc(t);if(d&&(p=Ht(p,u)),!s&&!this.isValid(p))throw new Error("invalid field element: outside of range 0..ORDER");return p}invertBatch(t){return g3(this,t,!0)}cmov(t,s,r){return xr(r,"condition"),r?s:t}}function Lp(e,t={}){return Object.freeze(s_.prototype),new s_(e,t)}function y3(e){if(typeof e!="bigint")throw new Error("field order must be bigint");if(e<=vt)throw new Error("field order must be greater than 1");const t=kb(e-vt);return Math.ceil(t/8)}function Cb(e){const t=y3(e);return t+Math.ceil(t/2)}function v3(e,t,s=!1){Mt(e);const r=e.length,i=y3(t),c=Math.max(Cb(t),16);if(r<c||r>1024)throw new Error("expected "+c+"-1024 bytes of input, got "+r);const u=s?Fu(e):qc(e),d=Ht(u,t-vt)+vt;return s?o3(d,i):_b(d,i)}const Ib=BigInt(0),qu=BigInt(1),Pz=BigInt(4),ry=16,r_=128,Gz=5,a_=2**31;function cl(e){const t=e;if(typeof t!="function")throw new TypeError('"Point" expected constructor, got type='+typeof e);Du(t.fromAffine,"Point.fromAffine"),Du(t.fromBytes,"Point.fromBytes"),Du(t.fromHex,"Point.fromHex"),Cc(t.BASE,"Point.BASE"),Cc(t.ZERO,"Point.ZERO"),Hu(t.Fp),Hu(t.Fn)}function b3(e,t){cl(e),T3(t,e);const s=g3(e.Fp,t.map(r=>r.Z));return t.map((r,i)=>e.fromAffine(r.toAffine(s[i])))}function Fz(e,t,s=1){if(!Number.isSafeInteger(e)||e<s||e>t)throw new Error("invalid window size, expected ["+s+".."+t+"], got W="+e)}function Hz(e,t){const s=e*(4*t+128);if(s>a_)throw new Error("invalid window size: table would need ~"+Math.ceil(s/2**20)+" MiB, max "+a_/2**20+" MiB")}function w3(e,t){if(e!==void 0){Du(e,"randomBytes");try{const s=e(t);if(!ld(s)||s.length!==t)return}catch{return}return e}}function T3(e,t){r3(e,"points"),e.forEach((s,r)=>{if(!(s instanceof t))throw new Error("invalid point at index "+r)})}function qz(e,t,s){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,i)=>{if(!(s===void 0?t.isValid(r):ro(r)&&r<s))throw new Error("invalid scalar at index "+i)})}const S3=new WeakMap;function ay(e){return S3.get(e)||1}function Zz(e,t){const s=e.double(),r=[e];for(let i=1;i<t;i++)r.push(r[i-1].add(s));return r}function Yz(e,t){const s=2**t,r=s/2,i=BigInt(s-1),c=[];for(;e>Ib;){let u=0;e&qu&&(u=Number(e&i),u>=r&&(u-=s),e-=BigInt(u)),c.push(u),e>>=qu}return c}function Wz(e,t,s){const r=2**t,i=r/2,c=BigInt(r-1),u=BigInt(t),d=[];for(let p=0;p<s;p++){let m=Number(e&c);e>>=u,m>i&&(m-=r,e+=qu),d.push(m)}if(e!==Ib)throw new Error("invalid wnaf");return d}function Xz(e,t,s){let r=0;for(const c of s)r=Math.max(r,c.length);let i=e;for(let c=r-1;c>=0;c--){c!==r-1&&(i=i.double());for(let u=0;u<s.length;u++){const d=s[u][c];if(d){const p=t[u][Math.abs(d)-1>>1];i=i.add(d<0?p.negate():p)}}}return i}class E3{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(t,s){cl(t),this.randomBytes=w3(s,ry),this.Point=t,this.BASE=t.BASE,this.ZERO=t.ZERO,this.bits=t.Fn.BITS}buildWnafTable(t,s,r){const i=Math.ceil(r/s)+1,c=2**(s-1),u=[];let d=t;for(let p=0;p<i;p++){let m=d;for(let g=0;g<c;g++)u.push(m),m=m.add(d);d=u[u.length-1].double()}return{W:s,bits:r,windows:i,comp:u}}wnafCachedCT(t,s){const{W:r,windows:i,comp:c}=t,u=2**(r-1),d=Wz(s,r,i);let p=this.ZERO,m=this.BASE;for(let g=0;g<i;g++){const y=d[g],b=g*u,E=Math.abs(y)-1;let O=c[b];for(let R=1;R<u;R++)O=R===E?c[b+R]:O;const C=O.negate();y===0?m=m.add(c[b]):p=p.add(y<0?C:O)}return{p,f:m}}getWnafPrecomputes(t,s,r,i){let c=this.wnafPrecomputes.get(s),u=c?.find(d=>d.W===t&&d.bits===r);return u||(u=this.buildWnafTable(s,t,r),typeof i=="function"&&(u={...u,comp:i(u.comp)}),c||(c=[],this.wnafPrecomputes.set(s,c)),c.push(u)),u}assertPoint(t){if(!(t instanceof this.Point))throw new TypeError('"point" expected Point instance, got type='+typeof t)}validateMulInput(t,s){if(this.assertPoint(t),!c3(s,qu,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(t,s,r,i){const c=ay(t);return c===1?this.fixedWindowCT(t,s,r):this.wnafCachedCT(this.getWnafPrecomputes(c,t,r,i),s)}mulCT(t,s,r){return this.validateMulInput(t,s),this.runCT(t,s,this.bits,r)}mulCTBlinded(t,s,r){if(this.validateMulInput(t,s),this.randomBytes===void 0)throw new Error("randomBytes is required for scalar blinding");const i=this.Point.Fn.BITS+r_,c=this.randomBytes(ry);if(!ld(c)||c.length!==ry)throw new Error("randomBytes returned invalid byte array");c[0]=c[0]&63|128;const u=s+qc(c)*this.Point.Fn.ORDER;return this.runCT(t,u,i,r)}fixedWindowCT(t,s,r){const i=Gz,c=1<<i,u=Ab(i),d=new Array(c);d[0]=this.ZERO;for(let g=1;g<c;g++)d[g]=d[g-1].add(t);const p=Math.ceil(r/i);let m=this.ZERO;for(let g=p-1;g>=0;g--){if(g!==p-1)for(let E=0;E<i;E++)m=m.double();const y=Number(s>>BigInt(g*i)&u);let b=d[0];for(let E=1;E<c;E++)b=E===y?d[E]:b;m=m.add(b)}return{p:m,f:m}}shouldBlind(t,s){return this.randomBytes===void 0?!1:s===qu?!0:t!==this.BASE?!1:(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded)}mulSecret(t,s,r,i){return this.shouldBlind(t,r)?this.mulCTBlinded(t,s,i):this.mulCT(t,s,i)}mulUnsafe(t,s,r){if(this.assertPoint(t),!ro(s))throw new Error("invalid scalar");const i=ay(t);if(i===1||s>=this.Point.Fn.ORDER)return cv(this.Point,[t],[s],!0);const c=this.getWnafPrecomputes(i,t,this.bits,r);return this.wnafCachedCT(c,s).p}setWindowSize(t,s){this.assertPoint(t),Fz(s,this.bits);const r=Math.ceil((this.bits+r_)/s)+1;Hz(r*2**(s-1),this.Point.Fp.BYTES),S3.set(t,s),this.wnafPrecomputes.delete(t)}hasWindowSize(t){return ay(t)!==1}}function cv(e,t,s,r=!1){if(cl(e),T3(t,e),xr(r,"allowOversized"),qz(s,e.Fn,r?e.Fn.ORDER**Pz:void 0),t.length!==s.length)throw new Error("arrays of points and scalars must have equal length");const i=t.map(u=>Zz(u,4)),c=s.map(u=>Yz(u,4));return Xz(e.ZERO,i,c)}function i_(e,t,s){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Hu(t),t}else return Lp(e,{isLE:s})}function _3(e,t,s={},r){if(e!=="weierstrass"&&e!=="edwards")throw new Error('expected curve type "weierstrass" or "edwards"');if(r===void 0&&(r=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);_r(s);for(const p of["p","n","h"]){const m=t[p];if(!(ro(m)&&m!==Ib))throw new Error(`CURVE.${p} must be positive bigint`)}const i=i_(t.p,s.Fp,r),c=i_(t.n,s.Fn,r),d=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(const p of d)if(!i.isValid(t[p]))throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:c}}function k3(e,t){return function(r){const i=e(r);return{secretKey:i,publicKey:t(i)}}}const Qf=BigInt(0),eh=BigInt(1),th=BigInt(2),Kz=BigInt(4),o_=BigInt(8);function Jz(e,t,s,r){const i=e.sqr(s),c=e.sqr(r),u=e.add(e.mul(t.a,i),c),d=e.add(e.ONE,e.mul(t.d,e.mul(i,c)));return e.eql(u,d)}function Qz(e,t={}){_r(t,{},{},"extraOpts");const s=t,r=_3("edwards",e,s,s.FpFnLE),{Fp:i,Fn:c}=r;let u=r.CURVE;const{h:d}=u;if(tp(i,u.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(tp(i,u.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");_r(s,{},{uvRatio:"function",randomBytes:"function"});const p=s.randomBytes===void 0?ud:s.randomBytes,m=th<<BigInt(i.BYTES*8)-eh;function g(x){if(!i.isOdd)throw new Error("Field does not have .isOdd()");return i.isOdd(x)}const y=s.uvRatio===void 0?(x,W)=>{try{return{isValid:!0,value:i.sqrt(i.div(x,W))}}catch{return{isValid:!1,value:Qf}}}:s.uvRatio;if(!Jz(i,u,u.Gx,u.Gy))throw new Error("bad curve params: generator point");const b=i.eql(u.a,i.neg(i.ONE))?x=>i.neg(x):i.eql(u.a,i.ONE)?x=>x:x=>i.mul(u.a,x);function E(x,W,oe=!1){const me=oe?eh:Qf;return ep("coordinate "+x,W,me,m),W}function O(x){if(!(x instanceof C))throw new Error("EdwardsPoint expected")}class C{static BASE=new C(u.Gx,u.Gy,i.ONE,i.mul(u.Gx,u.Gy));static ZERO=new C(i.ZERO,i.ONE,i.ONE,i.ZERO);static Fp=i;static Fn=c;X;Y;Z;T;constructor(W,oe,me,G){this.X=E("x",W),this.Y=E("y",oe),this.Z=E("z",me,!0),this.T=E("t",G),Object.freeze(this)}static CURVE(){return u}static fromAffine(W){if(W instanceof C)throw new Error("extended point not allowed");const{x:oe,y:me}=W||{};return E("x",oe),E("y",me),new C(oe,me,i.ONE,i.mul(oe,me))}static fromBytes(W,oe=!1){const me=i.BYTES,{a:G,d:J}=u;W=Qh(Mt(W,me,"point")),xr(oe,"zip215");const w=Qh(W),A=W[me-1];w[me-1]=A&-129;const N=Fu(w),F=oe?m:i.ORDER;ep("point.y",N,Qf,F);const B=i.sqr(N),q=i.sub(B,i.ONE),z=i.sub(i.mulN(J,B),G);let{isValid:D,value:k}=y(q,z);if(!D)throw new Error("bad point: invalid y coordinate");const j=g(k),U=(A&128)!==0;if(!oe&&i.is0(k)&&U)throw new Error("bad point: x=0 and x_0=1");return U!==j&&(k=i.neg(k)),C.fromAffine({x:k,y:N})}static fromHex(W,oe=!1){return C.fromBytes(Kh(W),oe)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(W=6,oe=!0){return $.setWindowSize(this,W),oe||this.multiply(th),this}assertValidity(){const W=this,{a:oe,d:me}=u;if(W.is0())throw new Error("bad point: ZERO");const{X:G,Y:J,Z:w,T:A}=W,N=i.sqr(G),F=i.sqr(J),B=i.sqr(w),q=i.sqr(B),z=i.mul(N,oe),D=i.mul(i.add(z,F),B),k=i.add(q,i.mul(me,i.mul(N,F)));if(!i.eql(D,k))throw new Error("bad point: equation left != right (1)");const j=i.mul(G,J),U=i.mul(w,A);if(!i.eql(j,U))throw new Error("bad point: equation left != right (2)")}equals(W){O(W);const{X:oe,Y:me,Z:G}=this,{X:J,Y:w,Z:A}=W,N=i.mul(oe,A),F=i.mul(J,G),B=i.mul(me,A),q=i.mul(w,G);return i.eql(N,F)&&i.eql(B,q)}is0(){return this.equals(C.ZERO)}negate(){return new C(i.neg(this.X),this.Y,this.Z,i.neg(this.T))}double(){const{X:W,Y:oe,Z:me}=this,G=i.sqr(W),J=i.sqr(oe),w=i.mul(i.sqr(me),th),A=b(G),N=i.addN(W,oe),F=i.sub(i.subN(i.sqr(N),G),J),B=i.addN(A,J),q=i.subN(B,w),z=i.subN(A,J),D=i.mul(F,q),k=i.mul(B,z),j=i.mul(F,z),U=i.mul(q,B);return new C(D,k,U,j)}add(W){O(W);const{d:oe}=u,{X:me,Y:G,Z:J,T:w}=this,{X:A,Y:N,Z:F,T:B}=W,q=i.mul(me,A),z=i.mul(G,N),D=i.mul(i.mulN(w,oe),B),k=i.mul(J,F),j=i.sub(i.subN(i.mulN(i.addN(me,G),i.addN(A,N)),q),z),U=i.subN(k,D),V=i.addN(k,D),K=i.sub(z,b(q)),P=i.mul(j,U),re=i.mul(V,K),ue=i.mul(j,K),I=i.mul(U,V);return new C(P,re,I,ue)}subtract(W){return O(W),this.add(W.negate())}multiply(W){if(!c.isValidNot0(W))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:oe,f:me}=$.mulSecret(this,W,d,R);return R([oe,me])[0]}multiplyUnsafe(W){if(!c.isValid(W))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return W===Qf?C.ZERO:this.is0()||W===eh?this:$.mulUnsafe(this,W,R)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return $.mulUnsafe(this,u.n).is0()}toAffine(W){const oe=this;let me=W;if(me!=null&&typeof me!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof me);const{X:G,Y:J,Z:w}=oe,A=oe.is0();me==null&&(me=A?i.create(o_):i.inv(w));const N=i.mul(G,me),F=i.mul(J,me),B=i.mul(w,me);if(A)return{x:i.ZERO,y:i.ONE};if(!i.eql(B,i.ONE))throw new Error("invZ was invalid");return{x:N,y:F}}clearCofactor(){return d===eh?this:d===th?this.double():d===Kz?this.double().double():d===o_?this.double().double().double():this.multiplyUnsafe(d)}toBytes(){const{x:W,y:oe}=this.toAffine(),me=i.toBytes(oe);return me[me.length-1]|=g(W)?128:0,me}toHex(){return Sb(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const R=x=>b3(C,x),$=new E3(C,p);return $.bits>=6&&C.BASE.precompute(6),Object.freeze(C.prototype),Object.freeze(C),C}function e$(e,t,s={}){if(cl(e),typeof t!="function")throw new Error('"hash" function param is required');const r=t,i=s;_r(i,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function",toMontgomery:"function",toMontgomerySecret:"function"});const{prehash:c}=i,{BASE:u,Fp:d,Fn:p}=e,m=r.outputLen,g=2*d.BYTES;if(m!==void 0&&(Hc(m,"hash.outputLen"),m!==g))throw new Error(`hash.outputLen must be ${g}, got ${m}`);const y=i.randomBytes===void 0?ud:i.randomBytes,b=i.toMontgomery,E=i.toMontgomerySecret,O=i.adjustScalarBytes===void 0?z=>z:i.adjustScalarBytes,C=i.domain===void 0?(z,D,k)=>{if(xr(k,"phflag"),D.length||k)throw new Error("Contexts/pre-hash are not supported");return z}:i.domain;function R(z){return p.create(Fu(z))}function $(z){const D=A.secretKey;Mt(z,A.secretKey,"secretKey");const k=Mt(r(z),2*D,"hashedSecretKey"),j=O(k.slice(0,D)),U=k.slice(D,2*D),V=R(j);return{head:j,prefix:U,scalar:V}}function x(z){const{head:D,prefix:k,scalar:j}=$(z),U=u.multiply(j),V=U.toBytes();return{head:D,prefix:k,scalar:j,point:U,pointBytes:V}}function W(z){return x(z).pointBytes}function oe(z=Uint8Array.of(),...D){const k=Sr(...D);return R(r(C(k,Mt(z,void 0,"context"),!!c)))}function me(z,D,k={}){_r(k,{},{},"options"),z=Qh(Mt(z,void 0,"message")),c&&(z=c(z));const{prefix:j,scalar:U,pointBytes:V}=x(D),K=oe(k.context,j,z),P=u.multiply(K).toBytes(),re=oe(k.context,P,V,z),ue=p.create(K+re*U);if(!p.isValid(ue))throw new Error("sign failed: invalid s");const I=Sr(P,p.toBytes(ue));return Mt(I,A.signature,"result")}const G={zip215:i.zip215};function J(z,D,k,j=G){_r(j);const{context:U}=j,V=j.zip215===void 0?!!G.zip215:j.zip215,K=A.signature;z=Mt(z,K,"signature"),D=Mt(D,void 0,"message"),k=Mt(k,A.publicKey,"publicKey"),V!==void 0&&xr(V,"zip215"),c&&(D=c(D));const P=K/2,re=z.subarray(0,P),ue=Fu(z.subarray(P,K));let I,X,ce;try{I=e.fromBytes(k,V),X=e.fromBytes(re,V),ce=u.multiplyUnsafe(ue)}catch{return!1}if(!V&&I.isSmallOrder())return!1;const he=oe(U,re,k,D);return X.add(I.multiplyUnsafe(he)).subtract(ce).clearCofactor().is0()}const w=d.BYTES,A={secretKey:w,publicKey:w,signature:2*w,seed:w};function N(z){return z=z===void 0?y(A.seed):z,Mt(z,A.seed,"seed")}function F(z){return ld(z)&&z.length===A.secretKey}function B(z,D){try{return!!e.fromBytes(z,D===void 0?G.zip215:D)}catch{return!1}}const q={getExtendedPublicKey:x,randomSecretKey:N,isValidSecretKey:F,isValidPublicKey:B,toMontgomery(z){if(b===void 0)throw new Error("Montgomery conversion is not supported for this curve");return b(e.fromBytes(z))},toMontgomerySecret(z){if(E===void 0)throw new Error("Montgomery conversion is not supported for this curve");return E(z)}};return Object.freeze(A),Object.freeze(q),Object.freeze({keygen:k3(N,W),getPublicKey:W,sign:me,verify:J,utils:q,Point:e,lengths:A})}const lv=BigInt(1),c_=BigInt(2),t$=BigInt(5),n$=BigInt(8),Rb=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),s$={p:Rb,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:n$,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function r$(e){const t=BigInt(10),s=BigInt(20),r=BigInt(40),i=BigInt(80),c=Rb,d=e*e%c*e%c,p=Ft(d,c_,c)*d%c,m=Ft(p,lv,c)*e%c,g=Ft(m,t$,c)*m%c,y=Ft(g,t,c)*g%c,b=Ft(y,s,c)*y%c,E=Ft(b,r,c)*b%c,O=Ft(E,i,c)*E%c,C=Ft(O,i,c)*E%c,R=Ft(C,t,c)*g%c;return{pow_p_5_8:Ft(R,c_,c)*e%c,b2:d}}function A3(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const l_=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function a$(e,t){const s=Rb,r=Ht(t*t*t,s),i=Ht(r*r*t,s),c=r$(e*i).pow_p_5_8;let u=Ht(e*r*c,s);const d=Ht(t*u*u,s),p=u,m=Ht(u*l_,s),g=d===e,y=d===Ht(-e,s),b=d===Ht(-e*l_,s);return g&&(u=p),(y||b)&&(u=m),zz(u,s)&&(u=Ht(-u,s)),{isValid:g||y,value:u}}const jb=Qz(s$,{uvRatio:a$}),u_=jb.Fp;function i$(e){const{y:t}=e;return u_.toBytes(u_.div(lv+t,lv-t))}function o$(e){const t=jb.Fp.BYTES;return Un(e,t),A3(cd(e.subarray(0,t))).subarray(0,t)}function c$(e){return e$(jb,cd,Object.assign({adjustScalarBytes:A3,toMontgomery:i$,toMontgomerySecret:o$,zip215:!0},e))}const na=c$({}),iy=32;var jc,O3=(jc=class extends ol{constructor(t){if(super(),typeof t=="string"?this.data=Ge(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==iy)throw new Error(`Invalid public key input. Expected ${iy} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return Ps.ED25519}async verify(t,s){let r;if(typeof s=="string"){const i=wb(s);if(i.signatureScheme!=="ED25519")throw new Error("Invalid signature scheme");if(!mi(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return na.verify(r,t,this.toRawBytes())}},jc.SIZE=iy,jc);class d_{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(t,s){if(Kv(t),Un(s,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("expected Hash instance");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(s.length>r?t.create().update(s).digest():s);for(let c=0;c<i.length;c++)i[c]^=54;this.iHash.update(i),this.oHash=t.create();for(let c=0;c<i.length;c++)i[c]^=106;this.oHash.update(i),Vs(i)}update(t){return Fc(this),this.iHash.update(t),this}digestInto(t){Fc(this),Jv(t,this),this.finished=!0;const s=t.subarray(0,this.outputLen);this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||=Object.create(Object.getPrototypeOf(this),{});const{oHash:s,iHash:r,finished:i,destroyed:c,blockLen:u,outputLen:d,canXOF:p}=this;return t=t,t.finished=i,t.destroyed=c,t.blockLen=u,t.outputLen=d,t.canXOF=p,t.oHash=s._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const zp=(()=>{const e=((t,s,r)=>new d_(t,s).update(r).digest());return e.create=(t,s)=>new d_(t,s),e})();function l$(e,t,s,r){Kv(e);const i=eb({dkLen:32,asyncTick:10},r),{c,dkLen:u,asyncTick:d}=i;if(as(c,"c"),as(u,"dkLen"),as(d,"asyncTick"),c<1)throw new Error('"c" (iterations) must be >= 1');if(u<1)throw new Error('"dkLen" must be >= 1');if(u>(2**32-1)*e.outputLen)throw new Error("derived key too long");const p=sE(t,"password");try{const m=sE(s,"salt");try{const g=new Uint8Array(u),{iHash:y,oHash:b,outputLen:E}=zp.create(e,p),O=new Uint8Array(E),C=u$(y,b,m,O);return{c,dkLen:u,asyncTick:d,DK:g,outputLen:E,eng:C}}finally{typeof s=="string"&&Vs(m)}}finally{typeof t=="string"&&Vs(p)}}function u$(e,t,s,r){const i=new Uint8Array(4),c=uh(i),u=e._cloneInto().update(s),d=t._cloneInto(),p=e._cloneInto,m=t._cloneInto;return{u1:(g,y)=>{c.setInt32(0,g,!1),u._cloneInto(d).update(i).digestInto(r),t._cloneInto(d).update(r).digestInto(r),y.set(r.subarray(0,y.length))},rounds:(g,y)=>{for(let b=1;b<g;b++){p.call(e,d).update(r).digestInto(r),m.call(t,d).update(r).digestInto(r);for(let E=0;E<y.length;E++)y[E]^=r[E]}},output:g=>(e.destroy(),t.destroy(),u.destroy(),d.destroy(),Vs(r),g)}}function d$(e,t,s,r){const{c:i,dkLen:c,DK:u,outputLen:d,eng:p}=l$(e,t,s,r);for(let m=1,g=0;g<c;m++,g+=d){const y=u.subarray(g,g+d);p.u1(m,y),p.rounds(i,y)}return p.output(u)}function f$(e){for(let t=0;t<e.length;t++){const s=e.charCodeAt(t);if(s>=55296&&s<=56319){if(t+1>=e.length)return!1;const r=e.charCodeAt(++t);if(r<56320||r>57343)return!1}else if(s>=56320&&s<=57343)return!1}return!0}function N3(e){if(typeof e!="string")throw new TypeError("invalid mnemonic type: "+typeof e);if(!f$(e))throw new TypeError("expected well-formed Unicode string");return e.normalize("NFKD")}function h$(e){const t=N3(e),s=t.split(" ");if(![12,15,18,21,24].includes(s.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:s}}const p$=e=>{if(typeof e!="string")throw new TypeError("invalid passphrase type: "+typeof e);return N3("mnemonic"+e)};function m$(e,t=""){return d$(cd,h$(e).nfkd,p$(t),{c:2048,dkLen:64})}function f_(e){return!!new RegExp("^m\\/44'\\/784'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'+$").test(e)}function g$(e){return m$(e,"")}function y$(e){return Ar(g$(e))}const v$=BigInt(0);class b$ extends Error{constructor(t=""){super(t)}}const ra={Err:b$,_tlv:{encode:(e,t)=>{const{Err:s}=ra;if(Hc(e,"tag"),e<0||e>255)throw new s("tlv.encode: wrong tag");if(Nz(t,"data"),t.length&1)throw new s("tlv.encode: unpadded data");const r=t.length/2,i=Jf(r);if(i.length/2&128)throw new s("tlv.encode: long form length too big");const c=r>127?Jf(i.length/2|128):"";return Jf(e)+c+i+t},decode(e,t){const{Err:s}=ra;t=Mt(t,void 0,"DER data");let r=0;if(e<0||e>255)throw new s("tlv.decode: wrong tag");if(t.length<2||t[r++]!==e)throw new s("tlv.decode: wrong tlv");const i=t[r++],c=!!(i&128);let u=0;if(!c)u=i;else{const p=i&127;if(!p)throw new s("tlv.decode(long): indefinite length not supported");if(p>4)throw new s("tlv.decode(long): byte length is too big");const m=t.subarray(r,r+p);if(m.length!==p)throw new s("tlv.decode: length bytes not complete");if(m[0]===0)throw new s("tlv.decode(long): zero leftmost byte");for(const g of m)u=u<<8|g;if(r+=p,u<128)throw new s("tlv.decode(long): not minimal encoding")}const d=t.subarray(r,r+u);if(d.length!==u)throw new s("tlv.decode: wrong value length");return{v:d,l:t.subarray(r+u)}}},_int:{encode(e){const{Err:t}=ra;if(Eb(e),e<v$)throw new t("integer: negative integers are not allowed");let s=Jf(e);if(Number.parseInt(s[0],16)&8&&(s="00"+s),s.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return s},decode(e){const{Err:t}=ra;if(e.length<1)throw new t("invalid signature integer: empty");if(e[0]&128)throw new t("invalid signature integer: negative");if(e.length>1&&e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return qc(e)}},toSig(e,t){const{Err:s,_int:r,_tlv:i}=ra;if(t!==void 0&&(Hc(t,"maxScalarBytes"),t<1))throw new s("invalid signature: maxScalarBytes must be positive");const c=Mt(e,void 0,"signature"),{v:u,l:d}=i.decode(48,c);if(d.length)throw new s("invalid signature: left bytes after parsing");const{v:p,l:m}=i.decode(2,u),{v:g,l:y}=i.decode(2,m);if(y.length)throw new s("invalid signature: left bytes after parsing");if(t!==void 0&&(p.length>t||g.length>t))throw new s("invalid signature: integer too large");return{r:r.decode(p),s:r.decode(g)}},hexFromSig(e){const{_tlv:t,_int:s}=ra;_r(e,{r:"bigint",s:"bigint"},{},"sig");const r=t.encode(2,s.encode(e.r)),i=t.encode(2,s.encode(e.s)),c=r+i;return t.encode(48,c)}},oy=(Object.freeze(ra._tlv),Object.freeze(ra._int),Object.freeze(ra));const h_=(e,t)=>(e+(e>=0?t:-t)/x3)/t;function w$(e,t,s){ep("scalar",e,oa,s);const[[r,i],[c,u]]=t,d=h_(u*e,s),p=h_(-i*e,s);let m=e-d*r-p*c,g=-d*i-p*u;const y=m<oa,b=g<oa;y&&(m=-m),b&&(g=-g);const E=Ab(Math.ceil(kb(s)/2))+eo;if(m<oa||m>=E||g<oa||g>=E)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:y,k1:m,k2neg:b,k2:g}}function uv(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function cy(e,t){_r(e);const s={};for(let r of Object.keys(t))s[r]=e[r]===void 0?t[r]:e[r];return xr(s.lowS,"lowS"),xr(s.prehash,"prehash"),s.format!==void 0&&uv(s.format),s}const oa=BigInt(0),eo=BigInt(1),x3=BigInt(2),ly=BigInt(3),T$=BigInt(4);function C3(e,t={}){const s=_3("weierstrass",e,t),r=s.Fp,i=s.Fn;let c=s.CURVE;const{h:u,n:d}=c;_r(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",randomBytes:"function"});const{endo:p,allowInfinityPoint:m,clearCofactor:g,isTorsionFree:y,fromBytes:b,toBytes:E}=t,O=t.randomBytes===void 0?ud:t.randomBytes;if(p&&(!r.is0(c.a)||typeof p.beta!="bigint"||!Array.isArray(p.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const C=p?{beta:p.beta,basises:p.basises.map(K=>[...K])}:void 0,R=R3(r,i);function $(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function x(K,P,re){if(P.is0()){if(!m)throw new Error("bad point: ZERO");return Uint8Array.of(0)}const{x:ue,y:I}=P.toAffine(),X=r.toBytes(ue);if(xr(re,"isCompressed"),re){$();const ce=!r.isOdd(I);return Sr(I3(ce),X)}else return Sr(Uint8Array.of(4),X,r.toBytes(I))}function W(K){Mt(K,void 0,"Point");const{publicKey:P,publicKeyUncompressed:re}=R,ue=K.length,I=K[0],X=K.subarray(1);if(m&&ue===1&&I===0)return{x:r.ZERO,y:r.ZERO};if(ue===P&&(I===2||I===3)){const ce=r.fromBytes(X);if(!r.isValid(ce))throw new Error("bad point: is not on curve, wrong x");const he=w(ce);let Te;try{Te=r.sqrt(he)}catch(be){const _e=be instanceof Error?": "+be.message:"";throw new Error("bad point: is not on curve, sqrt error"+_e)}$();const Oe=r.isOdd(Te);return(I&1)===1!==Oe&&(Te=r.neg(Te)),{x:ce,y:Te}}else if(ue===re&&I===4){const ce=r.BYTES,he=r.fromBytes(X.subarray(0,ce)),Te=r.fromBytes(X.subarray(ce,ce*2));if(!A(he,Te))throw new Error("bad point: is not on curve");return{x:he,y:Te}}else throw new Error(`bad point: got length ${ue}, expected compressed=${P} or uncompressed=${re}`)}const oe=E===void 0?x:E,me=b===void 0?W:b,G=r.mul(c.b,ly),J=r.is0(c.a)?K=>r.ZERO:K=>r.mul(c.a,K);function w(K){const P=r.sqr(K),re=r.mul(P,K);return r.add(r.add(re,r.mul(K,c.a)),c.b)}function A(K,P){const re=r.sqr(P),ue=w(K);return r.eql(re,ue)}if(!A(c.Gx,c.Gy))throw new Error("bad curve params: generator point");const N=r.mul(r.pow(c.a,ly),T$),F=r.mul(r.sqr(c.b),BigInt(27));if(r.is0(r.add(N,F)))throw new Error("bad curve params: a or b");function B(K,P,re=!1){if(!r.isValid(P)||re&&r.is0(P))throw new Error(`bad point coordinate ${K}`);return typeof P=="object"&&P!==null?r.create(P):P}function q(K){if(!(K instanceof j))throw new Error("Weierstrass Point expected")}function z(K){if(!C||!C.basises)throw new Error("no endo");return w$(K,C.basises,i.ORDER)}function D(K,P,re,ue){if(!i.isValid(ue))throw new RangeError("invalid scalar: out of range");if(C){const{k1neg:I,k1:X,k2neg:ce,k2:he}=z(ue),Te=new j(r.mul(re.X,C.beta),re.Y,re.Z);K.push(I?re.negate():re,ce?Te.negate():Te),P.push(X,he)}else K.push(re),P.push(ue)}const k=new WeakSet;class j{static BASE=new j(c.Gx,c.Gy,r.ONE);static ZERO=new j(r.ZERO,r.ONE,r.ZERO);static Fp=r;static Fn=i;X;Y;Z;constructor(P,re,ue){this.X=B("x",P),this.Y=B("y",re,!0),this.Z=B("z",ue),Object.freeze(this)}static CURVE(){return c}static fromAffine(P){const{x:re,y:ue}=P||{};if(!P||!r.isValid(re)||!r.isValid(ue))throw new Error("invalid affine point");if(P instanceof j)throw new Error("projective point not allowed");return r.is0(re)&&r.is0(ue)?j.ZERO:new j(re,ue,r.ONE)}static fromBytes(P){const re=j.fromAffine(me(Mt(P,void 0,"point")));return re.assertValidity(),re}static fromHex(P){return j.fromBytes(Kh(P))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(P=6,re=!0){return V.setWindowSize(this,P),re||this.multiply(ly),this}assertValidity(){const P=this;if(P.is0()){if(m&&r.is0(P.X)&&r.eql(P.Y,r.ONE)&&r.is0(P.Z))return;throw new Error("bad point: ZERO")}if(k.has(P))return;const{x:re,y:ue}=P.toAffine();if(!r.isValid(re)||!r.isValid(ue))throw new Error("bad point: x or y not field elements");if(!A(re,ue))throw new Error("bad point: equation left != right");if(!P.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");k.add(P)}hasEvenY(){const{y:P}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(P)}equals(P){q(P);const{X:re,Y:ue,Z:I}=this,{X,Y:ce,Z:he}=P,Te=r.eql(r.mul(re,he),r.mul(X,I)),Oe=r.eql(r.mul(ue,he),r.mul(ce,I));return Te&&Oe}negate(){return new j(this.X,r.neg(this.Y),this.Z)}double(){const{X:P,Y:re,Z:ue}=this;let I=r.ZERO,X=r.ZERO,ce=r.ZERO,he=r.mul(P,P),Te=r.mul(re,re),Oe=r.mul(ue,ue),Ae=r.mul(P,re);return Ae=r.add(Ae,Ae),ce=r.mul(P,ue),ce=r.add(ce,ce),I=J(ce),X=r.mul(G,Oe),X=r.add(I,X),I=r.sub(Te,X),X=r.add(Te,X),X=r.mul(I,X),I=r.mul(Ae,I),ce=r.mul(G,ce),Oe=J(Oe),Ae=r.sub(he,Oe),Ae=J(Ae),Ae=r.add(Ae,ce),ce=r.add(he,he),he=r.add(ce,he),he=r.add(he,Oe),he=r.mul(he,Ae),X=r.add(X,he),Oe=r.mul(re,ue),Oe=r.add(Oe,Oe),he=r.mul(Oe,Ae),I=r.sub(I,he),ce=r.mul(Oe,Te),ce=r.add(ce,ce),ce=r.add(ce,ce),new j(I,X,ce)}add(P){q(P);const{X:re,Y:ue,Z:I}=this,{X,Y:ce,Z:he}=P;let Te=r.ZERO,Oe=r.ZERO,Ae=r.ZERO,be=r.mul(re,X),_e=r.mul(ue,ce),Pe=r.mul(I,he),at=r.add(re,ue),H=r.add(X,ce);at=r.mul(at,H),H=r.add(be,_e),at=r.sub(at,H),H=r.add(re,I);let te=r.add(X,he);return H=r.mul(H,te),te=r.add(be,Pe),H=r.sub(H,te),te=r.add(ue,I),Te=r.add(ce,he),te=r.mul(te,Te),Te=r.add(_e,Pe),te=r.sub(te,Te),Ae=J(H),Te=r.mul(G,Pe),Ae=r.add(Te,Ae),Te=r.sub(_e,Ae),Ae=r.add(_e,Ae),Oe=r.mul(Te,Ae),_e=r.add(be,be),_e=r.add(_e,be),Pe=J(Pe),H=r.mul(G,H),_e=r.add(_e,Pe),Pe=r.sub(be,Pe),Pe=J(Pe),H=r.add(H,Pe),be=r.mul(_e,H),Oe=r.add(Oe,be),be=r.mul(te,H),Te=r.mul(at,Te),Te=r.sub(Te,be),be=r.mul(at,_e),Ae=r.mul(te,Ae),Ae=r.add(Ae,be),new j(Te,Oe,Ae)}subtract(P){return q(P),this.add(P.negate())}is0(){return this.equals(j.ZERO)}multiply(P){if(!i.isValidNot0(P))throw new RangeError("invalid scalar: out of range");const{p:re,f:ue}=V.mulSecret(this,P,u,U);return U([re,ue])[0]}multiplyUnsafe(P){const re=this,ue=P;if(!i.isValid(ue))throw new RangeError("invalid scalar: out of range");if(ue===oa||re.is0())return j.ZERO;if(ue===eo)return re;if(V.hasWindowSize(this))return V.mulUnsafe(re,ue,U);const I=[],X=[];return D(I,X,re,ue),cv(j,I,X)}mulAddUnsafe(P,re,ue){q(re);const I=[],X=[];return D(I,X,this,P),D(I,X,re,ue),cv(j,I,X)}toAffine(P){const re=this;let ue=P;if(ue!=null&&!r.isValid(ue))throw new RangeError('"invertedZ" expected valid field element');const{X:I,Y:X,Z:ce}=re;if(r.eql(ce,r.ONE))return{x:I,y:X};const he=re.is0();ue==null&&(ue=he?r.ONE:r.inv(ce));const Te=r.mul(I,ue),Oe=r.mul(X,ue),Ae=r.mul(ce,ue);if(he)return{x:r.ZERO,y:r.ZERO};if(!r.eql(Ae,r.ONE))throw new Error("invZ was invalid");return{x:Te,y:Oe}}isTorsionFree(){return u===eo?!0:y?y(j,this):V.mulUnsafe(this,d).is0()}clearCofactor(){return u===eo?this:g?g(j,this):this.multiplyUnsafe(u)}isSmallOrder(){return u===eo?this.is0():this.clearCofactor().is0()}toBytes(P=!0){return xr(P,"isCompressed"),this.assertValidity(),oe(j,this,P)}toHex(P=!0){return Sb(this.toBytes(P))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const U=K=>b3(j,K),V=new E3(j,O);return V.bits>=6&&j.BASE.precompute(6),Object.freeze(j.prototype),Object.freeze(j),j}function I3(e){return Uint8Array.of(e?2:3)}function R3(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function S$(e,t={}){cl(e);const{Fn:s}=e,r=t.randomBytes===void 0?ud:t.randomBytes,i=Object.assign(R3(e.Fp,s),{seed:Math.max(Cb(s.ORDER),16)});function c(E){try{const O=s.fromBytes(E);return s.isValidNot0(O)}catch{return!1}}function u(E,O){const{publicKey:C,publicKeyUncompressed:R}=i;try{const $=E.length;return O===!0&&$!==C||O===!1&&$!==R?!1:!e.fromBytes(E).is0()}catch{return!1}}function d(E){return E=E===void 0?r(i.seed):E,v3(Mt(E,i.seed,"seed"),s.ORDER)}function p(E,O=!0){return e.BASE.multiply(s.fromBytes(E)).toBytes(O)}function m(E){const{secretKey:O,publicKey:C,publicKeyUncompressed:R}=i,$=s._lengths;if(!ld(E))return;const x=Mt(E,void 0,"key").length,W=x===C||x===R,oe=x===O||!!$?.includes(x);if(!(W&&oe))return W}function g(E,O,C=!0){if(m(E)===!0)throw new Error("first arg must be private key");if(m(O)===!1)throw new Error("second arg must be public key");const R=s.fromBytes(E),$=e.fromBytes(O);if($.is0())throw new Error("invalid public key: point at infinity");return $.multiply(R).toBytes(C)}const y={isValidSecretKey:c,isValidPublicKey:u,randomSecretKey:d},b=k3(d,p);return Object.freeze(y),Object.freeze(i),Object.freeze({getPublicKey:p,getSharedSecret:g,keygen:b,Point:e,utils:y,lengths:i})}function j3(e,t,s={}){cl(e);const r=t;Kv(r),_r(s,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const i=Object.assign({},s),c=i.randomBytes===void 0?ud:i.randomBytes,u=i.hmac===void 0?(K,P)=>zp(r,K,P):i.hmac,{Fp:d,Fn:p}=e,{ORDER:m,BITS:g}=p,y=Cb(m),b=w3(c,y),{keygen:E,getPublicKey:O,getSharedSecret:C,utils:R,lengths:$}=S$(e,i),x={prehash:!0,lowS:typeof i.lowS=="boolean"?i.lowS:!0,format:"compact",extraEntropy:!1},W=m*x3+eo<d.ORDER;function oe(K){const P=m>>eo;return K>P}function me(K,P){if(!p.isValidNot0(P))throw new Error(`invalid signature ${K}: out of range 1..Point.Fn.ORDER`);return P}function G(){if(!d.isOdd)throw new Error("Field doesn't support isOdd")}function J(K,P,re){return G(),(K===re?0:2)|Number(d.isOdd(P))}function w(){if(W)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function A(K,P){uv(P);const re=$.signature,ue=P==="compact"?re:P==="recovered"?re+1:void 0;return Mt(K,ue)}class N{r;s;recovery;constructor(P,re,ue){if(this.r=me("r",P),this.s=me("s",re),ue!=null){if(w(),![0,1,2,3].includes(ue))throw new Error("invalid recovery id");this.recovery=ue}Object.freeze(this)}static fromBytes(P,re=x.format){A(P,re);let ue;if(re==="der"){if(P.length>2*p.BYTES+16)throw new oy.Err("invalid signature: DER signature too long");const{r:he,s:Te}=oy.toSig(Mt(P),p.BYTES+1);return new N(he,Te)}re==="recovered"&&(ue=P[0],re="compact",P=P.subarray(1));const I=$.signature/2,X=P.subarray(0,I),ce=P.subarray(I,I*2);return new N(p.fromBytes(X),p.fromBytes(ce),ue)}static fromHex(P,re){return this.fromBytes(Kh(P),re)}assertRecovery(){const{recovery:P}=this;if(P==null)throw new Error("invalid recovery id: must be present");return P}addRecoveryBit(P){return new N(this.r,this.s,P)}recoverPublicKey(P){const{r:re,s:ue}=this,I=this.assertRecovery(),X=I===2||I===3?re+m:re;if(!d.isValid(X))throw new Error("invalid recovery id: sig.r+curve.n != R.x");const ce=d.toBytes(X),he=e.fromBytes(Sr(I3((I&1)===0),ce)),Te=p.inv(X),Oe=B(Mt(P,void 0,"msgHash")),Ae=p.create(-Oe*Te),be=p.create(ue*Te),_e=e.BASE.mulAddUnsafe(Ae,he,be);if(_e.is0())throw new Error("invalid recovery: point at infinify");return _e.assertValidity(),_e}hasHighS(){return oe(this.s)}toBytes(P=x.format){if(uv(P),P==="der")return Kh(oy.hexFromSig(this));const{r:re,s:ue}=this,I=p.toBytes(re),X=p.toBytes(ue);return P==="recovered"?(w(),Sr(Uint8Array.of(this.assertRecovery()),I,X)):Sr(I,X)}toHex(P){return Sb(this.toBytes(P))}}Object.freeze(N.prototype),Object.freeze(N);const F=i.bits2int===void 0?function(P){if(P.length>8192)throw new Error("input is too large");const re=qc(P),ue=P.length*8-g;return ue>0?re>>BigInt(ue):re}:i.bits2int,B=i.bits2int_modN===void 0?function(P){return p.create(F(P))}:i.bits2int_modN,q=Ab(g);function z(K){return ep("num < 2^"+g,K,oa,q),p.toBytes(K)}function D(K,P){return Mt(K,void 0,"message"),P?Mt(r(K),void 0,"prehashed message"):K}function k(K,P,re){const{lowS:ue,prehash:I,extraEntropy:X}=cy(re,x);K=D(K,I);const ce=B(K),he=p.fromBytes(P);if(!p.isValidNot0(he))throw new Error("invalid private key");const Te=[z(he),z(ce)];if(X!=null&&X!==!1){const _e=X===!0?c($.secretKey):X;Te.push(Mt(_e,void 0,"extraEntropy"))}const Oe=Sr(...Te),Ae=ce;function be(_e){const Pe=F(_e);if(!p.isValidNot0(Pe))return;const at=e.BASE.multiply(Pe).toAffine(),H=p.create(at.x);if(H===oa)return;let te;if(b!==void 0){const le=qc(v3(b(y),m)),$e=p.inv(p.mul(le,Pe)),Le=p.mul(le,Ae),Dt=p.mul(le,he);te=p.create($e*p.create(Le+Dt*H))}else{const le=Dz(Pe,m);te=p.create(le*p.create(Ae+H*he))}if(te===oa)return;let de=J(at.x,at.y,H),fe=te;return ue&&oe(te)&&(fe=p.neg(te),de^=1),new N(H,fe,W?void 0:de)}return{seed:Oe,k2sig:be}}function j(K,P,re={}){const{seed:ue,k2sig:I}=k(K,P,re);return Cz(r.outputLen,p.BYTES,u)(ue,I).toBytes(re.format)}function U(K,P,re,ue={}){const{lowS:I,prehash:X,format:ce}=cy(ue,x);if(re=Mt(re,void 0,"publicKey"),P=D(P,X),!ld(K)){const he=K instanceof N?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+he)}A(K,ce);try{const he=N.fromBytes(K,ce),Te=e.fromBytes(re);if(Te.is0()||I&&he.hasHighS())return!1;const{r:Oe,s:Ae}=he,be=B(P),_e=p.inv(Ae),Pe=p.create(be*_e),at=p.create(Oe*_e),H=e.BASE.mulAddUnsafe(Pe,Te,at);if(H.is0())return!1;const te=H.toAffine();return!(p.create(te.x)!==Oe||ce==="recovered"&&he.recovery!==J(te.x,te.y,Oe))}catch{return!1}}function V(K,P,re={}){const{prehash:ue}=cy(re,x);return P=D(P,ue),N.fromBytes(K,"recovered").recoverPublicKey(P).toBytes()}return Object.freeze({keygen:E,getPublicKey:O,getSharedSecret:C,utils:R,lengths:$,Point:e,sign:j,verify:U,recoverPublicKey:V,Signature:N,hash:r})}const E$={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},_$=C3(E$),Uu=j3(_$,Tb),uy=33,dv=64;var Mc,k$=(Mc=class extends ol{constructor(t){if(super(),typeof t=="string"?this.data=Ge(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==uy)throw new Error(`Invalid public key input. Expected ${uy} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return Ps.Passkey}async verify(t,s){const r=M3(s),i=JSON.parse(r.clientDataJson);if(i.type!=="webauthn.get"||!mi(t,Ge(i.challenge.replace(/-/g,"+").replace(/_/g,"/"))))return!1;const c=r.userSignature.slice(1+dv);if(!mi(this.toRawBytes(),c))return!1;const u=new Uint8Array([...r.authenticatorData,...Tb(new TextEncoder().encode(r.clientDataJson))]),d=r.userSignature.slice(1,dv+1);return Uu.verify(d,u,c)}},Mc.SIZE=uy,Mc);function M3(e){const t=typeof e=="string"?Ge(e):e;if(t[0]!==Ps.Passkey)throw new Error("Invalid signature scheme");const s=vk.parse(t.slice(1));return{signatureScheme:"Passkey",serializedSignature:Ke(t),signature:t,authenticatorData:s.authenticatorData,clientDataJson:s.clientDataJson,userSignature:new Uint8Array(s.userSignature),publicKey:new Uint8Array(s.userSignature.slice(1+dv))}}function A$(e){for(let t=0;t<e.length;t++)if(e[t]!==0)return t;return-1}function Mb(e,t){return Qv(e.toString(16).padStart(t*2,"0").slice(-t*2))}function D3(e,t){const s=Mb(e,t),r=A$(s);return r===-1?new Uint8Array([0]):s.slice(r)}function O$(e){return e==="accounts.google.com"?"https://accounts.google.com":e}function N$(e){if(e.length!==1)throw new Error("Invalid base64Url character: "+e);const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".indexOf(e);if(t===-1)throw new Error("Invalid base64Url character: "+e);const s=t.toString(2).padStart(6,"0");return Array.from(s).map(Number)}function x$(e){let t=[];for(let s=0;s<e.length;s++){const r=N$(e.charAt(s));t=t.concat(r)}return t}function C$(e,t){if(e.length<2)throw new Error(`Input (s = ${e}) is not tightly packed because s.length < 2`);let s=x$(e);const r=t%4;if(r!==0)if(r===1)s=s.slice(2);else if(r===2)s=s.slice(4);else throw new Error(`Input (s = ${e}) is not tightly packed because i%4 = 3 (i = ${t}))`);const i=(t+e.length-1)%4;if(i!==3)if(i===2)s=s.slice(0,s.length-2);else if(i===1)s=s.slice(0,s.length-4);else throw new Error(`Input (s = ${e}) is not tightly packed because (i + s.length - 1)%4 = 0 (i = ${t}))`);if(s.length%8!==0)throw new Error("We should never reach here...");const c=new Uint8Array(Math.floor(s.length/8));let u=0;for(let d=0;d<s.length;d+=8){const p=s.slice(d,d+8),m=parseInt(p.join(""),2);c[u++]=m}return new TextDecoder().decode(c)}function I$(e){if(!(e.slice(-1)==="}"||e.slice(-1)===","))throw new Error("Invalid claim");const t=JSON.parse("{"+e.slice(0,-1)+"}");if(Object.keys(t).length!==1)throw new Error("Invalid claim");const s=Object.keys(t)[0];return[s,t[s]]}function U3(e,t){const[s,r]=I$(C$(e.value,e.indexMod4));if(s!==t)throw new Error(`Invalid field name: found ${s} expected ${t}`);return r}const R$=S.struct("ZkLoginSignature",{inputs:S.struct("ZkLoginSignatureInputs",{proofPoints:S.struct("ZkLoginSignatureInputsProofPoints",{a:S.vector(S.string()),b:S.vector(S.vector(S.string())),c:S.vector(S.string())}),issBase64Details:S.struct("ZkLoginSignatureInputsClaim",{value:S.string(),indexMod4:S.u8()}),headerBase64:S.string(),addressSeed:S.string()}),maxEpoch:S.u64(),userSignature:S.byteVector()});function j$(e){return R$.parse(typeof e=="string"?Ge(e):e)}var B3=class ti extends ol{#e;#t;#r;constructor(t,{client:s}={}){super(),this.#t=s,typeof t=="string"?this.#e=Ge(t):t instanceof Uint8Array?this.#e=t:this.#e=Uint8Array.from(t),this.#r=this.#e.length!==this.#e[0]+1+32,this.#r&&(this.#e=wc(this.#e,!1))}get legacyAddress(){return this.#r}static fromBytes(t,{client:s,address:r,legacyAddress:i}={}){let c;if(i===!0?c=new ti(wc(t,!0),{client:s}):i===!1?c=new ti(wc(t,!1),{client:s}):r?(c=new ti(wc(t,!1),{client:s}),c.toSuiAddress()!==r&&(c=new ti(wc(t,!0),{client:s}))):c=new ti(t,{client:s}),r&&c.toSuiAddress()!==r)throw new Error("Public key bytes do not match the provided address");return c}static fromProof(t,s){const{issBase64Details:r,addressSeed:i}=s,c=U3(r,"iss"),u=np(BigInt(i),c,{legacyAddress:!0});if(u.toSuiAddress()===t)return u;const d=np(BigInt(i),c,{legacyAddress:!1});if(d.toSuiAddress()!==t)throw new Error("Proof does not match address");return d}equals(t){return super.equals(t)}toSuiAddress(){return this.#r?this.#s():super.toSuiAddress()}#s(){const t=wc(this.#e,!0),s=new Uint8Array(t.length+1);return s[0]=this.flag(),s.set(t,1),ye(il(po(s,{dkLen:32})).slice(0,sl*2))}toRawBytes(){return this.#e}flag(){return Ps.ZkLogin}async verify(t,s){throw Error("does not support")}verifyPersonalMessage(t,s){const r=fv(s);return p_({address:new ti(r.publicKey).toSuiAddress(),bytes:Ke(t),signature:r.serializedSignature,intentScope:"PersonalMessage",client:this.#t})}verifyTransaction(t,s){const r=fv(s);return p_({address:new ti(r.publicKey).toSuiAddress(),bytes:Ke(t),signature:r.serializedSignature,intentScope:"TransactionData",client:this.#t})}verifyAddress(t){return t===super.toSuiAddress()||t===this.#s()}};function np(e,t,s){if(s.legacyAddress===void 0)throw new Error("legacyAddress parameter must be specified");const r=s.legacyAddress?D3(e,32):Mb(e,32),i=new TextEncoder().encode(O$(t)),c=new Uint8Array(1+i.length+r.length);return c.set([i.length],0),c.set(i,1),c.set(r,1+i.length),new B3(c,s)}function wc(e,t){const s=e[0]+1,r=BigInt(`0x${Ar(e.slice(s))}`),i=t?D3(r,32):Mb(r,32),c=new Uint8Array(s+i.length);return c.set(e.slice(0,s),0),c.set(i,s),c}async function p_({address:e,bytes:t,signature:s,intentScope:r,client:i}){if(!i)throw new Error("A Sui Client (GRPC, GraphQL, or JSON RPC) is required to verify zkLogin signatures");const c=await i.core.verifyZkLoginSignature({bytes:t,signature:s,intentScope:r,address:e});return c.success===!0&&c.errors.length===0}function fv(e){const t=typeof e=="string"?Ge(e):e;if(t[0]!==Ps.ZkLogin)throw new Error("Invalid signature scheme");const{inputs:s,maxEpoch:r,userSignature:i}=j$(t.slice(1)),{issBase64Details:c,addressSeed:u}=s,d=U3(c,"iss"),p=np(BigInt(u),d,{legacyAddress:!1});return{serializedSignature:Ke(t),signatureScheme:"ZkLogin",zkLogin:{inputs:s,maxEpoch:r,userSignature:i,iss:d,addressSeed:BigInt(u)},signature:t,publicKey:p.toRawBytes()}}function M$({signature:e,signatureScheme:t,publicKey:s}){if(!s)throw new Error("`publicKey` is required");const r=s.toRawBytes(),i=new Uint8Array(1+e.length+r.length);return i.set([Ps[t]]),i.set(e,1),i.set(r,1+e.length),Ke(i)}function sp(e){const t=Ge(e),s=Bp[t[0]];switch(s){case"Passkey":return M3(e);case"MultiSig":return{serializedSignature:e,signatureScheme:s,multisig:M.MultiSig.parse(t.slice(1)),bytes:t,signature:void 0};case"ZkLogin":return fv(e);case"ED25519":case"Secp256k1":case"Secp256r1":return wb(e);default:throw new Error("Unsupported signature scheme")}}const Ah=32,L3="suiprivkey";var Db=class{async signWithIntent(e,t){const s=po(n3(t,e),{dkLen:32});return{signature:M$({signature:await this.sign(s),signatureScheme:this.getKeyScheme(),publicKey:this.getPublicKey()}),bytes:Ke(e)}}async signTransaction(e){return this.signWithIntent(e,"TransactionData")}async signPersonalMessage(e){const{signature:t}=await this.signWithIntent(S.byteVector().serialize(e).toBytes(),"PersonalMessage");return{bytes:Ke(e),signature:t}}async signAndExecuteTransaction({transaction:e,client:t}){e.setSenderIfNotSet(this.toSuiAddress());const s=await e.build({client:t}),{signature:r}=await this.signTransaction(s);return t.core.executeTransaction({transaction:s,signatures:[r],include:{transaction:!0,effects:!0}})}toSuiAddress(){return this.getPublicKey().toSuiAddress()}},D$=class extends Db{};function U$(e){const{prefix:t,words:s}=Dh.decode(e);if(t!==L3)throw new Error("invalid private key prefix");const r=new Uint8Array(Dh.fromWords(s)),i=r.slice(1);return{scheme:Bp[r[0]],secretKey:i}}function B$(e,t){if(e.length!==Ah)throw new Error("Invalid bytes length");const s=Ps[t],r=new Uint8Array(e.length+1);return r.set([s]),r.set(e,1),Dh.encode(L3,Dh.toWords(r))}const L$="ed25519 seed",z$=2147483648,$$=new RegExp("^m(\\/[0-9]+')+$"),z3=e=>e.replace("'",""),V$=e=>{const t=zp.create(cd,new TextEncoder().encode(L$)).update(sd(e)).digest();return{key:t.slice(0,32),chainCode:t.slice(32)}},P$=({key:e,chainCode:t},s)=>{const r=new ArrayBuffer(4);new DataView(r).setUint32(0,s);const i=new Uint8Array(1+e.length+r.byteLength);i.set(new Uint8Array(1).fill(0)),i.set(e,1),i.set(new Uint8Array(r,0,r.byteLength),e.length+1);const c=zp.create(cd,t).update(i).digest();return{key:c.slice(0,32),chainCode:c.slice(32)}},G$=e=>$$.test(e)?!e.split("/").slice(1).map(z3).some(isNaN):!1,m_=(e,t,s=z$)=>{if(!G$(e))throw new Error("Invalid derivation path");const{key:r,chainCode:i}=V$(t);return e.split("/").slice(1).map(z3).map(c=>parseInt(c,10)).reduce((c,u)=>P$(c,u+s),{key:r,chainCode:i})},g_="m/44'/784'/0'/0'/0'";var F$=class xu extends D${constructor(t){if(super(),t)this.keypair={publicKey:t.publicKey,secretKey:t.secretKey.slice(0,32)};else{const s=na.utils.randomSecretKey();this.keypair={publicKey:na.getPublicKey(s),secretKey:s}}}getKeyScheme(){return"ED25519"}static generate(){const t=na.utils.randomSecretKey();return new xu({publicKey:na.getPublicKey(t),secretKey:t})}static fromSecretKey(t,s){if(typeof t=="string"){const c=U$(t);if(c.scheme!=="ED25519")throw new Error(`Expected a ED25519 keypair, got ${c.scheme}`);return this.fromSecretKey(c.secretKey,s)}const r=t.length;if(r!==Ah)throw new Error(`Wrong secretKey size. Expected ${Ah} bytes, got ${r}.`);const i={publicKey:na.getPublicKey(t),secretKey:t};if(!s||!s.skipValidation){const c=new TextEncoder().encode("sui validation"),u=na.sign(c,t);if(!na.verify(u,c,i.publicKey))throw new Error("provided secretKey is invalid")}return new xu(i)}getPublicKey(){return new O3(this.keypair.publicKey)}getSecretKey(){return B$(this.keypair.secretKey.slice(0,Ah),this.getKeyScheme())}async sign(t){return na.sign(t,this.keypair.secretKey)}static deriveKeypair(t,s){if(s==null&&(s=g_),!f_(s))throw new Error("Invalid derivation path");const{key:r}=m_(s,y$(t));return xu.fromSecretKey(r)}static deriveKeypairFromSeed(t,s){if(s==null&&(s=g_),!f_(s))throw new Error("Invalid derivation path");const r=typeof t=="string"?t:Ar(t),{key:i}=m_(s,r);return xu.fromSecretKey(i)}};const Ub={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},H$={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},y_=BigInt(2);function q$(e){const t=Ub.p,s=BigInt(3),r=BigInt(6),i=BigInt(11),c=BigInt(22),u=BigInt(23),d=BigInt(44),p=BigInt(88),m=e*e*e%t,g=m*m*e%t,y=Ft(g,s,t)*g%t,b=Ft(y,s,t)*g%t,E=Ft(b,y_,t)*m%t,O=Ft(E,i,t)*E%t,C=Ft(O,c,t)*O%t,R=Ft(C,d,t)*C%t,$=Ft(R,p,t)*R%t,x=Ft($,d,t)*C%t,W=Ft(x,s,t)*g%t,oe=Ft(W,u,t)*O%t,me=Ft(oe,r,t)*m%t,G=Ft(me,y_,t);if(!hv.eql(hv.sqr(G),e))throw new Error("Cannot find square root");return G}const hv=Lp(Ub.p,{sqrt:q$}),Z$=C3(Ub,{Fp:hv,endo:H$}),Y$=j3(Z$,Tb),dy=33;var Dc,W$=(Dc=class extends ol{constructor(t){if(super(),typeof t=="string"?this.data=Ge(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==dy)throw new Error(`Invalid public key input. Expected ${dy} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return Ps.Secp256k1}async verify(t,s){let r;if(typeof s=="string"){const i=wb(s);if(i.signatureScheme!=="Secp256k1")throw new Error("Invalid signature scheme");if(!mi(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return Y$.verify(r,t,this.toRawBytes())}},Dc.SIZE=dy,Dc);const fy=33;var Uc,Bb=(Uc=class extends ol{constructor(t){if(super(),typeof t=="string"?this.data=Ge(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==fy)throw new Error(`Invalid public key input. Expected ${fy} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return Ps.Secp256r1}async verify(t,s){let r;if(typeof s=="string"){const i=sp(s);if(i.signatureScheme!=="Secp256r1")throw new Error("Invalid signature scheme");if(!mi(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return Uu.verify(r,t,this.toRawBytes())}},Uc.SIZE=fy,Uc),X$=class{#e;#t;#r=null;constructor(e,t){this.#e=e,this.#t=t}get(e){return this.#a("readonly",t=>t.get(e))}async set(e,t){await this.#a("readwrite",s=>s.put(t,e))}del(e){return this.#a("readwrite",t=>t.delete(e))}entries(){return this.#s().then(e=>new Promise((t,s)=>{const r=e.transaction(this.#t,"readonly"),i=r.objectStore(this.#t),c=[],u=i.openCursor();u.onsuccess=()=>{const d=u.result;d&&(c.push([d.key,d.value]),d.continue())},r.oncomplete=()=>t(c),r.onerror=()=>s(r.error)}))}#s(){return this.#r||(this.#r=new Promise((e,t)=>{const s=indexedDB.open(this.#e);s.onupgradeneeded=()=>{s.result.objectStoreNames.contains(this.#t)||s.result.createObjectStore(this.#t)},s.onsuccess=()=>e(s.result),s.onerror=()=>{this.#r=null,t(s.error)}})),this.#r}#a(e,t){return this.#s().then(s=>new Promise((r,i)=>{const c=s.transaction(this.#t,e),u=t(c.objectStore(this.#t));c.oncomplete=()=>r(u.result),c.onerror=()=>i(c.error),c.onabort=()=>i(c.error)}))}};function K$(e){const t=new Uint8Array(e),s=t.slice(1,33),r=(t.slice(33,65)[31]&1)===0?2:3,i=new Uint8Array(Bb.SIZE);return i[0]=r,i.set(s,1),i}var v_=class pv extends Db{#e;static async generate({extractable:t=!1}={}){const s=await globalThis.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},t,["sign","verify"]),r=await globalThis.crypto.subtle.exportKey("raw",s.publicKey);return new pv(s.privateKey,K$(new Uint8Array(r)))}static import(t){return new pv(t.privateKey,t.publicKey)}getKeyScheme(){return"Secp256r1"}constructor(t,s){super(),this.privateKey=t,this.#e=new Bb(s)}export(){const t={privateKey:this.privateKey,publicKey:this.#e.toRawBytes()};return Object.defineProperty(t,"toJSON",{enumerable:!1,value:()=>{throw new Error("The exported keypair must not be serialized. It must be stored in IndexedDB directly.")}}),t}getPublicKey(){return this.#e}async sign(t){const s=await globalThis.crypto.subtle.sign({name:"ECDSA",hash:"SHA-256"},this.privateKey,t),r=Uu.Signature.fromBytes(new Uint8Array(s));return(r.hasHighS()?new Uu.Signature(r.r,Uu.Point.Fn.neg(r.s)):r).toBytes("compact")}};const J$="dev-wallet-webcrypto",Q$="accounts",hy="__account_meta__";var eV=class extends bz{#e;constructor(e){super(),this.id="webcrypto",this.name="WebCrypto Signer",this.#e=new X$(e?.dbName??J$,e?.storeName??Q$)}async initialize(){const e=await this.#e.entries(),t=await this.#e.get(hy)??[],s=[];for(const[r,i]of e){if(r===hy)continue;const c=r;try{const u=i,d=v_.import(u),p=t.find(m=>m.address===c);s.push(Jy(d,c,p?.label??"Account"))}catch(u){console.warn(`[dev-wallet] Failed to load account ${c}, skipping:`,u)}}this.setInitialAccounts(s)}async createAccount(e){const t=await v_.generate(),s=t.getPublicKey().toSuiAddress(),r=Jy(t,s,e?.label??this.getDefaultLabel());return await this.#e.set(s,t.export()),this.addAccount(r),await this.#t(),r}async renameAccount(e,t){return this._performRename(e,t)?(await this.#t(),!0):!1}async removeAccount(e){return this.removeAccountByAddress(e)?(await this.#e.del(e),await this.#t(),!0):!1}async#t(){const e=this.getAccounts().map(t=>({address:t.address,label:t.label}));await this.#e.set(hy,e)}};let py=0,b_=[];function tV(){return py+=1,()=>{if(py-=1,py===0){let e=b_;b_=[];for(let t of e)t()}}}function rp(e){let t=tV(),s;try{s=Promise.resolve(e()).finally(t)}catch(r){throw t(),r}return s.t=!0,s}let Qs=[],Cu=0;const mv=4,Oh=globalThis.nanostoresGlobal||={epoch:0};let nV=()=>{let e,t;for(;Cu<Qs.length;){t=Cu,Cu+=mv;try{Qs[t](Qs[t+1].value,Qs[t+2],Qs[t+3])}catch(s){e=s}}if(Qs.length=Cu=0,e)throw e};const ap=e=>{let t=[],s={eq:Object.is,get(){return s.lc||s.listen(()=>{})(),s.value},init:e,lc:0,listen(r){return s.lc=t.push(r),()=>{for(let c=Cu;c<Qs.length;)Qs[c]===r?Qs.splice(c,mv):c+=mv;let i=t.indexOf(r);~i&&(t.splice(i,1),--s.lc||s.off())}},notify(r,i){Oh.epoch++;let c=!Qs.length&&!0;for(let u of t)Qs.push(u,s,r,i);c&&nV()},off(){},set(r){let i=s.value;s.eq(i,r)||(s.value=r,s.notify(i))},subscribe(r){let i=s.listen(r);return r(s.value),i},value:e};return s},sV=e=>e,rV=5,nh=6,sh=10;let aV=(e,t,s,r)=>(e.events=e.events||{},e.events[s+sh]||(e.events[s+sh]=r(i=>{e.events[s].reduceRight((c,u)=>(u(c),c),{shared:{},...i})})),e.events[s]=e.events[s]||[],e.events[s].push(t),()=>{let i=e.events[s],c=i.indexOf(t);~c&&(i.splice(c,1),i.length||(e.events[s+sh](),delete e.events[s+sh]))});const iV=1e3;let $p=(e,t)=>aV(e,r=>{let i=t(r);i&&e.events[nh].push(i)},rV,r=>{let i=e.listen;e.listen=(...u)=>(!e.lc&&!e.active&&(e.active=!0,r()),i(...u));let c=e.off;return e.events[nh]=[],e.off=()=>{c(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let u of e.events[nh])u();e.events[nh]=[]}},iV)},()=>{e.listen=i,e.off=c}}),oV=(e,t,s)=>{Array.isArray(e)||(e=[e]);let r,i,c=()=>{if(i===Oh.epoch)return;i=Oh.epoch;let m=e.map(g=>g.get());if(!r?.every((g,y)=>e[y].eq(g,m[y]))){r=m;let g=t(...m);g&&g.then&&g.t?g.then(y=>{r===m&&u.set(y)}):(u.set(g),i=Oh.epoch)}},u=ap(),d=u.get;u.get=()=>(c(),d());let p=c;return $p(u,()=>{let m=e.map(g=>g.listen(p));return c(),()=>{for(let g of m)g()}}),u};const my=(e,t)=>oV(e,t);function w_(e,t){let s=cV(t),r=e;for(let i of s){if(r==null)return;r=r[i]}return r}const T_=/(.*)\[(\d+)\]/;function cV(e){return e.split(".").flatMap(t=>$3(t))}function $3(e){if(T_.test(e)){let[,t,s]=e.match(T_);return[...$3(t),s]}return[e]}function lV(e,t,s){let r=new Set(t);return e.listen((i,c,u)=>{(u===void 0?t.some(d=>c===void 0||i[d]!==c[d]||w_(i,d)!==w_(c,d)):r.has(u)||r.has(u.split(/\.|\[/)[0]))&&s(i,c,u)})}const uV=(e={})=>{let t=ap(e);return t.eqKey=Object.is,t.setKey=function(s,r){let i=t.value;typeof r>"u"&&s in t.value?(t.value={...t.value},delete t.value[s],t.notify(i,s)):t.eqKey(t.value[s],r,s)||(t.value={...t.value,[s]:r},t.notify(i,s))},t},V3=new WeakMap;function P3(e,t){V3.set(e,t)}function Vp(e){const t=Cr(e),s=t.accounts.find(({address:r})=>r===e.address);if(!s){const r=new ad(yj,{address:e.address,walletName:t.name});throw Ip(r,Vp),r}return s}function Cr(e){const t=V3.get(e);if(!t){const s=new ad(gj);throw Ip(s,Cr),s}return t}function ip(e,t){const s=new Set(e),r=new Set(t);if(s.size!==r.size)return!0;for(const i of s)if(!r.has(i))return!0;return!1}function dV(e,t){if(e.length!==t.length)return!0;for(let s=0;s<e.length;s+=1)if(e[s]!==t[s])return!0;return!1}const S_=new WeakMap;function gv(e,t){let s=S_.get(t);if(s)try{Cr(s)!==e&&(s=void 0)}catch{s=void 0}const r=!s;let i=s??{},c=!s;function u(){c||(i={...i},c=!0)}return(r||ip(i.chains,t.chains))&&(u(),i.chains=Object.freeze([...t.chains])),(r||ip(i.features,t.features))&&(u(),i.features=Object.freeze([...t.features])),(r||i.address!==t.address||i.icon!==t.icon||i.label!==t.label||dV(i.publicKey,t.publicKey))&&(u(),i.address=t.address,i.icon=t.icon,i.label=t.label,i.publicKey=t.publicKey),c&&(S_.set(t,i),P3(i,e)),Object.freeze(i)}const E_=new WeakMap;function fV(e){const t=E_.get(e),s=!t;let r=t??{},i=!t;function c(){i||(r={...r},i=!0)}const u={_cache:[],*[Symbol.iterator](){this._cache.length&&(yield*this._cache);for(const d of e.accounts.slice(this._cache.length)){const p=gv(e,d);this._cache.push(p),yield p}},some(d){if(this._cache.some(d))return!0;for(const p of e.accounts.slice(this._cache.length)){const m=gv(e,p);if(this._cache.push(m),d(m))return!0}return!1},get length(){return e.accounts.length}};return(s||r.accounts.length!==e.accounts.length||u.some(d=>!r.accounts.includes(d)))&&(c(),r.accounts=Object.freeze(Array.from(u))),(s||ip(r.features,Object.keys(e.features)))&&(c(),r.features=Object.freeze(Object.keys(e.features))),(s||ip(r.chains,e.chains))&&(c(),r.chains=Object.freeze([...e.chains])),(s||r.icon!==e.icon||r.name!==e.name||r.version!==e.version)&&(c(),r.icon=e.icon,r.name=e.name,r.version=e.version),i&&(E_.set(e,r),P3(r,e)),Object.freeze(r)}function hV(e,t){if(e.address!==t.address)return!1;const s=Cr(e),r=Cr(t);return s===r}function Zc(e,t){const s=Cr(t),r=Cr(e);return s===r}function dd(e,t){const s=Cr(e);if(!(t in s.features)){const r=new ad(Tj,{featureName:t,supportedChains:[...s.chains],supportedFeatures:Object.keys(s.features),walletName:s.name});throw Ip(r,dd),r}return s.features[t]}function G3(e,t){if(!e.features.includes(t)){const s=new ad(wj,{address:e.address,featureName:t,supportedChains:[...e.chains],supportedFeatures:[...e.features]});throw Ip(s,G3),s}return dd(e,t)}new TextEncoder;const pV=new TextDecoder,mV=new TextDecoder("utf-8",{fatal:!0});function gV(e,t=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64"});if(t){if(e.includes("+")||e.includes("/"))throw new TypeError("Invalid base64url");e=e.replace(/-/g,"+").replace(/_/g,"/")}const s=atob(e),r=new Uint8Array(s.length);for(let i=0;i<s.length;i++)r[i]=s.charCodeAt(i);return r}class yV extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,s){super(t,s),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class qi extends yV{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}const vV="The input to be decoded is not correctly encoded.";function bV(e){try{return gV(typeof e=="string"?e:pV.decode(e),!0)}catch(t){throw new TypeError(vV,{cause:t})}}function wV(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function TV(e){if(typeof e!="string")throw new qi("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:s}=e.split(".");if(s===5)throw new qi("Only JWTs using Compact JWS serialization can be decoded");if(s!==3)throw new qi("Invalid JWT");if(!t)throw new qi("JWTs must contain a payload");let r;try{r=bV(t)}catch{throw new qi("Failed to base64url decode the payload")}let i;try{i=JSON.parse(mV.decode(r))}catch{throw new qi("Failed to parse the decoded payload as JSON")}if(!wV(i))throw new qi("Invalid JWT Claims Set");return i}const SV=Ne({address:Be(),publicKey:Be(),label:fn(Be()),features:fn(ct(Be()))}),EV=Ne({exp:In(),iat:In(),iss:Be(),aud:Be(),payload:Ne({accounts:ct(SV)})});function _V(e){const t=TV(e);return Et(EV,t)}const kV=Np("type",[Ne({type:st("connect"),session:Be("`session` is required")}),Ne({type:st("sign-transaction"),bytes:Be(),signature:Be()}),Ne({type:st("sign-and-execute-transaction"),bytes:Be(),signature:Be(),digest:Be(),effects:Be()}),Ne({type:st("sign-personal-message"),bytes:Be(),signature:Be()})]),AV=Np("type",[Ne({type:st("reject"),reason:fn(Be("`reason` must be a string"))}),Ne({type:st("resolve"),data:kV})]),OV=Ne({id:Kt(Be(),Ik()),source:st("web-wallet-channel"),payload:AV,version:st("1")});function NV(){return{version:"1",originUrl:window.location.href,userAgent:navigator.userAgent,screenResolution:`${window.screen.width}x${window.screen.height}`,language:navigator.language,platform:navigator.platform,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:Date.now()}}var xV=class{#e;#t="1";#r;#s;#a;#i;#o;#c;#n;#m;#h=null;#f=!1;constructor({appName:e,hostOrigin:t,hostPathname:s="dapp-request",extraRequestOptions:r,popupWindow:i}){const c=i??window.open("about:blank","_blank");if(!c)throw new Error("Failed to open new window");this.#r=crypto.randomUUID(),this.#e=c,this.#s=t,this.#a=s,this.#i=e;const{promise:u,resolve:d,reject:p}=H4();this.#c=u,this.#n=d,this.#m=p,this.#o=r,this.#h=setInterval(()=>{try{this.#e.closed&&(this.#l(),p(new Error("User closed the wallet window")))}catch{}},1e3)}send({type:e,...t}){if(this.#e.closed)throw new Error("User closed the wallet window");if(this.#f)throw new Error("send() can only be called once");this.#f=!0,window.addEventListener("message",this.#p);const s={version:this.#t,requestId:this.#r,appUrl:window.location.href.split("#")[0],appName:this.#i,payload:{type:e,...t},metadata:NV(),extraRequestOptions:this.#o},r=encodeURIComponent(btoa(JSON.stringify(s)));return this.#e.location.assign(`${this.#s}/${this.#a}#${r}`),this.#c}close(){this.#l(),this.#e.close()}#p=e=>{if(e.origin!==this.#s)return;const{success:t,output:s}=wR(OV,e.data);!t||s.id!==this.#r||(this.#l(),s.payload.type==="reject"?this.#m(new Error(s.payload.reason||"User rejected the request")):s.payload.type==="resolve"&&this.#n(s.payload.data))};#l(){this.#h&&(clearInterval(this.#h),this.#h=null),window.removeEventListener("message",this.#p)}};const CV="https://my.slush.app",op="slush:session",IV="Slush",RV="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgMjRDMCAxMC43NDUyIDEwLjc0NTIgMCAyNCAwQzM3LjI1NDggMCA0OCAxMC43NDUyIDQ4IDI0QzQ4IDM3LjI1NDggMzcuMjU0OCA0OCAyNCA0OEMxMC43NDUyIDQ4IDAgMzcuMjU0OCAwIDI0WiIgZmlsbD0iIzBDMEExRiIvPgo8cGF0aCBkPSJNMTMuMTM1OCAzMi4xMDg1QzE0LjE3MDEgMzUuOTY4MyAxOC4wMzMxIDM5LjQ2MjQgMjYuMDI1NSAzNy4zMjA4QzMzLjY1MTUgMzUuMjc3NCAzOC40MzA5IDI5LjAwNCAzNy4xOTE2IDI0LjM3ODlDMzYuNzYzNiAyMi43ODE3IDM1LjQ3NDYgMjEuNzAwNiAzMy40ODcyIDIxLjg3NjVMMTUuNzE2NSAyMy4zNTcyQzE0LjU5NzMgMjMuNDQzIDE0LjA4NDIgMjMuMjU5NiAxMy43ODgxIDIyLjU1NDNDMTMuNTAxIDIxLjg4MjMgMTMuNjY0NiAyMS4xNjA5IDE1LjAxNjMgMjAuNDc3N0wyOC41NDAxIDEzLjUzNzRDMjkuNTc2NyAxMy4wMSAzMC4yNjcxIDEyLjc4OTMgMzAuODk4IDEzLjAxMjZDMzEuMjkzNCAxMy4xNTYzIDMxLjU1MzggMTMuNzI4NCAzMS4zMTQ3IDE0LjQzNDRMMzAuNDM3OCAxNy4wMjMyQzI5LjM2MTcgMjAuMjAwMiAzMS42NjUzIDIwLjkzODIgMzIuOTY0MSAyMC41OTAyQzM0LjkyODkgMjAuMDYzNyAzNS4zOTExIDE4LjE5MjMgMzQuNzU4MSAxNS44Mjk5QzMzLjE1MzMgOS44NDA1NCAyNi43OTkgOC45MDQxMSAyMS4wMzc4IDEwLjQ0NzhDMTUuMTc2NyAxMi4wMTgzIDEwLjA5NiAxNi43Njc2IDExLjY0NzQgMjIuNTU3M0MxMi4wMTI5IDIzLjkyMTYgMTMuMjY4NyAyNS4wMTE2IDE0LjcyMzIgMjQuOTc4NUwxNi45NDM4IDI0Ljk3MzFDMTcuNDAwNCAyNC45NjI1IDE3LjIzNiAyNSAxOC4xMTcgMjQuOTI3MUMxOC45OTggMjQuODU0MSAyMS4zNTA5IDI0LjU2NDYgMjEuMzUwOSAyNC41NjQ2TDMyLjg5NjIgMjMuMjU4TDMzLjE5MzcgMjMuMjE0OEMzMy44Njg5IDIzLjA5OTcgMzQuMzc5MiAyMy4yNzUgMzQuODEwNiAyNC4wMTgzQzM1LjQ1NjMgMjUuMTMwNCAzNC40NzEyIDI1Ljk2OTEgMzMuMjkyIDI2Ljk3MzFDMzMuMjYwNSAyNyAzMy4yMjg4IDI3LjAyNyAzMy4xOTcgMjcuMDU0MUwyMy4wNDgyIDM1LjgwMDVDMjEuMzA4NyAzNy4zMDA4IDIwLjA4NjcgMzYuNzM2NyAxOS42NTg4IDM1LjEzOTVMMTguMTQzMSAyOS40ODI5QzE3Ljc2ODcgMjguMDg1NCAxNi40MDQxIDI2Ljk4ODkgMTQuODA1NiAyNy40MTcyQzEyLjgwNzUgMjcuOTUyNiAxMi42NDU1IDMwLjI3ODQgMTMuMTM1OCAzMi4xMDg1WiIgZmlsbD0iI0ZCRkFGRiIvPgo8L3N2Zz4K",gy="com.mystenlabs.suiwallet",jV="https://api.slush.app/api/wallet/metadata",MV={id:"com.mystenlabs.suiwallet.web",walletName:"Slush",description:"Trade and earn on Sui.",icon:RV,enabled:!0},DV=Ne({id:Be("Wallet ID is required"),walletName:Be("Wallet name is required"),icon:Be("Icon must be a valid wallet icon format"),enabled:fo("Enabled is required")});function UV(e){localStorage.setItem(op,e)}function gu(){const e=localStorage.getItem(op);if(!e)throw new Error("No session found");return e}const __=["sui:signTransaction","sui:signAndExecuteTransaction","sui:signPersonalMessage","sui:signTransactionBlock"];function k_(e){const{payload:t}=_V(e);return t.accounts.map(s=>new id({address:s.address,chains:Gu,features:s.features?__.filter(r=>s.features?.includes(r)):__,publicKey:Ge(s.publicKey)}))}var BV=class{#e;#t;#r;#s;#a;#i;#o;#c=null;get name(){return this.#a}get id(){return this.#e}get icon(){return this.#i}get version(){return"1.0.0"}get chains(){return Gu}get accounts(){return this.#r}get features(){return{"standard:connect":{version:"1.0.0",connect:this.#g},"standard:disconnect":{version:"1.0.0",disconnect:this.#y},"standard:events":{version:"1.0.0",on:this.#p},"sui:signTransactionBlock":{version:"1.0.0",signTransactionBlock:this.#n},"sui:signTransaction":{version:"2.0.0",signTransaction:this.#m},"sui:signPersonalMessage":{version:"1.1.0",signPersonalMessage:this.#f},"sui:signAndExecuteTransaction":{version:"2.0.0",signAndExecuteTransaction:this.#h}}}constructor({name:e,origin:t,metadata:s}){if(this.#e=s.id,this.#r=this.#d(),this.#t=Z4(),this.#s=t||CV,this.#o=e,this.#a=s.walletName,this.#i=s.icon,typeof window<"u"){const r=window,i=c=>{c.storageArea!==localStorage||c.key!==op&&c.key!==null||this.#l(this.#d())};r.addEventListener("storage",i),this.#c=()=>r.removeEventListener("storage",i)}}dispose(){this.#c?.(),this.#c=null}#n=async({transactionBlock:e,account:t,chain:s})=>{const r=await e.toJSON(),i=await this.#u().send({type:"sign-transaction",transaction:r,address:t.address,chain:s,session:gu()});return{transactionBlockBytes:i.bytes,signature:i.signature}};#m=async({transaction:e,account:t,chain:s})=>{const r=this.#u(),i=await e.toJSON(),c=await r.send({type:"sign-transaction",transaction:i,address:t.address,chain:s,session:gu()});return{bytes:c.bytes,signature:c.signature}};#h=async({transaction:e,account:t,chain:s})=>{const r=this.#u(),i=await e.toJSON(),c=await r.send({type:"sign-and-execute-transaction",transaction:i,address:t.address,chain:s,session:gu()});return{bytes:c.bytes,signature:c.signature,digest:c.digest,effects:c.effects}};#f=async({message:e,account:t,chain:s})=>{const r=await this.#u().send({type:"sign-personal-message",message:Ke(e),address:t.address,chain:s??nA,session:gu()});return{bytes:r.bytes,signature:r.signature}};#p=(e,t)=>(this.#t.on(e,t),()=>this.#t.off(e,t));#l(e){this.#r=e,this.#t.emit("change",{accounts:this.accounts})}#g=async e=>{if(e?.silent)return{accounts:this.accounts};const t=await this.#u().send({type:"connect"});return UV(t.session),this.#l(k_(t.session)),{accounts:this.accounts}};#d(){try{return k_(gu())}catch{return[]}}#y=async()=>{localStorage.removeItem(op),this.#l([])};#u(){return new xV({appName:this.#o,hostOrigin:this.#s})}updateMetadata(e){this.#e=e.id,this.#a=e.walletName,this.#i=e.icon}};async function LV(e){const t=await fetch(e);if(!t.ok)throw new Error("Failed to fetch wallet metadata");return Et(DV,await t.json())}function zV(e,{origin:t,metadataApiUrl:s=jV}={}){const r=Cp();if(r.get().some(m=>m.id===gy))return;const i=new BV({name:e,origin:t,metadata:MV}),c=r.register(i);let u=!1;const d=()=>{u||(u=!0,i.dispose(),p(),c())},p=r.on("register",m=>{m.id===gy&&d()});return r.get().some(m=>m.id===gy)&&d(),LV(s).then(m=>{if(!u){if(!m.enabled){console.log("Slush wallet is not currently enabled."),d();return}i.updateMetadata(m)}}).catch(m=>{console.error("Error fetching metadata",m)}),{wallet:i,unregister:d}}var $V=class extends Db{#e;#t;constructor(e,t=[]){super(),this.#e=e,this.#t=t;const s=new Set;let r=0;const i=e.getPublicKeys().map(({weight:c,publicKey:u})=>({weight:c,address:u.toSuiAddress()}));for(const c of t){const u=c.toSuiAddress();if(s.has(u))throw new Error("Can't create MultiSigSigner with duplicate signers");s.add(u);const d=i.find(p=>p.address===u)?.weight;if(!d)throw new Error(`Signer ${u} is not part of the MultiSig public key`);r+=d}if(r<e.getThreshold())throw new Error("Combined weight of signers is less than threshold")}getKeyScheme(){return"MultiSig"}getPublicKey(){return this.#e}sign(e){throw new Error("MultiSigSigner does not support signing directly. Use signTransaction or signPersonalMessage instead")}async signTransaction(e){return{signature:this.#e.combinePartialSignatures(await Promise.all(this.#t.map(async t=>(await t.signTransaction(e)).signature))),bytes:Ke(e)}}async signPersonalMessage(e){return{signature:this.#e.combinePartialSignatures(await Promise.all(this.#t.map(async t=>(await t.signPersonalMessage(e)).signature))),bytes:Ke(e)}}};const yu=10,A_=1;var F3=class H3 extends ol{constructor(t,s={}){if(super(),typeof t=="string"?(this.rawBytes=Ge(t),this.multisigPublicKey=M.MultiSigPublicKey.parse(this.rawBytes)):t instanceof Uint8Array?(this.rawBytes=t,this.multisigPublicKey=M.MultiSigPublicKey.parse(this.rawBytes)):(this.multisigPublicKey=t,this.rawBytes=M.MultiSigPublicKey.serialize(t).toBytes()),this.multisigPublicKey.threshold<1)throw new Error("Invalid threshold");const r=new Set;this.publicKeys=this.multisigPublicKey.pk_map.map(({pubKey:c,weight:u})=>{const[d,p]=Object.entries(c).filter(([g])=>g!=="$kind")[0],m=Uint8Array.from(p).toString();if(r.has(m))throw new Error("Multisig does not support duplicate public keys");if(r.add(m),u<1)throw new Error("Invalid weight");return{publicKey:Lb(d,Uint8Array.from(p),s),weight:u}});const i=this.publicKeys.reduce((c,{weight:u})=>c+u,0);if(this.multisigPublicKey.threshold>i)throw new Error("Unreachable threshold");if(this.publicKeys.length>yu)throw new Error(`Max number of signers in a multisig is ${yu}`);if(this.publicKeys.length<A_)throw new Error(`Min number of signers in a multisig is ${A_}`)}static fromPublicKeys({threshold:t,publicKeys:s}){return new H3({pk_map:s.map(({publicKey:r,weight:i})=>({pubKey:{[Bp[r.flag()]]:r.toRawBytes()},weight:i})),threshold:t})}equals(t){return super.equals(t)}toRawBytes(){return this.rawBytes}getPublicKeys(){return this.publicKeys}getThreshold(){return this.multisigPublicKey.threshold}getSigner(...t){return new $V(this,t)}toSuiAddress(){const t=1+65*yu+2,s=new Uint8Array(t);s.set([Ps.MultiSig]),s.set(M.u16().serialize(this.multisigPublicKey.threshold).toBytes(),1);let r=3;for(const{publicKey:i,weight:c}of this.publicKeys){const u=i.toSuiBytes();s.set(u,r),r+=u.length,s.set([c],r++)}return ye(il(po(s.slice(0,r),{dkLen:32})))}flag(){return Ps.MultiSig}async verify(t,s){const r=sp(s);if(r.signatureScheme!=="MultiSig")throw new Error("Invalid signature scheme");const{multisig:i}=r;let c=0;if(!mi(M.MultiSigPublicKey.serialize(this.multisigPublicKey).toBytes(),M.MultiSigPublicKey.serialize(i.multisig_pk).toBytes()))return!1;for(const{publicKey:u,weight:d,signature:p}of VV(i)){if(!await u.verify(t,p))return!1;c+=d}return c>=this.multisigPublicKey.threshold}combinePartialSignatures(t){if(t.length>yu)throw new Error(`Max number of signatures in a multisig is ${yu}`);let s=0;const r=new Array(t.length);for(let d=0;d<t.length;d++){const p=sp(t[d]);if(p.signatureScheme==="MultiSig")throw new Error("MultiSig is not supported inside MultiSig");let m;p.signatureScheme==="ZkLogin"?m=np(p.zkLogin?.addressSeed,p.zkLogin?.iss,{legacyAddress:!1}).toRawBytes():m=p.publicKey,r[d]={[p.signatureScheme]:p.signature};let g;for(let y=0;y<this.publicKeys.length;y++)if(mi(m,this.publicKeys[y].publicKey.toRawBytes())){if(s&1<<y)throw new Error("Received multiple signatures from the same public key");g=y;break}if(g===void 0)throw new Error("Received signature from unknown public key");s|=1<<g}const i={sigs:r,bitmap:s,multisig_pk:this.multisigPublicKey},c=M.MultiSig.serialize(i,{maxSize:8192}).toBytes(),u=new Uint8Array(c.length+1);return u.set([Ps.MultiSig]),u.set(c,1),Ke(u)}};function VV(e,t={}){const s=new Array(e.sigs.length);for(let r=0;r<e.sigs.length;r++){const[i,c]=Object.entries(e.sigs[r]).filter(([g])=>g!=="$kind")[0],u=PV(e.bitmap).at(r),d=e.multisig_pk.pk_map[u],p=Uint8Array.from(Object.values(d.pubKey)[0]);if(i==="MultiSig")throw new Error("MultiSig is not supported inside MultiSig");const m=Lb(i,p,t);s[r]={signatureScheme:i,signature:Uint8Array.from(c),publicKey:m,weight:d.weight}}return s}function PV(e){if(e<0||e>1024)throw new Error("Invalid bitmap");const t=[];for(let s=0;s<10;s++)(e&1<<s)!==0&&t.push(s);return Uint8Array.from(t)}async function GV(e,t,s={}){const r=HV(t,{client:s.client});return!r||!await r.publicKey.verifyPersonalMessage(e,r.serializedSignature)?!1:s.address?r.publicKey.verifyAddress(s.address):!0}async function FV(e,t,s={}){const{publicKey:r}=q3(t,s);if(!await GV(e,t,{client:s.client}))throw new Error("Signature is not valid for the provided message");if(s.address&&!r.verifyAddress(s.address))throw new Error("Signature is not valid for the provided address");return r}function q3(e,t={}){const s=sp(e);if(s.signatureScheme==="MultiSig")return{...s,publicKey:new F3(s.multisig.multisig_pk)};const r=Lb(s.signatureScheme,s.publicKey,t);return{...s,publicKey:r}}function HV(e,t={}){try{return q3(e,t)}catch{return null}}function Lb(e,t,s={}){let r;switch(e){case"ED25519":r=new O3(t);break;case"Secp256k1":r=new W$(t);break;case"Secp256r1":r=new Bb(t);break;case"MultiSig":r=new F3(t);break;case"ZkLogin":r=B3.fromBytes(t,s);break;case"Passkey":r=new k$(t);break;default:throw new Error(`Unsupported signature scheme ${e}`)}if(s.address&&r.toSuiAddress()!==s.address)throw new Error("Public key bytes do not match the provided address");return r}var ll=class extends Error{},zb=class extends ll{},qV=class extends ll{},Pp=class extends ll{},ZV=class extends ll{},$b=class extends ll{};function ul(e){return`sui:${e}`}function YV(e,t){if(e.length===0)throw new ll("You must specify at least one Sui network for your application.");const s=new Map;function r(i){if(s.has(i))return s.get(i);const c=t(i);return s.set(i,c),c}return{networkConfig:Object.freeze(s),getClient:r}}const WV=[ob,Rp],XV=[Fh,eA];function Vb(e){const t=Cr(e);return t.id??t.name}function Pb(e,t){if(!e.wallet||!e.account)throw new zb("No wallet is connected.");if(t&&!Zc(t,e.wallet))throw new $b(`No account with address ${t.address} is connected to ${e.wallet.name}.`);return t??e.account}function Z3({account:e,featureName:t,chain:s}){if(!e.chains.includes(s)){const r=new ad(bj,{chain:s,featureName:t,supportedChains:[...e.chains],supportedFeatures:[...e.features],address:e.address});throw new qV(`The account ${r.context.address} does not support the chain "${r.context.chain}".`,{cause:r})}try{return G3(e,t)}catch(r){throw new Pp(`The account ${e.address} does not support the feature "${t}".`,{cause:r})}}function cp(...e){try{return Z3(...e)}catch(t){if(t instanceof Pp)return null;throw t}}function KV({defaultNetwork:e,getClient:t}){const s=uV({status:"disconnected",currentAccount:null}),r=ap(e),i=ap([]),c=my([i,r],(u,d)=>u.filter(p=>{const m=p.chains.some(b=>ul(d)===b),g=WV.every(b=>p.features.includes(b)),y=XV.some(b=>p.features.includes(b));return m&&g&&y}));return{$currentNetwork:r,$registeredWallets:i,$compatibleWallets:c,$baseConnection:s,$currentClient:my(r,t),$connection:my([s,c],(u,d)=>{switch(u.status){case"connected":{const p=d.find(m=>Zc(u.currentAccount,m));return p?{wallet:p,account:u.currentAccount,status:u.status,supportedIntents:u.supportedIntents,isConnected:!0,isConnecting:!1,isReconnecting:!1,isDisconnected:!1}:{wallet:null,account:null,status:"disconnected",supportedIntents:[],isConnected:!1,isConnecting:!1,isReconnecting:!1,isDisconnected:!0}}case"connecting":return{wallet:null,account:u.currentAccount,status:u.status,supportedIntents:[],isConnected:!1,isConnecting:!0,isReconnecting:!1,isDisconnected:!1};case"reconnecting":{const{currentAccount:p}=u,m=p?d.find(g=>Zc(p,g))??null:null;return!p||!m?{wallet:null,account:null,status:u.status,supportedIntents:[],isConnected:!1,isConnecting:!1,isReconnecting:!0,isDisconnected:!1}:{wallet:m,account:p,status:u.status,supportedIntents:u.supportedIntents,isConnected:!1,isConnecting:!1,isReconnecting:!0,isDisconnected:!1}}case"disconnected":return{wallet:null,account:u.currentAccount,status:u.status,supportedIntents:[],isConnected:!1,isConnecting:!1,isReconnecting:!1,isDisconnected:!0};default:throw new Error(`Encountered unknown connection status: ${u}`)}})}}function JV({$registeredWallets:e}){$p(e,()=>{const t=Cp(),s=new Map,r=()=>{const d=t.get(),p=[];for(const m of d)try{p.push(fV(m))}catch{console.warn(`[dapp-kit] Skipping wallet "${m.name}" because it does not comply with the Wallet Standard.`)}e.set(p)},i=d=>{const p=d.features[Rp].on("change",()=>{r()});s.set(d,p)},c=t.on("register",(...d)=>{d.filter(yy).forEach(i),r()}),u=t.on("unregister",(...d)=>{d.filter(yy).forEach(p=>{const m=s.get(p);m&&(s.delete(p),m())}),r()});return t.get().filter(yy).forEach(i),r(),()=>{c(),u(),s.forEach(d=>d()),s.clear()}})}function yy(e){return Rp in e.features}const QV="mysten-dapp-kit:selected-wallet-and-address";function eP(){return tP()?localStorage:Y3()}function Y3(){const e=new Map;return{getItem(t){return e.get(t)??null},setItem(t,s){e.set(t,s)},removeItem(t){e.delete(t)}}}function W3(e,t,s,r){const i=Vb(s).replace(":","_"),c=r.join(","),u=[i,s.address,c].join(":");e.setItem(t,u)}function tP(){try{const e="__storage_test__";return localStorage.setItem(e,"test"),localStorage.removeItem(e),!0}catch{return!1}}function nP({$baseConnection:e},t,{storage:s,storageKey:r}){return async function({wallet:c,account:u,...d}){return await rp(async()=>{const p=e.get().status==="connected";try{e.setKey("status",p?"reconnecting":"connecting");const{accounts:m,supportedIntents:g}=await X3(c,t,d);if(!p&&m.length===0)throw new ZV("No accounts were authorized.");if(u&&!Zc(u,c))throw new $b(`No account with address ${u.address} is authorized for ${c.name}.`);const y=u??m[0],b=g??[];return e.set({status:"connected",currentAccount:y,supportedIntents:b}),W3(s,r,y,b),{accounts:m}}catch(m){throw e.setKey("status",p?"connected":"disconnected"),m}})}}async function X3(e,t,s){const{connect:r}=dd(e,ob),i=await r(s),c=Cr(e),u=t.map(ul),d=i.supportedIntents??await K3(e);return{accounts:i.accounts.filter(p=>p.chains.some(m=>u.includes(m))).map(gv.bind(null,c)),supportedIntents:d}}async function K3(e){return e.features.includes("sui:getCapabilities")?(await dd(e,"sui:getCapabilities")?.getCapabilities())?.supportedIntents??[]:[]}function sP({networks:e,stores:{$baseConnection:t,$compatibleWallets:s},storage:r,storageKey:i,walletsRegistered:c,timeout:u}){$p(s,()=>{let d=!1,p;const m=()=>{d=!0,p?.()},g=y=>rp(async()=>{if(d)return;const{status:b}=t.get();if(b!=="disconnected"&&b!=="reconnecting"){m();return}const E=await rP({networks:e,storage:r,storageKey:i,wallets:y});d||E&&(t.set({status:"connected",currentAccount:E.account,supportedIntents:E.supportedIntents}),m())});return p=s.subscribe((y,b)=>{y&&(b&&b.length>y.length||g(y))}),rp(async()=>{const y=!!await r.getItem(i);if(d)return;if(!y){m();return}t.get().status==="disconnected"&&t.set({status:"reconnecting",currentAccount:null,supportedIntents:[]});const b=new Promise(E=>setTimeout(E,u));await Promise.all([c.catch(()=>{}),b]),!d&&(await g(s.get()??[]),!d&&t.get().status==="reconnecting"&&t.set({status:"disconnected",currentAccount:null}))}),m})}async function rP({networks:e,storage:t,storageKey:s,wallets:r}){const i=await t.getItem(s);if(!i)return null;const[c,u,d]=i.split(":");if(!c||!u)return null;const p=r.find(E=>Vb(E)===c);if(!p)return null;const m=p.accounts.find(E=>E.address===u);if(m)return{account:m,supportedIntents:(d?d.split(","):null)??await K3(p)};const{accounts:g,supportedIntents:y}=await X3(p,e,{silent:!0}),b=g.find(E=>E.address===u);return b?{account:b,supportedIntents:y}:null}function aP({$compatibleWallets:e,$baseConnection:t}){$p(e,()=>e.listen(async s=>{const r=t.get();if(r.status!=="connected")return;const i=iP(r.currentAccount,s);i?t.setKey("currentAccount",i):t.set({status:"disconnected",currentAccount:null})}))}function iP(e,t){for(const s of t){for(const r of s.accounts)if(hV(e,r))return r;if(Zc(e,s)&&s.accounts[0])return s.accounts[0]}return null}function oP({$currentNetwork:e}){return function(s){e.set(s)}}function cP({$baseConnection:e,$connection:t},{storage:s,storageKey:r}){return async function(...c){return await rp(async()=>{const{wallet:u}=t.get();if(!u)throw new zb("No wallet is connected.");try{const{disconnect:d}=dd(u,Aj);await d(...c)}catch(d){console.warn("Failed to disconnect the current wallet from the application.",d)}finally{s.removeItem(r),e.set({status:"disconnected",currentAccount:null})}})}}function lP({$baseConnection:e,$connection:t},{storage:s,storageKey:r}){return function({account:c}){const u=t.get();if(!u.wallet)throw new zb("No wallet is connected.");if(!Zc(c,u.wallet))throw new $b(`No account with address ${c.address} is connected to ${u.wallet.name}.`);e.setKey("currentAccount",c),W3(s,r,c,u.supportedIntents)}}function uP({$connection:e,$currentNetwork:t}){return async function({account:r,network:i,...c}){const u=Pb(e.get(),r),d=ul(i??t.get());return await Z3({account:u,chain:d,featureName:Ky}).signPersonalMessage({...c,account:Vp(u),chain:d})}}function O_(e,t,s,r){const i=U8(r);let c=null;try{c=B8(r)}catch{console.warn("Parsing transaction effects failed, you may need to update the SDK to pickup the latest bcs types")}const u={digest:e,signatures:[t],epoch:null,timestampMs:null,checkpoint:null,status:i,effects:c,transaction:M8(s),balanceChanges:void 0,events:void 0,objectTypes:void 0,bcs:s};return i.success?{$kind:"Transaction",Transaction:u}:{$kind:"FailedTransaction",FailedTransaction:u}}function dP({$connection:e,$currentNetwork:t},s){return async function({transaction:i,account:c,network:u,...d}){const p=e.get(),m=Pb(p,c),g=[...p.supportedIntents],y=Vp(m),b=u??t.get(),E=s(b),O=ul(b),C={toJSON:async()=>typeof i=="string"?i:(i.setSenderIfNotSet(m.address),await i.toJSON({client:E,supportedIntents:g}))},R=cp({account:m,chain:O,featureName:Xy});if(R){const x=await R.signAndExecuteTransaction({...d,account:y,transaction:C,chain:O}),W=Ge(x.bytes),oe=Ge(x.effects);return O_(x.digest,x.signature,W,oe)}const $=cp({account:m,chain:O,featureName:cj});if($){const x=Yn.from(await C.toJSON()),{digest:W,rawEffects:oe,rawTransaction:me}=await $.signAndExecuteTransactionBlock({account:y,chain:O,transactionBlock:x,options:{showRawEffects:!0,showRawInput:!0}}),[{txSignatures:[G],intentMessage:{value:J}}]=M.SenderSignedData.parse(Ge(me));return O_(W,G,M.TransactionData.serialize(J).toBytes(),new Uint8Array(oe))}throw new Pp(`The account ${m.address} does not support signing and executing transactions.`)}}function fP({$connection:e,$currentNetwork:t},s){return async function({transaction:i,account:c,network:u,...d}){const p=e.get(),m=Pb(p,c),g=[...p.supportedIntents],y=Vp(m),b=u??t.get(),E=s(b),O=ul(b),C={toJSON:async()=>typeof i=="string"?i:(i.setSenderIfNotSet(m.address),await i.toJSON({client:E,supportedIntents:g}))},R=cp({account:m,chain:O,featureName:Fh});if(R)return await R.signTransaction({...d,transaction:C,account:y,chain:O});const $=cp({account:m,chain:O,featureName:eA});if($){const x=Yn.from(await C.toJSON()),{transactionBlockBytes:W,signature:oe}=await $.signTransactionBlock({transactionBlock:x,account:y,chain:O});return{bytes:W,signature:oe}}throw new Pp(`The account ${m.address} does not support signing transactions.`)}}function hP(e){return{id:"slush-web-wallet-initializer",async initialize(){const t=await zV(e?.appName||pP(),{origin:e?.origin,metadataApiUrl:e?.metadataApiUrl});if(!t)throw new Error("Registration un-successful.");return{unregister:t.unregister}}}}function pP(){return document.querySelector('meta[name="application-name"]')?.content||document.title}const vy=new Map;async function mP(e,t){vy.forEach(i=>i()),vy.clear();const s=[...new Map(e.map(i=>[i.id,i])).values()].map(async i=>({initializer:i,result:await i.initialize(t)})),r=await Promise.allSettled(s);for(const i of r)if(i.status==="fulfilled"){const{initializer:c,result:u}=i.value;vy.set(c.id,u.unregister)}else console.warn(`Skipping wallet initializer: "${i.reason}".`)}function gP(){return{id:"unsafe-burner-initalizer",async initialize({networks:e,getClient:t}){const s=new yP({clients:e.map(t)});return{unregister:Cp().register(s)}}}}var yP=class{#e;#t=new F$;#r;constructor({clients:e}){this.#e=e.reduce((t,s)=>{const r=ul(s.network);return t[r]=s,t},{}),this.#r=new id({address:this.#t.getPublicKey().toSuiAddress(),publicKey:this.#t.getPublicKey().toSuiBytes(),chains:this.chains,features:[Fh,Xy,Ky]}),console.warn("Your application is currently using the unsafe burner wallet. Make sure that this wallet is disabled in production.")}get version(){return"1.0.0"}get name(){return"Unsafe Burner Wallet"}get icon(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAJrElEQVR42tWbe2xT1x3H7UxAyD3XrdrSbGXlUbKWsq5rWdVuVOMRSEqSOmnVRZMmJqZNYv1nf3R/jWmVmVrtRRM/YwPd1nVTNcrE3pQCoikrIRAC4VVNY0hlD9ZOo1uCfe3ra9979v0dcy3s5Pper76Oh/STE+495/4+5/c85zqe2f7HAx5vKsS+monJj/CdHi/f4/HWW4f6AwdblmXjTM0NyS+movKtw9v+j6C5gKhyTMTTpA2x15Qwy+Pz75motOGdgKep8WF5ATgVZIt5NeO2wMqD0hfVGNPh3oYaYflsjG0l63PeyLCDnqbsLpZIhaRNFI+Ox+Le5KB0RybK8gDmJOkI07U4i/FhT1NDQl8Me5rUIfaDfELOJ0NsFa/SJQHm1WLsHcDqRWiy9BCL8s0N5t6UWWFVvxplejYm60hC91cNjPtzCTZsAptCVoeLP8PDDQJNCSodap6H+LtE8ZcdkvVkkD38vwDn4/Jvy4EhBhZSvRaUHiTXn31gJJxkUPoClBKKFizM+inhVA2cYIdM4HJouPvoe9s9H+KzDhyGK6KkmIqitBhww2C11rjQL2L4kgUwFxk8yPyzauUA3Pk/353XnA6zKbKCaQ2UlMvJF6W5uF5F8yHfZWZpC9HRmBziaEpm1bpY9XvhxuWJRldC7Mt03WlZwpjnkZUNa2DMG2EaPj9MGd2l2mofd0hQ7ZSopsXckHxVCUp32fXGdD0ZktrgFUmMqwhcWFjp87RArsD+9bn585IRaSHAKgBL3SZwOTRc8BKg7yYoskp5OJDiiPmF2Sj7ox0siYJ7lJA04EqvzZ9B1xSVt6PlW0IxZgUMJdZYAJuWngLQt9IRuZXmoTEkmci8ZtTXTViUKyasA9FRun5d8z6bfw0gYWm9mmCXxZatQgxfC7I2NVpRYQOxKWppLs4mcgn5NcibgL1K40xYp8CYY5TXEpjcb3LAJ0OZyyg3+2nySm6fjEtzkEz+7VBx3RTb+60z9dma7pkvwO2QQL5HzTtAdpKF7euw/HuzfrosBHy+ZsBimzbQshjWTVMDgez53B5MbjcGbr1ZjdUJOM5O0SLXzJ2R+uOA1dMAVoLsm5zb73JSId8t8Aa1LsAJdoTCrCaw6e3NC2DdFMUXWRg173mysJNOSUNskUJ1cOlXa2LhcbgmSszXYSn9hl3KSxTDjrZ2cbbfbWDyumsh9m3e7zCG7a3ETt+gtI7fx6lEOanZKDVvuA2cjYmt5xNOd2Louz3IQ12UZ2Zo3lkb9cDlvSs6m4Vk5Yqlabs0B97wT7PUuCXQz0Bnt9QxMPTW4iwBtmUlY8hFsHJPlzcQ1xuG75CVK1kXofCUGnU9fg1aVD7kfE9MoabtYkcAvIUYS2op3Hc3TTrDQzIAeojugTVLFolWDR6wFPtY0R66n6HltwjCIawnE2ymresk9NtN+pfUUi0mX6RJLfrh9zMRaRPOqubSA8W2MNzC0mHpK7j2ruuw5mYkxl5+2+HGQeg4yNYg7vNg+xMxFsuRMuiTsRJZG3cysAl4D9n4aC4un8L9qUyVvbCyYwFXX1nGUxFf1cCiEQqy75O+TpMwYKNKSPQUqhLyyWLsRbESLctx0YnixgfphRWA8pOPc+N4F9d+eV9V4OlCX/As5w5g+wtGhJGukp5go2R3D7EW9rSDcnGL56YgJHj+8GcFND/Vy41jj/H0jxc6HU/AA2QlR01UlH3D7CmITQnJq4lVWBi1yl8XYEh278c5H++F+Iui7r7bYR8tH/gbqoJN7fVODUhLYVVxzmYCEyOxFg7RUVa0egCHZZ55eRHnp/tKgMna6s/bbMdTxZgMzl9CCcmq7k690OzDfaeSN4QcsREjsQpgXHwyWyfg9K5WE7hc6JqTWjyihObfygOFOkv6i5K5TZx8LsL1sVS4NL8ItiB7sgAcEKcWHfUCVhK3kUVnBNbfXIs4l5xAv5sJs234eTUy93L0Au2otQOw5ORMyfQ6WwexFupVSHowG6uThXfebmlhWojMS3fazmMeGxEI6S2SUti6RAo2vKohVuH3qUG5FWm/PjH8kzutgSH5g58xrVwzIbZkxHf7OFjFC+wrMDXcpOqOKX/g01U/XPvVJyxdWsiJblqYmnZoWbDxAcR56X5WPuh4ewcL5PY9JBRUYjc7fzjG6Uc3mHBWbg23X1BLaFHOSnrw4bWiNAXSEWcWRntIignXTP/oDsfKZX66mMbZAPfhviU1AyYmJLYAMZa/QXjUSeIiixpj3UUFtd884KytjN7EjdGNNMbWwtlf3FvbQ4OQtIoYSzbxqVDLXMTxP8jnnbiyKcaJLvueGLD6kXW2sKZov1tpn7hwXf3ZUvq0K2FXOM7Op/Xgb6PhxsWIErYGVuK3WGXWkkwMMZVCVl5kWtax5A6usgemvnx4DelUcYcFC0eIbcbXKzggeyBjeXIhkftaKknJKLtnuSg7KmKQsrH+1nqbmLWY6w/tBGy/8xrruR5SM99LLIjfT/4ZbNZnQEPssIVb21rKTGRIPDagNoLdFMKgcuLc/TF6Bulk6c7ovg4TU+XvS6FNw1tDfVqH9MOPmBDui0hcK6wz744FlDjNe0m3aVldJYagtI6YbF+3ZGPsQHlN1vbeh8lJofqJ+uo9Zi4wXZxKFiXKGxbHT7pNq71oNg4Qi6MviE0FpRVqjGXILYoJ4tCjdYU1rWeMdPLc/ochj3B9pGNGL4NupGPRlUl35KMVxFLNO6ZnxYlBsUPqoMkbUqAb6VhMVKQ7MVT1dYdrL8hzEAcjpmvjHKphgaFb0ZVJZw7dwVD9q5fkgPTRbBxnzmGfgRLQsMCkG+moQdcp6GzzZsL2MGyllvBNGWM9RqMCk26kI7aBK526csVShZTfzid6FEzeiNAGP92jpCPQEbrW7EW5MbZxAz/fN9lg0IbQaaxrQ83/VoKPb/HqJx67Hw+43CDQBPsX0gm6ufXNvH4vP9rZapzx7+Nn+oxZAjfo2caZ3n350c5W6FSEdQ86sNarj3c/jRV+H42AXsdGRBfPPIlnb/mUtxzWXfALn/PmRze2Gud6E/xsXwYtnlsWN8Tc5/oyxjn/jvyJrlY82xLUfWuPr/TqxzuXQZkIP9M7CXiyuP4B4WmsTnNhzinjrD+WO9bRhmdZWLXe4EKRtV5tpN3Hx3s2G+d79/MJf4qff0LnE72kfFEs4ITQvWLMab8C131dP9n9Je1Yx000Nz2jAf+UJwCBchc3NvGR1Qx71XXY2Ww1Jvx7YalzAPkX9rp5E5Z+pv+ja8bE43uN491b9dHO9Xx4lUxziLn21Nai/wXWM6t9vkvtrwAAAABJRU5ErkJggg=="}get chains(){return Object.keys(this.#e)}get accounts(){return[this.#r]}get features(){return{[ob]:{version:"1.0.0",connect:this.#a},[Rp]:{version:"1.0.0",on:this.#s},[Ky]:{version:"1.1.0",signPersonalMessage:this.#i},[Fh]:{version:"2.0.0",signTransaction:this.#o},[Xy]:{version:"2.0.0",signAndExecuteTransaction:this.#c}}}#s=()=>()=>{};#a=async()=>({accounts:this.accounts});#i=async e=>await this.#t.signPersonalMessage(e.message);#o=async({transaction:e,signal:t,chain:s})=>{t?.throwIfAborted();const r=this.#e[s];if(!r)throw new Error(`Invalid chain "${s}" specified.`);const i=await Yn.from(await e.toJSON()).build({client:r});return await this.#t.signTransaction(i)};#c=async({transaction:e,signal:t,chain:s})=>{t?.throwIfAborted();const r=this.#e[s];if(!r)throw new Error(`Invalid chain "${s}" specified.`);const i=Yn.from(await e.toJSON()),c=await i.build({client:r}),u=await this.#t.signAndExecuteTransaction({transaction:i,client:r}),d=u.Transaction??u.FailedTransaction;return{bytes:Ke(c),signature:d.signatures[0],digest:d.digest,effects:Ke(d.effects.bcs)}}};function vP({autoConnect:e=!0,networks:t,createClient:s,defaultNetwork:r=t[0],enableBurnerWallet:i=!1,slushWalletConfig:c,storage:u=eP(),storageKey:d=QV,walletInitializers:p=[],autoConnectTimeout:m=5e3}){const g=YV(t,s),y=KV({defaultNetwork:r,getClient:g.getClient});function b(O){return O?g.getClient(O):y.$currentClient.get()}u||=Y3(),JV(y),aP(y);const E=mP([...p,...i?[gP()]:[],...c!==null?[hP(c)]:[]],{networks:t,getClient:b});return e&&sP({networks:t,stores:y,storageKey:d,storage:u,walletsRegistered:E,timeout:m}),{networks:t,getClient:b,signTransaction:fP(y,g.getClient),signAndExecuteTransaction:dP(y,g.getClient),signPersonalMessage:uP(y),connectWallet:nP(y,t,{storage:u,storageKey:d}),disconnectWallet:cP(y,{storage:u,storageKey:d}),switchAccount:lP(y,{storage:u,storageKey:d}),switchNetwork:oP(y),stores:{$wallets:y.$compatibleWallets,$connection:y.$connection,$currentNetwork:sV(y.$currentNetwork),$currentClient:y.$currentClient}}}var by={exports:{}},Fe={};var N_;function bP(){if(N_)return Fe;N_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),E=Symbol.iterator;function O(I){return I===null||typeof I!="object"?null:(I=E&&I[E]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,$={};function x(I,X,ce){this.props=I,this.context=X,this.refs=$,this.updater=ce||C}x.prototype.isReactComponent={},x.prototype.setState=function(I,X){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,X,"setState")},x.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function W(){}W.prototype=x.prototype;function oe(I,X,ce){this.props=I,this.context=X,this.refs=$,this.updater=ce||C}var me=oe.prototype=new W;me.constructor=oe,R(me,x.prototype),me.isPureReactComponent=!0;var G=Array.isArray;function J(){}var w={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function N(I,X,ce){var he=ce.ref;return{$$typeof:e,type:I,key:X,ref:he!==void 0?he:null,props:ce}}function F(I,X){return N(I.type,X,I.props)}function B(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function q(I){var X={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(ce){return X[ce]})}var z=/\/+/g;function D(I,X){return typeof I=="object"&&I!==null&&I.key!=null?q(""+I.key):X.toString(36)}function k(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(J,J):(I.status="pending",I.then(function(X){I.status==="pending"&&(I.status="fulfilled",I.value=X)},function(X){I.status==="pending"&&(I.status="rejected",I.reason=X)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function j(I,X,ce,he,Te){var Oe=typeof I;(Oe==="undefined"||Oe==="boolean")&&(I=null);var Ae=!1;if(I===null)Ae=!0;else switch(Oe){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(I.$$typeof){case e:case t:Ae=!0;break;case g:return Ae=I._init,j(Ae(I._payload),X,ce,he,Te)}}if(Ae)return Te=Te(I),Ae=he===""?"."+D(I,0):he,G(Te)?(ce="",Ae!=null&&(ce=Ae.replace(z,"$&/")+"/"),j(Te,X,ce,"",function(Pe){return Pe})):Te!=null&&(B(Te)&&(Te=F(Te,ce+(Te.key==null||I&&I.key===Te.key?"":(""+Te.key).replace(z,"$&/")+"/")+Ae)),X.push(Te)),1;Ae=0;var be=he===""?".":he+":";if(G(I))for(var _e=0;_e<I.length;_e++)he=I[_e],Oe=be+D(he,_e),Ae+=j(he,X,ce,Oe,Te);else if(_e=O(I),typeof _e=="function")for(I=_e.call(I),_e=0;!(he=I.next()).done;)he=he.value,Oe=be+D(he,_e++),Ae+=j(he,X,ce,Oe,Te);else if(Oe==="object"){if(typeof I.then=="function")return j(k(I),X,ce,he,Te);throw X=String(I),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function U(I,X,ce){if(I==null)return I;var he=[],Te=0;return j(I,he,"","",function(Oe){return X.call(ce,Oe,Te++)}),he}function V(I){if(I._status===-1){var X=I._result,ce=X();ce.then(function(he){(I._status===0||I._status===-1)&&(I._status=1,I._result=he,ce.status===void 0&&(ce.status="fulfilled",ce.value=he))},function(he){(I._status===0||I._status===-1)&&(I._status=2,I._result=he,ce.status===void 0&&(ce.status="rejected",ce.reason=he))}),I._status===-1&&(I._status=0,I._result=ce)}if(I._status===1)return I._result.default;throw I._result}var K=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function P(I){var X=w.T,ce={};ce.types=X!==null?X.types:null,w.T=ce;try{var he=I(),Te=w.S;Te!==null&&Te(ce,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(J,K)}catch(Oe){K(Oe)}finally{X!==null&&ce.types!==null&&(X.types=ce.types),w.T=X}}function re(I){var X=w.T;if(X!==null){var ce=X.types;ce===null?X.types=[I]:ce.indexOf(I)===-1&&ce.push(I)}else P(re.bind(null,I))}var ue={map:U,forEach:function(I,X,ce){U(I,function(){X.apply(this,arguments)},ce)},count:function(I){var X=0;return U(I,function(){X++}),X},toArray:function(I){return U(I,function(X){return X})||[]},only:function(I){if(!B(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Fe.Activity=y,Fe.Children=ue,Fe.Component=x,Fe.Fragment=s,Fe.Profiler=i,Fe.PureComponent=oe,Fe.StrictMode=r,Fe.Suspense=p,Fe.ViewTransition=b,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(I){return w.H.useMemoCache(I)}},Fe.addTransitionType=re,Fe.cache=function(I){return function(){return I.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(I,X,ce){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var he=R({},I.props),Te=I.key;if(X!=null)for(Oe in X.key!==void 0&&(Te=""+X.key),X)!A.call(X,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&X.ref===void 0||(he[Oe]=X[Oe]);var Oe=arguments.length-2;if(Oe===1)he.children=ce;else if(1<Oe){for(var Ae=Array(Oe),be=0;be<Oe;be++)Ae[be]=arguments[be+2];he.children=Ae}return N(I.type,Te,he)},Fe.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:c,_context:I},I},Fe.createElement=function(I,X,ce){var he,Te={},Oe=null;if(X!=null)for(he in X.key!==void 0&&(Oe=""+X.key),X)A.call(X,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(Te[he]=X[he]);var Ae=arguments.length-2;if(Ae===1)Te.children=ce;else if(1<Ae){for(var be=Array(Ae),_e=0;_e<Ae;_e++)be[_e]=arguments[_e+2];Te.children=be}if(I&&I.defaultProps)for(he in Ae=I.defaultProps,Ae)Te[he]===void 0&&(Te[he]=Ae[he]);return N(I,Oe,Te)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(I){return{$$typeof:d,render:I}},Fe.isValidElement=B,Fe.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:V}},Fe.memo=function(I,X){return{$$typeof:m,type:I,compare:X===void 0?null:X}},Fe.startTransition=P,Fe.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},Fe.use=function(I){return w.H.use(I)},Fe.useActionState=function(I,X,ce){return w.H.useActionState(I,X,ce)},Fe.useCallback=function(I,X){return w.H.useCallback(I,X)},Fe.useContext=function(I){return w.H.useContext(I)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(I,X){return w.H.useDeferredValue(I,X)},Fe.useEffect=function(I,X){return w.H.useEffect(I,X)},Fe.useEffectEvent=function(I){return w.H.useEffectEvent(I)},Fe.useId=function(){return w.H.useId()},Fe.useImperativeHandle=function(I,X,ce){return w.H.useImperativeHandle(I,X,ce)},Fe.useInsertionEffect=function(I,X){return w.H.useInsertionEffect(I,X)},Fe.useLayoutEffect=function(I,X){return w.H.useLayoutEffect(I,X)},Fe.useMemo=function(I,X){return w.H.useMemo(I,X)},Fe.useOptimistic=function(I,X){return w.H.useOptimistic(I,X)},Fe.useReducer=function(I,X,ce){return w.H.useReducer(I,X,ce)},Fe.useRef=function(I){return w.H.useRef(I)},Fe.useState=function(I){return w.H.useState(I)},Fe.useSyncExternalStore=function(I,X,ce){return w.H.useSyncExternalStore(I,X,ce)},Fe.useTransition=function(){return w.H.useTransition()},Fe.version="19.3.0",Fe}var x_;function Gb(){return x_||(x_=1,by.exports=bP()),by.exports}var ze=Gb();const Fb=g6(ze),J3=m6({__proto__:null,default:Fb},[ze]),Q3=ze.createContext(null);function wP({dAppKit:e,children:t}){return T.jsx(Q3.Provider,{value:e,children:t})}function bi(e){const t=ze.useContext(Q3);if(e)return e;if(!t)throw new Error("Could not find DAppKitContext. Ensure that you have set up the `DAppKitProvider` component.");return t}let wy=(e,t)=>s=>{e.current!==s&&(e.current=s,t())};function eO(e,{keys:t,deps:s=[e,t],ssr:r}={}){let i=ze.useRef();i.current=e.get();let c=ze.useCallback(p=>(wy(i,p)(e.value),t?.length>0?lV(e,t,wy(i,p)):e.listen(wy(i,p))),s),u=()=>i.current,d=u;return r&&"init"in e&&(d=r==="initial"?()=>e.init:r),ze.useSyncExternalStore(c,u,d)}function TP({dAppKit:e}={}){return eO(bi(e).stores.$wallets)}function SP({dAppKit:e}={}){return eO(bi(e).stores.$connection)}function Eo({dAppKit:e}={}){return SP({dAppKit:e}).account}const EP=new Set(["children","localName","ref","style","className"]),C_=new WeakMap,I_=(e,t,s,r,i)=>{const c=i?.[t];c===void 0?(e[t]=s,s==null&&t in HTMLElement.prototype&&e.removeAttribute(t)):s!==r&&((u,d,p)=>{let m=C_.get(u);m===void 0&&C_.set(u,m=new Map);let g=m.get(d);p!==void 0?g===void 0?(m.set(d,g={handleEvent:p}),u.addEventListener(d,g)):g.handleEvent=p:g!==void 0&&(m.delete(d),u.removeEventListener(d,g))})(e,c,s)},tO=({react:e,tagName:t,elementClass:s,events:r,displayName:i})=>{const c=new Set(Object.keys(r??{})),u=e.forwardRef(((d,p)=>{const m=e.useRef(new Map),g=e.useRef(null),y={},b={};for(const[E,O]of Object.entries(d))EP.has(E)?y[E==="className"?"class":E]=O:c.has(E)||E in s.prototype?b[E]=O:y[E]=O;return e.useLayoutEffect((()=>{if(g.current===null)return;const E=new Map;for(const O in b)I_(g.current,O,d[O],m.current.get(O),r),m.current.delete(O),E.set(O,d[O]);for(const[O,C]of m.current)I_(g.current,O,void 0,C,r);m.current=E})),e.useLayoutEffect((()=>{g.current?.removeAttribute("defer-hydration")}),[]),y.suppressHydrationWarning=!0,e.createElement(t,{...y,ref:e.useCallback((E=>{g.current=E,typeof p=="function"?p(E):p!==null&&(p.current=E)}),[p])})}));return u.displayName=i??s.name,u};var R_={},j_;function _P(){return j_||(j_=1,(function(){function e(H){var te=0;return function(){return te<H.length?{done:!1,value:H[te++]}:{done:!0}}}var t=typeof Object.defineProperties=="function"?Object.defineProperty:function(H,te,de){return H==Array.prototype||H==Object.prototype||(H[te]=de.value),H};function s(H){H=[typeof globalThis=="object"&&globalThis,H,typeof window=="object"&&window,typeof self=="object"&&self,typeof Ac=="object"&&Ac];for(var te=0;te<H.length;++te){var de=H[te];if(de&&de.Math==Math)return de}throw Error("Cannot find global object")}var r=s(this);function i(H,te){if(te)e:{var de=r;H=H.split(".");for(var fe=0;fe<H.length-1;fe++){var le=H[fe];if(!(le in de))break e;de=de[le]}H=H[H.length-1],fe=de[H],te=te(fe),te!=fe&&te!=null&&t(de,H,{configurable:!0,writable:!0,value:te})}}i("Symbol",function(H){function te(le){if(this instanceof te)throw new TypeError("Symbol is not a constructor");return new de("jscomp_symbol_"+(le||"")+"_"+fe++,le)}function de(le,$e){this.l=le,t(this,"description",{configurable:!0,writable:!0,value:$e})}if(H)return H;de.prototype.toString=function(){return this.l};var fe=0;return te}),i("Symbol.iterator",function(H){if(H)return H;H=Symbol("Symbol.iterator");for(var te="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),de=0;de<te.length;de++){var fe=r[te[de]];typeof fe=="function"&&typeof fe.prototype[H]!="function"&&t(fe.prototype,H,{configurable:!0,writable:!0,value:function(){return c(e(this))}})}return H});function c(H){return H={next:H},H[Symbol.iterator]=function(){return this},H}function u(H){var te=typeof Symbol<"u"&&Symbol.iterator&&H[Symbol.iterator];return te?te.call(H):{next:e(H)}}function d(H){if(!(H instanceof Array)){H=u(H);for(var te,de=[];!(te=H.next()).done;)de.push(te.value);H=de}return H}var p=typeof Object.create=="function"?Object.create:function(H){function te(){}return te.prototype=H,new te},m=(function(){function H(){function de(){}return Reflect.construct(de,[],function(){}),new de instanceof de}if(typeof Reflect<"u"&&Reflect.construct){if(H())return Reflect.construct;var te=Reflect.construct;return function(de,fe,le){return de=te(de,fe),le&&Reflect.setPrototypeOf(de,le.prototype),de}}return function(de,fe,le){return le===void 0&&(le=de),le=p(le.prototype||Object.prototype),Function.prototype.apply.call(de,le,fe)||le}})(),g;if(typeof Object.setPrototypeOf=="function")g=Object.setPrototypeOf;else{var y;e:{var b={a:!0},E={};try{E.__proto__=b,y=E.a;break e}catch{}y=!1}g=y?function(H,te){if(H.__proto__=te,H.__proto__!==te)throw new TypeError(H+" is not extensible");return H}:null}var O=g,C=window,R;if(((R=C.CustomElementRegistryPolyfill)==null?void 0:R.formAssociated)===void 0){var $={};C.CustomElementRegistryPolyfill=($.formAssociated=new Set,$)}var x=window.HTMLElement,W=window.customElements.define,oe=window.customElements.get,me=window.customElements,G=new WeakMap,J=new WeakMap,w=new WeakMap,A=new WeakMap;function N(){var H;this.promise=new Promise(function(te){H=te}),this.resolve=H}function F(){this.h=new Map,this.m=new Map,this.j=new Map,this.i=new Map}F.prototype.define=function(H,te){if(H=H.toLowerCase(),this.h.get(H)!==void 0)throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "`+H+'" has already been used with this registry');if(this.m.get(te)!==void 0)throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");var de=te.prototype.attributeChangedCallback,fe=new Set(te.observedAttributes||[]);D(te,fe,de);var le=oe.call(me,H),$e,Le,Dt=(Le=($e=le)==null?void 0:$e.s)!=null?Le:te.formAssociated||C.CustomElementRegistryPolyfill.formAssociated.has(H);if(Dt&&C.CustomElementRegistryPolyfill.formAssociated.add(H),Dt!=te.formAssociated)try{te.formAssociated=Dt}catch{}if(de={tagName:H,g:te,connectedCallback:te.prototype.connectedCallback,disconnectedCallback:te.prototype.disconnectedCallback,adoptedCallback:te.prototype.adoptedCallback,attributeChangedCallback:de,formAssociated:Dt,formAssociatedCallback:te.prototype.formAssociatedCallback,formDisabledCallback:te.prototype.formDisabledCallback,formResetCallback:te.prototype.formResetCallback,formStateRestoreCallback:te.prototype.formStateRestoreCallback,observedAttributes:fe},this.h.set(H,de),this.m.set(te,de),le||(le=z(H),W.call(me,H,le)),this===window.customElements&&(w.set(te,de),de.o=le),le=this.i.get(H))for(this.i.delete(H),le=u(le),fe=le.next();!fe.done;fe=le.next())fe=fe.value,J.delete(fe),K(fe,de,!0);return le=this.j.get(H),le!==void 0&&(le.resolve(te),this.j.delete(H)),te},F.prototype.upgrade=function(H){for(var te=[],de=0;de<arguments.length;++de)te[de]=arguments[de];re.push(this),me.upgrade.apply(me,d(te)),re.pop()},F.prototype.get=function(H){var te;return(te=this.h.get(H))==null?void 0:te.g},F.prototype.whenDefined=function(H){var te=this.h.get(H);return te!==void 0?Promise.resolve(te.g):(te=this.j.get(H),te===void 0&&(te=new N,this.j.set(H,te)),te.promise)};function B(H,te,de,fe){var le=H.i.get(de);le||H.i.set(de,le=new Set),fe?le.add(te):le.delete(te)}var q;window.HTMLElement=function(){var H=q;if(H)return q=void 0,H;var te=w.get(this.constructor);if(!te)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return H=Reflect.construct(x,[],te.o),Object.setPrototypeOf(H,this.constructor.prototype),G.set(H,te),H},window.HTMLElement.prototype=x.prototype;function z(H){function te(){var de=Reflect.construct(x,[],this.constructor);Object.setPrototypeOf(de,HTMLElement.prototype);e:{var fe=de.getRootNode();if(!(fe===document||fe instanceof ShadowRoot)){if(fe=re[re.length-1],fe instanceof CustomElementRegistry){var le=fe;break e}fe=fe.getRootNode(),fe===document||fe instanceof ShadowRoot||(fe=((le=A.get(fe))==null?void 0:le.getRootNode())||document)}le=fe.registry}return le=le||window.customElements,(fe=le.h.get(H))?K(de,fe):J.set(de,le),de}return r.Object.defineProperty(te,"formAssociated",{configurable:!0,enumerable:!0,get:function(){return C.CustomElementRegistryPolyfill.formAssociated.has(H)}}),te.prototype.connectedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];j(this),(le=G.get(this))?le.connectedCallback&&le.connectedCallback.apply(this,fe):B(J.get(this),this,H,!0)},te.prototype.disconnectedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];(le=G.get(this))?le.disconnectedCallback&&le.disconnectedCallback.apply(this,fe):B(J.get(this),this,H,!1)},te.prototype.adoptedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];var $e,Le;($e=G.get(this))==null||(Le=$e.adoptedCallback)==null||Le.apply(this,fe)},te.prototype.formAssociatedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=G.get(this),le!=null&&le.formAssociated){var $e;le==null||($e=le.formAssociatedCallback)==null||$e.apply(this,fe)}},te.prototype.formDisabledCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=G.get(this),le!=null&&le.formAssociated){var $e;le==null||($e=le.formDisabledCallback)==null||$e.apply(this,fe)}},te.prototype.formResetCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=G.get(this),le!=null&&le.formAssociated){var $e;le==null||($e=le.formResetCallback)==null||$e.apply(this,fe)}},te.prototype.formStateRestoreCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=G.get(this),le!=null&&le.formAssociated){var $e;le==null||($e=le.formStateRestoreCallback)==null||$e.apply(this,fe)}},te}window.CustomElementRegistry=F;function D(H,te,de){if(te.size!==0&&de!==void 0){var fe=H.prototype.setAttribute;fe&&(H.prototype.setAttribute=function(Le,Dt){if(j(this),Le=Le.toLowerCase(),te.has(Le)){var _s=this.getAttribute(Le);fe.call(this,Le,Dt),de.call(this,Le,_s,Dt)}else fe.call(this,Le,Dt)});var le=H.prototype.removeAttribute;le&&(H.prototype.removeAttribute=function(Le){if(j(this),Le=Le.toLowerCase(),te.has(Le)){var Dt=this.getAttribute(Le);le.call(this,Le),de.call(this,Le,Dt,null)}else le.call(this,Le)});var $e=H.prototype.toggleAttribute;$e&&(H.prototype.toggleAttribute=function(Le,Dt){if(j(this),Le=Le.toLowerCase(),te.has(Le)){var _s=this.getAttribute(Le);$e.call(this,Le,Dt),Dt=this.getAttribute(Le),_s!==Dt&&de.call(this,Le,_s,Dt)}else $e.call(this,Le,Dt)})}}var k;document.readyState==="loading"&&(k=new Set,document.addEventListener("readystatechange",function(){k.forEach(function(H){return U(H,G.get(H))})},{once:!0}));function j(H){var te;(te=k)!=null&&te.has(H)&&U(H,G.get(H))}function U(H,te){var de;(de=k)==null||de.delete(H),te.attributeChangedCallback&&te.observedAttributes.forEach(function(fe){H.hasAttribute(fe)&&te.attributeChangedCallback.call(H,fe,null,H.getAttribute(fe))})}function V(H){var te=Object.getPrototypeOf(H);if(te!==window.HTMLElement)return te===x?Object.setPrototypeOf(H,window.HTMLElement):V(te)}function K(H,te,de){de=de===void 0?!1:de,Object.setPrototypeOf(H,te.g.prototype),G.set(H,te),q=H;try{new te.g}catch{V(te.g),new te.g}te.attributeChangedCallback&&(k===void 0||H.hasAttributes()?U(H,te):k.add(H)),de&&te.connectedCallback&&H.isConnected&&te.connectedCallback.call(H)}var P=Element.prototype.attachShadow;Element.prototype.attachShadow=function(H,te){for(var de=[],fe=1;fe<arguments.length;++fe)de[fe-1]=arguments[fe];var le=Object.assign({},H);return fe=H.customElements,fe=H.registry===void 0?fe:H.registry,le=(delete le.customElements,delete le.registry,le),de=P.call.apply(P,[this,le].concat(d(de))),fe!==void 0&&(de.customElements=de.registry=fe),de};var re=[document];function ue(H,te,de){var fe=(de?Object.getPrototypeOf(de):H.prototype)[te];H.prototype[te]=function(le){for(var $e=[],Le=0;Le<arguments.length;++Le)$e[Le]=arguments[Le];return re.push(this),$e=fe.apply(de||this,$e),$e!==void 0&&A.set($e,this),re.pop(),$e}}ue(ShadowRoot,"createElement",document),ue(ShadowRoot,"createElementNS",document),ue(ShadowRoot,"importNode",document),ue(Element,"insertAdjacentHTML");function I(H){var te=Object.getOwnPropertyDescriptor(H.prototype,"innerHTML");Object.defineProperty(H.prototype,"innerHTML",Object.assign({},te,{set:function(de){re.push(this),te.set.call(this,de),re.pop()}}))}if(I(Element),I(ShadowRoot),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){var X=new WeakMap,ce=HTMLElement.prototype.attachInternals,he=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(H){for(var te=[],de=0;de<arguments.length;++de)te[de]=arguments[de];return te=ce.call.apply(ce,[this].concat(d(te))),X.set(te,this),te},he.forEach(function(H){var te=window.ElementInternals.prototype,de=te[H];te[H]=function(fe){for(var le=[],$e=0;$e<arguments.length;++$e)le[$e]=arguments[$e];if($e=X.get(this),G.get($e).formAssociated===!0)return de?.call.apply(de,[this].concat(d(le)));throw new DOMException("Failed to execute "+de+" on 'ElementInternals': The target element is not a form-associated custom element.")}});var Te=function(H){var te=m(Array,[].concat(d(H)),this.constructor);return te.l=H,te},Oe=Te,Ae=Array;if(Oe.prototype=p(Ae.prototype),Oe.prototype.constructor=Oe,O)O(Oe,Ae);else for(var be in Ae)if(be!="prototype")if(Object.defineProperties){var _e=Object.getOwnPropertyDescriptor(Ae,be);_e&&Object.defineProperty(Oe,be,_e)}else Oe[be]=Ae[be];Oe.u=Ae.prototype,r.Object.defineProperty(Te.prototype,"value",{configurable:!0,enumerable:!0,get:function(){var H;return((H=this.l.find(function(te){return te.checked===!0}))==null?void 0:H.value)||""}});var Pe=function(H){var te=this,de=new Map;H.forEach(function(fe,le){var $e=fe.getAttribute("name"),Le=de.get($e)||[];te[+le]=fe,Le.push(fe),de.set($e,Le)}),this.length=H.length,de.forEach(function(fe,le){fe&&le!=="length"&&le!=="item"&&le!=="namedItem"&&(te[le]=fe.length===1?fe[0]:new Te(fe))})};Pe.prototype.item=function(H){var te;return(te=this[H])!=null?te:null},Pe.prototype[Symbol.iterator]=function(){throw Error("Method not implemented.")},Pe.prototype.namedItem=function(H){var te;return(te=this[H])!=null?te:null};var at=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){var H=at.get.call(this),te=[];H=u(H);for(var de=H.next();!de.done;de=H.next()){de=de.value;var fe=G.get(de);fe&&fe.formAssociated!==!0||te.push(de)}return new Pe(te)}})}}).call(typeof globalThis=="object"?globalThis:window)),R_}_P();const Nh=globalThis,Hb=Nh.ShadowRoot&&(Nh.ShadyCSS===void 0||Nh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,qb=Symbol(),M_=new WeakMap;let nO=class{constructor(t,s,r){if(this._$cssResult$=!0,r!==qb)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o;const s=this.t;if(Hb&&t===void 0){const r=s!==void 0&&s.length===1;r&&(t=M_.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&M_.set(s,t))}return t}toString(){return this.cssText}};const kP=e=>new nO(typeof e=="string"?e:e+"",void 0,qb),ya=(e,...t)=>{const s=e.length===1?e[0]:t.reduce((r,i,c)=>r+(u=>{if(u._$cssResult$===!0)return u.cssText;if(typeof u=="number")return u;throw Error("Value passed to 'css' function must be a 'css' function result: "+u+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[c+1],e[0]);return new nO(s,e,qb)},sO=(e,t)=>{if(Hb)e.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of t){const r=document.createElement("style"),i=Nh.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=s.cssText,e.appendChild(r)}},D_=Hb?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(const r of t.cssRules)s+=r.cssText;return kP(s)})(e):e;const{is:AP,defineProperty:OP,getOwnPropertyDescriptor:NP,getOwnPropertyNames:xP,getOwnPropertySymbols:CP,getPrototypeOf:IP}=Object,Gp=globalThis,U_=Gp.trustedTypes,RP=U_?U_.emptyScript:"",jP=Gp.reactiveElementPolyfillSupport,Bu=(e,t)=>e,lp={toAttribute(e,t){switch(t){case Boolean:e=e?RP:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=e!==null;break;case Number:s=e===null?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch{s=null}}return s}},Fp=(e,t)=>!AP(e,t),B_={attribute:!0,type:String,converter:lp,reflect:!1,useDefault:!1,hasChanged:Fp};Symbol.metadata??=Symbol("metadata"),Gp.litPropertyMetadata??=new WeakMap;let _c=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=B_){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(t,r,s);i!==void 0&&OP(this.prototype,t,i)}}static getPropertyDescriptor(t,s,r){const{get:i,set:c}=NP(this.prototype,t)??{get(){return this[s]},set(u){this[s]=u}};return{get:i,set(u){const d=i?.call(this);c?.call(this,u),this.requestUpdate(t,d,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??B_}static _$Ei(){if(this.hasOwnProperty(Bu("elementProperties")))return;const t=IP(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Bu("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Bu("properties"))){const s=this.properties,r=[...xP(s),...CP(s)];for(const i of r)this.createProperty(i,s[i])}const t=this[Symbol.metadata];if(t!==null){const s=litPropertyMetadata.get(t);if(s!==void 0)for(const[r,i]of s)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[s,r]of this.elementProperties){const i=this._$Eu(s,r);i!==void 0&&this._$Eh.set(i,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const i of r)s.unshift(D_(i))}else t!==void 0&&s.push(D_(t));return s}static _$Eu(t,s){const r=s.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const r of s.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return sO(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,s,r){this._$AK(t,r)}_$ET(t,s){const r=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,r);if(i!==void 0&&r.reflect===!0){const c=(r.converter?.toAttribute!==void 0?r.converter:lp).toAttribute(s,r.type);this._$Em=t,c==null?this.removeAttribute(i):this.setAttribute(i,c),this._$Em=null}}_$AK(t,s){const r=this.constructor,i=r._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const c=r.getPropertyOptions(i),u=typeof c.converter=="function"?{fromAttribute:c.converter}:c.converter?.fromAttribute!==void 0?c.converter:lp;this._$Em=i;const d=u.fromAttribute(s,c.type);this[i]=d??this._$Ej?.get(i)??d,this._$Em=null}}requestUpdate(t,s,r,i=!1,c){if(t!==void 0){const u=this.constructor;if(i===!1&&(c=this[t]),r??=u.getPropertyOptions(t),!((r.hasChanged??Fp)(c,s)||r.useDefault&&r.reflect&&c===this._$Ej?.get(t)&&!this.hasAttribute(u._$Eu(t,r))))return;this.C(t,s,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,s,{useDefault:r,reflect:i,wrapped:c},u){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,u??s??this[t]),c!==!0||u!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(s=void 0),this._$AL.set(t,s)),i===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,c]of this._$Ep)this[i]=c;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[i,c]of r){const{wrapped:u}=c,d=this[i];u!==!0||this._$AL.has(i)||d===void 0||this.C(i,void 0,c,d)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(s)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach(s=>s.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(s=>this._$ET(s,this[s])),this._$EM()}updated(t){}firstUpdated(t){}};_c.elementStyles=[],_c.shadowRootOptions={mode:"open"},_c[Bu("elementProperties")]=new Map,_c[Bu("finalized")]=new Map,jP?.({ReactiveElement:_c}),(Gp.reactiveElementVersions??=[]).push("2.1.2");const Zb=globalThis,L_=e=>e,up=Zb.trustedTypes,z_=up?up.createPolicy("lit-html",{createHTML:e=>e}):void 0,rO="$lit$",ai=`lit$${Math.random().toFixed(9).slice(2)}$`,aO="?"+ai,MP=`<${aO}>`,go=document,Zu=()=>go.createComment(""),Yu=e=>e===null||typeof e!="object"&&typeof e!="function",Yb=Array.isArray,DP=e=>Yb(e)||typeof e?.[Symbol.iterator]=="function",Ty=`[
|
|
12
|
+
`)){if(s=="")continue;let[r,...i]=s.split(":");const c=i.join(":").trim();r=r.trim();let u=t[r];typeof u=="string"?t[r]=[u,c]:Array.isArray(u)?u.push(c):t[r]=c}return t}function g8(e){let t={};return e.forEach((s,r)=>{let i=t[r];typeof i=="string"?t[r]=[i,s]:Array.isArray(i)?i.push(s):t[r]=s}),t}function y8(e){switch(e){case 200:return we.OK;case 400:return we.INVALID_ARGUMENT;case 401:return we.UNAUTHENTICATED;case 403:return we.PERMISSION_DENIED;case 404:return we.NOT_FOUND;case 409:return we.ABORTED;case 412:return we.FAILED_PRECONDITION;case 429:return we.RESOURCE_EXHAUSTED;case 499:return we.CANCELLED;case 500:return we.UNKNOWN;case 501:return we.UNIMPLEMENTED;case 503:return we.UNAVAILABLE;case 504:return we.DEADLINE_EXCEEDED;default:return we.UNKNOWN}}class v8{constructor(t){this.defaultOptions=t}mergeOptions(t){return o8(this.defaultOptions,t)}makeUrl(t,s){let r=s.baseUrl;return r.endsWith("/")&&(r=r.substring(0,r.length-1)),`${r}/${t.service.typeName}/${t.name}`}clientStreaming(t){const s=new gt("Client streaming is not supported by grpc-web",we[we.UNIMPLEMENTED]);throw s.methodName=t.name,s.serviceName=t.service.typeName,s}duplex(t){const s=new gt("Duplex streaming is not supported by grpc-web",we[we.UNIMPLEMENTED]);throw s.methodName=t.name,s.serviceName=t.service.typeName,s}serverStreaming(t,s,r){var i,c,u,d,p;let m=r,g=(i=m.format)!==null&&i!==void 0?i:"text",y=(c=m.fetch)!==null&&c!==void 0?c:globalThis.fetch,b=(u=m.fetchInit)!==null&&u!==void 0?u:{},E=this.makeUrl(t,m),O=t.I.toBinary(s,m.binaryOptions),C=new ei,R=new c8,$=!0,x,W=new ei,oe,me=new ei;return y(E,Object.assign(Object.assign({},b),{method:"POST",headers:NE(new globalThis.Headers,g,m.timeout,m.meta),body:xE(O,g),signal:(d=r.abort)!==null&&d!==void 0?d:null})).then(G=>{let[J,w,A]=tv(G);if(C.resolve(A),J!=null&&J!==we.OK)throw new gt(w??we[J],we[J],A);return J!=null&&(x={code:we[J],detail:w??we[J]}),G}).then(G=>{if(!G.body)throw new gt("missing response body",we[we.INTERNAL]);return IE(G.body,G.headers.get("content-type"),(J,w)=>{switch(J){case nr.DATA:R.notifyMessage(t.O.fromBinary(w,m.binaryOptions)),$=!1;break;case nr.TRAILER:let A,N;[A,N,oe]=CE(w),x={code:we[A],detail:N??we[A]};break}})}).then(()=>{if(!oe&&!$)throw new gt("missing trailers",we[we.DATA_LOSS]);if(!x)throw new gt("missing status",we[we.INTERNAL]);if(x.code!=="OK")throw new gt(x.detail,x.code,oe);R.notifyComplete(),W.resolve(x),me.resolve(oe||{})}).catch(G=>{let J;G instanceof gt?J=G:G instanceof Error&&G.name==="AbortError"?J=new gt(G.message,we[we.CANCELLED]):J=new gt(G instanceof Error?G.message:""+G,we[we.INTERNAL]),J.methodName=t.name,J.serviceName=t.service.typeName,C.rejectPending(J),R.notifyError(J),W.rejectPending(J),me.rejectPending(J)}),new d8(t,(p=m.meta)!==null&&p!==void 0?p:{},s,C.promise,R,W.promise,me.promise)}unary(t,s,r){var i,c,u,d,p;let m=r,g=(i=m.format)!==null&&i!==void 0?i:"text",y=(c=m.fetch)!==null&&c!==void 0?c:globalThis.fetch,b=(u=m.fetchInit)!==null&&u!==void 0?u:{},E=this.makeUrl(t,m),O=t.I.toBinary(s,m.binaryOptions),C=new ei,R,$=new ei,x,W=new ei,oe,me=new ei;return y(E,Object.assign(Object.assign({},b),{method:"POST",headers:NE(new globalThis.Headers,g,m.timeout,m.meta),body:xE(O,g),signal:(d=r.abort)!==null&&d!==void 0?d:null})).then(G=>{let[J,w,A]=tv(G);if(C.resolve(A),J!=null&&J!==we.OK)throw new gt(w??we[J],we[J],A);return J!=null&&(x={code:we[J],detail:w??we[J]}),G}).then(G=>{if(!G.body)throw new gt("missing response body",we[we.INTERNAL]);return IE(G.body,G.headers.get("content-type"),(J,w)=>{switch(J){case nr.DATA:if(R)throw new gt("unary call received 2nd message",we[we.DATA_LOSS]);R=t.O.fromBinary(w,m.binaryOptions);break;case nr.TRAILER:let A,N;[A,N,oe]=CE(w),x={code:we[A],detail:N??we[A]};break}})}).then(()=>{if(!oe&&R)throw new gt("missing trailers",we[we.DATA_LOSS]);if(!x)throw new gt("missing status",we[we.INTERNAL]);if(!R&&x.code==="OK")throw new gt("expected error status",we[we.DATA_LOSS]);if(!R)throw new gt(x.detail,x.code,oe);if($.resolve(R),x.code!=="OK")throw new gt(x.detail,x.code,oe);W.resolve(x),me.resolve(oe||{})}).catch(G=>{let J;G instanceof gt?J=G:G instanceof Error&&G.name==="AbortError"?J=new gt(G.message,we[we.CANCELLED]):J=new gt(G instanceof Error?G.message:""+G,we[we.INTERNAL]),J.methodName=t.name,J.serviceName=t.service.typeName,C.rejectPending(J),$.rejectPending(J),W.rejectPending(J),me.rejectPending(J)}),new mA(t,(p=m.meta)!==null&&p!==void 0?p:{},s,C.promise,$.promise,W.promise,me.promise)}}const nv=Symbol.for("@mysten/sui/grpc/decoded-status-message");function b8(e){if(!e.includes("%"))return e;try{return decodeURIComponent(e)}catch{return e}}function vA(e){return nv in e?!1:(Object.defineProperty(e,nv,{value:!0,configurable:!0}),!0)}function jE(e){vA(e)&&(e.message=b8(e.message))}function w8(e){return nv in e}function sv(e,t){if(!(typeof e!="object"||e===null))try{return e[t]}catch{return}}function T8(e){const t=sv(e,"code");return typeof t=="string"&&typeof we[t]=="number"?t:sv(e,"name")==="TimeoutError"?we[we.DEADLINE_EXCEEDED]:we[we.CANCELLED]}function S8(e,t){if(typeof t=="string")return e===t;const s=sv(t,"message");return typeof s=="string"&&e===s}function bA(e,t){try{E8(e,t)}catch{}}function E8(e,t){if(e instanceof gt){if(t?.aborted&&(e.code===we[we.INTERNAL]||e.code===we[we.CANCELLED])){e.code=T8(t.reason),S8(e.message,t.reason)?vA(e):jE(e);return}jE(e)}}function ME(e,t){for(const s of e)s.then(void 0,r=>bA(r,t))}var lb=class extends v8{constructor(e){super({...e,meta:{[sA]:String(rA),...e.meta}})}unary(e,t,s){const r=super.unary(e,t,s);return ME([r.headers,r.response,r.status,r.trailers],s.abort),r}serverStreaming(e,t,s){const r=super.serverStreaming(e,t,s);return r.responses.onError(i=>bA(i,s.abort)),ME([r.headers,r.status,r.trailers],s.abort),r}};function _8(e){return{mergeOptions(t){const s=e.mergeOptions(t);return{...s,meta:{[sA]:String(rA),...s.meta}}},unary:e.unary.bind(e),serverStreaming:e.serverStreaming.bind(e),clientStreaming:e.clientStreaming.bind(e),duplex:e.duplex.bind(e)}}var k8=class wA{#e;#t;constructor({prefix:t,cache:s}={}){this.#e=t??[],this.#t=s??new Map}read(t,s){const r=[this.#e,...t].join(":");if(this.#t.has(r))return this.#t.get(r);const i=s();return this.#t.set(r,i),typeof i=="object"&&i!==null&&"then"in i?Promise.resolve(i).then(c=>(this.#t.set(r,c),c)).catch(c=>{throw this.#t.delete(r),c}):i}readSync(t,s){const r=[this.#e,...t].join(":");if(this.#t.has(r))return this.#t.get(r);const i=s();return this.#t.set(r,i),i}clear(t){const s=[...this.#e,...t??[]].join(":");if(!s){this.#t.clear();return}for(const r of this.#t.keys())r.startsWith(s)&&this.#t.delete(r)}scope(t){return new wA({prefix:[...this.#e,...Array.isArray(t)?t:[t]],cache:this.#t})}},TA=class{constructor({network:e,base:t,cache:s=t?.cache??new k8}){this.network=e,this.base=t??this,this.cache=s}$extend(...e){const t=Object.fromEntries(e.map(r=>[r.name,r.register(this)])),s=new Map;return new Proxy(this,{get(r,i,c){if(typeof i=="string"&&i in t)return t[i];const u=Reflect.get(r,i,c);return typeof u=="function"?i==="$extend"?u.bind(c):(s.has(i)||s.set(i,u.bind(r)),s.get(i)):u}})}};const A8={mainnet:"https://mainnet.mvr.mystenlabs.com",testnet:"https://testnet.mvr.mystenlabs.com"};var O8=class extends TA{constructor(e){super(e),this.core=this,this.mvr=new g5({cache:this.cache.scope("core.mvr"),url:e.mvr?.url??A8[this.network],pageSize:e.mvr?.pageSize,overrides:e.mvr?.overrides})}async getObject(e){const{objectId:t}=e,{objects:[s]}=await this.getObjects({objectIds:[t],signal:e.signal,include:e.include});if(s instanceof Error)throw s;return{object:s}}async getDynamicField(e){const t=uo.parseFromStr((await this.core.mvr.resolveType({type:e.name.type,signal:e.signal})).type),s=ib(e.parentId,t,e.name.bcs),{objects:[r]}=await this.getObjects({objectIds:[s],signal:e.signal,include:{previousTransaction:!0,content:!0}});if(r instanceof Error)throw r;const i=Ss(r.type),c=await r.content,u=i.typeParams[0],d=typeof u!="string"&&u.module==="dynamic_object_field"&&u.name==="Wrapper",p=c.slice(sl+e.name.bcs.length),m=typeof i.typeParams[1]=="string"?i.typeParams[1]:De(i.typeParams[1]);return{dynamicField:{$kind:d?"DynamicObject":"DynamicField",fieldId:r.objectId,digest:r.digest,version:r.version,type:r.type,previousTransaction:r.previousTransaction,name:{type:typeof u=="string"?u:De(u),bcs:e.name.bcs},value:{type:m,bcs:p},childId:d?M.Address.parse(p):void 0}}}async getDynamicObjectField(e){const t=`0x2::dynamic_object_field::Wrapper<${(await this.core.mvr.resolveType({type:e.name.type,signal:e.signal})).type}>`,{dynamicField:s}=await this.getDynamicField({parentId:e.parentId,name:{type:t,bcs:e.name.bcs},signal:e.signal}),{object:r}=await this.getObject({objectId:s.childId,signal:e.signal,include:e.include});return{object:r}}async waitForTransaction(e){const{signal:t,timeout:s=60*1e3,pollSchedule:r,include:i}=e,c="result"in e&&e.result?(e.result.Transaction??e.result.FailedTransaction).digest:e.digest,u=t?AbortSignal.any([AbortSignal.timeout(s),t]):AbortSignal.timeout(s),d=new Promise((b,E)=>{u.addEventListener("abort",()=>E(u.reason))});d.catch(()=>{});const p=r??[0,300,600,1500,3500],m=Date.now();let g=0;const y=p.length>0?p[p.length-1]-(p[p.length-2]??0):2e3;for(;;){if(g<p.length){const b=m+p[g]-Date.now();g++,b>0&&await Promise.race([new Promise(E=>setTimeout(E,b)),d])}else await Promise.race([new Promise(b=>setTimeout(b,y)),d]);u.throwIfAborted();try{return await this.getTransaction({digest:c,include:i,signal:u})}catch{}}}async signAndExecuteTransaction({transaction:e,signer:t,additionalSignatures:s=[],...r}){let i;e instanceof Uint8Array?i=e:(e.setSenderIfNotSet(t.toSuiAddress()),i=await e.build({client:this}));const{signature:c}=await t.signTransaction(i);return this.executeTransaction({transaction:i,signatures:[c,...s],...r})}};const N8=new Intl.PluralRules("en-US",{type:"ordinal"}),x8=new Map([["one","st"],["two","nd"],["few","rd"],["other","th"]]);function C8(e){return`${e}${x8.get(N8.select(e))}`}function SA(e){const{command:t,location:s,abortCode:r,cleverError:i}=e,c=[];if(t!=null?c.push(`MoveAbort in ${C8(t+1)} command`):c.push("MoveAbort"),i?.constantName){const u=i.value?`'${i.constantName}': ${i.value}`:`'${i.constantName}'`;c.push(u)}else c.push(`abort code: ${r}`);if(s?.package&&s?.module){const u=[`in '${[s.package.startsWith("0x")?s.package:`0x${s.package}`,s.module,s.functionName].filter(Boolean).join("::")}'`];i?.lineNumber!=null?u.push(`(line ${i.lineNumber})`):s.instruction!=null&&u.push(`(instruction ${s.instruction})`),c.push(u.join(" "))}return c.join(", ")}const DE=M.struct("MinimalEffectsWithError",{status:Pv}),I8=M.enum("MinimalTransactionEffectsWithError",{V1:DE,V2:DE}),R8=M.enum("MinimalExecutionStatusNoError",{Success:null,Failed:null}),UE=M.struct("MinimalEffectsNoError",{status:R8}),j8=M.enum("MinimalTransactionEffectsNoError",{V1:UE,V2:UE});function ns(e,t){return t!=null&&typeof t!="boolean"?`${e}(${JSON.stringify(t,(s,r)=>typeof r=="bigint"?r.toString():r)})`:e}function ub(e){const t=e.error,s=e.command!=null?Number(e.command):void 0;switch(t.$kind){case"MoveAbort":{const[r,i]=t.MoveAbort,c={package:r.module.address,module:r.module.name,function:r.function,functionName:r.functionName??void 0,instruction:r.instruction};return{$kind:"MoveAbort",message:SA({command:s,location:c,abortCode:String(i)}),command:s,MoveAbort:{abortCode:String(i),location:c}}}case"MoveObjectTooBig":return{$kind:"SizeError",message:ns("MoveObjectTooBig",t.MoveObjectTooBig),command:s,SizeError:{name:"ObjectTooBig",size:Number(t.MoveObjectTooBig.objectSize),maxSize:Number(t.MoveObjectTooBig.maxObjectSize)}};case"MovePackageTooBig":return{$kind:"SizeError",message:ns("MovePackageTooBig",t.MovePackageTooBig),command:s,SizeError:{name:"PackageTooBig",size:Number(t.MovePackageTooBig.objectSize),maxSize:Number(t.MovePackageTooBig.maxObjectSize)}};case"EffectsTooLarge":return{$kind:"SizeError",message:ns("EffectsTooLarge",t.EffectsTooLarge),command:s,SizeError:{name:"EffectsTooLarge",size:Number(t.EffectsTooLarge.currentSize),maxSize:Number(t.EffectsTooLarge.maxSize)}};case"WrittenObjectsTooLarge":return{$kind:"SizeError",message:ns("WrittenObjectsTooLarge",t.WrittenObjectsTooLarge),command:s,SizeError:{name:"WrittenObjectsTooLarge",size:Number(t.WrittenObjectsTooLarge.currentSize),maxSize:Number(t.WrittenObjectsTooLarge.maxSize)}};case"MoveVectorElemTooBig":return{$kind:"SizeError",message:ns("MoveVectorElemTooBig",t.MoveVectorElemTooBig),command:s,SizeError:{name:"MoveVectorElemTooBig",size:Number(t.MoveVectorElemTooBig.valueSize),maxSize:Number(t.MoveVectorElemTooBig.maxScaledSize)}};case"MoveRawValueTooBig":return{$kind:"SizeError",message:ns("MoveRawValueTooBig",t.MoveRawValueTooBig),command:s,SizeError:{name:"MoveRawValueTooBig",size:Number(t.MoveRawValueTooBig.valueSize),maxSize:Number(t.MoveRawValueTooBig.maxScaledSize)}};case"CommandArgumentError":return{$kind:"CommandArgumentError",message:ns("CommandArgumentError",t.CommandArgumentError),command:s,CommandArgumentError:{argument:t.CommandArgumentError.argIdx,name:t.CommandArgumentError.kind.$kind}};case"TypeArgumentError":return{$kind:"TypeArgumentError",message:ns("TypeArgumentError",t.TypeArgumentError),command:s,TypeArgumentError:{typeArgument:t.TypeArgumentError.argumentIdx,name:t.TypeArgumentError.kind.$kind}};case"PackageUpgradeError":{const r=t.PackageUpgradeError.upgradeError;return{$kind:"PackageUpgradeError",message:ns("PackageUpgradeError",t.PackageUpgradeError),command:s,PackageUpgradeError:{name:r.$kind,packageId:r.$kind==="UnableToFetchPackage"?r.UnableToFetchPackage.packageId:void 0,digest:r.$kind==="DigestDoesNotMatch"?Ke(r.DigestDoesNotMatch.digest):void 0}}}case"ExecutionCancelledDueToSharedObjectCongestion":return{$kind:"CongestedObjects",message:ns("ExecutionCancelledDueToSharedObjectCongestion",t.ExecutionCancelledDueToSharedObjectCongestion),command:s,CongestedObjects:{name:"ExecutionCanceledDueToConsensusObjectCongestion",objects:t.ExecutionCancelledDueToSharedObjectCongestion.congested_objects}};case"AddressDeniedForCoin":return{$kind:"CoinDenyListError",message:ns("AddressDeniedForCoin",t.AddressDeniedForCoin),command:s,CoinDenyListError:{name:"AddressDeniedForCoin",address:t.AddressDeniedForCoin.address,coinType:t.AddressDeniedForCoin.coinType}};case"CoinTypeGlobalPause":return{$kind:"CoinDenyListError",message:ns("CoinTypeGlobalPause",t.CoinTypeGlobalPause),command:s,CoinDenyListError:{name:"CoinTypeGlobalPause",coinType:t.CoinTypeGlobalPause.coinType}};case"CircularObjectOwnership":return{$kind:"ObjectIdError",message:ns("CircularObjectOwnership",t.CircularObjectOwnership),command:s,ObjectIdError:{name:"CircularObjectOwnership",objectId:t.CircularObjectOwnership.object}};case"InvalidGasObject":return{$kind:"ObjectIdError",message:"InvalidGasObject",command:s,ObjectIdError:{name:"InvalidGasObject",objectId:""}};case"InputObjectDeleted":return{$kind:"ObjectIdError",message:"InputObjectDeleted",command:s,ObjectIdError:{name:"InputObjectDeleted",objectId:""}};case"InvalidTransferObject":return{$kind:"ObjectIdError",message:"InvalidTransferObject",command:s,ObjectIdError:{name:"InvalidTransferObject",objectId:""}};case"NonExclusiveWriteInputObjectModified":return{$kind:"Unknown",message:ns("NonExclusiveWriteInputObjectModified",t.NonExclusiveWriteInputObjectModified),command:s,Unknown:null};case"InsufficientGas":case"InvariantViolation":case"FeatureNotYetSupported":case"InsufficientCoinBalance":case"CoinBalanceOverflow":case"PublishErrorNonZeroAddress":case"SuiMoveVerificationError":case"MovePrimitiveRuntimeError":case"VMVerificationOrDeserializationError":case"VMInvariantViolation":case"FunctionNotFound":case"ArityMismatch":case"TypeArityMismatch":case"NonEntryFunctionInvoked":case"UnusedValueWithoutDrop":case"InvalidPublicFunctionReturnType":case"PublishUpgradeMissingDependency":case"PublishUpgradeDependencyDowngrade":case"CertificateDenied":case"SuiMoveVerificationTimedout":case"SharedObjectOperationNotAllowed":case"ExecutionCancelledDueToRandomnessUnavailable":case"InvalidLinkage":case"InsufficientBalanceForWithdraw":return{$kind:"Unknown",message:t.$kind,command:s,Unknown:null};default:return{$kind:"Unknown",message:"Unknown error",command:s,Unknown:null}}}function M8(e,t=!1){return(t?Ji.fromKindBytes(e):Ji.fromBytes(e)).snapshot()}function D8(e){try{return M.TransactionData.parse(e).V1?.gasData.payment?.length===0}catch{return!1}}function U8(e){let t=null;try{t=I8.parse(e)}catch{const r=j8.parse(e);return(r.V1??r.V2).status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:{$kind:"Unknown",message:"ExecutionFailed",Unknown:null}}}const s=(t.V1??t.V2).status;return s.$kind==="Success"?{success:!0,error:null}:{success:!1,error:ub(s.Failure)}}function B8(e){const t=M.TransactionEffects.parse(e);switch(t.$kind){case"V1":return L8({bytes:e,effects:t.V1});case"V2":return z8({bytes:e,effects:t.V2});default:throw new Error(`Unknown transaction effects version: ${t.$kind}`)}}function L8({bytes:e,effects:t}){const s=new Map(t.modifiedAtVersions),r=new Map(t.sharedObjects.map(b=>[b.objectId,b])),i=(b,E)=>{const O=r.get(b.objectId);return{objectId:b.objectId,inputState:E.inputState,inputVersion:E.inputState==="Exists"?O?.version??s.get(b.objectId)??null:null,inputDigest:E.inputState==="Exists"?O?.digest??null:null,inputOwner:null,outputState:E.outputState,outputVersion:E.outputState==="DoesNotExist"?null:b.version,outputDigest:E.outputState==="DoesNotExist"?null:b.digest,outputOwner:E.outputOwner,idOperation:E.idOperation}},c=(b,E,O)=>b.map(([C,R])=>i(C,{inputState:E,outputState:"ObjectWrite",outputOwner:R,idOperation:O})),u=(b,E,O)=>b.map(C=>i(C,{inputState:E,outputState:"DoesNotExist",outputOwner:null,idOperation:O})),d=[...c(t.created,"DoesNotExist","Created"),...c(t.mutated,"Exists","None"),...c(t.unwrapped,"DoesNotExist","None"),...u(t.deleted,"Exists","Deleted"),...u(t.unwrappedThenDeleted,"DoesNotExist","Deleted"),...u(t.wrapped,"Exists","None")],p=t.gasObject[0].objectId,m=d.find(b=>b.objectId===p)??null,g=new Set(d.map(b=>b.objectId)),y=t.modifiedAtVersions.reduce((b,[,E])=>BigInt(E)>b?BigInt(E):b,0n);return{bcs:e,version:1,status:t.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:ub(t.status.Failure)},gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:m,eventsDigest:t.eventsDigest,dependencies:t.dependencies,lamportVersion:(y+1n).toString(),changedObjects:d,unchangedConsensusObjects:t.sharedObjects.filter(b=>!g.has(b.objectId)).map(b=>({kind:"ReadOnlyRoot",objectId:b.objectId,version:b.version,digest:b.digest})),auxiliaryDataDigest:null}}function z8({bytes:e,effects:t}){const s=t.changedObjects.map(([r,i])=>({objectId:r,inputState:i.inputState.$kind==="Exist"?"Exists":"DoesNotExist",inputVersion:i.inputState.Exist?.[0][0]??null,inputDigest:i.inputState.Exist?.[0][1]??null,inputOwner:i.inputState.Exist?.[1]??null,outputState:i.outputState.$kind==="NotExist"?"DoesNotExist":i.outputState.$kind,outputVersion:i.outputState.$kind==="PackageWrite"?i.outputState.PackageWrite?.[0]:i.outputState.$kind==="ObjectWrite"?t.lamportVersion:null,outputDigest:i.outputState.$kind==="PackageWrite"?i.outputState.PackageWrite?.[1]:i.outputState.$kind==="ObjectWrite"?i.outputState.ObjectWrite?.[0]??null:null,outputOwner:i.outputState.$kind==="ObjectWrite"?i.outputState.ObjectWrite[1]:null,idOperation:i.idOperation.$kind}));return{bcs:e,version:2,status:t.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:ub(t.status.Failure)},gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:t.gasObjectIndex===null?null:s[t.gasObjectIndex]??null,eventsDigest:t.eventsDigest,dependencies:t.dependencies,lamportVersion:t.lamportVersion,changedObjects:s,unchangedConsensusObjects:t.unchangedConsensusObjects.map(([r,i])=>({kind:i.$kind,objectId:r,version:i.$kind==="ReadOnlyRoot"?i.ReadOnlyRoot[0]:i[i.$kind],digest:i.$kind==="ReadOnlyRoot"?i.ReadOnlyRoot[1]:null})),auxiliaryDataDigest:t.auxDataDigest}}let BE=(function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e})({});var $8=class extends Y{constructor(){super("google.protobuf.Struct",[{no:1,name:"fields",kind:"map",K:9,V:{kind:"message",T:()=>pn}}])}internalJsonWrite(e,t){let s={};for(let[r,i]of Object.entries(e.fields))s[r]=pn.toJson(i);return s}internalJsonRead(e,t,s){if(!Hh(e))throw new globalThis.Error("Unable to parse message "+this.typeName+" from JSON "+ga(e)+".");s||(s=this.create());for(let[r,i]of globalThis.Object.entries(e))s.fields[r]=pn.fromJson(i);return s}};const LE=new $8;var V8=class extends Y{constructor(){super("google.protobuf.Value",[{no:1,name:"null_value",kind:"enum",oneof:"kind",T:()=>["google.protobuf.NullValue",BE]},{no:2,name:"number_value",kind:"scalar",oneof:"kind",T:1},{no:3,name:"string_value",kind:"scalar",oneof:"kind",T:9},{no:4,name:"bool_value",kind:"scalar",oneof:"kind",T:8},{no:5,name:"struct_value",kind:"message",oneof:"kind",T:()=>LE},{no:6,name:"list_value",kind:"message",oneof:"kind",T:()=>zE}])}internalJsonWrite(e,t){if(e.kind.oneofKind===void 0)throw new globalThis.Error;switch(e.kind.oneofKind){case void 0:throw new globalThis.Error;case"boolValue":return e.kind.boolValue;case"nullValue":return null;case"numberValue":let s=e.kind.numberValue;if(typeof s=="number"&&!Number.isFinite(s))throw new globalThis.Error;return s;case"stringValue":return e.kind.stringValue;case"listValue":let r=this.fields.find(c=>c.no===6);if(r?.kind!=="message")throw new globalThis.Error;return r.T().toJson(e.kind.listValue);case"structValue":let i=this.fields.find(c=>c.no===5);if(i?.kind!=="message")throw new globalThis.Error;return i.T().toJson(e.kind.structValue)}}internalJsonRead(e,t,s){switch(s||(s=this.create()),typeof e){case"number":s.kind={oneofKind:"numberValue",numberValue:e};break;case"string":s.kind={oneofKind:"stringValue",stringValue:e};break;case"boolean":s.kind={oneofKind:"boolValue",boolValue:e};break;case"object":e===null?s.kind={oneofKind:"nullValue",nullValue:BE.NULL_VALUE}:globalThis.Array.isArray(e)?s.kind={oneofKind:"listValue",listValue:zE.fromJson(e)}:s.kind={oneofKind:"structValue",structValue:LE.fromJson(e)};break;default:throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+ga(e))}return s}};const pn=new V8;var P8=class extends Y{constructor(){super("google.protobuf.ListValue",[{no:1,name:"values",kind:"message",repeat:2,T:()=>pn}])}internalJsonWrite(e,t){return e.values.map(s=>pn.toJson(s))}internalJsonRead(e,t,s){if(!globalThis.Array.isArray(e))throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+ga(e));s||(s=this.create());let r=e.map(i=>pn.fromJson(i));return s.values.push(...r),s}};const zE=new P8;let G8=(function(e){return e[e.DATATYPE_KIND_UNKNOWN=0]="DATATYPE_KIND_UNKNOWN",e[e.STRUCT=1]="STRUCT",e[e.ENUM=2]="ENUM",e})({}),ys=(function(e){return e[e.TYPE_UNKNOWN=0]="TYPE_UNKNOWN",e[e.ADDRESS=1]="ADDRESS",e[e.BOOL=2]="BOOL",e[e.U8=3]="U8",e[e.U16=4]="U16",e[e.U32=5]="U32",e[e.U64=6]="U64",e[e.U128=7]="U128",e[e.U256=8]="U256",e[e.VECTOR=9]="VECTOR",e[e.DATATYPE=10]="DATATYPE",e[e.TYPE_PARAMETER=11]="TYPE_PARAMETER",e})({}),Eh=(function(e){return e[e.VISIBILITY_UNKNOWN=0]="VISIBILITY_UNKNOWN",e[e.PRIVATE=1]="PRIVATE",e[e.PUBLIC=2]="PUBLIC",e[e.FRIEND=3]="FRIEND",e})({}),rv=(function(e){return e[e.REFERENCE_UNKNOWN=0]="REFERENCE_UNKNOWN",e[e.IMMUTABLE=1]="IMMUTABLE",e[e.MUTABLE=2]="MUTABLE",e})({}),Nc=(function(e){return e[e.ABILITY_UNKNOWN=0]="ABILITY_UNKNOWN",e[e.COPY=1]="COPY",e[e.DROP=2]="DROP",e[e.STORE=3]="STORE",e[e.KEY=4]="KEY",e})({});var F8=class extends Y{constructor(){super("sui.rpc.v2.Package",[{no:1,name:"storage_id",kind:"scalar",opt:!0,T:9},{no:2,name:"original_id",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"modules",kind:"message",repeat:2,T:()=>q8},{no:5,name:"type_origins",kind:"message",repeat:2,T:()=>nM},{no:6,name:"linkage",kind:"message",repeat:2,T:()=>rM}])}};const EA=new F8;var H8=class extends Y{constructor(){super("sui.rpc.v2.Module",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"contents",kind:"scalar",opt:!0,T:12},{no:3,name:"datatypes",kind:"message",repeat:2,T:()=>_A},{no:4,name:"functions",kind:"message",repeat:2,T:()=>OA}])}};const q8=new H8;var Z8=class extends Y{constructor(){super("sui.rpc.v2.DatatypeDescriptor",[{no:1,name:"type_name",kind:"scalar",opt:!0,T:9},{no:2,name:"defining_id",kind:"scalar",opt:!0,T:9},{no:3,name:"module",kind:"scalar",opt:!0,T:9},{no:4,name:"name",kind:"scalar",opt:!0,T:9},{no:5,name:"abilities",kind:"enum",repeat:1,T:()=>["sui.rpc.v2.Ability",Nc]},{no:6,name:"type_parameters",kind:"message",repeat:2,T:()=>kA},{no:7,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.DatatypeDescriptor.DatatypeKind",G8]},{no:8,name:"fields",kind:"message",repeat:2,T:()=>AA},{no:9,name:"variants",kind:"message",repeat:2,T:()=>K8}])}};const _A=new Z8;var Y8=class extends Y{constructor(){super("sui.rpc.v2.TypeParameter",[{no:1,name:"constraints",kind:"enum",repeat:1,T:()=>["sui.rpc.v2.Ability",Nc]},{no:2,name:"is_phantom",kind:"scalar",opt:!0,T:8}])}};const kA=new Y8;var W8=class extends Y{constructor(){super("sui.rpc.v2.FieldDescriptor",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"position",kind:"scalar",opt:!0,T:13},{no:3,name:"type",kind:"message",T:()=>db}])}};const AA=new W8;var X8=class extends Y{constructor(){super("sui.rpc.v2.VariantDescriptor",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"position",kind:"scalar",opt:!0,T:13},{no:3,name:"fields",kind:"message",repeat:2,T:()=>AA}])}};const K8=new X8;var J8=class extends Y{constructor(){super("sui.rpc.v2.OpenSignatureBody",[{no:1,name:"type",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.OpenSignatureBody.Type",ys]},{no:2,name:"type_name",kind:"scalar",opt:!0,T:9},{no:3,name:"type_parameter_instantiation",kind:"message",repeat:2,T:()=>db},{no:4,name:"type_parameter",kind:"scalar",opt:!0,T:13}])}};const db=new J8;var Q8=class extends Y{constructor(){super("sui.rpc.v2.FunctionDescriptor",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:5,name:"visibility",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.FunctionDescriptor.Visibility",Eh]},{no:6,name:"is_entry",kind:"scalar",opt:!0,T:8},{no:7,name:"type_parameters",kind:"message",repeat:2,T:()=>kA},{no:8,name:"parameters",kind:"message",repeat:2,T:()=>$E},{no:9,name:"returns",kind:"message",repeat:2,T:()=>$E}])}};const OA=new Q8;var eM=class extends Y{constructor(){super("sui.rpc.v2.OpenSignature",[{no:1,name:"reference",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.OpenSignature.Reference",rv]},{no:2,name:"body",kind:"message",T:()=>db}])}};const $E=new eM;var tM=class extends Y{constructor(){super("sui.rpc.v2.TypeOrigin",[{no:1,name:"module_name",kind:"scalar",opt:!0,T:9},{no:2,name:"datatype_name",kind:"scalar",opt:!0,T:9},{no:3,name:"package_id",kind:"scalar",opt:!0,T:9}])}};const nM=new tM;var sM=class extends Y{constructor(){super("sui.rpc.v2.Linkage",[{no:1,name:"original_id",kind:"scalar",opt:!0,T:9},{no:2,name:"upgraded_id",kind:"scalar",opt:!0,T:9},{no:3,name:"upgraded_version",kind:"scalar",opt:!0,T:4,L:0}])}};const rM=new sM;let Sc=(function(e){return e[e.OWNER_KIND_UNKNOWN=0]="OWNER_KIND_UNKNOWN",e[e.ADDRESS=1]="ADDRESS",e[e.OBJECT=2]="OBJECT",e[e.SHARED=3]="SHARED",e[e.IMMUTABLE=4]="IMMUTABLE",e[e.CONSENSUS_ADDRESS=5]="CONSENSUS_ADDRESS",e})({});var aM=class extends Y{constructor(){super("sui.rpc.v2.Owner",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Owner.OwnerKind",Sc]},{no:2,name:"address",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const av=new aM;let oi=(function(e){return e[e.ARGUMENT_KIND_UNKNOWN=0]="ARGUMENT_KIND_UNKNOWN",e[e.GAS=1]="GAS",e[e.INPUT=2]="INPUT",e[e.RESULT=3]="RESULT",e})({});var iM=class extends Y{constructor(){super("sui.rpc.v2.Argument",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Argument.ArgumentKind",oi]},{no:2,name:"input",kind:"scalar",opt:!0,T:13},{no:3,name:"result",kind:"scalar",opt:!0,T:13},{no:4,name:"subresult",kind:"scalar",opt:!0,T:13}])}};const Or=new iM;let tr=(function(e){return e[e.INPUT_KIND_UNKNOWN=0]="INPUT_KIND_UNKNOWN",e[e.PURE=1]="PURE",e[e.IMMUTABLE_OR_OWNED=2]="IMMUTABLE_OR_OWNED",e[e.SHARED=3]="SHARED",e[e.RECEIVING=4]="RECEIVING",e[e.FUNDS_WITHDRAWAL=5]="FUNDS_WITHDRAWAL",e})({}),oM=(function(e){return e[e.MUTABILITY_UNKNOWN=0]="MUTABILITY_UNKNOWN",e[e.IMMUTABLE=1]="IMMUTABLE",e[e.MUTABLE=2]="MUTABLE",e[e.NON_EXCLUSIVE_WRITE=3]="NON_EXCLUSIVE_WRITE",e})({}),xc=(function(e){return e[e.SOURCE_UNKNOWN=0]="SOURCE_UNKNOWN",e[e.SENDER=1]="SENDER",e[e.SPONSOR=2]="SPONSOR",e[e.SENDER_ALLOWANCE=3]="SENDER_ALLOWANCE",e})({});var cM=class extends Y{constructor(){super("sui.rpc.v2.Input",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Input.InputKind",tr]},{no:2,name:"pure",kind:"scalar",opt:!0,T:12},{no:3,name:"object_id",kind:"scalar",opt:!0,T:9},{no:4,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"digest",kind:"scalar",opt:!0,T:9},{no:6,name:"mutable",kind:"scalar",opt:!0,T:8},{no:7,name:"mutability",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Input.Mutability",oM]},{no:8,name:"funds_withdrawal",kind:"message",T:()=>dM},{no:1e3,name:"literal",kind:"message",T:()=>pn}])}};const lM=new cM;var uM=class extends Y{constructor(){super("sui.rpc.v2.FundsWithdrawal",[{no:1,name:"amount",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:3,name:"source",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.FundsWithdrawal.Source",xc]},{no:4,name:"funder",kind:"scalar",opt:!0,T:9},{no:5,name:"allowance",kind:"scalar",opt:!0,T:9}])}};const dM=new uM;var fM=class extends Y{constructor(){super("google.protobuf.Duration",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}internalJsonWrite(e,t){let s=Ot.from(e.seconds).toNumber();if(s>315576e6||s<-315576e6)throw new Error("Duration value out of range.");let r=e.seconds.toString();if(s===0&&e.nanos<0&&(r="-"+r),e.nanos!==0){let i=Math.abs(e.nanos).toString();i="0".repeat(9-i.length)+i,i.substring(3)==="000000"?i=i.substring(0,3):i.substring(6)==="000"&&(i=i.substring(0,6)),r+="."+i}return r+"s"}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse Duration from JSON "+ga(e)+". Expected string.");let r=e.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);if(r===null)throw new Error("Unable to parse Duration from JSON string. Invalid format.");s||(s=this.create());let[,i,c,u]=r,d=Ot.from(i+c);if(d.toNumber()>315576e6||d.toNumber()<-315576e6)throw new Error("Unable to parse Duration from JSON string. Value out of range.");if(s.seconds=d.toBigInt(),typeof u=="string"){let p=i+u+"0".repeat(9-u.length);s.nanos=parseInt(p)}return s}};const hM=new fM;var pM=class extends Y{constructor(){super("sui.rpc.v2.JwkId",[{no:1,name:"iss",kind:"scalar",opt:!0,T:9},{no:2,name:"kid",kind:"scalar",opt:!0,T:9}])}};const NA=new pM;var mM=class extends Y{constructor(){super("sui.rpc.v2.Jwk",[{no:1,name:"kty",kind:"scalar",opt:!0,T:9},{no:2,name:"e",kind:"scalar",opt:!0,T:9},{no:3,name:"n",kind:"scalar",opt:!0,T:9},{no:4,name:"alg",kind:"scalar",opt:!0,T:9}])}};const gM=new mM;var yM=class extends Y{constructor(){super("sui.rpc.v2.Bcs",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"value",kind:"scalar",opt:!0,T:12}])}};const Es=new yM;var vM=class extends Y{constructor(){super("sui.rpc.v2.Object",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"object_id",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"digest",kind:"scalar",opt:!0,T:9},{no:5,name:"owner",kind:"message",T:()=>av},{no:6,name:"object_type",kind:"scalar",opt:!0,T:9},{no:7,name:"has_public_transfer",kind:"scalar",opt:!0,T:8},{no:8,name:"contents",kind:"message",T:()=>Es},{no:9,name:"package",kind:"message",T:()=>EA},{no:10,name:"previous_transaction",kind:"scalar",opt:!0,T:9},{no:11,name:"storage_rebate",kind:"scalar",opt:!0,T:4,L:0},{no:100,name:"json",kind:"message",T:()=>pn},{no:101,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:102,name:"display",kind:"message",T:()=>TM}])}};const mo=new vM;var bM=class extends Y{constructor(){super("sui.rpc.v2.ObjectSet",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>mo}])}};const xA=new bM;var wM=class extends Y{constructor(){super("sui.rpc.v2.Display",[{no:1,name:"output",kind:"message",T:()=>pn},{no:2,name:"errors",kind:"message",T:()=>pn}])}};const TM=new wM;var SM=class extends Y{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const e=this.create(),t=Date.now();return e.seconds=Ot.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(Ot.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){const t=this.create(),s=e.getTime();return t.seconds=Ot.from(Math.floor(s/1e3)).toBigInt(),t.nanos=(s%1e3+(s<0&&s%1e3!==0?1e3:0))*1e6,t}internalJsonWrite(e,t){let s=Ot.from(e.seconds).toNumber()*1e3;if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(e.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let r="Z";if(e.nanos>0){let i=(e.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(s).toISOString().replace(".000Z",r)}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse Timestamp from JSON "+ga(e)+".");let r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return s||(s=this.create()),s.seconds=Ot.from(i/1e3).toBigInt(),s.nanos=0,r[7]&&(s.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),s}};const Nr=new SM;var EM=class extends Y{constructor(){super("sui.rpc.v2.ObjectReference",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"digest",kind:"scalar",opt:!0,T:9}])}};const CA=new EM;let la=(function(e){return e[e.TRANSACTION_EXPIRATION_KIND_UNKNOWN=0]="TRANSACTION_EXPIRATION_KIND_UNKNOWN",e[e.NONE=1]="NONE",e[e.EPOCH=2]="EPOCH",e[e.VALID_DURING=3]="VALID_DURING",e[e.VALIDITY=4]="VALIDITY",e})({}),_M=(function(e){return e[e.KIND_UNKNOWN=0]="KIND_UNKNOWN",e[e.PROGRAMMABLE_TRANSACTION=1]="PROGRAMMABLE_TRANSACTION",e[e.CHANGE_EPOCH=2]="CHANGE_EPOCH",e[e.GENESIS=3]="GENESIS",e[e.CONSENSUS_COMMIT_PROLOGUE_V1=4]="CONSENSUS_COMMIT_PROLOGUE_V1",e[e.AUTHENTICATOR_STATE_UPDATE=5]="AUTHENTICATOR_STATE_UPDATE",e[e.END_OF_EPOCH=6]="END_OF_EPOCH",e[e.RANDOMNESS_STATE_UPDATE=7]="RANDOMNESS_STATE_UPDATE",e[e.CONSENSUS_COMMIT_PROLOGUE_V2=8]="CONSENSUS_COMMIT_PROLOGUE_V2",e[e.CONSENSUS_COMMIT_PROLOGUE_V3=9]="CONSENSUS_COMMIT_PROLOGUE_V3",e[e.CONSENSUS_COMMIT_PROLOGUE_V4=10]="CONSENSUS_COMMIT_PROLOGUE_V4",e[e.PROGRAMMABLE_SYSTEM_TRANSACTION=11]="PROGRAMMABLE_SYSTEM_TRANSACTION",e})({}),kM=(function(e){return e[e.KIND_UNKNOWN=0]="KIND_UNKNOWN",e[e.CHANGE_EPOCH=1]="CHANGE_EPOCH",e[e.AUTHENTICATOR_STATE_CREATE=2]="AUTHENTICATOR_STATE_CREATE",e[e.AUTHENTICATOR_STATE_EXPIRE=3]="AUTHENTICATOR_STATE_EXPIRE",e[e.RANDOMNESS_STATE_CREATE=4]="RANDOMNESS_STATE_CREATE",e[e.DENY_LIST_STATE_CREATE=5]="DENY_LIST_STATE_CREATE",e[e.BRIDGE_STATE_CREATE=6]="BRIDGE_STATE_CREATE",e[e.BRIDGE_COMMITTEE_INIT=7]="BRIDGE_COMMITTEE_INIT",e[e.STORE_EXECUTION_TIME_OBSERVATIONS=8]="STORE_EXECUTION_TIME_OBSERVATIONS",e[e.ACCUMULATOR_ROOT_CREATE=9]="ACCUMULATOR_ROOT_CREATE",e[e.COIN_REGISTRY_CREATE=10]="COIN_REGISTRY_CREATE",e[e.DISPLAY_REGISTRY_CREATE=11]="DISPLAY_REGISTRY_CREATE",e[e.ADDRESS_ALIAS_STATE_CREATE=12]="ADDRESS_ALIAS_STATE_CREATE",e[e.WRITE_ACCUMULATOR_STORAGE_COST=13]="WRITE_ACCUMULATOR_STORAGE_COST",e})({}),AM=(function(e){return e[e.EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN=0]="EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",e[e.MOVE_ENTRY_POINT=1]="MOVE_ENTRY_POINT",e[e.TRANSFER_OBJECTS=2]="TRANSFER_OBJECTS",e[e.SPLIT_COINS=3]="SPLIT_COINS",e[e.MERGE_COINS=4]="MERGE_COINS",e[e.PUBLISH=5]="PUBLISH",e[e.MAKE_MOVE_VECTOR=6]="MAKE_MOVE_VECTOR",e[e.UPGRADE=7]="UPGRADE",e})({});var OM=class extends Y{constructor(){super("sui.rpc.v2.Transaction",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:5},{no:4,name:"kind",kind:"message",T:()=>DM},{no:5,name:"sender",kind:"scalar",opt:!0,T:9},{no:6,name:"gas_payment",kind:"message",T:()=>xM},{no:7,name:"expiration",kind:"message",T:()=>IM}])}};const fb=new OM;var NM=class extends Y{constructor(){super("sui.rpc.v2.GasPayment",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>CA},{no:2,name:"owner",kind:"scalar",opt:!0,T:9},{no:3,name:"price",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"budget",kind:"scalar",opt:!0,T:4,L:0}])}};const xM=new NM;var CM=class extends Y{constructor(){super("sui.rpc.v2.TransactionExpiration",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TransactionExpiration.TransactionExpirationKind",la]},{no:2,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"min_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"min_timestamp",kind:"message",T:()=>Nr},{no:5,name:"max_timestamp",kind:"message",T:()=>Nr},{no:6,name:"chain",kind:"scalar",opt:!0,T:9},{no:7,name:"nonce",kind:"scalar",opt:!0,T:13},{no:8,name:"allowed_proposers",kind:"message",T:()=>jM}])}};const IM=new CM;var RM=class extends Y{constructor(){super("sui.rpc.v2.AllowedProposers",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"proposers",kind:"scalar",repeat:1,T:13}])}};const jM=new RM;var MM=class extends Y{constructor(){super("sui.rpc.v2.TransactionKind",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TransactionKind.Kind",_M]},{no:2,name:"programmable_transaction",kind:"message",oneof:"data",T:()=>BM},{no:3,name:"change_epoch",kind:"message",oneof:"data",T:()=>RA},{no:4,name:"genesis",kind:"message",oneof:"data",T:()=>a9},{no:5,name:"consensus_commit_prologue",kind:"message",oneof:"data",T:()=>o9},{no:6,name:"authenticator_state_update",kind:"message",oneof:"data",T:()=>m9},{no:7,name:"end_of_epoch",kind:"message",oneof:"data",T:()=>v9},{no:8,name:"randomness_state_update",kind:"message",oneof:"data",T:()=>e9}])}};const DM=new MM;var UM=class extends Y{constructor(){super("sui.rpc.v2.ProgrammableTransaction",[{no:1,name:"inputs",kind:"message",repeat:2,T:()=>lM},{no:2,name:"commands",kind:"message",repeat:2,T:()=>zM}])}};const BM=new UM;var LM=class extends Y{constructor(){super("sui.rpc.v2.Command",[{no:1,name:"move_call",kind:"message",oneof:"command",T:()=>IA},{no:2,name:"transfer_objects",kind:"message",oneof:"command",T:()=>PM},{no:3,name:"split_coins",kind:"message",oneof:"command",T:()=>FM},{no:4,name:"merge_coins",kind:"message",oneof:"command",T:()=>qM},{no:5,name:"publish",kind:"message",oneof:"command",T:()=>YM},{no:6,name:"make_move_vector",kind:"message",oneof:"command",T:()=>XM},{no:7,name:"upgrade",kind:"message",oneof:"command",T:()=>JM}])}};const zM=new LM;var $M=class extends Y{constructor(){super("sui.rpc.v2.MoveCall",[{no:1,name:"package",kind:"scalar",opt:!0,T:9},{no:2,name:"module",kind:"scalar",opt:!0,T:9},{no:3,name:"function",kind:"scalar",opt:!0,T:9},{no:4,name:"type_arguments",kind:"scalar",repeat:2,T:9},{no:5,name:"arguments",kind:"message",repeat:2,T:()=>Or}])}};const IA=new $M;var VM=class extends Y{constructor(){super("sui.rpc.v2.TransferObjects",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>Or},{no:2,name:"address",kind:"message",T:()=>Or}])}};const PM=new VM;var GM=class extends Y{constructor(){super("sui.rpc.v2.SplitCoins",[{no:1,name:"coin",kind:"message",T:()=>Or},{no:2,name:"amounts",kind:"message",repeat:2,T:()=>Or}])}};const FM=new GM;var HM=class extends Y{constructor(){super("sui.rpc.v2.MergeCoins",[{no:1,name:"coin",kind:"message",T:()=>Or},{no:2,name:"coins_to_merge",kind:"message",repeat:2,T:()=>Or}])}};const qM=new HM;var ZM=class extends Y{constructor(){super("sui.rpc.v2.Publish",[{no:1,name:"modules",kind:"scalar",repeat:2,T:12},{no:2,name:"dependencies",kind:"scalar",repeat:2,T:9}])}};const YM=new ZM;var WM=class extends Y{constructor(){super("sui.rpc.v2.MakeMoveVector",[{no:1,name:"element_type",kind:"scalar",opt:!0,T:9},{no:2,name:"elements",kind:"message",repeat:2,T:()=>Or}])}};const XM=new WM;var KM=class extends Y{constructor(){super("sui.rpc.v2.Upgrade",[{no:1,name:"modules",kind:"scalar",repeat:2,T:12},{no:2,name:"dependencies",kind:"scalar",repeat:2,T:9},{no:3,name:"package",kind:"scalar",opt:!0,T:9},{no:4,name:"ticket",kind:"message",T:()=>Or}])}};const JM=new KM;var QM=class extends Y{constructor(){super("sui.rpc.v2.RandomnessStateUpdate",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"randomness_round",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"random_bytes",kind:"scalar",opt:!0,T:12},{no:4,name:"randomness_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const e9=new QM;var t9=class extends Y{constructor(){super("sui.rpc.v2.ChangeEpoch",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"storage_charge",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"computation_charge",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"storage_rebate",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"non_refundable_storage_fee",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"epoch_start_timestamp",kind:"message",T:()=>Nr},{no:8,name:"system_packages",kind:"message",repeat:2,T:()=>s9}])}};const RA=new t9;var n9=class extends Y{constructor(){super("sui.rpc.v2.SystemPackage",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"modules",kind:"scalar",repeat:2,T:12},{no:3,name:"dependencies",kind:"scalar",repeat:2,T:9}])}};const s9=new n9;var r9=class extends Y{constructor(){super("sui.rpc.v2.GenesisTransaction",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>mo}])}};const a9=new r9;var i9=class extends Y{constructor(){super("sui.rpc.v2.ConsensusCommitPrologue",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"round",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"commit_timestamp",kind:"message",T:()=>Nr},{no:4,name:"consensus_commit_digest",kind:"scalar",opt:!0,T:9},{no:5,name:"sub_dag_index",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"consensus_determined_version_assignments",kind:"message",T:()=>h9},{no:7,name:"additional_state_digest",kind:"scalar",opt:!0,T:9}])}};const o9=new i9;var c9=class extends Y{constructor(){super("sui.rpc.v2.VersionAssignment",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"start_version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const l9=new c9;var u9=class extends Y{constructor(){super("sui.rpc.v2.CanceledTransaction",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"version_assignments",kind:"message",repeat:2,T:()=>l9}])}};const d9=new u9;var f9=class extends Y{constructor(){super("sui.rpc.v2.ConsensusDeterminedVersionAssignments",[{no:1,name:"version",kind:"scalar",opt:!0,T:5},{no:3,name:"canceled_transactions",kind:"message",repeat:2,T:()=>d9}])}};const h9=new f9;var p9=class extends Y{constructor(){super("sui.rpc.v2.AuthenticatorStateUpdate",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"round",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"new_active_jwks",kind:"message",repeat:2,T:()=>jA},{no:4,name:"authenticator_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const m9=new p9;var g9=class extends Y{constructor(){super("sui.rpc.v2.ActiveJwk",[{no:1,name:"id",kind:"message",T:()=>NA},{no:2,name:"jwk",kind:"message",T:()=>gM},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0}])}};const jA=new g9;var y9=class extends Y{constructor(){super("sui.rpc.v2.EndOfEpochTransaction",[{no:1,name:"transactions",kind:"message",repeat:2,T:()=>w9}])}};const v9=new y9;var b9=class extends Y{constructor(){super("sui.rpc.v2.EndOfEpochTransactionKind",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.EndOfEpochTransactionKind.Kind",kM]},{no:2,name:"change_epoch",kind:"message",oneof:"data",T:()=>RA},{no:3,name:"authenticator_state_expire",kind:"message",oneof:"data",T:()=>S9},{no:4,name:"execution_time_observations",kind:"message",oneof:"data",T:()=>_9},{no:5,name:"bridge_chain_id",kind:"scalar",oneof:"data",T:9},{no:6,name:"bridge_object_version",kind:"scalar",oneof:"data",T:4,L:0},{no:7,name:"storage_cost",kind:"scalar",oneof:"data",T:4,L:0}])}};const w9=new b9;var T9=class extends Y{constructor(){super("sui.rpc.v2.AuthenticatorStateExpire",[{no:1,name:"min_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"authenticator_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const S9=new T9;var E9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionTimeObservations",[{no:1,name:"version",kind:"scalar",opt:!0,T:5},{no:2,name:"observations",kind:"message",repeat:2,T:()=>A9}])}};const _9=new E9;var k9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionTimeObservation",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ExecutionTimeObservation.ExecutionTimeObservationKind",AM]},{no:2,name:"move_entry_point",kind:"message",T:()=>IA},{no:3,name:"validator_observations",kind:"message",repeat:2,T:()=>N9}])}};const A9=new k9;var O9=class extends Y{constructor(){super("sui.rpc.v2.ValidatorExecutionTimeObservation",[{no:1,name:"validator",kind:"scalar",opt:!0,T:12},{no:2,name:"duration",kind:"message",T:()=>hM}])}};const N9=new O9;function VE(e){const t=BigInt(e);return{seconds:t/1000n,nanos:Number(t%1000n)*1e6}}function Xf(e){return(e.seconds*1000n+BigInt(Math.floor(e.nanos/1e6))).toString()}function x9(e){switch(e.$kind){case"Pure":return{kind:tr.PURE,pure:Ge(e.Pure.bytes)};case"Object":if(e.Object.$kind==="ImmOrOwnedObject")return{kind:tr.IMMUTABLE_OR_OWNED,objectId:e.Object.ImmOrOwnedObject.objectId,version:BigInt(e.Object.ImmOrOwnedObject.version),digest:e.Object.ImmOrOwnedObject.digest};if(e.Object.$kind==="SharedObject")return{kind:tr.SHARED,objectId:e.Object.SharedObject.objectId,version:BigInt(e.Object.SharedObject.initialSharedVersion),mutable:e.Object.SharedObject.mutable};if(e.Object.$kind==="Receiving")return{kind:tr.RECEIVING,objectId:e.Object.Receiving.objectId,version:BigInt(e.Object.Receiving.version),digest:e.Object.Receiving.digest};throw new Error(`Unknown Object kind: ${JSON.stringify(e.Object)}`);case"UnresolvedObject":const t=e.UnresolvedObject;return{objectId:t.objectId,version:t.version?BigInt(t.version):t.initialSharedVersion?BigInt(t.initialSharedVersion):void 0,digest:t.digest??void 0,mutable:t.mutable??void 0};case"UnresolvedPure":throw new Error("UnresolvedPure arguments must be resolved before converting to gRPC format");case"FundsWithdrawal":{const s=e.FundsWithdrawal;return{kind:tr.FUNDS_WITHDRAWAL,fundsWithdrawal:{amount:s.reservation.$kind==="MaxAmountU64"?BigInt(s.reservation.MaxAmountU64):void 0,coinType:s.typeArg.$kind==="Balance"?s.typeArg.Balance:void 0,...C9(s.withdrawFrom)}}}default:throw new Error(`Unknown CallArg kind: ${JSON.stringify(e)}`)}}function C9(e){switch(e.$kind){case"Sender":return{source:xc.SENDER};case"Sponsor":return{source:xc.SPONSOR};case"SenderAllowance":return{source:xc.SENDER_ALLOWANCE,funder:e.SenderAllowance.funder,allowance:e.SenderAllowance.allowance};default:throw new Error(`Unknown WithdrawFrom kind: ${JSON.stringify(e)}`)}}function I9(e){switch(e?.source){case xc.SPONSOR:return{$kind:"Sponsor",Sponsor:!0};case xc.SENDER_ALLOWANCE:if(!e.funder||!e.allowance)throw new Error(`SENDER_ALLOWANCE withdrawal is missing funder or allowance: ${JSON.stringify(e)}`);return{$kind:"SenderAllowance",SenderAllowance:{funder:e.funder,allowance:e.allowance}};default:return{$kind:"Sender",Sender:!0}}}function Jr(e){if("GasCoin"in e)return{kind:oi.GAS};if("Input"in e)return{kind:oi.INPUT,input:e.Input};if("Result"in e)return{kind:oi.RESULT,result:e.Result};if("NestedResult"in e)return{kind:oi.RESULT,result:e.NestedResult[0],subresult:e.NestedResult[1]};throw new Error(`Unknown Argument: ${JSON.stringify(e)}`)}function R9(e){switch(e.$kind){case"MoveCall":return{command:{oneofKind:"moveCall",moveCall:{package:e.MoveCall.package,module:e.MoveCall.module,function:e.MoveCall.function,typeArguments:e.MoveCall.typeArguments,arguments:e.MoveCall.arguments.map(Jr)}}};case"TransferObjects":return{command:{oneofKind:"transferObjects",transferObjects:{objects:e.TransferObjects.objects.map(Jr),address:Jr(e.TransferObjects.address)}}};case"SplitCoins":return{command:{oneofKind:"splitCoins",splitCoins:{coin:Jr(e.SplitCoins.coin),amounts:e.SplitCoins.amounts.map(Jr)}}};case"MergeCoins":return{command:{oneofKind:"mergeCoins",mergeCoins:{coin:Jr(e.MergeCoins.destination),coinsToMerge:e.MergeCoins.sources.map(Jr)}}};case"Publish":return{command:{oneofKind:"publish",publish:{modules:e.Publish.modules.map(t=>Ge(t)),dependencies:e.Publish.dependencies}}};case"MakeMoveVec":return{command:{oneofKind:"makeMoveVector",makeMoveVector:{elementType:e.MakeMoveVec.type??void 0,elements:e.MakeMoveVec.elements.map(Jr)}}};case"Upgrade":return{command:{oneofKind:"upgrade",upgrade:{modules:e.Upgrade.modules.map(t=>Ge(t)),dependencies:e.Upgrade.dependencies,package:e.Upgrade.package,ticket:Jr(e.Upgrade.ticket)}}};default:throw new Error(`Unknown Command kind: ${JSON.stringify(e)}`)}}function MA(e){const t={version:1,kind:{data:{oneofKind:"programmableTransaction",programmableTransaction:{inputs:e.inputs.map(x9),commands:e.commands.map(R9)}}}};e.sender&&(t.sender=e.sender);const s=e.gasData.owner??e.sender;if(t.gasPayment={objects:e.gasData.payment?e.gasData.payment.map(r=>({objectId:r.objectId,version:BigInt(r.version),digest:r.digest})):[],price:e.gasData.price?BigInt(e.gasData.price):void 0,budget:e.gasData.budget?BigInt(e.gasData.budget):void 0},s&&(t.gasPayment.owner=s),e.expiration){if("None"in e.expiration)t.expiration={kind:la.NONE};else if(e.expiration.$kind==="Epoch")t.expiration={kind:la.EPOCH,epoch:BigInt(e.expiration.Epoch)};else if(e.expiration.$kind==="ValidDuring"||e.expiration.$kind==="Validity"){const r=e.expiration.$kind==="ValidDuring"?e.expiration.ValidDuring:e.expiration.Validity,i=e.expiration.$kind==="Validity"?e.expiration.Validity.allowedProposers:null;t.expiration={kind:e.expiration.$kind==="ValidDuring"?la.VALID_DURING:la.VALIDITY,minEpoch:r.minEpoch!=null?BigInt(r.minEpoch):void 0,epoch:r.maxEpoch!=null?BigInt(r.maxEpoch):void 0,minTimestamp:r.minTimestamp!=null?VE(r.minTimestamp):void 0,maxTimestamp:r.maxTimestamp!=null?VE(r.maxTimestamp):void 0,chain:r.chain,nonce:r.nonce,allowedProposers:i?{epoch:BigInt(i.epoch),proposers:ik(i.proposers)}:void 0}}}return t}function j9(e,t,s){const r=DA(t);s?.onlyTransactionKind?e.applyResolvedData({...r,sender:null,gasData:{budget:null,owner:null,payment:null,price:null},expiration:null}):e.applyResolvedData(r)}function M9(e){const t=e.getData();return t.sender||(t.sender="0x0000000000000000000000000000000000000000000000000000000000000000"),MA(t)}function D9(e){switch(e.kind){case tr.PURE:return{$kind:"Pure",Pure:{bytes:Ke(e.pure)}};case tr.IMMUTABLE_OR_OWNED:return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{objectId:e.objectId,version:e.version.toString(),digest:e.digest}}};case tr.SHARED:return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{objectId:e.objectId,initialSharedVersion:e.version.toString(),mutable:e.mutable??!1}}};case tr.RECEIVING:return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{objectId:e.objectId,version:e.version.toString(),digest:e.digest}}};case tr.FUNDS_WITHDRAWAL:return{$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:{$kind:"MaxAmountU64",MaxAmountU64:e.fundsWithdrawal?.amount?.toString()??"0"},typeArg:{$kind:"Balance",Balance:e.fundsWithdrawal?.coinType??"0x2::sui::SUI"},withdrawFrom:I9(e.fundsWithdrawal)}};default:throw new Error(`Unknown Input kind: ${JSON.stringify(e)}`)}}function Qr(e){switch(e.kind){case oi.GAS:return{$kind:"GasCoin",GasCoin:!0};case oi.INPUT:return{$kind:"Input",Input:e.input};case oi.RESULT:return e.subresult!=null?{$kind:"NestedResult",NestedResult:[e.result,e.subresult]}:{$kind:"Result",Result:e.result};default:throw new Error(`Unknown Argument kind: ${JSON.stringify(e)}`)}}function U9(e){const t=e.command;if(!t)throw new Error("Command is missing");switch(t.oneofKind){case"moveCall":return{$kind:"MoveCall",MoveCall:{package:t.moveCall.package,module:t.moveCall.module,function:t.moveCall.function,typeArguments:t.moveCall.typeArguments??[],arguments:t.moveCall.arguments.map(Qr)}};case"transferObjects":return{$kind:"TransferObjects",TransferObjects:{objects:t.transferObjects.objects.map(Qr),address:Qr(t.transferObjects.address)}};case"splitCoins":return{$kind:"SplitCoins",SplitCoins:{coin:Qr(t.splitCoins.coin),amounts:t.splitCoins.amounts.map(Qr)}};case"mergeCoins":return{$kind:"MergeCoins",MergeCoins:{destination:Qr(t.mergeCoins.coin),sources:t.mergeCoins.coinsToMerge.map(Qr)}};case"publish":return{$kind:"Publish",Publish:{modules:t.publish.modules.map(s=>Ke(s)),dependencies:t.publish.dependencies??[]}};case"makeMoveVector":return{$kind:"MakeMoveVec",MakeMoveVec:{type:t.makeMoveVector.elementType??null,elements:t.makeMoveVector.elements.map(Qr)}};case"upgrade":return{$kind:"Upgrade",Upgrade:{modules:t.upgrade.modules.map(s=>Ke(s)),dependencies:t.upgrade.dependencies??[],package:t.upgrade.package,ticket:Qr(t.upgrade.ticket)}};default:throw new Error(`Unknown Command kind: ${JSON.stringify(t)}`)}}function DA(e){const t=e.kind?.data;if(t?.oneofKind!=="programmableTransaction")throw new Error("Only programmable transactions are supported");const s=t.programmableTransaction.inputs.map(D9),r=t.programmableTransaction.commands.map(U9);let i=null;if(e.expiration)switch(e.expiration.kind){case la.NONE:i={$kind:"None",None:!0};break;case la.EPOCH:i={$kind:"Epoch",Epoch:e.expiration.epoch.toString()};break;case la.VALID_DURING:i={$kind:"ValidDuring",ValidDuring:{minEpoch:e.expiration.minEpoch?.toString()??null,maxEpoch:e.expiration.epoch?.toString()??null,minTimestamp:e.expiration.minTimestamp?Xf(e.expiration.minTimestamp):null,maxTimestamp:e.expiration.maxTimestamp?Xf(e.expiration.maxTimestamp):null,chain:e.expiration.chain??"",nonce:e.expiration.nonce??0}};break;case la.VALIDITY:i={$kind:"Validity",Validity:{minEpoch:e.expiration.minEpoch?.toString()??null,maxEpoch:e.expiration.epoch?.toString()??null,minTimestamp:e.expiration.minTimestamp?Xf(e.expiration.minTimestamp):null,maxTimestamp:e.expiration.maxTimestamp?Xf(e.expiration.maxTimestamp):null,chain:e.expiration.chain??"",nonce:e.expiration.nonce??0,allowedProposers:e.expiration.allowedProposers?{epoch:e.expiration.allowedProposers.epoch?.toString()??"0",proposers:zv(e.expiration.allowedProposers.proposers)}:null}};break;default:throw new Error(`Unknown transaction expiration kind: ${e.expiration.kind}`)}return{version:2,sender:e.sender??null,expiration:i,gasData:{budget:e.gasPayment?.budget?.toString()??null,owner:e.gasPayment?.owner??null,payment:e.gasPayment?.objects?.map(c=>({objectId:c.objectId,version:c.version.toString(),digest:c.digest}))??null,price:e.gasPayment?.price?.toString()??null},inputs:s,commands:r}}async function B9({transactionData:e,client:t,epoch:s,originalTransactionData:r,isTransactionKindOnly:i,doGasSelection:c}){if(i||c||r.expiration||r.gasData.payment?.length!==0||e.expiration&&e.expiration.$kind!=="None")return;const[{chainIdentifier:u},d]=await Promise.all([t.core.getChainIdentifier(),s==null?t.core.getCurrentSystemState():null]),p=BigInt(s??d.systemState.epoch);e.expiration={$kind:"ValidDuring",ValidDuring:{minEpoch:String(p),maxEpoch:String(p+1n),minTimestamp:null,maxTimestamp:null,chain:u,nonce:Math.random()*4294967296>>>0}}}let L9=(function(e){return e[e.EXECUTION_ERROR_KIND_UNKNOWN=0]="EXECUTION_ERROR_KIND_UNKNOWN",e[e.INSUFFICIENT_GAS=1]="INSUFFICIENT_GAS",e[e.INVALID_GAS_OBJECT=2]="INVALID_GAS_OBJECT",e[e.INVARIANT_VIOLATION=3]="INVARIANT_VIOLATION",e[e.FEATURE_NOT_YET_SUPPORTED=4]="FEATURE_NOT_YET_SUPPORTED",e[e.OBJECT_TOO_BIG=5]="OBJECT_TOO_BIG",e[e.PACKAGE_TOO_BIG=6]="PACKAGE_TOO_BIG",e[e.CIRCULAR_OBJECT_OWNERSHIP=7]="CIRCULAR_OBJECT_OWNERSHIP",e[e.INSUFFICIENT_COIN_BALANCE=8]="INSUFFICIENT_COIN_BALANCE",e[e.COIN_BALANCE_OVERFLOW=9]="COIN_BALANCE_OVERFLOW",e[e.PUBLISH_ERROR_NON_ZERO_ADDRESS=10]="PUBLISH_ERROR_NON_ZERO_ADDRESS",e[e.SUI_MOVE_VERIFICATION_ERROR=11]="SUI_MOVE_VERIFICATION_ERROR",e[e.MOVE_PRIMITIVE_RUNTIME_ERROR=12]="MOVE_PRIMITIVE_RUNTIME_ERROR",e[e.MOVE_ABORT=13]="MOVE_ABORT",e[e.VM_VERIFICATION_OR_DESERIALIZATION_ERROR=14]="VM_VERIFICATION_OR_DESERIALIZATION_ERROR",e[e.VM_INVARIANT_VIOLATION=15]="VM_INVARIANT_VIOLATION",e[e.FUNCTION_NOT_FOUND=16]="FUNCTION_NOT_FOUND",e[e.ARITY_MISMATCH=17]="ARITY_MISMATCH",e[e.TYPE_ARITY_MISMATCH=18]="TYPE_ARITY_MISMATCH",e[e.NON_ENTRY_FUNCTION_INVOKED=19]="NON_ENTRY_FUNCTION_INVOKED",e[e.COMMAND_ARGUMENT_ERROR=20]="COMMAND_ARGUMENT_ERROR",e[e.TYPE_ARGUMENT_ERROR=21]="TYPE_ARGUMENT_ERROR",e[e.UNUSED_VALUE_WITHOUT_DROP=22]="UNUSED_VALUE_WITHOUT_DROP",e[e.INVALID_PUBLIC_FUNCTION_RETURN_TYPE=23]="INVALID_PUBLIC_FUNCTION_RETURN_TYPE",e[e.INVALID_TRANSFER_OBJECT=24]="INVALID_TRANSFER_OBJECT",e[e.EFFECTS_TOO_LARGE=25]="EFFECTS_TOO_LARGE",e[e.PUBLISH_UPGRADE_MISSING_DEPENDENCY=26]="PUBLISH_UPGRADE_MISSING_DEPENDENCY",e[e.PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE=27]="PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE",e[e.PACKAGE_UPGRADE_ERROR=28]="PACKAGE_UPGRADE_ERROR",e[e.WRITTEN_OBJECTS_TOO_LARGE=29]="WRITTEN_OBJECTS_TOO_LARGE",e[e.CERTIFICATE_DENIED=30]="CERTIFICATE_DENIED",e[e.SUI_MOVE_VERIFICATION_TIMEDOUT=31]="SUI_MOVE_VERIFICATION_TIMEDOUT",e[e.CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED=32]="CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED",e[e.INPUT_OBJECT_DELETED=33]="INPUT_OBJECT_DELETED",e[e.EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION=34]="EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION",e[e.ADDRESS_DENIED_FOR_COIN=35]="ADDRESS_DENIED_FOR_COIN",e[e.COIN_TYPE_GLOBAL_PAUSE=36]="COIN_TYPE_GLOBAL_PAUSE",e[e.EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE=37]="EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE",e[e.MOVE_VECTOR_ELEM_TOO_BIG=38]="MOVE_VECTOR_ELEM_TOO_BIG",e[e.MOVE_RAW_VALUE_TOO_BIG=39]="MOVE_RAW_VALUE_TOO_BIG",e[e.INVALID_LINKAGE=40]="INVALID_LINKAGE",e[e.INSUFFICIENT_FUNDS_FOR_WITHDRAW=41]="INSUFFICIENT_FUNDS_FOR_WITHDRAW",e[e.NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED=42]="NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED",e})({}),UA=(function(e){return e[e.COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN=0]="COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",e[e.TYPE_MISMATCH=1]="TYPE_MISMATCH",e[e.INVALID_BCS_BYTES=2]="INVALID_BCS_BYTES",e[e.INVALID_USAGE_OF_PURE_ARGUMENT=3]="INVALID_USAGE_OF_PURE_ARGUMENT",e[e.INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION=4]="INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION",e[e.INDEX_OUT_OF_BOUNDS=5]="INDEX_OUT_OF_BOUNDS",e[e.SECONDARY_INDEX_OUT_OF_BOUNDS=6]="SECONDARY_INDEX_OUT_OF_BOUNDS",e[e.INVALID_RESULT_ARITY=7]="INVALID_RESULT_ARITY",e[e.INVALID_GAS_COIN_USAGE=8]="INVALID_GAS_COIN_USAGE",e[e.INVALID_VALUE_USAGE=9]="INVALID_VALUE_USAGE",e[e.INVALID_OBJECT_BY_VALUE=10]="INVALID_OBJECT_BY_VALUE",e[e.INVALID_OBJECT_BY_MUT_REF=11]="INVALID_OBJECT_BY_MUT_REF",e[e.CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED=12]="CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED",e[e.INVALID_ARGUMENT_ARITY=13]="INVALID_ARGUMENT_ARITY",e[e.INVALID_TRANSFER_OBJECT=14]="INVALID_TRANSFER_OBJECT",e[e.INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT=15]="INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT",e[e.ARGUMENT_WITHOUT_VALUE=16]="ARGUMENT_WITHOUT_VALUE",e[e.CANNOT_MOVE_BORROWED_VALUE=17]="CANNOT_MOVE_BORROWED_VALUE",e[e.CANNOT_WRITE_TO_EXTENDED_REFERENCE=18]="CANNOT_WRITE_TO_EXTENDED_REFERENCE",e[e.INVALID_REFERENCE_ARGUMENT=19]="INVALID_REFERENCE_ARGUMENT",e[e.INVALID_TX_CONTEXT=20]="INVALID_TX_CONTEXT",e})({}),z9=(function(e){return e[e.PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN=0]="PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",e[e.UNABLE_TO_FETCH_PACKAGE=1]="UNABLE_TO_FETCH_PACKAGE",e[e.NOT_A_PACKAGE=2]="NOT_A_PACKAGE",e[e.INCOMPATIBLE_UPGRADE=3]="INCOMPATIBLE_UPGRADE",e[e.DIGEST_DOES_NOT_MATCH=4]="DIGEST_DOES_NOT_MATCH",e[e.UNKNOWN_UPGRADE_POLICY=5]="UNKNOWN_UPGRADE_POLICY",e[e.PACKAGE_ID_DOES_NOT_MATCH=6]="PACKAGE_ID_DOES_NOT_MATCH",e})({}),$9=(function(e){return e[e.TYPE_ARGUMENT_ERROR_KIND_UNKNOWN=0]="TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",e[e.TYPE_NOT_FOUND=1]="TYPE_NOT_FOUND",e[e.CONSTRAINT_NOT_SATISFIED=2]="CONSTRAINT_NOT_SATISFIED",e})({});var V9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionStatus",[{no:1,name:"success",kind:"scalar",opt:!0,T:8},{no:2,name:"error",kind:"message",T:()=>F9}])}};const P9=new V9;var G9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionError",[{no:1,name:"description",kind:"scalar",opt:!0,T:9},{no:2,name:"command",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ExecutionError.ExecutionErrorKind",L9]},{no:4,name:"abort",kind:"message",oneof:"errorDetails",T:()=>q9},{no:5,name:"size_error",kind:"message",oneof:"errorDetails",T:()=>J9},{no:6,name:"command_argument_error",kind:"message",oneof:"errorDetails",T:()=>aD},{no:7,name:"type_argument_error",kind:"message",oneof:"errorDetails",T:()=>lD},{no:8,name:"package_upgrade_error",kind:"message",oneof:"errorDetails",T:()=>oD},{no:9,name:"index_error",kind:"message",oneof:"errorDetails",T:()=>BA},{no:10,name:"object_id",kind:"scalar",oneof:"errorDetails",T:9},{no:11,name:"coin_deny_list_error",kind:"message",oneof:"errorDetails",T:()=>tD},{no:12,name:"congested_objects",kind:"message",oneof:"errorDetails",T:()=>sD}])}};const F9=new G9;var H9=class extends Y{constructor(){super("sui.rpc.v2.MoveAbort",[{no:1,name:"abort_code",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"location",kind:"message",T:()=>Y9},{no:3,name:"clever_error",kind:"message",T:()=>X9}])}};const q9=new H9;var Z9=class extends Y{constructor(){super("sui.rpc.v2.MoveLocation",[{no:1,name:"package",kind:"scalar",opt:!0,T:9},{no:2,name:"module",kind:"scalar",opt:!0,T:9},{no:3,name:"function",kind:"scalar",opt:!0,T:13},{no:4,name:"instruction",kind:"scalar",opt:!0,T:13},{no:5,name:"function_name",kind:"scalar",opt:!0,T:9}])}};const Y9=new Z9;var W9=class extends Y{constructor(){super("sui.rpc.v2.CleverError",[{no:1,name:"error_code",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"line_number",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"constant_name",kind:"scalar",opt:!0,T:9},{no:4,name:"constant_type",kind:"scalar",opt:!0,T:9},{no:5,name:"rendered",kind:"scalar",oneof:"value",T:9},{no:6,name:"raw",kind:"scalar",oneof:"value",T:12}])}};const X9=new W9;var K9=class extends Y{constructor(){super("sui.rpc.v2.SizeError",[{no:1,name:"size",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"max_size",kind:"scalar",opt:!0,T:4,L:0}])}};const J9=new K9;var Q9=class extends Y{constructor(){super("sui.rpc.v2.IndexError",[{no:1,name:"index",kind:"scalar",opt:!0,T:13},{no:2,name:"subresult",kind:"scalar",opt:!0,T:13}])}};const BA=new Q9;var eD=class extends Y{constructor(){super("sui.rpc.v2.CoinDenyListError",[{no:1,name:"address",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const tD=new eD;var nD=class extends Y{constructor(){super("sui.rpc.v2.CongestedObjects",[{no:1,name:"objects",kind:"scalar",repeat:2,T:9}])}};const sD=new nD;var rD=class extends Y{constructor(){super("sui.rpc.v2.CommandArgumentError",[{no:1,name:"argument",kind:"scalar",opt:!0,T:13},{no:2,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CommandArgumentError.CommandArgumentErrorKind",UA]},{no:3,name:"index_error",kind:"message",T:()=>BA}])}};const aD=new rD;var iD=class extends Y{constructor(){super("sui.rpc.v2.PackageUpgradeError",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.PackageUpgradeError.PackageUpgradeErrorKind",z9]},{no:2,name:"package_id",kind:"scalar",opt:!0,T:9},{no:3,name:"digest",kind:"scalar",opt:!0,T:9},{no:4,name:"policy",kind:"scalar",opt:!0,T:13},{no:5,name:"ticket_id",kind:"scalar",opt:!0,T:9}])}};const oD=new iD;var cD=class extends Y{constructor(){super("sui.rpc.v2.TypeArgumentError",[{no:1,name:"type_argument",kind:"scalar",opt:!0,T:13},{no:2,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TypeArgumentError.TypeArgumentErrorKind",$9]}])}};const lD=new cD;var uD=class extends Y{constructor(){super("sui.rpc.v2.GasCostSummary",[{no:1,name:"computation_cost",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"storage_cost",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"storage_rebate",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"non_refundable_storage_fee",kind:"scalar",opt:!0,T:4,L:0}])}};const LA=new uD;let _h=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.DOES_NOT_EXIST=1]="DOES_NOT_EXIST",e[e.EXISTS=2]="EXISTS",e})({}),Ec=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.DOES_NOT_EXIST=1]="DOES_NOT_EXIST",e[e.OBJECT_WRITE=2]="OBJECT_WRITE",e[e.PACKAGE_WRITE=3]="PACKAGE_WRITE",e[e.ACCUMULATOR_WRITE=4]="ACCUMULATOR_WRITE",e})({}),Au=(function(e){return e[e.ID_OPERATION_UNKNOWN=0]="ID_OPERATION_UNKNOWN",e[e.NONE=1]="NONE",e[e.CREATED=2]="CREATED",e[e.DELETED=3]="DELETED",e})({}),dD=(function(e){return e[e.ACCUMULATOR_OPERATION_UNKNOWN=0]="ACCUMULATOR_OPERATION_UNKNOWN",e[e.MERGE=1]="MERGE",e[e.SPLIT=2]="SPLIT",e})({}),fD=(function(e){return e[e.ACCUMULATOR_VALUE_UNKNOWN=0]="ACCUMULATOR_VALUE_UNKNOWN",e[e.INTEGER=1]="INTEGER",e[e.INTEGER_TUPLE=2]="INTEGER_TUPLE",e[e.EVENT_DIGEST=3]="EVENT_DIGEST",e})({}),Ki=(function(e){return e[e.UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN=0]="UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",e[e.READ_ONLY_ROOT=1]="READ_ONLY_ROOT",e[e.MUTATE_CONSENSUS_STREAM_ENDED=2]="MUTATE_CONSENSUS_STREAM_ENDED",e[e.READ_CONSENSUS_STREAM_ENDED=3]="READ_CONSENSUS_STREAM_ENDED",e[e.CANCELED=4]="CANCELED",e[e.PER_EPOCH_CONFIG=5]="PER_EPOCH_CONFIG",e})({});var hD=class extends Y{constructor(){super("sui.rpc.v2.TransactionEffects",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:5},{no:4,name:"status",kind:"message",T:()=>P9},{no:5,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"gas_used",kind:"message",T:()=>LA},{no:7,name:"transaction_digest",kind:"scalar",opt:!0,T:9},{no:8,name:"gas_object",kind:"message",T:()=>PE},{no:9,name:"events_digest",kind:"scalar",opt:!0,T:9},{no:10,name:"dependencies",kind:"scalar",repeat:2,T:9},{no:11,name:"lamport_version",kind:"scalar",opt:!0,T:4,L:0},{no:12,name:"changed_objects",kind:"message",repeat:2,T:()=>PE},{no:13,name:"unchanged_consensus_objects",kind:"message",repeat:2,T:()=>TD},{no:14,name:"auxiliary_data_digest",kind:"scalar",opt:!0,T:9},{no:15,name:"unchanged_loaded_runtime_objects",kind:"message",repeat:2,T:()=>CA}])}};const pD=new hD;var mD=class extends Y{constructor(){super("sui.rpc.v2.ChangedObject",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"input_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.InputObjectState",_h,"INPUT_OBJECT_STATE_"]},{no:3,name:"input_version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"input_digest",kind:"scalar",opt:!0,T:9},{no:5,name:"input_owner",kind:"message",T:()=>av},{no:6,name:"output_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.OutputObjectState",Ec,"OUTPUT_OBJECT_STATE_"]},{no:7,name:"output_version",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"output_digest",kind:"scalar",opt:!0,T:9},{no:9,name:"output_owner",kind:"message",T:()=>av},{no:12,name:"accumulator_write",kind:"message",T:()=>bD},{no:10,name:"id_operation",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.IdOperation",Au]},{no:11,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const PE=new mD;var gD=class extends Y{constructor(){super("sui.rpc.v2.EventDigestEntry",[{no:1,name:"event_index",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"digest",kind:"scalar",opt:!0,T:9}])}};const yD=new gD;var vD=class extends Y{constructor(){super("sui.rpc.v2.AccumulatorWrite",[{no:1,name:"address",kind:"scalar",opt:!0,T:9},{no:2,name:"accumulator_type",kind:"scalar",opt:!0,T:9},{no:3,name:"operation",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.AccumulatorWrite.AccumulatorOperation",dD]},{no:4,name:"value_kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.AccumulatorWrite.AccumulatorValue",fD]},{no:5,name:"integer_value",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"integer_tuple",kind:"scalar",repeat:1,T:4,L:0},{no:7,name:"event_digest_value",kind:"message",repeat:2,T:()=>yD}])}};const bD=new vD;var wD=class extends Y{constructor(){super("sui.rpc.v2.UnchangedConsensusObject",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.UnchangedConsensusObject.UnchangedConsensusObjectKind",Ki]},{no:2,name:"object_id",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"digest",kind:"scalar",opt:!0,T:9},{no:5,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const TD=new wD,SD=50;function GE(e){if(e.after!=null&&e.before!=null)throw new Error("Only one of `after` or `before` may be provided");const t=e.order?e.order==="descending":e.before!=null;if(e.after!=null&&t)throw new Error("`after` can not be combined with descending queries");if(e.before!=null&&!t)throw new Error("`before` can not be combined with ascending queries");return{descending:t,after:e.after??void 0,before:e.before??void 0,limit:e.limit??SD}}function ED(e,t){if(e?.$kind==="function"&&(t.after!=null||t.before!=null)&&(!e.module||!e.function))throw new Error("Paginating transactions filtered by function requires a fully qualified `package::module::function`")}async function _D(e,t,s){if(zA(t,["sender","function"],"transaction"),t.sender!=null)return{$kind:"sender",sender:ye(t.sender)};const[r,i,c,...u]=t.function.split("::");if(!r||u.length>0||i===""||c==="")throw new Error(`Invalid function filter "${t.function}": expected "package", "package::module", or "package::module::function"`);return{$kind:"function",package:ye((await e.resolvePackage({package:r,signal:s})).package),module:i,function:c}}async function kD(e,t,s){if(zA(t,["sender","emitModule","eventType"],"event"),t.sender!=null)return{$kind:"sender",sender:ye(t.sender)};if(t.emitModule!=null){const[c,u,...d]=t.emitModule.split("::");if(!c||!u||d.length>0)throw new Error(`Invalid emitModule filter "${t.emitModule}": expected "package::module"`);return{$kind:"emitModule",package:ye((await e.resolvePackage({package:c,signal:s})).package),module:u}}const r=t.eventType,i=r.split("::");if(i.length===2&&i.every(c=>c!==""))return{$kind:"eventTypeModule",package:ye((await e.resolvePackage({package:i[0],signal:s})).package),module:i[1]};if(i.length<3||i.some(c=>c===""))throw new Error(`Invalid eventType filter "${r}": expected "package::module" or a fully qualified type name`);return{$kind:"eventType",eventType:(await e.resolveType({type:r,signal:s})).type}}function zA(e,t,s){const r=t.filter(i=>e[i]!=null);if(r.length!==1)throw new Error(`A ${s} filter must specify exactly one of ${t.join(", ")}${r.length?` (got ${r.join(", ")})`:""}`)}var AD=class extends Y{constructor(){super("sui.rpc.v2.BalanceChange",[{no:1,name:"address",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:3,name:"amount",kind:"scalar",opt:!0,T:9}])}};const OD=new AD;var ND=class extends Y{constructor(){super("sui.rpc.v2.TransactionEvents",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"events",kind:"message",repeat:2,T:()=>hb}])}};const xD=new ND;var CD=class extends Y{constructor(){super("sui.rpc.v2.Event",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"module",kind:"scalar",opt:!0,T:9},{no:3,name:"sender",kind:"scalar",opt:!0,T:9},{no:4,name:"event_type",kind:"scalar",opt:!0,T:9},{no:5,name:"contents",kind:"message",T:()=>Es},{no:6,name:"json",kind:"message",T:()=>pn},{no:7,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"transaction_digest",kind:"scalar",opt:!0,T:9},{no:9,name:"transaction_index",kind:"scalar",opt:!0,T:4,L:0},{no:10,name:"event_index",kind:"scalar",opt:!0,T:13}])}};const hb=new CD;let Mp=(function(e){return e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.SECP256R1=2]="SECP256R1",e[e.MULTISIG=3]="MULTISIG",e[e.BLS12381=4]="BLS12381",e[e.ZKLOGIN=5]="ZKLOGIN",e[e.PASSKEY=6]="PASSKEY",e})({});var ID=class extends Y{constructor(){super("sui.rpc.v2.UserSignature",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Mp]},{no:3,name:"simple",kind:"message",oneof:"signature",T:()=>pb},{no:4,name:"multisig",kind:"message",oneof:"signature",T:()=>VD},{no:5,name:"zklogin",kind:"message",oneof:"signature",T:()=>VA},{no:6,name:"passkey",kind:"message",oneof:"signature",T:()=>PA}])}};const Dp=new ID;var RD=class extends Y{constructor(){super("sui.rpc.v2.SimpleSignature",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Mp]},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"public_key",kind:"scalar",opt:!0,T:12}])}};const pb=new RD;var jD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginPublicIdentifier",[{no:1,name:"iss",kind:"scalar",opt:!0,T:9},{no:2,name:"address_seed",kind:"scalar",opt:!0,T:9}])}};const $A=new jD;var MD=class extends Y{constructor(){super("sui.rpc.v2.MultisigMemberPublicKey",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Mp]},{no:2,name:"public_key",kind:"scalar",opt:!0,T:12},{no:3,name:"zklogin",kind:"message",T:()=>$A}])}};const DD=new MD;var UD=class extends Y{constructor(){super("sui.rpc.v2.MultisigMember",[{no:1,name:"public_key",kind:"message",T:()=>DD},{no:2,name:"weight",kind:"scalar",opt:!0,T:13}])}};const BD=new UD;var LD=class extends Y{constructor(){super("sui.rpc.v2.MultisigCommittee",[{no:1,name:"members",kind:"message",repeat:2,T:()=>BD},{no:2,name:"threshold",kind:"scalar",opt:!0,T:13}])}};const zD=new LD;var $D=class extends Y{constructor(){super("sui.rpc.v2.MultisigAggregatedSignature",[{no:1,name:"signatures",kind:"message",repeat:2,T:()=>GD},{no:2,name:"bitmap",kind:"scalar",opt:!0,T:13},{no:3,name:"legacy_bitmap",kind:"scalar",opt:!0,T:12},{no:4,name:"committee",kind:"message",T:()=>zD}])}};const VD=new $D;var PD=class extends Y{constructor(){super("sui.rpc.v2.MultisigMemberSignature",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Mp]},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"zklogin",kind:"message",T:()=>VA},{no:4,name:"passkey",kind:"message",T:()=>PA}])}};const GD=new PD;var FD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginAuthenticator",[{no:1,name:"inputs",kind:"message",T:()=>qD},{no:2,name:"max_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"signature",kind:"message",T:()=>pb},{no:4,name:"public_identifier",kind:"message",T:()=>$A},{no:5,name:"jwk_id",kind:"message",T:()=>NA}])}};const VA=new FD;var HD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginInputs",[{no:1,name:"proof_points",kind:"message",T:()=>YD},{no:2,name:"iss_base64_details",kind:"message",T:()=>XD},{no:3,name:"header_base64",kind:"scalar",opt:!0,T:9},{no:4,name:"address_seed",kind:"scalar",opt:!0,T:9}])}};const qD=new HD;var ZD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginProof",[{no:1,name:"a",kind:"message",T:()=>FE},{no:2,name:"b",kind:"message",T:()=>QD},{no:3,name:"c",kind:"message",T:()=>FE}])}};const YD=new ZD;var WD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginClaim",[{no:1,name:"value",kind:"scalar",opt:!0,T:9},{no:2,name:"index_mod_4",kind:"scalar",opt:!0,T:13}])}};const XD=new WD;var KD=class extends Y{constructor(){super("sui.rpc.v2.CircomG1",[{no:1,name:"e0",kind:"scalar",opt:!0,T:9},{no:2,name:"e1",kind:"scalar",opt:!0,T:9},{no:3,name:"e2",kind:"scalar",opt:!0,T:9}])}};const FE=new KD;var JD=class extends Y{constructor(){super("sui.rpc.v2.CircomG2",[{no:1,name:"e00",kind:"scalar",opt:!0,T:9},{no:2,name:"e01",kind:"scalar",opt:!0,T:9},{no:3,name:"e10",kind:"scalar",opt:!0,T:9},{no:4,name:"e11",kind:"scalar",opt:!0,T:9},{no:5,name:"e20",kind:"scalar",opt:!0,T:9},{no:6,name:"e21",kind:"scalar",opt:!0,T:9}])}};const QD=new JD;var eU=class extends Y{constructor(){super("sui.rpc.v2.PasskeyAuthenticator",[{no:1,name:"authenticator_data",kind:"scalar",opt:!0,T:12},{no:2,name:"client_data_json",kind:"scalar",opt:!0,T:9},{no:3,name:"signature",kind:"message",T:()=>pb}])}};const PA=new eU;var tU=class extends Y{constructor(){super("sui.rpc.v2.ValidatorCommittee",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"members",kind:"message",repeat:2,T:()=>GA}])}};const nU=new tU;var sU=class extends Y{constructor(){super("sui.rpc.v2.ValidatorCommitteeMember",[{no:1,name:"public_key",kind:"scalar",opt:!0,T:12},{no:2,name:"weight",kind:"scalar",opt:!0,T:4,L:0}])}};const GA=new sU;var rU=class extends Y{constructor(){super("sui.rpc.v2.ValidatorAggregatedSignature",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"bitmap",kind:"scalar",opt:!0,T:12}])}};const aU=new rU;var iU=class extends Y{constructor(){super("sui.rpc.v2.ExecutedTransaction",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"transaction",kind:"message",T:()=>fb},{no:3,name:"signatures",kind:"message",repeat:2,T:()=>Dp},{no:4,name:"effects",kind:"message",T:()=>pD},{no:5,name:"events",kind:"message",T:()=>xD},{no:6,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"timestamp",kind:"message",T:()=>Nr},{no:8,name:"balance_changes",kind:"message",repeat:2,T:()=>OD},{no:9,name:"objects",kind:"message",T:()=>xA},{no:10,name:"transaction_index",kind:"scalar",opt:!0,T:4,L:0}])}};const pa=new iU;var oU=class extends Y{constructor(){super("google.protobuf.FieldMask",[{no:1,name:"paths",kind:"scalar",repeat:2,T:9}])}internalJsonWrite(e,t){const s=/[A-Z]|(_([.0-9_]|$))/g;return e.paths.map(r=>{if(s.test(r))throw new Error('Unable to encode FieldMask to JSON. lowerCamelCase of path name "'+r+'" is irreversible.');return Wh(r)}).join(",")}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse FieldMask from JSON "+ga(e)+". Expected string.");if(s||(s=this.create()),e==="")return s;let r=i=>{if(i.includes("_"))throw new Error("Unable to parse FieldMask from JSON. Path names must be lowerCamelCase.");return i.replace(/[A-Z]/g,c=>"_"+c.toLowerCase())};return s.paths=e.split(",").map(r),s}};const Ln=new oU;let Ou=(function(e){return e[e.ENABLED=0]="ENABLED",e[e.DISABLED=1]="DISABLED",e})({});var cU=class extends Y{constructor(){super("sui.rpc.v2.ExecuteTransactionRequest",[{no:1,name:"transaction",kind:"message",T:()=>fb},{no:2,name:"signatures",kind:"message",repeat:2,T:()=>Dp},{no:3,name:"read_mask",kind:"message",T:()=>Ln}])}};const lU=new cU;var uU=class extends Y{constructor(){super("sui.rpc.v2.ExecuteTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>pa}])}};const dU=new uU;var fU=class extends Y{constructor(){super("sui.rpc.v2.SimulateTransactionRequest",[{no:1,name:"transaction",kind:"message",T:()=>fb},{no:2,name:"read_mask",kind:"message",T:()=>Ln},{no:3,name:"checks",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SimulateTransactionRequest.TransactionChecks",Ou]},{no:4,name:"do_gas_selection",kind:"scalar",opt:!0,T:8}])}};const hU=new fU;var pU=class extends Y{constructor(){super("sui.rpc.v2.SimulateTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>pa},{no:2,name:"command_outputs",kind:"message",repeat:2,T:()=>gU},{no:3,name:"suggested_gas_price",kind:"scalar",opt:!0,T:4,L:0}])}};const FA=new pU;var mU=class extends Y{constructor(){super("sui.rpc.v2.CommandResult",[{no:1,name:"return_values",kind:"message",repeat:2,T:()=>HE},{no:2,name:"mutated_by_ref",kind:"message",repeat:2,T:()=>HE}])}};const gU=new mU;var yU=class extends Y{constructor(){super("sui.rpc.v2.CommandOutput",[{no:1,name:"argument",kind:"message",T:()=>Or},{no:2,name:"value",kind:"message",T:()=>Es},{no:3,name:"json",kind:"message",T:()=>pn}])}};const HE=new yU,W0=new vi("sui.rpc.v2.TransactionExecutionService",[{name:"ExecuteTransaction",options:{},I:lU,O:dU},{name:"SimulateTransaction",options:{},I:hU,O:FA}]);let iv=(function(e){return e[e.ASCENDING=0]="ASCENDING",e[e.DESCENDING=1]="DESCENDING",e})({}),Nu=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.ITEM_LIMIT=1]="ITEM_LIMIT",e[e.SCAN_LIMIT=2]="SCAN_LIMIT",e[e.CHECKPOINT_BOUND=3]="CHECKPOINT_BOUND",e[e.CURSOR_BOUND=4]="CURSOR_BOUND",e[e.LEDGER_TIP=5]="LEDGER_TIP",e})({});var vU=class extends Y{constructor(){super("sui.rpc.v2.QueryOptions",[{no:1,name:"limit",kind:"scalar",opt:!0,T:13},{no:2,name:"after",kind:"scalar",opt:!0,T:12},{no:3,name:"before",kind:"scalar",opt:!0,T:12},{no:4,name:"ordering",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Ordering",iv,"ORDERING_"]}])}};const mb=new vU;var bU=class extends Y{constructor(){super("sui.rpc.v2.Watermark",[{no:1,name:"cursor",kind:"scalar",opt:!0,T:12},{no:2,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0}])}};const od=new bU;var wU=class extends Y{constructor(){super("sui.rpc.v2.QueryEnd",[{no:1,name:"reason",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.QueryEndReason",Nu,"QUERY_END_REASON_"]}])}};const gb=new wU;function TU(e){return{terms:[{literals:[e.$kind==="sender"?{negated:!1,predicate:{oneofKind:"sender",sender:{address:e.sender}}}:{negated:!1,predicate:{oneofKind:"moveCall",moveCall:{function:[e.package,e.module,e.function].filter(Boolean).join("::")}}}]}]}}function SU(e){return{terms:[{literals:[e.$kind==="sender"?{negated:!1,predicate:{oneofKind:"sender",sender:{address:e.sender}}}:e.$kind==="emitModule"?{negated:!1,predicate:{oneofKind:"emitModule",emitModule:{module:`${e.package}::${e.module}`}}}:{negated:!1,predicate:{oneofKind:"eventType",eventType:{eventType:e.$kind==="eventTypeModule"?`${e.package}::${e.module}`:e.eventType}}}]}]}}function EU(e){if(typeof e!="object"||e===null)return!1;const{code:t,message:s}=e;return typeof t!="string"||typeof s!="string"?!1:t===we[we.NOT_FOUND]?!0:t!==we[we.RESOURCE_EXHAUSTED]?!1:s==="name has expired"?!0:!w8(e)&&s==="name%20has%20expired"}var _U=class extends O8{#e;constructor({client:e,...t}){super(t),this.#e=e}async getObjects(e){const t=Bh(e.objectIds,50),s=[],r=["owner","object_type","digest","version","object_id"];e.include?.content&&r.push("contents"),e.include?.previousTransaction&&r.push("previous_transaction"),e.include?.objectBcs&&r.push("bcs"),e.include?.json&&r.push("json"),e.include?.display&&r.push("display");for(const i of t){const c=await this.#e.ledgerService.batchGetObjects({requests:i.map(u=>({objectId:u})),readMask:{paths:r}},{abort:e.signal});s.push(...c.response.objects.map((u,d)=>{if(u.result.oneofKind==="error"){const O=u.result.error;return O.code===we.NOT_FOUND?new hh("notExists",O.message,{cause:O,reason:"notFound",objectId:i[d]}):new hh(we[O.code]??"unknown",O.message,{cause:O,reason:"unknown",objectId:i[d]})}if(u.result.oneofKind!=="object")return new hh("unknown","Unexpected result type",{reason:"unknown",objectId:i[d]});const p=u.result.object.contents?.value??void 0,m=u.result.object.bcs?.value??void 0,g=u.result.object.objectType,y=g&&g.includes("::")?De(g):g??"",b=e.include?.json?u.result.object.json?pn.toJson(u.result.object.json):null:void 0,E=ZE(e.include?.display,u.result.object.display);return{objectId:u.result.object.objectId,version:u.result.object.version?.toString(),digest:u.result.object.digest,content:p,owner:Qi(u.result.object.owner),type:y,previousTransaction:u.result.object.previousTransaction??void 0,objectBcs:m,json:b,display:E}}))}return{objects:s}}async listOwnedObjects(e){const t=["owner","object_type","digest","version","object_id"];e.include?.content&&t.push("contents"),e.include?.previousTransaction&&t.push("previous_transaction"),e.include?.objectBcs&&t.push("bcs"),e.include?.json&&t.push("json"),e.include?.display&&t.push("display");const s=await this.#e.stateService.listOwnedObjects({owner:e.owner,objectType:e.type?(await this.mvr.resolveType({type:e.type,signal:e.signal})).type:void 0,pageToken:e.cursor?Ge(e.cursor):void 0,pageSize:e.limit,readMask:{paths:t}},{abort:e.signal});return{objects:s.response.objects.map(r=>({objectId:r.objectId,version:r.version?.toString(),digest:r.digest,content:r.contents?.value,owner:Qi(r.owner),type:r.objectType,previousTransaction:r.previousTransaction??void 0,objectBcs:r.bcs?.value,json:e.include?.json?r.json?pn.toJson(r.json):null:void 0,display:ZE(e.include?.display,r.display)})),cursor:s.response.nextPageToken?Ke(s.response.nextPageToken):null,hasNextPage:s.response.nextPageToken!==void 0}}async listCoins(e){const t=["owner","object_type","digest","version","object_id","balance"],s=e.coinType??Vh,r=await this.#e.stateService.listOwnedObjects({owner:e.owner,objectType:`0x2::coin::Coin<${(await this.mvr.resolveType({type:s,signal:e.signal})).type}>`,pageToken:e.cursor?Ge(e.cursor):void 0,pageSize:e.limit,readMask:{paths:t}},{abort:e.signal});return{objects:r.response.objects.map(i=>({objectId:i.objectId,version:i.version?.toString(),digest:i.digest,owner:Qi(i.owner),type:i.objectType,balance:i.balance?.toString()})),cursor:r.response.nextPageToken?Ke(r.response.nextPageToken):null,hasNextPage:r.response.nextPageToken!==void 0}}async getBalance(e){const t=e.coinType??Vh,s=await this.#e.stateService.getBalance({owner:e.owner,coinType:(await this.mvr.resolveType({type:t,signal:e.signal})).type},{abort:e.signal});return{balance:{balance:s.response.balance?.balance?.toString()??"0",coinType:s.response.balance?.coinType??t,coinBalance:s.response.balance?.coinBalance?.toString()??"0",addressBalance:s.response.balance?.addressBalance?.toString()??"0"}}}async getCoinMetadata(e){const t=(await this.mvr.resolveType({type:e.coinType,signal:e.signal})).type;let s;try{({response:s}=await this.#e.stateService.getCoinInfo({coinType:t},{abort:e.signal}))}catch(r){if(e.signal?.aborted)throw r;return{coinMetadata:null}}return s.metadata?{coinMetadata:{id:s.metadata.id??null,decimals:s.metadata.decimals??0,name:s.metadata.name??"",symbol:s.metadata.symbol??"",description:s.metadata.description??"",iconUrl:s.metadata.iconUrl??null}}:{coinMetadata:null}}async listBalances(e){const t=await this.#e.stateService.listBalances({owner:e.owner,pageToken:e.cursor?Ge(e.cursor):void 0,pageSize:e.limit},{abort:e.signal});return{hasNextPage:!!t.response.nextPageToken,cursor:t.response.nextPageToken?Ke(t.response.nextPageToken):null,balances:t.response.balances.map(s=>({balance:s.balance?.toString()??"0",coinType:s.coinType,coinBalance:s.coinBalance?.toString()??"0",addressBalance:s.addressBalance?.toString()??"0"}))}}async getTransaction(e){try{const{response:t}=await this.#e.ledgerService.getTransaction({digest:e.digest,readMask:{paths:Kf(e.include)}},{abort:e.signal});if(!t.transaction)throw new uE("notFound",e.digest);return X0(kh(t.transaction,{include:e.include}),e.include,()=>pa.toJson(t.transaction))}catch(t){throw t instanceof gt&&t.code===we[we.NOT_FOUND]?new uE("notFound",e.digest,{cause:t}):t}}async executeTransaction(e){const{response:t}=await this.#e.transactionExecutionService.executeTransaction({transaction:{bcs:{value:e.transaction}},signatures:e.signatures.map(s=>({bcs:{value:Ge(s)},signature:{oneofKind:void 0}})),readMask:{paths:Kf(e.include)}},{abort:e.signal});return X0(kh(t.transaction,{include:e.include}),e.include,()=>pa.toJson(t.transaction))}async simulateTransaction(e){const t=Kf(e.include,"transaction.");e.include?.commandResults&&t.push("command_outputs"),e.transaction instanceof Uint8Array||await e.transaction.prepareForSerialization({client:this});const s=e.doGasSelection??(e.transaction instanceof Uint8Array?D8(e.transaction):e.transaction.getData().gasData.payment?.length===0),{response:r}=await this.#e.transactionExecutionService.simulateTransaction({transaction:e.transaction instanceof Uint8Array?{bcs:{value:e.transaction}}:M9(e.transaction),readMask:{paths:t},doGasSelection:s,checks:e.checksEnabled===!1?Ou.DISABLED:Ou.ENABLED},{abort:e.signal});return X0(NU(r,{include:e.include}),e.include,()=>FA.toJson(r))}async getReferenceGasPrice(e){return{referenceGasPrice:(await this.#e.ledgerService.getEpoch({readMask:{paths:["reference_gas_price"]}},{abort:e?.signal})).response.epoch?.referenceGasPrice?.toString()??""}}async getProtocolConfig(e){const t=(await this.#e.ledgerService.getEpoch({readMask:{paths:["protocol_config"]}},{abort:e?.signal})).response.epoch?.protocolConfig;if(!t)throw new Error("Protocol config not found in response");const s={...t.featureFlags},r={};if(t.attributes)for(const[i,c]of Object.entries(t.attributes))r[i]=c??null;return{protocolConfig:{protocolVersion:t.protocolVersion?.toString()??null,featureFlags:s,attributes:r}}}async getCurrentSystemState(e){const t=(await this.#e.ledgerService.getEpoch({readMask:{paths:["system_state.version","system_state.epoch","system_state.protocol_version","system_state.reference_gas_price","system_state.epoch_start_timestamp_ms","system_state.safe_mode","system_state.safe_mode_storage_rewards","system_state.safe_mode_computation_rewards","system_state.safe_mode_storage_rebates","system_state.safe_mode_non_refundable_storage_fee","system_state.parameters","system_state.storage_fund","system_state.stake_subsidy"]}},{abort:e?.signal})).response.epoch,s=t?.systemState;if(!s)throw new Error("System state not found in response");const r=t?.start?.seconds?Number(t.start.seconds)*1e3+Math.floor((t.start.nanos||0)/1e6):s.epochStartTimestampMs?Number(s.epochStartTimestampMs):null;return{systemState:{systemStateVersion:s.version?.toString()??null,epoch:s.epoch?.toString()??null,protocolVersion:s.protocolVersion?.toString()??null,referenceGasPrice:s.referenceGasPrice?.toString()??null,epochStartTimestampMs:r.toString(),safeMode:s.safeMode??!1,safeModeStorageRewards:s.safeModeStorageRewards?.toString()??null,safeModeComputationRewards:s.safeModeComputationRewards?.toString()??null,safeModeStorageRebates:s.safeModeStorageRebates?.toString()??null,safeModeNonRefundableStorageFee:s.safeModeNonRefundableStorageFee?.toString()??null,parameters:{epochDurationMs:s.parameters?.epochDurationMs?.toString()??null,stakeSubsidyStartEpoch:s.parameters?.stakeSubsidyStartEpoch?.toString()??null,maxValidatorCount:s.parameters?.maxValidatorCount?.toString()??null,minValidatorJoiningStake:s.parameters?.minValidatorJoiningStake?.toString()??null,validatorLowStakeThreshold:s.parameters?.validatorLowStakeThreshold?.toString()??null,validatorLowStakeGracePeriod:s.parameters?.validatorLowStakeGracePeriod?.toString()??null},storageFund:{totalObjectStorageRebates:s.storageFund?.totalObjectStorageRebates?.toString()??null,nonRefundableBalance:s.storageFund?.nonRefundableBalance?.toString()??null},stakeSubsidy:{balance:s.stakeSubsidy?.balance?.toString()??null,distributionCounter:s.stakeSubsidy?.distributionCounter?.toString()??null,currentDistributionAmount:s.stakeSubsidy?.currentDistributionAmount?.toString()??null,stakeSubsidyPeriodLength:s.stakeSubsidy?.stakeSubsidyPeriodLength?.toString()??null,stakeSubsidyDecreaseRate:s.stakeSubsidy?.stakeSubsidyDecreaseRate??null}}}}async listDynamicFields(e){return this.#e.listDynamicFields(e)}async listTransactions(e){const t=Kf(e.include),s=e.filter?await _D(this.mvr,e.filter,e.signal):void 0,r=GE(e);ED(s,r);const i=this.#e.ledgerService.listTransactions({readMask:{paths:t},filter:s&&TU(s),options:qE(r,r.limit+1)},{abort:e.signal}),c=[];let u=null,d=null,p=null,m,g=!1;for await(const b of i.responses)b.watermark?.cursor&&(p=Ke(b.watermark.cursor)),b.transaction&&(c.length>=r.limit?g=!0:(u??=p,d=p,c.push(kh(b.transaction,{include:e.include})))),b.end&&(m=b.end);const y=g||m?.reason===Nu.SCAN_LIMIT||m?.reason===Nu.ITEM_LIMIT;return{transactions:c,hasNextPage:y,startCursor:u,endCursor:g?d:y?p??d:d}}async listEvents(e){const t=GE(e),s=this.#e.ledgerService.listEvents({readMask:{paths:["package_id","module","sender","event_type","contents","json","checkpoint","transaction_digest","event_index"]},filter:e.filter?SU(await kD(this.mvr,e.filter,e.signal)):void 0,options:qE(t,t.limit+1)},{abort:e.signal}),r=[];let i=null,c=null,u=null,d,p=!1;for await(const g of s.responses){if(g.watermark?.cursor&&(u=Ke(g.watermark.cursor)),g.event)if(r.length>=t.limit)p=!0;else{i??=u,c=u;const y=g.event;r.push({packageId:ye(y.packageId),module:y.module,sender:ye(y.sender),eventType:De(y.eventType),bcs:y.contents?.value??new Uint8Array,json:y.json?pn.toJson(y.json):null,checkpoint:y.checkpoint?.toString()??null,transactionDigest:y.transactionDigest,eventIndex:y.eventIndex})}g.end&&(d=g.end)}const m=p||d?.reason===Nu.SCAN_LIMIT||d?.reason===Nu.ITEM_LIMIT;return{events:r,hasNextPage:m,startCursor:i,endCursor:p?c:m?u??c:c}}async verifyZkLoginSignature(e){const t=Ge(e.bytes),s=e.intentScope==="PersonalMessage"?M.byteVector().serialize(t).toBytes():t,{response:r}=await this.#e.signatureVerificationService.verifySignature({message:{name:e.intentScope,value:s},signature:{bcs:{value:Ge(e.signature)},signature:{oneofKind:void 0}},address:e.address,jwks:[]},{abort:e.signal});return{success:r.isValid??!1,errors:r.reason?[r.reason]:[]}}async defaultNameServiceName(e){return{data:{name:(await this.#e.nameService.reverseLookupName({address:e.address},{abort:e.signal})).response.record?.name??null}}}async resolveNameServiceAddress(e){try{const{response:t}=await this.#e.nameService.lookupName({name:e.name},{abort:e.signal});return{address:t.record?.targetAddress??null}}catch(t){if(EU(t))return{address:null};throw t}}async getMoveFunction(e){const t=(await this.mvr.resolvePackage({package:e.packageId,signal:e.signal})).package,{response:s}=await this.#e.movePackageService.getFunction({packageId:t,moduleName:e.moduleName,name:e.name},{abort:e.signal});let r="unknown";switch(s.function?.visibility){case Eh.PUBLIC:r="public";break;case Eh.PRIVATE:r="private";break;case Eh.FRIEND:r="friend";break}return{function:{packageId:ye(t),moduleName:e.moduleName,name:s.function?.name,visibility:r,isEntry:s.function?.isEntry??!1,typeParameters:s.function?.typeParameters?.map(({constraints:i})=>({isPhantom:!1,constraints:i.map(c=>{switch(c){case Nc.COPY:return"copy";case Nc.DROP:return"drop";case Nc.STORE:return"store";case Nc.KEY:return"key";default:return"unknown"}})??[]}))??[],parameters:s.function?.parameters?.map(i=>KE(i))??[],returns:s.function?.returns?.map(i=>KE(i))??[]}}}async getChainIdentifier(e){return fh(Promise.resolve(this.cache.read(["chainIdentifier"],async()=>{const{response:t}=await this.#e.ledgerService.getServiceInfo({});if(!t.chainId)throw new Error("Chain identifier not found in service info");return{chainIdentifier:t.chainId}})),e?.signal)}resolveTransactionPlugin(){const e=this.#e;return async function(s,r,i){const c=s.snapshot();c.sender||(c.sender="0x0000000000000000000000000000000000000000000000000000000000000000");const u=MA(c),d=!r.onlyTransactionKind&&(c.gasData.budget==null||c.gasData.payment==null);let p;try{p=(await e.transactionExecutionService.simulateTransaction({transaction:u,doGasSelection:d,checks:r.onlyTransactionKind?Ou.DISABLED:Ou.ENABLED,readMask:{paths:["transaction.transaction.sender","transaction.transaction.gas_payment","transaction.transaction.expiration","transaction.transaction.kind","transaction.effects.status","transaction.effects.epoch"]}})).response}catch(m){throw m instanceof Error&&m.message?new Yy(m.message,{cause:m}):m}if(!r.onlyTransactionKind&&p.transaction?.effects?.status&&!p.transaction.effects.status.success){const m=p.transaction.effects.status.error?yb(p.transaction.effects.status.error):void 0;throw new Yy(`Transaction resolution failed: ${m?.message??"Transaction failed"}`,{executionError:m})}if(!p.transaction?.transaction)throw new Error("simulateTransaction did not return resolved transaction data");return j9(s,p.transaction.transaction,r),await B9({transactionData:s,client:e,epoch:p.transaction.effects?.epoch,originalTransactionData:c,isTransactionKindOnly:!!r.onlyTransactionKind,doGasSelection:d}),await i()}}};function qE(e,t){return{limit:t,ordering:e.descending?iv.DESCENDING:iv.ASCENDING,after:e.after?Ge(e.after):void 0,before:e.before?Ge(e.before):void 0}}function Kf(e,t=""){const s=["digest","transaction.digest","signatures","effects.status","timestamp","checkpoint"];return e?.transaction&&s.push("transaction.sender","transaction.gas_payment","transaction.expiration","transaction.kind"),e?.bcs&&s.push("transaction.bcs"),e?.balanceChanges&&s.push("balance_changes"),e?.effects&&s.push("effects"),e?.events&&s.push("events"),e?.objectTypes&&(s.push("effects.changed_objects.object_type"),s.push("effects.changed_objects.object_id")),t?s.map(r=>t+r):s}function X0(e,t,s){return t?.protoJson?{...e,protoJson:s()}:e}function ZE(e,t){if(e)return t===void 0?null:{output:t.output!==void 0?pn.toJson(t.output):null,errors:t.errors!==void 0?pn.toJson(t.errors):null}}function Qi(e){if(!e)return null;if(e.kind===Sc.IMMUTABLE)return{$kind:"Immutable",Immutable:!0};if(e.kind===Sc.ADDRESS)return{AddressOwner:e.address,$kind:"AddressOwner"};if(e.kind===Sc.OBJECT)return{$kind:"ObjectOwner",ObjectOwner:e.address};if(e.kind===Sc.SHARED)return{$kind:"Shared",Shared:{initialSharedVersion:e.version?.toString()}};if(e.kind===Sc.CONSENSUS_ADDRESS)return{$kind:"ConsensusAddressOwner",ConsensusAddressOwner:{startVersion:e.version?.toString(),owner:e.address}};throw new Error(`Unknown owner kind ${JSON.stringify(e,(t,s)=>typeof s=="bigint"?s.toString():s)}`)}function yb(e){const t=e.description??"Unknown error",s=e.command!=null?Number(e.command):void 0,r=e.errorDetails;switch(r?.oneofKind){case"abort":{const i=r.abort,c=i.cleverError;return{$kind:"MoveAbort",message:SA({command:s,location:i.location,abortCode:String(i.abortCode??0n),cleverError:c?{lineNumber:c.lineNumber!=null?Number(c.lineNumber):void 0,constantName:c.constantName,value:c.value?.oneofKind==="rendered"?c.value.rendered:void 0}:void 0}),command:s,MoveAbort:kU(i)}}case"sizeError":return{$kind:"SizeError",message:t,command:s,SizeError:{name:Hi(e.kind),size:Number(r.sizeError.size??0n),maxSize:Number(r.sizeError.maxSize??0n)}};case"commandArgumentError":return{$kind:"CommandArgumentError",message:t,command:s,CommandArgumentError:{argument:r.commandArgumentError.argument??0,name:Hi(r.commandArgumentError.kind)}};case"typeArgumentError":return{$kind:"TypeArgumentError",message:t,command:s,TypeArgumentError:{typeArgument:r.typeArgumentError.typeArgument??0,name:Hi(r.typeArgumentError.kind)}};case"packageUpgradeError":return{$kind:"PackageUpgradeError",message:t,command:s,PackageUpgradeError:{name:Hi(r.packageUpgradeError.kind),packageId:r.packageUpgradeError.packageId,digest:r.packageUpgradeError.digest}};case"indexError":return{$kind:"IndexError",message:t,command:s,IndexError:{index:r.indexError.index,subresult:r.indexError.subresult}};case"coinDenyListError":return{$kind:"CoinDenyListError",message:t,command:s,CoinDenyListError:{name:Hi(e.kind),coinType:r.coinDenyListError.coinType,address:r.coinDenyListError.address}};case"congestedObjects":return{$kind:"CongestedObjects",message:t,command:s,CongestedObjects:{name:Hi(e.kind),objects:r.congestedObjects.objects}};case"objectId":return{$kind:"ObjectIdError",message:t,command:s,ObjectIdError:{name:Hi(e.kind),objectId:r.objectId}};default:return{$kind:"Unknown",message:t,command:s,Unknown:null}}}function kU(e){return{abortCode:String(e.abortCode??0n),location:{...e.location},cleverError:e.cleverError?{errorCode:e.cleverError.errorCode!=null?Number(e.cleverError.errorCode):void 0,lineNumber:e.cleverError.lineNumber!=null?Number(e.cleverError.lineNumber):void 0,constantName:e.cleverError.constantName,constantType:e.cleverError.constantType,value:e.cleverError.value?.oneofKind==="rendered"?e.cleverError.value.rendered:e.cleverError.value?.oneofKind==="raw"?Ke(e.cleverError.value.raw):void 0}:void 0}}function Hi(e){if(e==null)return"Unknown";const t=UA[e];return!t||t.endsWith("_UNKNOWN")?"Unknown":t.split("_").map(s=>s.charAt(0)+s.slice(1).toLowerCase()).join("")}function YE(e){if(e==null)return null;switch(e){case Au.CREATED:return"Created";case Au.DELETED:return"Deleted";case Au.NONE:case Au.ID_OPERATION_UNKNOWN:return"None";default:return"Unknown"}}function WE(e){if(e==null)return null;switch(e){case _h.EXISTS:return"Exists";case _h.DOES_NOT_EXIST:return"DoesNotExist";case _h.UNKNOWN:return"Unknown";default:return"Unknown"}}function XE(e){if(e==null)return null;switch(e){case Ec.OBJECT_WRITE:return"ObjectWrite";case Ec.PACKAGE_WRITE:return"PackageWrite";case Ec.DOES_NOT_EXIST:return"DoesNotExist";case Ec.ACCUMULATOR_WRITE:return"AccumulatorWriteV1";case Ec.UNKNOWN:return"Unknown";default:return"Unknown"}}function AU(e){if(e==null)return null;switch(e){case Ki.UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN:return"Unknown";case Ki.READ_ONLY_ROOT:return"ReadOnlyRoot";case Ki.MUTATE_CONSENSUS_STREAM_ENDED:return"MutateConsensusStreamEnded";case Ki.READ_CONSENSUS_STREAM_ENDED:return"ReadConsensusStreamEnded";case Ki.CANCELED:return"Cancelled";case Ki.PER_EPOCH_CONFIG:return"PerEpochConfig";default:return"Unknown"}}function OU({effects:e}){if(!e)return null;const t=e.changedObjects.map(s=>({objectId:s.objectId,inputState:WE(s.inputState),inputVersion:s.inputVersion?.toString()??null,inputDigest:s.inputDigest??null,inputOwner:Qi(s.inputOwner),outputState:XE(s.outputState),outputVersion:s.outputVersion?.toString()??null,outputDigest:s.outputDigest??null,outputOwner:Qi(s.outputOwner),idOperation:YE(s.idOperation)}));return{bcs:e.bcs?.value,version:e.version??2,status:e.status?.success?{success:!0,error:null}:{success:!1,error:yb(e.status.error)},gasUsed:{computationCost:e.gasUsed?.computationCost?.toString(),storageCost:e.gasUsed?.storageCost?.toString(),storageRebate:e.gasUsed?.storageRebate?.toString(),nonRefundableStorageFee:e.gasUsed?.nonRefundableStorageFee?.toString()},transactionDigest:e.transactionDigest,gasObject:e.gasObject?{objectId:e.gasObject.objectId,inputState:WE(e.gasObject.inputState),inputVersion:e.gasObject.inputVersion?.toString()??null,inputDigest:e.gasObject.inputDigest??null,inputOwner:Qi(e.gasObject.inputOwner),outputState:XE(e.gasObject.outputState),outputVersion:e.gasObject.outputVersion?.toString()??null,outputDigest:e.gasObject.outputDigest??null,outputOwner:Qi(e.gasObject.outputOwner),idOperation:YE(e.gasObject.idOperation)}:null,eventsDigest:e.eventsDigest??null,dependencies:e.dependencies,lamportVersion:e.lamportVersion?.toString()??null,changedObjects:t,unchangedConsensusObjects:e.unchangedConsensusObjects.map(s=>({kind:AU(s.kind),objectId:s.objectId,version:s.version?.toString()??null,digest:s.digest??null})),auxiliaryDataDigest:e.auxiliaryDataDigest??null}}function kh(e,t){const s=t?.include,r={};s?.objectTypes&&e.effects?.changedObjects?.forEach(m=>{m.objectId&&m.objectType&&(r[m.objectId]=m.objectType)});let i;if(s?.transaction){const m=e.transaction;if(!m)throw new Error("Transaction data is required but missing from gRPC response");const g=DA(m);i={gasData:g.gasData,sender:g.sender,expiration:g.expiration,commands:g.commands,inputs:g.inputs,version:g.version}}const c=s?.bcs?e.transaction?.bcs?.value:void 0,u=s?.effects?OU({effects:e.effects}):void 0,d=e.effects?.status?.success?{success:!0,error:null}:{success:!1,error:e.effects?.status?.error?yb(e.effects.status.error):{$kind:"Unknown",message:"Transaction failed",Unknown:null}},p={digest:e.digest,epoch:e.effects?.epoch?.toString()??null,timestampMs:e.timestamp?Number(e.timestamp.seconds)*1e3+Math.floor(e.timestamp.nanos/1e6):null,checkpoint:e.checkpoint?.toString()??null,status:d,effects:u,objectTypes:s?.objectTypes?r:void 0,transaction:i,bcs:c,signatures:e.signatures?.map(m=>Ke(m.bcs?.value))??[],balanceChanges:s?.balanceChanges?e.balanceChanges?.map(m=>({coinType:m.coinType,address:m.address,amount:m.amount}))??[]:void 0,events:s?.events?e.events?.events.map(m=>({packageId:ye(m.packageId),module:m.module,sender:ye(m.sender),eventType:m.eventType,bcs:m.contents?.value??new Uint8Array,json:m.json?pn.toJson(m.json):null}))??[]:void 0};return d.success?{$kind:"Transaction",Transaction:p}:{$kind:"FailedTransaction",FailedTransaction:p}}function NU(e,t){const s=t?.include,r=kh(e.transaction,{include:s}),i=s?.commandResults&&e.commandOutputs?e.commandOutputs.map(c=>({returnValues:(c.returnValues??[]).map(u=>({bcs:u.value?.value??null})),mutatedReferences:(c.mutatedByRef??[]).map(u=>({bcs:u.value?.value??null}))})):void 0;return r.$kind==="Transaction"?{$kind:"Transaction",Transaction:r.Transaction,commandResults:i}:{$kind:"FailedTransaction",FailedTransaction:r.FailedTransaction,commandResults:i}}function KE(e){let t=null;return e.reference===rv.IMMUTABLE?t="immutable":e.reference===rv.MUTABLE&&(t="mutable"),{reference:t,body:ov(e.body)}}function ov(e){switch(e.type){case ys.TYPE_UNKNOWN:return{$kind:"unknown"};case ys.ADDRESS:return{$kind:"address"};case ys.BOOL:return{$kind:"bool"};case ys.U8:return{$kind:"u8"};case ys.U16:return{$kind:"u16"};case ys.U32:return{$kind:"u32"};case ys.U64:return{$kind:"u64"};case ys.U128:return{$kind:"u128"};case ys.U256:return{$kind:"u256"};case ys.VECTOR:return{$kind:"vector",vector:ov(e.typeParameterInstantiation[0])};case ys.DATATYPE:return{$kind:"datatype",datatype:{typeName:e.typeName,typeParameters:e.typeParameterInstantiation.map(t=>ov(t))}};case ys.TYPE_PARAMETER:return{$kind:"typeParameter",index:e.typeParameter};default:return{$kind:"unknown"}}}var xU=class{constructor(e){this._transport=e,this.typeName=W0.typeName,this.methods=W0.methods,this.options=W0.options}executeTransaction(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}simulateTransaction(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},CU=class extends Y{constructor(){super("sui.rpc.v2.TransactionFilter",[{no:1,name:"terms",kind:"message",repeat:2,T:()=>RU}])}};const Up=new CU;var IU=class extends Y{constructor(){super("sui.rpc.v2.TransactionTerm",[{no:1,name:"literals",kind:"message",repeat:2,T:()=>MU}])}};const RU=new IU;var jU=class extends Y{constructor(){super("sui.rpc.v2.TransactionLiteral",[{no:1,name:"negated",kind:"scalar",T:8},{no:2,name:"sender",kind:"message",oneof:"predicate",T:()=>qA},{no:3,name:"affected_address",kind:"message",oneof:"predicate",T:()=>PU},{no:4,name:"affected_object",kind:"message",oneof:"predicate",T:()=>FU},{no:5,name:"move_call",kind:"message",oneof:"predicate",T:()=>qU},{no:6,name:"emit_module",kind:"message",oneof:"predicate",T:()=>ZA},{no:7,name:"event_type",kind:"message",oneof:"predicate",T:()=>YA},{no:8,name:"event_stream_head",kind:"message",oneof:"predicate",T:()=>WA},{no:9,name:"package_write",kind:"message",oneof:"predicate",T:()=>KU}])}};const MU=new jU;var DU=class extends Y{constructor(){super("sui.rpc.v2.EventFilter",[{no:1,name:"terms",kind:"message",repeat:2,T:()=>BU}])}};const HA=new DU;var UU=class extends Y{constructor(){super("sui.rpc.v2.EventTerm",[{no:1,name:"literals",kind:"message",repeat:2,T:()=>zU}])}};const BU=new UU;var LU=class extends Y{constructor(){super("sui.rpc.v2.EventLiteral",[{no:1,name:"negated",kind:"scalar",T:8},{no:2,name:"sender",kind:"message",oneof:"predicate",T:()=>qA},{no:3,name:"emit_module",kind:"message",oneof:"predicate",T:()=>ZA},{no:4,name:"event_type",kind:"message",oneof:"predicate",T:()=>YA},{no:5,name:"event_stream_head",kind:"message",oneof:"predicate",T:()=>WA}])}};const zU=new LU;var $U=class extends Y{constructor(){super("sui.rpc.v2.SenderFilter",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const qA=new $U;var VU=class extends Y{constructor(){super("sui.rpc.v2.AffectedAddressFilter",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const PU=new VU;var GU=class extends Y{constructor(){super("sui.rpc.v2.AffectedObjectFilter",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9}])}};const FU=new GU;var HU=class extends Y{constructor(){super("sui.rpc.v2.MoveCallFilter",[{no:1,name:"function",kind:"scalar",opt:!0,T:9}])}};const qU=new HU;var ZU=class extends Y{constructor(){super("sui.rpc.v2.EmitModuleFilter",[{no:1,name:"module",kind:"scalar",opt:!0,T:9}])}};const ZA=new ZU;var YU=class extends Y{constructor(){super("sui.rpc.v2.EventTypeFilter",[{no:1,name:"event_type",kind:"scalar",opt:!0,T:9}])}};const YA=new YU;var WU=class extends Y{constructor(){super("sui.rpc.v2.EventStreamHeadFilter",[{no:1,name:"stream_id",kind:"scalar",opt:!0,T:9}])}};const WA=new WU;var XU=class extends Y{constructor(){super("sui.rpc.v2.PackageWriteFilter",[])}};const KU=new XU;var JU=class extends Y{constructor(){super("sui.rpc.v2.ProtocolConfig",[{no:1,name:"protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"feature_flags",kind:"map",K:9,V:{kind:"scalar",T:8}},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"configs",kind:"map",K:9,V:{kind:"message",T:()=>pn}}])}};const QU=new JU;var e7=class extends Y{constructor(){super("sui.rpc.v2.SystemState",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"validators",kind:"message",T:()=>f7},{no:5,name:"storage_fund",kind:"message",T:()=>u7},{no:6,name:"parameters",kind:"message",T:()=>a7},{no:7,name:"reference_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"validator_report_records",kind:"message",repeat:2,T:()=>s7},{no:9,name:"stake_subsidy",kind:"message",T:()=>c7},{no:10,name:"safe_mode",kind:"scalar",opt:!0,T:8},{no:11,name:"safe_mode_storage_rewards",kind:"scalar",opt:!0,T:4,L:0},{no:12,name:"safe_mode_computation_rewards",kind:"scalar",opt:!0,T:4,L:0},{no:13,name:"safe_mode_storage_rebates",kind:"scalar",opt:!0,T:4,L:0},{no:14,name:"safe_mode_non_refundable_storage_fee",kind:"scalar",opt:!0,T:4,L:0},{no:15,name:"epoch_start_timestamp_ms",kind:"scalar",opt:!0,T:4,L:0},{no:16,name:"extra_fields",kind:"message",T:()=>$s}])}};const t7=new e7;var n7=class extends Y{constructor(){super("sui.rpc.v2.ValidatorReportRecord",[{no:1,name:"reported",kind:"scalar",opt:!0,T:9},{no:2,name:"reporters",kind:"scalar",repeat:2,T:9}])}};const s7=new n7;var r7=class extends Y{constructor(){super("sui.rpc.v2.SystemParameters",[{no:1,name:"epoch_duration_ms",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"stake_subsidy_start_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"min_validator_count",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"max_validator_count",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"min_validator_joining_stake",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"validator_low_stake_threshold",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"validator_very_low_stake_threshold",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"validator_low_stake_grace_period",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"extra_fields",kind:"message",T:()=>$s}])}};const a7=new r7;var i7=class extends Y{constructor(){super("sui.rpc.v2.MoveTable",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"size",kind:"scalar",opt:!0,T:4,L:0}])}};const $s=new i7;var o7=class extends Y{constructor(){super("sui.rpc.v2.StakeSubsidy",[{no:1,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"distribution_counter",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"current_distribution_amount",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"stake_subsidy_period_length",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"stake_subsidy_decrease_rate",kind:"scalar",opt:!0,T:13},{no:6,name:"extra_fields",kind:"message",T:()=>$s}])}};const c7=new o7;var l7=class extends Y{constructor(){super("sui.rpc.v2.StorageFund",[{no:1,name:"total_object_storage_rebates",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"non_refundable_balance",kind:"scalar",opt:!0,T:4,L:0}])}};const u7=new l7;var d7=class extends Y{constructor(){super("sui.rpc.v2.ValidatorSet",[{no:1,name:"total_stake",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"active_validators",kind:"message",repeat:2,T:()=>p7},{no:3,name:"pending_active_validators",kind:"message",T:()=>$s},{no:4,name:"pending_removals",kind:"scalar",repeat:1,T:4,L:0},{no:5,name:"staking_pool_mappings",kind:"message",T:()=>$s},{no:6,name:"inactive_validators",kind:"message",T:()=>$s},{no:7,name:"validator_candidates",kind:"message",T:()=>$s},{no:8,name:"at_risk_validators",kind:"map",K:9,V:{kind:"scalar",T:4,L:0}},{no:9,name:"extra_fields",kind:"message",T:()=>$s}])}};const f7=new d7;var h7=class extends Y{constructor(){super("sui.rpc.v2.Validator",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"address",kind:"scalar",opt:!0,T:9},{no:3,name:"description",kind:"scalar",opt:!0,T:9},{no:4,name:"image_url",kind:"scalar",opt:!0,T:9},{no:5,name:"project_url",kind:"scalar",opt:!0,T:9},{no:7,name:"protocol_public_key",kind:"scalar",opt:!0,T:12},{no:8,name:"proof_of_possession",kind:"scalar",opt:!0,T:12},{no:10,name:"network_public_key",kind:"scalar",opt:!0,T:12},{no:12,name:"worker_public_key",kind:"scalar",opt:!0,T:12},{no:13,name:"network_address",kind:"scalar",opt:!0,T:9},{no:14,name:"p2p_address",kind:"scalar",jsonName:"p2pAddress",opt:!0,T:9},{no:15,name:"primary_address",kind:"scalar",opt:!0,T:9},{no:16,name:"worker_address",kind:"scalar",opt:!0,T:9},{no:18,name:"next_epoch_protocol_public_key",kind:"scalar",opt:!0,T:12},{no:19,name:"next_epoch_proof_of_possession",kind:"scalar",opt:!0,T:12},{no:21,name:"next_epoch_network_public_key",kind:"scalar",opt:!0,T:12},{no:23,name:"next_epoch_worker_public_key",kind:"scalar",opt:!0,T:12},{no:24,name:"next_epoch_network_address",kind:"scalar",opt:!0,T:9},{no:25,name:"next_epoch_p2p_address",kind:"scalar",jsonName:"nextEpochP2pAddress",opt:!0,T:9},{no:26,name:"next_epoch_primary_address",kind:"scalar",opt:!0,T:9},{no:27,name:"next_epoch_worker_address",kind:"scalar",opt:!0,T:9},{no:28,name:"metadata_extra_fields",kind:"message",T:()=>$s},{no:29,name:"voting_power",kind:"scalar",opt:!0,T:4,L:0},{no:30,name:"operation_cap_id",kind:"scalar",opt:!0,T:9},{no:31,name:"gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:32,name:"staking_pool",kind:"message",T:()=>g7},{no:33,name:"commission_rate",kind:"scalar",opt:!0,T:4,L:0},{no:34,name:"next_epoch_stake",kind:"scalar",opt:!0,T:4,L:0},{no:35,name:"next_epoch_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:36,name:"next_epoch_commission_rate",kind:"scalar",opt:!0,T:4,L:0},{no:37,name:"extra_fields",kind:"message",T:()=>$s}])}};const p7=new h7;var m7=class extends Y{constructor(){super("sui.rpc.v2.StakingPool",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"activation_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"deactivation_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"sui_balance",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"rewards_pool",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"pool_token_balance",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"exchange_rates",kind:"message",T:()=>$s},{no:8,name:"pending_stake",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"pending_total_sui_withdraw",kind:"scalar",opt:!0,T:4,L:0},{no:10,name:"pending_pool_token_withdraw",kind:"scalar",opt:!0,T:4,L:0},{no:11,name:"extra_fields",kind:"message",T:()=>$s}])}};const g7=new m7;var y7=class extends Y{constructor(){super("sui.rpc.v2.Epoch",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"committee",kind:"message",T:()=>nU},{no:3,name:"system_state",kind:"message",T:()=>t7},{no:4,name:"first_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"last_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"start",kind:"message",T:()=>Nr},{no:7,name:"end",kind:"message",T:()=>Nr},{no:8,name:"reference_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"protocol_config",kind:"message",T:()=>QU}])}};const v7=new y7;var b7=class extends Y{constructor(){super("sui.rpc.v2.CheckpointContents",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:5},{no:4,name:"transactions",kind:"message",repeat:2,T:()=>S7}])}};const w7=new b7;var T7=class extends Y{constructor(){super("sui.rpc.v2.CheckpointedTransactionInfo",[{no:1,name:"transaction",kind:"scalar",opt:!0,T:9},{no:2,name:"effects",kind:"scalar",opt:!0,T:9},{no:3,name:"signatures",kind:"message",repeat:2,T:()=>Dp},{no:4,name:"address_aliases_versions",kind:"message",repeat:2,T:()=>_7}])}};const S7=new T7;var E7=class extends Y{constructor(){super("sui.rpc.v2.AddressAliasesVersion",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const _7=new E7;let k7=(function(e){return e[e.CHECKPOINT_COMMITMENT_KIND_UNKNOWN=0]="CHECKPOINT_COMMITMENT_KIND_UNKNOWN",e[e.ECMH_LIVE_OBJECT_SET=1]="ECMH_LIVE_OBJECT_SET",e[e.CHECKPOINT_ARTIFACTS=2]="CHECKPOINT_ARTIFACTS",e})({});var A7=class extends Y{constructor(){super("sui.rpc.v2.CheckpointSummary",[{no:1,name:"bcs",kind:"message",T:()=>Es},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"sequence_number",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"total_network_transactions",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"content_digest",kind:"scalar",opt:!0,T:9},{no:7,name:"previous_digest",kind:"scalar",opt:!0,T:9},{no:8,name:"epoch_rolling_gas_cost_summary",kind:"message",T:()=>LA},{no:9,name:"timestamp",kind:"message",T:()=>Nr},{no:10,name:"commitments",kind:"message",repeat:2,T:()=>XA},{no:11,name:"end_of_epoch_data",kind:"message",T:()=>x7},{no:12,name:"version_specific_data",kind:"scalar",opt:!0,T:12}])}};const O7=new A7;var N7=class extends Y{constructor(){super("sui.rpc.v2.EndOfEpochData",[{no:1,name:"next_epoch_committee",kind:"message",repeat:2,T:()=>GA},{no:2,name:"next_epoch_protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"epoch_commitments",kind:"message",repeat:2,T:()=>XA}])}};const x7=new N7;var C7=class extends Y{constructor(){super("sui.rpc.v2.CheckpointCommitment",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CheckpointCommitment.CheckpointCommitmentKind",k7]},{no:2,name:"digest",kind:"scalar",opt:!0,T:9}])}};const XA=new C7;var I7=class extends Y{constructor(){super("sui.rpc.v2.Checkpoint",[{no:1,name:"sequence_number",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"summary",kind:"message",T:()=>O7},{no:4,name:"signature",kind:"message",T:()=>aU},{no:5,name:"contents",kind:"message",T:()=>w7},{no:6,name:"transactions",kind:"message",repeat:2,T:()=>pa},{no:7,name:"objects",kind:"message",T:()=>xA}])}};const vb=new I7;var R7=class extends Y{constructor(){super("google.protobuf.Any",[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}])}pack(e,t){return{typeUrl:this.typeNameToUrl(t.typeName),value:t.toBinary(e)}}unpack(e,t,s){if(!this.contains(e,t))throw new Error("Cannot unpack google.protobuf.Any with typeUrl '"+e.typeUrl+"' as "+t.typeName+".");return t.fromBinary(e.value,s)}contains(e,t){return e.typeUrl.length?(typeof t=="string"?t:t.typeName)===this.typeUrlToName(e.typeUrl):!1}internalJsonWrite(e,t){if(e.typeUrl==="")return{};let s=this.typeUrlToName(e.typeUrl),r=dA(t),i=r.typeRegistry?.find(d=>d.typeName===s);if(!i)throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '"+e.typeUrl+"' to JSON. The specified type "+s+" is not available in the type registry.");let c=i.fromBinary(e.value,{readUnknownField:!1}),u=i.internalJsonWrite(c,r);return(s.startsWith("google.protobuf.")||!Hh(u))&&(u={value:u}),u["@type"]=e.typeUrl,u}internalJsonRead(e,t,s){if(!Hh(e))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+ga(e)+".");if(typeof e["@type"]!="string"||e["@type"]=="")return this.create();let r=this.typeUrlToName(e["@type"]),i=t?.typeRegistry?.find(u=>u.typeName==r);if(!i)throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type "+r+" is not available in the type registry.");let c;if(r.startsWith("google.protobuf.")&&e.hasOwnProperty("value"))c=i.fromJson(e.value,t);else{let u=Object.assign({},e);delete u["@type"],c=i.fromJson(u,t)}return s===void 0&&(s=this.create()),s.typeUrl=e["@type"],s.value=i.toBinary(c),s}typeNameToUrl(e){if(!e.length)throw new Error("invalid type name: "+e);return"type.googleapis.com/"+e}typeUrlToName(e){if(!e.length)throw new Error("invalid type url: "+e);let t=e.lastIndexOf("/"),s=t>0?e.substring(t+1):e;if(!s.length)throw new Error("invalid type url: "+e);return s}};const j7=new R7;var M7=class extends Y{constructor(){super("google.rpc.Status",[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",repeat:2,T:()=>j7}])}};const KA=new M7;var D7=class extends Y{constructor(){super("sui.rpc.v2.GetServiceInfoRequest",[])}};const U7=new D7;var B7=class extends Y{constructor(){super("sui.rpc.v2.GetServiceInfoResponse",[{no:1,name:"chain_id",kind:"scalar",opt:!0,T:9},{no:2,name:"chain",kind:"scalar",opt:!0,T:9},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"checkpoint_height",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"timestamp",kind:"message",T:()=>Nr},{no:6,name:"lowest_available_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"lowest_available_checkpoint_objects",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"server",kind:"scalar",opt:!0,T:9}])}};const L7=new B7;var z7=class extends Y{constructor(){super("sui.rpc.v2.GetObjectRequest",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"read_mask",kind:"message",T:()=>Ln}])}};const JA=new z7;var $7=class extends Y{constructor(){super("sui.rpc.v2.GetObjectResponse",[{no:1,name:"object",kind:"message",T:()=>mo}])}};const V7=new $7;var P7=class extends Y{constructor(){super("sui.rpc.v2.BatchGetObjectsRequest",[{no:1,name:"requests",kind:"message",repeat:2,T:()=>JA},{no:2,name:"read_mask",kind:"message",T:()=>Ln}])}};const G7=new P7;var F7=class extends Y{constructor(){super("sui.rpc.v2.BatchGetObjectsResponse",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>Z7}])}};const H7=new F7;var q7=class extends Y{constructor(){super("sui.rpc.v2.GetObjectResult",[{no:1,name:"object",kind:"message",oneof:"result",T:()=>mo},{no:2,name:"error",kind:"message",oneof:"result",T:()=>KA}])}};const Z7=new q7;var Y7=class extends Y{constructor(){super("sui.rpc.v2.GetTransactionRequest",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"read_mask",kind:"message",T:()=>Ln}])}};const W7=new Y7;var X7=class extends Y{constructor(){super("sui.rpc.v2.GetTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>pa}])}};const K7=new X7;var J7=class extends Y{constructor(){super("sui.rpc.v2.BatchGetTransactionsRequest",[{no:1,name:"digests",kind:"scalar",repeat:2,T:9},{no:2,name:"read_mask",kind:"message",T:()=>Ln}])}};const Q7=new J7;var eB=class extends Y{constructor(){super("sui.rpc.v2.BatchGetTransactionsResponse",[{no:1,name:"transactions",kind:"message",repeat:2,T:()=>sB}])}};const tB=new eB;var nB=class extends Y{constructor(){super("sui.rpc.v2.GetTransactionResult",[{no:1,name:"transaction",kind:"message",oneof:"result",T:()=>pa},{no:2,name:"error",kind:"message",oneof:"result",T:()=>KA}])}};const sB=new nB;var rB=class extends Y{constructor(){super("sui.rpc.v2.GetCheckpointRequest",[{no:1,name:"sequence_number",kind:"scalar",oneof:"checkpointId",T:4,L:0},{no:2,name:"digest",kind:"scalar",oneof:"checkpointId",T:9},{no:3,name:"read_mask",kind:"message",T:()=>Ln}])}};const aB=new rB;var iB=class extends Y{constructor(){super("sui.rpc.v2.GetCheckpointResponse",[{no:1,name:"checkpoint",kind:"message",T:()=>vb}])}};const oB=new iB;var cB=class extends Y{constructor(){super("sui.rpc.v2.GetEpochRequest",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"read_mask",kind:"message",T:()=>Ln}])}};const lB=new cB;var uB=class extends Y{constructor(){super("sui.rpc.v2.GetEpochResponse",[{no:1,name:"epoch",kind:"message",T:()=>v7}])}};const dB=new uB;var fB=class extends Y{constructor(){super("sui.rpc.v2.ListCheckpointsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"start_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"end_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"filter",kind:"message",T:()=>Up},{no:5,name:"options",kind:"message",T:()=>mb}])}};const hB=new fB;var pB=class extends Y{constructor(){super("sui.rpc.v2.ListCheckpointsResponse",[{no:1,name:"checkpoint",kind:"message",T:()=>vb},{no:2,name:"watermark",kind:"message",T:()=>od},{no:3,name:"end",kind:"message",T:()=>gb}])}};const mB=new pB;var gB=class extends Y{constructor(){super("sui.rpc.v2.ListTransactionsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"start_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"end_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"filter",kind:"message",T:()=>Up},{no:5,name:"options",kind:"message",T:()=>mb}])}};const yB=new gB;var vB=class extends Y{constructor(){super("sui.rpc.v2.ListTransactionsResponse",[{no:1,name:"transaction",kind:"message",T:()=>pa},{no:2,name:"watermark",kind:"message",T:()=>od},{no:3,name:"end",kind:"message",T:()=>gb}])}};const bB=new vB;var wB=class extends Y{constructor(){super("sui.rpc.v2.ListEventsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"start_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"end_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"filter",kind:"message",T:()=>HA},{no:5,name:"options",kind:"message",T:()=>mb}])}};const TB=new wB;var SB=class extends Y{constructor(){super("sui.rpc.v2.ListEventsResponse",[{no:1,name:"event",kind:"message",T:()=>hb},{no:2,name:"watermark",kind:"message",T:()=>od},{no:3,name:"end",kind:"message",T:()=>gb}])}};const EB=new SB,K0=new vi("sui.rpc.v2.LedgerService",[{name:"GetServiceInfo",options:{},I:U7,O:L7},{name:"GetObject",options:{},I:JA,O:V7},{name:"BatchGetObjects",options:{},I:G7,O:H7},{name:"GetTransaction",options:{},I:W7,O:K7},{name:"BatchGetTransactions",options:{},I:Q7,O:tB},{name:"GetCheckpoint",options:{},I:aB,O:oB},{name:"GetEpoch",options:{},I:lB,O:dB},{name:"ListCheckpoints",serverStreaming:!0,options:{},I:hB,O:mB},{name:"ListTransactions",serverStreaming:!0,options:{},I:yB,O:bB},{name:"ListEvents",serverStreaming:!0,options:{},I:TB,O:EB}]);var _B=class{constructor(e){this._transport=e,this.typeName=K0.typeName,this.methods=K0.methods,this.options=K0.options}getServiceInfo(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getObject(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}batchGetObjects(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getTransaction(e,t){const s=this.methods[3],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}batchGetTransactions(e,t){const s=this.methods[4],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getCheckpoint(e,t){const s=this.methods[5],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getEpoch(e,t){const s=this.methods[6],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listCheckpoints(e,t){const s=this.methods[7],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}listTransactions(e,t){const s=this.methods[8],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}listEvents(e,t){const s=this.methods[9],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}},kB=class extends Y{constructor(){super("sui.rpc.v2.GetPackageRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9}])}};const AB=new kB;var OB=class extends Y{constructor(){super("sui.rpc.v2.GetPackageResponse",[{no:1,name:"package",kind:"message",T:()=>EA}])}};const NB=new OB;var xB=class extends Y{constructor(){super("sui.rpc.v2.GetDatatypeRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"module_name",kind:"scalar",opt:!0,T:9},{no:3,name:"name",kind:"scalar",opt:!0,T:9}])}};const CB=new xB;var IB=class extends Y{constructor(){super("sui.rpc.v2.GetDatatypeResponse",[{no:1,name:"datatype",kind:"message",T:()=>_A}])}};const RB=new IB;var jB=class extends Y{constructor(){super("sui.rpc.v2.GetFunctionRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"module_name",kind:"scalar",opt:!0,T:9},{no:3,name:"name",kind:"scalar",opt:!0,T:9}])}};const MB=new jB;var DB=class extends Y{constructor(){super("sui.rpc.v2.GetFunctionResponse",[{no:1,name:"function",kind:"message",T:()=>OA}])}};const UB=new DB;var BB=class extends Y{constructor(){super("sui.rpc.v2.ListPackageVersionsRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12}])}};const LB=new BB;var zB=class extends Y{constructor(){super("sui.rpc.v2.ListPackageVersionsResponse",[{no:1,name:"versions",kind:"message",repeat:2,T:()=>PB},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const $B=new zB;var VB=class extends Y{constructor(){super("sui.rpc.v2.PackageVersion",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const PB=new VB,J0=new vi("sui.rpc.v2.MovePackageService",[{name:"GetPackage",options:{},I:AB,O:NB},{name:"GetDatatype",options:{},I:CB,O:RB},{name:"GetFunction",options:{},I:MB,O:UB},{name:"ListPackageVersions",options:{},I:LB,O:$B}]);var GB=class{constructor(e){this._transport=e,this.typeName=J0.typeName,this.methods=J0.methods,this.options=J0.options}getPackage(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getDatatype(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getFunction(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listPackageVersions(e,t){const s=this.methods[3],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},FB=class extends Y{constructor(){super("sui.rpc.v2.VerifySignatureRequest",[{no:1,name:"message",kind:"message",T:()=>Es},{no:2,name:"signature",kind:"message",T:()=>Dp},{no:3,name:"address",kind:"scalar",opt:!0,T:9},{no:4,name:"jwks",kind:"message",repeat:2,T:()=>jA}])}};const HB=new FB;var qB=class extends Y{constructor(){super("sui.rpc.v2.VerifySignatureResponse",[{no:1,name:"is_valid",kind:"scalar",opt:!0,T:8},{no:2,name:"reason",kind:"scalar",opt:!0,T:9}])}};const ZB=new qB,Q0=new vi("sui.rpc.v2.SignatureVerificationService",[{name:"VerifySignature",options:{},I:HB,O:ZB}]);var YB=class{constructor(e){this._transport=e,this.typeName=Q0.typeName,this.methods=Q0.methods,this.options=Q0.options}verifySignature(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}};let WB=(function(e){return e[e.METADATA_CAP_STATE_UNKNOWN=0]="METADATA_CAP_STATE_UNKNOWN",e[e.CLAIMED=1]="CLAIMED",e[e.UNCLAIMED=2]="UNCLAIMED",e[e.DELETED=3]="DELETED",e})({}),XB=(function(e){return e[e.SUPPLY_STATE_UNKNOWN=0]="SUPPLY_STATE_UNKNOWN",e[e.FIXED=1]="FIXED",e[e.BURN_ONLY=2]="BURN_ONLY",e})({}),KB=(function(e){return e[e.COIN_REGULATED_STATE_UNKNOWN=0]="COIN_REGULATED_STATE_UNKNOWN",e[e.REGULATED=1]="REGULATED",e[e.UNREGULATED=2]="UNREGULATED",e})({}),QA=(function(e){return e[e.DYNAMIC_FIELD_KIND_UNKNOWN=0]="DYNAMIC_FIELD_KIND_UNKNOWN",e[e.FIELD=1]="FIELD",e[e.OBJECT=2]="OBJECT",e})({});var JB=class extends Y{constructor(){super("sui.rpc.v2.GetCoinInfoRequest",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const QB=new JB;var eL=class extends Y{constructor(){super("sui.rpc.v2.GetCoinInfoResponse",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:2,name:"metadata",kind:"message",T:()=>sL},{no:3,name:"treasury",kind:"message",T:()=>aL},{no:4,name:"regulated_metadata",kind:"message",T:()=>oL}])}};const tL=new eL;var nL=class extends Y{constructor(){super("sui.rpc.v2.CoinMetadata",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"decimals",kind:"scalar",opt:!0,T:13},{no:3,name:"name",kind:"scalar",opt:!0,T:9},{no:4,name:"symbol",kind:"scalar",opt:!0,T:9},{no:5,name:"description",kind:"scalar",opt:!0,T:9},{no:6,name:"icon_url",kind:"scalar",opt:!0,T:9},{no:7,name:"metadata_cap_id",kind:"scalar",opt:!0,T:9},{no:8,name:"metadata_cap_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CoinMetadata.MetadataCapState",WB]}])}};const sL=new nL;var rL=class extends Y{constructor(){super("sui.rpc.v2.CoinTreasury",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"total_supply",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"supply_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CoinTreasury.SupplyState",XB]}])}};const aL=new rL;var iL=class extends Y{constructor(){super("sui.rpc.v2.RegulatedCoinMetadata",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_metadata_object",kind:"scalar",opt:!0,T:9},{no:3,name:"deny_cap_object",kind:"scalar",opt:!0,T:9},{no:4,name:"allow_global_pause",kind:"scalar",opt:!0,T:8},{no:5,name:"variant",kind:"scalar",opt:!0,T:13},{no:6,name:"coin_regulated_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.RegulatedCoinMetadata.CoinRegulatedState",KB]}])}};const oL=new iL;var cL=class extends Y{constructor(){super("sui.rpc.v2.GetBalanceRequest",[{no:1,name:"owner",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const lL=new cL;var uL=class extends Y{constructor(){super("sui.rpc.v2.GetBalanceResponse",[{no:1,name:"balance",kind:"message",T:()=>e3}])}};const dL=new uL;var fL=class extends Y{constructor(){super("sui.rpc.v2.ListBalancesRequest",[{no:1,name:"owner",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12}])}};const hL=new fL;var pL=class extends Y{constructor(){super("sui.rpc.v2.ListBalancesResponse",[{no:1,name:"balances",kind:"message",repeat:2,T:()=>e3},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const mL=new pL;var gL=class extends Y{constructor(){super("sui.rpc.v2.Balance",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:3,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"address_balance",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"coin_balance",kind:"scalar",opt:!0,T:4,L:0}])}};const e3=new gL;var yL=class extends Y{constructor(){super("sui.rpc.v2.ListDynamicFieldsRequest",[{no:1,name:"parent",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12},{no:4,name:"read_mask",kind:"message",T:()=>Ln}])}};const vL=new yL;var bL=class extends Y{constructor(){super("sui.rpc.v2.ListDynamicFieldsResponse",[{no:1,name:"dynamic_fields",kind:"message",repeat:2,T:()=>SL},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const wL=new bL;var TL=class extends Y{constructor(){super("sui.rpc.v2.DynamicField",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.DynamicField.DynamicFieldKind",QA]},{no:2,name:"parent",kind:"scalar",opt:!0,T:9},{no:3,name:"field_id",kind:"scalar",opt:!0,T:9},{no:4,name:"field_object",kind:"message",T:()=>mo},{no:5,name:"name",kind:"message",T:()=>Es},{no:6,name:"value",kind:"message",T:()=>Es},{no:7,name:"value_type",kind:"scalar",opt:!0,T:9},{no:8,name:"child_id",kind:"scalar",opt:!0,T:9},{no:9,name:"child_object",kind:"message",T:()=>mo}])}};const SL=new TL;var EL=class extends Y{constructor(){super("sui.rpc.v2.ListOwnedObjectsRequest",[{no:1,name:"owner",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12},{no:4,name:"read_mask",kind:"message",T:()=>Ln},{no:5,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const _L=new EL;var kL=class extends Y{constructor(){super("sui.rpc.v2.ListOwnedObjectsResponse",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>mo},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const AL=new kL,ey=new vi("sui.rpc.v2.StateService",[{name:"ListDynamicFields",options:{},I:vL,O:wL},{name:"ListOwnedObjects",options:{},I:_L,O:AL},{name:"GetCoinInfo",options:{},I:QB,O:tL},{name:"GetBalance",options:{},I:lL,O:dL},{name:"ListBalances",options:{},I:hL,O:mL}]);var OL=class{constructor(e){this._transport=e,this.typeName=ey.typeName,this.methods=ey.methods,this.options=ey.options}listDynamicFields(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listOwnedObjects(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getCoinInfo(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getBalance(e,t){const s=this.methods[3],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listBalances(e,t){const s=this.methods[4],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},NL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeCheckpointsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"filter",kind:"message",T:()=>Up}])}};const xL=new NL;var CL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeCheckpointsResponse",[{no:1,name:"cursor",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"checkpoint",kind:"message",T:()=>vb}])}};const IL=new CL;var RL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeTransactionsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"filter",kind:"message",T:()=>Up}])}};const jL=new RL;var ML=class extends Y{constructor(){super("sui.rpc.v2.SubscribeTransactionsResponse",[{no:1,name:"transaction",kind:"message",T:()=>pa},{no:2,name:"watermark",kind:"message",T:()=>od}])}};const DL=new ML;var UL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeEventsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Ln},{no:2,name:"filter",kind:"message",T:()=>HA}])}};const BL=new UL;var LL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeEventsResponse",[{no:1,name:"event",kind:"message",T:()=>hb},{no:2,name:"watermark",kind:"message",T:()=>od}])}};const zL=new LL,ty=new vi("sui.rpc.v2.SubscriptionService",[{name:"SubscribeCheckpoints",serverStreaming:!0,options:{},I:xL,O:IL},{name:"SubscribeTransactions",serverStreaming:!0,options:{},I:jL,O:DL},{name:"SubscribeEvents",serverStreaming:!0,options:{},I:BL,O:zL}]);var $L=class{constructor(e){this._transport=e,this.typeName=ty.typeName,this.methods=ty.methods,this.options=ty.options}subscribeCheckpoints(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}subscribeTransactions(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}subscribeEvents(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}},VL=class extends Y{constructor(){super("sui.rpc.v2.LookupNameRequest",[{no:1,name:"name",kind:"scalar",opt:!0,T:9}])}};const PL=new VL;var GL=class extends Y{constructor(){super("sui.rpc.v2.LookupNameResponse",[{no:1,name:"record",kind:"message",T:()=>t3}])}};const FL=new GL;var HL=class extends Y{constructor(){super("sui.rpc.v2.ReverseLookupNameRequest",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const qL=new HL;var ZL=class extends Y{constructor(){super("sui.rpc.v2.ReverseLookupNameResponse",[{no:1,name:"record",kind:"message",T:()=>t3}])}};const YL=new ZL;var WL=class extends Y{constructor(){super("sui.rpc.v2.NameRecord",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"registration_nft_id",kind:"scalar",opt:!0,T:9},{no:4,name:"expiration_timestamp",kind:"message",T:()=>Nr},{no:5,name:"target_address",kind:"scalar",opt:!0,T:9},{no:6,name:"data",kind:"map",K:9,V:{kind:"scalar",T:9}}])}};const t3=new WL,ny=new vi("sui.rpc.v2.NameService",[{name:"LookupName",options:{},I:PL,O:FL},{name:"ReverseLookupName",options:{},I:qL,O:YL}]);var XL=class{constructor(e){this._transport=e,this.typeName=ny.typeName,this.methods=ny.methods,this.options=ny.options}lookupName(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}reverseLookupName(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},KL=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceClockRequest",[{no:1,name:"duration_ms",kind:"scalar",opt:!0,T:4,L:0}])}};const JL=new KL;var QL=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceClockResponse",[{no:1,name:"timestamp_ms",kind:"scalar",T:4,L:0},{no:2,name:"tx_digest",kind:"scalar",T:9}])}};const ez=new QL;var tz=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceCheckpointRequest",[])}};const nz=new tz;var sz=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceCheckpointResponse",[{no:1,name:"checkpoint_sequence_number",kind:"scalar",T:4,L:0},{no:2,name:"timestamp_ms",kind:"scalar",T:4,L:0}])}};const rz=new sz;var az=class extends Y{constructor(){super("sui.forking.v1alpha.GetStatusRequest",[])}};const iz=new az;var oz=class extends Y{constructor(){super("sui.forking.v1alpha.GetStatusResponse",[{no:1,name:"epoch",kind:"scalar",T:4,L:0},{no:2,name:"checkpoint_sequence_number",kind:"scalar",T:4,L:0},{no:3,name:"timestamp_ms",kind:"scalar",T:4,L:0},{no:4,name:"forked_at_checkpoint",kind:"scalar",T:4,L:0}])}};const cz=new oz,sy=new vi("sui.forking.v1alpha.ForkingService",[{name:"AdvanceClock",options:{},I:JL,O:ez},{name:"AdvanceCheckpoint",options:{},I:nz,O:rz},{name:"GetStatus",options:{},I:iz,O:cz}]);var lz=class{constructor(e){this._transport=e,this.typeName=sy.typeName,this.methods=sy.methods,this.options=sy.options}advanceClock(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}advanceCheckpoint(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getStatus(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}};const uz=Symbol.for("@mysten/SuiGrpcClient");var bb=class extends TA{get mvr(){return this.core.mvr}get[uz](){return!0}constructor(e){super({network:e.network});const{network:t,mvr:s,abort:r,transport:i,...c}=e,u=_8(i??new lb(c));this.transactionExecutionService=new xU(u),this.ledgerService=new _B(u),this.stateService=new OL(u),this.subscriptionService=new $L(u),this.movePackageService=new GB(u),this.signatureVerificationService=new YB(u),this.nameService=new XL(u),this.forkingService=new lz(u),this.core=new _U({client:this,base:this,network:e.network,mvr:e.mvr})}getObjects(e){return this.core.getObjects(e)}getObject(e){return this.core.getObject(e)}listCoins(e){return this.core.listCoins(e)}listOwnedObjects(e){return this.core.listOwnedObjects(e)}getBalance(e){return this.core.getBalance(e)}listBalances(e){return this.core.listBalances(e)}getCoinMetadata(e){return this.core.getCoinMetadata(e)}getTransaction(e){return this.core.getTransaction(e)}executeTransaction(e){return this.core.executeTransaction(e)}signAndExecuteTransaction(e){return this.core.signAndExecuteTransaction(e)}waitForTransaction(e){return this.core.waitForTransaction(e)}simulateTransaction(e){return this.core.simulateTransaction(e)}getReferenceGasPrice(e){return this.core.getReferenceGasPrice(e)}getCurrentSystemState(e){return this.core.getCurrentSystemState(e)}getProtocolConfig(e){return this.core.getProtocolConfig(e)}getChainIdentifier(e){return this.core.getChainIdentifier(e)}async listDynamicFields(e){const t=e.include?.value??!1,s=["field_id","name","value_type","kind","child_id"];t&&s.push("value");const r=await this.stateService.listDynamicFields({parent:e.parentId,pageToken:e.cursor?Ge(e.cursor):void 0,pageSize:e.limit,readMask:{paths:s}},{abort:e.signal});return{dynamicFields:r.response.dynamicFields.map(i=>{const c=i.kind===QA.OBJECT,u=c?`0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${i.name?.name}>,0x2::object::ID>`:`0x2::dynamic_field::Field<${i.name?.name},${i.valueType}>`;return{$kind:c?"DynamicObject":"DynamicField",fieldId:i.fieldId,name:{type:i.name?.name,bcs:i.name?.value},valueType:i.valueType,type:De(u),childId:i.childId,value:t?{type:i.valueType,bcs:i.value?.value??new Uint8Array}:void 0}}),cursor:r.response.nextPageToken?Ke(r.response.nextPageToken):null,hasNextPage:r.response.nextPageToken!==void 0}}getDynamicField(e){return this.core.getDynamicField(e)}getDynamicObjectField(e){return this.core.getDynamicObjectField(e)}listTransactions(e){return this.core.listTransactions(e)}listEvents(e){return this.core.listEvents(e)}getMoveFunction(e){return this.core.getMoveFunction(e)}resolveTransactionPlugin(){return this.core.resolveTransactionPlugin()}verifyZkLoginSignature(e){return this.core.verifyZkLoginSignature(e)}defaultNameServiceName(e){return this.core.defaultNameServiceName(e)}resolveNameServiceAddress(e){return this.core.resolveNameServiceAddress(e)}};const dz="Dev Wallet",JE="dev-wallet:networks",fz={devnet:"https://fullnode.devnet.sui.io:443",testnet:"https://fullnode.testnet.sui.io:443",localnet:"http://127.0.0.1:9000"};var hz=class{#e;#t;#r;#s;#a;#i;#o;#c;#n;#m;#h;#f;#p=null;#l;#g;#d;#y;#u;#b;#w;#k=!1;constructor(e){e.adapters.length===0&&console.warn("[dev-wallet] No adapters provided. The wallet will have no accounts."),this.#e=e.adapters,this.#h=e.persistNetworks??!1,this.#t=this.#D(e.networks??fz),this.#r={...e.faucets},this.#s={},this.#a=e.activeNetwork??Object.keys(this.#t)[0]??"",this.#i=e.name??dz,this.#o=e.icon??"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgd2lkdGg9IjY0IiBoZWlnaHQ9IjY0Ij4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0id2FsbGV0R3JhZCIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMTAwJSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0eWxlPSJzdG9wLWNvbG9yOiM2MzY2RjEiIC8+CiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6IzI1NjNFQiIgLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImZsYXBHcmFkIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjEwMCUiIHkyPSIxMDAlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3R5bGU9InN0b3AtY29sb3I6IzgxOENGOCIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdHlsZT0ic3RvcC1jb2xvcjojNEY0NkU1IiAvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICA8L2RlZnM+CiAgPCEtLSBTaGFkb3cgLS0+CiAgPHJlY3QgeD0iOSIgeT0iMjEiIHdpZHRoPSI1MCIgaGVpZ2h0PSIzNiIgcng9IjYiIHJ5PSI2IiBmaWxsPSIjMDAwIiBvcGFjaXR5PSIwLjEiIC8+CiAgPCEtLSBXYWxsZXQgYm9keSAtLT4KICA8cmVjdCB4PSI2IiB5PSIxOCIgd2lkdGg9IjUwIiBoZWlnaHQ9IjM2IiByeD0iNiIgcnk9IjYiIGZpbGw9InVybCgjd2FsbGV0R3JhZCkiIC8+CiAgPCEtLSBGbGFwIC0tPgogIDxwYXRoIGQ9Ik02IDI2IEw2IDIyIEM2IDE1IDggMTIgMTQgMTIgTDQ2IDEyIEM1MiAxMiA1NiAxNSA1NiAyMiBMNTYgMjYgWiIgZmlsbD0idXJsKCNmbGFwR3JhZCkiIC8+CiAgPCEtLSBDbGFzcCAtLT4KICA8cmVjdCB4PSI0MiIgeT0iMzAiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxMiIgcng9IjQiIHJ5PSI0IiBmaWxsPSIjNDMzOENBIiAvPgogIDwhLS0gR29sZCBjb2luIGluIGNsYXNwIC0tPgogIDxjaXJjbGUgY3g9IjQ4IiBjeT0iMzYiIHI9IjMuNSIgZmlsbD0iI0ZDRDM0RCIgLz4KICA8Y2lyY2xlIGN4PSI0OCIgY3k9IjM2IiByPSIyIiBmaWxsPSIjRjU5RTBCIiAvPgogIDwhLS0gRW1ib3NzZWQgRFcgdGV4dCAtLT4KICA8dGV4dCB4PSIyNiIgeT0iNDUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmIiBmb250LXdlaWdodD0iOTAwIiBmb250LXNpemU9IjE4IiBmaWxsPSIjMzczMEEzIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkb21pbmFudC1iYXNlbGluZT0ibWlkZGxlIiBsZXR0ZXItc3BhY2luZz0iMiI+RFc8L3RleHQ+CiAgPHRleHQgeD0iMjYiIHk9IjQ0IiBmb250LWZhbWlseT0iQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZiIgZm9udC13ZWlnaHQ9IjkwMCIgZm9udC1zaXplPSIxOCIgZmlsbD0iI0M3RDJGRSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGxlIiBsZXR0ZXItc3BhY2luZz0iMiI+RFc8L3RleHQ+Cjwvc3ZnPgo=",this.#c=e.autoApprove??!1,this.#n=e.autoConnect??!1,this.#m=e.clientFactory??((t,s)=>new bb({baseUrl:s,network:t})),this.#f=this.#A(),this.#l=Z4(),this.#g=[],this.#d=null,this.#y=new Set,this.#u=null,this.#b=new Set,this.#w=new Set,this.#C()}get version(){return"1.0.0"}get name(){return this.#i}get icon(){return this.#o}get chains(){return Ij(Object.keys(this.#t))}get accounts(){return this.#v()}setSelectedAccount(e){if(e!==null){const t=this.#f.find(s=>s.address.toLowerCase()===e.toLowerCase());if(t===void 0){const s=this.#f.map(r=>r.address).join(", ");throw new Error(`No dev-wallet account for address "${e}". Available: ${s||"(none)"}`)}this.#p=t.address}else this.#p=null;this.#l.emit("change",{accounts:this.#v()})}#v(){return this.#p===null?this.#f:this.#f.filter(e=>e.address.toLowerCase()===this.#p.toLowerCase())}get features(){return{"standard:connect":{version:"1.0.0",connect:this.#R},"standard:events":{version:"1.0.0",on:this.#I},"standard:disconnect":{version:"1.0.0",disconnect:this.#j},"sui:signPersonalMessage":{version:"1.1.0",signPersonalMessage:this.#L},"sui:signTransaction":{version:"2.0.0",signTransaction:this.#z},"sui:signAndExecuteTransaction":{version:"2.0.0",signAndExecuteTransaction:this.#$}}}get pendingRequest(){return this.#d}get adapters(){return this.#e}getAdapterForAccount(e){return this.#e.find(t=>t.getAccount(e)!==void 0)}get clients(){for(const e of Object.keys(this.#t))this.#S(e);return{...this.#s}}getClient(e){return this.#S(e)}get networkUrls(){return{...this.#t}}get faucetUrls(){return{...this.#r}}getFaucet(e){return this.#r[e]??null}get activeFaucet(){return this.getFaucet(this.#a)}get activeNetwork(){return this.#a}get activeClient(){return!this.#a||!this.#t[this.#a]?null:this.#S(this.#a)}get availableNetworks(){return Object.keys(this.#t)}setActiveNetwork(e){if(!this.#t[e])throw new Error(`No client for network "${e}". Available: ${this.availableNetworks.join(", ")}`);this.#a=e,this.#l.emit("change",{accounts:this.#v()})}addNetwork(e,t,s){let r;try{r=new URL(t)}catch{throw new Error(`Invalid URL: ${t}`)}if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error(`Invalid URL: must use http or https (got ${r.protocol})`);this.#t[e]=t,this.#s[e]=this.#m(e,t),s!=null&&(this.#r[e]=s),this.#O(),this.#l.emit("change",{accounts:this.#v()})}removeNetwork(e){delete this.#t[e],delete this.#r[e],delete this.#s[e],this.#a===e&&(this.#a=Object.keys(this.#t)[0]??""),this.#O(),this.#l.emit("change",{accounts:this.#v()})}register(){return typeof process<"u"&&console.warn("[@mysten-incubation/dev-wallet] DevWallet is intended for development only. Do not use in production."),Cp().register(this)}destroy(){this.#k=!0;for(const e of this.#g)e();this.#g=[];for(const e of this.#e)e.destroy();this.#d&&(this.#d.reject(new Error("Wallet destroyed.")),this.#d=null),this.#u&&(this.#u.reject(new Error("Wallet destroyed.")),this.#u=null),this.#y.clear(),this.#b.clear(),this.#w.clear(),this.#l.all.clear()}async approveRequest(){const e=this.#d;if(!e)throw new Error("No pending request to approve.");try{const t=await this.#N(e.type,e.account,e.chain,e.data);this.#d=null,this.#T(),e.resolve(t)}catch(t){this.#d=null,this.#T(),e.reject(t instanceof Error?t:new Error(String(t)))}}rejectRequest(e){const t=this.#d;if(!t)throw new Error("No pending request to reject.");this.#d=null,this.#T(),t.reject(new Error(e??"Request rejected by user."))}onRequestChange(e){return this.#y.add(e),()=>{this.#y.delete(e)}}get pendingConnect(){return this.#u}approveConnect(e){const t=this.#u;if(!t)throw new Error("No pending connect request to approve.");const s=e.length>0?this.#f.filter(r=>e.includes(r.address)):[...this.#f];this.#u=null,this.#E(),t.resolve({accounts:s})}rejectConnect(e){const t=this.#u;if(!t)throw new Error("No pending connect request to reject.");this.#u=null,this.#E(),t.reject(new Error(e??"Connection rejected by user."))}onConnectChange(e){return this.#b.add(e),()=>{this.#b.delete(e)}}#T(){const e=this.#d;for(const t of this.#y)t(e)}#E(){const e=this.#u;for(const t of this.#b)t(e)}onDAppConnected(e){return this.#w.add(e),()=>{this.#w.delete(e)}}#x(){for(const e of this.#w)try{e()}catch(t){console.error("[dev-wallet] onDAppConnected listener threw:",t)}}#A(){return this.#e.flatMap(e=>e.getAccounts().map(t=>t.walletAccount))}#C(){for(const e of this.#e){const t=e.onAccountsChanged(()=>{this.#f=this.#A(),this.#l.emit("change",{accounts:this.#v()})});this.#g.push(t)}}#I=(e,t)=>(this.#l.on(e,t),()=>this.#l.off(e,t));#R=async()=>(this.#x(),this.#n?{accounts:this.accounts}:this.#u?Promise.reject(new Error("A connect request is already pending.")):new Promise((e,t)=>{this.#u={id:crypto.randomUUID(),resolve:e,reject:t},this.#E()}));#j=async()=>{};#M(e){const t=Rj(e);if(!t)throw new Error(`Invalid chain identifier: ${e}`);return this.#S(t)}#D(e){if(!this.#h||typeof localStorage>"u")return{...e};try{const t=localStorage.getItem(JE);if(t){const s=JSON.parse(t);if(typeof s=="object"&&s!==null&&!Array.isArray(s))return s}}catch{}return{...e}}#O(){!this.#h||typeof localStorage>"u"||localStorage.setItem(JE,JSON.stringify(this.#t))}#S(e){if(!this.#s[e]){const t=this.#t[e];if(!t)throw new Error(`No client for network "${e}". Available: ${this.availableNetworks.join(", ")}`);this.#s[e]=this.#m(e,t)}return this.#s[e]}#U(e){for(const s of this.#e){const r=s.getAccount(e);if(r)return r.signer}const t=this.#e.flatMap(s=>s.getAccounts().map(r=>r.address));throw new Error(`No account found for address "${e}". Available addresses: ${t.join(", ")}`)}#B(e,t,s,r){return this.getAdapterForAccount(t.address)?.allowAutoSign===!1?!1:this.#c===!0?!0:typeof this.#c=="function"?this.#c({type:e,account:t,chain:s,data:r}):!1}async#N(e,t,s,r){return jj({type:e,signer:this.#U(t.address),data:r,client:e!=="sign-personal-message"?this.#M(s):void 0})}#_(e,t,s,r){return this.#k?Promise.reject(new Error("Wallet has been destroyed.")):this.#B(e,t,s,r)?this.#N(e,t,s,r):this.#d?Promise.reject(new Error("A signing request is already pending.")):new Promise((i,c)=>{this.#d={id:crypto.randomUUID(),type:e,account:t,chain:s,data:r,resolve:i,reject:c},this.#T()})}#L=async e=>this.#_("sign-personal-message",e.account,e.chain??"sui:unknown",e.message);#z=async e=>{const t=await e.transaction.toJSON();return this.#_("sign-transaction",e.account,e.chain,t)};#$=async e=>{const t=await e.transaction.toJSON();return this.#_("sign-and-execute-transaction",e.account,e.chain,t)}};const pz="modulepreload",mz=function(e,t){return new URL(e,t).href},QE={},gz=function(t,s,r){let i=Promise.resolve();if(s&&s.length>0){let m=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const u=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=d?.nonce||d?.getAttribute("nonce");i=m(s.map(g=>{if(g=mz(g,r),g in QE)return;QE[g]=!0;const y=g.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(r)for(let O=u.length-1;O>=0;O--){const C=u[O];if(C.href===g&&(!y||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${b}`))return;const E=document.createElement("link");if(E.rel=y?"stylesheet":pz,y||(E.as="script"),E.crossOrigin="",E.href=g,p&&E.setAttribute("nonce",p),document.head.appendChild(E),y)return new Promise((O,C)=>{E.addEventListener("load",O),E.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${g}`)))})}))}function c(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return i.then(u=>{for(const d of u||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})};async function yz(e){const{autoInitialize:t=!0,createInitialAccount:s=!1,mountUI:r=!0,dockStyle:i,container:c,onWalletCreated:u,...d}=e;if(t&&await Promise.all(d.adapters.map(y=>y.initialize())),s&&!d.adapters.some(y=>y.getAccounts().length>0)){const y=d.adapters.find(b=>b.createAccount&&b.getAccounts().length===0);y?.createAccount&&await y.createAccount({label:"Dev Account"})}const p=new hz(d);u?.(p);let m;if(r&&typeof document<"u"){const{mountDevWallet:y}=await gz(async()=>{const{mountDevWallet:b}=await import("./mount-wnWN72B8.js");return{mountDevWallet:b}},[],import.meta.url);m=y(p,{container:c,dockStyle:i})}const g=p.register();return{wallet:p,dispose(){m?.(),g(),p.destroy()}}}function vz(e){return{id:"dev-wallet-initializer",async initialize({networks:t,getClient:s}){const r={};for(const c of t)r[c]=`dapp-kit://${c}`;const{dispose:i}=await yz({adapters:e.adapters,networks:r,name:e.name,icon:e.icon,autoApprove:e.autoApprove,autoConnect:e.autoConnect,clientFactory:c=>s(c),autoInitialize:e.autoInitialize??!0,createInitialAccount:e.createInitialAccount??!0,mountUI:e.mountUI??!1,dockStyle:e.dockStyle,container:e.container,onWalletCreated:e.onWalletCreated});return{unregister:i}}}}var bz=class{constructor(){this.allowAutoSign=!0,this.#e=[],this.#t=new Set}#e;#t;getAccounts(){return[...this.#e]}getAccount(e){return this.#e.find(t=>t.address===e)}onAccountsChanged(e){return this.#t.add(e),()=>{this.#t.delete(e)}}destroy(){this.#e=[],this.#t.clear()}get _accounts(){return this.#e}setInitialAccounts(e){this.#e=e,this.notifyListeners()}addAccount(e){this.#e.push(e),this.notifyListeners()}removeAccountByAddress(e){const t=this.#e.findIndex(s=>s.address===e);return t===-1?!1:(this.#e.splice(t,1),this.notifyListeners(),!0)}replaceAccount(e,t){const s=this.#e.findIndex(r=>r.address===e);return s===-1?!1:(this.#e[s]=t,this.notifyListeners(),!0)}_performRename(e,t){const s=this.getAccount(e);return s?this.replaceAccount(e,Jy(s.signer,e,t)):!1}getDefaultLabel(){return`Account ${this.getAccounts().length+1}`}notifyListeners(){const e=this.getAccounts();for(const t of this.#t)t(e)}};const Ps={ED25519:0,Secp256k1:1,Secp256r1:2,MultiSig:3,ZkLogin:5,Passkey:6},wz={ED25519:32,Secp256k1:33,Secp256r1:33,Passkey:33},Bp={0:"ED25519",1:"Secp256k1",2:"Secp256r1",3:"MultiSig",5:"ZkLogin",6:"Passkey"};function n3(e,t){return M.IntentMessage(M.bytes(t.length)).serialize({intent:{scope:{[e]:!0},version:{V0:!0},appId:{Sui:!0}},value:t}).toBytes()}function mi(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}var ol=class{equals(e){return mi(this.toRawBytes(),e.toRawBytes())}toBase64(){return Ke(this.toRawBytes())}toString(){throw new Error("`toString` is not implemented on public keys. Use `toBase64()` or `toRawBytes()` instead.")}toSuiPublicKey(){return Ke(this.toSuiBytes())}verifyWithIntent(e,t,s){const r=po(n3(s,e),{dkLen:32});return this.verify(r,t)}verifyPersonalMessage(e,t){return this.verifyWithIntent(M.byteVector().serialize(e).toBytes(),t,"PersonalMessage")}verifyTransaction(e,t){return this.verifyWithIntent(e,t,"TransactionData")}verifyAddress(e){return this.toSuiAddress()===e}toSuiBytes(){const e=this.toRawBytes(),t=new Uint8Array(e.length+1);return t.set([this.flag()]),t.set(e,1),t}toSuiAddress(){return ye(il(po(this.toSuiBytes(),{dkLen:32})).slice(0,sl*2))}};function wb(e){const t=Ge(e),s=Bp[t[0]];switch(s){case"ED25519":case"Secp256k1":case"Secp256r1":const r=wz[s],i=t.slice(1,t.length-r);return{serializedSignature:e,signatureScheme:s,signature:i,publicKey:t.slice(1+i.length),bytes:t};default:throw new Error("Unsupported signature scheme")}}const Tz=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Xa=new Uint32Array(64);class Sz extends Hk{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(t,s){super(64,t,8,!1),this.A=s[0]|0,this.B=s[1]|0,this.C=s[2]|0,this.D=s[3]|0,this.E=s[4]|0,this.F=s[5]|0,this.G=s[6]|0,this.H=s[7]|0}get(){const{A:t,B:s,C:r,D:i,E:c,F:u,G:d,H:p}=this;return[t,s,r,i,c,u,d,p]}set(t,s,r,i,c,u,d,p){this.A=t|0,this.B=s|0,this.C=r|0,this.D=i|0,this.E=c|0,this.F=u|0,this.G=d|0,this.H=p|0}_cloneInto(t){return(t||=new this.constructor).set(...this.get()),this._cloneIntoMeta(t)}process(t,s){for(let y=0;y<16;y++,s+=4)Xa[y]=t.getUint32(s,!1);for(let y=16;y<64;y++){const b=Xa[y-15],E=Xa[y-2],O=br(b,7)^br(b,18)^b>>>3,C=br(E,17)^br(E,19)^E>>>10;Xa[y]=C+Xa[y-7]+O+Xa[y-16]|0}let{A:r,B:i,C:c,D:u,E:d,F:p,G:m,H:g}=this;for(let y=0;y<64;y++){const b=br(d,6)^br(d,11)^br(d,25),E=g+b+e5(d,p,m)+Tz[y]+Xa[y]|0,C=(br(r,2)^br(r,13)^br(r,22))+t5(r,i,c)|0;g=m,m=p,p=d,d=u+E|0,u=c,c=i,i=r,r=E+C|0}r=r+this.A|0,i=i+this.B|0,c=c+this.C|0,u=u+this.D|0,d=d+this.E|0,p=p+this.F|0,m=m+this.G|0,g=g+this.H|0,this.set(r,i,c,u,d,p,m,g)}roundClean(){Vs(Xa)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Vs(this.buffer)}}class Ez extends Sz{constructor(){super(32,n5)}}const s3=qR(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),_z=s3[0],kz=s3[1],Ka=new Uint32Array(80),Ja=new Uint32Array(80);class Az extends Hk{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(t,s){super(128,t,16,!1),this.Ah=s[0]|0,this.Al=s[1]|0,this.Bh=s[2]|0,this.Bl=s[3]|0,this.Ch=s[4]|0,this.Cl=s[5]|0,this.Dh=s[6]|0,this.Dl=s[7]|0,this.Eh=s[8]|0,this.El=s[9]|0,this.Fh=s[10]|0,this.Fl=s[11]|0,this.Gh=s[12]|0,this.Gl=s[13]|0,this.Hh=s[14]|0,this.Hl=s[15]|0}get(){const{Ah:t,Al:s,Bh:r,Bl:i,Ch:c,Cl:u,Dh:d,Dl:p,Eh:m,El:g,Fh:y,Fl:b,Gh:E,Gl:O,Hh:C,Hl:R}=this;return[t,s,r,i,c,u,d,p,m,g,y,b,E,O,C,R]}set(t,s,r,i,c,u,d,p,m,g,y,b,E,O,C,R){this.Ah=t|0,this.Al=s|0,this.Bh=r|0,this.Bl=i|0,this.Ch=c|0,this.Cl=u|0,this.Dh=d|0,this.Dl=p|0,this.Eh=m|0,this.El=g|0,this.Fh=y|0,this.Fl=b|0,this.Gh=E|0,this.Gl=O|0,this.Hh=C|0,this.Hl=R|0}_cloneInto(t){return(t||=new this.constructor).set(...this.get()),this._cloneIntoMeta(t)}process(t,s){for(let W=0;W<16;W++,s+=4)Ka[W]=t.getUint32(s),Ja[W]=t.getUint32(s+=4);for(let W=16;W<80;W++){const oe=Ka[W-15]|0,me=Ja[W-15]|0,G=ni(oe,me,1)^ni(oe,me,8)^aE(oe,me,7),J=si(oe,me,1)^si(oe,me,8)^iE(oe,me,7),w=Ka[W-2]|0,A=Ja[W-2]|0,N=ni(w,A,19)^_u(w,A,61)^aE(w,A,6),F=si(w,A,19)^ku(w,A,61)^iE(w,A,6),B=XR(J,F,Ja[W-7],Ja[W-16]),q=KR(B,G,N,Ka[W-7],Ka[W-16]);Ka[W]=q|0,Ja[W]=B|0}let{Ah:r,Al:i,Bh:c,Bl:u,Ch:d,Cl:p,Dh:m,Dl:g,Eh:y,El:b,Fh:E,Fl:O,Gh:C,Gl:R,Hh:$,Hl:x}=this;for(let W=0;W<80;W++){const oe=ni(y,b,14)^ni(y,b,18)^_u(y,b,41),me=si(y,b,14)^si(y,b,18)^ku(y,b,41),G=y&E^~y&C,J=b&O^~b&R,w=JR(x,me,J,kz[W],Ja[W]),A=QR(w,$,oe,G,_z[W],Ka[W]),N=w|0,F=ni(r,i,28)^_u(r,i,34)^_u(r,i,39),B=si(r,i,28)^ku(r,i,34)^ku(r,i,39),q=r&c^r&d^c&d,z=i&u^i&p^u&p;$=C|0,x=R|0,C=E|0,R=O|0,E=y|0,O=b|0,{h:y,l:b}=Ks(m|0,g|0,A|0,N|0),m=d|0,g=p|0,d=c|0,p=u|0,c=r|0,u=i|0;const D=nb(N,B,z);r=sb(D,A,F,q),i=D|0}({h:r,l:i}=Ks(this.Ah|0,this.Al|0,r|0,i|0)),{h:c,l:u}=Ks(this.Bh|0,this.Bl|0,c|0,u|0),{h:d,l:p}=Ks(this.Ch|0,this.Cl|0,d|0,p|0),{h:m,l:g}=Ks(this.Dh|0,this.Dl|0,m|0,g|0),{h:y,l:b}=Ks(this.Eh|0,this.El|0,y|0,b|0),{h:E,l:O}=Ks(this.Fh|0,this.Fl|0,E|0,O|0),{h:C,l:R}=Ks(this.Gh|0,this.Gl|0,C|0,R|0),{h:$,l:x}=Ks(this.Hh|0,this.Hl|0,$|0,x|0),this.set(r,i,c,u,d,p,m,g,y,b,E,O,C,R,$,x)}roundClean(){Vs(Ka,Ja)}destroy(){this.destroyed=!0,Vs(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Oz extends Az{constructor(){super(64,s5)}}const Tb=tb(()=>new Ez,Pk(1)),cd=tb(()=>new Oz,Pk(3));function r3(e,t,s=()=>{}){if(!Array.isArray(e))throw new TypeError(`"${t}" expected array, got type=${typeof e}`);for(let r=0;r<e.length;r++)s(e[r],`${t}[${r}]`);return e}const Mt=(e,t,s)=>Un(e,t,s),a3=as;function Nz(e,t=""){if(typeof e!="string"){const s=t&&`"${t}" `;throw new TypeError(s+"expected string, got type="+typeof e)}return e}function Cc(e,t="object"){if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(t==="object"?"expected valid options object":`"${t}" expected object, got type=${typeof e}`);return e}function Du(e,t){if(typeof e!="function")throw new TypeError(`"${t}" is invalid: expected function, got ${typeof e}`);return e}const Sb=il,Sr=(...e)=>PR(...e),Kh=e=>Qv(e),ld=Hy,ud=e=>GR(e),Jh=BigInt(0),e_=BigInt(1),xz=e=>e?`"${e}" `:"";function xr(e,t=""){if(typeof e!="boolean")throw new TypeError(xz(t)+"expected boolean, got type="+typeof e);return e}function Eb(e){if(typeof e=="bigint"){if(!ro(e))throw new RangeError("positive bigint expected, got "+e)}else a3(e);return e}function Hc(e,t=""){if(typeof e!="number"){const s=t&&`"${t}" `;throw new TypeError(s+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){const s=t&&`"${t}" `;throw new RangeError(s+"expected safe integer, got "+e)}}function Jf(e){const t=Eb(e).toString(16);return t.length&1?"0"+t:t}function i3(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?Jh:BigInt("0x"+e)}function qc(e){return i3(il(e))}function Fu(e){return i3(il(Qh(Un(e)).reverse()))}function _b(e,t){if(as(t),t===0)throw new Error("zero output length is invalid");e=Eb(e);const s=t*2,r=e.toString(16);if(r.length>s)throw new RangeError("number is too large");return Qv(r.padStart(s,"0"))}function o3(e,t){return _b(e,t).reverse()}function Qh(e){return Uint8Array.from(Mt(e))}function ro(e){return typeof e=="bigint"&&Jh<=e}function c3(e,t,s){return ro(e)&&ro(t)&&ro(s)&&t<=e&&e<s}function ep(e,t,s,r){if(!c3(t,s,r))throw new RangeError("expected valid "+e+": "+s+" <= n < "+r+", got "+t)}function kb(e){if(e<Jh)throw new Error("expected non-negative bigint, got "+e);return e===Jh?0:e.toString(2).length}const Ab=e=>(Hc(e,"n"),(e_<<BigInt(e))-e_);function Cz(e,t,s){if(as(e,"hashLen"),as(t,"qByteLen"),typeof s!="function")throw new TypeError("hmacFn must be a function");const r=R=>new Uint8Array(R),i=Uint8Array.of(),c=Uint8Array.of(0),u=Uint8Array.of(1),d=1e3;let p=r(e),m=r(e),g=0;const y=()=>{p.fill(1),m.fill(0),g=0},b=(...R)=>s(m,Sr(p,...R)),E=(R=i)=>{m=b(c,R),p=b(),R.length!==0&&(m=b(u,R),p=b())},O=()=>{if(g++>=d)throw new Error("drbg: tried max amount of iterations");let R=0;const $=[];for(;R<t;){p=b();const x=p.slice();$.push(x),R+=p.length}return Sr(...$)};return(R,$)=>{y(),E(R);let x;for(;(x=$(O()))===void 0;)E();return y(),x}}function _r(e,t={},s={},r="object"){Cc(e,r),Cc(t,"fields"),Cc(s,"optFields");function i(u,d,p){const m=r==="object"?`param "${String(u)}"`:`"${r}.${String(u)}"`,g=e[u];if(!Object.hasOwn(e,u)&&(p?g!==void 0:d!=="function"))throw new TypeError(`${m} is invalid: expected own property`);if(p&&g===void 0)return;const y=typeof g;if(y!==d||g===null)throw new TypeError(`${m} is invalid: expected ${d}, got ${y}`)}const c=(u,d)=>Object.entries(u).forEach(([p,m])=>i(p,m,d));c(t,!1),c(s,!0)}const dn=BigInt(0),vt=BigInt(1),ci=BigInt(2),l3=BigInt(3),Ob=BigInt(4),u3=BigInt(5),Iz=BigInt(7),d3=BigInt(8),Rz=BigInt(9),jz=BigInt(15),f3=BigInt(16),Mz=BigInt("0x10000000000000000");function Ht(e,t){if(t<=dn)throw new Error("mod: expected positive modulus, got "+t);const s=e%t;return s>=dn?s:t+s}function h3(e,t,s){if(s<=vt)throw new Error("pow: expected modulus > 1, got "+s);if(typeof t!="bigint")throw new TypeError("invalid exponent: expected bigint, got "+typeof t);if(t<dn)throw new Error("invalid exponent, negatives unsupported");if(t===dn)return vt;if(t===vt)return e;let r=e%s;if(r<dn&&(r+=s),t<Mz){let d=vt;for(;t>dn;)t&vt&&(d=d*r%s),r=r*r%s,t>>=vt;return d}const i=[];for(;t>dn;)i.push(Number(t&jz)),t>>=Ob;const c=new Array(16);c[0]=vt,c[1]=r;for(let d=2;d<16;d++)c[d]=c[d-1]*r%s;let u=c[i[i.length-1]];for(let d=i.length-2;d>=0;d--){u=u*u%s,u=u*u%s,u=u*u%s,u=u*u%s;const p=i[d];p!==0&&(u=u*c[p]%s)}return u}function Ft(e,t,s){if(s<=vt)throw new Error("pow2: expected modulus > 1, got "+s);if(t<dn)throw new Error("pow2: expected non-negative exponent, got "+t);let r=e;for(;t-- >dn;)r*=r,r%=s;return r}function t_(e,t){if(e===dn)throw new Error("invert: expected non-zero number");if(t<=vt)throw new Error("invert: expected modulus > 1, got "+t);let s=Ht(e,t),r=t,i=dn,c=vt;for(;s!==dn;){const d=r/s,p=r-s*d,m=i-c*d;r=s,s=p,i=c,c=m}if(r!==vt)throw new Error("invert: does not exist");return Ht(i,t)}function Dz(e,t){if(t<=vt)throw new Error("invertCt: expected prime modulus > 1, got "+t);const s=Ht(e,t);if(s===dn)throw new Error("invertCt: expected non-zero number");const r=h3(s,t-ci,t);if(Ht(s*r,t)!==vt)throw new Error("invertCt: does not exist");return r}function Nb(e,t,s){const r=e;if(!r.eql(r.sqr(t),s))throw new Error("Cannot find square root")}function xb(e,t){if((e&vt)===dn)throw new Error(t+": expected odd modulus, got "+e)}function p3(e,t){const s=e,r=(s.ORDER+vt)/Ob,i=s.pow(t,r);return Nb(s,i,t),i}function Uz(e,t){const s=e,r=(s.ORDER-u3)/d3,i=s.mul(t,ci),c=s.pow(i,r),u=s.mul(t,c),d=s.mul(s.mul(u,ci),c),p=s.mul(u,s.sub(d,s.ONE));return Nb(s,p,t),p}function Bz(e){const t=Lp(e),s=m3(e),r=s(t,t.neg(t.ONE)),i=s(t,r),c=s(t,t.neg(r)),u=(e+Iz)/f3;return((d,p)=>{const m=d;let g=m.pow(p,u),y=m.mul(g,r);const b=m.mul(g,i),E=m.mul(g,c),O=m.eql(m.sqr(y),p),C=m.eql(m.sqr(b),p);g=m.cmov(g,y,O),y=m.cmov(E,b,C);const R=m.eql(m.sqr(y),p),$=m.cmov(g,y,R);return Nb(m,$,p),$})}function m3(e){if(e<l3)throw new Error("sqrt is not defined for small field");xb(e,"tonelliShanks");let t=e-vt,s=0;for(;t%ci===dn;)t/=ci,s++;let r=ci;const i=Lp(e);for(;tp(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(s===1)return p3;let c=i.pow(r,t);const u=(t+vt)/ci;return function(p,m){const g=p;if(g.is0(m))return m;if(tp(g,m)!==1)throw new Error("Cannot find square root");let y=s,b=g.mul(g.ONE,c),E=g.pow(m,t),O=g.pow(m,u);for(;!g.eql(E,g.ONE);){if(g.is0(E))throw new Error("Cannot find square root: probably non-prime P");let C=1,R=g.sqr(E);for(;!g.eql(R,g.ONE);)if(C++,R=g.sqr(R),C===y)throw new Error("Cannot find square root");const $=vt<<BigInt(y-C-1),x=g.pow(b,$);y=C,b=g.sqr(x),E=g.mul(E,b),O=g.mul(O,x)}return O}}function Lz(e){return xb(e,"Fp.sqrt"),e%Ob===l3?p3:e%d3===u3?Uz:e%f3===Rz?Bz(e):m3(e)}const zz=(e,t)=>(Ht(e,t)&vt)===vt,$z=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Hu(e){if(Cc(e,"field"),typeof e.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof e.ORDER);Hc(e.BYTES,"BYTES"),Hc(e.BITS,"BITS");for(const t of $z)Du(e[t],"field."+t);if(e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=vt)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function g3(e,t,s=!1){Hu(e),r3(t,"nums"),xr(s,"passZero");const r=e,i=new Array(t.length).fill(s?r.ZERO:void 0),c=t.reduce((d,p,m)=>r.is0(p)?d:(i[m]=d,r.mul(d,p)),r.ONE),u=r.inv(c);return t.reduceRight((d,p,m)=>r.is0(p)?d:(i[m]=r.mul(d,i[m]),r.mul(d,p)),u),i}function tp(e,t){Hu(e);const s=e;xb(s.ORDER,"FpLegendre");const r=(s.ORDER-vt)/ci,i=s.pow(t,r),c=s.eql(i,s.ONE),u=s.eql(i,s.ZERO),d=s.eql(i,s.neg(s.ONE));if(!c&&!u&&!d)throw new Error("invalid Legendre symbol result");return c?1:u?0:-1}function Vz(e,t){if(t!==void 0&&a3(t),e<=dn)throw new Error("invalid n length: expected positive n, got "+e);if(t!==void 0&&t<1)throw new Error("invalid n length: expected positive bit length, got "+t);const s=kb(e);if(t!==void 0&&t<s)throw new Error(`invalid n length: expected nBitLength (${t}) >= bitLen(n) (${s})`);const r=t!==void 0?t:s,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}const n_=new WeakMap;class s_{ORDER;BITS;BYTES;isLE;ZERO=dn;ONE=vt;_lengths;_mod;constructor(t,s={}){if(t<=vt)throw new Error("invalid field: expected ORDER > 1, got "+t);let r;this.isLE=!1,s!=null&&typeof s=="object"&&(typeof s.BITS=="number"&&(r=s.BITS),typeof s.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:s.sqrt,enumerable:!0}),typeof s.isLE=="boolean"&&(this.isLE=s.isLE),s.allowedLengths&&(this._lengths=Object.freeze(s.allowedLengths.slice())),typeof s.modFromBytes=="boolean"&&(this._mod=s.modFromBytes));const{nBitLength:i,nByteLength:c}=Vz(t,r);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=i,this.BYTES=c,Object.freeze(this)}create(t){return Ht(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof t);return dn<=t&&t<this.ORDER}is0(t){return t===dn}isValidNot0(t){return!this.is0(t)&&this.isValid(t)}isOdd(t){return(t&vt)===vt}neg(t){return Ht(-t,this.ORDER)}eql(t,s){return t===s}sqr(t){return Ht(t*t,this.ORDER)}add(t,s){return Ht(t+s,this.ORDER)}sub(t,s){return Ht(t-s,this.ORDER)}mul(t,s){return Ht(t*s,this.ORDER)}pow(t,s){return h3(t,s,this.ORDER)}div(t,s){return Ht(t*t_(s,this.ORDER),this.ORDER)}sqrN(t){return t*t}addN(t,s){return t+s}subN(t,s){return t-s}mulN(t,s){return t*s}inv(t){return t_(t,this.ORDER)}sqrt(t){let s=n_.get(this);return s||n_.set(this,s=Lz(this.ORDER)),s(this,t)}toBytes(t){return this.isLE?o3(t,this.BYTES):_b(t,this.BYTES)}fromBytes(t,s=!1){Mt(t);const{_lengths:r,BYTES:i,isLE:c,ORDER:u,_mod:d}=this;if(r){if(t.length<1||!r.includes(t.length)||t.length>i)throw new Error("Field.fromBytes: expected "+r+" bytes, got "+t.length);const m=new Uint8Array(i);m.set(t,c?0:m.length-t.length),t=m}if(t.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);let p=c?Fu(t):qc(t);if(d&&(p=Ht(p,u)),!s&&!this.isValid(p))throw new Error("invalid field element: outside of range 0..ORDER");return p}invertBatch(t){return g3(this,t,!0)}cmov(t,s,r){return xr(r,"condition"),r?s:t}}function Lp(e,t={}){return Object.freeze(s_.prototype),new s_(e,t)}function y3(e){if(typeof e!="bigint")throw new Error("field order must be bigint");if(e<=vt)throw new Error("field order must be greater than 1");const t=kb(e-vt);return Math.ceil(t/8)}function Cb(e){const t=y3(e);return t+Math.ceil(t/2)}function v3(e,t,s=!1){Mt(e);const r=e.length,i=y3(t),c=Math.max(Cb(t),16);if(r<c||r>1024)throw new Error("expected "+c+"-1024 bytes of input, got "+r);const u=s?Fu(e):qc(e),d=Ht(u,t-vt)+vt;return s?o3(d,i):_b(d,i)}const Ib=BigInt(0),qu=BigInt(1),Pz=BigInt(4),ry=16,r_=128,Gz=5,a_=2**31;function cl(e){const t=e;if(typeof t!="function")throw new TypeError('"Point" expected constructor, got type='+typeof e);Du(t.fromAffine,"Point.fromAffine"),Du(t.fromBytes,"Point.fromBytes"),Du(t.fromHex,"Point.fromHex"),Cc(t.BASE,"Point.BASE"),Cc(t.ZERO,"Point.ZERO"),Hu(t.Fp),Hu(t.Fn)}function b3(e,t){cl(e),T3(t,e);const s=g3(e.Fp,t.map(r=>r.Z));return t.map((r,i)=>e.fromAffine(r.toAffine(s[i])))}function Fz(e,t,s=1){if(!Number.isSafeInteger(e)||e<s||e>t)throw new Error("invalid window size, expected ["+s+".."+t+"], got W="+e)}function Hz(e,t){const s=e*(4*t+128);if(s>a_)throw new Error("invalid window size: table would need ~"+Math.ceil(s/2**20)+" MiB, max "+a_/2**20+" MiB")}function w3(e,t){if(e!==void 0){Du(e,"randomBytes");try{const s=e(t);if(!ld(s)||s.length!==t)return}catch{return}return e}}function T3(e,t){r3(e,"points"),e.forEach((s,r)=>{if(!(s instanceof t))throw new Error("invalid point at index "+r)})}function qz(e,t,s){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,i)=>{if(!(s===void 0?t.isValid(r):ro(r)&&r<s))throw new Error("invalid scalar at index "+i)})}const S3=new WeakMap;function ay(e){return S3.get(e)||1}function Zz(e,t){const s=e.double(),r=[e];for(let i=1;i<t;i++)r.push(r[i-1].add(s));return r}function Yz(e,t){const s=2**t,r=s/2,i=BigInt(s-1),c=[];for(;e>Ib;){let u=0;e&qu&&(u=Number(e&i),u>=r&&(u-=s),e-=BigInt(u)),c.push(u),e>>=qu}return c}function Wz(e,t,s){const r=2**t,i=r/2,c=BigInt(r-1),u=BigInt(t),d=[];for(let p=0;p<s;p++){let m=Number(e&c);e>>=u,m>i&&(m-=r,e+=qu),d.push(m)}if(e!==Ib)throw new Error("invalid wnaf");return d}function Xz(e,t,s){let r=0;for(const c of s)r=Math.max(r,c.length);let i=e;for(let c=r-1;c>=0;c--){c!==r-1&&(i=i.double());for(let u=0;u<s.length;u++){const d=s[u][c];if(d){const p=t[u][Math.abs(d)-1>>1];i=i.add(d<0?p.negate():p)}}}return i}class E3{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(t,s){cl(t),this.randomBytes=w3(s,ry),this.Point=t,this.BASE=t.BASE,this.ZERO=t.ZERO,this.bits=t.Fn.BITS}buildWnafTable(t,s,r){const i=Math.ceil(r/s)+1,c=2**(s-1),u=[];let d=t;for(let p=0;p<i;p++){let m=d;for(let g=0;g<c;g++)u.push(m),m=m.add(d);d=u[u.length-1].double()}return{W:s,bits:r,windows:i,comp:u}}wnafCachedCT(t,s){const{W:r,windows:i,comp:c}=t,u=2**(r-1),d=Wz(s,r,i);let p=this.ZERO,m=this.BASE;for(let g=0;g<i;g++){const y=d[g],b=g*u,E=Math.abs(y)-1;let O=c[b];for(let R=1;R<u;R++)O=R===E?c[b+R]:O;const C=O.negate();y===0?m=m.add(c[b]):p=p.add(y<0?C:O)}return{p,f:m}}getWnafPrecomputes(t,s,r,i){let c=this.wnafPrecomputes.get(s),u=c?.find(d=>d.W===t&&d.bits===r);return u||(u=this.buildWnafTable(s,t,r),typeof i=="function"&&(u={...u,comp:i(u.comp)}),c||(c=[],this.wnafPrecomputes.set(s,c)),c.push(u)),u}assertPoint(t){if(!(t instanceof this.Point))throw new TypeError('"point" expected Point instance, got type='+typeof t)}validateMulInput(t,s){if(this.assertPoint(t),!c3(s,qu,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(t,s,r,i){const c=ay(t);return c===1?this.fixedWindowCT(t,s,r):this.wnafCachedCT(this.getWnafPrecomputes(c,t,r,i),s)}mulCT(t,s,r){return this.validateMulInput(t,s),this.runCT(t,s,this.bits,r)}mulCTBlinded(t,s,r){if(this.validateMulInput(t,s),this.randomBytes===void 0)throw new Error("randomBytes is required for scalar blinding");const i=this.Point.Fn.BITS+r_,c=this.randomBytes(ry);if(!ld(c)||c.length!==ry)throw new Error("randomBytes returned invalid byte array");c[0]=c[0]&63|128;const u=s+qc(c)*this.Point.Fn.ORDER;return this.runCT(t,u,i,r)}fixedWindowCT(t,s,r){const i=Gz,c=1<<i,u=Ab(i),d=new Array(c);d[0]=this.ZERO;for(let g=1;g<c;g++)d[g]=d[g-1].add(t);const p=Math.ceil(r/i);let m=this.ZERO;for(let g=p-1;g>=0;g--){if(g!==p-1)for(let E=0;E<i;E++)m=m.double();const y=Number(s>>BigInt(g*i)&u);let b=d[0];for(let E=1;E<c;E++)b=E===y?d[E]:b;m=m.add(b)}return{p:m,f:m}}shouldBlind(t,s){return this.randomBytes===void 0?!1:s===qu?!0:t!==this.BASE?!1:(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded)}mulSecret(t,s,r,i){return this.shouldBlind(t,r)?this.mulCTBlinded(t,s,i):this.mulCT(t,s,i)}mulUnsafe(t,s,r){if(this.assertPoint(t),!ro(s))throw new Error("invalid scalar");const i=ay(t);if(i===1||s>=this.Point.Fn.ORDER)return cv(this.Point,[t],[s],!0);const c=this.getWnafPrecomputes(i,t,this.bits,r);return this.wnafCachedCT(c,s).p}setWindowSize(t,s){this.assertPoint(t),Fz(s,this.bits);const r=Math.ceil((this.bits+r_)/s)+1;Hz(r*2**(s-1),this.Point.Fp.BYTES),S3.set(t,s),this.wnafPrecomputes.delete(t)}hasWindowSize(t){return ay(t)!==1}}function cv(e,t,s,r=!1){if(cl(e),T3(t,e),xr(r,"allowOversized"),qz(s,e.Fn,r?e.Fn.ORDER**Pz:void 0),t.length!==s.length)throw new Error("arrays of points and scalars must have equal length");const i=t.map(u=>Zz(u,4)),c=s.map(u=>Yz(u,4));return Xz(e.ZERO,i,c)}function i_(e,t,s){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Hu(t),t}else return Lp(e,{isLE:s})}function _3(e,t,s={},r){if(e!=="weierstrass"&&e!=="edwards")throw new Error('expected curve type "weierstrass" or "edwards"');if(r===void 0&&(r=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);_r(s);for(const p of["p","n","h"]){const m=t[p];if(!(ro(m)&&m!==Ib))throw new Error(`CURVE.${p} must be positive bigint`)}const i=i_(t.p,s.Fp,r),c=i_(t.n,s.Fn,r),d=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(const p of d)if(!i.isValid(t[p]))throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:c}}function k3(e,t){return function(r){const i=e(r);return{secretKey:i,publicKey:t(i)}}}const Qf=BigInt(0),eh=BigInt(1),th=BigInt(2),Kz=BigInt(4),o_=BigInt(8);function Jz(e,t,s,r){const i=e.sqr(s),c=e.sqr(r),u=e.add(e.mul(t.a,i),c),d=e.add(e.ONE,e.mul(t.d,e.mul(i,c)));return e.eql(u,d)}function Qz(e,t={}){_r(t,{},{},"extraOpts");const s=t,r=_3("edwards",e,s,s.FpFnLE),{Fp:i,Fn:c}=r;let u=r.CURVE;const{h:d}=u;if(tp(i,u.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(tp(i,u.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");_r(s,{},{uvRatio:"function",randomBytes:"function"});const p=s.randomBytes===void 0?ud:s.randomBytes,m=th<<BigInt(i.BYTES*8)-eh;function g(x){if(!i.isOdd)throw new Error("Field does not have .isOdd()");return i.isOdd(x)}const y=s.uvRatio===void 0?(x,W)=>{try{return{isValid:!0,value:i.sqrt(i.div(x,W))}}catch{return{isValid:!1,value:Qf}}}:s.uvRatio;if(!Jz(i,u,u.Gx,u.Gy))throw new Error("bad curve params: generator point");const b=i.eql(u.a,i.neg(i.ONE))?x=>i.neg(x):i.eql(u.a,i.ONE)?x=>x:x=>i.mul(u.a,x);function E(x,W,oe=!1){const me=oe?eh:Qf;return ep("coordinate "+x,W,me,m),W}function O(x){if(!(x instanceof C))throw new Error("EdwardsPoint expected")}class C{static BASE=new C(u.Gx,u.Gy,i.ONE,i.mul(u.Gx,u.Gy));static ZERO=new C(i.ZERO,i.ONE,i.ONE,i.ZERO);static Fp=i;static Fn=c;X;Y;Z;T;constructor(W,oe,me,G){this.X=E("x",W),this.Y=E("y",oe),this.Z=E("z",me,!0),this.T=E("t",G),Object.freeze(this)}static CURVE(){return u}static fromAffine(W){if(W instanceof C)throw new Error("extended point not allowed");const{x:oe,y:me}=W||{};return E("x",oe),E("y",me),new C(oe,me,i.ONE,i.mul(oe,me))}static fromBytes(W,oe=!1){const me=i.BYTES,{a:G,d:J}=u;W=Qh(Mt(W,me,"point")),xr(oe,"zip215");const w=Qh(W),A=W[me-1];w[me-1]=A&-129;const N=Fu(w),F=oe?m:i.ORDER;ep("point.y",N,Qf,F);const B=i.sqr(N),q=i.sub(B,i.ONE),z=i.sub(i.mulN(J,B),G);let{isValid:D,value:k}=y(q,z);if(!D)throw new Error("bad point: invalid y coordinate");const j=g(k),U=(A&128)!==0;if(!oe&&i.is0(k)&&U)throw new Error("bad point: x=0 and x_0=1");return U!==j&&(k=i.neg(k)),C.fromAffine({x:k,y:N})}static fromHex(W,oe=!1){return C.fromBytes(Kh(W),oe)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(W=6,oe=!0){return $.setWindowSize(this,W),oe||this.multiply(th),this}assertValidity(){const W=this,{a:oe,d:me}=u;if(W.is0())throw new Error("bad point: ZERO");const{X:G,Y:J,Z:w,T:A}=W,N=i.sqr(G),F=i.sqr(J),B=i.sqr(w),q=i.sqr(B),z=i.mul(N,oe),D=i.mul(i.add(z,F),B),k=i.add(q,i.mul(me,i.mul(N,F)));if(!i.eql(D,k))throw new Error("bad point: equation left != right (1)");const j=i.mul(G,J),U=i.mul(w,A);if(!i.eql(j,U))throw new Error("bad point: equation left != right (2)")}equals(W){O(W);const{X:oe,Y:me,Z:G}=this,{X:J,Y:w,Z:A}=W,N=i.mul(oe,A),F=i.mul(J,G),B=i.mul(me,A),q=i.mul(w,G);return i.eql(N,F)&&i.eql(B,q)}is0(){return this.equals(C.ZERO)}negate(){return new C(i.neg(this.X),this.Y,this.Z,i.neg(this.T))}double(){const{X:W,Y:oe,Z:me}=this,G=i.sqr(W),J=i.sqr(oe),w=i.mul(i.sqr(me),th),A=b(G),N=i.addN(W,oe),F=i.sub(i.subN(i.sqr(N),G),J),B=i.addN(A,J),q=i.subN(B,w),z=i.subN(A,J),D=i.mul(F,q),k=i.mul(B,z),j=i.mul(F,z),U=i.mul(q,B);return new C(D,k,U,j)}add(W){O(W);const{d:oe}=u,{X:me,Y:G,Z:J,T:w}=this,{X:A,Y:N,Z:F,T:B}=W,q=i.mul(me,A),z=i.mul(G,N),D=i.mul(i.mulN(w,oe),B),k=i.mul(J,F),j=i.sub(i.subN(i.mulN(i.addN(me,G),i.addN(A,N)),q),z),U=i.subN(k,D),V=i.addN(k,D),K=i.sub(z,b(q)),P=i.mul(j,U),re=i.mul(V,K),ue=i.mul(j,K),I=i.mul(U,V);return new C(P,re,I,ue)}subtract(W){return O(W),this.add(W.negate())}multiply(W){if(!c.isValidNot0(W))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:oe,f:me}=$.mulSecret(this,W,d,R);return R([oe,me])[0]}multiplyUnsafe(W){if(!c.isValid(W))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return W===Qf?C.ZERO:this.is0()||W===eh?this:$.mulUnsafe(this,W,R)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return $.mulUnsafe(this,u.n).is0()}toAffine(W){const oe=this;let me=W;if(me!=null&&typeof me!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof me);const{X:G,Y:J,Z:w}=oe,A=oe.is0();me==null&&(me=A?i.create(o_):i.inv(w));const N=i.mul(G,me),F=i.mul(J,me),B=i.mul(w,me);if(A)return{x:i.ZERO,y:i.ONE};if(!i.eql(B,i.ONE))throw new Error("invZ was invalid");return{x:N,y:F}}clearCofactor(){return d===eh?this:d===th?this.double():d===Kz?this.double().double():d===o_?this.double().double().double():this.multiplyUnsafe(d)}toBytes(){const{x:W,y:oe}=this.toAffine(),me=i.toBytes(oe);return me[me.length-1]|=g(W)?128:0,me}toHex(){return Sb(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const R=x=>b3(C,x),$=new E3(C,p);return $.bits>=6&&C.BASE.precompute(6),Object.freeze(C.prototype),Object.freeze(C),C}function e$(e,t,s={}){if(cl(e),typeof t!="function")throw new Error('"hash" function param is required');const r=t,i=s;_r(i,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function",toMontgomery:"function",toMontgomerySecret:"function"});const{prehash:c}=i,{BASE:u,Fp:d,Fn:p}=e,m=r.outputLen,g=2*d.BYTES;if(m!==void 0&&(Hc(m,"hash.outputLen"),m!==g))throw new Error(`hash.outputLen must be ${g}, got ${m}`);const y=i.randomBytes===void 0?ud:i.randomBytes,b=i.toMontgomery,E=i.toMontgomerySecret,O=i.adjustScalarBytes===void 0?z=>z:i.adjustScalarBytes,C=i.domain===void 0?(z,D,k)=>{if(xr(k,"phflag"),D.length||k)throw new Error("Contexts/pre-hash are not supported");return z}:i.domain;function R(z){return p.create(Fu(z))}function $(z){const D=A.secretKey;Mt(z,A.secretKey,"secretKey");const k=Mt(r(z),2*D,"hashedSecretKey"),j=O(k.slice(0,D)),U=k.slice(D,2*D),V=R(j);return{head:j,prefix:U,scalar:V}}function x(z){const{head:D,prefix:k,scalar:j}=$(z),U=u.multiply(j),V=U.toBytes();return{head:D,prefix:k,scalar:j,point:U,pointBytes:V}}function W(z){return x(z).pointBytes}function oe(z=Uint8Array.of(),...D){const k=Sr(...D);return R(r(C(k,Mt(z,void 0,"context"),!!c)))}function me(z,D,k={}){_r(k,{},{},"options"),z=Qh(Mt(z,void 0,"message")),c&&(z=c(z));const{prefix:j,scalar:U,pointBytes:V}=x(D),K=oe(k.context,j,z),P=u.multiply(K).toBytes(),re=oe(k.context,P,V,z),ue=p.create(K+re*U);if(!p.isValid(ue))throw new Error("sign failed: invalid s");const I=Sr(P,p.toBytes(ue));return Mt(I,A.signature,"result")}const G={zip215:i.zip215};function J(z,D,k,j=G){_r(j);const{context:U}=j,V=j.zip215===void 0?!!G.zip215:j.zip215,K=A.signature;z=Mt(z,K,"signature"),D=Mt(D,void 0,"message"),k=Mt(k,A.publicKey,"publicKey"),V!==void 0&&xr(V,"zip215"),c&&(D=c(D));const P=K/2,re=z.subarray(0,P),ue=Fu(z.subarray(P,K));let I,X,ce;try{I=e.fromBytes(k,V),X=e.fromBytes(re,V),ce=u.multiplyUnsafe(ue)}catch{return!1}if(!V&&I.isSmallOrder())return!1;const he=oe(U,re,k,D);return X.add(I.multiplyUnsafe(he)).subtract(ce).clearCofactor().is0()}const w=d.BYTES,A={secretKey:w,publicKey:w,signature:2*w,seed:w};function N(z){return z=z===void 0?y(A.seed):z,Mt(z,A.seed,"seed")}function F(z){return ld(z)&&z.length===A.secretKey}function B(z,D){try{return!!e.fromBytes(z,D===void 0?G.zip215:D)}catch{return!1}}const q={getExtendedPublicKey:x,randomSecretKey:N,isValidSecretKey:F,isValidPublicKey:B,toMontgomery(z){if(b===void 0)throw new Error("Montgomery conversion is not supported for this curve");return b(e.fromBytes(z))},toMontgomerySecret(z){if(E===void 0)throw new Error("Montgomery conversion is not supported for this curve");return E(z)}};return Object.freeze(A),Object.freeze(q),Object.freeze({keygen:k3(N,W),getPublicKey:W,sign:me,verify:J,utils:q,Point:e,lengths:A})}const lv=BigInt(1),c_=BigInt(2),t$=BigInt(5),n$=BigInt(8),Rb=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),s$={p:Rb,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:n$,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function r$(e){const t=BigInt(10),s=BigInt(20),r=BigInt(40),i=BigInt(80),c=Rb,d=e*e%c*e%c,p=Ft(d,c_,c)*d%c,m=Ft(p,lv,c)*e%c,g=Ft(m,t$,c)*m%c,y=Ft(g,t,c)*g%c,b=Ft(y,s,c)*y%c,E=Ft(b,r,c)*b%c,O=Ft(E,i,c)*E%c,C=Ft(O,i,c)*E%c,R=Ft(C,t,c)*g%c;return{pow_p_5_8:Ft(R,c_,c)*e%c,b2:d}}function A3(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const l_=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function a$(e,t){const s=Rb,r=Ht(t*t*t,s),i=Ht(r*r*t,s),c=r$(e*i).pow_p_5_8;let u=Ht(e*r*c,s);const d=Ht(t*u*u,s),p=u,m=Ht(u*l_,s),g=d===e,y=d===Ht(-e,s),b=d===Ht(-e*l_,s);return g&&(u=p),(y||b)&&(u=m),zz(u,s)&&(u=Ht(-u,s)),{isValid:g||y,value:u}}const jb=Qz(s$,{uvRatio:a$}),u_=jb.Fp;function i$(e){const{y:t}=e;return u_.toBytes(u_.div(lv+t,lv-t))}function o$(e){const t=jb.Fp.BYTES;return Un(e,t),A3(cd(e.subarray(0,t))).subarray(0,t)}function c$(e){return e$(jb,cd,Object.assign({adjustScalarBytes:A3,toMontgomery:i$,toMontgomerySecret:o$,zip215:!0},e))}const na=c$({}),iy=32;var jc,O3=(jc=class extends ol{constructor(t){if(super(),typeof t=="string"?this.data=Ge(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==iy)throw new Error(`Invalid public key input. Expected ${iy} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return Ps.ED25519}async verify(t,s){let r;if(typeof s=="string"){const i=wb(s);if(i.signatureScheme!=="ED25519")throw new Error("Invalid signature scheme");if(!mi(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return na.verify(r,t,this.toRawBytes())}},jc.SIZE=iy,jc);class d_{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(t,s){if(Kv(t),Un(s,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("expected Hash instance");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(s.length>r?t.create().update(s).digest():s);for(let c=0;c<i.length;c++)i[c]^=54;this.iHash.update(i),this.oHash=t.create();for(let c=0;c<i.length;c++)i[c]^=106;this.oHash.update(i),Vs(i)}update(t){return Fc(this),this.iHash.update(t),this}digestInto(t){Fc(this),Jv(t,this),this.finished=!0;const s=t.subarray(0,this.outputLen);this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||=Object.create(Object.getPrototypeOf(this),{});const{oHash:s,iHash:r,finished:i,destroyed:c,blockLen:u,outputLen:d,canXOF:p}=this;return t=t,t.finished=i,t.destroyed=c,t.blockLen=u,t.outputLen=d,t.canXOF=p,t.oHash=s._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const zp=(()=>{const e=((t,s,r)=>new d_(t,s).update(r).digest());return e.create=(t,s)=>new d_(t,s),e})();function l$(e,t,s,r){Kv(e);const i=eb({dkLen:32,asyncTick:10},r),{c,dkLen:u,asyncTick:d}=i;if(as(c,"c"),as(u,"dkLen"),as(d,"asyncTick"),c<1)throw new Error('"c" (iterations) must be >= 1');if(u<1)throw new Error('"dkLen" must be >= 1');if(u>(2**32-1)*e.outputLen)throw new Error("derived key too long");const p=sE(t,"password");try{const m=sE(s,"salt");try{const g=new Uint8Array(u),{iHash:y,oHash:b,outputLen:E}=zp.create(e,p),O=new Uint8Array(E),C=u$(y,b,m,O);return{c,dkLen:u,asyncTick:d,DK:g,outputLen:E,eng:C}}finally{typeof s=="string"&&Vs(m)}}finally{typeof t=="string"&&Vs(p)}}function u$(e,t,s,r){const i=new Uint8Array(4),c=uh(i),u=e._cloneInto().update(s),d=t._cloneInto(),p=e._cloneInto,m=t._cloneInto;return{u1:(g,y)=>{c.setInt32(0,g,!1),u._cloneInto(d).update(i).digestInto(r),t._cloneInto(d).update(r).digestInto(r),y.set(r.subarray(0,y.length))},rounds:(g,y)=>{for(let b=1;b<g;b++){p.call(e,d).update(r).digestInto(r),m.call(t,d).update(r).digestInto(r);for(let E=0;E<y.length;E++)y[E]^=r[E]}},output:g=>(e.destroy(),t.destroy(),u.destroy(),d.destroy(),Vs(r),g)}}function d$(e,t,s,r){const{c:i,dkLen:c,DK:u,outputLen:d,eng:p}=l$(e,t,s,r);for(let m=1,g=0;g<c;m++,g+=d){const y=u.subarray(g,g+d);p.u1(m,y),p.rounds(i,y)}return p.output(u)}function f$(e){for(let t=0;t<e.length;t++){const s=e.charCodeAt(t);if(s>=55296&&s<=56319){if(t+1>=e.length)return!1;const r=e.charCodeAt(++t);if(r<56320||r>57343)return!1}else if(s>=56320&&s<=57343)return!1}return!0}function N3(e){if(typeof e!="string")throw new TypeError("invalid mnemonic type: "+typeof e);if(!f$(e))throw new TypeError("expected well-formed Unicode string");return e.normalize("NFKD")}function h$(e){const t=N3(e),s=t.split(" ");if(![12,15,18,21,24].includes(s.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:s}}const p$=e=>{if(typeof e!="string")throw new TypeError("invalid passphrase type: "+typeof e);return N3("mnemonic"+e)};function m$(e,t=""){return d$(cd,h$(e).nfkd,p$(t),{c:2048,dkLen:64})}function f_(e){return!!new RegExp("^m\\/44'\\/784'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'+$").test(e)}function g$(e){return m$(e,"")}function y$(e){return Ar(g$(e))}const v$=BigInt(0);class b$ extends Error{constructor(t=""){super(t)}}const ra={Err:b$,_tlv:{encode:(e,t)=>{const{Err:s}=ra;if(Hc(e,"tag"),e<0||e>255)throw new s("tlv.encode: wrong tag");if(Nz(t,"data"),t.length&1)throw new s("tlv.encode: unpadded data");const r=t.length/2,i=Jf(r);if(i.length/2&128)throw new s("tlv.encode: long form length too big");const c=r>127?Jf(i.length/2|128):"";return Jf(e)+c+i+t},decode(e,t){const{Err:s}=ra;t=Mt(t,void 0,"DER data");let r=0;if(e<0||e>255)throw new s("tlv.decode: wrong tag");if(t.length<2||t[r++]!==e)throw new s("tlv.decode: wrong tlv");const i=t[r++],c=!!(i&128);let u=0;if(!c)u=i;else{const p=i&127;if(!p)throw new s("tlv.decode(long): indefinite length not supported");if(p>4)throw new s("tlv.decode(long): byte length is too big");const m=t.subarray(r,r+p);if(m.length!==p)throw new s("tlv.decode: length bytes not complete");if(m[0]===0)throw new s("tlv.decode(long): zero leftmost byte");for(const g of m)u=u<<8|g;if(r+=p,u<128)throw new s("tlv.decode(long): not minimal encoding")}const d=t.subarray(r,r+u);if(d.length!==u)throw new s("tlv.decode: wrong value length");return{v:d,l:t.subarray(r+u)}}},_int:{encode(e){const{Err:t}=ra;if(Eb(e),e<v$)throw new t("integer: negative integers are not allowed");let s=Jf(e);if(Number.parseInt(s[0],16)&8&&(s="00"+s),s.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return s},decode(e){const{Err:t}=ra;if(e.length<1)throw new t("invalid signature integer: empty");if(e[0]&128)throw new t("invalid signature integer: negative");if(e.length>1&&e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return qc(e)}},toSig(e,t){const{Err:s,_int:r,_tlv:i}=ra;if(t!==void 0&&(Hc(t,"maxScalarBytes"),t<1))throw new s("invalid signature: maxScalarBytes must be positive");const c=Mt(e,void 0,"signature"),{v:u,l:d}=i.decode(48,c);if(d.length)throw new s("invalid signature: left bytes after parsing");const{v:p,l:m}=i.decode(2,u),{v:g,l:y}=i.decode(2,m);if(y.length)throw new s("invalid signature: left bytes after parsing");if(t!==void 0&&(p.length>t||g.length>t))throw new s("invalid signature: integer too large");return{r:r.decode(p),s:r.decode(g)}},hexFromSig(e){const{_tlv:t,_int:s}=ra;_r(e,{r:"bigint",s:"bigint"},{},"sig");const r=t.encode(2,s.encode(e.r)),i=t.encode(2,s.encode(e.s)),c=r+i;return t.encode(48,c)}},oy=(Object.freeze(ra._tlv),Object.freeze(ra._int),Object.freeze(ra));const h_=(e,t)=>(e+(e>=0?t:-t)/x3)/t;function w$(e,t,s){ep("scalar",e,oa,s);const[[r,i],[c,u]]=t,d=h_(u*e,s),p=h_(-i*e,s);let m=e-d*r-p*c,g=-d*i-p*u;const y=m<oa,b=g<oa;y&&(m=-m),b&&(g=-g);const E=Ab(Math.ceil(kb(s)/2))+eo;if(m<oa||m>=E||g<oa||g>=E)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:y,k1:m,k2neg:b,k2:g}}function uv(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function cy(e,t){_r(e);const s={};for(let r of Object.keys(t))s[r]=e[r]===void 0?t[r]:e[r];return xr(s.lowS,"lowS"),xr(s.prehash,"prehash"),s.format!==void 0&&uv(s.format),s}const oa=BigInt(0),eo=BigInt(1),x3=BigInt(2),ly=BigInt(3),T$=BigInt(4);function C3(e,t={}){const s=_3("weierstrass",e,t),r=s.Fp,i=s.Fn;let c=s.CURVE;const{h:u,n:d}=c;_r(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",randomBytes:"function"});const{endo:p,allowInfinityPoint:m,clearCofactor:g,isTorsionFree:y,fromBytes:b,toBytes:E}=t,O=t.randomBytes===void 0?ud:t.randomBytes;if(p&&(!r.is0(c.a)||typeof p.beta!="bigint"||!Array.isArray(p.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const C=p?{beta:p.beta,basises:p.basises.map(K=>[...K])}:void 0,R=R3(r,i);function $(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function x(K,P,re){if(P.is0()){if(!m)throw new Error("bad point: ZERO");return Uint8Array.of(0)}const{x:ue,y:I}=P.toAffine(),X=r.toBytes(ue);if(xr(re,"isCompressed"),re){$();const ce=!r.isOdd(I);return Sr(I3(ce),X)}else return Sr(Uint8Array.of(4),X,r.toBytes(I))}function W(K){Mt(K,void 0,"Point");const{publicKey:P,publicKeyUncompressed:re}=R,ue=K.length,I=K[0],X=K.subarray(1);if(m&&ue===1&&I===0)return{x:r.ZERO,y:r.ZERO};if(ue===P&&(I===2||I===3)){const ce=r.fromBytes(X);if(!r.isValid(ce))throw new Error("bad point: is not on curve, wrong x");const he=w(ce);let Te;try{Te=r.sqrt(he)}catch(be){const _e=be instanceof Error?": "+be.message:"";throw new Error("bad point: is not on curve, sqrt error"+_e)}$();const Oe=r.isOdd(Te);return(I&1)===1!==Oe&&(Te=r.neg(Te)),{x:ce,y:Te}}else if(ue===re&&I===4){const ce=r.BYTES,he=r.fromBytes(X.subarray(0,ce)),Te=r.fromBytes(X.subarray(ce,ce*2));if(!A(he,Te))throw new Error("bad point: is not on curve");return{x:he,y:Te}}else throw new Error(`bad point: got length ${ue}, expected compressed=${P} or uncompressed=${re}`)}const oe=E===void 0?x:E,me=b===void 0?W:b,G=r.mul(c.b,ly),J=r.is0(c.a)?K=>r.ZERO:K=>r.mul(c.a,K);function w(K){const P=r.sqr(K),re=r.mul(P,K);return r.add(r.add(re,r.mul(K,c.a)),c.b)}function A(K,P){const re=r.sqr(P),ue=w(K);return r.eql(re,ue)}if(!A(c.Gx,c.Gy))throw new Error("bad curve params: generator point");const N=r.mul(r.pow(c.a,ly),T$),F=r.mul(r.sqr(c.b),BigInt(27));if(r.is0(r.add(N,F)))throw new Error("bad curve params: a or b");function B(K,P,re=!1){if(!r.isValid(P)||re&&r.is0(P))throw new Error(`bad point coordinate ${K}`);return typeof P=="object"&&P!==null?r.create(P):P}function q(K){if(!(K instanceof j))throw new Error("Weierstrass Point expected")}function z(K){if(!C||!C.basises)throw new Error("no endo");return w$(K,C.basises,i.ORDER)}function D(K,P,re,ue){if(!i.isValid(ue))throw new RangeError("invalid scalar: out of range");if(C){const{k1neg:I,k1:X,k2neg:ce,k2:he}=z(ue),Te=new j(r.mul(re.X,C.beta),re.Y,re.Z);K.push(I?re.negate():re,ce?Te.negate():Te),P.push(X,he)}else K.push(re),P.push(ue)}const k=new WeakSet;class j{static BASE=new j(c.Gx,c.Gy,r.ONE);static ZERO=new j(r.ZERO,r.ONE,r.ZERO);static Fp=r;static Fn=i;X;Y;Z;constructor(P,re,ue){this.X=B("x",P),this.Y=B("y",re,!0),this.Z=B("z",ue),Object.freeze(this)}static CURVE(){return c}static fromAffine(P){const{x:re,y:ue}=P||{};if(!P||!r.isValid(re)||!r.isValid(ue))throw new Error("invalid affine point");if(P instanceof j)throw new Error("projective point not allowed");return r.is0(re)&&r.is0(ue)?j.ZERO:new j(re,ue,r.ONE)}static fromBytes(P){const re=j.fromAffine(me(Mt(P,void 0,"point")));return re.assertValidity(),re}static fromHex(P){return j.fromBytes(Kh(P))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(P=6,re=!0){return V.setWindowSize(this,P),re||this.multiply(ly),this}assertValidity(){const P=this;if(P.is0()){if(m&&r.is0(P.X)&&r.eql(P.Y,r.ONE)&&r.is0(P.Z))return;throw new Error("bad point: ZERO")}if(k.has(P))return;const{x:re,y:ue}=P.toAffine();if(!r.isValid(re)||!r.isValid(ue))throw new Error("bad point: x or y not field elements");if(!A(re,ue))throw new Error("bad point: equation left != right");if(!P.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");k.add(P)}hasEvenY(){const{y:P}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(P)}equals(P){q(P);const{X:re,Y:ue,Z:I}=this,{X,Y:ce,Z:he}=P,Te=r.eql(r.mul(re,he),r.mul(X,I)),Oe=r.eql(r.mul(ue,he),r.mul(ce,I));return Te&&Oe}negate(){return new j(this.X,r.neg(this.Y),this.Z)}double(){const{X:P,Y:re,Z:ue}=this;let I=r.ZERO,X=r.ZERO,ce=r.ZERO,he=r.mul(P,P),Te=r.mul(re,re),Oe=r.mul(ue,ue),Ae=r.mul(P,re);return Ae=r.add(Ae,Ae),ce=r.mul(P,ue),ce=r.add(ce,ce),I=J(ce),X=r.mul(G,Oe),X=r.add(I,X),I=r.sub(Te,X),X=r.add(Te,X),X=r.mul(I,X),I=r.mul(Ae,I),ce=r.mul(G,ce),Oe=J(Oe),Ae=r.sub(he,Oe),Ae=J(Ae),Ae=r.add(Ae,ce),ce=r.add(he,he),he=r.add(ce,he),he=r.add(he,Oe),he=r.mul(he,Ae),X=r.add(X,he),Oe=r.mul(re,ue),Oe=r.add(Oe,Oe),he=r.mul(Oe,Ae),I=r.sub(I,he),ce=r.mul(Oe,Te),ce=r.add(ce,ce),ce=r.add(ce,ce),new j(I,X,ce)}add(P){q(P);const{X:re,Y:ue,Z:I}=this,{X,Y:ce,Z:he}=P;let Te=r.ZERO,Oe=r.ZERO,Ae=r.ZERO,be=r.mul(re,X),_e=r.mul(ue,ce),Pe=r.mul(I,he),at=r.add(re,ue),H=r.add(X,ce);at=r.mul(at,H),H=r.add(be,_e),at=r.sub(at,H),H=r.add(re,I);let te=r.add(X,he);return H=r.mul(H,te),te=r.add(be,Pe),H=r.sub(H,te),te=r.add(ue,I),Te=r.add(ce,he),te=r.mul(te,Te),Te=r.add(_e,Pe),te=r.sub(te,Te),Ae=J(H),Te=r.mul(G,Pe),Ae=r.add(Te,Ae),Te=r.sub(_e,Ae),Ae=r.add(_e,Ae),Oe=r.mul(Te,Ae),_e=r.add(be,be),_e=r.add(_e,be),Pe=J(Pe),H=r.mul(G,H),_e=r.add(_e,Pe),Pe=r.sub(be,Pe),Pe=J(Pe),H=r.add(H,Pe),be=r.mul(_e,H),Oe=r.add(Oe,be),be=r.mul(te,H),Te=r.mul(at,Te),Te=r.sub(Te,be),be=r.mul(at,_e),Ae=r.mul(te,Ae),Ae=r.add(Ae,be),new j(Te,Oe,Ae)}subtract(P){return q(P),this.add(P.negate())}is0(){return this.equals(j.ZERO)}multiply(P){if(!i.isValidNot0(P))throw new RangeError("invalid scalar: out of range");const{p:re,f:ue}=V.mulSecret(this,P,u,U);return U([re,ue])[0]}multiplyUnsafe(P){const re=this,ue=P;if(!i.isValid(ue))throw new RangeError("invalid scalar: out of range");if(ue===oa||re.is0())return j.ZERO;if(ue===eo)return re;if(V.hasWindowSize(this))return V.mulUnsafe(re,ue,U);const I=[],X=[];return D(I,X,re,ue),cv(j,I,X)}mulAddUnsafe(P,re,ue){q(re);const I=[],X=[];return D(I,X,this,P),D(I,X,re,ue),cv(j,I,X)}toAffine(P){const re=this;let ue=P;if(ue!=null&&!r.isValid(ue))throw new RangeError('"invertedZ" expected valid field element');const{X:I,Y:X,Z:ce}=re;if(r.eql(ce,r.ONE))return{x:I,y:X};const he=re.is0();ue==null&&(ue=he?r.ONE:r.inv(ce));const Te=r.mul(I,ue),Oe=r.mul(X,ue),Ae=r.mul(ce,ue);if(he)return{x:r.ZERO,y:r.ZERO};if(!r.eql(Ae,r.ONE))throw new Error("invZ was invalid");return{x:Te,y:Oe}}isTorsionFree(){return u===eo?!0:y?y(j,this):V.mulUnsafe(this,d).is0()}clearCofactor(){return u===eo?this:g?g(j,this):this.multiplyUnsafe(u)}isSmallOrder(){return u===eo?this.is0():this.clearCofactor().is0()}toBytes(P=!0){return xr(P,"isCompressed"),this.assertValidity(),oe(j,this,P)}toHex(P=!0){return Sb(this.toBytes(P))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const U=K=>b3(j,K),V=new E3(j,O);return V.bits>=6&&j.BASE.precompute(6),Object.freeze(j.prototype),Object.freeze(j),j}function I3(e){return Uint8Array.of(e?2:3)}function R3(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function S$(e,t={}){cl(e);const{Fn:s}=e,r=t.randomBytes===void 0?ud:t.randomBytes,i=Object.assign(R3(e.Fp,s),{seed:Math.max(Cb(s.ORDER),16)});function c(E){try{const O=s.fromBytes(E);return s.isValidNot0(O)}catch{return!1}}function u(E,O){const{publicKey:C,publicKeyUncompressed:R}=i;try{const $=E.length;return O===!0&&$!==C||O===!1&&$!==R?!1:!e.fromBytes(E).is0()}catch{return!1}}function d(E){return E=E===void 0?r(i.seed):E,v3(Mt(E,i.seed,"seed"),s.ORDER)}function p(E,O=!0){return e.BASE.multiply(s.fromBytes(E)).toBytes(O)}function m(E){const{secretKey:O,publicKey:C,publicKeyUncompressed:R}=i,$=s._lengths;if(!ld(E))return;const x=Mt(E,void 0,"key").length,W=x===C||x===R,oe=x===O||!!$?.includes(x);if(!(W&&oe))return W}function g(E,O,C=!0){if(m(E)===!0)throw new Error("first arg must be private key");if(m(O)===!1)throw new Error("second arg must be public key");const R=s.fromBytes(E),$=e.fromBytes(O);if($.is0())throw new Error("invalid public key: point at infinity");return $.multiply(R).toBytes(C)}const y={isValidSecretKey:c,isValidPublicKey:u,randomSecretKey:d},b=k3(d,p);return Object.freeze(y),Object.freeze(i),Object.freeze({getPublicKey:p,getSharedSecret:g,keygen:b,Point:e,utils:y,lengths:i})}function j3(e,t,s={}){cl(e);const r=t;Kv(r),_r(s,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const i=Object.assign({},s),c=i.randomBytes===void 0?ud:i.randomBytes,u=i.hmac===void 0?(K,P)=>zp(r,K,P):i.hmac,{Fp:d,Fn:p}=e,{ORDER:m,BITS:g}=p,y=Cb(m),b=w3(c,y),{keygen:E,getPublicKey:O,getSharedSecret:C,utils:R,lengths:$}=S$(e,i),x={prehash:!0,lowS:typeof i.lowS=="boolean"?i.lowS:!0,format:"compact",extraEntropy:!1},W=m*x3+eo<d.ORDER;function oe(K){const P=m>>eo;return K>P}function me(K,P){if(!p.isValidNot0(P))throw new Error(`invalid signature ${K}: out of range 1..Point.Fn.ORDER`);return P}function G(){if(!d.isOdd)throw new Error("Field doesn't support isOdd")}function J(K,P,re){return G(),(K===re?0:2)|Number(d.isOdd(P))}function w(){if(W)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function A(K,P){uv(P);const re=$.signature,ue=P==="compact"?re:P==="recovered"?re+1:void 0;return Mt(K,ue)}class N{r;s;recovery;constructor(P,re,ue){if(this.r=me("r",P),this.s=me("s",re),ue!=null){if(w(),![0,1,2,3].includes(ue))throw new Error("invalid recovery id");this.recovery=ue}Object.freeze(this)}static fromBytes(P,re=x.format){A(P,re);let ue;if(re==="der"){if(P.length>2*p.BYTES+16)throw new oy.Err("invalid signature: DER signature too long");const{r:he,s:Te}=oy.toSig(Mt(P),p.BYTES+1);return new N(he,Te)}re==="recovered"&&(ue=P[0],re="compact",P=P.subarray(1));const I=$.signature/2,X=P.subarray(0,I),ce=P.subarray(I,I*2);return new N(p.fromBytes(X),p.fromBytes(ce),ue)}static fromHex(P,re){return this.fromBytes(Kh(P),re)}assertRecovery(){const{recovery:P}=this;if(P==null)throw new Error("invalid recovery id: must be present");return P}addRecoveryBit(P){return new N(this.r,this.s,P)}recoverPublicKey(P){const{r:re,s:ue}=this,I=this.assertRecovery(),X=I===2||I===3?re+m:re;if(!d.isValid(X))throw new Error("invalid recovery id: sig.r+curve.n != R.x");const ce=d.toBytes(X),he=e.fromBytes(Sr(I3((I&1)===0),ce)),Te=p.inv(X),Oe=B(Mt(P,void 0,"msgHash")),Ae=p.create(-Oe*Te),be=p.create(ue*Te),_e=e.BASE.mulAddUnsafe(Ae,he,be);if(_e.is0())throw new Error("invalid recovery: point at infinify");return _e.assertValidity(),_e}hasHighS(){return oe(this.s)}toBytes(P=x.format){if(uv(P),P==="der")return Kh(oy.hexFromSig(this));const{r:re,s:ue}=this,I=p.toBytes(re),X=p.toBytes(ue);return P==="recovered"?(w(),Sr(Uint8Array.of(this.assertRecovery()),I,X)):Sr(I,X)}toHex(P){return Sb(this.toBytes(P))}}Object.freeze(N.prototype),Object.freeze(N);const F=i.bits2int===void 0?function(P){if(P.length>8192)throw new Error("input is too large");const re=qc(P),ue=P.length*8-g;return ue>0?re>>BigInt(ue):re}:i.bits2int,B=i.bits2int_modN===void 0?function(P){return p.create(F(P))}:i.bits2int_modN,q=Ab(g);function z(K){return ep("num < 2^"+g,K,oa,q),p.toBytes(K)}function D(K,P){return Mt(K,void 0,"message"),P?Mt(r(K),void 0,"prehashed message"):K}function k(K,P,re){const{lowS:ue,prehash:I,extraEntropy:X}=cy(re,x);K=D(K,I);const ce=B(K),he=p.fromBytes(P);if(!p.isValidNot0(he))throw new Error("invalid private key");const Te=[z(he),z(ce)];if(X!=null&&X!==!1){const _e=X===!0?c($.secretKey):X;Te.push(Mt(_e,void 0,"extraEntropy"))}const Oe=Sr(...Te),Ae=ce;function be(_e){const Pe=F(_e);if(!p.isValidNot0(Pe))return;const at=e.BASE.multiply(Pe).toAffine(),H=p.create(at.x);if(H===oa)return;let te;if(b!==void 0){const le=qc(v3(b(y),m)),$e=p.inv(p.mul(le,Pe)),Le=p.mul(le,Ae),Dt=p.mul(le,he);te=p.create($e*p.create(Le+Dt*H))}else{const le=Dz(Pe,m);te=p.create(le*p.create(Ae+H*he))}if(te===oa)return;let de=J(at.x,at.y,H),fe=te;return ue&&oe(te)&&(fe=p.neg(te),de^=1),new N(H,fe,W?void 0:de)}return{seed:Oe,k2sig:be}}function j(K,P,re={}){const{seed:ue,k2sig:I}=k(K,P,re);return Cz(r.outputLen,p.BYTES,u)(ue,I).toBytes(re.format)}function U(K,P,re,ue={}){const{lowS:I,prehash:X,format:ce}=cy(ue,x);if(re=Mt(re,void 0,"publicKey"),P=D(P,X),!ld(K)){const he=K instanceof N?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+he)}A(K,ce);try{const he=N.fromBytes(K,ce),Te=e.fromBytes(re);if(Te.is0()||I&&he.hasHighS())return!1;const{r:Oe,s:Ae}=he,be=B(P),_e=p.inv(Ae),Pe=p.create(be*_e),at=p.create(Oe*_e),H=e.BASE.mulAddUnsafe(Pe,Te,at);if(H.is0())return!1;const te=H.toAffine();return!(p.create(te.x)!==Oe||ce==="recovered"&&he.recovery!==J(te.x,te.y,Oe))}catch{return!1}}function V(K,P,re={}){const{prehash:ue}=cy(re,x);return P=D(P,ue),N.fromBytes(K,"recovered").recoverPublicKey(P).toBytes()}return Object.freeze({keygen:E,getPublicKey:O,getSharedSecret:C,utils:R,lengths:$,Point:e,sign:j,verify:U,recoverPublicKey:V,Signature:N,hash:r})}const E$={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},_$=C3(E$),Uu=j3(_$,Tb),uy=33,dv=64;var Mc,k$=(Mc=class extends ol{constructor(t){if(super(),typeof t=="string"?this.data=Ge(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==uy)throw new Error(`Invalid public key input. Expected ${uy} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return Ps.Passkey}async verify(t,s){const r=M3(s),i=JSON.parse(r.clientDataJson);if(i.type!=="webauthn.get"||!mi(t,Ge(i.challenge.replace(/-/g,"+").replace(/_/g,"/"))))return!1;const c=r.userSignature.slice(1+dv);if(!mi(this.toRawBytes(),c))return!1;const u=new Uint8Array([...r.authenticatorData,...Tb(new TextEncoder().encode(r.clientDataJson))]),d=r.userSignature.slice(1,dv+1);return Uu.verify(d,u,c)}},Mc.SIZE=uy,Mc);function M3(e){const t=typeof e=="string"?Ge(e):e;if(t[0]!==Ps.Passkey)throw new Error("Invalid signature scheme");const s=vk.parse(t.slice(1));return{signatureScheme:"Passkey",serializedSignature:Ke(t),signature:t,authenticatorData:s.authenticatorData,clientDataJson:s.clientDataJson,userSignature:new Uint8Array(s.userSignature),publicKey:new Uint8Array(s.userSignature.slice(1+dv))}}function A$(e){for(let t=0;t<e.length;t++)if(e[t]!==0)return t;return-1}function Mb(e,t){return Qv(e.toString(16).padStart(t*2,"0").slice(-t*2))}function D3(e,t){const s=Mb(e,t),r=A$(s);return r===-1?new Uint8Array([0]):s.slice(r)}function O$(e){return e==="accounts.google.com"?"https://accounts.google.com":e}function N$(e){if(e.length!==1)throw new Error("Invalid base64Url character: "+e);const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".indexOf(e);if(t===-1)throw new Error("Invalid base64Url character: "+e);const s=t.toString(2).padStart(6,"0");return Array.from(s).map(Number)}function x$(e){let t=[];for(let s=0;s<e.length;s++){const r=N$(e.charAt(s));t=t.concat(r)}return t}function C$(e,t){if(e.length<2)throw new Error(`Input (s = ${e}) is not tightly packed because s.length < 2`);let s=x$(e);const r=t%4;if(r!==0)if(r===1)s=s.slice(2);else if(r===2)s=s.slice(4);else throw new Error(`Input (s = ${e}) is not tightly packed because i%4 = 3 (i = ${t}))`);const i=(t+e.length-1)%4;if(i!==3)if(i===2)s=s.slice(0,s.length-2);else if(i===1)s=s.slice(0,s.length-4);else throw new Error(`Input (s = ${e}) is not tightly packed because (i + s.length - 1)%4 = 0 (i = ${t}))`);if(s.length%8!==0)throw new Error("We should never reach here...");const c=new Uint8Array(Math.floor(s.length/8));let u=0;for(let d=0;d<s.length;d+=8){const p=s.slice(d,d+8),m=parseInt(p.join(""),2);c[u++]=m}return new TextDecoder().decode(c)}function I$(e){if(!(e.slice(-1)==="}"||e.slice(-1)===","))throw new Error("Invalid claim");const t=JSON.parse("{"+e.slice(0,-1)+"}");if(Object.keys(t).length!==1)throw new Error("Invalid claim");const s=Object.keys(t)[0];return[s,t[s]]}function U3(e,t){const[s,r]=I$(C$(e.value,e.indexMod4));if(s!==t)throw new Error(`Invalid field name: found ${s} expected ${t}`);return r}const R$=S.struct("ZkLoginSignature",{inputs:S.struct("ZkLoginSignatureInputs",{proofPoints:S.struct("ZkLoginSignatureInputsProofPoints",{a:S.vector(S.string()),b:S.vector(S.vector(S.string())),c:S.vector(S.string())}),issBase64Details:S.struct("ZkLoginSignatureInputsClaim",{value:S.string(),indexMod4:S.u8()}),headerBase64:S.string(),addressSeed:S.string()}),maxEpoch:S.u64(),userSignature:S.byteVector()});function j$(e){return R$.parse(typeof e=="string"?Ge(e):e)}var B3=class ti extends ol{#e;#t;#r;constructor(t,{client:s}={}){super(),this.#t=s,typeof t=="string"?this.#e=Ge(t):t instanceof Uint8Array?this.#e=t:this.#e=Uint8Array.from(t),this.#r=this.#e.length!==this.#e[0]+1+32,this.#r&&(this.#e=wc(this.#e,!1))}get legacyAddress(){return this.#r}static fromBytes(t,{client:s,address:r,legacyAddress:i}={}){let c;if(i===!0?c=new ti(wc(t,!0),{client:s}):i===!1?c=new ti(wc(t,!1),{client:s}):r?(c=new ti(wc(t,!1),{client:s}),c.toSuiAddress()!==r&&(c=new ti(wc(t,!0),{client:s}))):c=new ti(t,{client:s}),r&&c.toSuiAddress()!==r)throw new Error("Public key bytes do not match the provided address");return c}static fromProof(t,s){const{issBase64Details:r,addressSeed:i}=s,c=U3(r,"iss"),u=np(BigInt(i),c,{legacyAddress:!0});if(u.toSuiAddress()===t)return u;const d=np(BigInt(i),c,{legacyAddress:!1});if(d.toSuiAddress()!==t)throw new Error("Proof does not match address");return d}equals(t){return super.equals(t)}toSuiAddress(){return this.#r?this.#s():super.toSuiAddress()}#s(){const t=wc(this.#e,!0),s=new Uint8Array(t.length+1);return s[0]=this.flag(),s.set(t,1),ye(il(po(s,{dkLen:32})).slice(0,sl*2))}toRawBytes(){return this.#e}flag(){return Ps.ZkLogin}async verify(t,s){throw Error("does not support")}verifyPersonalMessage(t,s){const r=fv(s);return p_({address:new ti(r.publicKey).toSuiAddress(),bytes:Ke(t),signature:r.serializedSignature,intentScope:"PersonalMessage",client:this.#t})}verifyTransaction(t,s){const r=fv(s);return p_({address:new ti(r.publicKey).toSuiAddress(),bytes:Ke(t),signature:r.serializedSignature,intentScope:"TransactionData",client:this.#t})}verifyAddress(t){return t===super.toSuiAddress()||t===this.#s()}};function np(e,t,s){if(s.legacyAddress===void 0)throw new Error("legacyAddress parameter must be specified");const r=s.legacyAddress?D3(e,32):Mb(e,32),i=new TextEncoder().encode(O$(t)),c=new Uint8Array(1+i.length+r.length);return c.set([i.length],0),c.set(i,1),c.set(r,1+i.length),new B3(c,s)}function wc(e,t){const s=e[0]+1,r=BigInt(`0x${Ar(e.slice(s))}`),i=t?D3(r,32):Mb(r,32),c=new Uint8Array(s+i.length);return c.set(e.slice(0,s),0),c.set(i,s),c}async function p_({address:e,bytes:t,signature:s,intentScope:r,client:i}){if(!i)throw new Error("A Sui Client (GRPC, GraphQL, or JSON RPC) is required to verify zkLogin signatures");const c=await i.core.verifyZkLoginSignature({bytes:t,signature:s,intentScope:r,address:e});return c.success===!0&&c.errors.length===0}function fv(e){const t=typeof e=="string"?Ge(e):e;if(t[0]!==Ps.ZkLogin)throw new Error("Invalid signature scheme");const{inputs:s,maxEpoch:r,userSignature:i}=j$(t.slice(1)),{issBase64Details:c,addressSeed:u}=s,d=U3(c,"iss"),p=np(BigInt(u),d,{legacyAddress:!1});return{serializedSignature:Ke(t),signatureScheme:"ZkLogin",zkLogin:{inputs:s,maxEpoch:r,userSignature:i,iss:d,addressSeed:BigInt(u)},signature:t,publicKey:p.toRawBytes()}}function M$({signature:e,signatureScheme:t,publicKey:s}){if(!s)throw new Error("`publicKey` is required");const r=s.toRawBytes(),i=new Uint8Array(1+e.length+r.length);return i.set([Ps[t]]),i.set(e,1),i.set(r,1+e.length),Ke(i)}function sp(e){const t=Ge(e),s=Bp[t[0]];switch(s){case"Passkey":return M3(e);case"MultiSig":return{serializedSignature:e,signatureScheme:s,multisig:M.MultiSig.parse(t.slice(1)),bytes:t,signature:void 0};case"ZkLogin":return fv(e);case"ED25519":case"Secp256k1":case"Secp256r1":return wb(e);default:throw new Error("Unsupported signature scheme")}}const Ah=32,L3="suiprivkey";var Db=class{async signWithIntent(e,t){const s=po(n3(t,e),{dkLen:32});return{signature:M$({signature:await this.sign(s),signatureScheme:this.getKeyScheme(),publicKey:this.getPublicKey()}),bytes:Ke(e)}}async signTransaction(e){return this.signWithIntent(e,"TransactionData")}async signPersonalMessage(e){const{signature:t}=await this.signWithIntent(S.byteVector().serialize(e).toBytes(),"PersonalMessage");return{bytes:Ke(e),signature:t}}async signAndExecuteTransaction({transaction:e,client:t}){e.setSenderIfNotSet(this.toSuiAddress());const s=await e.build({client:t}),{signature:r}=await this.signTransaction(s);return t.core.executeTransaction({transaction:s,signatures:[r],include:{transaction:!0,effects:!0}})}toSuiAddress(){return this.getPublicKey().toSuiAddress()}},D$=class extends Db{};function U$(e){const{prefix:t,words:s}=Dh.decode(e);if(t!==L3)throw new Error("invalid private key prefix");const r=new Uint8Array(Dh.fromWords(s)),i=r.slice(1);return{scheme:Bp[r[0]],secretKey:i}}function B$(e,t){if(e.length!==Ah)throw new Error("Invalid bytes length");const s=Ps[t],r=new Uint8Array(e.length+1);return r.set([s]),r.set(e,1),Dh.encode(L3,Dh.toWords(r))}const L$="ed25519 seed",z$=2147483648,$$=new RegExp("^m(\\/[0-9]+')+$"),z3=e=>e.replace("'",""),V$=e=>{const t=zp.create(cd,new TextEncoder().encode(L$)).update(sd(e)).digest();return{key:t.slice(0,32),chainCode:t.slice(32)}},P$=({key:e,chainCode:t},s)=>{const r=new ArrayBuffer(4);new DataView(r).setUint32(0,s);const i=new Uint8Array(1+e.length+r.byteLength);i.set(new Uint8Array(1).fill(0)),i.set(e,1),i.set(new Uint8Array(r,0,r.byteLength),e.length+1);const c=zp.create(cd,t).update(i).digest();return{key:c.slice(0,32),chainCode:c.slice(32)}},G$=e=>$$.test(e)?!e.split("/").slice(1).map(z3).some(isNaN):!1,m_=(e,t,s=z$)=>{if(!G$(e))throw new Error("Invalid derivation path");const{key:r,chainCode:i}=V$(t);return e.split("/").slice(1).map(z3).map(c=>parseInt(c,10)).reduce((c,u)=>P$(c,u+s),{key:r,chainCode:i})},g_="m/44'/784'/0'/0'/0'";var F$=class xu extends D${constructor(t){if(super(),t)this.keypair={publicKey:t.publicKey,secretKey:t.secretKey.slice(0,32)};else{const s=na.utils.randomSecretKey();this.keypair={publicKey:na.getPublicKey(s),secretKey:s}}}getKeyScheme(){return"ED25519"}static generate(){const t=na.utils.randomSecretKey();return new xu({publicKey:na.getPublicKey(t),secretKey:t})}static fromSecretKey(t,s){if(typeof t=="string"){const c=U$(t);if(c.scheme!=="ED25519")throw new Error(`Expected a ED25519 keypair, got ${c.scheme}`);return this.fromSecretKey(c.secretKey,s)}const r=t.length;if(r!==Ah)throw new Error(`Wrong secretKey size. Expected ${Ah} bytes, got ${r}.`);const i={publicKey:na.getPublicKey(t),secretKey:t};if(!s||!s.skipValidation){const c=new TextEncoder().encode("sui validation"),u=na.sign(c,t);if(!na.verify(u,c,i.publicKey))throw new Error("provided secretKey is invalid")}return new xu(i)}getPublicKey(){return new O3(this.keypair.publicKey)}getSecretKey(){return B$(this.keypair.secretKey.slice(0,Ah),this.getKeyScheme())}async sign(t){return na.sign(t,this.keypair.secretKey)}static deriveKeypair(t,s){if(s==null&&(s=g_),!f_(s))throw new Error("Invalid derivation path");const{key:r}=m_(s,y$(t));return xu.fromSecretKey(r)}static deriveKeypairFromSeed(t,s){if(s==null&&(s=g_),!f_(s))throw new Error("Invalid derivation path");const r=typeof t=="string"?t:Ar(t),{key:i}=m_(s,r);return xu.fromSecretKey(i)}};const Ub={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},H$={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},y_=BigInt(2);function q$(e){const t=Ub.p,s=BigInt(3),r=BigInt(6),i=BigInt(11),c=BigInt(22),u=BigInt(23),d=BigInt(44),p=BigInt(88),m=e*e*e%t,g=m*m*e%t,y=Ft(g,s,t)*g%t,b=Ft(y,s,t)*g%t,E=Ft(b,y_,t)*m%t,O=Ft(E,i,t)*E%t,C=Ft(O,c,t)*O%t,R=Ft(C,d,t)*C%t,$=Ft(R,p,t)*R%t,x=Ft($,d,t)*C%t,W=Ft(x,s,t)*g%t,oe=Ft(W,u,t)*O%t,me=Ft(oe,r,t)*m%t,G=Ft(me,y_,t);if(!hv.eql(hv.sqr(G),e))throw new Error("Cannot find square root");return G}const hv=Lp(Ub.p,{sqrt:q$}),Z$=C3(Ub,{Fp:hv,endo:H$}),Y$=j3(Z$,Tb),dy=33;var Dc,W$=(Dc=class extends ol{constructor(t){if(super(),typeof t=="string"?this.data=Ge(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==dy)throw new Error(`Invalid public key input. Expected ${dy} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return Ps.Secp256k1}async verify(t,s){let r;if(typeof s=="string"){const i=wb(s);if(i.signatureScheme!=="Secp256k1")throw new Error("Invalid signature scheme");if(!mi(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return Y$.verify(r,t,this.toRawBytes())}},Dc.SIZE=dy,Dc);const fy=33;var Uc,Bb=(Uc=class extends ol{constructor(t){if(super(),typeof t=="string"?this.data=Ge(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==fy)throw new Error(`Invalid public key input. Expected ${fy} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return Ps.Secp256r1}async verify(t,s){let r;if(typeof s=="string"){const i=sp(s);if(i.signatureScheme!=="Secp256r1")throw new Error("Invalid signature scheme");if(!mi(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return Uu.verify(r,t,this.toRawBytes())}},Uc.SIZE=fy,Uc),X$=class{#e;#t;#r=null;constructor(e,t){this.#e=e,this.#t=t}get(e){return this.#a("readonly",t=>t.get(e))}async set(e,t){await this.#a("readwrite",s=>s.put(t,e))}del(e){return this.#a("readwrite",t=>t.delete(e))}entries(){return this.#s().then(e=>new Promise((t,s)=>{const r=e.transaction(this.#t,"readonly"),i=r.objectStore(this.#t),c=[],u=i.openCursor();u.onsuccess=()=>{const d=u.result;d&&(c.push([d.key,d.value]),d.continue())},r.oncomplete=()=>t(c),r.onerror=()=>s(r.error)}))}#s(){return this.#r||(this.#r=new Promise((e,t)=>{const s=indexedDB.open(this.#e);s.onupgradeneeded=()=>{s.result.objectStoreNames.contains(this.#t)||s.result.createObjectStore(this.#t)},s.onsuccess=()=>e(s.result),s.onerror=()=>{this.#r=null,t(s.error)}})),this.#r}#a(e,t){return this.#s().then(s=>new Promise((r,i)=>{const c=s.transaction(this.#t,e),u=t(c.objectStore(this.#t));c.oncomplete=()=>r(u.result),c.onerror=()=>i(c.error),c.onabort=()=>i(c.error)}))}};function K$(e){const t=new Uint8Array(e),s=t.slice(1,33),r=(t.slice(33,65)[31]&1)===0?2:3,i=new Uint8Array(Bb.SIZE);return i[0]=r,i.set(s,1),i}var v_=class pv extends Db{#e;static async generate({extractable:t=!1}={}){const s=await globalThis.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},t,["sign","verify"]),r=await globalThis.crypto.subtle.exportKey("raw",s.publicKey);return new pv(s.privateKey,K$(new Uint8Array(r)))}static import(t){return new pv(t.privateKey,t.publicKey)}getKeyScheme(){return"Secp256r1"}constructor(t,s){super(),this.privateKey=t,this.#e=new Bb(s)}export(){const t={privateKey:this.privateKey,publicKey:this.#e.toRawBytes()};return Object.defineProperty(t,"toJSON",{enumerable:!1,value:()=>{throw new Error("The exported keypair must not be serialized. It must be stored in IndexedDB directly.")}}),t}getPublicKey(){return this.#e}async sign(t){const s=await globalThis.crypto.subtle.sign({name:"ECDSA",hash:"SHA-256"},this.privateKey,t),r=Uu.Signature.fromBytes(new Uint8Array(s));return(r.hasHighS()?new Uu.Signature(r.r,Uu.Point.Fn.neg(r.s)):r).toBytes("compact")}};const J$="dev-wallet-webcrypto",Q$="accounts",hy="__account_meta__";var eV=class extends bz{#e;constructor(e){super(),this.id="webcrypto",this.name="WebCrypto Signer",this.#e=new X$(e?.dbName??J$,e?.storeName??Q$)}async initialize(){const e=await this.#e.entries(),t=await this.#e.get(hy)??[],s=[];for(const[r,i]of e){if(r===hy)continue;const c=r;try{const u=i,d=v_.import(u),p=t.find(m=>m.address===c);s.push(Jy(d,c,p?.label??"Account"))}catch(u){console.warn(`[dev-wallet] Failed to load account ${c}, skipping:`,u)}}this.setInitialAccounts(s)}async createAccount(e){const t=await v_.generate(),s=t.getPublicKey().toSuiAddress(),r=Jy(t,s,e?.label??this.getDefaultLabel());return await this.#e.set(s,t.export()),this.addAccount(r),await this.#t(),r}async renameAccount(e,t){return this._performRename(e,t)?(await this.#t(),!0):!1}async removeAccount(e){return this.removeAccountByAddress(e)?(await this.#e.del(e),await this.#t(),!0):!1}async#t(){const e=this.getAccounts().map(t=>({address:t.address,label:t.label}));await this.#e.set(hy,e)}};let py=0,b_=[];function tV(){return py+=1,()=>{if(py-=1,py===0){let e=b_;b_=[];for(let t of e)t()}}}function rp(e){let t=tV(),s;try{s=Promise.resolve(e()).finally(t)}catch(r){throw t(),r}return s.t=!0,s}let Qs=[],Cu=0;const mv=4,Oh=globalThis.nanostoresGlobal||={epoch:0};let nV=()=>{let e,t;for(;Cu<Qs.length;){t=Cu,Cu+=mv;try{Qs[t](Qs[t+1].value,Qs[t+2],Qs[t+3])}catch(s){e=s}}if(Qs.length=Cu=0,e)throw e};const ap=e=>{let t=[],s={eq:Object.is,get(){return s.lc||s.listen(()=>{})(),s.value},init:e,lc:0,listen(r){return s.lc=t.push(r),()=>{for(let c=Cu;c<Qs.length;)Qs[c]===r?Qs.splice(c,mv):c+=mv;let i=t.indexOf(r);~i&&(t.splice(i,1),--s.lc||s.off())}},notify(r,i){Oh.epoch++;let c=!Qs.length&&!0;for(let u of t)Qs.push(u,s,r,i);c&&nV()},off(){},set(r){let i=s.value;s.eq(i,r)||(s.value=r,s.notify(i))},subscribe(r){let i=s.listen(r);return r(s.value),i},value:e};return s},sV=e=>e,rV=5,nh=6,sh=10;let aV=(e,t,s,r)=>(e.events=e.events||{},e.events[s+sh]||(e.events[s+sh]=r(i=>{e.events[s].reduceRight((c,u)=>(u(c),c),{shared:{},...i})})),e.events[s]=e.events[s]||[],e.events[s].push(t),()=>{let i=e.events[s],c=i.indexOf(t);~c&&(i.splice(c,1),i.length||(e.events[s+sh](),delete e.events[s+sh]))});const iV=1e3;let $p=(e,t)=>aV(e,r=>{let i=t(r);i&&e.events[nh].push(i)},rV,r=>{let i=e.listen;e.listen=(...u)=>(!e.lc&&!e.active&&(e.active=!0,r()),i(...u));let c=e.off;return e.events[nh]=[],e.off=()=>{c(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let u of e.events[nh])u();e.events[nh]=[]}},iV)},()=>{e.listen=i,e.off=c}}),oV=(e,t,s)=>{Array.isArray(e)||(e=[e]);let r,i,c=()=>{if(i===Oh.epoch)return;i=Oh.epoch;let m=e.map(g=>g.get());if(!r?.every((g,y)=>e[y].eq(g,m[y]))){r=m;let g=t(...m);g&&g.then&&g.t?g.then(y=>{r===m&&u.set(y)}):(u.set(g),i=Oh.epoch)}},u=ap(),d=u.get;u.get=()=>(c(),d());let p=c;return $p(u,()=>{let m=e.map(g=>g.listen(p));return c(),()=>{for(let g of m)g()}}),u};const my=(e,t)=>oV(e,t);function w_(e,t){let s=cV(t),r=e;for(let i of s){if(r==null)return;r=r[i]}return r}const T_=/(.*)\[(\d+)\]/;function cV(e){return e.split(".").flatMap(t=>$3(t))}function $3(e){if(T_.test(e)){let[,t,s]=e.match(T_);return[...$3(t),s]}return[e]}function lV(e,t,s){let r=new Set(t);return e.listen((i,c,u)=>{(u===void 0?t.some(d=>c===void 0||i[d]!==c[d]||w_(i,d)!==w_(c,d)):r.has(u)||r.has(u.split(/\.|\[/)[0]))&&s(i,c,u)})}const uV=(e={})=>{let t=ap(e);return t.eqKey=Object.is,t.setKey=function(s,r){let i=t.value;typeof r>"u"&&s in t.value?(t.value={...t.value},delete t.value[s],t.notify(i,s)):t.eqKey(t.value[s],r,s)||(t.value={...t.value,[s]:r},t.notify(i,s))},t},V3=new WeakMap;function P3(e,t){V3.set(e,t)}function Vp(e){const t=Cr(e),s=t.accounts.find(({address:r})=>r===e.address);if(!s){const r=new ad(yj,{address:e.address,walletName:t.name});throw Ip(r,Vp),r}return s}function Cr(e){const t=V3.get(e);if(!t){const s=new ad(gj);throw Ip(s,Cr),s}return t}function ip(e,t){const s=new Set(e),r=new Set(t);if(s.size!==r.size)return!0;for(const i of s)if(!r.has(i))return!0;return!1}function dV(e,t){if(e.length!==t.length)return!0;for(let s=0;s<e.length;s+=1)if(e[s]!==t[s])return!0;return!1}const S_=new WeakMap;function gv(e,t){let s=S_.get(t);if(s)try{Cr(s)!==e&&(s=void 0)}catch{s=void 0}const r=!s;let i=s??{},c=!s;function u(){c||(i={...i},c=!0)}return(r||ip(i.chains,t.chains))&&(u(),i.chains=Object.freeze([...t.chains])),(r||ip(i.features,t.features))&&(u(),i.features=Object.freeze([...t.features])),(r||i.address!==t.address||i.icon!==t.icon||i.label!==t.label||dV(i.publicKey,t.publicKey))&&(u(),i.address=t.address,i.icon=t.icon,i.label=t.label,i.publicKey=t.publicKey),c&&(S_.set(t,i),P3(i,e)),Object.freeze(i)}const E_=new WeakMap;function fV(e){const t=E_.get(e),s=!t;let r=t??{},i=!t;function c(){i||(r={...r},i=!0)}const u={_cache:[],*[Symbol.iterator](){this._cache.length&&(yield*this._cache);for(const d of e.accounts.slice(this._cache.length)){const p=gv(e,d);this._cache.push(p),yield p}},some(d){if(this._cache.some(d))return!0;for(const p of e.accounts.slice(this._cache.length)){const m=gv(e,p);if(this._cache.push(m),d(m))return!0}return!1},get length(){return e.accounts.length}};return(s||r.accounts.length!==e.accounts.length||u.some(d=>!r.accounts.includes(d)))&&(c(),r.accounts=Object.freeze(Array.from(u))),(s||ip(r.features,Object.keys(e.features)))&&(c(),r.features=Object.freeze(Object.keys(e.features))),(s||ip(r.chains,e.chains))&&(c(),r.chains=Object.freeze([...e.chains])),(s||r.icon!==e.icon||r.name!==e.name||r.version!==e.version)&&(c(),r.icon=e.icon,r.name=e.name,r.version=e.version),i&&(E_.set(e,r),P3(r,e)),Object.freeze(r)}function hV(e,t){if(e.address!==t.address)return!1;const s=Cr(e),r=Cr(t);return s===r}function Zc(e,t){const s=Cr(t),r=Cr(e);return s===r}function dd(e,t){const s=Cr(e);if(!(t in s.features)){const r=new ad(Tj,{featureName:t,supportedChains:[...s.chains],supportedFeatures:Object.keys(s.features),walletName:s.name});throw Ip(r,dd),r}return s.features[t]}function G3(e,t){if(!e.features.includes(t)){const s=new ad(wj,{address:e.address,featureName:t,supportedChains:[...e.chains],supportedFeatures:[...e.features]});throw Ip(s,G3),s}return dd(e,t)}new TextEncoder;const pV=new TextDecoder,mV=new TextDecoder("utf-8",{fatal:!0});function gV(e,t=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64"});if(t){if(e.includes("+")||e.includes("/"))throw new TypeError("Invalid base64url");e=e.replace(/-/g,"+").replace(/_/g,"/")}const s=atob(e),r=new Uint8Array(s.length);for(let i=0;i<s.length;i++)r[i]=s.charCodeAt(i);return r}class yV extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,s){super(t,s),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class qi extends yV{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}const vV="The input to be decoded is not correctly encoded.";function bV(e){try{return gV(typeof e=="string"?e:pV.decode(e),!0)}catch(t){throw new TypeError(vV,{cause:t})}}function wV(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function TV(e){if(typeof e!="string")throw new qi("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:s}=e.split(".");if(s===5)throw new qi("Only JWTs using Compact JWS serialization can be decoded");if(s!==3)throw new qi("Invalid JWT");if(!t)throw new qi("JWTs must contain a payload");let r;try{r=bV(t)}catch{throw new qi("Failed to base64url decode the payload")}let i;try{i=JSON.parse(mV.decode(r))}catch{throw new qi("Failed to parse the decoded payload as JSON")}if(!wV(i))throw new qi("Invalid JWT Claims Set");return i}const SV=Ne({address:Be(),publicKey:Be(),label:fn(Be()),features:fn(ct(Be()))}),EV=Ne({exp:In(),iat:In(),iss:Be(),aud:Be(),payload:Ne({accounts:ct(SV)})});function _V(e){const t=TV(e);return Et(EV,t)}const kV=Np("type",[Ne({type:st("connect"),session:Be("`session` is required")}),Ne({type:st("sign-transaction"),bytes:Be(),signature:Be()}),Ne({type:st("sign-and-execute-transaction"),bytes:Be(),signature:Be(),digest:Be(),effects:Be()}),Ne({type:st("sign-personal-message"),bytes:Be(),signature:Be()})]),AV=Np("type",[Ne({type:st("reject"),reason:fn(Be("`reason` must be a string"))}),Ne({type:st("resolve"),data:kV})]),OV=Ne({id:Kt(Be(),Ik()),source:st("web-wallet-channel"),payload:AV,version:st("1")});function NV(){return{version:"1",originUrl:window.location.href,userAgent:navigator.userAgent,screenResolution:`${window.screen.width}x${window.screen.height}`,language:navigator.language,platform:navigator.platform,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:Date.now()}}var xV=class{#e;#t="1";#r;#s;#a;#i;#o;#c;#n;#m;#h=null;#f=!1;constructor({appName:e,hostOrigin:t,hostPathname:s="dapp-request",extraRequestOptions:r,popupWindow:i}){const c=i??window.open("about:blank","_blank");if(!c)throw new Error("Failed to open new window");this.#r=crypto.randomUUID(),this.#e=c,this.#s=t,this.#a=s,this.#i=e;const{promise:u,resolve:d,reject:p}=H4();this.#c=u,this.#n=d,this.#m=p,this.#o=r,this.#h=setInterval(()=>{try{this.#e.closed&&(this.#l(),p(new Error("User closed the wallet window")))}catch{}},1e3)}send({type:e,...t}){if(this.#e.closed)throw new Error("User closed the wallet window");if(this.#f)throw new Error("send() can only be called once");this.#f=!0,window.addEventListener("message",this.#p);const s={version:this.#t,requestId:this.#r,appUrl:window.location.href.split("#")[0],appName:this.#i,payload:{type:e,...t},metadata:NV(),extraRequestOptions:this.#o},r=encodeURIComponent(btoa(JSON.stringify(s)));return this.#e.location.assign(`${this.#s}/${this.#a}#${r}`),this.#c}close(){this.#l(),this.#e.close()}#p=e=>{if(e.origin!==this.#s)return;const{success:t,output:s}=wR(OV,e.data);!t||s.id!==this.#r||(this.#l(),s.payload.type==="reject"?this.#m(new Error(s.payload.reason||"User rejected the request")):s.payload.type==="resolve"&&this.#n(s.payload.data))};#l(){this.#h&&(clearInterval(this.#h),this.#h=null),window.removeEventListener("message",this.#p)}};const CV="https://my.slush.app",op="slush:session",IV="Slush",RV="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgMjRDMCAxMC43NDUyIDEwLjc0NTIgMCAyNCAwQzM3LjI1NDggMCA0OCAxMC43NDUyIDQ4IDI0QzQ4IDM3LjI1NDggMzcuMjU0OCA0OCAyNCA0OEMxMC43NDUyIDQ4IDAgMzcuMjU0OCAwIDI0WiIgZmlsbD0iIzBDMEExRiIvPgo8cGF0aCBkPSJNMTMuMTM1OCAzMi4xMDg1QzE0LjE3MDEgMzUuOTY4MyAxOC4wMzMxIDM5LjQ2MjQgMjYuMDI1NSAzNy4zMjA4QzMzLjY1MTUgMzUuMjc3NCAzOC40MzA5IDI5LjAwNCAzNy4xOTE2IDI0LjM3ODlDMzYuNzYzNiAyMi43ODE3IDM1LjQ3NDYgMjEuNzAwNiAzMy40ODcyIDIxLjg3NjVMMTUuNzE2NSAyMy4zNTcyQzE0LjU5NzMgMjMuNDQzIDE0LjA4NDIgMjMuMjU5NiAxMy43ODgxIDIyLjU1NDNDMTMuNTAxIDIxLjg4MjMgMTMuNjY0NiAyMS4xNjA5IDE1LjAxNjMgMjAuNDc3N0wyOC41NDAxIDEzLjUzNzRDMjkuNTc2NyAxMy4wMSAzMC4yNjcxIDEyLjc4OTMgMzAuODk4IDEzLjAxMjZDMzEuMjkzNCAxMy4xNTYzIDMxLjU1MzggMTMuNzI4NCAzMS4zMTQ3IDE0LjQzNDRMMzAuNDM3OCAxNy4wMjMyQzI5LjM2MTcgMjAuMjAwMiAzMS42NjUzIDIwLjkzODIgMzIuOTY0MSAyMC41OTAyQzM0LjkyODkgMjAuMDYzNyAzNS4zOTExIDE4LjE5MjMgMzQuNzU4MSAxNS44Mjk5QzMzLjE1MzMgOS44NDA1NCAyNi43OTkgOC45MDQxMSAyMS4wMzc4IDEwLjQ0NzhDMTUuMTc2NyAxMi4wMTgzIDEwLjA5NiAxNi43Njc2IDExLjY0NzQgMjIuNTU3M0MxMi4wMTI5IDIzLjkyMTYgMTMuMjY4NyAyNS4wMTE2IDE0LjcyMzIgMjQuOTc4NUwxNi45NDM4IDI0Ljk3MzFDMTcuNDAwNCAyNC45NjI1IDE3LjIzNiAyNSAxOC4xMTcgMjQuOTI3MUMxOC45OTggMjQuODU0MSAyMS4zNTA5IDI0LjU2NDYgMjEuMzUwOSAyNC41NjQ2TDMyLjg5NjIgMjMuMjU4TDMzLjE5MzcgMjMuMjE0OEMzMy44Njg5IDIzLjA5OTcgMzQuMzc5MiAyMy4yNzUgMzQuODEwNiAyNC4wMTgzQzM1LjQ1NjMgMjUuMTMwNCAzNC40NzEyIDI1Ljk2OTEgMzMuMjkyIDI2Ljk3MzFDMzMuMjYwNSAyNyAzMy4yMjg4IDI3LjAyNyAzMy4xOTcgMjcuMDU0MUwyMy4wNDgyIDM1LjgwMDVDMjEuMzA4NyAzNy4zMDA4IDIwLjA4NjcgMzYuNzM2NyAxOS42NTg4IDM1LjEzOTVMMTguMTQzMSAyOS40ODI5QzE3Ljc2ODcgMjguMDg1NCAxNi40MDQxIDI2Ljk4ODkgMTQuODA1NiAyNy40MTcyQzEyLjgwNzUgMjcuOTUyNiAxMi42NDU1IDMwLjI3ODQgMTMuMTM1OCAzMi4xMDg1WiIgZmlsbD0iI0ZCRkFGRiIvPgo8L3N2Zz4K",gy="com.mystenlabs.suiwallet",jV="https://api.slush.app/api/wallet/metadata",MV={id:"com.mystenlabs.suiwallet.web",walletName:"Slush",description:"Trade and earn on Sui.",icon:RV,enabled:!0},DV=Ne({id:Be("Wallet ID is required"),walletName:Be("Wallet name is required"),icon:Be("Icon must be a valid wallet icon format"),enabled:fo("Enabled is required")});function UV(e){localStorage.setItem(op,e)}function gu(){const e=localStorage.getItem(op);if(!e)throw new Error("No session found");return e}const __=["sui:signTransaction","sui:signAndExecuteTransaction","sui:signPersonalMessage","sui:signTransactionBlock"];function k_(e){const{payload:t}=_V(e);return t.accounts.map(s=>new id({address:s.address,chains:Gu,features:s.features?__.filter(r=>s.features?.includes(r)):__,publicKey:Ge(s.publicKey)}))}var BV=class{#e;#t;#r;#s;#a;#i;#o;#c=null;get name(){return this.#a}get id(){return this.#e}get icon(){return this.#i}get version(){return"1.0.0"}get chains(){return Gu}get accounts(){return this.#r}get features(){return{"standard:connect":{version:"1.0.0",connect:this.#g},"standard:disconnect":{version:"1.0.0",disconnect:this.#y},"standard:events":{version:"1.0.0",on:this.#p},"sui:signTransactionBlock":{version:"1.0.0",signTransactionBlock:this.#n},"sui:signTransaction":{version:"2.0.0",signTransaction:this.#m},"sui:signPersonalMessage":{version:"1.1.0",signPersonalMessage:this.#f},"sui:signAndExecuteTransaction":{version:"2.0.0",signAndExecuteTransaction:this.#h}}}constructor({name:e,origin:t,metadata:s}){if(this.#e=s.id,this.#r=this.#d(),this.#t=Z4(),this.#s=t||CV,this.#o=e,this.#a=s.walletName,this.#i=s.icon,typeof window<"u"){const r=window,i=c=>{c.storageArea!==localStorage||c.key!==op&&c.key!==null||this.#l(this.#d())};r.addEventListener("storage",i),this.#c=()=>r.removeEventListener("storage",i)}}dispose(){this.#c?.(),this.#c=null}#n=async({transactionBlock:e,account:t,chain:s})=>{const r=await e.toJSON(),i=await this.#u().send({type:"sign-transaction",transaction:r,address:t.address,chain:s,session:gu()});return{transactionBlockBytes:i.bytes,signature:i.signature}};#m=async({transaction:e,account:t,chain:s})=>{const r=this.#u(),i=await e.toJSON(),c=await r.send({type:"sign-transaction",transaction:i,address:t.address,chain:s,session:gu()});return{bytes:c.bytes,signature:c.signature}};#h=async({transaction:e,account:t,chain:s})=>{const r=this.#u(),i=await e.toJSON(),c=await r.send({type:"sign-and-execute-transaction",transaction:i,address:t.address,chain:s,session:gu()});return{bytes:c.bytes,signature:c.signature,digest:c.digest,effects:c.effects}};#f=async({message:e,account:t,chain:s})=>{const r=await this.#u().send({type:"sign-personal-message",message:Ke(e),address:t.address,chain:s??nA,session:gu()});return{bytes:r.bytes,signature:r.signature}};#p=(e,t)=>(this.#t.on(e,t),()=>this.#t.off(e,t));#l(e){this.#r=e,this.#t.emit("change",{accounts:this.accounts})}#g=async e=>{if(e?.silent)return{accounts:this.accounts};const t=await this.#u().send({type:"connect"});return UV(t.session),this.#l(k_(t.session)),{accounts:this.accounts}};#d(){try{return k_(gu())}catch{return[]}}#y=async()=>{localStorage.removeItem(op),this.#l([])};#u(){return new xV({appName:this.#o,hostOrigin:this.#s})}updateMetadata(e){this.#e=e.id,this.#a=e.walletName,this.#i=e.icon}};async function LV(e){const t=await fetch(e);if(!t.ok)throw new Error("Failed to fetch wallet metadata");return Et(DV,await t.json())}function zV(e,{origin:t,metadataApiUrl:s=jV}={}){const r=Cp();if(r.get().some(m=>m.id===gy))return;const i=new BV({name:e,origin:t,metadata:MV}),c=r.register(i);let u=!1;const d=()=>{u||(u=!0,i.dispose(),p(),c())},p=r.on("register",m=>{m.id===gy&&d()});return r.get().some(m=>m.id===gy)&&d(),LV(s).then(m=>{if(!u){if(!m.enabled){console.log("Slush wallet is not currently enabled."),d();return}i.updateMetadata(m)}}).catch(m=>{console.error("Error fetching metadata",m)}),{wallet:i,unregister:d}}var $V=class extends Db{#e;#t;constructor(e,t=[]){super(),this.#e=e,this.#t=t;const s=new Set;let r=0;const i=e.getPublicKeys().map(({weight:c,publicKey:u})=>({weight:c,address:u.toSuiAddress()}));for(const c of t){const u=c.toSuiAddress();if(s.has(u))throw new Error("Can't create MultiSigSigner with duplicate signers");s.add(u);const d=i.find(p=>p.address===u)?.weight;if(!d)throw new Error(`Signer ${u} is not part of the MultiSig public key`);r+=d}if(r<e.getThreshold())throw new Error("Combined weight of signers is less than threshold")}getKeyScheme(){return"MultiSig"}getPublicKey(){return this.#e}sign(e){throw new Error("MultiSigSigner does not support signing directly. Use signTransaction or signPersonalMessage instead")}async signTransaction(e){return{signature:this.#e.combinePartialSignatures(await Promise.all(this.#t.map(async t=>(await t.signTransaction(e)).signature))),bytes:Ke(e)}}async signPersonalMessage(e){return{signature:this.#e.combinePartialSignatures(await Promise.all(this.#t.map(async t=>(await t.signPersonalMessage(e)).signature))),bytes:Ke(e)}}};const yu=10,A_=1;var F3=class H3 extends ol{constructor(t,s={}){if(super(),typeof t=="string"?(this.rawBytes=Ge(t),this.multisigPublicKey=M.MultiSigPublicKey.parse(this.rawBytes)):t instanceof Uint8Array?(this.rawBytes=t,this.multisigPublicKey=M.MultiSigPublicKey.parse(this.rawBytes)):(this.multisigPublicKey=t,this.rawBytes=M.MultiSigPublicKey.serialize(t).toBytes()),this.multisigPublicKey.threshold<1)throw new Error("Invalid threshold");const r=new Set;this.publicKeys=this.multisigPublicKey.pk_map.map(({pubKey:c,weight:u})=>{const[d,p]=Object.entries(c).filter(([g])=>g!=="$kind")[0],m=Uint8Array.from(p).toString();if(r.has(m))throw new Error("Multisig does not support duplicate public keys");if(r.add(m),u<1)throw new Error("Invalid weight");return{publicKey:Lb(d,Uint8Array.from(p),s),weight:u}});const i=this.publicKeys.reduce((c,{weight:u})=>c+u,0);if(this.multisigPublicKey.threshold>i)throw new Error("Unreachable threshold");if(this.publicKeys.length>yu)throw new Error(`Max number of signers in a multisig is ${yu}`);if(this.publicKeys.length<A_)throw new Error(`Min number of signers in a multisig is ${A_}`)}static fromPublicKeys({threshold:t,publicKeys:s}){return new H3({pk_map:s.map(({publicKey:r,weight:i})=>({pubKey:{[Bp[r.flag()]]:r.toRawBytes()},weight:i})),threshold:t})}equals(t){return super.equals(t)}toRawBytes(){return this.rawBytes}getPublicKeys(){return this.publicKeys}getThreshold(){return this.multisigPublicKey.threshold}getSigner(...t){return new $V(this,t)}toSuiAddress(){const t=1+65*yu+2,s=new Uint8Array(t);s.set([Ps.MultiSig]),s.set(M.u16().serialize(this.multisigPublicKey.threshold).toBytes(),1);let r=3;for(const{publicKey:i,weight:c}of this.publicKeys){const u=i.toSuiBytes();s.set(u,r),r+=u.length,s.set([c],r++)}return ye(il(po(s.slice(0,r),{dkLen:32})))}flag(){return Ps.MultiSig}async verify(t,s){const r=sp(s);if(r.signatureScheme!=="MultiSig")throw new Error("Invalid signature scheme");const{multisig:i}=r;let c=0;if(!mi(M.MultiSigPublicKey.serialize(this.multisigPublicKey).toBytes(),M.MultiSigPublicKey.serialize(i.multisig_pk).toBytes()))return!1;for(const{publicKey:u,weight:d,signature:p}of VV(i)){if(!await u.verify(t,p))return!1;c+=d}return c>=this.multisigPublicKey.threshold}combinePartialSignatures(t){if(t.length>yu)throw new Error(`Max number of signatures in a multisig is ${yu}`);let s=0;const r=new Array(t.length);for(let d=0;d<t.length;d++){const p=sp(t[d]);if(p.signatureScheme==="MultiSig")throw new Error("MultiSig is not supported inside MultiSig");let m;p.signatureScheme==="ZkLogin"?m=np(p.zkLogin?.addressSeed,p.zkLogin?.iss,{legacyAddress:!1}).toRawBytes():m=p.publicKey,r[d]={[p.signatureScheme]:p.signature};let g;for(let y=0;y<this.publicKeys.length;y++)if(mi(m,this.publicKeys[y].publicKey.toRawBytes())){if(s&1<<y)throw new Error("Received multiple signatures from the same public key");g=y;break}if(g===void 0)throw new Error("Received signature from unknown public key");s|=1<<g}const i={sigs:r,bitmap:s,multisig_pk:this.multisigPublicKey},c=M.MultiSig.serialize(i,{maxSize:8192}).toBytes(),u=new Uint8Array(c.length+1);return u.set([Ps.MultiSig]),u.set(c,1),Ke(u)}};function VV(e,t={}){const s=new Array(e.sigs.length);for(let r=0;r<e.sigs.length;r++){const[i,c]=Object.entries(e.sigs[r]).filter(([g])=>g!=="$kind")[0],u=PV(e.bitmap).at(r),d=e.multisig_pk.pk_map[u],p=Uint8Array.from(Object.values(d.pubKey)[0]);if(i==="MultiSig")throw new Error("MultiSig is not supported inside MultiSig");const m=Lb(i,p,t);s[r]={signatureScheme:i,signature:Uint8Array.from(c),publicKey:m,weight:d.weight}}return s}function PV(e){if(e<0||e>1024)throw new Error("Invalid bitmap");const t=[];for(let s=0;s<10;s++)(e&1<<s)!==0&&t.push(s);return Uint8Array.from(t)}async function GV(e,t,s={}){const r=HV(t,{client:s.client});return!r||!await r.publicKey.verifyPersonalMessage(e,r.serializedSignature)?!1:s.address?r.publicKey.verifyAddress(s.address):!0}async function FV(e,t,s={}){const{publicKey:r}=q3(t,s);if(!await GV(e,t,{client:s.client}))throw new Error("Signature is not valid for the provided message");if(s.address&&!r.verifyAddress(s.address))throw new Error("Signature is not valid for the provided address");return r}function q3(e,t={}){const s=sp(e);if(s.signatureScheme==="MultiSig")return{...s,publicKey:new F3(s.multisig.multisig_pk)};const r=Lb(s.signatureScheme,s.publicKey,t);return{...s,publicKey:r}}function HV(e,t={}){try{return q3(e,t)}catch{return null}}function Lb(e,t,s={}){let r;switch(e){case"ED25519":r=new O3(t);break;case"Secp256k1":r=new W$(t);break;case"Secp256r1":r=new Bb(t);break;case"MultiSig":r=new F3(t);break;case"ZkLogin":r=B3.fromBytes(t,s);break;case"Passkey":r=new k$(t);break;default:throw new Error(`Unsupported signature scheme ${e}`)}if(s.address&&r.toSuiAddress()!==s.address)throw new Error("Public key bytes do not match the provided address");return r}var ll=class extends Error{},zb=class extends ll{},qV=class extends ll{},Pp=class extends ll{},ZV=class extends ll{},$b=class extends ll{};function ul(e){return`sui:${e}`}function YV(e,t){if(e.length===0)throw new ll("You must specify at least one Sui network for your application.");const s=new Map;function r(i){if(s.has(i))return s.get(i);const c=t(i);return s.set(i,c),c}return{networkConfig:Object.freeze(s),getClient:r}}const WV=[ob,Rp],XV=[Fh,eA];function Vb(e){const t=Cr(e);return t.id??t.name}function Pb(e,t){if(!e.wallet||!e.account)throw new zb("No wallet is connected.");if(t&&!Zc(t,e.wallet))throw new $b(`No account with address ${t.address} is connected to ${e.wallet.name}.`);return t??e.account}function Z3({account:e,featureName:t,chain:s}){if(!e.chains.includes(s)){const r=new ad(bj,{chain:s,featureName:t,supportedChains:[...e.chains],supportedFeatures:[...e.features],address:e.address});throw new qV(`The account ${r.context.address} does not support the chain "${r.context.chain}".`,{cause:r})}try{return G3(e,t)}catch(r){throw new Pp(`The account ${e.address} does not support the feature "${t}".`,{cause:r})}}function cp(...e){try{return Z3(...e)}catch(t){if(t instanceof Pp)return null;throw t}}function KV({defaultNetwork:e,getClient:t}){const s=uV({status:"disconnected",currentAccount:null}),r=ap(e),i=ap([]),c=my([i,r],(u,d)=>u.filter(p=>{const m=p.chains.some(b=>ul(d)===b),g=WV.every(b=>p.features.includes(b)),y=XV.some(b=>p.features.includes(b));return m&&g&&y}));return{$currentNetwork:r,$registeredWallets:i,$compatibleWallets:c,$baseConnection:s,$currentClient:my(r,t),$connection:my([s,c],(u,d)=>{switch(u.status){case"connected":{const p=d.find(m=>Zc(u.currentAccount,m));return p?{wallet:p,account:u.currentAccount,status:u.status,supportedIntents:u.supportedIntents,isConnected:!0,isConnecting:!1,isReconnecting:!1,isDisconnected:!1}:{wallet:null,account:null,status:"disconnected",supportedIntents:[],isConnected:!1,isConnecting:!1,isReconnecting:!1,isDisconnected:!0}}case"connecting":return{wallet:null,account:u.currentAccount,status:u.status,supportedIntents:[],isConnected:!1,isConnecting:!0,isReconnecting:!1,isDisconnected:!1};case"reconnecting":{const{currentAccount:p}=u,m=p?d.find(g=>Zc(p,g))??null:null;return!p||!m?{wallet:null,account:null,status:u.status,supportedIntents:[],isConnected:!1,isConnecting:!1,isReconnecting:!0,isDisconnected:!1}:{wallet:m,account:p,status:u.status,supportedIntents:u.supportedIntents,isConnected:!1,isConnecting:!1,isReconnecting:!0,isDisconnected:!1}}case"disconnected":return{wallet:null,account:u.currentAccount,status:u.status,supportedIntents:[],isConnected:!1,isConnecting:!1,isReconnecting:!1,isDisconnected:!0};default:throw new Error(`Encountered unknown connection status: ${u}`)}})}}function JV({$registeredWallets:e}){$p(e,()=>{const t=Cp(),s=new Map,r=()=>{const d=t.get(),p=[];for(const m of d)try{p.push(fV(m))}catch{console.warn(`[dapp-kit] Skipping wallet "${m.name}" because it does not comply with the Wallet Standard.`)}e.set(p)},i=d=>{const p=d.features[Rp].on("change",()=>{r()});s.set(d,p)},c=t.on("register",(...d)=>{d.filter(yy).forEach(i),r()}),u=t.on("unregister",(...d)=>{d.filter(yy).forEach(p=>{const m=s.get(p);m&&(s.delete(p),m())}),r()});return t.get().filter(yy).forEach(i),r(),()=>{c(),u(),s.forEach(d=>d()),s.clear()}})}function yy(e){return Rp in e.features}const QV="mysten-dapp-kit:selected-wallet-and-address";function eP(){return tP()?localStorage:Y3()}function Y3(){const e=new Map;return{getItem(t){return e.get(t)??null},setItem(t,s){e.set(t,s)},removeItem(t){e.delete(t)}}}function W3(e,t,s,r){const i=Vb(s).replace(":","_"),c=r.join(","),u=[i,s.address,c].join(":");e.setItem(t,u)}function tP(){try{const e="__storage_test__";return localStorage.setItem(e,"test"),localStorage.removeItem(e),!0}catch{return!1}}function nP({$baseConnection:e},t,{storage:s,storageKey:r}){return async function({wallet:c,account:u,...d}){return await rp(async()=>{const p=e.get().status==="connected";try{e.setKey("status",p?"reconnecting":"connecting");const{accounts:m,supportedIntents:g}=await X3(c,t,d);if(!p&&m.length===0)throw new ZV("No accounts were authorized.");if(u&&!Zc(u,c))throw new $b(`No account with address ${u.address} is authorized for ${c.name}.`);const y=u??m[0],b=g??[];return e.set({status:"connected",currentAccount:y,supportedIntents:b}),W3(s,r,y,b),{accounts:m}}catch(m){throw e.setKey("status",p?"connected":"disconnected"),m}})}}async function X3(e,t,s){const{connect:r}=dd(e,ob),i=await r(s),c=Cr(e),u=t.map(ul),d=i.supportedIntents??await K3(e);return{accounts:i.accounts.filter(p=>p.chains.some(m=>u.includes(m))).map(gv.bind(null,c)),supportedIntents:d}}async function K3(e){return e.features.includes("sui:getCapabilities")?(await dd(e,"sui:getCapabilities")?.getCapabilities())?.supportedIntents??[]:[]}function sP({networks:e,stores:{$baseConnection:t,$compatibleWallets:s},storage:r,storageKey:i,walletsRegistered:c,timeout:u}){$p(s,()=>{let d=!1,p;const m=()=>{d=!0,p?.()},g=y=>rp(async()=>{if(d)return;const{status:b}=t.get();if(b!=="disconnected"&&b!=="reconnecting"){m();return}const E=await rP({networks:e,storage:r,storageKey:i,wallets:y});d||E&&(t.set({status:"connected",currentAccount:E.account,supportedIntents:E.supportedIntents}),m())});return p=s.subscribe((y,b)=>{y&&(b&&b.length>y.length||g(y))}),rp(async()=>{const y=!!await r.getItem(i);if(d)return;if(!y){m();return}t.get().status==="disconnected"&&t.set({status:"reconnecting",currentAccount:null,supportedIntents:[]});const b=new Promise(E=>setTimeout(E,u));await Promise.all([c.catch(()=>{}),b]),!d&&(await g(s.get()??[]),!d&&t.get().status==="reconnecting"&&t.set({status:"disconnected",currentAccount:null}))}),m})}async function rP({networks:e,storage:t,storageKey:s,wallets:r}){const i=await t.getItem(s);if(!i)return null;const[c,u,d]=i.split(":");if(!c||!u)return null;const p=r.find(E=>Vb(E)===c);if(!p)return null;const m=p.accounts.find(E=>E.address===u);if(m)return{account:m,supportedIntents:(d?d.split(","):null)??await K3(p)};const{accounts:g,supportedIntents:y}=await X3(p,e,{silent:!0}),b=g.find(E=>E.address===u);return b?{account:b,supportedIntents:y}:null}function aP({$compatibleWallets:e,$baseConnection:t}){$p(e,()=>e.listen(async s=>{const r=t.get();if(r.status!=="connected")return;const i=iP(r.currentAccount,s);i?t.setKey("currentAccount",i):t.set({status:"disconnected",currentAccount:null})}))}function iP(e,t){for(const s of t){for(const r of s.accounts)if(hV(e,r))return r;if(Zc(e,s)&&s.accounts[0])return s.accounts[0]}return null}function oP({$currentNetwork:e}){return function(s){e.set(s)}}function cP({$baseConnection:e,$connection:t},{storage:s,storageKey:r}){return async function(...c){return await rp(async()=>{const{wallet:u}=t.get();if(!u)throw new zb("No wallet is connected.");try{const{disconnect:d}=dd(u,Aj);await d(...c)}catch(d){console.warn("Failed to disconnect the current wallet from the application.",d)}finally{s.removeItem(r),e.set({status:"disconnected",currentAccount:null})}})}}function lP({$baseConnection:e,$connection:t},{storage:s,storageKey:r}){return function({account:c}){const u=t.get();if(!u.wallet)throw new zb("No wallet is connected.");if(!Zc(c,u.wallet))throw new $b(`No account with address ${c.address} is connected to ${u.wallet.name}.`);e.setKey("currentAccount",c),W3(s,r,c,u.supportedIntents)}}function uP({$connection:e,$currentNetwork:t}){return async function({account:r,network:i,...c}){const u=Pb(e.get(),r),d=ul(i??t.get());return await Z3({account:u,chain:d,featureName:Ky}).signPersonalMessage({...c,account:Vp(u),chain:d})}}function O_(e,t,s,r){const i=U8(r);let c=null;try{c=B8(r)}catch{console.warn("Parsing transaction effects failed, you may need to update the SDK to pickup the latest bcs types")}const u={digest:e,signatures:[t],epoch:null,timestampMs:null,checkpoint:null,status:i,effects:c,transaction:M8(s),balanceChanges:void 0,events:void 0,objectTypes:void 0,bcs:s};return i.success?{$kind:"Transaction",Transaction:u}:{$kind:"FailedTransaction",FailedTransaction:u}}function dP({$connection:e,$currentNetwork:t},s){return async function({transaction:i,account:c,network:u,...d}){const p=e.get(),m=Pb(p,c),g=[...p.supportedIntents],y=Vp(m),b=u??t.get(),E=s(b),O=ul(b),C={toJSON:async()=>typeof i=="string"?i:(i.setSenderIfNotSet(m.address),await i.toJSON({client:E,supportedIntents:g}))},R=cp({account:m,chain:O,featureName:Xy});if(R){const x=await R.signAndExecuteTransaction({...d,account:y,transaction:C,chain:O}),W=Ge(x.bytes),oe=Ge(x.effects);return O_(x.digest,x.signature,W,oe)}const $=cp({account:m,chain:O,featureName:cj});if($){const x=Yn.from(await C.toJSON()),{digest:W,rawEffects:oe,rawTransaction:me}=await $.signAndExecuteTransactionBlock({account:y,chain:O,transactionBlock:x,options:{showRawEffects:!0,showRawInput:!0}}),[{txSignatures:[G],intentMessage:{value:J}}]=M.SenderSignedData.parse(Ge(me));return O_(W,G,M.TransactionData.serialize(J).toBytes(),new Uint8Array(oe))}throw new Pp(`The account ${m.address} does not support signing and executing transactions.`)}}function fP({$connection:e,$currentNetwork:t},s){return async function({transaction:i,account:c,network:u,...d}){const p=e.get(),m=Pb(p,c),g=[...p.supportedIntents],y=Vp(m),b=u??t.get(),E=s(b),O=ul(b),C={toJSON:async()=>typeof i=="string"?i:(i.setSenderIfNotSet(m.address),await i.toJSON({client:E,supportedIntents:g}))},R=cp({account:m,chain:O,featureName:Fh});if(R)return await R.signTransaction({...d,transaction:C,account:y,chain:O});const $=cp({account:m,chain:O,featureName:eA});if($){const x=Yn.from(await C.toJSON()),{transactionBlockBytes:W,signature:oe}=await $.signTransactionBlock({transactionBlock:x,account:y,chain:O});return{bytes:W,signature:oe}}throw new Pp(`The account ${m.address} does not support signing transactions.`)}}function hP(e){return{id:"slush-web-wallet-initializer",async initialize(){const t=await zV(e?.appName||pP(),{origin:e?.origin,metadataApiUrl:e?.metadataApiUrl});if(!t)throw new Error("Registration un-successful.");return{unregister:t.unregister}}}}function pP(){return document.querySelector('meta[name="application-name"]')?.content||document.title}const vy=new Map;async function mP(e,t){vy.forEach(i=>i()),vy.clear();const s=[...new Map(e.map(i=>[i.id,i])).values()].map(async i=>({initializer:i,result:await i.initialize(t)})),r=await Promise.allSettled(s);for(const i of r)if(i.status==="fulfilled"){const{initializer:c,result:u}=i.value;vy.set(c.id,u.unregister)}else console.warn(`Skipping wallet initializer: "${i.reason}".`)}function gP(){return{id:"unsafe-burner-initalizer",async initialize({networks:e,getClient:t}){const s=new yP({clients:e.map(t)});return{unregister:Cp().register(s)}}}}var yP=class{#e;#t=new F$;#r;constructor({clients:e}){this.#e=e.reduce((t,s)=>{const r=ul(s.network);return t[r]=s,t},{}),this.#r=new id({address:this.#t.getPublicKey().toSuiAddress(),publicKey:this.#t.getPublicKey().toSuiBytes(),chains:this.chains,features:[Fh,Xy,Ky]}),console.warn("Your application is currently using the unsafe burner wallet. Make sure that this wallet is disabled in production.")}get version(){return"1.0.0"}get name(){return"Unsafe Burner Wallet"}get icon(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAJrElEQVR42tWbe2xT1x3H7UxAyD3XrdrSbGXlUbKWsq5rWdVuVOMRSEqSOmnVRZMmJqZNYv1nf3R/jWmVmVrtRRM/YwPd1nVTNcrE3pQCoikrIRAC4VVNY0hlD9ZOo1uCfe3ra9979v0dcy3s5Pper76Oh/STE+495/4+5/c85zqe2f7HAx5vKsS+monJj/CdHi/f4/HWW4f6AwdblmXjTM0NyS+movKtw9v+j6C5gKhyTMTTpA2x15Qwy+Pz75motOGdgKep8WF5ATgVZIt5NeO2wMqD0hfVGNPh3oYaYflsjG0l63PeyLCDnqbsLpZIhaRNFI+Ox+Le5KB0RybK8gDmJOkI07U4i/FhT1NDQl8Me5rUIfaDfELOJ0NsFa/SJQHm1WLsHcDqRWiy9BCL8s0N5t6UWWFVvxplejYm60hC91cNjPtzCTZsAptCVoeLP8PDDQJNCSodap6H+LtE8ZcdkvVkkD38vwDn4/Jvy4EhBhZSvRaUHiTXn31gJJxkUPoClBKKFizM+inhVA2cYIdM4HJouPvoe9s9H+KzDhyGK6KkmIqitBhww2C11rjQL2L4kgUwFxk8yPyzauUA3Pk/353XnA6zKbKCaQ2UlMvJF6W5uF5F8yHfZWZpC9HRmBziaEpm1bpY9XvhxuWJRldC7Mt03WlZwpjnkZUNa2DMG2EaPj9MGd2l2mofd0hQ7ZSopsXckHxVCUp32fXGdD0ZktrgFUmMqwhcWFjp87RArsD+9bn585IRaSHAKgBL3SZwOTRc8BKg7yYoskp5OJDiiPmF2Sj7ox0siYJ7lJA04EqvzZ9B1xSVt6PlW0IxZgUMJdZYAJuWngLQt9IRuZXmoTEkmci8ZtTXTViUKyasA9FRun5d8z6bfw0gYWm9mmCXxZatQgxfC7I2NVpRYQOxKWppLs4mcgn5NcibgL1K40xYp8CYY5TXEpjcb3LAJ0OZyyg3+2nySm6fjEtzkEz+7VBx3RTb+60z9dma7pkvwO2QQL5HzTtAdpKF7euw/HuzfrosBHy+ZsBimzbQshjWTVMDgez53B5MbjcGbr1ZjdUJOM5O0SLXzJ2R+uOA1dMAVoLsm5zb73JSId8t8Aa1LsAJdoTCrCaw6e3NC2DdFMUXWRg173mysJNOSUNskUJ1cOlXa2LhcbgmSszXYSn9hl3KSxTDjrZ2cbbfbWDyumsh9m3e7zCG7a3ETt+gtI7fx6lEOanZKDVvuA2cjYmt5xNOd2Louz3IQ12UZ2Zo3lkb9cDlvSs6m4Vk5Yqlabs0B97wT7PUuCXQz0Bnt9QxMPTW4iwBtmUlY8hFsHJPlzcQ1xuG75CVK1kXofCUGnU9fg1aVD7kfE9MoabtYkcAvIUYS2op3Hc3TTrDQzIAeojugTVLFolWDR6wFPtY0R66n6HltwjCIawnE2ymresk9NtN+pfUUi0mX6RJLfrh9zMRaRPOqubSA8W2MNzC0mHpK7j2ruuw5mYkxl5+2+HGQeg4yNYg7vNg+xMxFsuRMuiTsRJZG3cysAl4D9n4aC4un8L9qUyVvbCyYwFXX1nGUxFf1cCiEQqy75O+TpMwYKNKSPQUqhLyyWLsRbESLctx0YnixgfphRWA8pOPc+N4F9d+eV9V4OlCX/As5w5g+wtGhJGukp5go2R3D7EW9rSDcnGL56YgJHj+8GcFND/Vy41jj/H0jxc6HU/AA2QlR01UlH3D7CmITQnJq4lVWBi1yl8XYEh278c5H++F+Iui7r7bYR8tH/gbqoJN7fVODUhLYVVxzmYCEyOxFg7RUVa0egCHZZ55eRHnp/tKgMna6s/bbMdTxZgMzl9CCcmq7k690OzDfaeSN4QcsREjsQpgXHwyWyfg9K5WE7hc6JqTWjyihObfygOFOkv6i5K5TZx8LsL1sVS4NL8ItiB7sgAcEKcWHfUCVhK3kUVnBNbfXIs4l5xAv5sJs234eTUy93L0Au2otQOw5ORMyfQ6WwexFupVSHowG6uThXfebmlhWojMS3fazmMeGxEI6S2SUti6RAo2vKohVuH3qUG5FWm/PjH8kzutgSH5g58xrVwzIbZkxHf7OFjFC+wrMDXcpOqOKX/g01U/XPvVJyxdWsiJblqYmnZoWbDxAcR56X5WPuh4ewcL5PY9JBRUYjc7fzjG6Uc3mHBWbg23X1BLaFHOSnrw4bWiNAXSEWcWRntIignXTP/oDsfKZX66mMbZAPfhviU1AyYmJLYAMZa/QXjUSeIiixpj3UUFtd884KytjN7EjdGNNMbWwtlf3FvbQ4OQtIoYSzbxqVDLXMTxP8jnnbiyKcaJLvueGLD6kXW2sKZov1tpn7hwXf3ZUvq0K2FXOM7Op/Xgb6PhxsWIErYGVuK3WGXWkkwMMZVCVl5kWtax5A6usgemvnx4DelUcYcFC0eIbcbXKzggeyBjeXIhkftaKknJKLtnuSg7KmKQsrH+1nqbmLWY6w/tBGy/8xrruR5SM99LLIjfT/4ZbNZnQEPssIVb21rKTGRIPDagNoLdFMKgcuLc/TF6Bulk6c7ovg4TU+XvS6FNw1tDfVqH9MOPmBDui0hcK6wz744FlDjNe0m3aVldJYagtI6YbF+3ZGPsQHlN1vbeh8lJofqJ+uo9Zi4wXZxKFiXKGxbHT7pNq71oNg4Qi6MviE0FpRVqjGXILYoJ4tCjdYU1rWeMdPLc/ochj3B9pGNGL4NupGPRlUl35KMVxFLNO6ZnxYlBsUPqoMkbUqAb6VhMVKQ7MVT1dYdrL8hzEAcjpmvjHKphgaFb0ZVJZw7dwVD9q5fkgPTRbBxnzmGfgRLQsMCkG+moQdcp6GzzZsL2MGyllvBNGWM9RqMCk26kI7aBK526csVShZTfzid6FEzeiNAGP92jpCPQEbrW7EW5MbZxAz/fN9lg0IbQaaxrQ83/VoKPb/HqJx67Hw+43CDQBPsX0gm6ufXNvH4vP9rZapzx7+Nn+oxZAjfo2caZ3n350c5W6FSEdQ86sNarj3c/jRV+H42AXsdGRBfPPIlnb/mUtxzWXfALn/PmRze2Gud6E/xsXwYtnlsWN8Tc5/oyxjn/jvyJrlY82xLUfWuPr/TqxzuXQZkIP9M7CXiyuP4B4WmsTnNhzinjrD+WO9bRhmdZWLXe4EKRtV5tpN3Hx3s2G+d79/MJf4qff0LnE72kfFEs4ITQvWLMab8C131dP9n9Je1Yx000Nz2jAf+UJwCBchc3NvGR1Qx71XXY2Ww1Jvx7YalzAPkX9rp5E5Z+pv+ja8bE43uN491b9dHO9Xx4lUxziLn21Nai/wXWM6t9vkvtrwAAAABJRU5ErkJggg=="}get chains(){return Object.keys(this.#e)}get accounts(){return[this.#r]}get features(){return{[ob]:{version:"1.0.0",connect:this.#a},[Rp]:{version:"1.0.0",on:this.#s},[Ky]:{version:"1.1.0",signPersonalMessage:this.#i},[Fh]:{version:"2.0.0",signTransaction:this.#o},[Xy]:{version:"2.0.0",signAndExecuteTransaction:this.#c}}}#s=()=>()=>{};#a=async()=>({accounts:this.accounts});#i=async e=>await this.#t.signPersonalMessage(e.message);#o=async({transaction:e,signal:t,chain:s})=>{t?.throwIfAborted();const r=this.#e[s];if(!r)throw new Error(`Invalid chain "${s}" specified.`);const i=await Yn.from(await e.toJSON()).build({client:r});return await this.#t.signTransaction(i)};#c=async({transaction:e,signal:t,chain:s})=>{t?.throwIfAborted();const r=this.#e[s];if(!r)throw new Error(`Invalid chain "${s}" specified.`);const i=Yn.from(await e.toJSON()),c=await i.build({client:r}),u=await this.#t.signAndExecuteTransaction({transaction:i,client:r}),d=u.Transaction??u.FailedTransaction;return{bytes:Ke(c),signature:d.signatures[0],digest:d.digest,effects:Ke(d.effects.bcs)}}};function vP({autoConnect:e=!0,networks:t,createClient:s,defaultNetwork:r=t[0],enableBurnerWallet:i=!1,slushWalletConfig:c,storage:u=eP(),storageKey:d=QV,walletInitializers:p=[],autoConnectTimeout:m=5e3}){const g=YV(t,s),y=KV({defaultNetwork:r,getClient:g.getClient});function b(O){return O?g.getClient(O):y.$currentClient.get()}u||=Y3(),JV(y),aP(y);const E=mP([...p,...i?[gP()]:[],...c!==null?[hP(c)]:[]],{networks:t,getClient:b});return e&&sP({networks:t,stores:y,storageKey:d,storage:u,walletsRegistered:E,timeout:m}),{networks:t,getClient:b,signTransaction:fP(y,g.getClient),signAndExecuteTransaction:dP(y,g.getClient),signPersonalMessage:uP(y),connectWallet:nP(y,t,{storage:u,storageKey:d}),disconnectWallet:cP(y,{storage:u,storageKey:d}),switchAccount:lP(y,{storage:u,storageKey:d}),switchNetwork:oP(y),stores:{$wallets:y.$compatibleWallets,$connection:y.$connection,$currentNetwork:sV(y.$currentNetwork),$currentClient:y.$currentClient}}}var by={exports:{}},Fe={};var N_;function bP(){if(N_)return Fe;N_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),E=Symbol.iterator;function O(I){return I===null||typeof I!="object"?null:(I=E&&I[E]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,$={};function x(I,X,ce){this.props=I,this.context=X,this.refs=$,this.updater=ce||C}x.prototype.isReactComponent={},x.prototype.setState=function(I,X){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,X,"setState")},x.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function W(){}W.prototype=x.prototype;function oe(I,X,ce){this.props=I,this.context=X,this.refs=$,this.updater=ce||C}var me=oe.prototype=new W;me.constructor=oe,R(me,x.prototype),me.isPureReactComponent=!0;var G=Array.isArray;function J(){}var w={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function N(I,X,ce){var he=ce.ref;return{$$typeof:e,type:I,key:X,ref:he!==void 0?he:null,props:ce}}function F(I,X){return N(I.type,X,I.props)}function B(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function q(I){var X={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(ce){return X[ce]})}var z=/\/+/g;function D(I,X){return typeof I=="object"&&I!==null&&I.key!=null?q(""+I.key):X.toString(36)}function k(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(J,J):(I.status="pending",I.then(function(X){I.status==="pending"&&(I.status="fulfilled",I.value=X)},function(X){I.status==="pending"&&(I.status="rejected",I.reason=X)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function j(I,X,ce,he,Te){var Oe=typeof I;(Oe==="undefined"||Oe==="boolean")&&(I=null);var Ae=!1;if(I===null)Ae=!0;else switch(Oe){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(I.$$typeof){case e:case t:Ae=!0;break;case g:return Ae=I._init,j(Ae(I._payload),X,ce,he,Te)}}if(Ae)return Te=Te(I),Ae=he===""?"."+D(I,0):he,G(Te)?(ce="",Ae!=null&&(ce=Ae.replace(z,"$&/")+"/"),j(Te,X,ce,"",function(Pe){return Pe})):Te!=null&&(B(Te)&&(Te=F(Te,ce+(Te.key==null||I&&I.key===Te.key?"":(""+Te.key).replace(z,"$&/")+"/")+Ae)),X.push(Te)),1;Ae=0;var be=he===""?".":he+":";if(G(I))for(var _e=0;_e<I.length;_e++)he=I[_e],Oe=be+D(he,_e),Ae+=j(he,X,ce,Oe,Te);else if(_e=O(I),typeof _e=="function")for(I=_e.call(I),_e=0;!(he=I.next()).done;)he=he.value,Oe=be+D(he,_e++),Ae+=j(he,X,ce,Oe,Te);else if(Oe==="object"){if(typeof I.then=="function")return j(k(I),X,ce,he,Te);throw X=String(I),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function U(I,X,ce){if(I==null)return I;var he=[],Te=0;return j(I,he,"","",function(Oe){return X.call(ce,Oe,Te++)}),he}function V(I){if(I._status===-1){var X=I._result,ce=X();ce.then(function(he){(I._status===0||I._status===-1)&&(I._status=1,I._result=he,ce.status===void 0&&(ce.status="fulfilled",ce.value=he))},function(he){(I._status===0||I._status===-1)&&(I._status=2,I._result=he,ce.status===void 0&&(ce.status="rejected",ce.reason=he))}),I._status===-1&&(I._status=0,I._result=ce)}if(I._status===1)return I._result.default;throw I._result}var K=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function P(I){var X=w.T,ce={};ce.types=X!==null?X.types:null,w.T=ce;try{var he=I(),Te=w.S;Te!==null&&Te(ce,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(J,K)}catch(Oe){K(Oe)}finally{X!==null&&ce.types!==null&&(X.types=ce.types),w.T=X}}function re(I){var X=w.T;if(X!==null){var ce=X.types;ce===null?X.types=[I]:ce.indexOf(I)===-1&&ce.push(I)}else P(re.bind(null,I))}var ue={map:U,forEach:function(I,X,ce){U(I,function(){X.apply(this,arguments)},ce)},count:function(I){var X=0;return U(I,function(){X++}),X},toArray:function(I){return U(I,function(X){return X})||[]},only:function(I){if(!B(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Fe.Activity=y,Fe.Children=ue,Fe.Component=x,Fe.Fragment=s,Fe.Profiler=i,Fe.PureComponent=oe,Fe.StrictMode=r,Fe.Suspense=p,Fe.ViewTransition=b,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(I){return w.H.useMemoCache(I)}},Fe.addTransitionType=re,Fe.cache=function(I){return function(){return I.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(I,X,ce){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var he=R({},I.props),Te=I.key;if(X!=null)for(Oe in X.key!==void 0&&(Te=""+X.key),X)!A.call(X,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&X.ref===void 0||(he[Oe]=X[Oe]);var Oe=arguments.length-2;if(Oe===1)he.children=ce;else if(1<Oe){for(var Ae=Array(Oe),be=0;be<Oe;be++)Ae[be]=arguments[be+2];he.children=Ae}return N(I.type,Te,he)},Fe.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:c,_context:I},I},Fe.createElement=function(I,X,ce){var he,Te={},Oe=null;if(X!=null)for(he in X.key!==void 0&&(Oe=""+X.key),X)A.call(X,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(Te[he]=X[he]);var Ae=arguments.length-2;if(Ae===1)Te.children=ce;else if(1<Ae){for(var be=Array(Ae),_e=0;_e<Ae;_e++)be[_e]=arguments[_e+2];Te.children=be}if(I&&I.defaultProps)for(he in Ae=I.defaultProps,Ae)Te[he]===void 0&&(Te[he]=Ae[he]);return N(I,Oe,Te)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(I){return{$$typeof:d,render:I}},Fe.isValidElement=B,Fe.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:V}},Fe.memo=function(I,X){return{$$typeof:m,type:I,compare:X===void 0?null:X}},Fe.startTransition=P,Fe.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},Fe.use=function(I){return w.H.use(I)},Fe.useActionState=function(I,X,ce){return w.H.useActionState(I,X,ce)},Fe.useCallback=function(I,X){return w.H.useCallback(I,X)},Fe.useContext=function(I){return w.H.useContext(I)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(I,X){return w.H.useDeferredValue(I,X)},Fe.useEffect=function(I,X){return w.H.useEffect(I,X)},Fe.useEffectEvent=function(I){return w.H.useEffectEvent(I)},Fe.useId=function(){return w.H.useId()},Fe.useImperativeHandle=function(I,X,ce){return w.H.useImperativeHandle(I,X,ce)},Fe.useInsertionEffect=function(I,X){return w.H.useInsertionEffect(I,X)},Fe.useLayoutEffect=function(I,X){return w.H.useLayoutEffect(I,X)},Fe.useMemo=function(I,X){return w.H.useMemo(I,X)},Fe.useOptimistic=function(I,X){return w.H.useOptimistic(I,X)},Fe.useReducer=function(I,X,ce){return w.H.useReducer(I,X,ce)},Fe.useRef=function(I){return w.H.useRef(I)},Fe.useState=function(I){return w.H.useState(I)},Fe.useSyncExternalStore=function(I,X,ce){return w.H.useSyncExternalStore(I,X,ce)},Fe.useTransition=function(){return w.H.useTransition()},Fe.version="19.3.0",Fe}var x_;function Gb(){return x_||(x_=1,by.exports=bP()),by.exports}var ze=Gb();const Fb=g6(ze),J3=m6({__proto__:null,default:Fb},[ze]),Q3=ze.createContext(null);function wP({dAppKit:e,children:t}){return T.jsx(Q3.Provider,{value:e,children:t})}function bi(e){const t=ze.useContext(Q3);if(e)return e;if(!t)throw new Error("Could not find DAppKitContext. Ensure that you have set up the `DAppKitProvider` component.");return t}let wy=(e,t)=>s=>{e.current!==s&&(e.current=s,t())};function eO(e,{keys:t,deps:s=[e,t],ssr:r}={}){let i=ze.useRef();i.current=e.get();let c=ze.useCallback(p=>(wy(i,p)(e.value),t?.length>0?lV(e,t,wy(i,p)):e.listen(wy(i,p))),s),u=()=>i.current,d=u;return r&&"init"in e&&(d=r==="initial"?()=>e.init:r),ze.useSyncExternalStore(c,u,d)}function TP({dAppKit:e}={}){return eO(bi(e).stores.$wallets)}function SP({dAppKit:e}={}){return eO(bi(e).stores.$connection)}function Eo({dAppKit:e}={}){return SP({dAppKit:e}).account}const EP=new Set(["children","localName","ref","style","className"]),C_=new WeakMap,I_=(e,t,s,r,i)=>{const c=i?.[t];c===void 0?(e[t]=s,s==null&&t in HTMLElement.prototype&&e.removeAttribute(t)):s!==r&&((u,d,p)=>{let m=C_.get(u);m===void 0&&C_.set(u,m=new Map);let g=m.get(d);p!==void 0?g===void 0?(m.set(d,g={handleEvent:p}),u.addEventListener(d,g)):g.handleEvent=p:g!==void 0&&(m.delete(d),u.removeEventListener(d,g))})(e,c,s)},tO=({react:e,tagName:t,elementClass:s,events:r,displayName:i})=>{const c=new Set(Object.keys(r??{})),u=e.forwardRef(((d,p)=>{const m=e.useRef(new Map),g=e.useRef(null),y={},b={};for(const[E,O]of Object.entries(d))EP.has(E)?y[E==="className"?"class":E]=O:c.has(E)||E in s.prototype?b[E]=O:y[E]=O;return e.useLayoutEffect((()=>{if(g.current===null)return;const E=new Map;for(const O in b)I_(g.current,O,d[O],m.current.get(O),r),m.current.delete(O),E.set(O,d[O]);for(const[O,C]of m.current)I_(g.current,O,void 0,C,r);m.current=E})),e.useLayoutEffect((()=>{g.current?.removeAttribute("defer-hydration")}),[]),y.suppressHydrationWarning=!0,e.createElement(t,{...y,ref:e.useCallback((E=>{g.current=E,typeof p=="function"?p(E):p!==null&&(p.current=E)}),[p])})}));return u.displayName=i??s.name,u};var R_={},j_;function _P(){return j_||(j_=1,(function(){function e(H){var te=0;return function(){return te<H.length?{done:!1,value:H[te++]}:{done:!0}}}var t=typeof Object.defineProperties=="function"?Object.defineProperty:function(H,te,de){return H==Array.prototype||H==Object.prototype||(H[te]=de.value),H};function s(H){H=[typeof globalThis=="object"&&globalThis,H,typeof window=="object"&&window,typeof self=="object"&&self,typeof Ac=="object"&&Ac];for(var te=0;te<H.length;++te){var de=H[te];if(de&&de.Math==Math)return de}throw Error("Cannot find global object")}var r=s(this);function i(H,te){if(te)e:{var de=r;H=H.split(".");for(var fe=0;fe<H.length-1;fe++){var le=H[fe];if(!(le in de))break e;de=de[le]}H=H[H.length-1],fe=de[H],te=te(fe),te!=fe&&te!=null&&t(de,H,{configurable:!0,writable:!0,value:te})}}i("Symbol",function(H){function te(le){if(this instanceof te)throw new TypeError("Symbol is not a constructor");return new de("jscomp_symbol_"+(le||"")+"_"+fe++,le)}function de(le,$e){this.l=le,t(this,"description",{configurable:!0,writable:!0,value:$e})}if(H)return H;de.prototype.toString=function(){return this.l};var fe=0;return te}),i("Symbol.iterator",function(H){if(H)return H;H=Symbol("Symbol.iterator");for(var te="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),de=0;de<te.length;de++){var fe=r[te[de]];typeof fe=="function"&&typeof fe.prototype[H]!="function"&&t(fe.prototype,H,{configurable:!0,writable:!0,value:function(){return c(e(this))}})}return H});function c(H){return H={next:H},H[Symbol.iterator]=function(){return this},H}function u(H){var te=typeof Symbol<"u"&&Symbol.iterator&&H[Symbol.iterator];return te?te.call(H):{next:e(H)}}function d(H){if(!(H instanceof Array)){H=u(H);for(var te,de=[];!(te=H.next()).done;)de.push(te.value);H=de}return H}var p=typeof Object.create=="function"?Object.create:function(H){function te(){}return te.prototype=H,new te},m=(function(){function H(){function de(){}return Reflect.construct(de,[],function(){}),new de instanceof de}if(typeof Reflect<"u"&&Reflect.construct){if(H())return Reflect.construct;var te=Reflect.construct;return function(de,fe,le){return de=te(de,fe),le&&Reflect.setPrototypeOf(de,le.prototype),de}}return function(de,fe,le){return le===void 0&&(le=de),le=p(le.prototype||Object.prototype),Function.prototype.apply.call(de,le,fe)||le}})(),g;if(typeof Object.setPrototypeOf=="function")g=Object.setPrototypeOf;else{var y;e:{var b={a:!0},E={};try{E.__proto__=b,y=E.a;break e}catch{}y=!1}g=y?function(H,te){if(H.__proto__=te,H.__proto__!==te)throw new TypeError(H+" is not extensible");return H}:null}var O=g,C=window,R;if(((R=C.CustomElementRegistryPolyfill)==null?void 0:R.formAssociated)===void 0){var $={};C.CustomElementRegistryPolyfill=($.formAssociated=new Set,$)}var x=window.HTMLElement,W=window.customElements.define,oe=window.customElements.get,me=window.customElements,G=new WeakMap,J=new WeakMap,w=new WeakMap,A=new WeakMap;function N(){var H;this.promise=new Promise(function(te){H=te}),this.resolve=H}function F(){this.h=new Map,this.m=new Map,this.j=new Map,this.i=new Map}F.prototype.define=function(H,te){if(H=H.toLowerCase(),this.h.get(H)!==void 0)throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "`+H+'" has already been used with this registry');if(this.m.get(te)!==void 0)throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");var de=te.prototype.attributeChangedCallback,fe=new Set(te.observedAttributes||[]);D(te,fe,de);var le=oe.call(me,H),$e,Le,Dt=(Le=($e=le)==null?void 0:$e.s)!=null?Le:te.formAssociated||C.CustomElementRegistryPolyfill.formAssociated.has(H);if(Dt&&C.CustomElementRegistryPolyfill.formAssociated.add(H),Dt!=te.formAssociated)try{te.formAssociated=Dt}catch{}if(de={tagName:H,g:te,connectedCallback:te.prototype.connectedCallback,disconnectedCallback:te.prototype.disconnectedCallback,adoptedCallback:te.prototype.adoptedCallback,attributeChangedCallback:de,formAssociated:Dt,formAssociatedCallback:te.prototype.formAssociatedCallback,formDisabledCallback:te.prototype.formDisabledCallback,formResetCallback:te.prototype.formResetCallback,formStateRestoreCallback:te.prototype.formStateRestoreCallback,observedAttributes:fe},this.h.set(H,de),this.m.set(te,de),le||(le=z(H),W.call(me,H,le)),this===window.customElements&&(w.set(te,de),de.o=le),le=this.i.get(H))for(this.i.delete(H),le=u(le),fe=le.next();!fe.done;fe=le.next())fe=fe.value,J.delete(fe),K(fe,de,!0);return le=this.j.get(H),le!==void 0&&(le.resolve(te),this.j.delete(H)),te},F.prototype.upgrade=function(H){for(var te=[],de=0;de<arguments.length;++de)te[de]=arguments[de];re.push(this),me.upgrade.apply(me,d(te)),re.pop()},F.prototype.get=function(H){var te;return(te=this.h.get(H))==null?void 0:te.g},F.prototype.whenDefined=function(H){var te=this.h.get(H);return te!==void 0?Promise.resolve(te.g):(te=this.j.get(H),te===void 0&&(te=new N,this.j.set(H,te)),te.promise)};function B(H,te,de,fe){var le=H.i.get(de);le||H.i.set(de,le=new Set),fe?le.add(te):le.delete(te)}var q;window.HTMLElement=function(){var H=q;if(H)return q=void 0,H;var te=w.get(this.constructor);if(!te)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return H=Reflect.construct(x,[],te.o),Object.setPrototypeOf(H,this.constructor.prototype),G.set(H,te),H},window.HTMLElement.prototype=x.prototype;function z(H){function te(){var de=Reflect.construct(x,[],this.constructor);Object.setPrototypeOf(de,HTMLElement.prototype);e:{var fe=de.getRootNode();if(!(fe===document||fe instanceof ShadowRoot)){if(fe=re[re.length-1],fe instanceof CustomElementRegistry){var le=fe;break e}fe=fe.getRootNode(),fe===document||fe instanceof ShadowRoot||(fe=((le=A.get(fe))==null?void 0:le.getRootNode())||document)}le=fe.registry}return le=le||window.customElements,(fe=le.h.get(H))?K(de,fe):J.set(de,le),de}return r.Object.defineProperty(te,"formAssociated",{configurable:!0,enumerable:!0,get:function(){return C.CustomElementRegistryPolyfill.formAssociated.has(H)}}),te.prototype.connectedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];j(this),(le=G.get(this))?le.connectedCallback&&le.connectedCallback.apply(this,fe):B(J.get(this),this,H,!0)},te.prototype.disconnectedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];(le=G.get(this))?le.disconnectedCallback&&le.disconnectedCallback.apply(this,fe):B(J.get(this),this,H,!1)},te.prototype.adoptedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];var $e,Le;($e=G.get(this))==null||(Le=$e.adoptedCallback)==null||Le.apply(this,fe)},te.prototype.formAssociatedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=G.get(this),le!=null&&le.formAssociated){var $e;le==null||($e=le.formAssociatedCallback)==null||$e.apply(this,fe)}},te.prototype.formDisabledCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=G.get(this),le!=null&&le.formAssociated){var $e;le==null||($e=le.formDisabledCallback)==null||$e.apply(this,fe)}},te.prototype.formResetCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=G.get(this),le!=null&&le.formAssociated){var $e;le==null||($e=le.formResetCallback)==null||$e.apply(this,fe)}},te.prototype.formStateRestoreCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=G.get(this),le!=null&&le.formAssociated){var $e;le==null||($e=le.formStateRestoreCallback)==null||$e.apply(this,fe)}},te}window.CustomElementRegistry=F;function D(H,te,de){if(te.size!==0&&de!==void 0){var fe=H.prototype.setAttribute;fe&&(H.prototype.setAttribute=function(Le,Dt){if(j(this),Le=Le.toLowerCase(),te.has(Le)){var _s=this.getAttribute(Le);fe.call(this,Le,Dt),de.call(this,Le,_s,Dt)}else fe.call(this,Le,Dt)});var le=H.prototype.removeAttribute;le&&(H.prototype.removeAttribute=function(Le){if(j(this),Le=Le.toLowerCase(),te.has(Le)){var Dt=this.getAttribute(Le);le.call(this,Le),de.call(this,Le,Dt,null)}else le.call(this,Le)});var $e=H.prototype.toggleAttribute;$e&&(H.prototype.toggleAttribute=function(Le,Dt){if(j(this),Le=Le.toLowerCase(),te.has(Le)){var _s=this.getAttribute(Le);$e.call(this,Le,Dt),Dt=this.getAttribute(Le),_s!==Dt&&de.call(this,Le,_s,Dt)}else $e.call(this,Le,Dt)})}}var k;document.readyState==="loading"&&(k=new Set,document.addEventListener("readystatechange",function(){k.forEach(function(H){return U(H,G.get(H))})},{once:!0}));function j(H){var te;(te=k)!=null&&te.has(H)&&U(H,G.get(H))}function U(H,te){var de;(de=k)==null||de.delete(H),te.attributeChangedCallback&&te.observedAttributes.forEach(function(fe){H.hasAttribute(fe)&&te.attributeChangedCallback.call(H,fe,null,H.getAttribute(fe))})}function V(H){var te=Object.getPrototypeOf(H);if(te!==window.HTMLElement)return te===x?Object.setPrototypeOf(H,window.HTMLElement):V(te)}function K(H,te,de){de=de===void 0?!1:de,Object.setPrototypeOf(H,te.g.prototype),G.set(H,te),q=H;try{new te.g}catch{V(te.g),new te.g}te.attributeChangedCallback&&(k===void 0||H.hasAttributes()?U(H,te):k.add(H)),de&&te.connectedCallback&&H.isConnected&&te.connectedCallback.call(H)}var P=Element.prototype.attachShadow;Element.prototype.attachShadow=function(H,te){for(var de=[],fe=1;fe<arguments.length;++fe)de[fe-1]=arguments[fe];var le=Object.assign({},H);return fe=H.customElements,fe=H.registry===void 0?fe:H.registry,le=(delete le.customElements,delete le.registry,le),de=P.call.apply(P,[this,le].concat(d(de))),fe!==void 0&&(de.customElements=de.registry=fe),de};var re=[document];function ue(H,te,de){var fe=(de?Object.getPrototypeOf(de):H.prototype)[te];H.prototype[te]=function(le){for(var $e=[],Le=0;Le<arguments.length;++Le)$e[Le]=arguments[Le];return re.push(this),$e=fe.apply(de||this,$e),$e!==void 0&&A.set($e,this),re.pop(),$e}}ue(ShadowRoot,"createElement",document),ue(ShadowRoot,"createElementNS",document),ue(ShadowRoot,"importNode",document),ue(Element,"insertAdjacentHTML");function I(H){var te=Object.getOwnPropertyDescriptor(H.prototype,"innerHTML");Object.defineProperty(H.prototype,"innerHTML",Object.assign({},te,{set:function(de){re.push(this),te.set.call(this,de),re.pop()}}))}if(I(Element),I(ShadowRoot),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){var X=new WeakMap,ce=HTMLElement.prototype.attachInternals,he=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(H){for(var te=[],de=0;de<arguments.length;++de)te[de]=arguments[de];return te=ce.call.apply(ce,[this].concat(d(te))),X.set(te,this),te},he.forEach(function(H){var te=window.ElementInternals.prototype,de=te[H];te[H]=function(fe){for(var le=[],$e=0;$e<arguments.length;++$e)le[$e]=arguments[$e];if($e=X.get(this),G.get($e).formAssociated===!0)return de?.call.apply(de,[this].concat(d(le)));throw new DOMException("Failed to execute "+de+" on 'ElementInternals': The target element is not a form-associated custom element.")}});var Te=function(H){var te=m(Array,[].concat(d(H)),this.constructor);return te.l=H,te},Oe=Te,Ae=Array;if(Oe.prototype=p(Ae.prototype),Oe.prototype.constructor=Oe,O)O(Oe,Ae);else for(var be in Ae)if(be!="prototype")if(Object.defineProperties){var _e=Object.getOwnPropertyDescriptor(Ae,be);_e&&Object.defineProperty(Oe,be,_e)}else Oe[be]=Ae[be];Oe.u=Ae.prototype,r.Object.defineProperty(Te.prototype,"value",{configurable:!0,enumerable:!0,get:function(){var H;return((H=this.l.find(function(te){return te.checked===!0}))==null?void 0:H.value)||""}});var Pe=function(H){var te=this,de=new Map;H.forEach(function(fe,le){var $e=fe.getAttribute("name"),Le=de.get($e)||[];te[+le]=fe,Le.push(fe),de.set($e,Le)}),this.length=H.length,de.forEach(function(fe,le){fe&&le!=="length"&&le!=="item"&&le!=="namedItem"&&(te[le]=fe.length===1?fe[0]:new Te(fe))})};Pe.prototype.item=function(H){var te;return(te=this[H])!=null?te:null},Pe.prototype[Symbol.iterator]=function(){throw Error("Method not implemented.")},Pe.prototype.namedItem=function(H){var te;return(te=this[H])!=null?te:null};var at=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){var H=at.get.call(this),te=[];H=u(H);for(var de=H.next();!de.done;de=H.next()){de=de.value;var fe=G.get(de);fe&&fe.formAssociated!==!0||te.push(de)}return new Pe(te)}})}}).call(typeof globalThis=="object"?globalThis:window)),R_}_P();const Nh=globalThis,Hb=Nh.ShadowRoot&&(Nh.ShadyCSS===void 0||Nh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,qb=Symbol(),M_=new WeakMap;let nO=class{constructor(t,s,r){if(this._$cssResult$=!0,r!==qb)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o;const s=this.t;if(Hb&&t===void 0){const r=s!==void 0&&s.length===1;r&&(t=M_.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&M_.set(s,t))}return t}toString(){return this.cssText}};const kP=e=>new nO(typeof e=="string"?e:e+"",void 0,qb),ya=(e,...t)=>{const s=e.length===1?e[0]:t.reduce((r,i,c)=>r+(u=>{if(u._$cssResult$===!0)return u.cssText;if(typeof u=="number")return u;throw Error("Value passed to 'css' function must be a 'css' function result: "+u+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[c+1],e[0]);return new nO(s,e,qb)},sO=(e,t)=>{if(Hb)e.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of t){const r=document.createElement("style"),i=Nh.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=s.cssText,e.appendChild(r)}},D_=Hb?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(const r of t.cssRules)s+=r.cssText;return kP(s)})(e):e;const{is:AP,defineProperty:OP,getOwnPropertyDescriptor:NP,getOwnPropertyNames:xP,getOwnPropertySymbols:CP,getPrototypeOf:IP}=Object,Gp=globalThis,U_=Gp.trustedTypes,RP=U_?U_.emptyScript:"",jP=Gp.reactiveElementPolyfillSupport,Bu=(e,t)=>e,lp={toAttribute(e,t){switch(t){case Boolean:e=e?RP:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=e!==null;break;case Number:s=e===null?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch{s=null}}return s}},Fp=(e,t)=>!AP(e,t),B_={attribute:!0,type:String,converter:lp,reflect:!1,useDefault:!1,hasChanged:Fp};Symbol.metadata??=Symbol("metadata"),Gp.litPropertyMetadata??=new WeakMap;let _c=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=B_){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(t,r,s);i!==void 0&&OP(this.prototype,t,i)}}static getPropertyDescriptor(t,s,r){const{get:i,set:c}=NP(this.prototype,t)??{get(){return this[s]},set(u){this[s]=u}};return{get:i,set(u){const d=i?.call(this);c?.call(this,u),this.requestUpdate(t,d,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??B_}static _$Ei(){if(this.hasOwnProperty(Bu("elementProperties")))return;const t=IP(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Bu("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Bu("properties"))){const s=this.properties,r=[...xP(s),...CP(s)];for(const i of r)this.createProperty(i,s[i])}const t=this[Symbol.metadata];if(t!==null){const s=litPropertyMetadata.get(t);if(s!==void 0)for(const[r,i]of s)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[s,r]of this.elementProperties){const i=this._$Eu(s,r);i!==void 0&&this._$Eh.set(i,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const i of r)s.unshift(D_(i))}else t!==void 0&&s.push(D_(t));return s}static _$Eu(t,s){const r=s.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const r of s.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return sO(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,s,r){this._$AK(t,r)}_$ET(t,s){const r=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,r);if(i!==void 0&&r.reflect===!0){const c=(r.converter?.toAttribute!==void 0?r.converter:lp).toAttribute(s,r.type);this._$Em=t,c==null?this.removeAttribute(i):this.setAttribute(i,c),this._$Em=null}}_$AK(t,s){const r=this.constructor,i=r._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const c=r.getPropertyOptions(i),u=typeof c.converter=="function"?{fromAttribute:c.converter}:c.converter?.fromAttribute!==void 0?c.converter:lp;this._$Em=i;const d=u.fromAttribute(s,c.type);this[i]=d??this._$Ej?.get(i)??d,this._$Em=null}}requestUpdate(t,s,r,i=!1,c){if(t!==void 0){const u=this.constructor;if(i===!1&&(c=this[t]),r??=u.getPropertyOptions(t),!((r.hasChanged??Fp)(c,s)||r.useDefault&&r.reflect&&c===this._$Ej?.get(t)&&!this.hasAttribute(u._$Eu(t,r))))return;this.C(t,s,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,s,{useDefault:r,reflect:i,wrapped:c},u){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,u??s??this[t]),c!==!0||u!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(s=void 0),this._$AL.set(t,s)),i===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,c]of this._$Ep)this[i]=c;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[i,c]of r){const{wrapped:u}=c,d=this[i];u!==!0||this._$AL.has(i)||d===void 0||this.C(i,void 0,c,d)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(s)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach(s=>s.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(s=>this._$ET(s,this[s])),this._$EM()}updated(t){}firstUpdated(t){}};_c.elementStyles=[],_c.shadowRootOptions={mode:"open"},_c[Bu("elementProperties")]=new Map,_c[Bu("finalized")]=new Map,jP?.({ReactiveElement:_c}),(Gp.reactiveElementVersions??=[]).push("2.1.2");const Zb=globalThis,L_=e=>e,up=Zb.trustedTypes,z_=up?up.createPolicy("lit-html",{createHTML:e=>e}):void 0,rO="$lit$",ai=`lit$${Math.random().toFixed(9).slice(2)}$`,aO="?"+ai,MP=`<${aO}>`,go=document,Zu=()=>go.createComment(""),Yu=e=>e===null||typeof e!="object"&&typeof e!="function",Yb=Array.isArray,DP=e=>Yb(e)||typeof e?.[Symbol.iterator]=="function",Ty=`[
|
|
13
13
|
\f\r]`,vu=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$_=/-->/g,V_=/>/g,Zi=RegExp(`>|${Ty}(?:([^\\s"'>=/]+)(${Ty}*=${Ty}*(?:[^
|
|
14
14
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),P_=/'/g,G_=/"/g,iO=/^(?:script|style|textarea|title)$/i,UP=e=>(t,...s)=>({_$litType$:e,strings:t,values:s}),bt=UP(1),yo=Symbol.for("lit-noChange"),un=Symbol.for("lit-nothing"),F_=new WeakMap,to=go.createTreeWalker(go,129);function oO(e,t){if(!Yb(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return z_!==void 0?z_.createHTML(t):t}const BP=(e,t)=>{const s=e.length-1,r=[];let i,c=t===2?"<svg>":t===3?"<math>":"",u=vu;for(let d=0;d<s;d++){const p=e[d];let m,g,y=-1,b=0;for(;b<p.length&&(u.lastIndex=b,g=u.exec(p),g!==null);)b=u.lastIndex,u===vu?g[1]==="!--"?u=$_:g[1]!==void 0?u=V_:g[2]!==void 0?(iO.test(g[2])&&(i=RegExp("</"+g[2],"g")),u=Zi):g[3]!==void 0&&(u=Zi):u===Zi?g[0]===">"?(u=i??vu,y=-1):g[1]===void 0?y=-2:(y=u.lastIndex-g[2].length,m=g[1],u=g[3]===void 0?Zi:g[3]==='"'?G_:P_):u===G_||u===P_?u=Zi:u===$_||u===V_?u=vu:(u=Zi,i=void 0);const E=u===Zi&&e[d+1].startsWith("/>")?" ":"";c+=u===vu?p+MP:y>=0?(r.push(m),p.slice(0,y)+rO+p.slice(y)+ai+E):p+ai+(y===-2?d:E)}return[oO(e,c+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};let yv=class cO{constructor({strings:t,_$litType$:s},r){let i;this.parts=[];let c=0,u=0;const d=t.length-1,p=this.parts,[m,g]=BP(t,s);if(this.el=cO.createElement(m,r),to.currentNode=this.el.content,s===2||s===3){const y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(i=to.nextNode())!==null&&p.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(const y of i.getAttributeNames())if(y.endsWith(rO)){const b=g[u++],E=i.getAttribute(y).split(ai),O=/([.?@])?(.*)/.exec(b);p.push({type:1,index:c,name:O[2],strings:E,ctor:O[1]==="."?zP:O[1]==="?"?$P:O[1]==="@"?VP:Hp}),i.removeAttribute(y)}else y.startsWith(ai)&&(p.push({type:6,index:c}),i.removeAttribute(y));if(iO.test(i.tagName)){const y=i.textContent.split(ai),b=y.length-1;if(b>0){i.textContent=up?up.emptyScript:"";for(let E=0;E<b;E++)i.append(y[E],Zu()),to.nextNode(),p.push({type:2,index:++c});i.append(y[b],Zu())}}}else if(i.nodeType===8)if(i.data===aO)p.push({type:2,index:c});else{let y=-1;for(;(y=i.data.indexOf(ai,y+1))!==-1;)p.push({type:7,index:c}),y+=ai.length-1}c++}}static createElement(t,s){const r=go.createElement("template");return r.innerHTML=t,r}};function Yc(e,t,s=e,r){if(t===yo)return t;let i=r!==void 0?s._$Co?.[r]:s._$Cl;const c=Yu(t)?void 0:t._$litDirective$;return i?.constructor!==c&&(i?._$AO?.(!1),c===void 0?i=void 0:(i=new c(e),i._$AT(e,s,r)),r!==void 0?(s._$Co??=[])[r]=i:s._$Cl=i),i!==void 0&&(t=Yc(e,i._$AS(e,t.values),i,r)),t}class LP{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:s},parts:r}=this._$AD,i=(t?.creationScope??go).importNode(s,!0);to.currentNode=i;let c=to.nextNode(),u=0,d=0,p=r[0];for(;p!==void 0;){if(u===p.index){let m;p.type===2?m=new fd(c,c.nextSibling,this,t):p.type===1?m=new p.ctor(c,p.name,p.strings,this,t):p.type===6&&(m=new PP(c,this,t)),this._$AV.push(m),p=r[++d]}u!==p?.index&&(c=to.nextNode(),u++)}return to.currentNode=go,i}p(t){let s=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,s),s+=r.strings.length-2):r._$AI(t[s])),s++}}class fd{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,r,i){this.type=2,this._$AH=un,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&t?.nodeType===11&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=Yc(this,t,s),Yu(t)?t===un||t==null||t===""?(this._$AH!==un&&this._$AR(),this._$AH=un):t!==this._$AH&&t!==yo&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):DP(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==un&&Yu(this._$AH)?this._$AA.nextSibling.data=t:this.T(go.createTextNode(t)),this._$AH=t}$(t){const{values:s,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=yv.createElement(oO(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(s);else{const c=new LP(i,this),u=c.u(this.options);c.p(s),this.T(u),this._$AH=c}}_$AC(t){let s=F_.get(t.strings);return s===void 0&&F_.set(t.strings,s=new yv(t)),s}k(t){Yb(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let r,i=0;for(const c of t)i===s.length?s.push(r=new fd(this.O(Zu()),this.O(Zu()),this,this.options)):r=s[i],r._$AI(c),i++;i<s.length&&(this._$AR(r&&r._$AB.nextSibling,i),s.length=i)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){const r=L_(t).nextSibling;L_(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class Hp{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,r,i,c){this.type=1,this._$AH=un,this._$AN=void 0,this.element=t,this.name=s,this._$AM=i,this.options=c,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=un}_$AI(t,s=this,r,i){const c=this.strings;let u=!1;if(c===void 0)t=Yc(this,t,s,0),u=!Yu(t)||t!==this._$AH&&t!==yo,u&&(this._$AH=t);else{const d=t;let p,m;for(t=c[0],p=0;p<c.length-1;p++)m=Yc(this,d[r+p],s,p),m===yo&&(m=this._$AH[p]),u||=!Yu(m)||m!==this._$AH[p],m===un?t=un:t!==un&&(t+=(m??"")+c[p+1]),this._$AH[p]=m}u&&!i&&this.j(t)}j(t){t===un?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}let zP=class extends Hp{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===un?void 0:t}};class $P extends Hp{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==un)}}let VP=class extends Hp{constructor(t,s,r,i,c){super(t,s,r,i,c),this.type=5}_$AI(t,s=this){if((t=Yc(this,t,s,0)??un)===yo)return;const r=this._$AH,i=t===un&&r!==un||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,c=t!==un&&(r===un||i);i&&this.element.removeEventListener(this.name,this,r),c&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}};class PP{constructor(t,s,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Yc(this,t)}}const GP=Zb.litHtmlPolyfillSupport;GP?.(yv,fd),(Zb.litHtmlVersions??=[]).push("3.3.3");const FP=(e,t,s)=>{const r=s?.renderBefore??t;let i=r._$litPart$;if(i===void 0){const c=s?.renderBefore??null;r._$litPart$=i=new fd(t.insertBefore(Zu(),c),c,void 0,s??{})}return i._$AI(e),i};const Wb=globalThis;let Zn=class extends _c{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=FP(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return yo}};Zn._$litElement$=!0,Zn.finalized=!0,Wb.litElementHydrateSupport?.({LitElement:Zn});const HP=Wb.litElementPolyfillSupport;HP?.({LitElement:Zn});(Wb.litElementVersions??=[]).push("4.2.2");const lO=e=>(t,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};const qP={attribute:!0,type:String,converter:lp,reflect:!1,hasChanged:Fp},ZP=(e=qP,t,s)=>{const{kind:r,metadata:i}=s;let c=globalThis.litPropertyMetadata.get(i);if(c===void 0&&globalThis.litPropertyMetadata.set(i,c=new Map),r==="setter"&&((e=Object.create(e)).wrapped=!0),c.set(s.name,e),r==="accessor"){const{name:u}=s;return{set(d){const p=t.get.call(this);t.set.call(this,d),this.requestUpdate(u,p,e,!0,d)},init(d){return d!==void 0&&this.C(u,void 0,e,d),d}}}if(r==="setter"){const{name:u}=s;return function(d){const p=this[u];t.call(this,d),this.requestUpdate(u,p,e,!0,d)}}throw Error("Unsupported decorator location: "+r)};function mn(e){return(t,s)=>typeof s=="object"?ZP(e,t,s):((r,i,c)=>{const u=i.hasOwnProperty(c);return i.constructor.createProperty(c,r),u?Object.getOwnPropertyDescriptor(i,c):void 0})(e,t,s)}function Xb(e){return mn({...e,state:!0,attribute:!1})}const YP=(e,t,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(e,t,s),s);function qp(e,t){return(s,r,i)=>{const c=u=>u.renderRoot?.querySelector(e)??null;return YP(s,r,{get(){return c(this)}})}}var Sy={},bu={},H_;function WP(){if(H_)return bu;H_=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.StoreController=void 0;let e=class{constructor(s,r){this.host=s,this.atom=r,s.addController(this)}hostConnected(){this.unsubscribe=this.atom.subscribe(()=>{this.host.requestUpdate()})}hostDisconnected(){var s;(s=this.unsubscribe)===null||s===void 0||s.call(this)}get value(){return this.atom.get()}};return bu.StoreController=e,bu}var wu={},q_;function Kb(){if(q_)return wu;q_=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.MultiStoreController=void 0;let e=class{constructor(s,r){this.host=s,this.atoms=r,s.addController(this)}hostConnected(){this.unsubscribes=this.atoms.map(s=>s.subscribe(()=>this.host.requestUpdate()))}hostDisconnected(){var s;(s=this.unsubscribes)===null||s===void 0||s.forEach(r=>r())}get values(){return this.atoms.map(s=>s.get())}};return wu.MultiStoreController=e,wu}var Tu={},Z_;function XP(){if(Z_)return Tu;Z_=1,Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.useStores=void 0;const e=Kb();function t(...s){return r=>class extends r{constructor(...i){super(...i),new e.MultiStoreController(this,s)}}}return Tu.useStores=t,Tu}var Su={},Y_;function KP(){if(Y_)return Su;Y_=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.withStores=void 0;const e=Kb(),t=(s,r)=>class extends s{constructor(...c){super(...c),new e.MultiStoreController(this,r)}};return Su.withStores=t,Su}var W_;function JP(){return W_||(W_=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withStores=e.useStores=e.MultiStoreController=e.StoreController=void 0;var t=WP();Object.defineProperty(e,"StoreController",{enumerable:!0,get:function(){return t.StoreController}});var s=Kb();Object.defineProperty(e,"MultiStoreController",{enumerable:!0,get:function(){return s.MultiStoreController}});var r=XP();Object.defineProperty(e,"useStores",{enumerable:!0,get:function(){return r.useStores}});var i=KP();Object.defineProperty(e,"withStores",{enumerable:!0,get:function(){return i.withStores}})})(Sy)),Sy}var QP=JP();function Zp(e){return class extends e{createRenderRoot(){const t=this.constructor,{registry:s,elementDefinitions:r,shadowRootOptions:i}=t;r&&!s&&(t.registry=new CustomElementRegistry,Object.entries(r).forEach((([u,d])=>t.registry.define(u,d))));const c=this.renderOptions.creationScope=this.attachShadow({...i,customElements:t.registry});return sO(c,this.constructor.elementStyles),c}}}const eG={ATTRIBUTE:1},tG=e=>(...t)=>({_$litDirective$:e,values:t});let nG=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,s,r){this._$Ct=t,this._$AM=s,this._$Ci=r}_$AS(t,s){return this.update(t,s)}update(t,s){return this.render(...s)}};const X_=tG(class extends nG{constructor(e){if(super(e),e.type!==eG.ATTRIBUTE||e.name!=="class"||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!this.nt?.has(r)&&this.st.add(r);return this.render(t)}const s=e.element.classList;for(const r of this.st)r in t||(s.remove(r),this.st.delete(r));for(const r in t){const i=!!t[r];i===this.st.has(r)||this.nt?.has(r)||(i?(s.add(r),this.st.add(r)):(s.remove(r),this.st.delete(r)))}return yo}}),dp=Math.min,ao=Math.max,fp=Math.round,rh=Math.floor,da=e=>({x:e,y:e}),sG={left:"right",right:"left",bottom:"top",top:"bottom"};function rG(e,t,s){return ao(e,dp(t,s))}function Yp(e,t){return typeof e=="function"?e(t):e}function Wc(e){return e.split("-")[0]}function Wp(e){return e.split("-")[1]}function uO(e){return e==="x"?"y":"x"}function dO(e){return e==="y"?"height":"width"}function li(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function fO(e){return uO(li(e))}function aG(e,t,s){s===void 0&&(s=!1);const r=Wp(e),i=fO(e),c=dO(i);let u=i==="x"?r===(s?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=hp(u)),[u,hp(u)]}function iG(e){const t=hp(e);return[vv(e),t,vv(t)]}function vv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const K_=["left","right"],J_=["right","left"],oG=["top","bottom"],cG=["bottom","top"];function lG(e,t,s){switch(e){case"top":case"bottom":return s?t?J_:K_:t?K_:J_;case"left":case"right":return t?oG:cG;default:return[]}}function uG(e,t,s,r){const i=Wp(e);let c=lG(Wc(e),s==="start",r);return i&&(c=c.map(u=>u+"-"+i),t&&(c=c.concat(c.map(vv)))),c}function hp(e){const t=Wc(e);return sG[t]+e.slice(t.length)}function dG(e){var t,s,r,i;return{top:(t=e.top)!=null?t:0,right:(s=e.right)!=null?s:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function fG(e){return typeof e!="number"?dG(e):{top:e,right:e,bottom:e,left:e}}function pp(e){const{x:t,y:s,width:r,height:i}=e;return{width:r,height:i,top:s,left:t,right:t+r,bottom:s+i,x:t,y:s}}function Q_(e,t,s){let{reference:r,floating:i}=e;const c=li(t),u=fO(t),d=dO(u),p=Wc(t),m=c==="y",g=r.x+r.width/2-i.width/2,y=r.y+r.height/2-i.height/2,b=r[d]/2-i[d]/2;let E;switch(p){case"top":E={x:g,y:r.y-i.height};break;case"bottom":E={x:g,y:r.y+r.height};break;case"right":E={x:r.x+r.width,y};break;case"left":E={x:r.x-i.width,y};break;default:E={x:r.x,y:r.y}}const O=Wp(t);return O&&(E[u]+=b*(O==="end"?1:-1)*(s&&m?-1:1)),E}async function hG(e,t){var s;t===void 0&&(t={});const{x:r,y:i,platform:c,rects:u,elements:d,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:b=!1,padding:E=0}=Yp(t,e),O=fG(E),R=d[b?y==="floating"?"reference":"floating":y],$=pp(await c.getClippingRect({element:(s=await(c.isElement==null?void 0:c.isElement(R)))==null||s?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(d.floating)),boundary:m,rootBoundary:g,strategy:p})),x=y==="floating"?{x:r,y:i,width:u.floating.width,height:u.floating.height}:u.reference,W=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d.floating)),oe=await(c.isElement==null?void 0:c.isElement(W))&&await(c.getScale==null?void 0:c.getScale(W))||{x:1,y:1},me=pp(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:x,offsetParent:W,strategy:p}):x);return{top:($.top-me.top+O.top)/oe.y,bottom:(me.bottom-$.bottom+O.bottom)/oe.y,left:($.left-me.left+O.left)/oe.x,right:(me.right-$.right+O.right)/oe.x}}const pG=50,mG=async(e,t,s)=>{const{placement:r="bottom",strategy:i="absolute",middleware:c=[],platform:u}=s,d=u.detectOverflow?u:{...u,detectOverflow:hG},p=await(u.isRTL==null?void 0:u.isRTL(t));let m=await u.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y}=Q_(m,r,p),b=r,E=0;const O={};for(let C=0;C<c.length;C++){const R=c[C];if(!R)continue;const{name:$,fn:x}=R,{x:W,y:oe,data:me,reset:G}=await x({x:g,y,initialPlacement:r,placement:b,strategy:i,middlewareData:O,rects:m,platform:d,elements:{reference:e,floating:t}});g=W??g,y=oe??y,O[$]={...O[$],...me},G&&E<pG&&(E++,typeof G=="object"&&(G.placement&&(b=G.placement),G.rects&&(m=G.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:i}):G.rects),{x:g,y}=Q_(m,b,p)),C=-1)}return{x:g,y,placement:b,strategy:i,middlewareData:O}},gG=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,r;const{placement:i,middlewareData:c,rects:u,initialPlacement:d,platform:p,elements:m}=t,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:C=!0,...R}=Yp(e,t);if((s=c.arrow)!=null&&s.alignmentOffset)return{};const $=Wc(i),x=li(d),W=Wc(d)===d,oe=await(p.isRTL==null?void 0:p.isRTL(m.floating)),me=b||(W||!C?[hp(d)]:iG(d)),G=O!=="none";!b&&G&&me.push(...uG(d,C,O,oe));const J=[d,...me],w=await p.detectOverflow(t,R),A=[];let N=((r=c.flip)==null?void 0:r.overflows)||[];if(g&&A.push(w[$]),y){const z=aG(i,u,oe);A.push(w[z[0]],w[z[1]])}if(N=[...N,{placement:i,overflows:A}],!A.every(z=>z<=0)){var F,B;const z=(((F=c.flip)==null?void 0:F.index)||0)+1,D=J[z];if(D&&(!(y==="alignment"?x!==li(D):!1)||N.every(U=>li(U.placement)===x?U.overflows[0]>0:!0)))return{data:{index:z,overflows:N},reset:{placement:D}};let k=(B=N.filter(j=>j.overflows[0]<=0).sort((j,U)=>j.overflows[1]-U.overflows[1])[0])==null?void 0:B.placement;if(!k)switch(E){case"bestFit":{var q;const j=(q=N.filter(U=>{if(G){const V=li(U.placement);return V===x||V==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((U,V)=>U[1]-V[1])[0])==null?void 0:q[0];j&&(k=j);break}case"initialPlacement":k=d;break}if(i!==k)return{reset:{placement:k}}}return{}}}},yG=new Set(["left","top"]);async function vG(e,t){const{placement:s,platform:r,elements:i}=e,c=await(r.isRTL==null?void 0:r.isRTL(i.floating)),u=Wc(s),d=Wp(s),p=li(s)==="y",m=yG.has(u)?-1:1,g=c&&p?-1:1,y=Yp(t,e);let{mainAxis:b,crossAxis:E,alignmentAxis:O}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return d&&typeof O=="number"&&(E=d==="end"?O*-1:O),p?{x:E*g,y:b*m}:{x:b*m,y:E*g}}const bG=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,r;const{x:i,y:c,placement:u,middlewareData:d}=t,p=await vG(t,e);return u===((s=d.offset)==null?void 0:s.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:i+p.x,y:c+p.y,data:{...p,placement:u}}}}},wG=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:r,placement:i,platform:c}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:p={fn:x=>{let{x:W,y:oe}=x;return{x:W,y:oe}}},...m}=Yp(e,t),g={x:s,y:r},y=await c.detectOverflow(t,m),b=li(i),E=uO(b);let O=g[E],C=g[b];const R=(x,W)=>rG(W+y[x==="y"?"top":"left"],W,W-y[x==="y"?"bottom":"right"]);u&&(O=R(E,O)),d&&(C=R(b,C));const $=p.fn({...t,[E]:O,[b]:C});return{...$,data:{x:$.x-s,y:$.y-r,enabled:{[E]:u,[b]:d}}}}}};function Xp(){return typeof window<"u"}function dl(e){return hO(e)?(e.nodeName||"").toLowerCase():"#document"}function is(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function va(e){var t;return(t=(hO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hO(e){return Xp()?e instanceof Node||e instanceof is(e).Node:!1}function Ir(e){return Xp()?e instanceof Element||e instanceof is(e).Element:!1}function wi(e){return Xp()?e instanceof HTMLElement||e instanceof is(e).HTMLElement:!1}function e4(e){return!Xp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof is(e).ShadowRoot}function Kp(e){const{overflow:t,overflowX:s,overflowY:r,display:i}=Rr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+s)&&i!=="inline"&&i!=="contents"}function TG(e){return/^(table|td|th)$/.test(dl(e))}function Jp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const SG=/transform|translate|scale|rotate|perspective|filter/,EG=/paint|layout|strict|content/,Yi=e=>!!e&&e!=="none";let Ey;function Jb(e){const t=Ir(e)?Rr(e):e;return Yi(t.transform)||Yi(t.translate)||Yi(t.scale)||Yi(t.rotate)||Yi(t.perspective)||!Qb()&&(Yi(t.backdropFilter)||Yi(t.filter))||SG.test(t.willChange||"")||EG.test(t.contain||"")}function _G(e){let t=vo(e);for(;wi(t)&&!Wu(t);){if(Jb(t))return t;if(Jp(t))return null;t=vo(t)}return null}function Qb(){return Ey==null&&(Ey=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ey}function Wu(e){return/^(html|body|#document)$/.test(dl(e))}function Rr(e){return is(e).getComputedStyle(e)}function Qp(e){return Ir(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vo(e){if(dl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||e4(e)&&e.host||va(e);return e4(t)?t.host:t}function pO(e){const t=vo(e);return Wu(t)?(e.ownerDocument||e).body:wi(t)&&Kp(t)?t:pO(t)}function Xu(e,t,s){var r;t===void 0&&(t=[]),s===void 0&&(s=!0);const i=pO(e),c=i===((r=e.ownerDocument)==null?void 0:r.body),u=is(i);if(c){const d=bv(u);return t.concat(u,u.visualViewport||[],Kp(i)?i:[],d&&s?Xu(d):[])}else return t.concat(i,Xu(i,[],s))}function bv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mO(e){const t=Rr(e);let s=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=wi(e),c=i?e.offsetWidth:s,u=i?e.offsetHeight:r,d=fp(s)!==c||fp(r)!==u;return d&&(s=c,r=u),{width:s,height:r,$:d}}function e1(e){return Ir(e)?e:e.contextElement}function Ic(e){const t=e1(e);if(!wi(t))return da(1);const s=t.getBoundingClientRect(),{width:r,height:i,$:c}=mO(t);let u=(c?fp(s.width):s.width)/r,d=(c?fp(s.height):s.height)/i;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const kG=da(0);function gO(e){const t=is(e);return!Qb()||!t.visualViewport?kG:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function AG(e,t,s){return t===void 0&&(t=!1),!!s&&t&&s===is(e)}function bo(e,t,s,r){t===void 0&&(t=!1),s===void 0&&(s=!1);const i=e.getBoundingClientRect(),c=e1(e);let u=da(1);t&&(r?Ir(r)&&(u=Ic(r)):u=Ic(e));const d=AG(c,s,r)?gO(c):da(0);let p=(i.left+d.x)/u.x,m=(i.top+d.y)/u.y,g=i.width/u.x,y=i.height/u.y;if(c&&r){const b=is(c),E=Ir(r)?is(r):r;let O=b,C=bv(O);for(;C&&E!==O;){const R=Ic(C),$=C.getBoundingClientRect(),x=Rr(C),W=$.left+(C.clientLeft+parseFloat(x.paddingLeft))*R.x,oe=$.top+(C.clientTop+parseFloat(x.paddingTop))*R.y;p*=R.x,m*=R.y,g*=R.x,y*=R.y,p+=W,m+=oe,O=is(C),C=bv(O)}}return pp({width:g,height:y,x:p,y:m})}function em(e,t){const s=Qp(e).scrollLeft;return t?t.left+s:bo(va(e)).left+s}function yO(e,t){const s=e.getBoundingClientRect(),r=s.left+t.scrollLeft-em(e,s),i=s.top+t.scrollTop;return{x:r,y:i}}function OG(e){let{elements:t,rect:s,offsetParent:r,strategy:i}=e;const c=i==="fixed",u=va(r),d=t?Jp(t.floating):!1;if(r===u||d&&c)return s;let p={scrollLeft:0,scrollTop:0},m=da(1);const g=da(0),y=wi(r);if((y||!c)&&((dl(r)!=="body"||Kp(u))&&(p=Qp(r)),y)){const E=bo(r);m=Ic(r),g.x=E.x+r.clientLeft,g.y=E.y+r.clientTop}const b=u&&!y&&!c?yO(u,p):da(0);return{width:s.width*m.x,height:s.height*m.y,x:s.x*m.x-p.scrollLeft*m.x+g.x+b.x,y:s.y*m.y-p.scrollTop*m.y+g.y+b.y}}function NG(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function xG(e){const t=Qp(e),s=e.ownerDocument.body,r=ao(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),i=ao(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let c=-t.scrollLeft+em(e);const u=-t.scrollTop;return Rr(s).direction==="rtl"&&(c+=ao(e.clientWidth,s.clientWidth)-r),{width:r,height:i,x:c,y:u}}const CG=25;function IG(e,t,s){s===void 0&&(s="viewport");const r=s==="layoutViewport",i=is(e),c=va(e),u=i.visualViewport;let d=c.clientWidth,p=c.clientHeight,m=0,g=0;if(u){const b=!Qb()||t==="fixed";r?b||(m=-u.offsetLeft,g=-u.offsetTop):(d=u.width,p=u.height,b&&(m=u.offsetLeft,g=u.offsetTop))}if(em(c)<=0){const b=c.ownerDocument,E=b.body,O=getComputedStyle(E),C=b.compatMode==="CSS1Compat"&&parseFloat(O.marginLeft)+parseFloat(O.marginRight)||0,R=Math.abs(c.clientWidth-E.clientWidth-C),$=getComputedStyle(c).scrollbarGutter==="stable both-edges"?R/2:R;$<=CG&&(d-=$)}return{width:d,height:p,x:m,y:g}}function RG(e,t){const s=bo(e,!0,t==="fixed"),r=s.top+e.clientTop,i=s.left+e.clientLeft,c=Ic(e),u=e.clientWidth*c.x,d=e.clientHeight*c.y,p=i*c.x,m=r*c.y;return{width:u,height:d,x:p,y:m}}function t4(e,t,s){let r;if(t==="viewport"||t==="layoutViewport")r=IG(e,s,t);else if(t==="document")r=xG(va(e));else if(Ir(t))r=RG(t,s);else{const i=gO(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return pp(r)}function jG(e,t){const s=t.get(e);if(s)return s;let r=Xu(e,[],!1).filter(d=>Ir(d)&&dl(d)!=="body"),i=null;const c=Rr(e).position==="fixed";let u=c?vo(e):e;for(;Ir(u)&&!Wu(u);){const d=Rr(u),p=Jb(u),m=i?i.position:c?"fixed":"";!p&&(m==="fixed"||m==="absolute"&&d.position==="static")?r=r.filter(y=>y!==u):i=d,u=vo(u)}return t.set(e,r),r}function MG(e){let{element:t,boundary:s,rootBoundary:r,strategy:i}=e;const u=[...s==="clippingAncestors"?Jp(t)?[]:jG(t,this._c):[].concat(s),r],d=t4(t,u[0],i);let p=d.top,m=d.right,g=d.bottom,y=d.left;for(let b=1;b<u.length;b++){const E=t4(t,u[b],i);p=ao(E.top,p),m=dp(E.right,m),g=dp(E.bottom,g),y=ao(E.left,y)}return{width:m-y,height:g-p,x:y,y:p}}function DG(e){const{width:t,height:s}=mO(e);return{width:t,height:s}}function UG(e,t,s){const r=wi(t),i=va(t),c=s==="fixed",u=bo(e,!0,c,t);let d={scrollLeft:0,scrollTop:0};const p=da(0);if((r||!c)&&((dl(t)!=="body"||Kp(i))&&(d=Qp(t)),r)){const b=bo(t,!0,c,t);p.x=b.x+t.clientLeft,p.y=b.y+t.clientTop}!r&&i&&(p.x=em(i));const m=i&&!r&&!c?yO(i,d):da(0),g=u.left+d.scrollLeft-p.x-m.x,y=u.top+d.scrollTop-p.y-m.y;return{x:g,y,width:u.width,height:u.height}}function _y(e){return Rr(e).position==="static"}function n4(e,t){if(!wi(e)||Rr(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return va(e)===s&&(s=s.ownerDocument.body),s}function vO(e,t){const s=is(e);if(Jp(e))return s;if(!wi(e)){let i=vo(e);for(;i&&!Wu(i);){if(Ir(i)&&!_y(i))return i;i=vo(i)}return s}let r=n4(e,t);for(;r&&TG(r)&&_y(r);)r=n4(r,t);return r&&Wu(r)&&_y(r)&&!Jb(r)?s:r||_G(e)||s}const BG=async function(e){const t=this.getOffsetParent||vO,s=this.getDimensions,r=await s(e.floating);return{reference:UG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function LG(e){return Rr(e).direction==="rtl"}const zG={convertOffsetParentRelativeRectToViewportRelativeRect:OG,getDocumentElement:va,getClippingRect:MG,getOffsetParent:vO,getElementRects:BG,getClientRects:NG,getDimensions:DG,getScale:Ic,isElement:Ir,isRTL:LG};function bO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $G(e,t,s){let r=null,i;const c=va(e);function u(){var g;clearTimeout(i),(g=r)==null||g.disconnect(),r=null}function d(g,y){g===void 0&&(g=!1),y===void 0&&(y=1),u();const b=e.getBoundingClientRect(),{left:E,top:O,width:C,height:R}=b;if(g||t(),!C||!R)return;const $=rh(O),x=rh(c.clientWidth-(E+C)),W=rh(c.clientHeight-(O+R)),oe=rh(E),G={rootMargin:-$+"px "+-x+"px "+-W+"px "+-oe+"px",threshold:ao(0,dp(1,y))||1};let J=!0;function w(A){const N=A[0].intersectionRatio;if(!bO(b,e.getBoundingClientRect()))return d();if(N!==y){if(!J)return d();N?d(!1,N):i=setTimeout(()=>{d(!1,1e-7)},1e3)}J=!1}try{r=new IntersectionObserver(w,{...G,root:c.ownerDocument})}catch{r=new IntersectionObserver(w,G)}r.observe(e)}const p=is(e),m=()=>d(s);return p.addEventListener("resize",m),d(!0),()=>{p.removeEventListener("resize",m),u()}}function VG(e,t,s,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:p=!1}=r,m=e1(e),g=i||c?[...m?Xu(m):[],...t?Xu(t):[]]:[];g.forEach($=>{i&&$.addEventListener("scroll",s),c&&$.addEventListener("resize",s)});const y=m&&d?$G(m,s,c):null;let b=-1,E=null;u&&(E=new ResizeObserver($=>{let[x]=$;x&&x.target===m&&E&&t&&(E.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var W;(W=E)==null||W.observe(t)})),s()}),m&&!p&&E.observe(m),t&&E.observe(t));let O,C=p?bo(e):null;p&&R();function R(){const $=bo(e);C&&!bO(C,$)&&s(),C=$,O=requestAnimationFrame(R)}return s(),()=>{var $;g.forEach(x=>{i&&x.removeEventListener("scroll",s),c&&x.removeEventListener("resize",s)}),y?.(),($=E)==null||$.disconnect(),E=null,p&&cancelAnimationFrame(O)}}const PG=bG,GG=wG,FG=gG,HG=(e,t,s)=>{const r=new Map,i=s??{},c={...zG,...i.platform,_c:r};return mG(e,t,{...i,platform:c})};function wv(e,t,s){return e?t(e):s?.(e)}const qG=Symbol();let wO=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,s)=>{this.o=t,this.h=s})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,s,r){this.p=0,this.i=0,(this._=t).addController(this);const i=typeof s=="object"?s:{task:s,args:r};this.v=i.task,this.j=i.args,this.m=i.argsEqual??ZG,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;const t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){const t=this.T(),s=this.O;this.O=t,t===s||t===void 0||s!==void 0&&this.m(s,t)||await this.run(t)}async run(t){let s,r;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();const i=++this.p;this.q=new AbortController;let c=!1;try{s=await this.v(t,{signal:this.q.signal})}catch(u){c=!0,r=u}if(this.p===i){if(s===qG)this.i=0;else{if(c===!1){try{this.k?.(s)}catch{}this.i=2,this.o?.(s)}else{try{this.A?.(r)}catch{}this.i=3,this.h?.(r)}this.u=s,this.l=r}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}};const ZG=(e,t)=>e===t||e.length===t.length&&e.every(((s,r)=>!Fp(s,t[r])));function TO(){return function(e,t){const s=Symbol(),r=Symbol();Object.defineProperty(e,t,{get(){return this[r]},set(i){const c=this[r];if(c===i)return;this[r]=i;const u=this[s];u&&(u.hostDisconnected(),this.removeController(u));const d=i?new QP.MultiStoreController(this,Object.values(i.stores)):void 0;this[s]=d,u&&!d&&this.requestUpdate(t,c)},configurable:!0,enumerable:!0})}}const YG=ya`
|
|
15
15
|
* {
|
|
@@ -839,7 +839,7 @@ Error generating stack: `+l.message+`
|
|
|
839
839
|
`+l.stack}}var vl=Object.prototype.hasOwnProperty,bl=e.unstable_scheduleCallback,wa=e.unstable_cancelCallback,om=e.unstable_shouldYield,cm=e.unstable_requestPaint,zn=e.unstable_now,lm=e.unstable_getCurrentPriorityLevel,yd=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,Ye=e.unstable_NormalPriority,Nt=e.unstable_LowPriority,ks=e.unstable_IdlePriority,Mn=e.log,Oo=e.unstable_setDisableYieldValue,wl=null,os=null;function Ta(n){if(typeof Mn=="function"&&Oo(n),os&&typeof os.setStrictMode=="function")try{os.setStrictMode(wl,n)}catch{}}var cs=Math.clz32?Math.clz32:NN,AN=Math.log,ON=Math.LN2;function NN(n){return n>>>=0,n===0?32:31-(AN(n)/ON|0)|0}var vd=256,bd=262144,wd=4194304;function Si(n){var a=n&42;if(a!==0)return a;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&-n;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Td(n,a,o){var l=n.pendingLanes;if(l===0)return 0;var f=0,h=n.suspendedLanes,v=n.pingedLanes;n=n.warmLanes;var _=l&134217727;return _!==0?(l=_&~h,l!==0?f=Si(l):(v&=_,v!==0?f=Si(v):o||(o=_&~n,o!==0&&(f=Si(o))))):(_=l&~h,_!==0?f=Si(_):v!==0?f=Si(v):o||(o=l&~n,o!==0&&(f=Si(o)))),f===0?0:a!==0&&a!==f&&(a&h)===0&&(h=f&-f,o=a&-a,h>=o||h===32&&(o&4194048)!==0)?a:f}function Tl(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function g1(n,a){(a&8)!==0&&(a|=a&32);var o=n.entangledLanes;if(o!==0)for(n=n.entanglements,o&=a;0<o;){var l=31-cs(o),f=1<<l;a|=n[l],o&=~f}return a}function xN(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function y1(){var n=wd;return wd<<=1,(wd&62914560)===0&&(wd=4194304),n}function um(n){for(var a=[],o=0;31>o;o++)a.push(n);return a}function Sl(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function CN(n,a,o,l,f,h){var v=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var _=n.entanglements,L=n.expirationTimes,ne=n.hiddenUpdates;for(o=v&~o;0<o;){var ie=31-cs(o),ge=1<<ie;_[ie]=0,L[ie]=-1;var Q=ne[ie];if(Q!==null)for(ne[ie]=null,ie=0;ie<Q.length;ie++){var ae=Q[ie];ae!==null&&(ae.lane&=-536870913)}o&=~ge}l!==0&&v1(n,l,0),h!==0&&f===0&&n.tag!==0&&(n.suspendedLanes|=h&~(v&~a))}function v1(n,a,o){n.pendingLanes|=a,n.suspendedLanes&=~a;var l=31-cs(a);n.entangledLanes|=a,n.entanglements[l]=n.entanglements[l]|1073741824|o&261930}function b1(n,a){var o=n.entangledLanes|=a;for(n=n.entanglements;o;){var l=31-cs(o),f=1<<l;f&a|n[l]&a&&(n[l]|=a),o&=~f}}function w1(n,a){var o=a&-a;return o=(o&42)!==0?1:dm(o),(o&(n.suspendedLanes|a))!==0?0:o}function dm(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function fm(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function T1(){var n=_e.p;return n!==0?n:(n=window.event,n===void 0?32:NS(n.type))}function S1(n,a){var o=_e.p;try{return _e.p=n,a()}finally{_e.p=o}}var Dr=Math.random().toString(36).slice(2),_n="__reactFiber$"+Dr,Xn="__reactProps$"+Dr,No="__reactContainer$"+Dr,E1="__reactEvents$"+Dr,IN="__reactListeners$"+Dr,RN="__reactHandles$"+Dr,_1="__reactResources$"+Dr,El="__reactMarker$"+Dr,Sd="__reactLoad$"+Dr;function Ed(n){delete n[_n],delete n[Xn],delete n[IN],delete n[RN]}function Ei(n){var a;if(a=n[_n])return a;for(var o=n.parentNode;o;){if(a=o[No]||o[_n]){if(o=a.alternate,a.child!==null||o!==null&&o.child!==null)for(n=cS(n);n!==null;){if(o=n[_n])return o;n=cS(n)}return a}n=o,o=n.parentNode}return null}function xo(n){if(n=n[_n]||n[No]){var a=n.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return n}return null}function _l(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(r(33))}function Co(n){var a=n[_1];return a||(a=n[_1]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function gn(n){n[El]=!0}function k1(n){n[Sd]=void 0}var A1=new Set,O1={};function _i(n,a){Io(n,a),Io(n+"Capture",a)}function Io(n,a){for(O1[n]=a,n=0;n<a.length;n++)A1.add(a[n])}var jN=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),N1={},x1={};function MN(n){return vl.call(x1,n)?!0:vl.call(N1,n)?!1:jN.test(n)?x1[n]=!0:(N1[n]=!0,!1)}var dt=!1;function C1(){var n=dt;return dt=!1,n}function _d(n,a,o){if(MN(a))if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(a);return;case"boolean":var l=a.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){n.removeAttribute(a);return}}n.setAttribute(a,o)}}function kd(n,a,o){if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttribute(a,o)}}function Ur(n,a,o,l){if(l===null)n.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(a,o,l)}}function ls(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function I1(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function DN(n,a,o){var l=Object.getOwnPropertyDescriptor(n.constructor.prototype,a);if(!n.hasOwnProperty(a)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,h=l.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return f.call(this)},set:function(v){o=""+v,h.call(this,v)}}),Object.defineProperty(n,a,{enumerable:l.enumerable}),{getValue:function(){return o},setValue:function(v){o=""+v},stopTracking:function(){n._valueTracker=null,delete n[a]}}}}function hm(n){if(!n._valueTracker){var a=I1(n)?"checked":"value";n._valueTracker=DN(n,a,""+n[a])}}function R1(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var o=a.getValue(),l="";return n&&(l=I1(n)?n.checked?"true":"false":n.value),n=l,n!==o?(a.setValue(n),!0):!1}var UN=/[\n"\\]/g;function As(n){return n.replace(UN,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function pm(n,a,o,l,f,h,v,_){n.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?n.type=v:n.removeAttribute("type"),a!=null?v==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+ls(a)):n.value!==""+ls(a)&&(n.value=""+ls(a)):v!=="submit"&&v!=="reset"||n.removeAttribute("value"),a!=null?v==="number"&&n.value==a?mm(n,ls(n.value)):mm(n,ls(a)):o!=null?mm(n,ls(o)):l!=null&&n.removeAttribute("value"),f==null&&h!=null&&(n.defaultChecked=!!h),f!=null&&(n.checked=f&&typeof f!="function"&&typeof f!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+ls(_):n.removeAttribute("name")}function j1(n,a,o,l,f,h,v,_){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(n.type=h),a!=null||o!=null){if(!(h!=="submit"&&h!=="reset"||a!=null)){hm(n);return}o=o!=null?""+ls(o):"",a=a!=null?""+ls(a):o,_||a===n.value||(n.value=a),n.defaultValue=a}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=_?n.checked:!!l,n.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.name=v),hm(n)}function mm(n,a){n.defaultValue!==""+a&&(n.defaultValue=""+a)}function Ro(n,a,o,l){if(n=n.options,a){a={};for(var f=0;f<o.length;f++)a["$"+o[f]]=!0;for(o=0;o<n.length;o++)f=a.hasOwnProperty("$"+n[o].value),n[o].selected!==f&&(n[o].selected=f),f&&l&&(n[o].defaultSelected=!0)}else{for(o=""+ls(o),a=null,f=0;f<n.length;f++){if(n[f].value===o){n[f].selected=!0,l&&(n[f].defaultSelected=!0);return}a!==null||n[f].disabled||(a=n[f])}a!==null&&(a.selected=!0)}}function M1(n,a,o){if(a!=null&&(a=""+ls(a),a!==n.value&&(n.value=a),o==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=o!=null?""+ls(o):""}function D1(n,a,o,l){if(a==null){if(l!=null){if(o!=null)throw Error(r(92));if(Ae(l)){if(1<l.length)throw Error(r(93));l=l[0]}o=l}o==null&&(o=""),a=o}o=ls(a),n.defaultValue=o,l=n.textContent,l===o&&l!==""&&l!==null&&(n.value=l),hm(n)}function jo(n,a){if(a){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=a;return}}n.textContent=a}var BN=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function U1(n,a,o){var l=a.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?n.setProperty(a,""):a==="float"?n.cssFloat="":n[a]="":l?n.setProperty(a,o):typeof o!="number"||o===0||BN.has(a)?a==="float"?n.cssFloat=o:n[a]=(""+o).trim():n[a]=o+"px"}function B1(n,a,o){if(a!=null&&typeof a!="object")throw Error(r(62));if(n=n.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||a!=null&&a.hasOwnProperty(l)||(l.indexOf("--")===0?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="",dt=!0);for(var f in a)l=a[f],a.hasOwnProperty(f)&&o[f]!==l&&(U1(n,f,l),dt=!0)}else for(var h in a)a.hasOwnProperty(h)&&U1(n,h,a[h])}function gm(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var LN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),zN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ad(n){return zN.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function cr(){}var ym=null;function vm(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Mo=null,Do=null;function L1(n){var a=xo(n);if(a&&(n=a.stateNode)){var o=n[Xn]||null;e:switch(n=a.stateNode,a.type){case"input":if(pm(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),a=o.name,o.type==="radio"&&a!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+As(""+a)+'"][type="radio"]'),a=0;a<o.length;a++){var l=o[a];if(l!==n&&l.form===n.form){var f=l[Xn]||null;if(!f)throw Error(r(90));pm(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(a=0;a<o.length;a++)l=o[a],l.form===n.form&&R1(l)}break e;case"textarea":M1(n,o.value,o.defaultValue);break e;case"select":a=o.value,a!=null&&Ro(n,!!o.multiple,a,!1)}}}var bm=!1;function z1(n,a,o){if(bm)return n(a,o);bm=!0;try{var l=n(a);return l}finally{if(bm=!1,(Mo!==null||Do!==null)&&(Of(),Mo&&(a=Mo,n=Do,Do=Mo=null,L1(a),n)))for(a=0;a<n.length;a++)L1(n[a])}}function kl(n,a){var o=n.stateNode;if(o===null)return null;var l=o[Xn]||null;if(l===null)return null;o=l[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(r(231,a,typeof o));return o}var Br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wm=!1;if(Br)try{var Al={};Object.defineProperty(Al,"passive",{get:function(){wm=!0}}),window.addEventListener("test",Al,Al),window.removeEventListener("test",Al,Al)}catch{wm=!1}var Sa=null,Tm=null,Od=null;function $1(){if(Od)return Od;var n,a=Tm,o=a.length,l,f="value"in Sa?Sa.value:Sa.textContent,h=f.length;for(n=0;n<o&&a[n]===f[n];n++);var v=o-n;for(l=1;l<=v&&a[o-l]===f[h-l];l++);return Od=f.slice(n,1<l?1-l:void 0)}function Nd(n){var a=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&a===13&&(n=13)):n=a,n===10&&(n=13),32<=n||n===13?n:0}function xd(){return!0}function V1(){return!1}function $n(n){function a(o,l,f,h,v){this._reactName=o,this._targetInst=f,this.type=l,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var _ in n)n.hasOwnProperty(_)&&(o=n[_],this[_]=o?o(h):h[_]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?xd:V1,this.isPropagationStopped=V1,this}return J(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=xd)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=xd)},persist:function(){},isPersistent:xd}),a}var Ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cd=$n(Ea),Ol=J({},Ea,{view:0,detail:0}),$N=$n(Ol),Sm,Em,Nl,Id=J({},Ol,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:km,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Nl&&(Nl&&n.type==="mousemove"?(Sm=n.screenX-Nl.screenX,Em=n.screenY-Nl.screenY):Em=Sm=0,Nl=n),Sm)},movementY:function(n){return"movementY"in n?n.movementY:Em}}),P1=$n(Id),VN=J({},Id,{dataTransfer:0}),PN=$n(VN),GN=J({},Ol,{relatedTarget:0}),_m=$n(GN),FN=J({},Ea,{animationName:0,elapsedTime:0,pseudoElement:0}),HN=$n(FN),qN=J({},Ea,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),ZN=$n(qN),YN=J({},Ea,{data:0}),G1=$n(YN),WN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XN={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},KN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function JN(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=KN[n])?!!a[n]:!1}function km(){return JN}var QN=J({},Ol,{key:function(n){if(n.key){var a=WN[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=Nd(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?XN[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:km,charCode:function(n){return n.type==="keypress"?Nd(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Nd(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),ex=$n(QN),tx=J({},Id,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),F1=$n(tx),nx=J({},Ea,{submitter:0}),sx=$n(nx),rx=J({},Ol,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:km}),ax=$n(rx),ix=J({},Ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),ox=$n(ix),cx=J({},Id,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),lx=$n(cx),ux=J({},Ea,{newState:0,oldState:0,source:0}),dx=$n(ux),fx=[9,13,27,32],Am=Br&&"CompositionEvent"in window,xl=null;Br&&"documentMode"in document&&(xl=document.documentMode);var hx=Br&&"TextEvent"in window&&!xl,H1=Br&&(!Am||xl&&8<xl&&11>=xl),q1=" ",Z1=!1;function Y1(n,a){switch(n){case"keyup":return fx.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function W1(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Uo=!1;function px(n,a){switch(n){case"compositionend":return W1(a);case"keypress":return a.which!==32?null:(Z1=!0,q1);case"textInput":return n=a.data,n===q1&&Z1?null:n;default:return null}}function mx(n,a){if(Uo)return n==="compositionend"||!Am&&Y1(n,a)?(n=$1(),Od=Tm=Sa=null,Uo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return H1&&a.locale!=="ko"?null:a.data;default:return null}}var gx={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function X1(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!gx[n.type]:a==="textarea"}function K1(n,a,o,l){Mo?Do?Do.push(l):Do=[l]:Mo=l,a=jf(a,"onChange"),0<a.length&&(o=new Cd("onChange","change",null,o,l),n.push({event:o,listeners:a}))}var Cl=null,Il=null;function yx(n){L2(n,0)}function Rd(n){var a=_l(n);if(R1(a))return n}function J1(n,a){if(n==="change")return a}var Q1=!1;if(Br){var Om;if(Br){var Nm="oninput"in document;if(!Nm){var ew=document.createElement("div");ew.setAttribute("oninput","return;"),Nm=typeof ew.oninput=="function"}Om=Nm}else Om=!1;Q1=Om&&(!document.documentMode||9<document.documentMode)}function tw(){Cl&&(Cl.detachEvent("onpropertychange",nw),Il=Cl=null)}function nw(n){if(n.propertyName==="value"&&Rd(Il)){var a=[];K1(a,Il,n,vm(n)),z1(yx,a)}}function vx(n,a,o){n==="focusin"?(tw(),Cl=a,Il=o,Cl.attachEvent("onpropertychange",nw)):n==="focusout"&&tw()}function bx(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Rd(Il)}function wx(n,a){if(n==="click")return Rd(a)}function Tx(n,a){if(n==="input"||n==="change")return Rd(a)}function Sx(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var us=typeof Object.is=="function"?Object.is:Sx;function Rl(n,a){if(us(n,a))return!0;if(typeof n!="object"||n===null||typeof a!="object"||a===null)return!1;var o=Object.keys(n),l=Object.keys(a);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var f=o[l];if(!vl.call(a,f)||!us(n[f],a[f]))return!1}return!0}function xm(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function sw(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function rw(n,a){var o=sw(n);n=0;for(var l;o;){if(o.nodeType===3){if(l=n+o.textContent.length,n<=a&&l>=a)return{node:o,offset:a-n};n=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=sw(o)}}function aw(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?aw(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function iw(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=xm(n.document);a instanceof n.HTMLIFrameElement;){try{var o=typeof a.contentWindow.location.href=="string"}catch{o=!1}if(o)n=a.contentWindow;else break;a=xm(n.document)}return a}function Cm(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var Ex=Br&&"documentMode"in document&&11>=document.documentMode,Bo=null,Im=null,jl=null,Rm=!1;function ow(n,a,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Rm||Bo==null||Bo!==xm(l)||(l=Bo,"selectionStart"in l&&Cm(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),jl&&Rl(jl,l)||(jl=l,l=jf(Im,"onSelect"),0<l.length&&(a=new Cd("onSelect","select",null,a,o),n.push({event:a,listeners:l}),a.target=Bo)))}function ki(n,a){var o={};return o[n.toLowerCase()]=a.toLowerCase(),o["Webkit"+n]="webkit"+a,o["Moz"+n]="moz"+a,o}var Lo={animationend:ki("Animation","AnimationEnd"),animationiteration:ki("Animation","AnimationIteration"),animationstart:ki("Animation","AnimationStart"),transitionrun:ki("Transition","TransitionRun"),transitionstart:ki("Transition","TransitionStart"),transitioncancel:ki("Transition","TransitionCancel"),transitionend:ki("Transition","TransitionEnd")},jm={},cw={};Br&&(cw=document.createElement("div").style,"AnimationEvent"in window||(delete Lo.animationend.animation,delete Lo.animationiteration.animation,delete Lo.animationstart.animation),"TransitionEvent"in window||delete Lo.transitionend.transition);function Ai(n){if(jm[n])return jm[n];if(!Lo[n])return n;var a=Lo[n],o;for(o in a)if(a.hasOwnProperty(o)&&o in cw)return jm[n]=a[o];return n}var lw=Ai("animationend"),uw=Ai("animationiteration"),dw=Ai("animationstart"),_x=Ai("transitionrun"),kx=Ai("transitionstart"),Ax=Ai("transitioncancel"),fw=Ai("transitionend"),hw=new Map,Mm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Mm.push("scrollEnd");function Fs(n,a){hw.set(n,a),_i(a,[n])}var Ox=0;function Lr(n,a){if(n.name!=null&&n.name!=="auto")return n.name;if(a.autoName!==null)return a.autoName;n=Ys.identifierPrefix;var o=Ox++;return n="_"+n+"t_"+o.toString(32)+"_",a.autoName=n}function pw(n){if(n==null||typeof n=="string")return n;var a=null,o=rc;if(o!==null)for(var l=0;l<o.length;l++){var f=n[o[l]];if(f!=null){if(f==="none")return"none";a=a==null?f:a+(" "+f)}}return a??n.default}function zr(n,a){return n=pw(n),a=pw(a),a==null?n==="auto"?null:n:a==="auto"?null:a}var jd=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Os=[],zo=0,Dm=0;function Md(){for(var n=zo,a=Dm=zo=0;a<n;){var o=Os[a];Os[a++]=null;var l=Os[a];Os[a++]=null;var f=Os[a];Os[a++]=null;var h=Os[a];if(Os[a++]=null,l!==null&&f!==null){var v=l.pending;v===null?f.next=f:(f.next=v.next,v.next=f),l.pending=f}h!==0&&mw(o,f,h)}}function Dd(n,a,o,l){Os[zo++]=n,Os[zo++]=a,Os[zo++]=o,Os[zo++]=l,Dm|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function Um(n,a,o,l){return Dd(n,a,o,l),Ud(n)}function Oi(n,a){return Dd(n,null,null,a),Ud(n)}function mw(n,a,o){n.lanes|=o;var l=n.alternate;l!==null&&(l.lanes|=o);for(var f=!1,h=n.return;h!==null;)h.childLanes|=o,l=h.alternate,l!==null&&(l.childLanes|=o),h.tag===22&&(n=h.stateNode,n===null||n._visibility&1||(f=!0)),n=h,h=h.return;return n.tag===3?(h=n.stateNode,f&&a!==null&&(f=31-cs(o),n=h.hiddenUpdates,l=n[f],l===null?n[f]=[a]:l.push(a),a.lane=o|536870912),h):null}function Ud(n){if(50<tu)throw tu=0,Af=null,Error(r(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var $o={};function Nx(n,a,o,l){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kn(n,a,o,l){return new Nx(n,a,o,l)}function Bm(n){return n=n.prototype,!(!n||!n.isReactComponent)}function $r(n,a){var o=n.alternate;return o===null?(o=Kn(n.tag,a,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=a,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&1206910976,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,a=n.dependencies,o.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function gw(n,a){n.flags&=1206910978;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=a,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,a=o.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),n}function Bd(n,a,o,l,f,h){var v=0;if(l=n,typeof l=="function")Bm(l)&&(v=1);else if(typeof l=="string")v=n6(n,o,le.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(l){case P:return n=Kn(31,o,a,f),n.elementType=P,n.lanes=h,n;case F:return Ni(o.children,f,h,a);case B:v=8,f|=24;break;case q:return n=Kn(12,o,a,f|2),n.elementType=q,n.lanes=h,n;case j:return n=Kn(13,o,a,f),n.elementType=j,n.lanes=h,n;case U:return n=Kn(19,o,a,f),n.elementType=U,n.lanes=h,n;case re:case I:return n=f|32,n=Kn(30,o,a,n),n.elementType=I,n.lanes=h,n.stateNode={autoName:null,paired:null,clones:null,ref:null},n;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case D:v=10;break e;case z:v=9;break e;case k:v=11;break e;case V:v=14;break e;case K:v=16,l=null;break e}v=29,o=Error(r(130,n===null?"null":typeof n,"")),l=null}return a=Kn(v,o,a,f),a.elementType=n,a.type=l,a.lanes=h,a}function Ni(n,a,o,l){return n=Kn(7,n,l,a),n.lanes=o,n}function Lm(n,a,o){return n=Kn(6,n,null,a),n.lanes=o,n}function yw(n){var a=Kn(18,null,null,0);return a.stateNode=n,a}function zm(n,a,o){return a=Kn(4,n.children!==null?n.children:[],n.key,a),a.lanes=o,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var vw=new WeakMap;function Ns(n,a){if(typeof n=="object"&&n!==null){var o=vw.get(n);return o!==void 0?o:(a={value:n,source:a,stack:gd(a)},vw.set(n,a),a)}return{value:n,source:a,stack:gd(a)}}var Vo=[],Po=0,Ld=null,Ml=0,xs=[],Cs=0,_a=null,lr=1,ur="";function Vr(n,a){Vo[Po++]=Ml,Vo[Po++]=Ld,Ld=n,Ml=a}function bw(n,a,o){xs[Cs++]=lr,xs[Cs++]=ur,xs[Cs++]=_a,_a=n;var l=lr;n=ur;var f=32-cs(l)-1;l&=~(1<<f),o+=1;var h=32-cs(a)+f;if(30<h){var v=f-f%5;h=(l&(1<<v)-1).toString(32),l>>=v,f-=v,lr=1<<32-cs(a)+f|o<<f|l,ur=h+n}else lr=1<<h|o<<f|l,ur=n}function zd(n){n.return!==null&&(Vr(n,1),bw(n,1,0))}function $m(n){for(;n===Ld;)Ld=Vo[--Po],Vo[Po]=null,Ml=Vo[--Po],Vo[Po]=null;for(;n===_a;)_a=xs[--Cs],xs[Cs]=null,ur=xs[--Cs],xs[Cs]=null,lr=xs[--Cs],xs[Cs]=null}function ww(n,a){xs[Cs++]=lr,xs[Cs++]=ur,xs[Cs++]=_a,lr=a.id,ur=a.overflow,_a=n}var yn=null,Rt=null,Qe=!1,ka=null,Is=!1,Vm=Error(r(519));function Aa(n){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Dl(Ns(a,n)),Vm}function Tw(n){var a=n.stateNode,o=n.type,l=n.memoizedProps;switch(a[_n]=n,a[Xn]=l,o){case"dialog":nt("cancel",a),nt("close",a);break;case"iframe":case"object":case"embed":nt("load",a);break;case"video":case"audio":for(o=0;o<su.length;o++)nt(su[o],a);break;case"source":nt("error",a);break;case"img":case"image":case"link":nt("error",a),nt("load",a);break;case"details":nt("toggle",a);break;case"input":nt("invalid",a),j1(a,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":nt("invalid",a);break;case"textarea":nt("invalid",a),D1(a,l.value,l.defaultValue,l.children)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||a.textContent===""+o||l.suppressHydrationWarning===!0||P2(a.textContent,o)?(l.popover!=null&&(nt("beforetoggle",a),nt("toggle",a)),l.onScroll!=null&&nt("scroll",a),l.onScrollEnd!=null&&nt("scrollend",a),l.onClick!=null&&(a.onclick=cr),a=!0):a=!1,a||Aa(n,!0)}function $d(n){for(yn=n.return;yn;)switch(yn.tag){case 5:case 31:case 13:Is=!1;return;case 27:case 3:Is=!0;return;default:yn=yn.return}}function Go(n){if(n!==yn)return!1;if(!Qe)return $d(n),Qe=!0,!1;var a=n.tag,o;if((o=a!==3&&a!==27)&&((o=a===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||y0(n.type,n.memoizedProps)),o=!o),o&&Rt&&Aa(n),$d(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));Rt=oS(n)}else if(a===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));Rt=oS(n)}else a===27?(a=Rt,Pa(n.type)?(n=A0,A0=null,Rt=n):Rt=a):Rt=yn?js(n.stateNode.nextSibling):null;return!0}function xi(){Rt=yn=null,Qe=!1}function Pm(){var n=ka;return n!==null&&(es===null?es=n:es.push.apply(es,n),ka=null),n}function Dl(n){ka===null?ka=[n]:ka.push(n)}var Gm=te(null),Ci=null,Pr=null;function Oa(n,a,o){fe(Gm,a._currentValue),a._currentValue=o}function Gr(n){n._currentValue=Gm.current,de(Gm)}function Vd(n,a,o){for(;n!==null;){var l=n.alternate;if((n.childLanes&a)!==a?(n.childLanes|=a,l!==null&&(l.childLanes|=a)):l!==null&&(l.childLanes&a)!==a&&(l.childLanes|=a),n===o)break;n=n.return}}function Fm(n,a,o,l){var f=n.child;for(f!==null&&(f.return=n);f!==null;){var h=f.dependencies;if(h!==null){var v=f.child;h=h.firstContext;e:for(;h!==null;){var _=h;h=f;for(var L=0;L<a.length;L++)if(_.context===a[L]){h.lanes|=o,_=h.alternate,_!==null&&(_.lanes|=o),Vd(h.return,o,n),l||(v=null);break e}h=_.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=o,h=v.alternate,h!==null&&(h.lanes|=o),Vd(v,o,n),v=null}else f.tag===13&&f.memoizedState!==null&&f.memoizedState.dehydrated===null?(f.lanes|=o,v=f.alternate,v!==null&&(v.lanes|=o),Vd(f.return,o,n),v=f.child,v=v!==null?v.sibling:null):v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===n){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function Ii(n,a,o,l){n=null;for(var f=a,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var _=f.type;us(f.pendingProps.value,v.value)||(n!==null?n.push(_):n=[_])}}else if(f===Dt.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(n!==null?n.push(pc):n=[pc])}f=f.return}return n!==null&&Fm(a,n,o,l),a.flags|=262144,n!==null}function Pd(n){for(n=n.firstContext;n!==null;){if(!us(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ri(n){Ci=n,Pr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function kn(n){return Sw(Ci,n)}function Gd(n,a){return Ci===null&&Ri(n),Sw(n,a)}function Sw(n,a){var o=a._currentValue;if(a={context:a,memoizedValue:o,next:null},Pr===null){if(n===null)throw Error(r(308));Pr=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else Pr=Pr.next=a;return o}var xx=typeof AbortController<"u"?AbortController:function(){var n=[],a=this.signal={aborted:!1,addEventListener:function(o,l){n.push(l)}};this.abort=function(){a.aborted=!0,n.forEach(function(o){return o()})}},Cx=e.unstable_scheduleCallback,Ix=e.unstable_NormalPriority,Jt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hm(){return{controller:new xx,data:new Map,refCount:0}}function Ul(n){n.refCount--,n.refCount===0&&Cx(Ix,function(){n.controller.abort()})}function Ew(n,a){if((n.pendingLanes&4194048)!==0){var o=n.transitionTypes;for(o===null&&(o=n.transitionTypes=[]),n=0;n<a.length;n++){var l=a[n];o.indexOf(l)===-1&&o.push(l)}}}var Bl=null;function Rx(n){var a=n.transitionTypes;return n.transitionTypes=null,a}var Ll=null,qm=0,ji=0,Fo=null;function jx(n,a){if(Ll===null){var o=Ll=[];qm=0,ji=c0(),Fo={status:"pending",value:void 0,then:function(l){o.push(l)}}}return qm++,a.then(_w,_w),a}function _w(){if(--qm===0&&(Bl=null,Ll!==null)){Fo!==null&&(Fo.status="fulfilled");var n=Ll;Ll=null,ji=0,Fo=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function Mx(n,a){var o=[],l={status:"pending",value:null,reason:null,then:function(f){o.push(f)}};return n.then(function(){l.status="fulfilled",l.value=a;for(var f=0;f<o.length;f++)(0,o[f])(a)},function(f){for(l.status="rejected",l.reason=f,f=0;f<o.length;f++)(0,o[f])(void 0)}),l}var kw=be.S;be.S=function(n,a){if(y2=zn(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&jx(n,a),Bl!==null)for(var o=cc;o!==null;)Ew(o,Bl),o=o.next;if(o=n.types,o!==null){for(var l=cc;l!==null;)Ew(l,o),l=l.next;if(ji!==0){l=Bl,l===null&&(l=Bl=[]);for(var f=0;f<o.length;f++){var h=o[f];l.indexOf(h)===-1&&l.push(h)}}}kw!==null&&kw(n,a)};var Mi=te(null);function Zm(){var n=Mi.current;return n!==null?n:xt.pooledCache}function Fd(n,a){a===null?fe(Mi,Mi.current):fe(Mi,a.pool)}function Aw(){var n=Zm();return n===null?null:{parent:Jt._currentValue,pool:n}}var Ho=Error(r(460)),Ym=Error(r(474)),Hd=Error(r(542)),qd={then:function(){}};function Ow(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Nw(n,a,o){switch(o=n[o],o===void 0?n.push(a):o!==a&&(a.then(cr,cr),a=o),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,Cw(n),n===void 0&&!("reason"in a)?Error(r(600)):n;default:if(typeof a.status=="string")a.then(cr,cr);else{if(n=xt,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=a,n.status="pending",n.then(function(l){if(a.status==="pending"){var f=a;f.status="fulfilled",f.value=l}},function(l){if(a.status==="pending"){var f=a;f.status="rejected",f.reason=l}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,Cw(n),n}throw Ui=a,Ho}}function Di(n){try{var a=n._init;return a(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Ui=o,Ho):o}}var Ui=null;function xw(){if(Ui===null)throw Error(r(459));var n=Ui;return Ui=null,n}function Cw(n){if(n===Ho||n===Hd)throw Error(r(483))}var qo=null,zl=0;function Zd(n){var a=zl;return zl+=1,qo===null&&(qo=[]),Nw(qo,n,a)}function Na(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function Yd(n,a){throw a.$$typeof===w?Error(r(525)):(n=Object.prototype.toString.call(a),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":n)))}function Iw(n){function a(ee,Z){if(n){var se=ee.deletions;se===null?(ee.deletions=[Z],ee.flags|=16):se.push(Z)}}function o(ee,Z){if(!n)return null;for(;Z!==null;)a(ee,Z),Z=Z.sibling;return null}function l(ee){for(var Z=new Map;ee!==null;)ee.key===null?Z.set(ee.index,ee):Z.set(ee.key,ee),ee=ee.sibling;return Z}function f(ee,Z){return ee=$r(ee,Z),ee.index=0,ee.sibling=null,ee}function h(ee,Z,se){return ee.index=se,n?(se=ee.alternate,se!==null?(se=se.index,se<Z?(ee.flags|=2,Z):se):(ee.flags|=134217730,Z)):(ee.flags|=1048576,Z)}function v(ee){return n&&ee.alternate===null&&(ee.flags|=134217730),ee}function _(ee,Z,se,pe){return Z===null||Z.tag!==6?(Z=Lm(se,ee.mode,pe),Z.return=ee,Z):(Z=f(Z,se),Z.return=ee,Z)}function L(ee,Z,se,pe){var Ie=se.type;return Ie===F?(ee=ie(ee,Z,se.props.children,pe,se.key),Na(ee,se),ee):Z!==null&&(Z.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===K&&Di(Ie)===Z.type)?(Z=f(Z,se.props),Na(Z,se),Z.return=ee,Z):(Z=Bd(se.type,se.key,se.props,null,ee.mode,pe),Na(Z,se),Z.return=ee,Z)}function ne(ee,Z,se,pe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==se.containerInfo||Z.stateNode.implementation!==se.implementation?(Z=zm(se,ee.mode,pe),Z.return=ee,Z):(Z=f(Z,se.children||[]),Z.return=ee,Z)}function ie(ee,Z,se,pe,Ie){return Z===null||Z.tag!==7?(Z=Ni(se,ee.mode,pe,Ie),Z.return=ee,Z):(Z=f(Z,se),Z.return=ee,Z)}function ge(ee,Z,se){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Lm(""+Z,ee.mode,se),Z.return=ee,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case A:return se=Bd(Z.type,Z.key,Z.props,null,ee.mode,se),Na(se,Z),se.return=ee,se;case N:return Z=zm(Z,ee.mode,se),Z.return=ee,Z;case K:return Z=Di(Z),ge(ee,Z,se)}if(Ae(Z)||he(Z))return Z=Ni(Z,ee.mode,se,null),Z.return=ee,Z;if(typeof Z.then=="function")return ge(ee,Zd(Z),se);if(Z.$$typeof===D)return ge(ee,Gd(ee,Z),se);Yd(ee,Z)}return null}function Q(ee,Z,se,pe){var Ie=Z!==null?Z.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Ie!==null?null:_(ee,Z,""+se,pe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case A:return se.key===Ie?L(ee,Z,se,pe):null;case N:return se.key===Ie?ne(ee,Z,se,pe):null;case K:return se=Di(se),Q(ee,Z,se,pe)}if(Ae(se)||he(se))return Ie!==null?null:ie(ee,Z,se,pe,null);if(typeof se.then=="function")return Q(ee,Z,Zd(se),pe);if(se.$$typeof===D)return Q(ee,Z,Gd(ee,se),pe);Yd(ee,se)}return null}function ae(ee,Z,se,pe,Ie){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ee=ee.get(se)||null,_(Z,ee,""+pe,Ie);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case A:return ee=ee.get(pe.key===null?se:pe.key)||null,L(Z,ee,pe,Ie);case N:return ee=ee.get(pe.key===null?se:pe.key)||null,ne(Z,ee,pe,Ie);case K:return pe=Di(pe),ae(ee,Z,se,pe,Ie)}if(Ae(pe)||he(pe))return ee=ee.get(se)||null,ie(Z,ee,pe,Ie,null);if(typeof pe.then=="function")return ae(ee,Z,se,Zd(pe),Ie);if(pe.$$typeof===D)return ae(ee,Z,se,Gd(Z,pe),Ie);Yd(Z,pe)}return null}function ke(ee,Z,se,pe){for(var Ie=null,ot=null,Ue=Z,Ve=Z=0,tn=null;Ue!==null&&Ve<se.length;Ve++){Ue.index>Ve?(tn=Ue,Ue=null):tn=Ue.sibling;var ut=Q(ee,Ue,se[Ve],pe);if(ut===null){Ue===null&&(Ue=tn);break}n&&Ue&&ut.alternate===null&&a(ee,Ue),Z=h(ut,Z,Ve),ot===null?Ie=ut:ot.sibling=ut,ot=ut,Ue=tn}if(Ve===se.length)return o(ee,Ue),Qe&&Vr(ee,Ve),Ie;if(Ue===null){for(;Ve<se.length;Ve++)Ue=ge(ee,se[Ve],pe),Ue!==null&&(Z=h(Ue,Z,Ve),ot===null?Ie=Ue:ot.sibling=Ue,ot=Ue);return Qe&&Vr(ee,Ve),Ie}for(Ue=l(Ue);Ve<se.length;Ve++)tn=ae(Ue,ee,Ve,se[Ve],pe),tn!==null&&(n&&(ut=tn.alternate,ut!==null&&Ue.delete(ut.key===null?Ve:ut.key)),Z=h(tn,Z,Ve),ot===null?Ie=tn:ot.sibling=tn,ot=tn);return n&&Ue.forEach(function(Za){return a(ee,Za)}),Qe&&Vr(ee,Ve),Ie}function Re(ee,Z,se,pe){if(se==null)throw Error(r(151));for(var Ie=null,ot=null,Ue=Z,Ve=Z=0,tn=null,ut=se.next();Ue!==null&&!ut.done;Ve++,ut=se.next()){Ue.index>Ve?(tn=Ue,Ue=null):tn=Ue.sibling;var Za=Q(ee,Ue,ut.value,pe);if(Za===null){Ue===null&&(Ue=tn);break}n&&Ue&&Za.alternate===null&&a(ee,Ue),Z=h(Za,Z,Ve),ot===null?Ie=Za:ot.sibling=Za,ot=Za,Ue=tn}if(ut.done)return o(ee,Ue),Qe&&Vr(ee,Ve),Ie;if(Ue===null){for(;!ut.done;Ve++,ut=se.next())ut=ge(ee,ut.value,pe),ut!==null&&(Z=h(ut,Z,Ve),ot===null?Ie=ut:ot.sibling=ut,ot=ut);return Qe&&Vr(ee,Ve),Ie}for(Ue=l(Ue);!ut.done;Ve++,ut=se.next())ut=ae(Ue,ee,Ve,ut.value,pe),ut!==null&&(n&&(tn=ut.alternate,tn!==null&&Ue.delete(tn.key===null?Ve:tn.key)),Z=h(ut,Z,Ve),ot===null?Ie=ut:ot.sibling=ut,ot=ut);return n&&Ue.forEach(function(p6){return a(ee,p6)}),Qe&&Vr(ee,Ve),Ie}function Xe(ee,Z,se,pe){if(typeof se=="object"&&se!==null&&se.type===F&&se.key===null&&se.props.ref===void 0&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case A:e:{for(var Ie=se.key;Z!==null;){if(Z.key===Ie){if(Ie=se.type,Ie===F){if(Z.tag===7){o(ee,Z.sibling),pe=f(Z,se.props.children),Na(pe,se),pe.return=ee,ee=pe;break e}}else if(Z.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===K&&Di(Ie)===Z.type){o(ee,Z.sibling),pe=f(Z,se.props),Na(pe,se),pe.return=ee,ee=pe;break e}o(ee,Z);break}else a(ee,Z);Z=Z.sibling}se.type===F?(pe=Ni(se.props.children,ee.mode,pe,se.key),Na(pe,se),pe.return=ee,ee=pe):(pe=Bd(se.type,se.key,se.props,null,ee.mode,pe),Na(pe,se),pe.return=ee,ee=pe)}return v(ee);case N:e:{for(Ie=se.key;Z!==null;){if(Z.key===Ie)if(Z.tag===4&&Z.stateNode.containerInfo===se.containerInfo&&Z.stateNode.implementation===se.implementation){o(ee,Z.sibling),pe=f(Z,se.children||[]),pe.return=ee,ee=pe;break e}else{o(ee,Z);break}else a(ee,Z);Z=Z.sibling}pe=zm(se,ee.mode,pe),pe.return=ee,ee=pe}return v(ee);case K:return se=Di(se),Xe(ee,Z,se,pe)}if(Ae(se))return ke(ee,Z,se,pe);if(he(se)){if(Ie=he(se),typeof Ie!="function")throw Error(r(150));return se=Ie.call(se),Re(ee,Z,se,pe)}if(typeof se.then=="function")return Xe(ee,Z,Zd(se),pe);if(se.$$typeof===D)return Xe(ee,Z,Gd(ee,se),pe);Yd(ee,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,Z!==null&&Z.tag===6?(o(ee,Z.sibling),pe=f(Z,se),pe.return=ee,ee=pe):(o(ee,Z),pe=Lm(se,ee.mode,pe),pe.return=ee,ee=pe),v(ee)):o(ee,Z)}return function(ee,Z,se,pe){try{zl=0;var Ie=Xe(ee,Z,se,pe);return qo=null,Ie}catch(Ue){if(Ue===Ho||Ue===Hd)throw Ue;var ot=Kn(29,Ue,null,ee.mode);return ot.lanes=pe,ot.return=ee,ot}}}var Bi=Iw(!0),Rw=Iw(!1),xa=!1;function Wm(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xm(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Ca(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ia(n,a,o){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(ht&2)!==0){var f=l.pending;return f===null?a.next=a:(a.next=f.next,f.next=a),l.pending=a,a=Ud(n),mw(n,null,o),a}return Dd(n,l,a,o),Ud(n)}function $l(n,a,o){if(a=a.updateQueue,a!==null&&(a=a.shared,(o&4194048)!==0)){var l=a.lanes;l&=n.pendingLanes,o|=l,a.lanes=o,b1(n,o)}}function Km(n,a){var o=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var f=null,h=null;if(o=o.firstBaseUpdate,o!==null){do{var v={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,o=o.next}while(o!==null);h===null?f=h=a:h=h.next=a}else f=h=a;o={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=a:n.next=a,o.lastBaseUpdate=a}var Jm=!1;function Vl(){if(Jm){var n=Fo;if(n!==null)throw n}}function Pl(n,a,o,l){Jm=!1;var f=n.updateQueue;xa=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,_=f.shared.pending;if(_!==null){f.shared.pending=null;var L=_,ne=L.next;L.next=null,v===null?h=ne:v.next=ne,v=L;var ie=n.alternate;ie!==null&&(ie=ie.updateQueue,_=ie.lastBaseUpdate,_!==v&&(_===null?ie.firstBaseUpdate=ne:_.next=ne,ie.lastBaseUpdate=L))}if(h!==null){var ge=f.baseState;v=0,ie=ne=L=null,_=h;do{var Q=_.lane&-536870913,ae=Q!==_.lane;if(ae?(it&Q)===Q:(l&Q)===Q){Q!==0&&Q===ji&&(Jm=!0),ie!==null&&(ie=ie.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ke=n,Re=_;Q=a;var Xe=o;switch(Re.tag){case 1:if(ke=Re.payload,typeof ke=="function"){ge=ke.call(Xe,ge,Q);break e}ge=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Re.payload,Q=typeof ke=="function"?ke.call(Xe,ge,Q):ke,Q==null)break e;ge=J({},ge,Q);break e;case 2:xa=!0}}Q=_.callback,Q!==null&&(n.flags|=64,ae&&(n.flags|=8192),ae=f.callbacks,ae===null?f.callbacks=[Q]:ae.push(Q))}else ae={lane:Q,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ie===null?(ne=ie=ae,L=ge):ie=ie.next=ae,v|=Q;if(_=_.next,_===null){if(_=f.shared.pending,_===null)break;ae=_,_=ae.next,ae.next=null,f.lastBaseUpdate=ae,f.shared.pending=null}}while(!0);ie===null&&(L=ge),f.baseState=L,f.firstBaseUpdate=ne,f.lastBaseUpdate=ie,h===null&&(f.shared.lanes=0),La|=v,n.lanes=v,n.memoizedState=ge}}function jw(n,a){if(typeof n!="function")throw Error(r(191,n));n.call(a)}function Mw(n,a){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)jw(o[n],a)}var Ra=te(null),Wd=te(0);function Dw(n,a){n=Yr,fe(Wd,n),fe(Ra,a),Yr=n|a.baseLanes}function Qm(){fe(Wd,Yr),fe(Ra,Ra.current)}function eg(){Yr=Wd.current,de(Ra),de(Wd)}var An=te(null),Dn=null;function ja(n){var a=n.alternate;fe(On,On.current&1),fe(An,n),Dn===null&&(a===null||Ra.current!==null||a.memoizedState!==null)&&(Dn=n)}function tg(n){fe(On,On.current),fe(An,n),Dn===null&&(Dn=n)}function Uw(n){n.tag===22?(fe(On,On.current),fe(An,n),Dn===null&&(Dn=n)):Ma()}function Ma(){fe(On,On.current),fe(An,An.current)}function ds(n){de(An),Dn===n&&(Dn=null),de(On)}var On=te(0);function Gl(n,a){fe(An,An.current),fe(On,a)}function ng(n){de(On),de(An),Dn===n&&(Dn=null)}function Xd(n){for(var a=n;a!==null;){if(a.tag===13){var o=a.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||_0(o)||k0(o)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!=="independent"){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Fr=0,We=null,kt=null,Qt=null,Kd=!1,Zo=!1,Li=!1,Jd=0,Fl=0,Yo=null,Dx=0;function Vt(){throw Error(r(321))}function sg(n,a){if(a===null)return!1;for(var o=0;o<a.length&&o<n.length;o++)if(!us(n[o],a[o]))return!1;return!0}function rg(n,a,o,l,f,h){return Fr=h,We=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,be.H=n===null||n.memoizedState===null?bT:wT,Li=!1,h=o(l,f),Li=!1,Zo&&(h=Lw(a,o,l,f)),Bw(n),h}function Bw(n){be.H=af;var a=kt!==null&&kt.next!==null;if(Fr=0,Qt=kt=We=null,Kd=!1,Fl=0,Yo=null,a)throw Error(r(300));n===null||en||(n=n.dependencies,n!==null&&Pd(n)&&(en=!0))}function Lw(n,a,o,l){We=n;var f=0;do{if(Zo&&(Yo=null),Fl=0,Zo=!1,25<=f)throw Error(r(301));if(f+=1,Qt=kt=null,n.updateQueue!=null){var h=n.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}be.H=Gx,h=a(o,l)}while(Zo);return h}function Ux(){var n=be.H,a=n.useState()[0];return a=typeof a.then=="function"?Hl(a):a,n=n.useState()[0],(kt!==null?kt.memoizedState:null)!==n&&(We.flags|=1024),a}function ag(){var n=Jd!==0;return Jd=0,n}function ig(n,a,o){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~o}function og(n){if(Kd){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Kd=!1}Fr=0,Qt=kt=We=null,Zo=!1,Fl=Jd=0,Yo=null}function Vn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?We.memoizedState=Qt=n:Qt=Qt.next=n,Qt}function Yt(){if(kt===null){var n=We.alternate;n=n!==null?n.memoizedState:null}else n=kt.next;var a=Qt===null?We.memoizedState:Qt.next;if(a!==null)Qt=a,kt=n;else{if(n===null)throw We.alternate===null?Error(r(467)):Error(r(310));kt=n,n={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},Qt===null?We.memoizedState=Qt=n:Qt=Qt.next=n}return Qt}function Qd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hl(n){var a=Fl;return Fl+=1,Yo===null&&(Yo=[]),n=Nw(Yo,n,a),a=We,(Qt===null?a.memoizedState:Qt.next)===null&&(a=a.alternate,be.H=a===null||a.memoizedState===null?bT:wT),n}function ef(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Hl(n);if(n.$$typeof===X)return;if(n.$$typeof===D)return kn(n)}throw Error(r(438,String(n)))}function cg(n){var a=null,o=We.updateQueue;if(o!==null&&(a=o.memoCache),a==null){var l=We.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(a={data:l.data.map(function(f){return f.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),o===null&&(o=Qd(),We.updateQueue=o),o.memoCache=a,o=a.data[a.index],o===void 0)for(o=a.data[a.index]=Array(n),l=0;l<n;l++)o[l]=ue;return a.index++,o}function Hr(n,a){return typeof a=="function"?a(n):a}function tf(n){var a=Yt();return lg(a,kt,n)}function lg(n,a,o){var l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=o;var f=n.baseQueue,h=l.pending;if(h!==null){if(f!==null){var v=f.next;f.next=h.next,h.next=v}a.baseQueue=f=h,l.pending=null}if(h=n.baseState,f===null)n.memoizedState=h;else{a=f.next;var _=v=null,L=null,ne=a,ie=!1;do{var ge=ne.lane&-536870913;if(ge!==ne.lane?(it&ge)===ge:(Fr&ge)===ge){var Q=ne.revertLane;if(Q===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ge===ji&&(ie=!0);else if((Fr&Q)===Q){ne=ne.next,Q===ji&&(ie=!0);continue}else ge={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},L===null?(_=L=ge,v=h):L=L.next=ge,We.lanes|=Q,La|=Q;ge=ne.action,Li&&o(h,ge),h=ne.hasEagerState?ne.eagerState:o(h,ge)}else Q={lane:ge,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},L===null?(_=L=Q,v=h):L=L.next=Q,We.lanes|=ge,La|=ge;ne=ne.next}while(ne!==null&&ne!==a);if(L===null?v=h:L.next=_,!us(h,n.memoizedState)&&(en=!0,ie&&(o=Fo,o!==null)))throw o;n.memoizedState=h,n.baseState=v,n.baseQueue=L,l.lastRenderedState=h}return f===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function ug(n){var a=Yt(),o=a.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=n;var l=o.dispatch,f=o.pending,h=a.memoizedState;if(f!==null){o.pending=null;var v=f=f.next;do h=n(h,v.action),v=v.next;while(v!==f);us(h,a.memoizedState)||(en=!0),a.memoizedState=h,a.baseQueue===null&&(a.baseState=h),o.lastRenderedState=h}return[h,l]}function zw(n,a,o){var l=We,f=Yt(),h=Qe;if(h){if(o===void 0)throw Error(r(407));o=o()}else o=a();var v=!us((kt||f).memoizedState,o);if(v&&(f.memoizedState=o,en=!0),f=f.queue,hg(Pw.bind(null,l,f,n),[n]),n=f.getSnapshot!==a||v||Qt!==null&&(Qt.memoizedState.tag&1)!==0,Wo(n?9:8,{destroy:void 0},Vw.bind(null,l,f,o,a),null),n){if(l.flags|=2048,xt===null)throw Error(r(349));h||(Fr&127)!==0||$w(l,a,o)}return o}function $w(n,a,o){n.flags|=16384,n={getSnapshot:a,value:o},a=We.updateQueue,a===null?(a=Qd(),We.updateQueue=a,a.stores=[n]):(o=a.stores,o===null?a.stores=[n]:o.push(n))}function Vw(n,a,o,l){a.value=o,a.getSnapshot=l,Gw(a)&&Fw(n)}function Pw(n,a,o){return o(function(){Gw(a)&&Fw(n)})}function Gw(n){var a=n.getSnapshot;n=n.value;try{var o=a();return!us(n,o)}catch{return!0}}function Fw(n){var a=Oi(n,2);a!==null&&ts(a,n,2)}function dg(n){var a=Vn();if(typeof n=="function"){var o=n;if(n=o(),Li){Ta(!0);try{o()}finally{Ta(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:n},a}function Hw(n,a,o,l){return n.baseState=o,lg(n,kt,typeof l=="function"?l:Hr)}function Bx(n,a,o,l,f){if(rf(n))throw Error(r(485));if(n=a.action,n!==null){var h={payload:f,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};be.T!==null?o(!0):h.isTransition=!1,l(h),o=a.pending,o===null?(h.next=a.pending=h,qw(a,h)):(h.next=o.next,a.pending=o.next=h)}}function qw(n,a){var o=a.action,l=a.payload,f=n.state;if(a.isTransition){var h=be.T,v={};v.types=h!==null?h.types:null,be.T=v;try{var _=o(f,l),L=be.S;L!==null&&L(v,_),Zw(n,a,_)}catch(ne){fg(n,a,ne)}finally{h!==null&&v.types!==null&&(h.types=v.types),be.T=h}}else try{h=o(f,l),Zw(n,a,h)}catch(ne){fg(n,a,ne)}}function Zw(n,a,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){Yw(n,a,l)},function(l){return fg(n,a,l)}):Yw(n,a,o)}function Yw(n,a,o){a.status="fulfilled",a.value=o,Ww(a),n.state=o,a=n.pending,a!==null&&(o=a.next,o===a?n.pending=null:(o=o.next,a.next=o,qw(n,o)))}function fg(n,a,o){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do a.status="rejected",a.reason=o,Ww(a),a=a.next;while(a!==l)}n.action=null}function Ww(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function Xw(n,a){return a}function Kw(n,a){if(Qe){var o=xt.formState;if(o!==null){e:{var l=We;if(Qe){if(Rt){t:{for(var f=Rt,h=Is;f.nodeType!==8;){if(!h){f=null;break t}if(f=js(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){Rt=js(f.nextSibling),l=f.data==="F!";break e}}Aa(l)}l=!1}l&&(a=o[0])}}return o=Vn(),o.memoizedState=o.baseState=a,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xw,lastRenderedState:a},o.queue=l,o=gT.bind(null,We,l),l.dispatch=o,l=dg(!1),h=vg.bind(null,We,!1,l.queue),l=Vn(),f={state:a,dispatch:null,action:n,pending:null},l.queue=f,o=Bx.bind(null,We,f,h,o),f.dispatch=o,l.memoizedState=n,[a,o,!1]}function Jw(n){var a=Yt();return Qw(a,kt,n)}function Qw(n,a,o){if(a=lg(n,a,Xw)[0],n=tf(Hr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var l=Hl(a)}catch(v){throw v===Ho?Hd:v}else l=a;a=Yt();var f=a.queue,h=f.dispatch;return o!==a.memoizedState&&(We.flags|=2048,Wo(9,{destroy:void 0},Lx.bind(null,f,o),null)),[l,h,n]}function Lx(n,a){n.action=a}function eT(n){var a=Yt(),o=kt;if(o!==null)return Qw(a,o,n);Yt(),a=a.memoizedState,o=Yt();var l=o.queue.dispatch;return o.memoizedState=n,[a,l,!1]}function Wo(n,a,o,l){return n={tag:n,create:o,deps:l,inst:a,next:null},a=We.updateQueue,a===null&&(a=Qd(),We.updateQueue=a),o=a.lastEffect,o===null?a.lastEffect=n.next=n:(l=o.next,o.next=n,n.next=l,a.lastEffect=n),n}function tT(){return Yt().memoizedState}function nf(n,a,o,l){var f=Vn();We.flags|=n,f.memoizedState=Wo(1|a,{destroy:void 0},o,l===void 0?null:l)}function sf(n,a,o,l){var f=Yt();l=l===void 0?null:l;var h=f.memoizedState.inst;kt!==null&&l!==null&&sg(l,kt.memoizedState.deps)?f.memoizedState=Wo(a,h,o,l):(We.flags|=n,f.memoizedState=Wo(1|a,h,o,l))}function nT(n,a){nf(8390656,8,n,a)}function hg(n,a){sf(2048,8,n,a)}function zx(n){We.flags|=4;var a=We.updateQueue;if(a===null)a=Qd(),We.updateQueue=a,a.events=[n];else{var o=a.events;o===null?a.events=[n]:o.push(n)}}function sT(n){var a=Yt().memoizedState;return zx({ref:a,nextImpl:n}),function(){if((ht&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function rT(n,a){return sf(4,2,n,a)}function aT(n,a){return sf(4,4,n,a)}function iT(n,a){if(typeof a=="function"){n=n();var o=a(n);return function(){typeof o=="function"?o():a(null)}}if(a!=null)return n=n(),a.current=n,function(){a.current=null}}function oT(n,a,o){o=o!=null?o.concat([n]):null,sf(4,4,iT.bind(null,a,n),o)}function pg(){}function cT(n,a){var o=Yt();a=a===void 0?null:a;var l=o.memoizedState;return a!==null&&sg(a,l[1])?l[0]:(o.memoizedState=[n,a],n)}function lT(n,a){var o=Yt();a=a===void 0?null:a;var l=o.memoizedState;if(a!==null&&sg(a,l[1]))return l[0];if(l=n(),Li){Ta(!0);try{n()}finally{Ta(!1)}}return o.memoizedState=[l,a],l}function mg(n,a,o){return o===void 0||(Fr&1073741824)!==0&&(it&261930)===0?n.memoizedState=a:(n.memoizedState=o,n=b2(),We.lanes|=n,La|=n,o)}function uT(n,a,o,l){return us(o,a)?o:Ra.current!==null?(n=mg(n,o,l),us(n,a)||(en=!0),n):(Fr&106)===0||(Fr&1073741824)!==0&&(it&261930)===0?(en=!0,n.memoizedState=o):(n=b2(),We.lanes|=n,La|=n,a)}function dT(n,a,o,l,f){var h=_e.p;_e.p=h!==0&&8>h?h:8;var v=be.T,_={};_.types=v!==null?v.types:null,be.T=_,vg(n,!1,a,o);try{var L=f(),ne=be.S;if(ne!==null&&ne(_,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var ie=Mx(L,l);ql(n,a,ie,ms(n))}else ql(n,a,l,ms(n))}catch(ge){ql(n,a,{then:function(){},status:"rejected",reason:ge},ms())}finally{_e.p=h,v!==null&&_.types!==null&&(v.types=_.types),be.T=v}}function $x(){}function gg(n,a,o,l){if(n.tag!==5)throw Error(r(476));var f=fT(n).queue;dT(n,f,a,Pe,o===null?$x:function(){return hT(n),o(l)})}function fT(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:Pe,baseState:Pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:Pe},next:null};var o={};return a.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:o},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function hT(n){var a=fT(n);a.next===null&&(a=n.alternate.memoizedState),ql(n,a.next.queue,{},ms())}function yg(){return kn(pc)}function pT(){return Yt().memoizedState}function mT(){return Yt().memoizedState}function Vx(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var o=ms();n=Ca(o);var l=Ia(a,n,o);l!==null&&(ts(l,a,o),$l(l,a,o)),a={cache:Hm()},n.payload=a;return}a=a.return}}function Px(n,a,o){var l=ms();o={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},rf(n)?yT(a,o):(o=Um(n,a,o,l),o!==null&&(ts(o,n,l),vT(o,a,l)))}function gT(n,a,o){var l=ms();ql(n,a,o,l)}function ql(n,a,o,l){var f={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(rf(n))yT(a,f);else{var h=n.alternate;if(n.lanes===0&&(h===null||h.lanes===0)&&(h=a.lastRenderedReducer,h!==null))try{var v=a.lastRenderedState,_=h(v,o);if(f.hasEagerState=!0,f.eagerState=_,us(_,v))return Dd(n,a,f,0),xt===null&&Md(),!1}catch{}if(o=Um(n,a,f,l),o!==null)return ts(o,n,l),vT(o,a,l),!0}return!1}function vg(n,a,o,l){if(l={lane:2,revertLane:c0(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},rf(n)){if(a)throw Error(r(479))}else a=Um(n,o,l,2),a!==null&&ts(a,n,2)}function rf(n){var a=n.alternate;return n===We||a!==null&&a===We}function yT(n,a){Zo=Kd=!0;var o=n.pending;o===null?a.next=a:(a.next=o.next,o.next=a),n.pending=a}function vT(n,a,o){if((o&4194048)!==0){var l=a.lanes;l&=n.pendingLanes,o|=l,a.lanes=o,b1(n,o)}}var af={readContext:kn,use:ef,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useLayoutEffect:Vt,useInsertionEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useSyncExternalStore:Vt,useId:Vt,useHostTransitionStatus:Vt,useFormState:Vt,useActionState:Vt,useOptimistic:Vt,useMemoCache:Vt,useCacheRefresh:Vt,useEffectEvent:Vt},bT={readContext:kn,use:ef,useCallback:function(n,a){return Vn().memoizedState=[n,a===void 0?null:a],n},useContext:kn,useEffect:nT,useImperativeHandle:function(n,a,o){o=o!=null?o.concat([n]):null,nf(4194308,4,iT.bind(null,a,n),o)},useLayoutEffect:function(n,a){return nf(4194308,4,n,a)},useInsertionEffect:function(n,a){nf(4,2,n,a)},useMemo:function(n,a){var o=Vn();a=a===void 0?null:a;var l=n();if(Li){Ta(!0);try{n()}finally{Ta(!1)}}return o.memoizedState=[l,a],l},useReducer:function(n,a,o){var l=Vn();if(o!==void 0){var f=o(a);if(Li){Ta(!0);try{o(a)}finally{Ta(!1)}}}else f=a;return l.memoizedState=l.baseState=f,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:f},l.queue=n,n=n.dispatch=Px.bind(null,We,n),[l.memoizedState,n]},useRef:function(n){var a=Vn();return n={current:n},a.memoizedState=n},useState:function(n){n=dg(n);var a=n.queue,o=gT.bind(null,We,a);return a.dispatch=o,[n.memoizedState,o]},useDebugValue:pg,useDeferredValue:function(n,a){var o=Vn();return mg(o,n,a)},useTransition:function(){var n=dg(!1);return n=dT.bind(null,We,n.queue,!0,!1),Vn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,o){var l=We,f=Vn();if(Qe){if(o===void 0)throw Error(r(407));o=o()}else{if(o=a(),xt===null)throw Error(r(349));(it&127)!==0||$w(l,a,o)}f.memoizedState=o;var h={value:o,getSnapshot:a};return f.queue=h,nT(Pw.bind(null,l,h,n),[n]),l.flags|=2048,Wo(9,{destroy:void 0},Vw.bind(null,l,h,o,a),null),o},useId:function(){var n=Vn(),a=xt.identifierPrefix;if(Qe){var o=ur,l=lr;o=(l&~(1<<32-cs(l)-1)).toString(32)+o,a="_"+a+"R_"+o,o=Jd++,0<o&&(a+="H"+o.toString(32)),a+="_"}else o=Dx++,a="_"+a+"r_"+o.toString(32)+"_";return n.memoizedState=a},useHostTransitionStatus:yg,useFormState:Kw,useActionState:Kw,useOptimistic:function(n){var a=Vn();a.memoizedState=a.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=o,a=vg.bind(null,We,!0,o),o.dispatch=a,[n,a]},useMemoCache:cg,useCacheRefresh:function(){return Vn().memoizedState=Vx.bind(null,We)},useEffectEvent:function(n){var a=Vn(),o={impl:n};return a.memoizedState=o,function(){if((ht&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},wT={readContext:kn,use:ef,useCallback:cT,useContext:kn,useEffect:hg,useImperativeHandle:oT,useInsertionEffect:rT,useLayoutEffect:aT,useMemo:lT,useReducer:tf,useRef:tT,useState:function(){return tf(Hr)},useDebugValue:pg,useDeferredValue:function(n,a){var o=Yt();return uT(o,kt.memoizedState,n,a)},useTransition:function(){var n=tf(Hr)[0],a=Yt().memoizedState;return[typeof n=="boolean"?n:Hl(n),a]},useSyncExternalStore:zw,useId:pT,useHostTransitionStatus:yg,useFormState:Jw,useActionState:Jw,useOptimistic:function(n,a){var o=Yt();return Hw(o,kt,n,a)},useMemoCache:cg,useCacheRefresh:mT,useEffectEvent:sT},Gx={readContext:kn,use:ef,useCallback:cT,useContext:kn,useEffect:hg,useImperativeHandle:oT,useInsertionEffect:rT,useLayoutEffect:aT,useMemo:lT,useReducer:ug,useRef:tT,useState:function(){return ug(Hr)},useDebugValue:pg,useDeferredValue:function(n,a){var o=Yt();return kt===null?mg(o,n,a):uT(o,kt.memoizedState,n,a)},useTransition:function(){var n=ug(Hr)[0],a=Yt().memoizedState;return[typeof n=="boolean"?n:Hl(n),a]},useSyncExternalStore:zw,useId:pT,useHostTransitionStatus:yg,useFormState:eT,useActionState:eT,useOptimistic:function(n,a){var o=Yt();return kt!==null?Hw(o,kt,n,a):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:cg,useCacheRefresh:mT,useEffectEvent:sT};function bg(n,a,o,l){a=n.memoizedState,o=o(l,a),o=o==null?a:J({},a,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var wg={enqueueSetState:function(n,a,o){n=n._reactInternals;var l=ms(),f=Ca(l);f.payload=a,o!=null&&(f.callback=o),a=Ia(n,f,l),a!==null&&(ts(a,n,l),$l(a,n,l))},enqueueReplaceState:function(n,a,o){n=n._reactInternals;var l=ms(),f=Ca(l);f.tag=1,f.payload=a,o!=null&&(f.callback=o),a=Ia(n,f,l),a!==null&&(ts(a,n,l),$l(a,n,l))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var o=ms(),l=Ca(o);l.tag=2,a!=null&&(l.callback=a),a=Ia(n,l,o),a!==null&&(ts(a,n,o),$l(a,n,o))}};function TT(n,a,o,l,f,h,v){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,h,v):a.prototype&&a.prototype.isPureReactComponent?!Rl(o,l)||!Rl(f,h):!0}function ST(n,a,o,l){n=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(o,l),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(o,l),a.state!==n&&wg.enqueueReplaceState(a,a.state,null)}function zi(n,a){var o=a;if("ref"in a){o={};for(var l in a)l!=="ref"&&(o[l]=a[l])}if(n=n.defaultProps){o===a&&(o=J({},o));for(var f in n)o[f]===void 0&&(o[f]=n[f])}return o}function ET(n){jd(n)}function _T(n){console.error(n)}function kT(n){jd(n)}function of(n,a){try{var o=n.onUncaughtError;o(a.value,{componentStack:a.stack})}catch(l){setTimeout(function(){throw l})}}function AT(n,a,o){try{var l=n.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Tg(n,a,o){return o=Ca(o),o.tag=3,o.payload={element:null},o.callback=function(){of(n,a)},o}function OT(n){return n=Ca(n),n.tag=3,n}function NT(n,a,o,l){var f=o.type.getDerivedStateFromError;if(typeof f=="function"){var h=l.value;n.payload=function(){return f(h)},n.callback=function(){AT(a,o,l)}}var v=o.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(n.callback=function(){AT(a,o,l),typeof f!="function"&&(za===null?za=new Set([this]):za.add(this));var _=l.stack;this.componentDidCatch(l.value,{componentStack:_!==null?_:""})})}function Fx(n,a,o,l,f){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(a=o.alternate,a!==null&&Ii(a,o,f,!0),o=An.current,o!==null){switch(o.tag){case 31:case 13:case 19:return Dn===null?Nf():o.alternate===null&&Pt===0&&(Pt=3),o.flags&=-257,o.flags|=65536,o.lanes=f,l===qd?o.flags|=16384:(a=o.updateQueue,a===null?o.updateQueue=new Set([l]):a.add(l),a0(n,l,f)),!1;case 22:return o.flags|=65536,l===qd?o.flags|=16384:(a=o.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=a):(o=a.retryQueue,o===null?a.retryQueue=new Set([l]):o.add(l)),a0(n,l,f)),!1}throw Error(r(435,o.tag))}return a0(n,l,f),Nf(),!1}if(Qe)return a=An.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=f,l!==Vm&&(n=Error(r(422),{cause:l}),Dl(Ns(n,o)))):(l!==Vm&&(a=Error(r(423),{cause:l}),Dl(Ns(a,o))),n=n.current.alternate,n.flags|=65536,f&=-f,n.lanes|=f,l=Ns(l,o),f=Tg(n.stateNode,l,f),Km(n,f),Pt!==4&&(Pt=2)),!1;var h=Error(r(520),{cause:l});if(h=Ns(h,o),eu===null?eu=[h]:eu.push(h),Pt!==4&&(Pt=2),a===null)return!0;l=Ns(l,o),o=a;do{switch(o.tag){case 3:return o.flags|=65536,n=f&-f,o.lanes|=n,n=Tg(o.stateNode,l,n),Km(o,n),!1;case 1:if(a=o.type,h=o.stateNode,(o.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(za===null||!za.has(h))))return o.flags|=65536,f&=-f,o.lanes|=f,f=OT(f),NT(f,n,o,l),Km(o,f),!1;break;case 22:if(o.memoizedState!==null)return o.flags|=65536,!1}o=o.return}while(o!==null);return!1}var Sg=Error(r(461)),en=!1;function rn(n,a,o,l){a.child=n===null?Rw(a,null,o,l):Bi(a,n.child,o,l)}function xT(n,a,o,l,f){o=o.render;var h=a.ref;if("ref"in l){var v={};for(var _ in l)_!=="ref"&&(v[_]=l[_])}else v=l;return Ri(a),l=rg(n,a,o,v,h,f),_=ag(),n!==null&&!en?(ig(n,a,f),qr(n,a,f)):(Qe&&_&&zd(a),a.flags|=1,rn(n,a,l,f),a.child)}function CT(n,a,o,l,f){if(n===null){var h=o.type;return typeof h=="function"&&!Bm(h)&&h.defaultProps===void 0&&o.compare===null?(a.tag=15,a.type=h,IT(n,a,h,l,f)):(n=Bd(o.type,null,l,a,a.mode,f),n.ref=a.ref,n.return=a,a.child=n)}if(h=n.child,!Cg(n,f)){var v=h.memoizedProps;if(o=o.compare,o=o!==null?o:Rl,o(v,l)&&n.ref===a.ref)return qr(n,a,f)}return a.flags|=1,n=$r(h,l),n.ref=a.ref,n.return=a,a.child=n}function IT(n,a,o,l,f){if(n!==null){var h=n.memoizedProps;if(Rl(h,l)&&n.ref===a.ref)if(en=!1,a.pendingProps=l=h,Cg(n,f))(n.flags&131072)!==0&&(en=!0);else return a.lanes=n.lanes,qr(n,a,f)}return Eg(n,a,o,l,f)}function RT(n,a,o,l){var f=l.children,h=n!==null?n.memoizedState:null;if(n===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((a.flags&128)!==0){if(h=h!==null?h.baseLanes|o:o,n!==null){for(l=a.child=n.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~h}else l=0,a.child=null;return jT(n,a,h,o,l)}if((o&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&Fd(a,h!==null?h.cachePool:null),h!==null?Dw(a,h):Qm(),Uw(a);else return l=a.lanes=536870912,jT(n,a,h!==null?h.baseLanes|o:o,o,l)}else h!==null?(Fd(a,h.cachePool),Dw(a,h),Ma(),a.memoizedState=null):(n!==null&&Fd(a,null),Qm(),Ma());return rn(n,a,f,o),a.child}function Zl(n,a){return n!==null&&n.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function jT(n,a,o,l,f){var h=Zm();return h=h===null?null:{parent:Jt._currentValue,pool:h},a.memoizedState={baseLanes:o,cachePool:h},n!==null&&Fd(a,null),Qm(),Uw(a),n!==null&&Ii(n,a,l,!0),a.childLanes=f,null}function cf(n,a){return a=lf({mode:a.mode,children:a.children},n.mode),a.ref=n.ref,n.child=a,a.return=n,a}function MT(n,a,o){return Bi(a,n.child,null,o),n=cf(a,a.pendingProps),n.flags|=2,ds(a),a.memoizedState=null,n}function Hx(n,a,o){var l=a.pendingProps,f=(a.flags&128)!==0;if(a.flags&=-129,n===null){if(Qe){if(l.mode==="hidden")return n=cf(a,l),a.lanes=536870912,n.memoizedState={baseLanes:0,cachePool:null},Zl(null,n);if(tg(a),(n=Rt)?(n=iS(n,Is),n=n!==null&&n.data==="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:_a!==null?{id:lr,overflow:ur}:null,retryLane:536870912,hydrationErrors:null},o=yw(n),o.return=a,a.child=o,yn=a,Rt=null)):n=null,n===null)throw Aa(a);return a.lanes=536870912,null}return cf(a,l)}var h=n.memoizedState;if(h!==null){var v=h.dehydrated;if(tg(a),f)if(a.flags&256)a.flags&=-257,a=MT(n,a,o);else if(a.memoizedState!==null)a.child=n.child,a.flags|=128,a=null;else throw Error(r(558));else if(en||Ii(n,a,o,!1),f=(o&n.childLanes)!==0,en||f){if(Ra.current===null){if(l=xt,l!==null&&(v=w1(l,o),v!==0&&v!==h.retryLane))throw h.retryLane=v,Oi(n,v),ts(l,n,v),Sg;Nf()}a=MT(n,a,o)}else n=h.treeContext,Rt=js(v.nextSibling),yn=a,Qe=!0,ka=null,Is=!1,n!==null&&ww(a,n),a=cf(a,l),a.flags|=134221824;return a}return n=$r(n.child,{mode:l.mode,children:l.children}),n.ref=a.ref,a.child=n,n.return=a,n}function Xo(n,a){var o=a.ref;if(o===null)n!==null&&n.ref!==null&&(a.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(n===null||n.ref!==o)&&(a.flags|=4194816)}}function Eg(n,a,o,l,f){return Ri(a),o=rg(n,a,o,l,void 0,f),l=ag(),n!==null&&!en?(ig(n,a,f),qr(n,a,f)):(Qe&&l&&zd(a),a.flags|=1,rn(n,a,o,f),a.child)}function DT(n,a,o,l,f,h){return Ri(a),a.updateQueue=null,o=Lw(a,l,o,f),Bw(n),l=ag(),n!==null&&!en?(ig(n,a,h),qr(n,a,h)):(Qe&&l&&zd(a),a.flags|=1,rn(n,a,o,h),a.child)}function UT(n,a,o,l,f){if(Ri(a),a.stateNode===null){var h=$o,v=o.contextType;typeof v=="object"&&v!==null&&(h=kn(v)),h=new o(l,h),a.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=wg,a.stateNode=h,h._reactInternals=a,h=a.stateNode,h.props=l,h.state=a.memoizedState,h.refs={},Wm(a),v=o.contextType,h.context=typeof v=="object"&&v!==null?kn(v):$o,h.state=a.memoizedState,v=o.getDerivedStateFromProps,typeof v=="function"&&(bg(a,o,v,l),h.state=a.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(v=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),v!==h.state&&wg.enqueueReplaceState(h,h.state,null),Pl(a,l,h,f),Vl(),h.state=a.memoizedState),typeof h.componentDidMount=="function"&&(a.flags|=4194308),l=!0}else if(n===null){h=a.stateNode;var _=a.memoizedProps,L=zi(o,_);h.props=L;var ne=h.context,ie=o.contextType;v=$o,typeof ie=="object"&&ie!==null&&(v=kn(ie));var ge=o.getDerivedStateFromProps;ie=typeof ge=="function"||typeof h.getSnapshotBeforeUpdate=="function",_=a.pendingProps!==_,ie||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_||ne!==v)&&ST(a,h,l,v),xa=!1;var Q=a.memoizedState;h.state=Q,Pl(a,l,h,f),Vl(),ne=a.memoizedState,_||Q!==ne||xa?(typeof ge=="function"&&(bg(a,o,ge,l),ne=a.memoizedState),(L=xa||TT(a,o,L,l,Q,ne,v))?(ie||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(a.flags|=4194308)):(typeof h.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=l,a.memoizedState=ne),h.props=l,h.state=ne,h.context=v,l=L):(typeof h.componentDidMount=="function"&&(a.flags|=4194308),l=!1)}else{h=a.stateNode,Xm(n,a),v=a.memoizedProps,ie=zi(o,v),h.props=ie,ge=a.pendingProps,Q=h.context,ne=o.contextType,L=$o,typeof ne=="object"&&ne!==null&&(L=kn(ne)),_=o.getDerivedStateFromProps,(ne=typeof _=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==ge||Q!==L)&&ST(a,h,l,L),xa=!1,Q=a.memoizedState,h.state=Q,Pl(a,l,h,f),Vl();var ae=a.memoizedState;v!==ge||Q!==ae||xa||n!==null&&n.dependencies!==null&&Pd(n.dependencies)?(typeof _=="function"&&(bg(a,o,_,l),ae=a.memoizedState),(ie=xa||TT(a,o,ie,l,Q,ae,L)||n!==null&&n.dependencies!==null&&Pd(n.dependencies))?(ne||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,ae,L),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,ae,L)),typeof h.componentDidUpdate=="function"&&(a.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===n.memoizedProps&&Q===n.memoizedState||(a.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===n.memoizedProps&&Q===n.memoizedState||(a.flags|=1024),a.memoizedProps=l,a.memoizedState=ae),h.props=l,h.state=ae,h.context=L,l=ie):(typeof h.componentDidUpdate!="function"||v===n.memoizedProps&&Q===n.memoizedState||(a.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===n.memoizedProps&&Q===n.memoizedState||(a.flags|=1024),l=!1)}return h=l,Xo(n,a),l=(a.flags&128)!==0,h||l?(h=a.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:h.render(),a.flags|=1,n!==null&&l?(a.child=Bi(a,n.child,null,f),a.child=Bi(a,null,o,f)):rn(n,a,o,f),a.memoizedState=h.state,n=a.child):n=qr(n,a,f),n}function BT(n,a,o,l){return xi(),a.flags|=256,rn(n,a,o,l),a.child}var _g={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kg(n){return{baseLanes:n,cachePool:Aw()}}function Ag(n,a,o){return n=n!==null?n.childLanes&~o:0,a&&(n|=ps),n}function LT(n,a,o){var l=a.pendingProps,f=!1,h=(a.flags&128)!==0,v;if((v=h)||(v=n!==null&&n.memoizedState===null?!1:(On.current&2)!==0),v&&(f=!0,a.flags&=-129),v=(a.flags&32)!==0,a.flags&=-33,n===null){if(Qe){if(f?ja(a):Ma(),(n=Rt)?(n=iS(n,Is),n=n!==null&&n.data!=="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:_a!==null?{id:lr,overflow:ur}:null,retryLane:536870912,hydrationErrors:null},o=yw(n),o.return=a,a.child=o,yn=a,Rt=null)):n=null,n===null)throw Aa(a);return k0(n)?a.lanes=32:a.lanes=536870912,null}return h=l.children,l=l.fallback,f?(Ma(),f=a.mode,h=lf({mode:"hidden",children:h},f),l=Ni(l,f,o,null),h.return=a,l.return=a,h.sibling=l,a.child=h,l=a.child,l.memoizedState=kg(o),l.childLanes=Ag(n,v,o),a.memoizedState=_g,Zl(null,l)):(ja(a),Og(a,h))}var _=n.memoizedState;if(_!==null){var L=_.dehydrated;if(L!==null)return qx(n,a,h,v,l,L,_,o)}return f?(Ma(),f=l.fallback,h=a.mode,_=n.child,L=_.sibling,l=$r(_,{mode:"hidden",children:l.children}),l.subtreeFlags=_.subtreeFlags&1206910976,L!==null?f=$r(L,f):(f=Ni(f,h,o,null),f.flags|=2),f.return=a,l.return=a,l.sibling=f,a.child=l,Zl(null,l),l=a.child,f=n.child.memoizedState,f===null?f=kg(o):(h=f.cachePool,h!==null?(_=Jt._currentValue,h=h.parent!==_?{parent:_,pool:_}:h):h=Aw(),f={baseLanes:f.baseLanes|o,cachePool:h}),l.memoizedState=f,l.childLanes=Ag(n,v,o),a.memoizedState=_g,Zl(n.child,l)):(ja(a),o=n.child,n=o.sibling,o=$r(o,{mode:"visible",children:l.children}),o.return=a,o.sibling=null,n!==null&&(v=a.deletions,v===null?(a.deletions=[n],a.flags|=16):v.push(n)),a.child=o,a.memoizedState=null,o)}function Og(n,a){return a=lf({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function lf(n,a){return n=Kn(22,n,null,a),n.lanes=0,n}function uf(n,a,o){return Bi(a,n.child,null,o),n=Og(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function qx(n,a,o,l,f,h,v,_){if(o)return a.flags&256?(ja(a),a.flags&=-257,uf(n,a,_)):a.memoizedState!==null?(Ma(),a.child=n.child,a.flags|=128,null):(Ma(),h=f.fallback,v=a.mode,f=lf({mode:"visible",children:f.children},v),h=Ni(h,v,_,null),h.flags|=2,f.return=a,h.return=a,f.sibling=h,a.child=f,Bi(a,n.child,null,_),f=a.child,f.memoizedState=kg(_),f.childLanes=Ag(n,l,_),a.memoizedState=_g,Zl(null,f));if(ja(a),k0(h)){if(l=h.nextSibling&&h.nextSibling.dataset,l)var L=l.dgst;return l=L,l!==""&&(f=Error(r(419)),f.stack="",f.digest=l,Dl({value:f,source:null,stack:null})),uf(n,a,_)}if(en||Ii(n,a,_,!1),l=(_&n.childLanes)!==0,en||l){if(Ra.current!==null)return uf(n,a,_);if(l=xt,l!==null&&(f=w1(l,_),f!==0&&f!==v.retryLane))throw v.retryLane=f,Oi(n,f),ts(l,n,f),Sg;return _0(h)||Nf(),uf(n,a,_)}return _0(h)?(a.flags|=192,a.child=n.child,null):(n=v.treeContext,Rt=js(h.nextSibling),yn=a,Qe=!0,ka=null,Is=!1,n!==null&&ww(a,n),a=Og(a,f.children),a.flags|=134221824,a)}function zT(n,a,o){n.lanes|=a;var l=n.alternate;l!==null&&(l.lanes|=a),Vd(n.return,a,o)}function $T(n){for(var a=null;n!==null;){var o=n.alternate;o!==null&&Xd(o)===null&&(a=n),n=n.sibling}return a}function df(n,a,o,l,f,h){var v=n.memoizedState;v===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:f,treeForkCount:h}:(v.isBackwards=a,v.rendering=null,v.renderingStartTime=0,v.last=l,v.tail=o,v.tailMode=f,v.treeForkCount=h)}function Ng(n){var a=n.child;for(n.child=null;a!==null;){var o=a.sibling;a.sibling=n.child,n.child=a,a=o}}function xg(n,a,o){var l=a.pendingProps,f=l.revealOrder,h=l.tail;l=l.children;var v=On.current;if(a.flags&128)return Gl(a,v),null;var _=(v&2)!==0;if(_?(v=v&1|2,a.flags|=128):v&=1,Gl(a,v),f==="backwards"&&n!==null?(Ng(n),rn(n,a,l,o),Ng(n)):rn(n,a,l,o),l=Qe?Ml:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&zT(n,o,a);else if(n.tag===19)zT(n,o,a);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break e;for(;n.sibling===null;){if(n.return===null||n.return===a)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(f){case"backwards":o=$T(a.child),o===null?(f=a.child,a.child=null):(f=o.sibling,o.sibling=null,Ng(a)),df(a,!0,f,null,h,l);break;case"unstable_legacy-backwards":for(o=null,f=a.child,a.child=null;f!==null;){if(n=f.alternate,n!==null&&Xd(n)===null){a.child=f;break}n=f.sibling,f.sibling=o,o=f,f=n}df(a,!0,o,null,h,l);break;case"together":df(a,!1,null,null,void 0,l);break;case"independent":a.memoizedState=null;break;default:o=$T(a.child),o===null?(f=a.child,a.child=null):(f=o.sibling,o.sibling=null),df(a,!1,f,o,h,l)}return a.child}function VT(n,a,o){var l=a.pendingProps;return Oa(a,a.type,l.value),rn(n,a,l.children,o),a.child}function qr(n,a,o){if(n!==null&&(a.dependencies=n.dependencies),La|=a.lanes,(o&a.childLanes)===0)if(n!==null){if(Ii(n,a,o,!1),(o&a.childLanes)===0)return null}else return null;if(n!==null&&a.child!==n.child)throw Error(r(153));if(a.child!==null){for(n=a.child,o=$r(n,n.pendingProps),a.child=o,o.return=a;n.sibling!==null;)n=n.sibling,o=o.sibling=$r(n,n.pendingProps),o.return=a;o.sibling=null}return a.child}function Cg(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&Pd(n)))}function Zx(n,a,o){switch(a.tag){case 3:_s(a,a.stateNode.containerInfo),Oa(a,Jt,n.memoizedState.cache),xi();break;case 27:case 5:pl(a);break;case 4:_s(a,a.stateNode.containerInfo);break;case 10:Oa(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,tg(a),null;break;case 13:var l=a.memoizedState;if(l!==null){if(l.dehydrated!==null)return ja(a),a.flags|=128,null;l=Ii(n,a,o,!1);var f=a.child.childLanes;return l||(o&f)!==0?LT(n,a,o):(ja(a),n=qr(n,a,o),n!==null?n.sibling:null)}ja(a);break;case 19:if(a.flags&128)return xg(n,a,o);if(f=(n.flags&128)!==0,l=(o&a.childLanes)!==0,l||(Ii(n,a,o,!1),l=(o&a.childLanes)!==0),f){if(l)return xg(n,a,o);a.flags|=128}if(f=a.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Gl(a,On.current),l)break;return null;case 22:return a.lanes=0,RT(n,a,o,a.pendingProps);case 24:Oa(a,Jt,n.memoizedState.cache)}return qr(n,a,o)}function PT(n,a,o){if(n!==null)if(n.memoizedProps!==a.pendingProps)en=!0;else{if(!Cg(n,o)&&(a.flags&128)===0)return en=!1,Zx(n,a,o);en=(n.flags&131072)!==0}else en=!1,Qe&&(a.flags&1048576)!==0&&bw(a,Ml,a.index);switch(a.lanes=0,a.tag){case 16:e:{var l=a.pendingProps;if(n=Di(a.elementType),a.type=n,typeof n=="function")Bm(n)?(l=zi(n,l),a.tag=1,a=UT(null,a,n,l,o)):(a.tag=0,a=Eg(null,a,n,l,o));else{if(n!=null){var f=n.$$typeof;if(f===k){a.tag=11,a=xT(null,a,n,l,o);break e}else if(f===V){a.tag=14,a=CT(null,a,n,l,o);break e}else if(f===D){a.tag=10,a.type=n,a=VT(null,a,o);break e}}throw a=Oe(n)||n,Error(r(306,a,""))}}return a;case 0:return Eg(n,a,a.type,a.pendingProps,o);case 1:return l=a.type,f=zi(l,a.pendingProps),UT(n,a,l,f,o);case 3:e:{if(_s(a,a.stateNode.containerInfo),n===null)throw Error(r(387));l=a.pendingProps;var h=a.memoizedState;f=h.element,Xm(n,a),Pl(a,l,null,o);var v=a.memoizedState;if(l=v.cache,Oa(a,Jt,l),l!==h.cache&&Fm(a,[Jt],o,!0),Vl(),l=v.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:v.cache},a.updateQueue.baseState=h,a.memoizedState=h,a.flags&256){a=BT(n,a,l,o);break e}else if(l!==f){f=Ns(Error(r(424)),a),Dl(f),a=BT(n,a,l,o);break e}else for(n=a.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Rt=js(n.firstChild),yn=a,Qe=!0,ka=null,Is=!0,o=Rw(a,null,l,o),a.child=o;o;)o.flags=o.flags&-3|134221824,o=o.sibling;else{if(xi(),l===f){a=qr(n,a,o);break e}rn(n,a,l,o)}a=a.child}return a;case 26:return Xo(n,a),n===null?(o=hS(a.type,null,a.pendingProps,null))?a.memoizedState=o:Qe||(a.stateNode=q2(a.type,a.pendingProps,Le.current,a)):a.memoizedState=hS(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return pl(a),n===null&&Qe&&(l=a.stateNode=lS(a.type,a.pendingProps,Le.current),yn=a,Is=!0,f=Rt,Pa(a.type)?(A0=f,Rt=js(l.firstChild)):Rt=f),rn(n,a,a.pendingProps.children,o),Xo(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&Qe&&((f=l=Rt)&&(l=VC(l,a.type,a.pendingProps,Is),l!==null?(a.stateNode=l,yn=a,Rt=js(l.firstChild),Is=!1,f=!0):f=!1),f||Aa(a)),pl(a),f=a.type,h=a.pendingProps,v=n!==null?n.memoizedProps:null,l=h.children,y0(f,h)?l=null:v!==null&&y0(f,v)&&(a.flags|=32),a.memoizedState!==null&&(f=rg(n,a,Ux,null,null,o),pc._currentValue=f),Xo(n,a),rn(n,a,l,o),a.child;case 6:return n===null&&Qe&&((n=o=Rt)&&(o=PC(o,a.pendingProps,Is),o!==null?(a.stateNode=o,yn=a,Rt=null,n=!0):n=!1),n||Aa(a)),null;case 13:return LT(n,a,o);case 4:return _s(a,a.stateNode.containerInfo),l=a.pendingProps,n===null?a.child=Bi(a,null,l,o):rn(n,a,l,o),a.child;case 11:return xT(n,a,a.type,a.pendingProps,o);case 7:return l=a.pendingProps,Xo(n,a),rn(n,a,l,o),a.child;case 8:return rn(n,a,a.pendingProps.children,o),a.child;case 12:return rn(n,a,a.pendingProps.children,o),a.child;case 10:return VT(n,a,o);case 9:return f=a.type._context,l=a.pendingProps.children,Ri(a),f=kn(f),l=l(f),a.flags|=1,rn(n,a,l,o),a.child;case 14:return CT(n,a,a.type,a.pendingProps,o);case 15:return IT(n,a,a.type,a.pendingProps,o);case 19:return xg(n,a,o);case 31:return Hx(n,a,o);case 22:return RT(n,a,o,a.pendingProps);case 24:return Ri(a),l=kn(Jt),n===null?(f=Zm(),f===null&&(f=xt,h=Hm(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=o),f=h),a.memoizedState={parent:l,cache:f},Wm(a),Oa(a,Jt,f)):((n.lanes&o)!==0&&(Xm(n,a),Pl(a,null,null,o),Vl()),f=n.memoizedState,h=a.memoizedState,f.parent!==l?(f={parent:l,cache:l},a.memoizedState=f,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=f),Oa(a,Jt,l)):(l=h.cache,Oa(a,Jt,l),l!==f.cache&&Fm(a,[Jt],o,!0))),rn(n,a,a.pendingProps.children,o),a.child;case 30:return a.stateNode===null&&(a.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=a.pendingProps,l.name!=null&&l.name!=="auto"?a.flags|=n===null?18882560:18874368:Qe&&zd(a),n!==null&&n.memoizedProps.name!==l.name?a.flags|=4194816:Xo(n,a),rn(n,a,l.children,o),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Zr(n){n.flags|=4}function Ig(n,a,o,l,f){var h;if((h=(n.mode&32)!==0)&&(h=o===null?yS(a,l):yS(a,l)&&(l.src!==o.src||l.srcSet!==o.srcSet)),h){if(n.flags|=16777216,(f&335544128)===f)if(n.stateNode.complete)n.flags|=8192;else if(E2())n.flags|=8192;else throw Ui=qd,Ym}else n.flags&=-16777217}function GT(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!vS(a))if(E2())n.flags|=8192;else throw Ui=qd,Ym}function ff(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?y1():536870912,n.lanes|=a,tc|=a)}function Yl(n,a){if(!Qe)switch(n.tailMode){case"visible":break;case"collapsed":for(var o=n.tail,l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?a||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null;break;default:for(a=n.tail,o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n.tail=null:o.sibling=null}}function jt(n){var a=n.alternate!==null&&n.alternate.child===n.child,o=0,l=0;if(a)for(var f=n.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags&1206910976,l|=f.flags&1206910976,f.return=n,f=f.sibling;else for(f=n.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=n,f=f.sibling;return n.subtreeFlags|=l,n.childLanes=o,a}function Yx(n,a,o){var l=a.pendingProps;switch($m(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(a),null;case 1:return jt(a),null;case 3:return o=a.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),a.memoizedState.cache!==l&&(a.flags|=2048),Gr(Jt),ba(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Go(a)?Zr(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Pm())),jt(a),null;case 26:var f=a.type,h=a.memoizedState;return n===null?(Zr(a),h!==null?(jt(a),GT(a,h)):(jt(a),Ig(a,f,null,l,o))):h?h!==n.memoizedState?(Zr(a),jt(a),GT(a,h)):(jt(a),a.flags&=-16777217):(n=n.memoizedProps,n!==l&&Zr(a),jt(a),Ig(a,f,n,l,o)),null;case 27:if(Ti(a),o=Le.current,f=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==l&&Zr(a);else{if(!l){if(a.stateNode===null)throw Error(r(166));return jt(a),a.subtreeFlags&=-33554433,null}n=le.current,Go(a)?Tw(a):(n=lS(f,l,o),a.stateNode=n,Zr(a))}return jt(a),a.subtreeFlags&=-33554433,null;case 5:if(Ti(a),f=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==l&&Zr(a);else{if(!l){if(a.stateNode===null)throw Error(r(166));return jt(a),a.subtreeFlags&=-33554433,null}if(h=le.current,Go(a))Tw(a);else{var v=au(Le.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?v.createElement("select",{is:l.is}):v.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?v.createElement(f,{is:l.is}):v.createElement(f)}}h[_n]=a,h[Xn]=l;e:for(v=a.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===a)break e;for(;v.sibling===null;){if(v.return===null||v.return===a)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}a.stateNode=h;e:switch(xn(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Zr(a)}}return jt(a),a.subtreeFlags&=-33554433,Ig(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,o),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==l&&Zr(a);else{if(typeof l!="string"&&a.stateNode===null)throw Error(r(166));if(n=Le.current,Go(a)){if(n=a.stateNode,o=a.memoizedProps,l=null,f=yn,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}n[_n]=a,n=!!(n.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||P2(n.nodeValue,o)),n||Aa(a,!0)}else n=au(n).createTextNode(l),n[_n]=a,a.stateNode=n}return jt(a),null;case 31:if(o=a.memoizedState,n===null||n.memoizedState!==null){if(l=Go(a),o!==null){if(n===null){if(!l)throw Error(r(318));if(n=a.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(557));n[_n]=a}else xi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;jt(a),n=!1}else o=Pm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return a.flags&256?(ds(a),a):(ds(a),null);if((a.flags&128)!==0)throw Error(r(558))}return jt(a),null;case 13:if(l=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=Go(a),l!==null&&l.dehydrated!==null){if(n===null){if(!f)throw Error(r(318));if(f=a.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[_n]=a}else xi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;jt(a),f=!1}else f=Pm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=f),f=!0;if(!f)return a.flags&256?(ds(a),a):(ds(a),null)}return ds(a),(a.flags&128)!==0?(a.lanes=o,a):(o=l!==null,n=n!==null&&n.memoizedState!==null,o&&(l=a.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),o!==n&&o&&(a.child.flags|=8192),ff(a,a.updateQueue),jt(a),null);case 4:return ba(),n===null&&f0(a.stateNode.containerInfo),a.flags|=67108864,jt(a),null;case 10:return Gr(a.type),jt(a),null;case 19:if(ng(a),l=a.memoizedState,l===null)return jt(a),null;if(f=(a.flags&128)!==0,h=l.rendering,h===null)if(f)Yl(l,!1);else{if(Pt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(h=Xd(n),h!==null){for(a.flags|=128,Yl(l,!1),n=h.updateQueue,a.updateQueue=n,ff(a,n),a.subtreeFlags=0,n=o,o=a.child;o!==null;)gw(o,n),o=o.sibling;return Gl(a,On.current&1|2),Qe&&Vr(a,l.treeForkCount),a.child}n=n.sibling}l.tail!==null&&zn()>_f&&(a.flags|=128,f=!0,Yl(l,!1),a.lanes=4194304)}else{if(!f)if(n=Xd(h),n!==null){if(a.flags|=128,f=!0,n=n.updateQueue,a.updateQueue=n,ff(a,n),Yl(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!h.alternate&&!Qe)return jt(a),null}else 2*zn()-l.renderingStartTime>_f&&o!==536870912&&(a.flags|=128,f=!0,Yl(l,!1),a.lanes=4194304);l.isBackwards?(h.sibling=a.child,a.child=h):(n=l.last,n!==null?n.sibling=h:a.child=h,l.last=h)}if(l.tail!==null){n=l.tail;e:{for(o=n;o!==null;){if(o.alternate!==null){o=!1;break e}o=o.sibling}o=!0}return l.rendering=n,l.tail=n.sibling,l.renderingStartTime=zn(),n.sibling=null,h=On.current,h=f?h&1|2:h&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!o||Qe?Gl(a,h):(o=h,fe(An,a),fe(On,o),Dn===null&&(Dn=a)),Qe&&Vr(a,l.treeForkCount),n}return jt(a),null;case 22:case 23:return ds(a),eg(),l=a.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(a.flags|=8192):l&&(a.flags|=8192),l?(o&536870912)!==0&&(a.flags&128)===0&&(jt(a),a.subtreeFlags&6&&(a.flags|=8192)):jt(a),o=a.updateQueue,o!==null&&ff(a,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),l=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),l!==o&&(a.flags|=2048),n!==null&&de(Mi),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),Gr(Jt),jt(a),null;case 25:return null;case 30:return a.flags|=33554432,jt(a),null}throw Error(r(156,a.tag))}function Wx(n,a){switch($m(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Gr(Jt),ba(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return Ti(a),null;case 31:if(a.memoizedState!==null){if(ds(a),a.alternate===null)throw Error(r(340));xi()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(ds(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(r(340));xi()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return ng(a),n=a.flags,n&65536?(a.flags=n&-65537|128,n=a.memoizedState,n!==null&&(n.rendering=null,n.tail=null),a.flags|=4,a):null;case 4:return ba(),null;case 10:return Gr(a.type),null;case 22:case 23:return ds(a),eg(),n!==null&&de(Mi),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Gr(Jt),null;case 25:return null;default:return null}}function FT(n,a){switch($m(a),a.tag){case 3:Gr(Jt),ba();break;case 26:case 27:case 5:Ti(a);break;case 4:ba();break;case 31:a.memoizedState!==null&&ds(a);break;case 13:ds(a);break;case 19:ng(a);break;case 10:Gr(a.type);break;case 22:case 23:ds(a),eg(),n!==null&&de(Mi);break;case 24:Gr(Jt)}}function Wl(n,a){try{var o=a.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var f=l.next;o=f;do{if((o.tag&n)===n){l=void 0;var h=o.create,v=o.inst;l=h(),v.destroy=l}o=o.next}while(o!==f)}}catch(_){Tt(a,a.return,_)}}function Da(n,a,o){try{var l=a.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&n)===n){var v=l.inst,_=v.destroy;if(_!==void 0){v.destroy=void 0,f=a;var L=o,ne=_;try{ne()}catch(ie){Tt(f,L,ie)}}}l=l.next}while(l!==h)}}catch(ie){Tt(a,a.return,ie)}}function HT(n){var a=n.updateQueue;if(a!==null){var o=n.stateNode;try{Mw(a,o)}catch(l){Tt(n,n.return,l)}}}function qT(n,a,o){o.props=zi(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(l){Tt(n,a,l)}}function dr(n,a){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:var f=n.stateNode,h=Lr(n.memoizedProps,f);(f.ref===null||f.ref.name!==h)&&(f.ref=Q2(h)),l=f.ref;break;case 7:if(n.stateNode===null){var v=new gs(n);y(n.child,!1,zC,v,void 0,void 0),n.stateNode=v}l=n.stateNode;break;default:l=n.stateNode}typeof o=="function"?n.refCleanup=o(l):o.current=l}}catch(_){Tt(n,a,_)}}function Nn(n,a){var o=n.ref,l=n.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(f){Tt(n,a,f)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(f){Tt(n,a,f)}else o.current=null}function hf(n,a){if((n.tag===5||n.tag===27||n.tag===6)&&n.alternate===null&&a!==null)for(var o=0;o<a.length;o++)aS(n.stateNode,a[o])}function ZT(n){for(var a=n.return;a!==null&&(jg(a)&&aS(n.stateNode,a.stateNode),!Rg(a));)a=a.return}function Xl(n){for(var a=n.return;a!==null&&(jg(a)&&$C(n.stateNode,a.stateNode),!Rg(a));)a=a.return}function Rg(n){return n.tag===5||n.tag===3||n.tag===27}function jg(n){return n&&n.tag===7&&n.stateNode!==null}function Mg(n){var a=n.type,o=n.memoizedProps,l=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(f){Tt(n,n.return,f)}}function Dg(n,a,o){try{var l=n.stateNode;TC(l,n.type,o,a),l[Xn]=a}catch(f){Tt(n,n.return,f)}}function YT(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Pa(n.type)||n.tag===4}function Ug(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||YT(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Pa(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Bg(n,a,o,l){var f=n.tag;if(f===5||f===6)f=n.stateNode,a?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(f,a):(a=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,a.appendChild(f),o=o._reactRootContainer,o!=null||a.onclick!==null||(a.onclick=cr)),hf(n,l),dt=!0;else if(f!==4&&(f===27&&(hf(n,l),l=null,Pa(n.type)&&(o=n.stateNode,a=null)),n=n.child,n!==null))for(Bg(n,a,o,l),n=n.sibling;n!==null;)Bg(n,a,o,l),n=n.sibling}function pf(n,a,o,l){var f=n.tag;if(f===5||f===6)f=n.stateNode,a?o.insertBefore(f,a):o.appendChild(f),hf(n,l),dt=!0;else if(f!==4&&(f===27&&(hf(n,l),l=null,Pa(n.type)&&(o=n.stateNode)),n=n.child,n!==null))for(pf(n,a,o,l),n=n.sibling;n!==null;)pf(n,a,o,l),n=n.sibling}function WT(n){var a=n.stateNode,o=n.memoizedProps;try{for(var l=n.type,f=a.attributes;f.length;)a.removeAttributeNode(f[0]);xn(a,l,o),a[_n]=n,a[Xn]=o}catch(h){Tt(n,n.return,h)}}var mf=!1,fs=null;function XT(n){(n.tag===30||(n.subtreeFlags&33554432)!==0)&&(mf=!0)}var fr=null;function KT(){var n=fr;return fr=null,n}var Jn=0;function Ko(n,a,o,l,f){return Jn=0,JT(n.child,a,o,l,f)}function JT(n,a,o,l,f){for(var h=!1;n!==null;){if(n.tag===5){var v=n.stateNode;if(l!==null){var _=w0(v);l.push(_),_.view&&(h=!0)}else h||w0(v).view&&(h=!0);mf=!0,K2(v,Jn===0?a:a+"_"+Jn,o),Jn++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&f||JT(n.child,a,o,l,f)&&(h=!0));n=n.sibling}return h}function hr(n,a){for(;n!==null;)n.tag===5?J2(n.stateNode,n.memoizedProps):(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&a||hr(n.child,a)),n=n.sibling}function gf(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if((n.tag!==22||n.memoizedState===null)&&(gf(n),n.tag===30&&(n.flags&18874368)!==0&&n.stateNode.paired)){var a=n.memoizedProps;if(a.name==null||a.name==="auto")throw Error(r(544));var o=a.name;a=zr(a.default,a.share),a!=="none"&&(Ko(n,o,a,null,!1)||hr(n.child,!1))}n=n.sibling}}function Lg(n,a){if(n.tag===30){var o=n.stateNode,l=n.memoizedProps,f=Lr(l,o),h=zr(l.default,o.paired?l.share:l.enter);h!=="none"?Ko(n,f,h,null,!1)?(gf(n),o.paired||a||ac(n,l.onEnter)):hr(n.child,!1):gf(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Lg(n,a),n=n.sibling;else gf(n)}function zg(n){if(fs!==null&&fs.size!==0){var a=fs;if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var o=n.memoizedProps,l=o.name;if(l!=null&&l!=="auto"){var f=a.get(l);if(f!==void 0){var h=zr(o.default,o.share);if(h!=="none"&&(Ko(n,l,h,null,!1)?(h=n.stateNode,f.paired=h,h.paired=f,ac(n,o.onShare)):hr(n.child,!1)),a.delete(l),a.size===0)break}}}zg(n)}n=n.sibling}}}function $g(n){if(n.tag===30){var a=n.memoizedProps,o=Lr(a,n.stateNode),l=fs!==null?fs.get(o):void 0,f=zr(a.default,l!==void 0?a.share:a.exit);f!=="none"&&(Ko(n,o,f,null,!1)?l!==void 0?(f=n.stateNode,l.paired=f,f.paired=l,fs.delete(o),ac(n,a.onShare)):ac(n,a.onExit):hr(n.child,!1)),fs!==null&&zg(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)$g(n),n=n.sibling;else fs!==null&&zg(n)}function QT(n){for(n=n.child;n!==null;){if(n.tag===30){var a=n.memoizedProps,o=Lr(a,n.stateNode);a=zr(a.default,a.update),n.flags&=-5,a!=="none"&&Ko(n,o,a,n.memoizedState=[],!1)}else(n.subtreeFlags&33554432)!==0&&QT(n);n=n.sibling}}function Vg(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var a=n.stateNode;a.paired!==null&&(a.paired=null,hr(n.child,!1))}Vg(n)}n=n.sibling}}function yf(n){if(n.tag===30)n.stateNode.paired=null,hr(n.child,!1),Vg(n);else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)yf(n),n=n.sibling;else Vg(n)}function e2(n){for(n=n.child;n!==null;)n.tag===30?hr(n.child,!1):(n.subtreeFlags&33554432)!==0&&e2(n),n=n.sibling}function Pg(n,a,o,l,f,h,v){for(var _=!1;a!==null;){if(a.tag===5){var L=a.stateNode;if(h!==null&&Jn<h.length){var ne=h[Jn],ie=w0(L);(ne.view||ie.view)&&(_=!0);var ge;if(ge=(n.flags&4)===0)if(ie.clip)ge=!0;else{ge=ne.rect;var Q=ie.rect;ge=ge.y!==Q.y||ge.x!==Q.x||ge.height!==Q.height||ge.width!==Q.width}ge&&(n.flags|=4),ie.abs?ie=!ne.abs:(ne=ne.rect,ie=ie.rect,ie=ne.height!==ie.height||ne.width!==ie.width),ie&&(n.flags|=32)}else n.flags|=32;(n.flags&4)!==0&&K2(L,Jn===0?o:o+"_"+Jn,f),_&&(n.flags&4)!==0||(fr===null&&(fr=[]),fr.push(L,Jn===0?l:l+"_"+Jn,a.memoizedProps)),Jn++}else(a.tag!==22||a.memoizedState===null)&&(a.tag===30&&v?n.flags|=a.flags&32:Pg(n,a.child,o,l,f,h,v)&&(_=!0));a=a.sibling}return _}function t2(n,a){for(n=n.child;n!==null;){if(n.tag===30){var o=n.memoizedProps,l=n.stateNode,f=Lr(o,l),h=zr(o.default,o.update),v;v=n.memoizedState,n.memoizedState=null,l=n;var _=n.child;Jn=0,f=Pg(l,_,f,f,h,v,!1),(n.flags&4)!==0&&f&&ac(n,o.onUpdate)}else(n.subtreeFlags&33554432)!==0&&t2(n);n=n.sibling}}var vn=!1,mt=!1,pr=!1,Gg=!1,n2=typeof WeakSet=="function"?WeakSet:Set,bn=null,mr=!1,Kl=!1,vf=!1,Fg=!1;function Xx(n,a,o){if(n=n.containerInfo,m0=mc,n=iw(n),Cm(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var h=f.anchorOffset,v=f.focusNode;f=f.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var _=0,L=-1,ne=-1,ie=0,ge=0,Q=n,ae=null;t:for(;;){for(var ke;Q!==l||h!==0&&Q.nodeType!==3||(L=_+h),Q!==v||f!==0&&Q.nodeType!==3||(ne=_+f),Q.nodeType===3&&(_+=Q.nodeValue.length),(ke=Q.firstChild)!==null;)ae=Q,Q=ke;for(;;){if(Q===n)break t;if(ae===l&&++ie===h&&(L=_),ae===v&&++ge===f&&(ne=_),(ke=Q.nextSibling)!==null)break;Q=ae,ae=Q.parentNode}Q=ke}l=L===-1||ne===-1?null:{start:L,end:ne}}else l=null}l=l||{start:0,end:0}}else l=null;for(g0={focusedElem:n,selectionRange:l},mc=!1,o=(o&335544064)===o,bn=a,a=o?9270:1024;bn!==null;){if(n=bn,o&&(l=n.deletions,l!==null))for(h=0;h<l.length;h++)o&&$g(l[h]);if(n.alternate===null&&(n.flags&2)!==0)o&&XT(n),bf(o);else{if(n.tag===22){if(l=n.alternate,n.memoizedState!==null){l!==null&&l.memoizedState===null&&o&&$g(l),bf(o);continue}else if(l!==null&&l.memoizedState!==null){o&&XT(n),bf(o);continue}}l=n.child,(n.subtreeFlags&a)!==0&&l!==null?(l.return=n,bn=l):(o&&QT(n),bf(o))}}fs=null}function bf(n){for(;bn!==null;){var a=bn,o=n,l=a.alternate,f=a.flags;switch(a.tag){case 0:case 11:case 15:break;case 1:if((f&1024)!==0&&l!==null){o=void 0,f=l.memoizedProps,l=l.memoizedState;var h=a.stateNode;try{var v=zi(a.type,f);o=h.getSnapshotBeforeUpdate(v,l),h.__reactInternalSnapshotBeforeUpdate=o}catch(_){Tt(a,a.return,_)}}break;case 3:if((f&1024)!==0){if(l=a.stateNode.containerInfo,o=l.nodeType,o===9)E0(l);else if(o===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":E0(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:o&&l!==null&&(o=Lr(l.memoizedProps,l.stateNode),f=a.memoizedProps,f=zr(f.default,f.update),f!=="none"&&Ko(l,o,f,l.memoizedState=[],!0));break;default:if((f&1024)!==0)throw Error(r(163))}if(l=a.sibling,l!==null){l.return=a.return,bn=l;break}bn=a.return}}function s2(n,a,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:gr(n,o),l&4&&Wl(5,o);break;case 1:if(gr(n,o),l&4)if(n=o.stateNode,a===null)try{n.componentDidMount()}catch(v){Tt(o,o.return,v)}else{var f=zi(o.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(f,a,n.__reactInternalSnapshotBeforeUpdate)}catch(v){Tt(o,o.return,v)}}l&64&&HT(o),l&512&&dr(o,o.return);break;case 3:if(gr(n,o),l&64&&(n=o.updateQueue,n!==null)){if(a=null,o.child!==null)switch(o.child.tag){case 27:case 5:a=o.child.stateNode;break;case 1:a=o.child.stateNode}try{Mw(n,a)}catch(v){Tt(o,o.return,v)}}break;case 27:a===null&&l&4&&WT(o);case 26:case 5:gr(n,o),a===null&&l&4&&Mg(o),l&512&&dr(o,o.return);break;case 12:gr(n,o);break;case 31:gr(n,o),l&4&&o2(n,o);break;case 13:gr(n,o),l&4&&c2(n,o),l&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=cC.bind(null,o),GC(n,o))));break;case 22:if(l=o.memoizedState!==null||vn,!l){var h=a!==null&&a.memoizedState!==null||mt;a=vn,f=mt,vn=l,(mt=h)&&!f?(l=2,(o.subtreeFlags&8772)!==0&&(l|=1),Zs(n,o,l)):gr(n,o),vn=a,mt=f}break;case 30:gr(n,o),l&512&&dr(o,o.return);break;case 7:l&512&&dr(o,o.return);default:gr(n,o)}}function Hg(n,a){for(n=n.child;n!==null;)r2(n,a),n=n.sibling}function r2(n,a){switch(n.tag){case 5:case 26:try{var o=n.stateNode;if(a){var l=o.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var f=n.stateNode,h=n.memoizedProps.style,v=h!=null&&h.hasOwnProperty("display")?h.display:null;f.style.display=v==null||typeof v=="boolean"?"":(""+v).trim()}}catch(L){Tt(n,n.return,L)}qg(n,a);break;case 6:try{n.stateNode.nodeValue=a?"":n.memoizedProps,dt=!0}catch(L){Tt(n,n.return,L)}break;case 18:try{var _=n.stateNode;a?X2(_,!0):X2(n.stateNode,!1)}catch(L){Tt(n,n.return,L)}break;case 22:case 23:n.memoizedState===null&&Hg(n,a);break;default:Hg(n,a)}}function qg(n,a){if(n.subtreeFlags&67108864)for(n=n.child;n!==null;){e:{var o=n,l=a;switch(o.tag){case 4:r2(o,l);break e;case 22:o.memoizedState===null&&qg(o,l);break e;default:qg(o,l)}}n=n.sibling}}function a2(n){var a=n.alternate;a!==null&&(n.alternate=null,a2(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&Ed(a)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Bt=null,Qn=!1;function Hs(n,a,o){for(o=o.child;o!==null;)i2(n,a,o),o=o.sibling}function i2(n,a,o){if(os&&typeof os.onCommitFiberUnmount=="function")try{os.onCommitFiberUnmount(wl,o)}catch{}switch(o.tag){case 26:mt||Nn(o,a),Hs(n,a,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&!mt&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:mt||Nn(o,a),Xl(o);var l=Bt,f=Qn;Pa(o.type)&&(Bt=o.stateNode,Qn=!1),Hs(n,a,o),uS(o.stateNode,o.type,o.memoizedProps),Bt=l,Qn=f;break;case 5:mt||Nn(o,a),Xl(o);case 6:if(o.tag===6&&Xl(o),l=Bt,f=Qn,Bt=null,Hs(n,a,o),Bt=l,Qn=f,Bt!==null)if(Qn)try{(Bt.nodeType===9?Bt.body:Bt.nodeName==="HTML"?Bt.ownerDocument.body:Bt).removeChild(o.stateNode),dt=!0}catch(h){Tt(o,a,h)}else try{Bt.removeChild(o.stateNode),dt=!0}catch(h){Tt(o,a,h)}break;case 18:Bt!==null&&(Qn?(n=Bt,W2(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),gc(n)):W2(Bt,o.stateNode));break;case 4:l=Bt,f=Qn,Bt=o.stateNode.containerInfo,Qn=!0,Hs(n,a,o),Bt=l,Qn=f;break;case 0:case 11:case 14:case 15:Da(2,o,a),mt||Da(4,o,a),Hs(n,a,o);break;case 1:mt||(Nn(o,a),l=o.stateNode,typeof l.componentWillUnmount=="function"&&qT(o,a,l)),Hs(n,a,o);break;case 21:Hs(n,a,o);break;case 22:mt=(l=mt)||o.memoizedState!==null,Hs(n,a,o),mt=l;break;case 30:Nn(o,a),Hs(n,a,o);break;case 7:mt||Nn(o,a),Hs(n,a,o);break;default:Hs(n,a,o)}}function o2(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{gc(n)}catch(o){Tt(a,a.return,o)}}}function c2(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{gc(n)}catch(o){Tt(a,a.return,o)}}function Kx(n){switch(n.tag){case 31:case 13:case 19:var a=n.stateNode;return a===null&&(a=n.stateNode=new n2),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new n2),a;default:throw Error(r(435,n.tag))}}function wf(n,a){var o=Kx(n);a.forEach(function(l){if(!o.has(l)){o.add(l);var f=lC.bind(null,n,l);l.then(f,f)}})}function Pn(n,a,o){var l=a.deletions;if(l!==null)for(var f=0;f<l.length;f++){var h=l[f],v=n,_=a,L=_;e:for(;L!==null;){switch(L.tag){case 27:if(Pa(L.type)){Bt=L.stateNode,Qn=!1;break e}break;case 5:Bt=L.stateNode,Qn=!1;break e;case 3:case 4:Bt=L.stateNode.containerInfo,Qn=!0;break e}L=L.return}if(Bt===null)throw Error(r(160));i2(v,_,h),Bt=null,Qn=!1,v=h.alternate,v!==null&&(v.return=null),h.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)l2(a,n,o),a=a.sibling}var qs=null;function l2(n,a,o){var l=n.alternate,f=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(f&4&&(l=n.updateQueue,l=l!==null?l.events:null,l!==null))for(var h=0;h<l.length;h++){var v=l[h];v.ref.impl=v.nextImpl}Pn(a,n,o),Gn(n),f&4&&(Da(3,n,n.return),Wl(3,n),Da(5,n,n.return));break;case 1:Pn(a,n,o),Gn(n),f&512&&(mt||l===null||Nn(l,l.return)),f&64&&vn&&(n=n.updateQueue,n!==null&&(a=n.callbacks,a!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?a:o.concat(a))));break;case 26:if(h=qs,Pn(a,n,o),Gn(n),f&512&&(mt||l===null||Nn(l,l.return)),f&4)if(f=l!==null?l.memoizedState:null,o=n.memoizedState,l===null)if(o===null)if(n.stateNode===null)if(vn)n.stateNode=q2(n.type,n.memoizedProps,a.containerInfo,n);else{e:{a=n.type,o=n.memoizedProps,f=h.ownerDocument||h;t:switch(a){case"title":l=f.getElementsByTagName("title")[0],(!l||l[El]||l[_n]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=f.createElement(a),f.head.insertBefore(l,f.querySelector("head > title"))),xn(l,a,o),l[_n]=n,gn(l),a=l;break e;case"link":if(h=gS("link","href",f).get(a+(o.href||""))){for(v=0;v<h.length;v++)if(l=h[v],l.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&l.getAttribute("rel")===(o.rel==null?null:o.rel)&&l.getAttribute("title")===(o.title==null?null:o.title)&&l.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){h.splice(v,1);break t}}l=f.createElement(a),xn(l,a,o),f.head.appendChild(l);break;case"meta":if(h=gS("meta","content",f).get(a+(o.content||""))){for(v=0;v<h.length;v++)if(l=h[v],l.getAttribute("content")===(o.content==null?null:""+o.content)&&l.getAttribute("name")===(o.name==null?null:o.name)&&l.getAttribute("property")===(o.property==null?null:o.property)&&l.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&l.getAttribute("charset")===(o.charSet==null?null:o.charSet)){h.splice(v,1);break t}}l=f.createElement(a),xn(l,a,o),f.head.appendChild(l);break;default:throw Error(r(468,a))}l[_n]=n,gn(l),a=l}n.stateNode=a}else vn||C0(h,n.type,n.stateNode);else n.stateNode=mS(h,o,n.memoizedProps);else f!==o?(f===null?(a=l.stateNode,a===null||mt||a.parentNode.removeChild(a)):f.count--,o===null?vn||C0(h,n.type,n.stateNode):mS(h,o,n.memoizedProps)):o===null&&n.stateNode!==null&&Dg(n,n.memoizedProps,l.memoizedProps);break;case 27:Pn(a,n,o),Gn(n),f&512&&(mt||l===null||Nn(l,l.return)),l!==null&&f&4&&Dg(n,n.memoizedProps,l.memoizedProps);break;case 5:if(h=pr,pr=!1,Pn(a,n,o),pr=h,Gn(n),f&512&&(mt||l===null||Nn(l,l.return)),n.flags&32){a=n.stateNode;try{jo(a,""),dt=!0}catch(ie){Tt(n,n.return,ie)}}f&4&&n.stateNode!=null&&(a=n.memoizedProps,Dg(n,a,l!==null?l.memoizedProps:a)),f&1024&&(Gg=!0);break;case 6:if(Pn(a,n,o),Gn(n),f&4){if(n.stateNode===null)throw Error(r(162));a=n.memoizedProps,o=n.stateNode;try{o.nodeValue=a,dt=!0}catch(ie){Tt(n,n.return,ie)}}break;case 3:if(dt=!1,Df=null,h=qs,qs=iu(a.containerInfo),Pn(a,n,o),qs=h,Gn(n),f&4&&l!==null&&l.memoizedState.isDehydrated)try{gc(a.containerInfo)}catch(ie){Tt(n,n.return,ie)}Gg&&(Gg=!1,u2(n)),dt=!1;break;case 4:f=pr,pr=vn,l=C1(),h=qs,qs=iu(n.stateNode.containerInfo),Pn(a,n,o),Gn(n),qs=h,dt&&Kl&&(vf=!0),dt=l,pr=f;break;case 12:Pn(a,n,o),Gn(n);break;case 31:Pn(a,n,o),Gn(n),f&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,wf(n,a)));break;case 13:Pn(a,n,o),Gn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ef=zn()),f&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,wf(n,a)));break;case 22:h=n.memoizedState!==null,v=l!==null&&l.memoizedState!==null;var _=vn,L=mt,ne=pr;vn=_||h,pr=ne||h,mt=L||v,Pn(a,n,o),mt=L,pr=ne,vn=_,Gn(n),f&8192&&(a=n.stateNode,a._visibility=h?a._visibility&-2:a._visibility|1,!h||l===null||v||vn||mt||(a=v||mt,o=vn,l=mt,vn=h||vn,mt=a,Ua(n,2),vn=o,mt=l),!h&&pr||Hg(n,h)),f&4&&(a=n.updateQueue,a!==null&&(o=a.retryQueue,o!==null&&(a.retryQueue=null,wf(n,o))));break;case 19:Pn(a,n,o),Gn(n),f&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,wf(n,a)));break;case 30:f&512&&(mt||l===null||Nn(l,l.return)),f=C1(),h=Kl,v=(o&335544064)===o,_=n.memoizedProps,Kl=v&&zr(_.default,_.update)!=="none",Pn(a,n,o),Gn(n),v&&l!==null&&dt&&(n.flags|=4),Kl=h,dt=f;break;case 21:break;case 7:f&512&&(mt||l===null||Nn(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=n);default:Pn(a,n,o),Gn(n)}}function Gn(n){var a=n.flags;if(a&2){try{for(var o,l=n.return;l!==null;){if(YT(l)){o=l;break}l=l.return}l=null;for(var f=n.return;f!==null;){if(jg(f)){var h=f.stateNode;l===null?l=[h]:l.push(h)}if(Rg(f))break;f=f.return}var v=l;if(o==null)throw Error(r(160));switch(o.tag){case 27:var _=o.stateNode,L=Ug(n);pf(n,L,_,v);break;case 5:var ne=o.stateNode;o.flags&32&&(jo(ne,""),o.flags&=-33);var ie=Ug(n);pf(n,ie,ne,v);break;case 3:case 4:var ge=o.stateNode.containerInfo,Q=Ug(n);Bg(n,Q,ge,v);break;default:throw Error(r(161))}}catch(ae){Tt(n,n.return,ae)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function u2(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;u2(a),a.tag===5&&a.flags&1024&&(a=a.stateNode,mc=!0,a.reset(),mc=!1),n=n.sibling}}function Jo(n,a){if(a.subtreeFlags&9270)for(a=a.child;a!==null;)d2(a,n),a=a.sibling;else t2(a)}function d2(n,a){var o=n.alternate;if(o===null)Lg(n,!1);else switch(n.tag){case 3:if(Fg=mr=!1,KT(),Jo(a,n),!mr&&!vf){if(n=fr,n!==null)for(var l=0;l<n.length;l+=3){o=n[l];var f=n[l+1];J2(o,n[l+2]),o=o.ownerDocument.documentElement,o!==null&&o.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+f+")"})}n=a.containerInfo,n=n.nodeType===9?n.documentElement:n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName===""&&(n.style.viewTransitionName="none",n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),n.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Fg=!0}fr=null;break;case 5:Jo(a,n);break;case 4:l=mr,mr=!1,Jo(a,n),mr&&(vf=!0),mr=l;break;case 22:n.memoizedState===null&&(o.memoizedState!==null?Lg(n,!1):Jo(a,n));break;case 30:l=mr,f=KT(),mr=!1,Jo(a,n),mr&&(n.flags|=4);var h=n.memoizedProps,v=n.stateNode;a=Lr(h,v),v=Lr(o.memoizedProps,v);var _=zr(h.default,h.update);_==="none"?a=!1:(h=o.memoizedState,o.memoizedState=null,o=n.child,Jn=0,a=Pg(n,o,a,v,_,h,!0),Jn!==(h===null?0:h.length)&&(n.flags|=32)),(n.flags&4)!==0&&a?(ac(n,n.memoizedProps.onUpdate),fr=f):f!==null&&(f.push.apply(f,fr),fr=f),mr=(n.flags&32)!==0?!0:l;break;default:Jo(a,n)}}function gr(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)s2(n,a.alternate,a),a=a.sibling}function Ua(n,a){for(n=n.child;n!==null;){var o=n,l=a;switch(o.tag){case 0:case 11:case 14:case 15:Da(4,o,o.return),Ua(o,l);break;case 1:Nn(o,o.return);var f=o.stateNode;typeof f.componentWillUnmount=="function"&&qT(o,o.return,f),Ua(o,l);break;case 27:(l&2)!==0&&uS(o.stateNode,o.type,o.memoizedProps);case 5:Nn(o,o.return),o.tag!==5&&o.tag!==27||Xl(o),Ua(o,l);break;case 6:Xl(o);break;case 26:Nn(o,o.return),f=o.stateNode,o.memoizedState!==null||f===null||mt||f.parentNode.removeChild(f),Ua(o,l);break;case 22:o.memoizedState===null&&Ua(o,l);break;case 30:Nn(o,o.return),Ua(o,l);break;case 7:Nn(o,o.return);default:Ua(o,l)}n=n.sibling}}function Zs(n,a,o){for(o=(a.subtreeFlags&8772)!==0?o:o&-2,a=a.child;a!==null;){var l=a.alternate,f=n,h=a,v=h.flags,_=(o&1)!==0;switch(h.tag){case 0:case 11:case 15:Zs(f,h,o),Wl(4,h);break;case 1:if(Zs(f,h,o),l=h,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ie){Tt(l,l.return,ie)}if(l=h,f=l.updateQueue,f!==null){var L=l.stateNode;try{var ne=f.shared.hiddenCallbacks;if(ne!==null)for(f.shared.hiddenCallbacks=null,f=0;f<ne.length;f++)jw(ne[f],L)}catch(ie){Tt(l,l.return,ie)}}_&&v&64&&HT(h),dr(h,h.return);break;case 27:(o&2)!==0&&WT(h);case 5:h.tag!==5&&h.tag!==27||ZT(h),Zs(f,h,o),_&&l===null&&v&4&&Mg(h),dr(h,h.return);break;case 6:ZT(h);break;case 26:L=h.stateNode,h.memoizedState!==null||L===null||vn||C0(iu(L.ownerDocument),h.type,L),Zs(f,h,o),_&&l===null&&v&4&&Mg(h),dr(h,h.return);break;case 12:Zs(f,h,o);break;case 31:Zs(f,h,o),_&&v&4&&o2(f,h);break;case 13:Zs(f,h,o),_&&v&4&&c2(f,h);break;case 22:h.memoizedState===null&&Zs(f,h,o),dr(h,h.return);break;case 30:Zs(f,h,o),dr(h,h.return);break;case 7:dr(h,h.return);default:Zs(f,h,o)}a=a.sibling}}function Zg(n,a){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&Ul(o))}function Yg(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&Ul(n))}function Rs(n,a,o,l){var f=(o&335544064)===o;if(a.subtreeFlags&(f?10262:10256))for(a=a.child;a!==null;)f2(n,a,o,l),a=a.sibling;else f&&e2(a)}function f2(n,a,o,l){var f=(o&335544064)===o;f&&a.alternate===null&&a.return!==null&&a.return.alternate!==null&&yf(a);var h=a.flags;switch(a.tag){case 0:case 11:case 15:Rs(n,a,o,l),h&2048&&Wl(9,a);break;case 1:Rs(n,a,o,l);break;case 3:Rs(n,a,o,l),f&&Fg&&(n=n.containerInfo,n=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,n.style.viewTransitionName==="root"&&(n.style.viewTransitionName=""),n=n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName==="none"&&(n.style.viewTransitionName="")),h&2048&&(h=null,a.alternate!==null&&(h=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==h&&(a.refCount++,h!=null&&Ul(h)));break;case 12:if(h&2048){Rs(n,a,o,l),h=a.stateNode;try{var v=a.memoizedProps,_=v.id,L=v.onPostCommit;typeof L=="function"&&L(_,a.alternate===null?"mount":"update",h.passiveEffectDuration,-0)}catch(ne){Tt(a,a.return,ne)}}else Rs(n,a,o,l);break;case 31:Rs(n,a,o,l);break;case 13:Rs(n,a,o,l);break;case 23:break;case 22:v=a.stateNode,_=a.alternate,a.memoizedState!==null?(f&&_!==null&&_.memoizedState===null&&yf(_),v._visibility&2?Rs(n,a,o,l):Jl(n,a)):(f&&_!==null&&_.memoizedState!==null&&yf(a),v._visibility&2?Rs(n,a,o,l):(v._visibility|=2,Qo(n,a,o,l,(a.subtreeFlags&10256)!==0||!1))),h&2048&&Zg(_,a);break;case 24:Rs(n,a,o,l),h&2048&&Yg(a.alternate,a);break;case 30:f&&(h=a.alternate,h!==null&&(hr(h.child,!0),hr(a.child,!0))),Rs(n,a,o,l);break;default:Rs(n,a,o,l)}}function Qo(n,a,o,l,f){for(f=f&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var h=n,v=a,_=o,L=l,ne=v.flags;switch(v.tag){case 0:case 11:case 15:Qo(h,v,_,L,f),Wl(8,v);break;case 23:break;case 22:var ie=v.stateNode;v.memoizedState!==null?ie._visibility&2?Qo(h,v,_,L,f):Jl(h,v):(ie._visibility|=2,Qo(h,v,_,L,f)),f&&ne&2048&&Zg(v.alternate,v);break;case 24:Qo(h,v,_,L,f),f&&ne&2048&&Yg(v.alternate,v);break;default:Qo(h,v,_,L,f)}a=a.sibling}}function Jl(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var o=n,l=a,f=l.flags;switch(l.tag){case 22:Jl(o,l),f&2048&&Zg(l.alternate,l);break;case 24:Jl(o,l),f&2048&&Yg(l.alternate,l);break;default:Jl(o,l)}a=a.sibling}}var $i=8192;function Vi(n,a,o){if(n.subtreeFlags&$i)for(n=n.child;n!==null;)h2(n,a,o),n=n.sibling}function h2(n,a,o){switch(n.tag){case 26:Vi(n,a,o),n.flags&$i&&(n.memoizedState!==null?s6(o,qs,n.memoizedState,n.memoizedProps):(n=n.stateNode,(a&335544128)===a&&wS(o,n)));break;case 5:Vi(n,a,o),n.flags&$i&&(n=n.stateNode,(a&335544128)===a&&wS(o,n));break;case 3:case 4:var l=qs;qs=iu(n.stateNode.containerInfo),Vi(n,a,o),qs=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=$i,$i=16777216,Vi(n,a,o),$i=l):Vi(n,a,o));break;case 30:if((n.flags&$i)!==0&&(l=n.memoizedProps.name,l!=null&&l!=="auto")){var f=n.stateNode;f.paired=null,fs===null&&(fs=new Map),fs.set(l,f)}Vi(n,a,o);break;default:Vi(n,a,o)}}function p2(n){var a=n.alternate;if(a!==null&&(n=a.child,n!==null)){a.child=null;do a=n.sibling,n.sibling=null,n=a;while(n!==null)}}function Ql(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var l=a[o];bn=l,g2(l,n)}p2(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)m2(n),n=n.sibling}function m2(n){switch(n.tag){case 0:case 11:case 15:Ql(n),n.flags&2048&&Da(9,n,n.return);break;case 3:Ql(n);break;case 12:Ql(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,Tf(n)):Ql(n);break;default:Ql(n)}}function Tf(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var l=a[o];bn=l,g2(l,n)}p2(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:Da(8,a,a.return),Tf(a);break;case 22:o=a.stateNode,o._visibility&2&&(o._visibility&=-3,Tf(a));break;default:Tf(a)}n=n.sibling}}function g2(n,a){for(;bn!==null;){var o=bn;switch(o.tag){case 0:case 11:case 15:Da(8,o,a);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ul(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,bn=l;else e:for(o=n;bn!==null;){l=bn;var f=l.sibling,h=l.return;if(a2(l),l===o){bn=null;break e}if(f!==null){f.return=h,bn=f;break e}bn=h}}}var Jx={getCacheForType:function(n){var a=kn(Jt),o=a.data.get(n);return o===void 0&&(o=n(),a.data.set(n,o)),o},cacheSignal:function(){return kn(Jt).controller.signal}},Qx=typeof WeakMap=="function"?WeakMap:Map,ht=0,xt=null,tt=null,it=0,wt=0,hs=null,Ba=!1,ec=!1,Wg=!1,Yr=0,Pt=0,La=0,Pi=0,Sf=0,ps=0,tc=0,eu=null,es=null,Xg=!1,Ef=0,y2=0,_f=1/0,kf=null,za=null,zt=0,Ys=null,Gi=null,yr=0,Kg=0,Jg=null,v2=null,nc=null,sc=null,rc=null,tu=0,Af=null;function ms(){return(ht&2)!==0&&it!==0?it&-it:be.T!==null?c0():T1()}function b2(){if(ps===0)if((it&536870912)===0||Qe){var n=bd;bd<<=1,(bd&3932160)===0&&(bd=262144),ps=n}else ps=536870912;return n=An.current,n!==null&&(n.flags|=32),ps}function ac(n,a){if(a!=null){var o=n.stateNode,l=o.ref;l===null&&(l=o.ref=Q2(Lr(n.memoizedProps,o))),sc===null&&(sc=[]),sc.push(a.bind(null,l))}}function ts(n,a,o){(n===xt&&(wt===2||wt===9)||n.cancelPendingCommit!==null)&&(ic(n,0),$a(n,it,ps,!1)),Sl(n,o),((ht&2)===0||n!==xt)&&(n===xt&&((ht&2)===0&&(Pi|=o),Pt===4&&$a(n,it,ps,!1)),vr(n))}function w2(n,a,o){if((ht&6)!==0)throw Error(r(327));var l=!o&&(a&127)===0&&(a&n.expiredLanes)===0||Tl(n,a),f=l?nC(n,a):e0(n,a,!0),h=l;do{if(f===0){ec&&!l&&$a(n,a,0,!1);break}else{if(o=n.current.alternate,h&&!eC(o)){f=e0(n,a,!1),h=!1;continue}if(f===2){if(h=a,n.errorRecoveryDisabledLanes&h)var v=0;else v=n.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){a=v;e:{var _=n;f=eu;var L=_.current.memoizedState.isDehydrated;if(L&&(ic(_,v).flags|=256),v=e0(_,v,!1),v!==2&&v!==6){if(Wg&&!L){_.errorRecoveryDisabledLanes|=h,Pi|=h,f=4;break e}h=es,es=f,h!==null&&(es===null?es=h:es.push.apply(es,h))}f=v}if(h=!1,f!==2)continue}}if(f===1){ic(n,0),$a(n,a,0,!0);break}e:{switch(l=n,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a&&(a&62914560)!==a)break;case 6:$a(l,a,ps,!Ba);break e;case 2:es=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(f=Ef+300-zn(),10<f)){if($a(l,a,ps,!Ba),Td(l,0,!0)!==0)break e;yr=a,l.timeoutHandle=b0(T2.bind(null,l,o,es,kf,Xg,a,ps,Pi,tc,Ba,h,"Throttled",-0,0),f);break e}T2(l,o,es,kf,Xg,a,ps,Pi,tc,Ba,h,null,-0,0)}}break}while(!0);vr(n)}function T2(n,a,o,l,f,h,v,_,L,ne,ie,ge,Q,ae){n.timeoutHandle=-1;var ke=a.subtreeFlags,Re=(h&335544064)===h;if(ge=null,(Re||ke&8192||(ke&16785408)===16785408)&&(ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cr},fs=null,h2(a,h,ge),Re&&(ke=ge,Re=n.containerInfo,Re=(Re.nodeType===9?Re:Re.ownerDocument).__reactViewTransition,Re!=null&&(ke.count++,ke.waitingForViewTransition=!0,ke=lu.bind(ke),Re.finished.then(ke,ke))),ke=(h&62914560)===h?Ef-zn():(h&4194048)===h?y2-zn():0,ke=r6(ge,ke),ke!==null)){yr=h,n.cancelPendingCommit=ke(x2.bind(null,n,a,h,o,l,f,v,_,L,ne,ie,ge,null,Q,ae)),$a(n,h,v,!ne);return}x2(n,a,h,o,l,f,v,_,L,ne,ie,ge)}function eC(n){for(var a=n;;){var o=a.tag;if((o===0||o===11||o===15)&&a.flags&16384&&(o=a.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var f=o[l],h=f.getSnapshot;f=f.value;try{if(!us(h(),f))return!1}catch{return!1}}if(o=a.child,a.subtreeFlags&16384&&o!==null)o.return=a,a=o;else{if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function $a(n,a,o,l){a=g1(n,a),a&=~Sf,a&=~Pi,n.suspendedLanes|=a,n.pingedLanes&=~a,l&&(n.warmLanes|=a),l=n.expirationTimes;for(var f=a;0<f;){var h=31-cs(f),v=1<<h;l[h]=-1,f&=~v}o!==0&&v1(n,o,a)}function Of(){return(ht&6)===0?(nu(0),!1):!0}function Qg(){if(tt!==null){if(wt===0)var n=tt.return;else n=tt,Pr=Ci=null,og(n),qo=null,zl=0,n=tt;for(;n!==null;)FT(n.alternate,n),n=n.return;tt=null}}function ic(n,a){var o=n.timeoutHandle;return o!==-1&&(n.timeoutHandle=-1,_C(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),yr=0,Qg(),xt=n,tt=o=$r(n.current,null),it=a,wt=0,hs=null,Ba=!1,ec=Tl(n,a),Wg=!1,tc=ps=Sf=Pi=La=Pt=0,es=eu=null,Xg=!1,Yr=g1(n,a),Md(),o}function S2(n,a){We=null,be.H=af,a===Ho||a===Hd?(a=xw(),wt=3):a===Ym?(a=xw(),wt=4):wt=a===Sg?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,hs=a,tt===null&&(Pt=1,of(n,Ns(a,n.current)))}function E2(){var n=An.current;return n===null?!0:(it&4194048)===it?Dn===null:(it&62914560)===it||(it&536870912)!==0?n===Dn:!1}function _2(){var n=be.H;return be.H=af,n===null?af:n}function k2(){var n=be.A;return be.A=Jx,n}function Nf(){Pt=4,Ba||(it&4194048)!==it&&An.current!==null||(ec=!0),(La&134217727)===0&&(Pi&134217727)===0||xt===null||$a(xt,it,ps,!1)}function e0(n,a,o){var l=ht;ht|=2;var f=_2(),h=k2();(xt!==n||it!==a)&&(kf=null,ic(n,a)),a=!1;var v=Pt;e:do try{if(wt!==0&&tt!==null){var _=tt,L=hs;switch(wt){case 8:Qg(),v=6;break e;case 3:case 2:case 9:case 6:An.current===null&&(a=!0);var ne=wt;if(wt=0,hs=null,oc(n,_,L,ne),o&&ec){v=0;break e}break;default:ne=wt,wt=0,hs=null,oc(n,_,L,ne)}}tC(),v=Pt;break}catch(ie){S2(n,ie)}while(!0);return a&&n.shellSuspendCounter++,Pr=Ci=null,ht=l,be.H=f,be.A=h,tt===null&&(xt=null,it=0,Md()),v}function tC(){for(;tt!==null;)A2(tt)}function nC(n,a){var o=ht;ht|=2;var l=_2(),f=k2();xt!==n||it!==a?(kf=null,_f=zn()+500,ic(n,a)):ec=Tl(n,a);e:do try{if(wt!==0&&tt!==null){a=tt;var h=hs;t:switch(wt){case 1:wt=0,hs=null,oc(n,a,h,1);break;case 2:case 9:if(Ow(h)){wt=0,hs=null,O2(a);break}a=function(){wt!==2&&wt!==9||xt!==n||(wt=7),vr(n)},h.then(a,a);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:Ow(h)?(wt=0,hs=null,O2(a)):(wt=0,hs=null,oc(n,a,h,7));break;case 5:var v=null;switch(tt.tag){case 26:v=tt.memoizedState;case 5:case 27:var _=tt;if(v?vS(v):_.stateNode.complete){wt=0,hs=null;var L=_.sibling;if(L!==null)tt=L;else{var ne=_.return;ne!==null?(tt=ne,xf(ne)):tt=null}break t}}wt=0,hs=null,oc(n,a,h,5);break;case 6:wt=0,hs=null,oc(n,a,h,6);break;case 8:Qg(),Pt=6;break e;default:throw Error(r(462))}}sC();break}catch(ie){S2(n,ie)}while(!0);return Pr=Ci=null,be.H=l,be.A=f,ht=o,tt!==null?0:(xt=null,it=0,Md(),Pt)}function sC(){for(;tt!==null&&!om();)A2(tt)}function A2(n){var a=PT(n.alternate,n,Yr);n.memoizedProps=n.pendingProps,a===null?xf(n):tt=a}function O2(n){var a=n,o=a.alternate;switch(a.tag){case 15:case 0:a=DT(o,a,a.pendingProps,a.type,void 0,it);break;case 11:a=DT(o,a,a.pendingProps,a.type.render,a.ref,it);break;case 5:og(a);var l=a;l===yn&&(Qe?($d(l),l.tag===5&&l.stateNode!=null&&(Rt=l.stateNode)):($d(l),Qe=!0));default:FT(o,a),a=tt=gw(a,Yr),a=PT(o,a,Yr)}n.memoizedProps=n.pendingProps,a===null?xf(n):tt=a}function oc(n,a,o,l){Pr=Ci=null,og(a),qo=null,zl=0;var f=a.return;try{if(Fx(n,f,a,o,it)){Pt=1,of(n,Ns(o,n.current)),tt=null;return}}catch(h){if(f!==null)throw tt=f,h;Pt=1,of(n,Ns(o,n.current)),tt=null;return}a.flags&32768?(Qe||l===1?n=!0:ec||(it&536870912)!==0?n=!1:(Ba=n=!0,(l===2||l===9||l===3||l===6)&&(l=An.current,l!==null&&l.tag===13&&(l.flags|=16384))),N2(a,n)):xf(a)}function xf(n){var a=n;do{if((a.flags&32768)!==0){N2(a,Ba);return}n=a.return;var o=Yx(a.alternate,a,Yr);if(o!==null){tt=o;return}if(a=a.sibling,a!==null){tt=a;return}tt=a=n}while(a!==null);Pt===0&&(Pt=5)}function N2(n,a){do{var o=Wx(n.alternate,n);if(o!==null){o.flags&=32767,tt=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!a&&(n=n.sibling,n!==null)){tt=n;return}tt=n=o}while(n!==null);Pt=6,tt=null}function x2(n,a,o,l,f,h,v,_,L,ne,ie,ge){n.cancelPendingCommit=null;do Cf();while(zt!==0);if((ht&6)!==0)throw Error(r(327));if(a!==null){if(a===n.current)throw Error(r(177));n===xt&&(tt=xt=null,it=0),Gi=a,Ys=n,yr=o,Jg=f,v2=l,rC(n,a,o,v,_,L,ge)}}function rC(n,a,o,l,f,h,v){var _=a.lanes|a.childLanes;if(Kg=_,_|=Dm,CN(n,o,_,l,f,h),sc=null,(o&335544064)===o?(rc=Rx(n),l=10262):(rc=null,l=10256),(a.subtreeFlags&l)!==0||(a.flags&l)!==0?(n.callbackNode=null,n.callbackPriority=0,uC(Ye,function(){return r0(),null})):(n.callbackNode=null,n.callbackPriority=0),mf=!1,l=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||l){l=be.T,be.T=null,f=_e.p,_e.p=2,h=ht,ht|=4;try{Xx(n,a,o)}finally{ht=h,_e.p=f,be.T=l}}zt=1,mf?nc=CC(v,n.containerInfo,rc,t0,n0,iC,s0,r0,aC):(t0(),n0(),s0())}function aC(n){if(zt!==0){var a=Ys.onRecoverableError;a(n,{componentStack:null})}}function iC(){zt===3&&(zt=0,d2(Gi,Ys),zt=4)}function t0(){if(zt===1){zt=0;var n=Ys,a=Gi,o=yr,l=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||l){l=be.T,be.T=null;var f=_e.p;_e.p=2;var h=ht;ht|=4;try{Kl=vf=!1,l2(a,n,o),o=g0;var v=iw(n.containerInfo),_=o.focusedElem,L=o.selectionRange;if(v!==_&&_&&_.ownerDocument&&aw(_.ownerDocument.documentElement,_)){if(L!==null&&Cm(_)){var ne=L.start,ie=L.end;if(ie===void 0&&(ie=ne),"selectionStart"in _)_.selectionStart=ne,_.selectionEnd=Math.min(ie,_.value.length);else{var ge=_.ownerDocument||document,Q=ge&&ge.defaultView||window;if(Q.getSelection){var ae=Q.getSelection(),ke=_.textContent.length,Re=Math.min(L.start,ke),Xe=L.end===void 0?Re:Math.min(L.end,ke);!ae.extend&&Re>Xe&&(v=Xe,Xe=Re,Re=v);var ee=rw(_,Re),Z=rw(_,Xe);if(ee&&Z&&(ae.rangeCount!==1||ae.anchorNode!==ee.node||ae.anchorOffset!==ee.offset||ae.focusNode!==Z.node||ae.focusOffset!==Z.offset)){var se=ge.createRange();se.setStart(ee.node,ee.offset),ae.removeAllRanges(),Re>Xe?(ae.addRange(se),ae.extend(Z.node,Z.offset)):(se.setEnd(Z.node,Z.offset),ae.addRange(se))}}}}for(ge=[],ae=_;ae=ae.parentNode;)ae.nodeType===1&&ge.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ge.length;_++){var pe=ge[_];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}mc=!!m0,g0=m0=null}finally{ht=h,_e.p=f,be.T=l}}n.current=a,zt=2}}function n0(){if(zt===2){zt=0;var n=Ys,a=Gi,o=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||o){o=be.T,be.T=null;var l=_e.p;_e.p=2;var f=ht;ht|=4;try{s2(n,a.alternate,a)}finally{ht=f,_e.p=l,be.T=o}}zt=3}}function s0(){if(zt===4||zt===3){zt=0;var n=nc;nc=null,cm();var a=Ys,o=Gi,l=yr,f=v2,h=(l&335544064)===l?10262:10256;if((o.subtreeFlags&h)!==0||(o.flags&h)!==0?zt=5:(zt=0,Gi=Ys=null,C2(a,a.pendingLanes)),h=a.pendingLanes,h===0&&(za=null),fm(l),o=o.stateNode,os&&typeof os.onCommitFiberRoot=="function")try{os.onCommitFiberRoot(wl,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=be.T,h=_e.p,_e.p=2,be.T=null;try{for(var v=a.onRecoverableError,_=0;_<f.length;_++){var L=f[_];v(L.value,{componentStack:L.stack})}}finally{be.T=o,_e.p=h}}if(f=sc,v=rc,rc=null,f!==null&&(sc=null,v===null&&(v=[]),n!==null))for(L=0;L<f.length;L++)o=(0,f[L])(v),o!==void 0&&n.finished.finally(o);(yr&3)!==0&&Cf(),vr(a),h=a.pendingLanes,(l&261930)!==0&&(h&42)!==0?a===Af?tu++:(tu=0,Af=a):(tu=0,Af=null),nu(0)}}function C2(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,Ul(a)))}function Cf(){return nc!==null&&(nc.skipTransition(),nc=null),t0(),n0(),s0(),r0()}function r0(){if(zt!==5)return!1;var n=Ys,a=Kg;Kg=0;var o=fm(yr),l=be.T,f=_e.p;try{_e.p=32>o?32:o,be.T=null,o=Jg,Jg=null;var h=Ys,v=yr;if(zt=0,Gi=Ys=null,yr=0,(ht&6)!==0)throw Error(r(331));var _=ht;if(ht|=4,m2(h.current),f2(h,h.current,v,o),ht=_,nu(0,!1),os&&typeof os.onPostCommitFiberRoot=="function")try{os.onPostCommitFiberRoot(wl,h)}catch{}return!0}finally{_e.p=f,be.T=l,C2(n,a)}}function I2(n,a,o){a=Ns(o,a),a=Tg(n.stateNode,a,2),n=Ia(n,a,2),n!==null&&(Sl(n,2),vr(n))}function Tt(n,a,o){if(n.tag===3)I2(n,n,o);else for(;a!==null;){if(a.tag===3){I2(a,n,o);break}else if(a.tag===1){var l=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(za===null||!za.has(l))){n=Ns(o,n),o=OT(2),l=Ia(a,o,2),l!==null&&(NT(o,l,a,n),Sl(l,2),vr(l));break}}a=a.return}}function a0(n,a,o){var l=n.pingCache;if(l===null){l=n.pingCache=new Qx;var f=new Set;l.set(a,f)}else f=l.get(a),f===void 0&&(f=new Set,l.set(a,f));f.has(o)||(Wg=!0,f.add(o),n=oC.bind(null,n,a,o),a.then(n,n))}function oC(n,a,o){var l=n.pingCache;l!==null&&l.delete(a),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,xt===n&&(it&o)===o&&((Pt===4||Pt===3&&(it&62914560)===it&&300>zn()-Ef)&&(ht&2)===0?ic(n,0):Sf|=o,tc===it&&(tc=0)),vr(n)}function R2(n,a){a===0&&(a=y1()),n=Oi(n,a),n!==null&&(Sl(n,a),vr(n))}function cC(n){var a=n.memoizedState,o=0;a!==null&&(o=a.retryLane),R2(n,o)}function lC(n,a){var o=0;switch(n.tag){case 31:case 13:var l=n.stateNode,f=n.memoizedState;f!==null&&(o=f.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(a),R2(n,o)}function uC(n,a){return bl(n,a)}var cc=null,lc=null,i0=!1,If=!1,o0=!1,Va=0;function vr(n){n!==lc&&n.next===null&&(lc===null?cc=lc=n:lc=lc.next=n),If=!0,i0||(i0=!0,fC())}function nu(n,a){if(!o0&&If){o0=!0;do for(var o=!1,l=cc;l!==null;){if(n!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var v=l.suspendedLanes,_=l.pingedLanes;h=(1<<31-cs(42|n)+1)-1,h&=f&~(v&~_),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(o=!0,U2(l,h))}else h=it,h=Td(l,l===xt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||Tl(l,h)||(o=!0,U2(l,h));l=l.next}while(o);o0=!1}}function dC(){j2()}function j2(){If=i0=!1;var n=0;Va!==0&&EC()&&(n=Va);for(var a=zn(),o=null,l=cc;l!==null;){var f=l.next,h=M2(l,a);h===0?(l.next=null,o===null?cc=f:o.next=f,f===null&&(lc=o)):(o=l,(n!==0||(h&3)!==0)&&(If=!0)),l=f}zt!==0&&zt!==5||nu(n),Va!==0&&(Va=0)}function M2(n,a){for(var o=n.suspendedLanes,l=n.pingedLanes,f=n.expirationTimes,h=n.pendingLanes&-62914561;0<h;){var v=31-cs(h),_=1<<v,L=f[v];L===-1?((_&o)===0||(_&l)!==0)&&(f[v]=xN(_,a)):L<=a&&(n.expiredLanes|=_),h&=~_}if(a=xt,o=it,o=Td(n,n===a?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l=n.callbackNode,o===0||n===a&&(wt===2||wt===9)||n.cancelPendingCommit!==null)return l!==null&&l!==null&&wa(l),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||Tl(n,o)){if(a=o&-o,a===n.callbackPriority)return a;switch(l!==null&&wa(l),fm(o)){case 2:case 8:o=Ce;break;case 32:o=Ye;break;case 268435456:o=ks;break;default:o=Ye}return l=D2.bind(null,n),o=bl(o,l),n.callbackPriority=a,n.callbackNode=o,a}return l!==null&&l!==null&&wa(l),n.callbackPriority=2,n.callbackNode=null,2}function D2(n,a){if(zt!==0&&zt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(Cf()&&n.callbackNode!==o)return null;var l=it;return l=Td(n,n===xt?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(w2(n,l,a),M2(n,zn()),n.callbackNode!=null&&n.callbackNode===o?D2.bind(null,n):null)}function U2(n,a){if(Cf())return null;w2(n,a,!0)}function fC(){kC(function(){(ht&6)!==0?bl(yd,dC):j2()})}function c0(){if(Va===0){var n=ji;n===0&&(n=vd,vd<<=1,(vd&261888)===0&&(vd=256)),Va=n}return Va}function B2(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ad(n)}function hC(n,a,o,l,f){if(a==="submit"&&o&&o.stateNode===f){var h=B2((f[Xn]||null).action),v=l.submitter;v&&(a=(a=v[Xn]||null)?B2(a.formAction):v.getAttribute("formAction"),a!==null&&(h=a,v=null));var _=new Cd("action","action",null,l,f);n.push({event:_,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Va!==0){var L=new FormData(f,v);gg(o,{pending:!0,data:L,method:f.method,action:h},null,L)}}else typeof h=="function"&&(_.preventDefault(),L=new FormData(f,v),gg(o,{pending:!0,data:L,method:f.method,action:h},h,L))},currentTarget:f}]})}}for(var l0=0;l0<Mm.length;l0++){var u0=Mm[l0],pC=u0.toLowerCase(),mC=u0[0].toUpperCase()+u0.slice(1);Fs(pC,"on"+mC)}Fs(lw,"onAnimationEnd"),Fs(uw,"onAnimationIteration"),Fs(dw,"onAnimationStart"),Fs("dblclick","onDoubleClick"),Fs("focusin","onFocus"),Fs("focusout","onBlur"),Fs(_x,"onTransitionRun"),Fs(kx,"onTransitionStart"),Fs(Ax,"onTransitionCancel"),Fs(fw,"onTransitionEnd"),Io("onMouseEnter",["mouseout","mouseover"]),Io("onMouseLeave",["mouseout","mouseover"]),Io("onPointerEnter",["pointerout","pointerover"]),Io("onPointerLeave",["pointerout","pointerover"]),_i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_i("onBeforeInput",["compositionend","keypress","textInput","paste"]),_i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var su="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),gC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(su));function L2(n,a){a=(a&4)!==0;for(var o=0;o<n.length;o++){var l=n[o],f=l.event;l=l.listeners;e:{var h=void 0;if(a)for(var v=l.length-1;0<=v;v--){var _=l[v],L=_.instance,ne=_.currentTarget;if(_=_.listener,L!==h&&f.isPropagationStopped())break e;h=_,f.currentTarget=ne;try{h(f)}catch(ie){jd(ie)}f.currentTarget=null,h=L}else for(v=0;v<l.length;v++){if(_=l[v],L=_.instance,ne=_.currentTarget,_=_.listener,L!==h&&f.isPropagationStopped())break e;h=_,f.currentTarget=ne;try{h(f)}catch(ie){jd(ie)}f.currentTarget=null,h=L}}}}function nt(n,a){var o=a[E1];o===void 0&&(o=a[E1]=new Set);var l=n+"__bubble";o.has(l)||(z2(a,n,2,!1),o.add(l))}function d0(n,a,o){var l=0;a&&(l|=4),z2(o,n,l,a)}var Rf="_reactListening"+Math.random().toString(36).slice(2);function f0(n){if(!n[Rf]){n[Rf]=!0,A1.forEach(function(o){o!=="selectionchange"&&(gC.has(o)||d0(o,!1,n),d0(o,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[Rf]||(a[Rf]=!0,d0("selectionchange",!1,a))}}function z2(n,a,o,l){switch(NS(a)){case 2:var f=c6;break;case 8:f=l6;break;default:f=R0}o=f.bind(null,a,o,n),f=void 0,!wm||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(f=!0),l?f!==void 0?n.addEventListener(a,o,{capture:!0,passive:f}):n.addEventListener(a,o,!0):f!==void 0?n.addEventListener(a,o,{passive:f}):n.addEventListener(a,o,!1)}function h0(n,a,o,l,f){var h=l;if((a&1)===0&&(a&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var _=l.stateNode.containerInfo;if(_===f)break;if(v===4)for(v=l.return;v!==null;){var L=v.tag;if((L===3||L===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;_!==null;){if(v=Ei(_),v===null)return;if(L=v.tag,L===5||L===6||L===26||L===27){l=h=v;continue e}_=_.parentNode}}l=l.return}z1(function(){var ne=h,ie=vm(o),ge=[];e:{var Q=hw.get(n);if(Q!==void 0){var ae=Cd,ke=n;switch(n){case"keypress":if(Nd(o)===0)break e;case"keydown":case"keyup":ae=ex;break;case"focusin":ke="focus",ae=_m;break;case"focusout":ke="blur",ae=_m;break;case"beforeblur":case"afterblur":ae=_m;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=P1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=PN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=ax;break;case lw:case uw:case dw:ae=HN;break;case fw:ae=ox;break;case"scroll":case"scrollend":ae=$N;break;case"wheel":ae=lx;break;case"copy":case"cut":case"paste":ae=ZN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=F1;break;case"submit":ae=sx;break;case"toggle":case"beforetoggle":ae=dx}var Re=(a&4)!==0,Xe=!Re&&(n==="scroll"||n==="scrollend"),ee=Re?Q!==null?Q+"Capture":null:Q;Re=[];for(var Z=ne,se;Z!==null;){var pe=Z;if(se=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||se===null||ee===null||(pe=kl(Z,ee),pe!=null&&Re.push(ru(Z,pe,se))),Xe)break;Z=Z.return}0<Re.length&&(Q=new ae(Q,ke,null,o,ie),ge.push({event:Q,listeners:Re}))}}if((a&7)===0){e:{if(ae=n==="mouseover"||n==="pointerover",Q=n==="mouseout"||n==="pointerout",ae&&o!==ym&&(ke=o.relatedTarget||o.fromElement)&&(Ei(ke)||ke[No]))break e;(Q||ae)&&(ke=ie.window===ie?ie:(ae=ie.ownerDocument)?ae.defaultView||ae.parentWindow:window,Q?(ae=o.relatedTarget||o.toElement,Q=ne,ae=ae?Ei(ae):null,ae!==null&&(Xe=c(ae),Re=ae.tag,ae!==Xe||Re!==5&&Re!==27&&Re!==6)&&(ae=null)):(Q=null,ae=ne),Q!==ae&&(Re=P1,pe="onMouseLeave",ee="onMouseEnter",Z="mouse",(n==="pointerout"||n==="pointerover")&&(Re=F1,pe="onPointerLeave",ee="onPointerEnter",Z="pointer"),Xe=Q==null?ke:_l(Q),se=ae==null?ke:_l(ae),ke=new Re(pe,Z+"leave",Q,o,ie),ke.target=Xe,ke.relatedTarget=se,pe=null,Ei(ie)===ne&&(Re=new Re(ee,Z+"enter",ae,o,ie),Re.target=se,Re.relatedTarget=Xe,pe=Re),Xe=pe,Re=Q&&ae?G(Q,ae,yC):null,Q!==null&&$2(ge,ke,Q,Re,!1),ae!==null&&Xe!==null&&$2(ge,Xe,ae,Re,!0)))}e:{if(Q=ne?_l(ne):window,ae=Q.nodeName&&Q.nodeName.toLowerCase(),ae==="select"||ae==="input"&&Q.type==="file")var Ie=J1;else if(X1(Q))if(Q1)Ie=Tx;else{Ie=bx;var ot=vx}else ae=Q.nodeName,!ae||ae.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?ne&&gm(ne.elementType)&&(Ie=J1):Ie=wx;if(Ie&&(Ie=Ie(n,ne))){K1(ge,Ie,o,ie);break e}ot&&ot(n,Q,ne)}switch(ot=ne?_l(ne):window,n){case"focusin":(X1(ot)||ot.contentEditable==="true")&&(Bo=ot,Im=ne,jl=null);break;case"focusout":jl=Im=Bo=null;break;case"mousedown":Rm=!0;break;case"contextmenu":case"mouseup":case"dragend":Rm=!1,ow(ge,o,ie);break;case"selectionchange":if(Ex)break;case"keydown":case"keyup":ow(ge,o,ie)}var Ue;if(Am)e:{switch(n){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Uo?Y1(n,o)&&(Ve="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(Ve="onCompositionStart");Ve&&(H1&&o.locale!=="ko"&&(Uo||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Uo&&(Ue=$1()):(Sa=ie,Tm="value"in Sa?Sa.value:Sa.textContent,Uo=!0)),ot=jf(ne,Ve),0<ot.length&&(Ve=new G1(Ve,n,null,o,ie),ge.push({event:Ve,listeners:ot}),Ue?Ve.data=Ue:(Ue=W1(o),Ue!==null&&(Ve.data=Ue)))),(Ue=hx?px(n,o):mx(n,o))&&(Ve=jf(ne,"onBeforeInput"),0<Ve.length&&(ot=new G1("onBeforeInput","beforeinput",null,o,ie),ge.push({event:ot,listeners:Ve}),ot.data=Ue)),hC(ge,n,ne,o,ie)}L2(ge,a)})}function ru(n,a,o){return{instance:n,listener:a,currentTarget:o}}function jf(n,a){for(var o=a+"Capture",l=[];n!==null;){var f=n,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=kl(n,o),f!=null&&l.unshift(ru(n,f,h)),f=kl(n,a),f!=null&&l.push(ru(n,f,h))),n.tag===3)return l;n=n.return}return[]}function yC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function $2(n,a,o,l,f){for(var h=a._reactName,v=[];o!==null&&o!==l;){var _=o,L=_.alternate,ne=_.stateNode;if(_=_.tag,L!==null&&L===l)break;_!==5&&_!==26&&_!==27||ne===null||(L=ne,f?(ne=kl(o,h),ne!=null&&v.unshift(ru(o,ne,L))):f||(ne=kl(o,h),ne!=null&&v.push(ru(o,ne,L)))),o=o.return}v.length!==0&&n.push({event:a,listeners:v})}var vC=/\r\n?/g,bC=/\u0000|\uFFFD/g;function V2(n){return(typeof n=="string"?n:""+n).replace(vC,`
|
|
840
840
|
`).replace(bC,"")}function P2(n,a){return a=V2(a),V2(n)===a}function St(n,a,o,l,f,h){switch(o){case"children":if(typeof l=="string")a==="body"||a==="textarea"&&l===""||jo(n,l);else if(typeof l=="number"||typeof l=="bigint")a!=="body"&&jo(n,""+l);else return;break;case"className":kd(n,"class",l);break;case"tabIndex":kd(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":kd(n,o,l);break;case"style":B1(n,l,h);return;case"data":if(a!=="object"){kd(n,"data",l);break}case"src":case"href":if(l===""&&(a!=="a"||o!=="href")){n.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(o);break}l=Ad(l),n.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){n.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(o==="formAction"?(a!=="input"&&St(n,a,"name",f.name,f,null),St(n,a,"formEncType",f.formEncType,f,null),St(n,a,"formMethod",f.formMethod,f,null),St(n,a,"formTarget",f.formTarget,f,null)):(St(n,a,"encType",f.encType,f,null),St(n,a,"method",f.method,f,null),St(n,a,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(o);break}l=Ad(l),n.setAttribute(o,l);break;case"onClick":l!=null&&(n.onclick=cr);return;case"onScroll":l!=null&&nt("scroll",n);return;case"onScrollEnd":l!=null&&nt("scrollend",n);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(f.children!=null)throw Error(r(60));h?.__html!==o&&(n.innerHTML=o)}}break;case"multiple":n.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":n.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){n.removeAttribute("xlink:href");break}o=Ad(l),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(o,l):n.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":l===!0?n.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(o,l):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?n.setAttribute(o,l):n.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?n.removeAttribute(o):n.setAttribute(o,l);break;case"popover":nt("beforetoggle",n),nt("toggle",n),_d(n,"popover",l);break;case"xlinkActuate":Ur(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ur(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ur(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ur(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ur(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ur(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ur(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ur(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ur(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":_d(n,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")o=LN.get(o)||o,_d(n,o,l);else return}dt=!0}function p0(n,a,o,l,f,h){switch(o){case"style":B1(n,l,h);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(f.children!=null)throw Error(r(60));h?.__html!==o&&(n.innerHTML=o)}}break;case"children":if(typeof l=="string")jo(n,l);else if(typeof l=="number"||typeof l=="bigint")jo(n,""+l);else return;break;case"onScroll":l!=null&&nt("scroll",n);return;case"onScrollEnd":l!=null&&nt("scrollend",n);return;case"onClick":l!=null&&(n.onclick=cr);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!O1.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(f=o.endsWith("Capture"),h=o.slice(2,f?o.length-7:void 0),a=n[Xn]||null,a=a!=null?a[o]:null,typeof a=="function"&&n.removeEventListener(h,a,f),typeof l=="function")){typeof a!="function"&&a!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(h,l,f);break e}dt=!0,o in n?n[o]=l:l===!0?n.setAttribute(o,""):_d(n,o,l)}return}dt=!0}function xn(n,a,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",n),nt("load",n);var l=!1,f=!1,h;for(h in o)if(o.hasOwnProperty(h)){var v=o[h];if(v!=null)switch(h){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:St(n,a,h,v,o,null)}}f&&St(n,a,"srcSet",o.srcSet,o,null),l&&St(n,a,"src",o.src,o,null);return;case"input":nt("invalid",n);var _=h=v=f=null,L=null,ne=null;for(l in o)if(o.hasOwnProperty(l)){var ie=o[l];if(ie!=null)switch(l){case"name":f=ie;break;case"type":v=ie;break;case"checked":L=ie;break;case"defaultChecked":ne=ie;break;case"value":h=ie;break;case"defaultValue":_=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,a));break;default:St(n,a,l,ie,o,null)}}j1(n,h,_,L,ne,v,f,!1);return;case"select":nt("invalid",n),l=v=h=null;for(f in o)if(o.hasOwnProperty(f)&&(_=o[f],_!=null))switch(f){case"value":h=_;break;case"defaultValue":v=_;break;case"multiple":l=_;default:St(n,a,f,_,o,null)}a=h,o=v,n.multiple=!!l,a!=null?Ro(n,!!l,a,!1):o!=null&&Ro(n,!!l,o,!0);return;case"textarea":nt("invalid",n),h=f=l=null;for(v in o)if(o.hasOwnProperty(v)&&(_=o[v],_!=null))switch(v){case"value":l=_;break;case"defaultValue":f=_;break;case"children":h=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:St(n,a,v,_,o,null)}D1(n,l,f,h);return;case"option":for(L in o)o.hasOwnProperty(L)&&(l=o[L],l!=null)&&(L==="selected"?n.selected=l&&typeof l!="function"&&typeof l!="symbol":St(n,a,L,l,o,null));return;case"dialog":nt("beforetoggle",n),nt("toggle",n),nt("cancel",n),nt("close",n);break;case"iframe":case"object":nt("load",n);break;case"video":case"audio":for(l=0;l<su.length;l++)nt(su[l],n);break;case"image":nt("error",n),nt("load",n);break;case"details":nt("toggle",n);break;case"embed":case"source":case"link":nt("error",n),nt("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in o)if(o.hasOwnProperty(ne)&&(l=o[ne],l!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:St(n,a,ne,l,o,null)}return;default:if(gm(a)){for(ie in o)o.hasOwnProperty(ie)&&(l=o[ie],l!==void 0&&p0(n,a,ie,l,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(l=o[_],l!=null&&St(n,a,_,l,o,null))}var wC={};function TC(n,a,o,l){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,v=null,_=null,L=null,ne=null,ie=null;for(ae in o){var ge=o[ae];if(o.hasOwnProperty(ae)&&ge!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":L=ge;default:l.hasOwnProperty(ae)||St(n,a,ae,null,l,ge)}}for(var Q in l){var ae=l[Q];if(ge=o[Q],l.hasOwnProperty(Q)&&(ae!=null||ge!=null))switch(Q){case"type":ae!==ge&&(dt=!0),h=ae;break;case"name":ae!==ge&&(dt=!0),f=ae;break;case"checked":ae!==ge&&(dt=!0),ne=ae;break;case"defaultChecked":ae!==ge&&(dt=!0),ie=ae;break;case"value":ae!==ge&&(dt=!0),v=ae;break;case"defaultValue":ae!==ge&&(dt=!0),_=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,a));break;default:ae!==ge&&St(n,a,Q,ae,l,ge)}}pm(n,v,_,L,ne,ie,h,f);return;case"select":ae=v=_=Q=null;for(h in o)if(L=o[h],o.hasOwnProperty(h)&&L!=null)switch(h){case"value":break;case"multiple":ae=L;default:l.hasOwnProperty(h)||St(n,a,h,null,l,L)}for(f in l)if(h=l[f],L=o[f],l.hasOwnProperty(f)&&(h!=null||L!=null))switch(f){case"value":h!==L&&(dt=!0),Q=h;break;case"defaultValue":h!==L&&(dt=!0),_=h;break;case"multiple":h!==L&&(dt=!0),v=h;default:h!==L&&St(n,a,f,h,l,L)}a=_,o=v,l=ae,Q!=null?Ro(n,!!o,Q,!1):!!l!=!!o&&(a!=null?Ro(n,!!o,a,!0):Ro(n,!!o,o?[]:"",!1));return;case"textarea":ae=Q=null;for(_ in o)if(f=o[_],o.hasOwnProperty(_)&&f!=null&&!l.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:St(n,a,_,null,l,f)}for(v in l)if(f=l[v],h=o[v],l.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":f!==h&&(dt=!0),Q=f;break;case"defaultValue":f!==h&&(dt=!0),ae=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&St(n,a,v,f,l,h)}M1(n,Q,ae);return;case"option":for(var ke in o)Q=o[ke],o.hasOwnProperty(ke)&&Q!=null&&!l.hasOwnProperty(ke)&&(ke==="selected"?n.selected=!1:St(n,a,ke,null,l,Q));for(L in l)Q=l[L],ae=o[L],l.hasOwnProperty(L)&&Q!==ae&&(Q!=null||ae!=null)&&(L==="selected"?(Q!==ae&&(dt=!0),n.selected=Q&&typeof Q!="function"&&typeof Q!="symbol"):St(n,a,L,Q,l,ae));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Re in o)Q=o[Re],o.hasOwnProperty(Re)&&Q!=null&&!l.hasOwnProperty(Re)&&St(n,a,Re,null,l,Q);for(ne in l)if(Q=l[ne],ae=o[ne],l.hasOwnProperty(ne)&&Q!==ae&&(Q!=null||ae!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,a));break;default:St(n,a,ne,Q,l,ae)}return;default:if(gm(a)){for(var Xe in o)Q=o[Xe],o.hasOwnProperty(Xe)&&Q!==void 0&&!l.hasOwnProperty(Xe)&&p0(n,a,Xe,void 0,l,Q);for(ie in l)Q=l[ie],ae=o[ie],!l.hasOwnProperty(ie)||Q===ae||Q===void 0&&ae===void 0||p0(n,a,ie,Q,l,ae);return}}for(var ee in o)Q=o[ee],o.hasOwnProperty(ee)&&Q!=null&&!l.hasOwnProperty(ee)&&St(n,a,ee,null,l,Q);for(ge in l)Q=l[ge],ae=o[ge],!l.hasOwnProperty(ge)||Q===ae||Q==null&&ae==null||St(n,a,ge,Q,l,ae)}function G2(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function SC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,a=0,o=performance.getEntriesByType("resource"),l=0;l<o.length;l++){var f=o[l],h=f.transferSize,v=f.initiatorType,_=f.duration;if(h&&_&&G2(v)){for(v=0,_=f.responseEnd,l+=1;l<o.length;l++){var L=o[l],ne=L.startTime;if(ne>_)break;var ie=L.transferSize,ge=L.initiatorType;ie&&G2(ge)&&(L=L.responseEnd,v+=ie*(L<_?1:(_-ne)/(L-ne)))}if(--l,a+=8*(h+v)/(f.duration/1e3),n++,10<n)break}}if(0<n)return a/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var m0=null,g0=null;function au(n){return n.nodeType===9?n:n.ownerDocument}function F2(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function H2(n,a){if(n===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&a==="foreignObject"?0:n}function q2(n,a,o,l){return o=au(o).createElement(n),o[_n]=l,o[Xn]=a,xn(o,n,a),gn(o),o}function y0(n,a){return n==="textarea"||n==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var v0=null;function EC(){var n=window.event;return n&&n.type==="popstate"?n===v0?!1:(v0=n,!0):(v0=null,!1)}var b0=typeof setTimeout=="function"?setTimeout:void 0,_C=typeof clearTimeout=="function"?clearTimeout:void 0,Z2=typeof Promise=="function"?Promise:void 0,Y2=typeof requestAnimationFrame=="function"?requestAnimationFrame:b0,kC=typeof queueMicrotask=="function"?queueMicrotask:typeof Z2<"u"?function(n){return Z2.resolve(null).then(n).catch(AC)}:b0;function AC(n){setTimeout(function(){throw n})}function Pa(n){return n==="head"}function W2(n,a){var o=a,l=0;do{var f=o.nextSibling;if(n.removeChild(o),f&&f.nodeType===8)if(o=f.data,o==="/$"||o==="/&"){if(l===0){n.removeChild(f),gc(a);return}l--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")l++;else if(o==="html")O0(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,O0(o);for(var h=o.firstChild;h;){var v=h.nextSibling,_=h.nodeName;h[El]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&h.rel.toLowerCase()==="stylesheet"||o.removeChild(h),h=v}}else o==="body"&&O0(n.ownerDocument.body);o=f}while(o);gc(a)}function X2(n,a){var o=n;n=0;do{var l=o.nextSibling;if(o.nodeType===1?a?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(a?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),l&&l.nodeType===8)if(o=l.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=l}while(o)}function K2(n,a,o){if(a=CSS.escape(a)!==a?"r-"+btoa(a).replace(/=/g,""):a,n.style.viewTransitionName=a,o!=null&&(n.style.viewTransitionClass=o),o=getComputedStyle(n),o.display==="inline"){if(a=n.getClientRects(),a.length===1)var l=1;else for(var f=l=0;f<a.length;f++){var h=a[f];0<h.width&&0<h.height&&l++}l===1&&(n=n.style,n.display=a.length===1?"inline-block":"block",n.marginTop="-"+o.paddingTop,n.marginBottom="-"+o.paddingBottom)}}function J2(n,a){n=n.style,a=a.style;var o=a!=null?a.hasOwnProperty("viewTransitionName")?a.viewTransitionName:a.hasOwnProperty("view-transition-name")?a["view-transition-name"]:null:null;n.viewTransitionName=o==null||typeof o=="boolean"?"":(""+o).trim(),o=a!=null?a.hasOwnProperty("viewTransitionClass")?a.viewTransitionClass:a.hasOwnProperty("view-transition-class")?a["view-transition-class"]:null:null,n.viewTransitionClass=o==null||typeof o=="boolean"?"":(""+o).trim(),n.display==="inline-block"&&(a==null?n.display=n.margin="":(o=a.display,n.display=o==null||typeof o=="boolean"?"":o,o=a.margin,o!=null?n.margin=o:(o=a.hasOwnProperty("marginTop")?a.marginTop:a["margin-top"],n.marginTop=o==null||typeof o=="boolean"?"":o,a=a.hasOwnProperty("marginBottom")?a.marginBottom:a["margin-bottom"],n.marginBottom=a==null||typeof a=="boolean"?"":a)))}function OC(n,a,o){return o=o.ownerDocument.defaultView,{rect:n,abs:a.position==="absolute"||a.position==="fixed",clip:a.clipPath!=="none"||a.overflow!=="visible"||a.filter!=="none"||a.mask!=="none"||a.mask!=="none"||a.borderRadius!=="0px",view:0<=n.bottom&&0<=n.right&&n.top<=o.innerHeight&&n.left<=o.innerWidth}}function w0(n){var a=n.getBoundingClientRect(),o=getComputedStyle(n);return OC(a,o,n)}function NC(n){return n.documentElement.clientHeight}function xC(n){this.addEventListener("load",n),this.addEventListener("error",n)}function CC(n,a,o,l,f,h,v,_,L){var ne=a.nodeType===9?a:a.ownerDocument;try{var ie=ne.startViewTransition({update:function(){var Q=ne.defaultView,ae=Q.navigation&&Q.navigation.transition,ke=ne.fonts.status;l();var Re=[];if(ke==="loaded"&&(NC(ne),ne.fonts.status==="loading"&&Re.push(ne.fonts.ready)),ke=Re.length,n!==null)for(var Xe=n.suspenseyImages,ee=0,Z=0;Z<Xe.length;Z++){var se=Xe[Z];if(!se.complete){var pe=se.getBoundingClientRect();if(0<pe.bottom&&0<pe.right&&pe.top<Q.innerHeight&&pe.left<Q.innerWidth){if(ee+=bS(se),ee>Uf){Re.length=ke;break}se=new Promise(xC.bind(se)),Re.push(se)}}}if(0<Re.length)return Q=Promise.race([Promise.all(Re),new Promise(function(Ie){return setTimeout(Ie,500)})]).then(f,f),(ae?Promise.allSettled([ae.finished,Q]):Q).then(h,h);if(f(),ae)return ae.finished.then(h,h);h()},types:o});ne.__reactViewTransition=ie;var ge=[];return ie.ready.then(function(){for(var Q=ne.documentElement.getAnimations({subtree:!0}),ae=0;ae<Q.length;ae++){var ke=Q[ae],Re=ke.effect,Xe=Re.pseudoElement;if(Xe!=null&&Xe.startsWith("::view-transition")){ge.push(ke),ke=Re.getKeyframes();for(var ee=Xe=void 0,Z=!0,se=0;se<ke.length;se++){var pe=ke[se],Ie=pe.width;if(Xe===void 0)Xe=Ie;else if(Xe!==Ie){Z=!1;break}if(Ie=pe.height,ee===void 0)ee=Ie;else if(ee!==Ie){Z=!1;break}delete pe.width,delete pe.height,pe.transform==="none"&&delete pe.transform}Z&&Xe!==void 0&&ee!==void 0&&(Re.setKeyframes(ke),Z=getComputedStyle(Re.target,Re.pseudoElement),Z.width!==Xe||Z.height!==ee)&&(Z=ke[0],Z.width=Xe,Z.height=ee,Z=ke[ke.length-1],Z.width=Xe,Z.height=ee,Re.setKeyframes(ke))}}v()},function(Q){ne.__reactViewTransition===ie&&(ne.__reactViewTransition=null);try{typeof Q=="object"&&Q!==null&&Q.name==="InvalidStateError"&&(Q.message==="View transition was skipped because document visibility state is hidden."||Q.message==="Skipping view transition because document visibility state has become hidden."||Q.message==="Skipping view transition because viewport size changed."||Q.message==="Transition was aborted because of invalid state")&&(Q=null),Q!==null&&L(Q)}finally{l(),f(),v()}}),ie.finished.finally(function(){for(var Q=0;Q<ge.length;Q++)ge[Q].cancel();ne.__reactViewTransition===ie&&(ne.__reactViewTransition=null),_()}),ie}catch{return l(),f(),v(),null}}function Fi(n,a){this._scope=document.documentElement,this._selector="::view-transition-"+n+"("+a+")"}Fi.prototype.animate=function(n,a){return a=typeof a=="number"?{duration:a}:J({},a),a.pseudoElement=this._selector,this._scope.animate(n,a)},Fi.prototype.getAnimations=function(){for(var n=this._scope,a=this._selector,o=n.getAnimations({subtree:!0}),l=[],f=0;f<o.length;f++){var h=o[f].effect;h!==null&&h.target===n&&h.pseudoElement===a&&l.push(o[f])}return l},Fi.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Q2(n){return{name:n,group:new Fi("group",n),imagePair:new Fi("image-pair",n),old:new Fi("old",n),new:new Fi("new",n)}}function gs(n){this._fragmentFiber=n,this._observers=this._eventListeners=null}gs.prototype.addEventListener=function(n,a,o){var l=null,f=null;if(!(o!=null&&typeof o!="boolean"&&(l=o.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var h=this._eventListeners;if(tS(h,n,a,o)===-1){var v=this,_=a;o!=null&&typeof o!="boolean"&&o.once===!0&&(_=function(L){v.removeEventListener(n,a,o),typeof a=="function"?a.call(this,L):a.handleEvent(L)}),l!==null&&(f=v.removeEventListener.bind(v,n,a,o),l.addEventListener("abort",f,{once:!0}),f=l.removeEventListener.bind(l,"abort",f)),l=uc(o),h.push({type:n,listener:a,optionsOrUseCapture:o,attachedListener:_,cleanup:f}),y(this._fragmentFiber.child,!1,IC,n,_,l)}this._eventListeners=h}};function IC(n,a,o,l){return R(n).addEventListener(a,o,l),!1}gs.prototype.removeEventListener=function(n,a,o){var l=this._eventListeners;if(l!==null&&(a=tS(l,n,a,o),a!==-1)){var f=l[a];o=f.attachedListener;var h=f.cleanup;f=uc(f.optionsOrUseCapture),y(this._fragmentFiber.child,!1,RC,n,o,f),l.splice(a,1),h!==null&&h()}};function RC(n,a,o,l){return R(n).removeEventListener(a,o,l),!1}function uc(n){return n!=null&&typeof n!="boolean"&&(n.once===!0||n.signal instanceof AbortSignal)?{capture:n.capture,passive:n.passive}:n}function eS(n){return n==null?"c=0":typeof n=="boolean"?"c="+(n?"1":"0"):"c="+(n.capture?"1":"0")}function tS(n,a,o,l){if(n.length===0)return-1;l=eS(l);for(var f=0;f<n.length;f++){var h=n[f];if(h.type===a&&h.listener===o&&eS(h.optionsOrUseCapture)===l)return f}return-1}gs.prototype.dispatchEvent=function(n){var a=b(this._fragmentFiber);if(a===null)return!0;a=R(a);var o=this._eventListeners;if(o!==null&&0<o.length||!n.bubbles){var l=a.nodeType===9?a.createComment(""):document.createTextNode("");if(o)for(var f=0;f<o.length;f++){var h=o[f];l.addEventListener(h.type,h.attachedListener,uc(h.optionsOrUseCapture))}if(a.appendChild(l),n=l.dispatchEvent(n),o)for(f=0;f<o.length;f++)h=o[f],l.removeEventListener(h.type,h.attachedListener,uc(h.optionsOrUseCapture));return a.removeChild(l),n}return a.dispatchEvent(n)},gs.prototype.focus=function(n){y(this._fragmentFiber.child,!0,nS,n,void 0,void 0)};function nS(n,a){return n.tag===6?!1:(n=R(n),FC(n,a))}gs.prototype.focusLast=function(n){var a=[];y(this._fragmentFiber.child,!0,T0,a,void 0,void 0);for(var o=a.length-1;0<=o&&!nS(a[o],n);o--);};function T0(n,a){return a.push(n),!1}gs.prototype.blur=function(){var n=b(this._fragmentFiber);n!==null&&(n=R(n),n=au(n).activeElement,n!==null&&y(this._fragmentFiber.child,!1,jC,n,void 0,void 0))};function jC(n,a){return n.tag===6?!1:(n=R(n),n===a||n.contains(a)?(a.blur(),!0):!1)}gs.prototype.observeUsing=function(n){this._observers===null&&(this._observers=new Set),this._observers.add(n),y(this._fragmentFiber.child,!1,MC,n,void 0,void 0)};function MC(n,a){return n.tag===6||(n=R(n),a.observe(n)),!1}gs.prototype.unobserveUsing=function(n){var a=this._observers;if(a!==null&&a.has(n)){a.delete(n),y(this._fragmentFiber.child,!1,DC,n,void 0,void 0);for(var o=a=0;o<Ws.length;o++){var l=Ws[o];l.fragmentInstance===this&&l.observer===n?n.unobserve(l.instance):Ws[a++]=l}Ws.length=a}};function DC(n,a){return n.tag===6||(n=R(n),a.unobserve(n)),!1}var Ws=[],S0=!1;function UC(n,a,o){Ws.push({fragmentInstance:n,observer:a,instance:o}),S0||(S0=!0,HC(function(){S0=!1;var l=Ws;Ws=[];for(var f=0;f<l.length;f++){var h=l[f];h.observer.unobserve(h.instance)}}))}gs.prototype.getClientRects=function(){var n=[];return y(this._fragmentFiber.child,!1,BC,n,void 0,void 0),n};function BC(n,a){if(n.tag===6){n=n.stateNode;var o=n.ownerDocument.createRange();o.selectNodeContents(n),a.push.apply(a,o.getClientRects())}else n=R(n),a.push.apply(a,n.getClientRects());return!1}gs.prototype.getRootNode=function(n){var a=b(this._fragmentFiber);return a===null?this:R(a).getRootNode(n)},gs.prototype.compareDocumentPosition=function(n){var a=b(this._fragmentFiber);if(a===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var o=[];y(this._fragmentFiber.child,!1,T0,o,void 0,void 0);var l=R(a);if(o.length===0){if(o=l,E(this._fragmentFiber)){e:{for(a=this._fragmentFiber.return;a!==null;){if(a.tag===4){a=a.stateNode.containerInfo;break e}if(a.tag===3||a.tag===5||a.tag===27)break;a=a.return}a=null}a!=null&&(o=a)}a=this._fragmentFiber;var f=l=o.compareDocumentPosition(n);return o===n?f=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(o=O(a)[1],o===null?f=Node.DOCUMENT_POSITION_PRECEDING:(n=R(o).compareDocumentPosition(n),f=n===0||n&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),f|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}a=R(o[0]),f=R(o[o.length-1]);var h=E(this._fragmentFiber)?a.parentElement:l;if(h==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=h.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY,h=h.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY;var v=a.compareDocumentPosition(n),_=f.compareDocumentPosition(n),L=v&Node.DOCUMENT_POSITION_CONTAINED_BY||_&Node.DOCUMENT_POSITION_CONTAINED_BY;return _=l&&h&&v&Node.DOCUMENT_POSITION_FOLLOWING&&_&Node.DOCUMENT_POSITION_PRECEDING,a=l&&a===n||h&&f===n||L||_?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&a===n||!h&&f===n?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:v,a&Node.DOCUMENT_POSITION_DISCONNECTED||a&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||LC(a,this._fragmentFiber,o[0],o[o.length-1],n)?a:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function LC(n,a,o,l,f){var h=Ei(f);if(n&Node.DOCUMENT_POSITION_CONTAINED_BY){if(o=!!h)e:{for(;h!==null;){if(h.tag===7&&(h===a||h.alternate===a)){o=!0;break e}h=h.return}o=!1}return o}if(n&Node.DOCUMENT_POSITION_CONTAINS){if(h===null)return h=f.ownerDocument,f===h||f===h.documentElement||f===h.body;e:{for(h=a,a=b(a);h!==null;){if(!(h.tag!==5&&h.tag!==3&&h.tag!==27||h!==a&&h.alternate!==a)){h=!0;break e}h=h.return}h=!1}return h}return n&Node.DOCUMENT_POSITION_PRECEDING?((a=!!h)&&!(a=h===o)&&(a=G(o,h,me),a===null?a=!1:(y(a,!0,W,h,o),h=$,$=null,a=h!==null)),a):n&Node.DOCUMENT_POSITION_FOLLOWING?((a=!!h)&&!(a=h===l)&&(a=G(l,h,me),a===null?a=!1:(y(a,!0,oe,h,l),h=$,x=$=null,a=h!==null)),a):!1}function sS(n,a){var o=n.ownerDocument.createRange();o.selectNodeContents(n),n=o.getBoundingClientRect(),window.scrollTo(window.scrollX+n.left,a?window.scrollY+n.top:window.scrollY+n.bottom-window.innerHeight)}gs.prototype.scrollIntoView=function(n){if(typeof n=="object")throw Error(r(566));var a=[];y(this._fragmentFiber.child,!1,T0,a,void 0,void 0);var o=n!==!1;if(a.length===0){var l=O(this._fragmentFiber);if(l=o?l[1]||l[0]||b(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){n=R(l),sS(n,o);return}if(l=R(l),l.nodeType!==9){if(l.nodeType===11){o="host"in l?l.host:null,o!==null&&o.scrollIntoView(n);return}l.scrollIntoView(n)}}for(l=o?a.length-1:0;l!==(o?-1:a.length);){var f=a[l];f.tag===6?(f=R(f),sS(f,o)):R(f).scrollIntoView(n),l+=o?-1:1}};function zC(n,a){return n=R(n),rS(n,a),!1}function rS(n,a){n.reactFragments==null&&(n.reactFragments=new Set),n.reactFragments.add(a)}function aS(n,a){var o=a._eventListeners;if(o!==null)for(var l=0;l<o.length;l++){var f=o[l];n.addEventListener(f.type,f.attachedListener,uc(f.optionsOrUseCapture))}n.nodeType!==3&&(o=a._observers,o!==null&&o.forEach(function(h){for(var v=0,_=0;_<Ws.length;_++){var L=Ws[_];(L.fragmentInstance!==a||L.observer!==h||L.instance!==n)&&(Ws[v++]=L)}Ws.length=v,h.observe(n)}),rS(n,a))}function $C(n,a){var o=a._eventListeners;if(o!==null)for(var l=0;l<o.length;l++){var f=o[l];n.removeEventListener(f.type,f.attachedListener,uc(f.optionsOrUseCapture))}n.nodeType!==3&&(o=a._observers,o!==null&&o.forEach(function(h){typeof h.rootMargin=="string"?UC(a,h,n):h.unobserve(n)}),n.reactFragments!=null&&n.reactFragments.delete(a))}function E0(n){var a=n.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var o=a;switch(a=a.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":E0(o),Ed(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function VC(n,a,o,l){for(;n.nodeType===1;){var f=o;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[El])switch(a){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(h=n.getAttribute("rel"),h==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(h!==f.rel||n.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||n.getAttribute("title")!==(f.title==null?null:f.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(h=n.getAttribute("src"),(h!==(f.src==null?null:f.src)||n.getAttribute("type")!==(f.type==null?null:f.type)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&n.getAttribute("name")===h)return n}else return n;if(n=js(n.nextSibling),n===null)break}return null}function PC(n,a,o){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=js(n.nextSibling),n===null))return null;return n}function iS(n,a){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=js(n.nextSibling),n===null))return null;return n}function _0(n){return n.data==="$?"||n.data==="$~"}function k0(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function GC(n,a){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=a;else if(n.data!=="$?"||o.readyState!=="loading")a();else{var l=function(){a(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),n._reactRetry=l}}function js(n){for(;n!=null;n=n.nextSibling){var a=n.nodeType;if(a===1||a===3)break;if(a===8){if(a=n.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return n}var A0=null;function oS(n){n=n.nextSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(a===0)return js(n.nextSibling);a--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||a++}n=n.nextSibling}return null}function cS(n){n=n.previousSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(a===0)return n;a--}else o!=="/$"&&o!=="/&"||a++}n=n.previousSibling}return null}function FC(n,a){function o(){l=!0}if(n.ownerDocument.activeElement===n)return!0;var l=!1;try{n.ownerDocument.addEventListener("focus",o,!0),(n.focus||HTMLElement.prototype.focus).call(n,a)}finally{n.ownerDocument.removeEventListener("focus",o,!0)}return l}function HC(n){Y2(function(){Y2(function(a){return n(a)})})}function lS(n,a,o){switch(a=au(o),n){case"html":if(n=a.documentElement,!n)throw Error(r(452));return n;case"head":if(n=a.head,!n)throw Error(r(453));return n;case"body":if(n=a.body,!n)throw Error(r(454));return n;default:throw Error(r(451))}}function uS(n,a,o){for(var l in o){var f=o[l];o.hasOwnProperty(l)&&f!=null&&St(n,a,l,null,wC,f)}o.dangerouslySetInnerHTML!=null&&(n.textContent=""),n.onclick===cr&&(n.onclick=null),Ed(n)}function O0(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);Ed(n)}var Ms=new Map,dS=new Set;function iu(n){if(typeof n.getRootNode=="function"){var a=n.getRootNode();if(a.nodeType===9||a.nodeType===11)return a}return n.nodeType===9?n:n.ownerDocument}var Wr=_e.d;_e.d={f:qC,r:ZC,D:YC,C:WC,L:XC,m:KC,X:QC,S:JC,M:e6};function qC(){var n=Wr.f(),a=Of();return n||a}function ZC(n){var a=xo(n);a!==null&&a.tag===5&&a.type==="form"?hT(a):Wr.r(n)}var dc=typeof document>"u"?null:document;function fS(n,a,o){var l=dc;if(l&&typeof a=="string"&&a){var f=As(a);f='link[rel="'+n+'"][href="'+f+'"]',typeof o=="string"&&(f+='[crossorigin="'+o+'"]'),dS.has(f)||(dS.add(f),n={rel:n,crossOrigin:o,href:a},l.querySelector(f)===null&&(a=l.createElement("link"),xn(a,"link",n),gn(a),l.head.appendChild(a)))}}function YC(n){Wr.D(n),fS("dns-prefetch",n,null)}function WC(n,a){Wr.C(n,a),fS("preconnect",n,a)}function XC(n,a,o){Wr.L(n,a,o);var l=dc;if(l&&n&&a){var f='link[rel="preload"][as="'+As(a)+'"]';a==="image"&&o&&o.imageSrcSet?(f+='[imagesrcset="'+As(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(f+='[imagesizes="'+As(o.imageSizes)+'"]')):f+='[href="'+As(n)+'"]';var h=f;switch(a){case"style":h=fc(n);break;case"script":h=hc(n)}if(!(Ms.has(h)||(n=J({rel:"preload",href:a==="image"&&o&&o.imageSrcSet?void 0:n,as:a},o),Ms.set(h,n),l.querySelector(f)!==null||a==="style"&&l.querySelector(ou(h))||a==="script"&&l.querySelector(cu(h))))){var v=l.createElement("link");xn(v,"link",n),a==="style"&&(v[Sd]=!0,v.onload=v.onerror=function(){k1(v)}),gn(v),l.head.appendChild(v)}}}function KC(n,a){Wr.m(n,a);var o=dc;if(o&&n){var l=a&&typeof a.as=="string"?a.as:"script",f='link[rel="modulepreload"][as="'+As(l)+'"][href="'+As(n)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=hc(n)}if(!Ms.has(h)&&(n=J({rel:"modulepreload",href:n},a),Ms.set(h,n),o.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(cu(h)))return}l=o.createElement("link"),xn(l,"link",n),gn(l),o.head.appendChild(l)}}}function JC(n,a,o){Wr.S(n,a,o);var l=dc;if(l&&n){var f=Co(l).hoistableStyles,h=fc(n);a=a||"default";var v=f.get(h);if(!v){var _={loading:0,preload:null};if(v=l.querySelector(ou(h)))_.loading=5;else{n=J({rel:"stylesheet",href:n,"data-precedence":a},o),(o=Ms.get(h))&&N0(n,o);var L=v=l.createElement("link");gn(L),xn(L,"link",n),L._p=new Promise(function(ne,ie){L.onload=ne,L.onerror=ie}),L.addEventListener("load",function(){_.loading|=1}),L.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Mf(v,a,l)}v={type:"stylesheet",instance:v,count:1,state:_},f.set(h,v)}}}function QC(n,a){Wr.X(n,a);var o=dc;if(o&&n){var l=Co(o).hoistableScripts,f=hc(n),h=l.get(f);h||(h=o.querySelector(cu(f)),h||(n=J({src:n,async:!0},a),(a=Ms.get(f))&&x0(n,a),h=o.createElement("script"),gn(h),xn(h,"link",n),o.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function e6(n,a){Wr.M(n,a);var o=dc;if(o&&n){var l=Co(o).hoistableScripts,f=hc(n),h=l.get(f);h||(h=o.querySelector(cu(f)),h||(n=J({src:n,async:!0,type:"module"},a),(a=Ms.get(f))&&x0(n,a),h=o.createElement("script"),gn(h),xn(h,"link",n),o.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function hS(n,a,o,l){var f=(f=Le.current)?iu(f):null;if(!f)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(o=fc(o.href),a=Co(f).hoistableStyles,l=a.get(o),l||(l={type:"style",instance:null,count:0,state:null},a.set(o,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=fc(o.href);var h=Co(f).hoistableStyles,v=h.get(n);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(n,v),(h=f.querySelector(ou(n)))?h._p||(v.instance=h,v.state.loading=5):(h=Ms.get(n),h||(h={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Ms.set(n,h)),t6(f,n,h,v.state))),a&&l===null)throw Error(r(528,""));return v}if(a&&l!==null)throw Error(r(529,""));return null;case"script":return a=o.async,o=o.src,typeof o=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(o=hc(o),a=Co(f).hoistableScripts,l=a.get(o),l||(l={type:"script",instance:null,count:0,state:null},a.set(o,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function fc(n){return'href="'+As(n)+'"'}function ou(n){return'link[rel="stylesheet"]['+n+"]"}function pS(n){return J({},n,{"data-precedence":n.precedence,precedence:null})}function t6(n,a,o,l){if(a=n.querySelector('link[rel="preload"][as="style"]['+a+"]")){if(a[Sd]!==!0){l.loading=1;return}}else a=n.createElement("link"),a[Sd]=!0,a.onload=a.onerror=k1.bind(null,a),xn(a,"link",o),gn(a),n.head.appendChild(a);l.preload=a,a.addEventListener("load",function(){return l.loading|=1}),a.addEventListener("error",function(){return l.loading|=2})}function hc(n){return'[src="'+As(n)+'"]'}function cu(n){return"script[async]"+n}function mS(n,a,o){if(a.count++,a.instance===null)switch(a.type){case"style":var l=n.querySelector('style[data-href~="'+As(o.href)+'"]');if(l)return a.instance=l,gn(l),l;var f=J({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),gn(l),xn(l,"style",f),Mf(l,o.precedence,n),a.instance=l;case"stylesheet":f=fc(o.href);var h=n.querySelector(ou(f));if(h)return a.state.loading|=4,a.instance=h,gn(h),h;l=pS(o),(f=Ms.get(f))&&N0(l,f),h=(n.ownerDocument||n).createElement("link"),gn(h);var v=h;return v._p=new Promise(function(_,L){v.onload=_,v.onerror=L}),xn(h,"link",l),a.state.loading|=4,Mf(h,o.precedence,n),a.instance=h;case"script":return h=hc(o.src),(f=n.querySelector(cu(h)))?(a.instance=f,gn(f),f):(l=o,(f=Ms.get(h))&&(l=J({},o),x0(l,f)),n=n.ownerDocument||n,f=n.createElement("script"),gn(f),xn(f,"link",l),n.head.appendChild(f),a.instance=f);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(l=a.instance,a.state.loading|=4,Mf(l,o.precedence,n));return a.instance}function Mf(n,a,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,v=0;v<l.length;v++){var _=l[v];if(_.dataset.precedence===a)h=_;else if(h!==f)break}h?h.parentNode.insertBefore(n,h.nextSibling):(a=o.nodeType===9?o.head:o,a.insertBefore(n,a.firstChild))}function N0(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function x0(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var Df=null;function gS(n,a,o){if(Df===null){var l=new Map,f=Df=new Map;f.set(o,l)}else f=Df,l=f.get(o),l||(l=new Map,f.set(o,l));if(l.has(n))return l;for(l.set(n,null),o=o.getElementsByTagName(n),f=0;f<o.length;f++){var h=o[f];if(!(h[El]||h[_n]||n==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(a)||"";v=n+v;var _=l.get(v);_?_.push(h):l.set(v,[h])}}return l}function C0(n,a,o){n=n.ownerDocument||n,n.head.insertBefore(o,a==="title"?n.querySelector("head > title"):null)}function n6(n,a,o){if(o===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(n=a.disabled,typeof a.precedence=="string"&&n==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function yS(n,a){return n==="img"&&a.src!=null&&a.src!==""&&a.onLoad==null&&a.loading!=="lazy"}function vS(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function bS(n){return(n.width||100)*(n.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function wS(n,a){typeof a.decode=="function"&&(n.imgCount++,a.complete||(n.imgBytes+=bS(a),n.suspenseyImages.push(a)),n=a6.bind(n),a.decode().then(n,n))}function s6(n,a,o,l){if(o.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var f=fc(l.href),h=a.querySelector(ou(f));if(h){a=h._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=lu.bind(n),a.then(n,n)),o.state.loading|=4,o.instance=h,gn(h);return}h=a.ownerDocument||a,l=pS(l),(f=Ms.get(f))&&N0(l,f),h=h.createElement("link"),gn(h);var v=h;v._p=new Promise(function(_,L){v.onload=_,v.onerror=L}),xn(h,"link",l),o.instance=h}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,a),(a=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=lu.bind(n),a.addEventListener("load",o),a.addEventListener("error",o))}}var Uf=0;function r6(n,a){return n.stylesheets&&n.count===0&&Lf(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var l=setTimeout(function(){if(n.stylesheets&&Lf(n,n.stylesheets),n.unsuspend){var h=n.unsuspend;n.unsuspend=null,h()}},6e4+a);0<n.imgBytes&&Uf===0&&(Uf=62500*SC());var f=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Lf(n,n.stylesheets),n.unsuspend)){var h=n.unsuspend;n.unsuspend=null,h()}},(n.imgBytes>Uf?50:800)+a);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function TS(n){if(n.count===0&&(n.imgCount===0||!n.waitingForImages)){if(n.stylesheets)Lf(n,n.stylesheets);else if(n.unsuspend){var a=n.unsuspend;n.unsuspend=null,a()}}}function lu(){this.count--,TS(this)}function a6(){this.imgCount--,TS(this)}var Bf=null;function Lf(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Bf=new Map,a.forEach(i6,n),Bf=null,lu.call(n))}function i6(n,a){if(!(a.state.loading&4)){var o=Bf.get(n);if(o)var l=o.get(null);else{o=new Map,Bf.set(n,o);for(var f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var v=f[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(o.set(v.dataset.precedence,v),l=v)}l&&o.set(null,l)}f=a.instance,v=f.getAttribute("data-precedence"),h=o.get(v)||l,h===l&&o.set(null,f),o.set(v,f),this.count++,l=lu.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),h?h.parentNode.insertBefore(f,h.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(f,n.firstChild)),a.state.loading|=4}}var pc={$$typeof:D,Provider:null,Consumer:null,_currentValue:Pe,_currentValue2:Pe,_threadCount:0};function o6(n,a,o,l,f,h,v,_,L){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=um(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=um(0),this.hiddenUpdates=um(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.transitionTypes=null,this.incompleteTransitions=new Map}function SS(n,a,o,l,f,h,v,_,L,ne,ie,ge){return n=new o6(n,a,o,v,L,ne,ie,ge,_),a=1,h===!0&&(a|=24),h=Kn(3,null,null,a),n.current=h,h.stateNode=n,a=Hm(),a.refCount++,n.pooledCache=a,a.refCount++,h.memoizedState={element:l,isDehydrated:o,cache:a},Wm(h),n}function ES(n){return n?(n=$o,n):$o}function _S(n,a,o,l,f,h){f=ES(f),l.context===null?l.context=f:l.pendingContext=f,l=Ca(a),l.payload={element:o},h=h===void 0?null:h,h!==null&&(l.callback=h),o=Ia(n,l,a),o!==null&&(ts(o,n,a),$l(o,n,a))}function kS(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<a?o:a}}function I0(n,a){kS(n,a),(n=n.alternate)&&kS(n,a)}function AS(n){if(n.tag===13||n.tag===31){var a=Oi(n,67108864);a!==null&&ts(a,n,67108864),I0(n,67108864)}}function OS(n){if(n.tag===13||n.tag===31){var a=ms();a=dm(a);var o=Oi(n,a);o!==null&&ts(o,n,a),I0(n,a)}}var mc=!0;function c6(n,a,o,l){var f=be.T;be.T=null;var h=_e.p;try{_e.p=2,R0(n,a,o,l)}finally{_e.p=h,be.T=f}}function l6(n,a,o,l){var f=be.T;be.T=null;var h=_e.p;try{_e.p=8,R0(n,a,o,l)}finally{_e.p=h,be.T=f}}function R0(n,a,o,l){if(mc){var f=j0(l);if(f===null)h0(n,a,l,zf,o),xS(n,l);else if(d6(f,n,a,o,l))l.stopPropagation();else if(xS(n,l),a&4&&-1<u6.indexOf(n)){for(;f!==null;){var h=xo(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=Si(h.pendingLanes);if(v!==0){var _=h;for(_.pendingLanes|=2,_.entangledLanes|=2;v;){var L=1<<31-cs(v);_.entanglements[1]|=L,v&=~L}vr(h),(ht&6)===0&&(_f=zn()+500,nu(0))}}break;case 31:case 13:_=Oi(h,2),_!==null&&ts(_,h,2),Of(),I0(h,2)}if(h=j0(l),h===null&&h0(n,a,l,zf,o),h===f)break;f=h}f!==null&&l.stopPropagation()}else h0(n,a,l,null,o)}}function j0(n){return n=vm(n),M0(n)}var zf=null;function M0(n){if(zf=null,n=Ei(n),n!==null){var a=c(n);if(a===null)n=null;else{var o=a.tag;if(o===13){if(n=u(a),n!==null)return n;n=null}else if(o===31){if(n=d(a),n!==null)return n;n=null}else if(o===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}return zf=n,null}function NS(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(lm()){case yd:return 2;case Ce:return 8;case Ye:case Nt:return 32;case ks:return 268435456;default:return 32}default:return 32}}var D0=!1,Ga=null,Fa=null,Ha=null,uu=new Map,du=new Map,qa=[],u6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function xS(n,a){switch(n){case"focusin":case"focusout":Ga=null;break;case"dragenter":case"dragleave":Fa=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":uu.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":du.delete(a.pointerId)}}function fu(n,a,o,l,f,h){return n===null||n.nativeEvent!==h?(n={blockedOn:a,domEventName:o,eventSystemFlags:l,nativeEvent:h,targetContainers:[f]},a!==null&&(a=xo(a),a!==null&&AS(a)),n):(n.eventSystemFlags|=l,a=n.targetContainers,f!==null&&a.indexOf(f)===-1&&a.push(f),n)}function d6(n,a,o,l,f){switch(a){case"focusin":return Ga=fu(Ga,n,a,o,l,f),!0;case"dragenter":return Fa=fu(Fa,n,a,o,l,f),!0;case"mouseover":return Ha=fu(Ha,n,a,o,l,f),!0;case"pointerover":var h=f.pointerId;return uu.set(h,fu(uu.get(h)||null,n,a,o,l,f)),!0;case"gotpointercapture":return h=f.pointerId,du.set(h,fu(du.get(h)||null,n,a,o,l,f)),!0}return!1}function CS(n){var a=Ei(n.target);if(a!==null){var o=c(a);if(o!==null){if(a=o.tag,a===13){if(a=u(o),a!==null){n.blockedOn=a,S1(n.priority,function(){OS(o)});return}}else if(a===31){if(a=d(o),a!==null){n.blockedOn=a,S1(n.priority,function(){OS(o)});return}}else if(a===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function $f(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var o=j0(n.nativeEvent);if(o===null){o=n.nativeEvent;var l=new o.constructor(o.type,o);ym=l,o.target.dispatchEvent(l),ym=null}else return a=xo(o),a!==null&&AS(a),n.blockedOn=o,!1;a.shift()}return!0}function IS(n,a,o){$f(n)&&o.delete(a)}function f6(){D0=!1,Ga!==null&&$f(Ga)&&(Ga=null),Fa!==null&&$f(Fa)&&(Fa=null),Ha!==null&&$f(Ha)&&(Ha=null),uu.forEach(IS),du.forEach(IS)}function Vf(n,a){n.blockedOn===a&&(n.blockedOn=null,D0||(D0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,f6)))}var Pf=null;function RS(n){Pf!==n&&(Pf=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Pf===n&&(Pf=null);for(var a=0;a<n.length;a+=3){var o=n[a],l=n[a+1],f=n[a+2];if(typeof l!="function"){if(M0(l||o)===null)continue;break}var h=xo(o);h!==null&&(n.splice(a,3),a-=3,gg(h,{pending:!0,data:f,method:o.method,action:l},l,f))}}))}function gc(n){function a(L){return Vf(L,n)}Ga!==null&&Vf(Ga,n),Fa!==null&&Vf(Fa,n),Ha!==null&&Vf(Ha,n),uu.forEach(a),du.forEach(a);for(var o=0;o<qa.length;o++){var l=qa[o];l.blockedOn===n&&(l.blockedOn=null)}for(;0<qa.length&&(o=qa[0],o.blockedOn===null);)CS(o),o.blockedOn===null&&qa.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var f=o[l],h=o[l+1],v=f[Xn]||null;if(typeof h=="function")v||RS(o);else if(v){var _=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[Xn]||null)_=v.formAction;else if(M0(f)!==null)continue}else _=v.action;typeof _=="function"?o[l+1]=_:(o.splice(l,3),l-=3),RS(o)}}}function jS(){function n(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function a(){f!==null&&(f(),f=null),l||setTimeout(o,20)}function o(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(o,100),function(){l=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),f!==null&&(f(),f=null)}}}function U0(n){this._internalRoot=n}Gf.prototype.render=U0.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(r(409));var o=a.current,l=ms();_S(o,l,n,a,null,null)},Gf.prototype.unmount=U0.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;_S(n.current,2,null,n,null,null),Of(),a[No]=null}};function Gf(n){this._internalRoot=n}Gf.prototype.unstable_scheduleHydration=function(n){if(n){var a=T1();n={blockedOn:null,target:n,priority:a};for(var o=0;o<qa.length&&a!==0&&a<qa[o].priority;o++);qa.splice(o,0,n),o===0&&CS(n)}};var MS=t.version;if(MS!=="19.3.0")throw Error(r(527,MS,"19.3.0"));_e.findDOMNode=function(n){var a=n._reactInternals;if(a===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=m(a),n=n!==null?g(n):null,n=n===null?null:n.stateNode,n};var h6={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:be,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ff=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ff.isDisabled&&Ff.supportsFiber)try{wl=Ff.inject(h6),os=Ff}catch{}}return Eu.createRoot=function(n,a){if(!i(n))throw Error(r(299));var o=!1,l="",f=ET,h=_T,v=kT;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(l=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError)),a=SS(n,1,!1,null,null,o,l,null,f,h,v,jS),n[No]=a.current,f0(n),new U0(a)},Eu.hydrateRoot=function(n,a,o){if(!i(n))throw Error(r(299));var l=!1,f="",h=ET,v=_T,_=kT,L=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(h=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError),o.formState!==void 0&&(L=o.formState)),a=SS(n,1,!0,a,o??null,l,f,L,h,v,_,jS),a.context=ES(null),o=a.current,l=ms(),l=dm(l),f=Ca(l),f.callback=null,Ia(o,f,l),o=l,a.current.lanes=o,Sl(a,o),vr(a),n[No]=a.current,f0(n),new Gf(a)},Eu.version="19.3.0",Eu}var c4;function vF(){if(c4)return ky.exports;c4=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ky.exports=yF(),ky.exports}var l4=vF(),ft;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function s(i){throw new Error}e.assertNever=s,e.arrayToEnum=i=>{const c={};for(const u of i)c[u]=u;return c},e.getValidEnumValues=i=>{const c=e.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),u={};for(const d of c)u[d]=i[d];return e.objectValues(u)},e.objectValues=i=>e.objectKeys(i).map(function(c){return i[c]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const c=[];for(const u in i)Object.prototype.hasOwnProperty.call(i,u)&&c.push(u);return c},e.find=(i,c)=>{for(const u of i)if(c(u))return u},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,c=" | "){return i.map(u=>typeof u=="string"?`'${u}'`:u).join(c)}e.joinValues=r,e.jsonStringifyReplacer=(i,c)=>typeof c=="bigint"?c.toString():c})(ft||(ft={}));var u4;(function(e){e.mergeShapes=(t,s)=>({...t,...s})})(u4||(u4={}));const je=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ri=e=>{switch(typeof e){case"undefined":return je.undefined;case"string":return je.string;case"number":return Number.isNaN(e)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(e)?je.array:e===null?je.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?je.promise:typeof Map<"u"&&e instanceof Map?je.map:typeof Set<"u"&&e instanceof Set?je.set:typeof Date<"u"&&e instanceof Date?je.date:je.object;default:return je.unknown}},Se=ft.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ma extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){const s=t||function(c){return c.message},r={_errors:[]},i=c=>{for(const u of c.issues)if(u.code==="invalid_union")u.unionErrors.map(i);else if(u.code==="invalid_return_type")i(u.returnTypeError);else if(u.code==="invalid_arguments")i(u.argumentsError);else if(u.path.length===0)r._errors.push(s(u));else{let d=r,p=0;for(;p<u.path.length;){const m=u.path[p];p===u.path.length-1?(d[m]=d[m]||{_errors:[]},d[m]._errors.push(s(u))):d[m]=d[m]||{_errors:[]},d=d[m],p++}}};return i(this),r}static assert(t){if(!(t instanceof ma))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ft.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){const s={},r=[];for(const i of this.issues)if(i.path.length>0){const c=i.path[0];s[c]=s[c]||[],s[c].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:s}}get formErrors(){return this.flatten()}}ma.create=e=>new ma(e);const _v=(e,t)=>{let s;switch(e.code){case Se.invalid_type:e.received===je.undefined?s="Required":s=`Expected ${e.expected}, received ${e.received}`;break;case Se.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,ft.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:s=`Unrecognized key(s) in object: ${ft.joinValues(e.keys,", ")}`;break;case Se.invalid_union:s="Invalid input";break;case Se.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${ft.joinValues(e.options)}`;break;case Se.invalid_enum_value:s=`Invalid enum value. Expected ${ft.joinValues(e.options)}, received '${e.received}'`;break;case Se.invalid_arguments:s="Invalid function arguments";break;case Se.invalid_return_type:s="Invalid function return type";break;case Se.invalid_date:s="Invalid date";break;case Se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:ft.assertNever(e.validation):e.validation!=="regex"?s=`Invalid ${e.validation}`:s="Invalid";break;case Se.too_small:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?s=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:s="Invalid input";break;case Se.too_big:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?s=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:s="Invalid input";break;case Se.custom:s="Invalid input";break;case Se.invalid_intersection_types:s="Intersection results could not be merged";break;case Se.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case Se.not_finite:s="Number must be finite";break;default:s=t.defaultError,ft.assertNever(e)}return{message:s}};let bF=_v;function wF(){return bF}const TF=e=>{const{data:t,path:s,errorMaps:r,issueData:i}=e,c=[...s,...i.path||[]],u={...i,path:c};if(i.message!==void 0)return{...i,path:c,message:i.message};let d="";const p=r.filter(m=>!!m).slice().reverse();for(const m of p)d=m(u,{data:t,defaultError:d}).message;return{...i,path:c,message:d}};function xe(e,t){const s=wF(),r=TF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===_v?void 0:_v].filter(i=>!!i)});e.common.issues.push(r)}class Wn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,s){const r=[];for(const i of s){if(i.status==="aborted")return qe;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,s){const r=[];for(const i of s){const c=await i.key,u=await i.value;r.push({key:c,value:u})}return Wn.mergeObjectSync(t,r)}static mergeObjectSync(t,s){const r={};for(const i of s){const{key:c,value:u}=i;if(c.status==="aborted"||u.status==="aborted")return qe;c.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),c.value!=="__proto__"&&(typeof u.value<"u"||i.alwaysSet)&&(r[c.value]=u.value)}return{status:t.value,value:r}}}const qe=Object.freeze({status:"aborted"}),Iu=e=>({status:"dirty",value:e}),Gs=e=>({status:"valid",value:e}),d4=e=>e.status==="aborted",f4=e=>e.status==="dirty",Kc=e=>e.status==="valid",mp=e=>typeof Promise<"u"&&e instanceof Promise;var Me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Me||(Me={}));class jr{constructor(t,s,r,i){this._cachedPath=[],this.parent=t,this.data=s,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const h4=(e,t)=>{if(Kc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new ma(e.common.issues);return this._error=s,this._error}}};function Je(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:r,description:i}=e;if(t&&(s||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(u,d)=>{const{message:p}=e;return u.code==="invalid_enum_value"?{message:p??d.defaultError}:typeof d.data>"u"?{message:p??r??d.defaultError}:u.code!=="invalid_type"?{message:d.defaultError}:{message:p??s??d.defaultError}},description:i}}class lt{get description(){return this._def.description}_getType(t){return ri(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:ri(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Wn,ctx:{common:t.parent.common,data:t.data,parsedType:ri(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const s=this._parse(t);if(mp(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(t){const s=this._parse(t);return Promise.resolve(s)}parse(t,s){const r=this.safeParse(t,s);if(r.success)return r.data;throw r.error}safeParse(t,s){const r={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ri(t)},i=this._parseSync({data:t,path:r.path,parent:r});return h4(r,i)}"~validate"(t){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ri(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:s});return Kc(r)?{value:r.value}:{issues:s.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(r=>Kc(r)?{value:r.value}:{issues:s.common.issues})}async parseAsync(t,s){const r=await this.safeParseAsync(t,s);if(r.success)return r.data;throw r.error}async safeParseAsync(t,s){const r={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ri(t)},i=this._parse({data:t,path:r.path,parent:r}),c=await(mp(i)?i:Promise.resolve(i));return h4(r,c)}refine(t,s){const r=i=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(i):s;return this._refinement((i,c)=>{const u=t(i),d=()=>c.addIssue({code:Se.custom,...r(i)});return typeof Promise<"u"&&u instanceof Promise?u.then(p=>p?!0:(d(),!1)):u?!0:(d(),!1)})}refinement(t,s){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof s=="function"?s(r,i):s),!1))}_refinement(t){return new el({schema:this,typeName:He.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return ui.create(this,this._def)}nullable(){return tl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this)}promise(){return wp.create(this,this._def)}or(t){return yp.create([this,t],this._def)}and(t){return vp.create(this,t,this._def)}transform(t){return new el({...Je(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const s=typeof t=="function"?t:()=>t;return new xv({...Je(this._def),innerType:this,defaultValue:s,typeName:He.ZodDefault})}brand(){return new FF({typeName:He.ZodBranded,type:this,...Je(this._def)})}catch(t){const s=typeof t=="function"?t:()=>t;return new Cv({...Je(this._def),innerType:this,catchValue:s,typeName:He.ZodCatch})}describe(t){const s=this.constructor;return new s({...this._def,description:t})}pipe(t){return s1.create(this,t)}readonly(){return Iv.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SF=/^c[^\s-]{8,}$/i,EF=/^[0-9a-z]+$/,_F=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AF=/^[a-z0-9_-]{21}$/i,OF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,NF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,xF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,CF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let xy;const IF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,RF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,jF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,MF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,DF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,MO="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",BF=new RegExp(`^${MO}$`);function DO(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const s=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${s}`}function LF(e){return new RegExp(`^${DO(e)}$`)}function zF(e){let t=`${MO}T${DO(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function $F(e,t){return!!((t==="v4"||!t)&&IF.test(e)||(t==="v6"||!t)&&jF.test(e))}function VF(e,t){if(!OF.test(e))return!1;try{const[s]=e.split(".");if(!s)return!1;const r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function PF(e,t){return!!((t==="v4"||!t)&&RF.test(e)||(t==="v6"||!t)&&MF.test(e))}class ua extends lt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==je.string){const c=this._getOrReturnCtx(t);return xe(c,{code:Se.invalid_type,expected:je.string,received:c.parsedType}),qe}const r=new Wn;let i;for(const c of this._def.checks)if(c.kind==="min")t.data.length<c.value&&(i=this._getOrReturnCtx(t,i),xe(i,{code:Se.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),r.dirty());else if(c.kind==="max")t.data.length>c.value&&(i=this._getOrReturnCtx(t,i),xe(i,{code:Se.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),r.dirty());else if(c.kind==="length"){const u=t.data.length>c.value,d=t.data.length<c.value;(u||d)&&(i=this._getOrReturnCtx(t,i),u?xe(i,{code:Se.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):d&&xe(i,{code:Se.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),r.dirty())}else if(c.kind==="email")xF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"email",code:Se.invalid_string,message:c.message}),r.dirty());else if(c.kind==="emoji")xy||(xy=new RegExp(CF,"u")),xy.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"emoji",code:Se.invalid_string,message:c.message}),r.dirty());else if(c.kind==="uuid")kF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"uuid",code:Se.invalid_string,message:c.message}),r.dirty());else if(c.kind==="nanoid")AF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"nanoid",code:Se.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid")SF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cuid",code:Se.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid2")EF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cuid2",code:Se.invalid_string,message:c.message}),r.dirty());else if(c.kind==="ulid")_F.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"ulid",code:Se.invalid_string,message:c.message}),r.dirty());else if(c.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),xe(i,{validation:"url",code:Se.invalid_string,message:c.message}),r.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"regex",code:Se.invalid_string,message:c.message}),r.dirty())):c.kind==="trim"?t.data=t.data.trim():c.kind==="includes"?t.data.includes(c.value,c.position)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Se.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),r.dirty()):c.kind==="toLowerCase"?t.data=t.data.toLowerCase():c.kind==="toUpperCase"?t.data=t.data.toUpperCase():c.kind==="startsWith"?t.data.startsWith(c.value)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Se.invalid_string,validation:{startsWith:c.value},message:c.message}),r.dirty()):c.kind==="endsWith"?t.data.endsWith(c.value)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Se.invalid_string,validation:{endsWith:c.value},message:c.message}),r.dirty()):c.kind==="datetime"?zF(c).test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Se.invalid_string,validation:"datetime",message:c.message}),r.dirty()):c.kind==="date"?BF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Se.invalid_string,validation:"date",message:c.message}),r.dirty()):c.kind==="time"?LF(c).test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Se.invalid_string,validation:"time",message:c.message}),r.dirty()):c.kind==="duration"?NF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"duration",code:Se.invalid_string,message:c.message}),r.dirty()):c.kind==="ip"?$F(t.data,c.version)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"ip",code:Se.invalid_string,message:c.message}),r.dirty()):c.kind==="jwt"?VF(t.data,c.alg)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"jwt",code:Se.invalid_string,message:c.message}),r.dirty()):c.kind==="cidr"?PF(t.data,c.version)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cidr",code:Se.invalid_string,message:c.message}),r.dirty()):c.kind==="base64"?DF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"base64",code:Se.invalid_string,message:c.message}),r.dirty()):c.kind==="base64url"?UF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"base64url",code:Se.invalid_string,message:c.message}),r.dirty()):ft.assertNever(c);return{status:r.value,value:t.data}}_regex(t,s,r){return this.refinement(i=>t.test(i),{validation:s,code:Se.invalid_string,...Me.errToObj(r)})}_addCheck(t){return new ua({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Me.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Me.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Me.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Me.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Me.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Me.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Me.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Me.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Me.errToObj(t)})}regex(t,s){return this._addCheck({kind:"regex",regex:t,...Me.errToObj(s)})}includes(t,s){return this._addCheck({kind:"includes",value:t,position:s?.position,...Me.errToObj(s?.message)})}startsWith(t,s){return this._addCheck({kind:"startsWith",value:t,...Me.errToObj(s)})}endsWith(t,s){return this._addCheck({kind:"endsWith",value:t,...Me.errToObj(s)})}min(t,s){return this._addCheck({kind:"min",value:t,...Me.errToObj(s)})}max(t,s){return this._addCheck({kind:"max",value:t,...Me.errToObj(s)})}length(t,s){return this._addCheck({kind:"length",value:t,...Me.errToObj(s)})}nonempty(t){return this.min(1,Me.errToObj(t))}trim(){return new ua({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ua({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ua({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxLength(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}ua.create=e=>new ua({checks:[],typeName:He.ZodString,coerce:e?.coerce??!1,...Je(e)});function GF(e,t){const s=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=s>r?s:r,c=Number.parseInt(e.toFixed(i).replace(".","")),u=Number.parseInt(t.toFixed(i).replace(".",""));return c%u/10**i}class Jc extends lt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==je.number){const c=this._getOrReturnCtx(t);return xe(c,{code:Se.invalid_type,expected:je.number,received:c.parsedType}),qe}let r;const i=new Wn;for(const c of this._def.checks)c.kind==="int"?ft.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),xe(r,{code:Se.invalid_type,expected:"integer",received:"float",message:c.message}),i.dirty()):c.kind==="min"?(c.inclusive?t.data<c.value:t.data<=c.value)&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Se.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),i.dirty()):c.kind==="max"?(c.inclusive?t.data>c.value:t.data>=c.value)&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Se.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),i.dirty()):c.kind==="multipleOf"?GF(t.data,c.value)!==0&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Se.not_multiple_of,multipleOf:c.value,message:c.message}),i.dirty()):c.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),xe(r,{code:Se.not_finite,message:c.message}),i.dirty()):ft.assertNever(c);return{status:i.value,value:t.data}}gte(t,s){return this.setLimit("min",t,!0,Me.toString(s))}gt(t,s){return this.setLimit("min",t,!1,Me.toString(s))}lte(t,s){return this.setLimit("max",t,!0,Me.toString(s))}lt(t,s){return this.setLimit("max",t,!1,Me.toString(s))}setLimit(t,s,r,i){return new Jc({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:Me.toString(i)}]})}_addCheck(t){return new Jc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Me.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:Me.toString(s)})}finite(t){return this._addCheck({kind:"finite",message:Me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Me.toString(t)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ft.isInteger(t.value))}get isFinite(){let t=null,s=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(s===null||r.value>s)&&(s=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(s)&&Number.isFinite(t)}}Jc.create=e=>new Jc({checks:[],typeName:He.ZodNumber,coerce:e?.coerce||!1,...Je(e)});class Ku extends lt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==je.bigint)return this._getInvalidInput(t);let r;const i=new Wn;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?t.data<c.value:t.data<=c.value)&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Se.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),i.dirty()):c.kind==="max"?(c.inclusive?t.data>c.value:t.data>=c.value)&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Se.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),i.dirty()):c.kind==="multipleOf"?t.data%c.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Se.not_multiple_of,multipleOf:c.value,message:c.message}),i.dirty()):ft.assertNever(c);return{status:i.value,value:t.data}}_getInvalidInput(t){const s=this._getOrReturnCtx(t);return xe(s,{code:Se.invalid_type,expected:je.bigint,received:s.parsedType}),qe}gte(t,s){return this.setLimit("min",t,!0,Me.toString(s))}gt(t,s){return this.setLimit("min",t,!1,Me.toString(s))}lte(t,s){return this.setLimit("max",t,!0,Me.toString(s))}lt(t,s){return this.setLimit("max",t,!1,Me.toString(s))}setLimit(t,s,r,i){return new Ku({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:Me.toString(i)}]})}_addCheck(t){return new Ku({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Me.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:Me.toString(s)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}Ku.create=e=>new Ku({checks:[],typeName:He.ZodBigInt,coerce:e?.coerce??!1,...Je(e)});class kv extends lt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==je.boolean){const r=this._getOrReturnCtx(t);return xe(r,{code:Se.invalid_type,expected:je.boolean,received:r.parsedType}),qe}return Gs(t.data)}}kv.create=e=>new kv({typeName:He.ZodBoolean,coerce:e?.coerce||!1,...Je(e)});class gp extends lt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==je.date){const c=this._getOrReturnCtx(t);return xe(c,{code:Se.invalid_type,expected:je.date,received:c.parsedType}),qe}if(Number.isNaN(t.data.getTime())){const c=this._getOrReturnCtx(t);return xe(c,{code:Se.invalid_date}),qe}const r=new Wn;let i;for(const c of this._def.checks)c.kind==="min"?t.data.getTime()<c.value&&(i=this._getOrReturnCtx(t,i),xe(i,{code:Se.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),r.dirty()):c.kind==="max"?t.data.getTime()>c.value&&(i=this._getOrReturnCtx(t,i),xe(i,{code:Se.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),r.dirty()):ft.assertNever(c);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new gp({...this._def,checks:[...this._def.checks,t]})}min(t,s){return this._addCheck({kind:"min",value:t.getTime(),message:Me.toString(s)})}max(t,s){return this._addCheck({kind:"max",value:t.getTime(),message:Me.toString(s)})}get minDate(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t!=null?new Date(t):null}}gp.create=e=>new gp({checks:[],coerce:e?.coerce||!1,typeName:He.ZodDate,...Je(e)});class p4 extends lt{_parse(t){if(this._getType(t)!==je.symbol){const r=this._getOrReturnCtx(t);return xe(r,{code:Se.invalid_type,expected:je.symbol,received:r.parsedType}),qe}return Gs(t.data)}}p4.create=e=>new p4({typeName:He.ZodSymbol,...Je(e)});class m4 extends lt{_parse(t){if(this._getType(t)!==je.undefined){const r=this._getOrReturnCtx(t);return xe(r,{code:Se.invalid_type,expected:je.undefined,received:r.parsedType}),qe}return Gs(t.data)}}m4.create=e=>new m4({typeName:He.ZodUndefined,...Je(e)});class g4 extends lt{_parse(t){if(this._getType(t)!==je.null){const r=this._getOrReturnCtx(t);return xe(r,{code:Se.invalid_type,expected:je.null,received:r.parsedType}),qe}return Gs(t.data)}}g4.create=e=>new g4({typeName:He.ZodNull,...Je(e)});class y4 extends lt{constructor(){super(...arguments),this._any=!0}_parse(t){return Gs(t.data)}}y4.create=e=>new y4({typeName:He.ZodAny,...Je(e)});class v4 extends lt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Gs(t.data)}}v4.create=e=>new v4({typeName:He.ZodUnknown,...Je(e)});class yi extends lt{_parse(t){const s=this._getOrReturnCtx(t);return xe(s,{code:Se.invalid_type,expected:je.never,received:s.parsedType}),qe}}yi.create=e=>new yi({typeName:He.ZodNever,...Je(e)});class b4 extends lt{_parse(t){if(this._getType(t)!==je.undefined){const r=this._getOrReturnCtx(t);return xe(r,{code:Se.invalid_type,expected:je.void,received:r.parsedType}),qe}return Gs(t.data)}}b4.create=e=>new b4({typeName:He.ZodVoid,...Je(e)});class kr extends lt{_parse(t){const{ctx:s,status:r}=this._processInputParams(t),i=this._def;if(s.parsedType!==je.array)return xe(s,{code:Se.invalid_type,expected:je.array,received:s.parsedType}),qe;if(i.exactLength!==null){const u=s.data.length>i.exactLength.value,d=s.data.length<i.exactLength.value;(u||d)&&(xe(s,{code:u?Se.too_big:Se.too_small,minimum:d?i.exactLength.value:void 0,maximum:u?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&s.data.length<i.minLength.value&&(xe(s,{code:Se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&s.data.length>i.maxLength.value&&(xe(s,{code:Se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),s.common.async)return Promise.all([...s.data].map((u,d)=>i.type._parseAsync(new jr(s,u,s.path,d)))).then(u=>Wn.mergeArray(r,u));const c=[...s.data].map((u,d)=>i.type._parseSync(new jr(s,u,s.path,d)));return Wn.mergeArray(r,c)}get element(){return this._def.type}min(t,s){return new kr({...this._def,minLength:{value:t,message:Me.toString(s)}})}max(t,s){return new kr({...this._def,maxLength:{value:t,message:Me.toString(s)}})}length(t,s){return new kr({...this._def,exactLength:{value:t,message:Me.toString(s)}})}nonempty(t){return this.min(1,t)}}kr.create=(e,t)=>new kr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...Je(t)});function kc(e){if(e instanceof nn){const t={};for(const s in e.shape){const r=e.shape[s];t[s]=ui.create(kc(r))}return new nn({...e._def,shape:()=>t})}else return e instanceof kr?new kr({...e._def,type:kc(e.element)}):e instanceof ui?ui.create(kc(e.unwrap())):e instanceof tl?tl.create(kc(e.unwrap())):e instanceof wo?wo.create(e.items.map(t=>kc(t))):e}class nn extends lt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),s=ft.objectKeys(t);return this._cached={shape:t,keys:s},this._cached}_parse(t){if(this._getType(t)!==je.object){const m=this._getOrReturnCtx(t);return xe(m,{code:Se.invalid_type,expected:je.object,received:m.parsedType}),qe}const{status:r,ctx:i}=this._processInputParams(t),{shape:c,keys:u}=this._getCached(),d=[];if(!(this._def.catchall instanceof yi&&this._def.unknownKeys==="strip"))for(const m in i.data)u.includes(m)||d.push(m);const p=[];for(const m of u){const g=c[m],y=i.data[m];p.push({key:{status:"valid",value:m},value:g._parse(new jr(i,y,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof yi){const m=this._def.unknownKeys;if(m==="passthrough")for(const g of d)p.push({key:{status:"valid",value:g},value:{status:"valid",value:i.data[g]}});else if(m==="strict")d.length>0&&(xe(i,{code:Se.unrecognized_keys,keys:d}),r.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const g of d){const y=i.data[g];p.push({key:{status:"valid",value:g},value:m._parse(new jr(i,y,i.path,g)),alwaysSet:g in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const m=[];for(const g of p){const y=await g.key,b=await g.value;m.push({key:y,value:b,alwaysSet:g.alwaysSet})}return m}).then(m=>Wn.mergeObjectSync(r,m)):Wn.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(t){return Me.errToObj,new nn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(s,r)=>{const i=this._def.errorMap?.(s,r).message??r.defaultError;return s.code==="unrecognized_keys"?{message:Me.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new nn({...this._def,unknownKeys:"strip"})}passthrough(){return new nn({...this._def,unknownKeys:"passthrough"})}extend(t){return new nn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new nn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:He.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new nn({...this._def,catchall:t})}pick(t){const s={};for(const r of ft.objectKeys(t))t[r]&&this.shape[r]&&(s[r]=this.shape[r]);return new nn({...this._def,shape:()=>s})}omit(t){const s={};for(const r of ft.objectKeys(this.shape))t[r]||(s[r]=this.shape[r]);return new nn({...this._def,shape:()=>s})}deepPartial(){return kc(this)}partial(t){const s={};for(const r of ft.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?s[r]=i:s[r]=i.optional()}return new nn({...this._def,shape:()=>s})}required(t){const s={};for(const r of ft.objectKeys(this.shape))if(t&&!t[r])s[r]=this.shape[r];else{let c=this.shape[r];for(;c instanceof ui;)c=c._def.innerType;s[r]=c}return new nn({...this._def,shape:()=>s})}keyof(){return UO(ft.objectKeys(this.shape))}}nn.create=(e,t)=>new nn({shape:()=>e,unknownKeys:"strip",catchall:yi.create(),typeName:He.ZodObject,...Je(t)});nn.strictCreate=(e,t)=>new nn({shape:()=>e,unknownKeys:"strict",catchall:yi.create(),typeName:He.ZodObject,...Je(t)});nn.lazycreate=(e,t)=>new nn({shape:e,unknownKeys:"strip",catchall:yi.create(),typeName:He.ZodObject,...Je(t)});class yp extends lt{_parse(t){const{ctx:s}=this._processInputParams(t),r=this._def.options;function i(c){for(const d of c)if(d.result.status==="valid")return d.result;for(const d of c)if(d.result.status==="dirty")return s.common.issues.push(...d.ctx.common.issues),d.result;const u=c.map(d=>new ma(d.ctx.common.issues));return xe(s,{code:Se.invalid_union,unionErrors:u}),qe}if(s.common.async)return Promise.all(r.map(async c=>{const u={...s,common:{...s.common,issues:[]},parent:null};return{result:await c._parseAsync({data:s.data,path:s.path,parent:u}),ctx:u}})).then(i);{let c;const u=[];for(const p of r){const m={...s,common:{...s.common,issues:[]},parent:null},g=p._parseSync({data:s.data,path:s.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!c&&(c={result:g,ctx:m}),m.common.issues.length&&u.push(m.common.issues)}if(c)return s.common.issues.push(...c.ctx.common.issues),c.result;const d=u.map(p=>new ma(p));return xe(s,{code:Se.invalid_union,unionErrors:d}),qe}}get options(){return this._def.options}}yp.create=(e,t)=>new yp({options:e,typeName:He.ZodUnion,...Je(t)});function Av(e,t){const s=ri(e),r=ri(t);if(e===t)return{valid:!0,data:e};if(s===je.object&&r===je.object){const i=ft.objectKeys(t),c=ft.objectKeys(e).filter(d=>i.indexOf(d)!==-1),u={...e,...t};for(const d of c){const p=Av(e[d],t[d]);if(!p.valid)return{valid:!1};u[d]=p.data}return{valid:!0,data:u}}else if(s===je.array&&r===je.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let c=0;c<e.length;c++){const u=e[c],d=t[c],p=Av(u,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return s===je.date&&r===je.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class vp extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t),i=(c,u)=>{if(d4(c)||d4(u))return qe;const d=Av(c.value,u.value);return d.valid?((f4(c)||f4(u))&&s.dirty(),{status:s.value,value:d.data}):(xe(r,{code:Se.invalid_intersection_types}),qe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([c,u])=>i(c,u)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}vp.create=(e,t,s)=>new vp({left:e,right:t,typeName:He.ZodIntersection,...Je(s)});class wo extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.array)return xe(r,{code:Se.invalid_type,expected:je.array,received:r.parsedType}),qe;if(r.data.length<this._def.items.length)return xe(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),qe;!this._def.rest&&r.data.length>this._def.items.length&&(xe(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const c=[...r.data].map((u,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new jr(r,u,r.path,d)):null}).filter(u=>!!u);return r.common.async?Promise.all(c).then(u=>Wn.mergeArray(s,u)):Wn.mergeArray(s,c)}get items(){return this._def.items}rest(t){return new wo({...this._def,rest:t})}}wo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new wo({items:e,typeName:He.ZodTuple,rest:null,...Je(t)})};class bp extends lt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.object)return xe(r,{code:Se.invalid_type,expected:je.object,received:r.parsedType}),qe;const i=[],c=this._def.keyType,u=this._def.valueType;for(const d in r.data)i.push({key:c._parse(new jr(r,d,r.path,d)),value:u._parse(new jr(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?Wn.mergeObjectAsync(s,i):Wn.mergeObjectSync(s,i)}get element(){return this._def.valueType}static create(t,s,r){return s instanceof lt?new bp({keyType:t,valueType:s,typeName:He.ZodRecord,...Je(r)}):new bp({keyType:ua.create(),valueType:t,typeName:He.ZodRecord,...Je(s)})}}class w4 extends lt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.map)return xe(r,{code:Se.invalid_type,expected:je.map,received:r.parsedType}),qe;const i=this._def.keyType,c=this._def.valueType,u=[...r.data.entries()].map(([d,p],m)=>({key:i._parse(new jr(r,d,r.path,[m,"key"])),value:c._parse(new jr(r,p,r.path,[m,"value"]))}));if(r.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of u){const m=await p.key,g=await p.value;if(m.status==="aborted"||g.status==="aborted")return qe;(m.status==="dirty"||g.status==="dirty")&&s.dirty(),d.set(m.value,g.value)}return{status:s.value,value:d}})}else{const d=new Map;for(const p of u){const m=p.key,g=p.value;if(m.status==="aborted"||g.status==="aborted")return qe;(m.status==="dirty"||g.status==="dirty")&&s.dirty(),d.set(m.value,g.value)}return{status:s.value,value:d}}}}w4.create=(e,t,s)=>new w4({valueType:t,keyType:e,typeName:He.ZodMap,...Je(s)});class Ju extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.set)return xe(r,{code:Se.invalid_type,expected:je.set,received:r.parsedType}),qe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(xe(r,{code:Se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),s.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(xe(r,{code:Se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),s.dirty());const c=this._def.valueType;function u(p){const m=new Set;for(const g of p){if(g.status==="aborted")return qe;g.status==="dirty"&&s.dirty(),m.add(g.value)}return{status:s.value,value:m}}const d=[...r.data.values()].map((p,m)=>c._parse(new jr(r,p,r.path,m)));return r.common.async?Promise.all(d).then(p=>u(p)):u(d)}min(t,s){return new Ju({...this._def,minSize:{value:t,message:Me.toString(s)}})}max(t,s){return new Ju({...this._def,maxSize:{value:t,message:Me.toString(s)}})}size(t,s){return this.min(t,s).max(t,s)}nonempty(t){return this.min(1,t)}}Ju.create=(e,t)=>new Ju({valueType:e,minSize:null,maxSize:null,typeName:He.ZodSet,...Je(t)});class Ov extends lt{get schema(){return this._def.getter()}_parse(t){const{ctx:s}=this._processInputParams(t);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Ov.create=(e,t)=>new Ov({getter:e,typeName:He.ZodLazy,...Je(t)});class Nv extends lt{_parse(t){if(t.data!==this._def.value){const s=this._getOrReturnCtx(t);return xe(s,{received:s.data,code:Se.invalid_literal,expected:this._def.value}),qe}return{status:"valid",value:t.data}}get value(){return this._def.value}}Nv.create=(e,t)=>new Nv({value:e,typeName:He.ZodLiteral,...Je(t)});function UO(e,t){return new Qc({values:e,typeName:He.ZodEnum,...Je(t)})}class Qc extends lt{_parse(t){if(typeof t.data!="string"){const s=this._getOrReturnCtx(t),r=this._def.values;return xe(s,{expected:ft.joinValues(r),received:s.parsedType,code:Se.invalid_type}),qe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const s=this._getOrReturnCtx(t),r=this._def.values;return xe(s,{received:s.data,code:Se.invalid_enum_value,options:r}),qe}return Gs(t.data)}get options(){return this._def.values}get enum(){const t={};for(const s of this._def.values)t[s]=s;return t}get Values(){const t={};for(const s of this._def.values)t[s]=s;return t}get Enum(){const t={};for(const s of this._def.values)t[s]=s;return t}extract(t,s=this._def){return Qc.create(t,{...this._def,...s})}exclude(t,s=this._def){return Qc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...s})}}Qc.create=UO;class T4 extends lt{_parse(t){const s=ft.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==je.string&&r.parsedType!==je.number){const i=ft.objectValues(s);return xe(r,{expected:ft.joinValues(i),received:r.parsedType,code:Se.invalid_type}),qe}if(this._cache||(this._cache=new Set(ft.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=ft.objectValues(s);return xe(r,{received:r.data,code:Se.invalid_enum_value,options:i}),qe}return Gs(t.data)}get enum(){return this._def.values}}T4.create=(e,t)=>new T4({values:e,typeName:He.ZodNativeEnum,...Je(t)});class wp extends lt{unwrap(){return this._def.type}_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==je.promise&&s.common.async===!1)return xe(s,{code:Se.invalid_type,expected:je.promise,received:s.parsedType}),qe;const r=s.parsedType===je.promise?s.data:Promise.resolve(s.data);return Gs(r.then(i=>this._def.type.parseAsync(i,{path:s.path,errorMap:s.common.contextualErrorMap})))}}wp.create=(e,t)=>new wp({type:e,typeName:He.ZodPromise,...Je(t)});class el extends lt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:s,ctx:r}=this._processInputParams(t),i=this._def.effect||null,c={addIssue:u=>{xe(r,u),u.fatal?s.abort():s.dirty()},get path(){return r.path}};if(c.addIssue=c.addIssue.bind(c),i.type==="preprocess"){const u=i.transform(r.data,c);if(r.common.async)return Promise.resolve(u).then(async d=>{if(s.value==="aborted")return qe;const p=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return p.status==="aborted"?qe:p.status==="dirty"||s.value==="dirty"?Iu(p.value):p});{if(s.value==="aborted")return qe;const d=this._def.schema._parseSync({data:u,path:r.path,parent:r});return d.status==="aborted"?qe:d.status==="dirty"||s.value==="dirty"?Iu(d.value):d}}if(i.type==="refinement"){const u=d=>{const p=i.refinement(d,c);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(r.common.async===!1){const d=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return d.status==="aborted"?qe:(d.status==="dirty"&&s.dirty(),u(d.value),{status:s.value,value:d.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(d=>d.status==="aborted"?qe:(d.status==="dirty"&&s.dirty(),u(d.value).then(()=>({status:s.value,value:d.value}))))}if(i.type==="transform")if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Kc(u))return qe;const d=i.transform(u.value,c);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:d}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>Kc(u)?Promise.resolve(i.transform(u.value,c)).then(d=>({status:s.value,value:d})):qe);ft.assertNever(i)}}el.create=(e,t,s)=>new el({schema:e,typeName:He.ZodEffects,effect:t,...Je(s)});el.createWithPreprocess=(e,t,s)=>new el({schema:t,effect:{type:"preprocess",transform:e},typeName:He.ZodEffects,...Je(s)});class ui extends lt{_parse(t){return this._getType(t)===je.undefined?Gs(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ui.create=(e,t)=>new ui({innerType:e,typeName:He.ZodOptional,...Je(t)});class tl extends lt{_parse(t){return this._getType(t)===je.null?Gs(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}tl.create=(e,t)=>new tl({innerType:e,typeName:He.ZodNullable,...Je(t)});class xv extends lt{_parse(t){const{ctx:s}=this._processInputParams(t);let r=s.data;return s.parsedType===je.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}xv.create=(e,t)=>new xv({innerType:e,typeName:He.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Je(t)});class Cv extends lt{_parse(t){const{ctx:s}=this._processInputParams(t),r={...s,common:{...s.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return mp(i)?i.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new ma(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ma(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Cv.create=(e,t)=>new Cv({innerType:e,typeName:He.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Je(t)});class S4 extends lt{_parse(t){if(this._getType(t)!==je.nan){const r=this._getOrReturnCtx(t);return xe(r,{code:Se.invalid_type,expected:je.nan,received:r.parsedType}),qe}return{status:"valid",value:t.data}}}S4.create=e=>new S4({typeName:He.ZodNaN,...Je(e)});class FF extends lt{_parse(t){const{ctx:s}=this._processInputParams(t),r=s.data;return this._def.type._parse({data:r,path:s.path,parent:s})}unwrap(){return this._def.type}}class s1 extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?qe:c.status==="dirty"?(s.dirty(),Iu(c.value)):this._def.out._parseAsync({data:c.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?qe:i.status==="dirty"?(s.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,s){return new s1({in:t,out:s,typeName:He.ZodPipeline})}}class Iv extends lt{_parse(t){const s=this._def.innerType._parse(t),r=i=>(Kc(i)&&(i.value=Object.freeze(i.value)),i);return mp(s)?s.then(i=>r(i)):r(s)}unwrap(){return this._def.innerType}}Iv.create=(e,t)=>new Iv({innerType:e,typeName:He.ZodReadonly,...Je(t)});var He;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(He||(He={}));const vs=ua.create,hl=Jc.create,BO=kv.create;yi.create;const di=kr.create,cn=nn.create;yp.create;vp.create;wo.create;const r1=bp.create,HF=Ov.create,qF=Nv.create,LO=Qc.create;wp.create;ui.create;tl.create;const Lt=De("0x2::sui::SUI"),Tp=864e5,zO=365,ZF=10n**27n,pt=vs().refine(fa,"Invalid Sui address").transform(e=>ye(e)),ar=vs().regex(/^0x[0-9a-fA-F]+::[A-Za-z_][A-Za-z0-9_]*::[A-Za-z_][A-Za-z0-9_]*(<.*>)?$/,"Not a coin type").transform(e=>De(e)),$O=vs().regex(/^(0|[1-9][0-9]*)$/).refine(e=>BigInt(e)<=18446744073709551615n,"Amount exceeds u64"),ws=$O.refine(e=>BigInt(e)>0n,"Must be positive"),VO="agent gas",At=(e,t)=>De(e)===De(t),YF=vs().regex(/^[a-z0-9_-]{1,32}$/),nm=e=>BigInt(e.perX)<=BigInt(e.daily),WF=cn({coin:ar,recipients:di(cn({name:YF,address:pt}).strict()).min(1),perTransfer:ws,daily:ws}).strict().refine(e=>nm({perX:e.perTransfer,daily:e.daily})&&new Set(e.recipients.map(t=>t.name)).size===e.recipients.length,"Per-transfer limit must not exceed the daily limit; recipient names must be unique"),XF=LO(["deepbook","cetus"]),KF=cn({coinIn:ar,coinOut:ar,pools:di(pt).min(1),perTrade:ws,daily:ws,minPrice:ws}).strict().refine(e=>nm({perX:e.perTrade,daily:e.daily})&&!At(e.coinIn,e.coinOut)&&new Set(e.pools).size===e.pools.length,"Per-trade limit must not exceed the daily limit; the pair must differ; pools must be unique"),JF=cn({coin:ar,allowBorrow:BO(),perAction:ws,daily:ws,minHealthFactor:hl().min(1).max(100).nullable()}).strict().refine(e=>nm({perX:e.perAction,daily:e.daily}),"Per-action limit must not exceed the daily limit"),QF=cn({validators:di(pt),perStake:ws,daily:ws}).strict().refine(e=>nm({perX:e.perStake,daily:e.daily})&&new Set(e.validators).size===e.validators.length,"Per-stake limit must not exceed the daily limit; validators must be unique"),Ch=e=>new Set(e).size===e.length,eH=cn({transfers:di(WF).default([]),swaps:di(KF).default([]),lending:di(JF).default([]),staking:QF.nullable().default(null)}).strict().refine(e=>e.transfers.length||e.swaps.length||e.lending.length||e.staking,"Allow at least one kind of action").refine(e=>Ch(e.transfers.map(t=>t.coin))&&Ch(e.swaps.map(t=>`${t.coinIn}>${t.coinOut}`))&&Ch(e.lending.map(t=>t.coin)),"One transfer rule per coin, one swap rule per direction, one lending rule per coin");function tH(e){const t=[...e.transfers.map(s=>s.coin),...e.swaps.map(s=>s.coinIn),...e.lending.map(s=>s.coin),...e.staking?[Lt]:[]];return[...new Set(t.map(s=>De(s)))]}const nH=cn({type:ar,symbol:vs().min(1).max(16),decimals:hl().int().min(0).max(18),unlisted:BO().optional()}).strict(),sH=cn({venue:XF,poolId:pt,coinA:ar,coinB:ar}).strict(),rH=hl().int().min(0).max(255),aH=cn({network:LO(["localnet","testnet","devnet","mainnet"]),grpcUrl:vs().url(),graphqlUrl:vs().url().optional(),chainIdentifier:vs().min(1),packageId:pt,publishedAt:pt,configId:pt,siteUrl:vs().url().optional(),coins:di(nH).min(1),pools:di(sH),maxTermDays:hl().int().min(1).max(zO),demoFaucet:cn({packageId:pt,faucetId:pt,coin:ar}).strict().optional(),protocols:cn({deepbook:cn({packageId:pt,publishedAt:pt,indexerUrl:vs().url().optional()}).strict(),cetus:cn({packageId:pt,publishedAt:pt,configId:pt,apiUrl:vs().url().optional()}).strict(),navi:cn({packageId:pt,publishedAt:pt,oraclePackageId:pt,storageId:pt,oracleId:pt,incentiveV2Id:pt,incentiveV3Id:pt,reserves:r1(ar,cn({poolId:pt,assetId:rH}).strict())}).strict()}).strict()}).strict().refine(e=>At(e.coins[0].type,Lt),"The first coin must be SUI, the gas coin").refine(e=>Ch(e.coins.map(t=>t.type)),"Each coin once").refine(e=>e.pools.every(t=>e.coins.some(s=>At(s.type,t.coinA))&&e.coins.some(s=>At(s.type,t.coinB)))&&Object.keys(e.protocols.navi.reserves).every(t=>e.coins.some(s=>At(s.type,t)))&&(!e.demoFaucet||e.coins.some(t=>At(t.type,e.demoFaucet.coin))),"Pools, reserves and the demo faucet may only name listed coins");function nl(e,t){const s=e.coins.find(r=>At(r.type,t));if(!s)throw new Error(`${t} is not a coin this deployment lists`);return s}const iH=cn({v:qF(1),sessionAddress:pt,setup:HF(()=>pH),passId:pt.optional()}).strict(),oH=M.struct("Proposal",{v:M.u8(),setup:M.struct("Setup",{name:M.string(),policy:M.struct("Policy",{transfers:M.vector(M.struct("Transfer",{coin:M.string(),recipients:M.vector(M.struct("Recipient",{name:M.string(),address:M.Address})),perTransfer:M.u64(),daily:M.u64()})),swaps:M.vector(M.struct("Swap",{coinIn:M.string(),coinOut:M.string(),pools:M.vector(M.Address),perTrade:M.u64(),daily:M.u64(),minPrice:M.u64()})),lending:M.vector(M.struct("Lending",{coin:M.string(),allowBorrow:M.bool(),perAction:M.u64(),daily:M.u64(),minHealthFactor:M.option(M.string())})),staking:M.option(M.struct("Staking",{validators:M.vector(M.Address),perStake:M.u64(),daily:M.u64()}))}),ttlMs:M.u64(),expiresMs:M.u64(),allowances:M.vector(M.struct("Allowance",{coin:M.string(),cap:M.u64()})),gasAmount:M.u64(),gasCap:M.u64(),gasDaily:M.u64()}),passId:M.option(M.Address)}),PO=e=>Ge(e.replaceAll("-","+").replaceAll("_","/"));class Ih extends Error{}async function cH(e){const[t,s]=e.split(".");if(!t||!s)throw new Ih("This link is incomplete");let r,i;try{r=PO(t),i=oH.parse(r)}catch{throw new Ih("This link was changed after the agent created it")}const c=await FV(r,lH(s)).catch(()=>null);if(!c)throw new Ih("This link was changed after the agent created it");const{passId:u,...d}=i;return iH.parse({...d,sessionAddress:c.toSuiAddress(),setup:{...i.setup,ttlMs:Number(i.setup.ttlMs),expiresMs:Number(i.setup.expiresMs),policy:{...i.setup.policy,lending:i.setup.policy.lending.map(p=>({...p,minHealthFactor:p.minHealthFactor===null?null:Number(p.minHealthFactor)}))},allowances:Object.fromEntries(i.setup.allowances.map(p=>[p.coin,p.cap]))},...u?{passId:u}:{}})}const lH=e=>Ke(PO(e)),uH=hl().int().positive().max(zO*Tp),dH=ws,fH=hl().int().positive(),hH=vs().regex(/^[\x20-\x7e]{1,64}$/),pH=cn({name:hH,policy:eH,ttlMs:uH,expiresMs:fH,allowances:r1(ar,ws),gasAmount:dH,gasCap:ws,gasDaily:ws}).strict().refine(e=>BigInt(e.gasDaily)<=BigInt(e.gasCap),"The 24-hour gas limit must not exceed the gas lifetime cap").refine(e=>{const t=new Set(Object.keys(e.allowances).map(r=>De(r))),s=tH(e.policy);return s.every(r=>t.has(r))&&t.size===s.length},"Exactly the coins the rules spend need an allowance").refine(({policy:e,allowances:t})=>{const s=r=>BigInt(t[De(r)]??"0");return e.transfers.every(r=>BigInt(r.daily)<=s(r.coin))&&e.swaps.every(r=>BigInt(r.daily)<=s(r.coinIn))&&e.lending.every(r=>BigInt(r.daily)<=s(r.coin))&&(!e.staking||BigInt(e.staking.daily)<=s(Lt))},"A daily limit must not exceed the lifetime cap of its coin");cn({passId:pt,receiptId:pt,allowances:r1(ar,cn({allowance:pt,revokeCap:pt}).strict()),gasAllowance:pt,gasRevokeCap:pt,owner:pt,authorizationDigest:vs().min(1)}).strict();function mH(e,t){if(!new RegExp(`^(0|[1-9][0-9]*)(\\.[0-9]{1,${t}})?$`).test(e))throw new Error(`Enter a non-negative number with at most ${t} decimals`);const[s,r=""]=e.split(".");return $O.parse((BigInt(s)*10n**BigInt(t)+BigInt(r.padEnd(t,"0"))).toString())}function pd(e,t){const s=BigInt(e),r=10n**BigInt(t),i=(s%r).toString().padStart(t,"0").replace(/0+$/,"");return`${s/r}${i?`.${i}`:""}`}function E4(e){const[t,,s]=De(e).split("::");return`${t.slice(0,6)}…${t.slice(-4)}::${s}`}function sr(e,t){const s=e.coins.find(r=>At(r.type,t));return s?s.unlisted?`${s.symbol} (${E4(t)})`:s.symbol:E4(t)}function hn(e,t,s){const r=e.coins.find(i=>At(i.type,t));return r?`${pd(s,r.decimals)} ${sr(e,t)}`:`${s} base units of ${t}`}function Sp(e){const t=new Set,s=new Set;for(const r of e.transfers)t.add(De(r.coin));for(const r of e.swaps){t.add(De(r.coinIn)),t.add(De(r.coinOut));for(const i of r.pools)s.add(i)}for(const r of e.lending)t.add(De(r.coin));return e.staking&&t.add(Lt),{coins:[...t],pools:[...s]}}function gH(e,t,s,r){const i=nl(e,s).decimals+9-nl(e,t).decimals;return i>=0?pd(r,i):(BigInt(r)*10n**BigInt(-i)).toString()}const _4=e=>/^(USD|AUSD$|FDUSD$|BUCK$)/i.test(e);function a1(e,t,s){const r=_4(nl(e,t).symbol),i=_4(nl(e,s).symbol);return r&&!i?{base:s,quote:t,limit:"max"}:{base:t,quote:s,limit:"min"}}function yH(e,t,s,r){if(a1(e,t,s).limit==="min")return gH(e,t,s,r);const i=BigInt(r),c=10n**BigInt(nl(e,s).decimals)*10n**9n;return pd(((c*2n+i)/(i*2n)).toString(),nl(e,t).decimals)}const vH=e=>e===null?"0":(BigInt(mH(e.toFixed(2),2))*ZF/100n).toString();function i1(e){const t={};for(const[s,r]of Object.entries(e.allowances))t[De(s)]=(t[De(s)]??0n)+BigInt(r);return t[Lt]=(t[Lt]??0n)+BigInt(e.gasCap),Object.fromEntries(Object.entries(t).map(([s,r])=>[s,r.toString()]))}function GO(e,t,s=null){const r=i=>t[De(i)];return Object.fromEntries(Object.entries(i1(e)).map(([i,c])=>{const u=BigInt(c)-BigInt(r(i)?.addressBalance??"0");if(u<=0n)return[i,"0"];if(s&&At(s,i))return[i,u.toString()];let d=BigInt(r(i)?.coinBalance??"0");return At(i,Lt)&&(d-=BigInt(e.gasAmount)+FO),[i,(d<=0n?0n:u<d?u:d).toString()]}))}function bH(e,t,s=null){const r=GO(e,t,s);return Object.fromEntries(Object.entries(i1(e)).flatMap(([i,c])=>{const u=BigInt(t[De(i)]?.addressBalance??"0")+BigInt(r[i]??"0");return u>=BigInt(c)?[]:[[i,{drawable:c,covered:u.toString()}]]}))}function wH(e){return(BigInt(e.gasAmount)+FO).toString()}const FO=50000000n,jn=M.Address,Rv=M.struct("Bag",{id:jn,size:M.u64()}),TH=M.struct("Control",{controller:jn,name:M.string(),owner:M.Address,agent:M.Address,agent_expires_ms:M.u64(),policies:M.struct("Policies",{bag:Rv}),positions:Rv}),SH=M.struct("Pass",{id:jn,control:TH}),sm=M.struct("Meter",{day:M.u64(),used:M.u64()}),EH=M.struct("TransferPolicy",{recipients:Rv,per_transfer:M.u64(),daily:M.u64(),meter:sm}),_H=M.struct("SwapPolicy",{venues:M.vector(jn),per_trade:M.u64(),daily:M.u64(),min_price:M.u64(),meter:sm}),kH=M.struct("LendingPolicy",{pool:jn,asset:M.u8(),allow_borrow:M.bool(),per_action:M.u64(),daily:M.u64(),min_health_factor:M.u256(),meter:sm}),AH=M.struct("StakingPolicy",{validators:M.vector(M.Address),per_stake:M.u64(),daily:M.u64(),meter:sm}),HO=M.struct("AccountCap",{id:jn,owner:M.Address}),OH=e=>ye(HO.parse(e).owner),NH=M.struct("StakedSui",{id:jn,pool_id:jn,stake_activation_epoch:M.u64(),principal:M.u64()}),xH=De("0x3::staking_pool::StakedSui"),CH=M.enum("RateLimit",{Windowed:M.struct("Windowed",{limit:M.u256(),spent:M.u256(),anchor_ms:M.option(M.u64()),index:M.u64(),window:M.enum("Window",{PeriodicMs:M.u64(),CalendarMonths:M.u8()})})}),IH=M.struct("Allowance",{id:jn,settings:M.struct("Settings",{funder:M.Address,spender:M.option(M.Address),app:M.option(M.struct("TypeName",{name:M.string()})),lifetime_cap:M.option(M.u256()),start_timestamp_ms:M.option(M.u64()),expiration_timestamp_ms:M.option(M.u64()),rate_limit:M.option(CH),name:M.string()}),current_spend:M.u256()}),RH=M.struct("AllowanceCap",{id:jn,allowance:jn}),jH=M.struct("Clock",{id:jn,timestamp_ms:M.u64()}),MH=M.struct("Created",{pass:jn,receipt:jn,name:M.string(),owner:M.Address,agent:M.Address,agent_expires_ms:M.u64()}),DH=M.struct("Issued",{pass:jn,coin_type:M.struct("TypeName",{name:M.string()}),lifetime_cap:M.option(M.u256()),expires_ms:M.option(M.u64())}),UH=M.struct("Receipt",{id:jn,pass:jn,name:M.string()}),qO=e=>`${e.packageId}::pass::PASS`,jv=e=>`${e.packageId}::pass::Created`;function Mv(e){const t=MH.parse(e);return{id:ye(t.pass),receiptId:ye(t.receipt),name:t.name,owner:ye(t.owner),agent:ye(t.agent),agentExpiresMs:t.agent_expires_ms}}async function ZO(e,t,s){const r=[];let i=null;do{const c=await e.listOwnedObjects({owner:s,type:BH(t),cursor:i,include:{content:!0}});for(const u of c.objects){const d=UH.parse(u.content);r.push({id:ye(d.id),pass:ye(d.pass),name:d.name})}i=c.hasNextPage?c.cursor:null}while(i);return r}const BH=e=>`${e.packageId}::pass::Receipt`,LH=e=>`0x2::allowance::Allowance<0x2::balance::Balance<${e}>>`,YO=e=>De(`0x${e}`);async function zH(e,t,s){const r=await e.waitForTransaction({digest:s,include:{events:!0,transaction:!0,effects:!0,objectTypes:!0,balanceChanges:!0}});if(r.$kind!=="Transaction")throw new Error("Authorization transaction failed on chain");const i=r.Transaction;if(!i.transaction?.sender)throw new Error("Authorization has no sender");const c=u=>i.events.filter(d=>d.eventType===u);return{sender:ye(i.transaction.sender),passes:c(jv(t)).map(u=>Mv(u.bcs)),issued:c(`${t.packageId}::pass::Issued`).map(u=>{const d=DH.parse(u.bcs);return{passId:ye(d.pass),coinType:YO(d.coin_type.name),lifetimeCap:d.lifetime_cap,expiresMs:d.expires_ms}}),balanceChanges:(i.balanceChanges??[]).map(u=>({address:ye(u.address),coinType:De(u.coinType),amount:u.amount})),objects:i.effects.changedObjects.filter(u=>u.idOperation==="Created"&&i.objectTypes[u.objectId]).map(u=>({id:ye(u.objectId),type:De(i.objectTypes[u.objectId]),owner:u.outputOwner?.$kind==="AddressOwner"?ye(u.outputOwner.AddressOwner):null,shared:u.outputOwner?.$kind==="Shared"}))}}const k4=[500,1e3,2e3,4e3],$H=e=>e instanceof gt&&e.code==="RESOURCE_EXHAUSTED";class VH extends lb{unary(t,s,r){const i=(async()=>{for(let c=0;;c++){const u=super.unary(t,s,r);try{return await u.response,u}catch(d){if(!$H(d)||c>=k4.length)throw d;for(const p of[u.headers,u.status,u.trailers])p.catch(()=>{});await new Promise(p=>setTimeout(p,k4[c]))}}})();return new mA(t,r.meta??{},s,i.then(c=>c.headers),i.then(c=>c.response),i.then(c=>c.status),i.then(c=>c.trailers))}}function qt(e){return new bb({network:e.network,transport:new VH({baseUrl:e.grpcUrl})})}async function WO(e){const{object:t}=await e.getObject({objectId:"0x6",include:{content:!0}});return Number(jH.parse(t.content).timestamp_ms)}function ih(e,t){const s=Math.floor(t/Tp);return{usedToday:s>Number(e.day)?"0":e.used,resetsAtMs:(s+1)*Tp}}async function Dv(e,t){const s=[];let r=null;do{const i=await e.listDynamicFields({parentId:t,cursor:r,include:{value:!0}});s.push(...i.dynamicFields),r=i.hasNextPage?i.cursor:null}while(r);return s}async function PH(e,t,s,r){const i={transfers:[],swaps:[],lending:[],staking:[]};for(const u of await Dv(e,s)){const d=Ss(u.valueType);if(ye(d.address)!==t.packageId)continue;const p=d.typeParams.map(m=>De(m));if(d.module==="transfer_policy"){const m=EH.parse(u.value.bcs),g=(await Dv(e,ye(m.recipients.id))).map(y=>({name:M.string().parse(y.name.bcs),address:ye(M.Address.parse(y.value.bcs))}));g.sort((y,b)=>y.name.localeCompare(b.name)),i.transfers.push({coinType:p[0],recipients:g,perTransfer:m.per_transfer,daily:m.daily,usage:ih(m.meter,r)})}else if(d.module==="swap_policy"){const m=_H.parse(u.value.bcs);i.swaps.push({coinIn:p[0],coinOut:p[1],venues:m.venues.map(g=>ye(g)),perTrade:m.per_trade,daily:m.daily,minPrice:m.min_price,usage:ih(m.meter,r)})}else if(d.module==="lending_policy"){const m=kH.parse(u.value.bcs);i.lending.push({coinType:p[0],poolId:ye(m.pool),asset:m.asset,allowBorrow:m.allow_borrow,perAction:m.per_action,daily:m.daily,minHealthFactor:m.min_health_factor,usage:ih(m.meter,r)})}else if(d.module==="staking_policy"){const m=AH.parse(u.value.bcs);i.staking.push({validators:m.validators.map(g=>ye(g)),perStake:m.per_stake,daily:m.daily,usage:ih(m.meter,r)})}}const c=(u,d)=>u.coinType.localeCompare(d.coinType);return i.transfers.sort(c),i.lending.sort(c),i.swaps.sort((u,d)=>(u.coinIn+u.coinOut).localeCompare(d.coinIn+d.coinOut)),i}async function md(e,t,s){const[{object:r},i]=await Promise.all([e.getObject({objectId:s,include:{content:!0}}),WO(e)]);if(De(r.type)!==De(`${t.packageId}::pass::AgentPass`)||r.owner.$kind!=="Shared")throw new Error("Unexpected pass type or ownership");const{control:c}=SH.parse(r.content),[u,d]=await Promise.all([PH(e,t,ye(c.policies.bag.id),i),Dv(e,ye(c.positions.id))]),p=d.find(g=>De(g.valueType)===De(`${t.protocols.navi.packageId}::account::AccountCap`)),m=d.filter(g=>De(g.valueType)===xH).map(g=>{const y=NH.parse(g.value.bcs);return{id:ye(y.id),poolId:ye(y.pool_id),activationEpoch:y.stake_activation_epoch,principal:y.principal}}).sort((g,y)=>g.id.localeCompare(y.id));return{id:ye(c.controller),name:c.name,owner:ye(c.owner),agent:ye(c.agent),agentExpiresMs:c.agent_expires_ms,revoked:c.agent_expires_ms==="0",policies:u,naviPosition:p?ye(HO.parse(p.value.bcs).owner):null,stakes:m,chainTimeMs:i}}async function GH(e,t,s){const r=await FH(e,t,s);return Object.fromEntries(Object.entries(r).map(([i,c])=>[i,c.addressBalance]))}async function FH(e,t,s){const r=await Promise.all(t.coins.map(async i=>{const{balance:c}=await e.getBalance({owner:s,coinType:i.type});return[De(i.type),{addressBalance:c.addressBalance,coinBalance:c.coinBalance}]}));return Object.fromEntries(r)}function HH(e){const t=Ss(e);if(ye(t.address)!==ye("0x2")||t.module!=="allowance"||t.name!=="Allowance")return null;const s=t.typeParams[0];if(!s||typeof s=="string")return null;const r=s.typeParams[0];return r?De(r):null}async function o1(e,t,s){let r;try{({object:r}=await e.getObject({objectId:t,include:{content:!0}}))}catch(m){if(m instanceof hh&&(m.reason==="deleted"||m.reason==="notFound"))return null;throw m}if(De(r.type)!==De(LH(s))||r.owner.$kind!=="Shared")throw new Error("Unexpected allowance type or ownership");const i=await WO(e),c=IH.parse(r.content),u=c.settings,d=u.rate_limit?.Windowed;let p=null;if(d){const m=d.window.PeriodicMs??null;let g=d.spent;d.anchor_ms!==null&&m!==null&&Math.floor((i-Number(d.anchor_ms))/Number(m))>Number(d.index)&&(g="0"),p={limit:d.limit,spent:d.spent,spentNow:g,anchorMs:d.anchor_ms,index:d.index,periodMs:m,months:d.window.CalendarMonths??null}}return{id:ye(c.id),coinType:s,funder:ye(u.funder),spender:u.spender?ye(u.spender):null,app:u.app?YO(u.app.name):null,name:u.name,lifetimeCap:u.lifetime_cap,startMs:u.start_timestamp_ms,expirationMs:u.expiration_timestamp_ms,rateLimit:p,currentSpend:c.current_spend,chainTimeMs:i}}async function qH(e,t){const{object:s}=await e.getObject({objectId:t,include:{content:!0}});return ye(RH.parse(s.content).allowance)}async function ZH(e,t,s){const r=De(qO(t)),i=ye(s.owner),c=ye(s.agent),u=[];let d=null;do{const g=await e.listOwnedObjects({owner:i,cursor:d,limit:50});for(const y of g.objects){const b=Ss(y.type);ye(b.address)===ye("0x2")&&b.module==="allowance"&&b.name==="AllowanceCap"&&u.push(y.objectId)}d=g.hasNextPage?g.cursor:null}while(d&&u.length<1e3);const p={};let m=null;return await Promise.all(u.map(async g=>{const y=await qH(e,g).catch(()=>null);if(!y)return;const{object:b}=await e.getObject({objectId:y}).catch(()=>({object:null})),E=b?HH(b.type):null;if(!E)return;const O=await o1(e,y,E);!O||O.funder!==i||O.spender!==c||(O.app===r?p[E]={allowance:y,revokeCap:g}:O.app===null&&O.name===VO&&E===Lt&&(m={allowance:y,revokeCap:g}))})),{allowances:p,gas:m}}async function XO(e,t){const s=await Promise.all(Object.entries(t.allowances).map(async([r,i])=>[r,await o1(e,i.allowance,r)]));return Object.fromEntries(s)}async function c1(e,t,s){const r=[...t.coins],i=[...t.pools],c=[["deepbook",t.protocols.deepbook.packageId],["cetus",t.protocols.cetus.packageId]];for(const d of s.pools){if(i.some(O=>ye(O.poolId)===ye(d)))continue;const{object:p}=await e.getObject({objectId:d}),m=Ss(p.type),g=c.find(([,O])=>ye(m.address)===ye(O))?.[0],[y,b]=m.typeParams;if(!g||m.module!=="pool"||m.name!=="Pool"||!y||!b)throw new Error(`${d} is not a DeepBook or Cetus pool on this network`);const E=O=>De(typeof O=="string"?O:KO(O));i.push({venue:g,poolId:ye(d),coinA:E(y),coinB:E(b)})}const u=new Set(s.coins.map(d=>De(d)));for(const d of i)u.add(d.coinA),u.add(d.coinB);for(const d of u){if(r.some(m=>At(m.type,d)))continue;const{coinMetadata:p}=await e.getCoinMetadata({coinType:d});if(!p)throw new Error(`${d} has no coin metadata on this network`);r.push({type:d,symbol:p.symbol.slice(0,16)||"COIN",decimals:p.decimals,unlisted:!0})}return{...t,coins:r,pools:i}}function KO(e){const t=e.typeParams.map(s=>typeof s=="string"?s:KO(s));return`${e.address}::${e.module}::${e.name}${t.length?`<${t.join(",")}>`:""}`}function YH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/tx/${encodeURIComponent(t)}`}function WH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/object/${t}`}function XH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/account/${t}`}const KH=e=>(Number(BigInt(e)/10n**25n)/100).toFixed(2);function JO(e,t,s=null){const r=(d,p)=>hn(e,d,p),i=d=>e.coins.find(p=>At(p.type,d))?.symbol??d,c=(d,p)=>{const m=e.pools.find(b=>b.poolId===d);if(!m)return d;const g=m.venue==="deepbook"?"DeepBook":"Cetus";return p&&(At(m.coinA,p[0])&&At(m.coinB,p[1])||At(m.coinA,p[1])&&At(m.coinB,p[0]))?g:`${g} ${i(m.coinA)}/${i(m.coinB)}`},u=[{label:"Allowed actions",value:[t.transfers.length&&"Transfers",t.swaps.length&&"Swaps",t.lending.length&&(t.lending.some(d=>d.allowBorrow)?"Lending and borrowing":"Lending"),t.staking&&"Staking"].filter(Boolean).join(" + ")}];for(const d of t.transfers){const p=s?.transfers.find(m=>At(m.coinType,d.coin));u.push({starts:!0,label:`Pay ${i(d.coin)} to`,value:(p?.recipients??d.recipients).map(m=>`${m.name} → ${m.address}`).join(`
|
|
841
841
|
`)},{label:`Max ${i(d.coin)} per transfer / per UTC day`,value:`${r(d.coin,p?.perTransfer??d.perTransfer)} / ${r(d.coin,p?.daily??d.daily)}`})}for(const d of t.swaps){const p=s?.swaps.find(y=>At(y.coinIn,d.coinIn)&&At(y.coinOut,d.coinOut)),m=p?.minPrice??d.minPrice,g=a1(e,d.coinIn,d.coinOut);u.push({starts:!0,label:g.limit==="max"?`Buy ${i(d.coinOut)} with ${i(d.coinIn)} on`:`Sell ${i(d.coinIn)} for ${i(d.coinOut)} on`,value:(p?.venues??d.pools).map(y=>c(y,[d.coinIn,d.coinOut])).join(", ")},{label:`Max ${i(d.coinIn)} ${g.limit==="max"?"spent":"sold"} per trade / per UTC day`,value:`${r(d.coinIn,p?.perTrade??d.perTrade)} / ${r(d.coinIn,p?.daily??d.daily)}`},{label:g.limit==="max"?"Highest price paid":"Lowest price accepted",value:`${yH(e,d.coinIn,d.coinOut,m)} ${i(g.quote)} per ${i(g.base)}`})}for(const d of t.lending){const p=s?.lending.find(g=>At(g.coinType,d.coin));u.push({starts:!0,label:`Max NAVI ${d.allowBorrow?"borrowing":"collateral"} in ${i(d.coin)} per action / per UTC day`,value:`${r(d.coin,p?.perAction??d.perAction)} / ${r(d.coin,p?.daily??d.daily)}`});const m=p?KH(p.minHealthFactor):d.minHealthFactor?.toFixed(2);m&&m!=="0.00"&&u.push({label:`Health factor kept above (${i(d.coin)})`,value:m})}if(t.staking){const d=s?.staking[0],p=d?.validators??t.staking.validators;u.push({starts:!0,label:"Stake SUI with",value:p.length?p.join(`
|
|
842
|
-
`):"Any active validator"},{label:"Max SUI per stake / per UTC day",value:`${r(Lt,d?.perStake??t.staking.perStake)} / ${r(Lt,d?.daily??t.staking.daily)}`})}return u}const JH=new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"short",timeZone:"UTC"});function Uv(e,t){return[...JO(e,t.policy),{starts:!0,label:"Authorization ends",value:`${JH.format(t.expiresMs)} UTC (${t.ttlMs/864e5} ${t.ttlMs===864e5?"day":"days"}); you can revoke earlier`},{label:"Agent may ever withdraw (lifetime caps)",value:Object.entries(t.allowances).map(([s,r])=>hn(e,s,r)).join(", ")},{label:"Max gas allowance, lifetime / per 24 hours from first top-up",value:`${hn(e,Lt,t.gasCap)} / ${hn(e,Lt,t.gasDaily)}`},{label:"Agent gas stipend (outside the rules)",value:hn(e,Lt,t.gasAmount)}]}const QH=new Set(["deposit_object","withdraw_object","navi_open","destroy","issue","add_policy","remove_policy","set_term","revoke_agent"]);function QO(e,t,s,r){const{inputs:i,commands:c}=r.transaction,u=(G,J)=>G?hn(e,A4(G),J):`${J} base units of an unknown coin`,d=G=>G?sr(e,A4(G)):"an unknown coin",p=G=>G&&typeof G=="object"&&"Input"in G?i[G.Input]:void 0,m=(G,J)=>{const w=p(G);if(!w||!("Pure"in w)||!w.Pure)return null;try{const A=Ge(w.Pure.bytes);return J==="u64"?M.u64().parse(A):J==="address"?ye(M.Address.parse(A)):M.string().parse(A)}catch{return null}},g=G=>{const J=p(G);if(!J||!("Object"in J)||!J.Object)return null;const w=J.Object,A="SharedObject"in w?w.SharedObject?.objectId:"ImmOrOwnedObject"in w?w.ImmOrOwnedObject?.objectId:void 0;return A?ye(A):null},y=G=>{const J=p(G);return!J||!("FundsWithdrawal"in J)||!J.FundsWithdrawal?null:J.FundsWithdrawal.reservation?.MaxAmountU64??null},b=G=>{const J=y(G.arguments[1]);return J===null?"SUI":u(Lt,J)},E=G=>{const J=e.pools.find(w=>w.poolId===G);return J?J.venue==="deepbook"?"DeepBook":"Cetus":"a pool you did not list"},O=G=>[e.packageId,e.publishedAt].some(J=>ye(J)===ye(G)),C=c.flatMap(G=>"MoveCall"in G&&G.MoveCall?[G.MoveCall]:[]),R=C.find(G=>O(G.package)&&G.module==="pass")??C.find(G=>O(G.package))??C[0];let $="Custom transaction",x=null;if(R&&O(R.package)){const[G,J]=R.typeArguments,w=R.arguments,A=(N,F=G)=>{const B=m(w[N],"u64")??y(w[N]);return B===null?"an amount":u(F,B)};switch(R.function){case"transfer":x=m(w[w.length-2],"string"),$=`Pay ${A(3)} to ${x?`"${x}"`:"a recipient"}`;break;case"begin_swap":{const F=C.filter(z=>["deepbook_base_to_quote","deepbook_quote_to_base","cetus_a_to_b","cetus_b_to_a"].includes(z.function)).map(z=>E(g(z.arguments[z.function.startsWith("cetus")?3:2]))),B=C.find(z=>z.function==="finish_swap"),q=B?m(B.arguments[2],"u64"):null;$=`Sell ${A(3)} for ${d(J)} on ${F.join(", then ")||"no pool"}, accepting at least ${q===null?"an amount":u(J,q)}`;break}case"navi_supply":$=`Supply ${A(3)} to NAVI`;break;case"navi_repay":$=`Repay ${A(3)} to NAVI`;break;case"navi_withdraw":$=`Withdraw ${A(7)} from NAVI`;break;case"navi_borrow":$=`Borrow ${A(7)} from NAVI`;break;case"stake":{const N=m(w[5],"address");$=`Stake ${A(3,Lt)} with ${N?`validator ${Cy(N)}`:"a validator"}`;break}case"unstake":{const N=m(w[3],"address");$=`Unstake ${N?Cy(N):"a stake"} back to your balance`;break}default:$=QH.has(R.function)?`Call the owner-only ${R.module}::${R.function}`:`Call ${R.module}::${R.function}`}}else R&&ye(R.package)===ye("0x2")&&R.module==="allowance"&&R.function==="balance_spend"?$=`Top up the agent's gas with ${b(R)}`:R&&($=`Call ${R.module}::${R.function}`);const W=new Map(s.map(G=>[ye(G.address),G.name])),oe=ye(t),me=r.status.success?r.balanceChanges.filter(G=>BigInt(G.amount)>0n&&ye(G.address)!==oe).map(G=>`${u(G.coinType,G.amount)} → ${W.get(ye(G.address))??Cy(G.address)}`):[];return{digest:r.digest,timestampMs:r.timestampMs,success:r.status.success,what:$,why:r.status.success?null:eq(e,r.status.error,x),moved:me}}const Cy=e=>`${e.slice(0,8)}…${e.slice(-6)}`,A4=e=>e.replace(/^0x0*([0-9a-f]+)::/i,(t,s)=>`${ye(s)}::`);function eq(e,t,s){const r=t.MoveAbort;if(t.message==="InsufficientBalanceForWithdraw")return"The owner's address balance does not hold enough of this coin right now. This is not one of the owner's rules: the action can run once the balance covers it (InsufficientBalanceForWithdraw)";if(!r?.location?.module)return t.message;const i=Number(r.cleverError?.errorCode??r.abortCode),c=`${r.location.module} abort ${i}`,u=ye(r.location.package??"0x0"),d={allowance:{3:"Over the lifetime cap of the owner's allowance for this coin (checked before the daily limit, so when the two are equal the day is used up as well)",4:"Over the gas allowance's limit per 24 hours from first top-up"},validator_set:{10:"Below the 1 SUI minimum stake",0:"Not an active validator"}};if(u===ye("0x2")||u===ye("0x3")){const g=d[r.location.module]?.[i];return g?`${g} (${c})`:`Refused in ${c}`}if(u!==ye(e.packageId)){const y={1500:"NAVI is paused",1502:"NAVI has no fresh oracle price for this asset; the price must be refreshed in the same transaction",1503:"NAVI rejected the amount",1506:"NAVI pool has insufficient balance",1508:"NAVI no longer accepts this entry point; the pass must call its current one",1600:"NAVI finds the position unhealthy",1601:"the position holds no collateral",1602:"the position has no debt to repay",1603:"the collateral does not cover that borrow (loan-to-value)",1604:"NAVI's deposit cap for this asset is reached",1605:"NAVI's borrow cap for this asset is reached"}[i];return y?`Refused by NAVI, not by your rules: ${y} (${c})`:`Refused inside the protocol, not by your rules (${c}): ${t.message}`}const m={transfer_policy:{0:`${s?`"${s}"`:"That recipient"} is not a recipient you named`,1:"Over your per-transfer limit",2:"Zero amount"},meter:{0:"Over your daily limit"},swap_policy:{0:"Not a pool you listed",1:"Over your per-trade limit",3:"Below the agent's own minimum output",4:"Worse than your price limit",8:"The venue filled nothing (order under its minimum size)"},lending_policy:{0:"Not the NAVI pool or asset you chose",1:"Borrowing is not allowed",3:"Over your per-action limit"},navi:{0:"Your health-factor floor would be breached",2:"The NAVI account is not in the pass; you reclaimed it"},staking_policy:{0:"Not a validator you listed",1:"Over your per-stake limit",2:"Zero amount"},staking:{0:"No such stake is held by the pass"},pass:{1:"Not an allowance issued for this pass",2:"No such object is held by the pass",7:"A swap begun on one pass cannot end on another"},control:{0:"Only your wallet can do this",1:"This key is not your agent",2:"Your agent's access was revoked or has expired"},policies:{0:"No rule allows this coin or action"}}[r.location.module]?.[i];return m?`${m} (${c})`:`Refused in ${c}`}async function tq(e,t,s){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:t,variables:s})});if(!r.ok)throw new Error(`GraphQL ${e}: HTTP ${r.status}`);const i=await r.json();if(i.errors?.length)throw new Error(`GraphQL ${e}: ${i.errors.map(c=>c.message).join("; ")}`);if(!i.data)throw new Error(`GraphQL ${e}: empty response`);return i.data}async function eN(e,t,s,r,i,c,u){const p=(await tq(e,`query($filter: ${r}, $limit: Int!, $before: String) { ${t}(last: $limit, before: $before, filter: $filter) { pageInfo { hasPreviousPage startCursor } nodes { ${s} } } }`,{filter:i,limit:c,before:u}))[t];return{nodes:p.nodes.slice().reverse(),hasNextPage:p.pageInfo.hasPreviousPage,endCursor:p.pageInfo.startCursor}}async function nq(e,t,s){const{nodes:r}=await eN(e,"transactions","digest","TransactionFilter",t,s,null);return r.map(i=>i.digest)}async function tN(e,t,s,r=null){if(t.graphqlUrl){const{nodes:u,hasNextPage:d,endCursor:p}=await eN(t.graphqlUrl,"events","timestamp contents { bcs } transaction { digest }","EventFilter",{type:jv(t)},s,r);return{summaries:u.filter(g=>g.contents&&g.transaction).map(g=>({...Mv(Ge(g.contents.bcs)),digest:g.transaction.digest,timestampMs:g.timestamp?Date.parse(g.timestamp):null})),hasNextPage:d,endCursor:p}}const i=await e.listEvents({filter:{eventType:jv(t)},order:"descending",limit:s,...r?{before:r}:{}});return{summaries:await Promise.all(i.events.map(async u=>{const d=await e.getTransaction({digest:u.transactionDigest}).catch(()=>null),p=d?.Transaction??d?.FailedTransaction;return{...Mv(u.bcs),digest:u.transactionDigest,timestampMs:p?.timestampMs??null}})),hasNextPage:i.hasNextPage,endCursor:i.endCursor}}const sq=(e,t)=>oj(e.configId,`${e.packageId}::pass::AgentKey`,M.Address.serialize(ye(t)).toBytes());async function rq(e,t,s){const r=sq(t,s),i=await e.getObject({objectId:r,include:{previousTransaction:!0}}).catch(u=>{if(u?.code==="notExists")return null;throw u});if(!i?.object.previousTransaction)return null;const{owner:c}=await md(e,t,r);return{id:r,owner:c,digest:i.object.previousTransaction}}async function aq(e,t,s=50){return(await tN(e,t,s)).summaries}async function rm(e,t,s){const r=ye(s);let i=null;for(let c=0;c<40;c++){const{summaries:u,hasNextPage:d,endCursor:p}=await tN(e,t,50,i),m=u.find(g=>g.id===r);if(m)return m;if(!d||!p)return null;i=p}return null}async function l1(e,t,s){const r=await md(e,t,s.id),{allowances:i,gas:c}=await ZH(e,t,{owner:s.owner,agent:r.agent});return!c||Object.keys(i).length===0?null:{passId:s.id,receiptId:s.receiptId,allowances:i,gasAllowance:c.allowance,gasRevokeCap:c.revokeCap,owner:s.owner,authorizationDigest:s.digest}}const nN={transaction:!0,balanceChanges:!0};async function sN(e,t,s,r,i){return(t.graphqlUrl?await Promise.all((await nq(t.graphqlUrl,"sender"in s?{sentAddress:s.sender}:s,r)).map(u=>e.getTransaction({digest:u,include:i}))):(await e.listTransactions({filter:s,order:"descending",limit:r,include:i})).transactions).map(u=>u.Transaction??u.FailedTransaction)}async function iq(e,t,s,r,i=30){return(await sN(e,t,{sender:s},i,nN)).map(u=>QO(t,s,r,u))}async function oq(e,t,s=40){return(await sN(e,t,{function:`${t.publishedAt}::pass`},s,nN)).map(i=>{const c=ye(i.transaction?.sender??"0x0");return{...QO(t,c,[],i),sender:c}})}const O4=M.bytes(32).transform({input:e=>sd(e),output:e=>Ar(e)});M.struct("IncentiveAPYInfo",{asset_id:M.u8(),apy:M.u256(),coin_types:M.vector(M.string())});const cq=M.struct("IncentivePoolInfo",{pool_id:O4,funds:O4,phase:M.u64(),start_at:M.u64(),end_at:M.u64(),closed_at:M.u64(),total_supply:M.u64(),asset_id:M.u8(),option:M.u8(),factor:M.u256(),distributed:M.u64(),available:M.u256(),total:M.u256()});M.struct("IncentivePoolInfoByPhase",{phase:M.u64(),pools:M.vector(cq)});M.struct("OracleInfo",{oracle_id:M.u8(),price:M.u256(),decimals:M.u8(),valid:M.bool()});M.struct("FlashLoanAssetConfig",{id:M.string(),asset_id:M.u8(),coin_type:M.string(),pool_id:M.string(),rate_to_supplier:M.u64(),rate_to_treasury:M.u64(),max:M.u64(),min:M.u64()});M.struct("ReserveDataInfo",{id:M.u8(),oracle_id:M.u8(),coin_type:M.string(),supply_cap:M.u256(),borrow_cap:M.u256(),supply_rate:M.u256(),borrow_rate:M.u256(),supply_index:M.u256(),borrow_index:M.u256(),total_supply:M.u256(),total_borrow:M.u256(),last_update_at:M.u64(),ltv:M.u256(),treasury_factor:M.u256(),treasury_balance:M.u256(),base_rate:M.u256(),multiplier:M.u256(),jump_rate_multiplier:M.u256(),reserve_factor:M.u256(),optimal_utilization:M.u256(),liquidation_ratio:M.u256(),liquidation_bonus:M.u256(),liquidation_threshold:M.u256()});M.struct("UserStateInfo",{asset_id:M.u8(),borrow_balance:M.u256(),supply_balance:M.u256()});var Iy,N4;function lq(){if(N4)return Iy;N4=1;var e="[object Symbol]",t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,s=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,r="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",c="\\u20d0-\\u20f0",u="\\u2700-\\u27bf",d="a-z\\xdf-\\xf6\\xf8-\\xff",p="\\xac\\xb1\\xd7\\xf7",m="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",g="\\u2000-\\u206f",y=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",b="A-Z\\xc0-\\xd6\\xd8-\\xde",E="\\ufe0e\\ufe0f",O=p+m+g+y,C="['’]",R="["+r+"]",$="["+O+"]",x="["+i+c+"]",W="\\d+",oe="["+u+"]",me="["+d+"]",G="[^"+r+O+W+u+d+b+"]",J="\\ud83c[\\udffb-\\udfff]",w="(?:"+x+"|"+J+")",A="[^"+r+"]",N="(?:\\ud83c[\\udde6-\\uddff]){2}",F="[\\ud800-\\udbff][\\udc00-\\udfff]",B="["+b+"]",q="\\u200d",z="(?:"+me+"|"+G+")",D="(?:"+B+"|"+G+")",k="(?:"+C+"(?:d|ll|m|re|s|t|ve))?",j="(?:"+C+"(?:D|LL|M|RE|S|T|VE))?",U=w+"?",V="["+E+"]?",K="(?:"+q+"(?:"+[A,N,F].join("|")+")"+V+U+")*",P=V+U+K,re="(?:"+[oe,N,F].join("|")+")"+P,ue="(?:"+[A+x+"?",x,N,F,R].join("|")+")",I=RegExp(C,"g"),X=RegExp(x,"g"),ce=RegExp(J+"(?="+J+")|"+ue+P,"g"),he=RegExp([B+"?"+me+"+"+k+"(?="+[$,B,"$"].join("|")+")",D+"+"+j+"(?="+[$,B+z,"$"].join("|")+")",B+"?"+z+"+"+k,B+"+"+j,W,re].join("|"),"g"),Te=RegExp("["+q+r+i+c+E+"]"),Oe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ae={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},be=typeof Ac=="object"&&Ac&&Ac.Object===Object&&Ac,_e=typeof self=="object"&&self&&self.Object===Object&&self,Pe=be||_e||Function("return this")();function at(Ce,Ye,Nt,ks){for(var Mn=-1,Oo=Ce?Ce.length:0;++Mn<Oo;)Nt=Ye(Nt,Ce[Mn],Mn,Ce);return Nt}function H(Ce){return Ce.split("")}function te(Ce){return Ce.match(t)||[]}function de(Ce){return function(Ye){return Ce?.[Ye]}}var fe=de(Ae);function le(Ce){return Te.test(Ce)}function $e(Ce){return Oe.test(Ce)}function Le(Ce){return le(Ce)?Dt(Ce):H(Ce)}function Dt(Ce){return Ce.match(ce)||[]}function _s(Ce){return Ce.match(he)||[]}var ba=Object.prototype,pl=ba.toString,Ti=Pe.Symbol,Ao=Ti?Ti.prototype:void 0,ml=Ao?Ao.toString:void 0;function or(Ce,Ye,Nt){var ks=-1,Mn=Ce.length;Ye<0&&(Ye=-Ye>Mn?0:Mn+Ye),Nt=Nt>Mn?Mn:Nt,Nt<0&&(Nt+=Mn),Mn=Ye>Nt?0:Nt-Ye>>>0,Ye>>>=0;for(var Oo=Array(Mn);++ks<Mn;)Oo[ks]=Ce[ks+Ye];return Oo}function gl(Ce){if(typeof Ce=="string")return Ce;if(bl(Ce))return ml?ml.call(Ce):"";var Ye=Ce+"";return Ye=="0"&&1/Ce==-1/0?"-0":Ye}function yl(Ce,Ye,Nt){var ks=Ce.length;return Nt=Nt===void 0?ks:Nt,!Ye&&Nt>=ks?Ce:or(Ce,Ye,Nt)}function im(Ce){return function(Ye){Ye=wa(Ye);var Nt=le(Ye)?Le(Ye):void 0,ks=Nt?Nt[0]:Ye.charAt(0),Mn=Nt?yl(Nt,1).join(""):Ye.slice(1);return ks[Ce]()+Mn}}function gd(Ce){return function(Ye){return at(yd(zn(Ye).replace(I,"")),Ce,"")}}function vl(Ce){return!!Ce&&typeof Ce=="object"}function bl(Ce){return typeof Ce=="symbol"||vl(Ce)&&pl.call(Ce)==e}function wa(Ce){return Ce==null?"":gl(Ce)}var om=gd(function(Ce,Ye,Nt){return Ye=Ye.toLowerCase(),Ce+(Nt?cm(Ye):Ye)});function cm(Ce){return lm(wa(Ce).toLowerCase())}function zn(Ce){return Ce=wa(Ce),Ce&&Ce.replace(s,fe).replace(X,"")}var lm=im("toUpperCase");function yd(Ce,Ye,Nt){return Ce=wa(Ce),Ye=Ye,Ye===void 0?$e(Ce)?_s(Ce):te(Ce):Ce.match(Ye)||[]}return Iy=om,Iy}lq();var uq=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ry=Math.ceil,Us=Math.floor,ss="[BigNumber Error] ",x4=ss+"Number primitive has more than 15 significant digits: ",Xs=1e14,Ze=14,jy=9007199254740991,My=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Qa=1e7,wn=1e9;function rN(e){var t,s,r,i=x.prototype={constructor:x,toString:null,valueOf:null},c=new x(1),u=20,d=4,p=-7,m=21,g=-1e7,y=1e7,b=!1,E=1,O=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},R="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function x(w,A){var N,F,B,q,z,D,k,j,U=this;if(!(U instanceof x))return new x(w,A);if(A==null){if(w&&w._isBigNumber===!0){U.s=w.s,!w.c||w.e>y?U.c=U.e=null:w.e<g?U.c=[U.e=0]:(U.e=w.e,U.c=w.c.slice());return}if((D=typeof w=="number")&&w*0==0){if(U.s=1/w<0?(w=-w,-1):1,w===~~w){for(q=0,z=w;z>=10;z/=10,q++);q>y?U.c=U.e=null:(U.e=q,U.c=[w]);return}j=String(w)}else{if(!uq.test(j=String(w)))return r(U,j,D);U.s=j.charCodeAt(0)==45?(j=j.slice(1),-1):1}(q=j.indexOf("."))>-1&&(j=j.replace(".","")),(z=j.search(/e/i))>0?(q<0&&(q=z),q+=+j.slice(z+1),j=j.substring(0,z)):q<0&&(q=j.length)}else{if($t(A,2,R.length,"Base"),A==10&&$)return U=new x(w),G(U,u+U.e+1,d);if(j=String(w),D=typeof w=="number"){if(w*0!=0)return r(U,j,D,A);if(U.s=1/w<0?(j=j.slice(1),-1):1,x.DEBUG&&j.replace(/^0\.0*|\./,"").length>15)throw Error(x4+w)}else U.s=j.charCodeAt(0)===45?(j=j.slice(1),-1):1;for(N=R.slice(0,A),q=z=0,k=j.length;z<k;z++)if(N.indexOf(F=j.charAt(z))<0){if(F=="."){if(z>q){q=k;continue}}else if(!B&&(j==j.toUpperCase()&&(j=j.toLowerCase())||j==j.toLowerCase()&&(j=j.toUpperCase()))){B=!0,z=-1,q=0;continue}return r(U,String(w),D,A)}D=!1,j=s(j,A,10,U.s),(q=j.indexOf("."))>-1?j=j.replace(".",""):q=j.length}for(z=0;j.charCodeAt(z)===48;z++);for(k=j.length;j.charCodeAt(--k)===48;);if(j=j.slice(z,++k)){if(k-=z,D&&x.DEBUG&&k>15&&(w>jy||w!==Us(w)))throw Error(x4+U.s*w);if((q=q-z-1)>y)U.c=U.e=null;else if(q<g)U.c=[U.e=0];else{if(U.e=q,U.c=[],z=(q+1)%Ze,q<0&&(z+=Ze),z<k){for(z&&U.c.push(+j.slice(0,z)),k-=Ze;z<k;)U.c.push(+j.slice(z,z+=Ze));z=Ze-(j=j.slice(z)).length}else z-=k;for(;z--;j+="0");U.c.push(+j)}}else U.c=[U.e=0]}x.clone=rN,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(w){var A,N;if(w!=null)if(typeof w=="object"){if(w.hasOwnProperty(A="DECIMAL_PLACES")&&(N=w[A],$t(N,0,wn,A),u=N),w.hasOwnProperty(A="ROUNDING_MODE")&&(N=w[A],$t(N,0,8,A),d=N),w.hasOwnProperty(A="EXPONENTIAL_AT")&&(N=w[A],N&&N.pop?($t(N[0],-wn,0,A),$t(N[1],0,wn,A),p=N[0],m=N[1]):($t(N,-wn,wn,A),p=-(m=N<0?-N:N))),w.hasOwnProperty(A="RANGE"))if(N=w[A],N&&N.pop)$t(N[0],-wn,-1,A),$t(N[1],1,wn,A),g=N[0],y=N[1];else if($t(N,-wn,wn,A),N)g=-(y=N<0?-N:N);else throw Error(ss+A+" cannot be zero: "+N);if(w.hasOwnProperty(A="CRYPTO"))if(N=w[A],N===!!N)if(N)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))b=N;else throw b=!N,Error(ss+"crypto unavailable");else b=N;else throw Error(ss+A+" not true or false: "+N);if(w.hasOwnProperty(A="MODULO_MODE")&&(N=w[A],$t(N,0,9,A),E=N),w.hasOwnProperty(A="POW_PRECISION")&&(N=w[A],$t(N,0,wn,A),O=N),w.hasOwnProperty(A="FORMAT"))if(N=w[A],typeof N=="object")C=N;else throw Error(ss+A+" not an object: "+N);if(w.hasOwnProperty(A="ALPHABET"))if(N=w[A],typeof N=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(N))$=N.slice(0,10)=="0123456789",R=N;else throw Error(ss+A+" invalid: "+N)}else throw Error(ss+"Object expected: "+w);return{DECIMAL_PLACES:u,ROUNDING_MODE:d,EXPONENTIAL_AT:[p,m],RANGE:[g,y],CRYPTO:b,MODULO_MODE:E,POW_PRECISION:O,FORMAT:C,ALPHABET:R}},x.isBigNumber=function(w){if(!w||w._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var A,N,F=w.c,B=w.e,q=w.s;e:if({}.toString.call(F)=="[object Array]"){if((q===1||q===-1)&&B>=-wn&&B<=wn&&B===Us(B)){if(F[0]===0){if(B===0&&F.length===1)return!0;break e}if(A=(B+1)%Ze,A<1&&(A+=Ze),String(F[0]).length==A){for(A=0;A<F.length;A++)if(N=F[A],N<0||N>=Xs||N!==Us(N))break e;if(N!==0)return!0}}}else if(F===null&&B===null&&(q===null||q===1||q===-1))return!0;throw Error(ss+"Invalid BigNumber: "+w)},x.maximum=x.max=function(){return oe(arguments,-1)},x.minimum=x.min=function(){return oe(arguments,1)},x.random=(function(){var w=9007199254740992,A=Math.random()*w&2097151?function(){return Us(Math.random()*w)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(N){var F,B,q,z,D,k=0,j=[],U=new x(c);if(N==null?N=u:$t(N,0,wn),z=Ry(N/Ze),b)if(crypto.getRandomValues){for(F=crypto.getRandomValues(new Uint32Array(z*=2));k<z;)D=F[k]*131072+(F[k+1]>>>11),D>=9e15?(B=crypto.getRandomValues(new Uint32Array(2)),F[k]=B[0],F[k+1]=B[1]):(j.push(D%1e14),k+=2);k=z/2}else if(crypto.randomBytes){for(F=crypto.randomBytes(z*=7);k<z;)D=(F[k]&31)*281474976710656+F[k+1]*1099511627776+F[k+2]*4294967296+F[k+3]*16777216+(F[k+4]<<16)+(F[k+5]<<8)+F[k+6],D>=9e15?crypto.randomBytes(7).copy(F,k):(j.push(D%1e14),k+=7);k=z/7}else throw b=!1,Error(ss+"crypto unavailable");if(!b)for(;k<z;)D=A(),D<9e15&&(j[k++]=D%1e14);for(z=j[--k],N%=Ze,z&&N&&(D=My[Ze-N],j[k]=Us(z/D)*D);j[k]===0;j.pop(),k--);if(k<0)j=[q=0];else{for(q=-1;j[0]===0;j.splice(0,1),q-=Ze);for(k=1,D=j[0];D>=10;D/=10,k++);k<Ze&&(q-=Ze-k)}return U.e=q,U.c=j,U}})(),x.sum=function(){for(var w=1,A=arguments,N=new x(A[0]);w<A.length;)N=N.plus(A[w++]);return N},s=(function(){var w="0123456789";function A(N,F,B,q){for(var z,D=[0],k,j=0,U=N.length;j<U;){for(k=D.length;k--;D[k]*=F);for(D[0]+=q.indexOf(N.charAt(j++)),z=0;z<D.length;z++)D[z]>B-1&&(D[z+1]==null&&(D[z+1]=0),D[z+1]+=D[z]/B|0,D[z]%=B)}return D.reverse()}return function(N,F,B,q,z){var D,k,j,U,V,K,P,re,ue=N.indexOf("."),I=u,X=d;for(ue>=0&&(U=O,O=0,N=N.replace(".",""),re=new x(F),K=re.pow(N.length-ue),O=U,re.c=A(ea(Ds(K.c),K.e,"0"),10,B,w),re.e=re.c.length),P=A(N,F,B,z?(D=R,w):(D=w,R)),j=U=P.length;P[--U]==0;P.pop());if(!P[0])return D.charAt(0);if(ue<0?--j:(K.c=P,K.e=j,K.s=q,K=t(K,re,I,X,B),P=K.c,V=K.r,j=K.e),k=j+I+1,ue=P[k],U=B/2,V=V||k<0||P[k+1]!=null,V=X<4?(ue!=null||V)&&(X==0||X==(K.s<0?3:2)):ue>U||ue==U&&(X==4||V||X==6&&P[k-1]&1||X==(K.s<0?8:7)),k<1||!P[0])N=V?ea(D.charAt(1),-I,D.charAt(0)):D.charAt(0);else{if(P.length=k,V)for(--B;++P[--k]>B;)P[k]=0,k||(++j,P=[1].concat(P));for(U=P.length;!P[--U];);for(ue=0,N="";ue<=U;N+=D.charAt(P[ue++]));N=ea(N,j,D.charAt(0))}return N}})(),t=(function(){function w(F,B,q){var z,D,k,j,U=0,V=F.length,K=B%Qa,P=B/Qa|0;for(F=F.slice();V--;)k=F[V]%Qa,j=F[V]/Qa|0,z=P*k+j*K,D=K*k+z%Qa*Qa+U,U=(D/q|0)+(z/Qa|0)+P*j,F[V]=D%q;return U&&(F=[U].concat(F)),F}function A(F,B,q,z){var D,k;if(q!=z)k=q>z?1:-1;else for(D=k=0;D<q;D++)if(F[D]!=B[D]){k=F[D]>B[D]?1:-1;break}return k}function N(F,B,q,z){for(var D=0;q--;)F[q]-=D,D=F[q]<B[q]?1:0,F[q]=D*z+F[q]-B[q];for(;!F[0]&&F.length>1;F.splice(0,1));}return function(F,B,q,z,D){var k,j,U,V,K,P,re,ue,I,X,ce,he,Te,Oe,Ae,be,_e,Pe=F.s==B.s?1:-1,at=F.c,H=B.c;if(!at||!at[0]||!H||!H[0])return new x(!F.s||!B.s||(at?H&&at[0]==H[0]:!H)?NaN:at&&at[0]==0||!H?Pe*0:Pe/0);for(ue=new x(Pe),I=ue.c=[],j=F.e-B.e,Pe=q+j+1,D||(D=Xs,j=Bs(F.e/Ze)-Bs(B.e/Ze),Pe=Pe/Ze|0),U=0;H[U]==(at[U]||0);U++);if(H[U]>(at[U]||0)&&j--,Pe<0)I.push(1),V=!0;else{for(Oe=at.length,be=H.length,U=0,Pe+=2,K=Us(D/(H[0]+1)),K>1&&(H=w(H,K,D),at=w(at,K,D),be=H.length,Oe=at.length),Te=be,X=at.slice(0,be),ce=X.length;ce<be;X[ce++]=0);_e=H.slice(),_e=[0].concat(_e),Ae=H[0],H[1]>=D/2&&Ae++;do{if(K=0,k=A(H,X,be,ce),k<0){if(he=X[0],be!=ce&&(he=he*D+(X[1]||0)),K=Us(he/Ae),K>1)for(K>=D&&(K=D-1),P=w(H,K,D),re=P.length,ce=X.length;A(P,X,re,ce)==1;)K--,N(P,be<re?_e:H,re,D),re=P.length,k=1;else K==0&&(k=K=1),P=H.slice(),re=P.length;if(re<ce&&(P=[0].concat(P)),N(X,P,ce,D),ce=X.length,k==-1)for(;A(H,X,be,ce)<1;)K++,N(X,be<ce?_e:H,ce,D),ce=X.length}else k===0&&(K++,X=[0]);I[U++]=K,X[0]?X[ce++]=at[Te]||0:(X=[at[Te]],ce=1)}while((Te++<Oe||X[0]!=null)&&Pe--);V=X[0]!=null,I[0]||I.splice(0,1)}if(D==Xs){for(U=1,Pe=I[0];Pe>=10;Pe/=10,U++);G(ue,q+(ue.e=U+j*Ze-1)+1,z,V)}else ue.e=j,ue.r=+V;return ue}})();function W(w,A,N,F){var B,q,z,D,k;if(N==null?N=d:$t(N,0,8),!w.c)return w.toString();if(B=w.c[0],z=w.e,A==null)k=Ds(w.c),k=F==1||F==2&&(z<=p||z>=m)?ch(k,z):ea(k,z,"0");else if(w=G(new x(w),A,N),q=w.e,k=Ds(w.c),D=k.length,F==1||F==2&&(A<=q||q<=p)){for(;D<A;k+="0",D++);k=ch(k,q)}else if(A-=z,k=ea(k,q,"0"),q+1>D){if(--A>0)for(k+=".";A--;k+="0");}else if(A+=q-D,A>0)for(q+1==D&&(k+=".");A--;k+="0");return w.s<0&&B?"-"+k:k}function oe(w,A){for(var N,F,B=1,q=new x(w[0]);B<w.length;B++)F=new x(w[B]),(!F.s||(N=Wi(q,F))===A||N===0&&q.s===A)&&(q=F);return q}function me(w,A,N){for(var F=1,B=A.length;!A[--B];A.pop());for(B=A[0];B>=10;B/=10,F++);return(N=F+N*Ze-1)>y?w.c=w.e=null:N<g?w.c=[w.e=0]:(w.e=N,w.c=A),w}r=(function(){var w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,A=/^([^.]+)\.$/,N=/^\.([^.]+)$/,F=/^-?(Infinity|NaN)$/,B=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(q,z,D,k){var j,U=D?z:z.replace(B,"");if(F.test(U))q.s=isNaN(U)?null:U<0?-1:1;else{if(!D&&(U=U.replace(w,function(V,K,P){return j=(P=P.toLowerCase())=="x"?16:P=="b"?2:8,!k||k==j?K:V}),k&&(j=k,U=U.replace(A,"$1").replace(N,"0.$1")),z!=U))return new x(U,j);if(x.DEBUG)throw Error(ss+"Not a"+(k?" base "+k:"")+" number: "+z);q.s=null}q.c=q.e=null}})();function G(w,A,N,F){var B,q,z,D,k,j,U,V=w.c,K=My;if(V){e:{for(B=1,D=V[0];D>=10;D/=10,B++);if(q=A-B,q<0)q+=Ze,z=A,k=V[j=0],U=Us(k/K[B-z-1]%10);else if(j=Ry((q+1)/Ze),j>=V.length)if(F){for(;V.length<=j;V.push(0));k=U=0,B=1,q%=Ze,z=q-Ze+1}else break e;else{for(k=D=V[j],B=1;D>=10;D/=10,B++);q%=Ze,z=q-Ze+B,U=z<0?0:Us(k/K[B-z-1]%10)}if(F=F||A<0||V[j+1]!=null||(z<0?k:k%K[B-z-1]),F=N<4?(U||F)&&(N==0||N==(w.s<0?3:2)):U>5||U==5&&(N==4||F||N==6&&(q>0?z>0?k/K[B-z]:0:V[j-1])%10&1||N==(w.s<0?8:7)),A<1||!V[0])return V.length=0,F?(A-=w.e+1,V[0]=K[(Ze-A%Ze)%Ze],w.e=-A||0):V[0]=w.e=0,w;if(q==0?(V.length=j,D=1,j--):(V.length=j+1,D=K[Ze-q],V[j]=z>0?Us(k/K[B-z]%K[z])*D:0),F)for(;;)if(j==0){for(q=1,z=V[0];z>=10;z/=10,q++);for(z=V[0]+=D,D=1;z>=10;z/=10,D++);q!=D&&(w.e++,V[0]==Xs&&(V[0]=1));break}else{if(V[j]+=D,V[j]!=Xs)break;V[j--]=0,D=1}for(q=V.length;V[--q]===0;V.pop());}w.e>y?w.c=w.e=null:w.e<g&&(w.c=[w.e=0])}return w}function J(w){var A,N=w.e;return N===null?w.toString():(A=Ds(w.c),A=N<=p||N>=m?ch(A,N):ea(A,N,"0"),w.s<0?"-"+A:A)}return i.absoluteValue=i.abs=function(){var w=new x(this);return w.s<0&&(w.s=1),w},i.comparedTo=function(w,A){return Wi(this,new x(w,A))},i.decimalPlaces=i.dp=function(w,A){var N,F,B,q=this;if(w!=null)return $t(w,0,wn),A==null?A=d:$t(A,0,8),G(new x(q),w+q.e+1,A);if(!(N=q.c))return null;if(F=((B=N.length-1)-Bs(this.e/Ze))*Ze,B=N[B])for(;B%10==0;B/=10,F--);return F<0&&(F=0),F},i.dividedBy=i.div=function(w,A){return t(this,new x(w,A),u,d)},i.dividedToIntegerBy=i.idiv=function(w,A){return t(this,new x(w,A),0,1)},i.exponentiatedBy=i.pow=function(w,A){var N,F,B,q,z,D,k,j,U,V=this;if(w=new x(w),w.c&&!w.isInteger())throw Error(ss+"Exponent not an integer: "+J(w));if(A!=null&&(A=new x(A)),D=w.e>14,!V.c||!V.c[0]||V.c[0]==1&&!V.e&&V.c.length==1||!w.c||!w.c[0])return U=new x(Math.pow(+J(V),D?w.s*(2-oh(w)):+J(w))),A?U.mod(A):U;if(k=w.s<0,A){if(A.c?!A.c[0]:!A.s)return new x(NaN);F=!k&&V.isInteger()&&A.isInteger(),F&&(V=V.mod(A))}else{if(w.e>9&&(V.e>0||V.e<-1||(V.e==0?V.c[0]>1||D&&V.c[1]>=24e7:V.c[0]<8e13||D&&V.c[0]<=9999975e7)))return q=V.s<0&&oh(w)?-0:0,V.e>-1&&(q=1/q),new x(k?1/q:q);O&&(q=Ry(O/Ze+2))}for(D?(N=new x(.5),k&&(w.s=1),j=oh(w)):(B=Math.abs(+J(w)),j=B%2),U=new x(c);;){if(j){if(U=U.times(V),!U.c)break;q?U.c.length>q&&(U.c.length=q):F&&(U=U.mod(A))}if(B){if(B=Us(B/2),B===0)break;j=B%2}else if(w=w.times(N),G(w,w.e+1,1),w.e>14)j=oh(w);else{if(B=+J(w),B===0)break;j=B%2}V=V.times(V),q?V.c&&V.c.length>q&&(V.c.length=q):F&&(V=V.mod(A))}return F?U:(k&&(U=c.div(U)),A?U.mod(A):q?G(U,O,d,z):U)},i.integerValue=function(w){var A=new x(this);return w==null?w=d:$t(w,0,8),G(A,A.e+1,w)},i.isEqualTo=i.eq=function(w,A){return Wi(this,new x(w,A))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(w,A){return Wi(this,new x(w,A))>0},i.isGreaterThanOrEqualTo=i.gte=function(w,A){return(A=Wi(this,new x(w,A)))===1||A===0},i.isInteger=function(){return!!this.c&&Bs(this.e/Ze)>this.c.length-2},i.isLessThan=i.lt=function(w,A){return Wi(this,new x(w,A))<0},i.isLessThanOrEqualTo=i.lte=function(w,A){return(A=Wi(this,new x(w,A)))===-1||A===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(w,A){var N,F,B,q,z=this,D=z.s;if(w=new x(w,A),A=w.s,!D||!A)return new x(NaN);if(D!=A)return w.s=-A,z.plus(w);var k=z.e/Ze,j=w.e/Ze,U=z.c,V=w.c;if(!k||!j){if(!U||!V)return U?(w.s=-A,w):new x(V?z:NaN);if(!U[0]||!V[0])return V[0]?(w.s=-A,w):new x(U[0]?z:d==3?-0:0)}if(k=Bs(k),j=Bs(j),U=U.slice(),D=k-j){for((q=D<0)?(D=-D,B=U):(j=k,B=V),B.reverse(),A=D;A--;B.push(0));B.reverse()}else for(F=(q=(D=U.length)<(A=V.length))?D:A,D=A=0;A<F;A++)if(U[A]!=V[A]){q=U[A]<V[A];break}if(q&&(B=U,U=V,V=B,w.s=-w.s),A=(F=V.length)-(N=U.length),A>0)for(;A--;U[N++]=0);for(A=Xs-1;F>D;){if(U[--F]<V[F]){for(N=F;N&&!U[--N];U[N]=A);--U[N],U[F]+=Xs}U[F]-=V[F]}for(;U[0]==0;U.splice(0,1),--j);return U[0]?me(w,U,j):(w.s=d==3?-1:1,w.c=[w.e=0],w)},i.modulo=i.mod=function(w,A){var N,F,B=this;return w=new x(w,A),!B.c||!w.s||w.c&&!w.c[0]?new x(NaN):!w.c||B.c&&!B.c[0]?new x(B):(E==9?(F=w.s,w.s=1,N=t(B,w,0,3),w.s=F,N.s*=F):N=t(B,w,0,E),w=B.minus(N.times(w)),!w.c[0]&&E==1&&(w.s=B.s),w)},i.multipliedBy=i.times=function(w,A){var N,F,B,q,z,D,k,j,U,V,K,P,re,ue,I,X=this,ce=X.c,he=(w=new x(w,A)).c;if(!ce||!he||!ce[0]||!he[0])return!X.s||!w.s||ce&&!ce[0]&&!he||he&&!he[0]&&!ce?w.c=w.e=w.s=null:(w.s*=X.s,!ce||!he?w.c=w.e=null:(w.c=[0],w.e=0)),w;for(F=Bs(X.e/Ze)+Bs(w.e/Ze),w.s*=X.s,k=ce.length,V=he.length,k<V&&(re=ce,ce=he,he=re,B=k,k=V,V=B),B=k+V,re=[];B--;re.push(0));for(ue=Xs,I=Qa,B=V;--B>=0;){for(N=0,K=he[B]%I,P=he[B]/I|0,z=k,q=B+z;q>B;)j=ce[--z]%I,U=ce[z]/I|0,D=P*j+U*K,j=K*j+D%I*I+re[q]+N,N=(j/ue|0)+(D/I|0)+P*U,re[q--]=j%ue;re[q]=N}return N?++F:re.splice(0,1),me(w,re,F)},i.negated=function(){var w=new x(this);return w.s=-w.s||null,w},i.plus=function(w,A){var N,F=this,B=F.s;if(w=new x(w,A),A=w.s,!B||!A)return new x(NaN);if(B!=A)return w.s=-A,F.minus(w);var q=F.e/Ze,z=w.e/Ze,D=F.c,k=w.c;if(!q||!z){if(!D||!k)return new x(B/0);if(!D[0]||!k[0])return k[0]?w:new x(D[0]?F:B*0)}if(q=Bs(q),z=Bs(z),D=D.slice(),B=q-z){for(B>0?(z=q,N=k):(B=-B,N=D),N.reverse();B--;N.push(0));N.reverse()}for(B=D.length,A=k.length,B-A<0&&(N=k,k=D,D=N,A=B),B=0;A;)B=(D[--A]=D[A]+k[A]+B)/Xs|0,D[A]=Xs===D[A]?0:D[A]%Xs;return B&&(D=[B].concat(D),++z),me(w,D,z)},i.precision=i.sd=function(w,A){var N,F,B,q=this;if(w!=null&&w!==!!w)return $t(w,1,wn),A==null?A=d:$t(A,0,8),G(new x(q),w,A);if(!(N=q.c))return null;if(B=N.length-1,F=B*Ze+1,B=N[B]){for(;B%10==0;B/=10,F--);for(B=N[0];B>=10;B/=10,F++);}return w&&q.e+1>F&&(F=q.e+1),F},i.shiftedBy=function(w){return $t(w,-jy,jy),this.times("1e"+w)},i.squareRoot=i.sqrt=function(){var w,A,N,F,B,q=this,z=q.c,D=q.s,k=q.e,j=u+4,U=new x("0.5");if(D!==1||!z||!z[0])return new x(!D||D<0&&(!z||z[0])?NaN:z?q:1/0);if(D=Math.sqrt(+J(q)),D==0||D==1/0?(A=Ds(z),(A.length+k)%2==0&&(A+="0"),D=Math.sqrt(+A),k=Bs((k+1)/2)-(k<0||k%2),D==1/0?A="5e"+k:(A=D.toExponential(),A=A.slice(0,A.indexOf("e")+1)+k),N=new x(A)):N=new x(D+""),N.c[0]){for(k=N.e,D=k+j,D<3&&(D=0);;)if(B=N,N=U.times(B.plus(t(q,B,j,1))),Ds(B.c).slice(0,D)===(A=Ds(N.c)).slice(0,D))if(N.e<k&&--D,A=A.slice(D-3,D+1),A=="9999"||!F&&A=="4999"){if(!F&&(G(B,B.e+u+2,0),B.times(B).eq(q))){N=B;break}j+=4,D+=4,F=1}else{(!+A||!+A.slice(1)&&A.charAt(0)=="5")&&(G(N,N.e+u+2,1),w=!N.times(N).eq(q));break}}return G(N,N.e+u+1,d,w)},i.toExponential=function(w,A){return w!=null&&($t(w,0,wn),w++),W(this,w,A,1)},i.toFixed=function(w,A){return w!=null&&($t(w,0,wn),w=w+this.e+1),W(this,w,A)},i.toFormat=function(w,A,N){var F,B=this;if(N==null)w!=null&&A&&typeof A=="object"?(N=A,A=null):w&&typeof w=="object"?(N=w,w=A=null):N=C;else if(typeof N!="object")throw Error(ss+"Argument not an object: "+N);if(F=B.toFixed(w,A),B.c){var q,z=F.split("."),D=+N.groupSize,k=+N.secondaryGroupSize,j=N.groupSeparator||"",U=z[0],V=z[1],K=B.s<0,P=K?U.slice(1):U,re=P.length;if(k&&(q=D,D=k,k=q,re-=q),D>0&&re>0){for(q=re%D||D,U=P.substr(0,q);q<re;q+=D)U+=j+P.substr(q,D);k>0&&(U+=j+P.slice(q)),K&&(U="-"+U)}F=V?U+(N.decimalSeparator||"")+((k=+N.fractionGroupSize)?V.replace(new RegExp("\\d{"+k+"}\\B","g"),"$&"+(N.fractionGroupSeparator||"")):V):U}return(N.prefix||"")+F+(N.suffix||"")},i.toFraction=function(w){var A,N,F,B,q,z,D,k,j,U,V,K,P=this,re=P.c;if(w!=null&&(D=new x(w),!D.isInteger()&&(D.c||D.s!==1)||D.lt(c)))throw Error(ss+"Argument "+(D.isInteger()?"out of range: ":"not an integer: ")+J(D));if(!re)return new x(P);for(A=new x(c),j=N=new x(c),F=k=new x(c),K=Ds(re),q=A.e=K.length-P.e-1,A.c[0]=My[(z=q%Ze)<0?Ze+z:z],w=!w||D.comparedTo(A)>0?q>0?A:j:D,z=y,y=1/0,D=new x(K),k.c[0]=0;U=t(D,A,0,1),B=N.plus(U.times(F)),B.comparedTo(w)!=1;)N=F,F=B,j=k.plus(U.times(B=j)),k=B,A=D.minus(U.times(B=A)),D=B;return B=t(w.minus(N),F,0,1),k=k.plus(B.times(j)),N=N.plus(B.times(F)),k.s=j.s=P.s,q=q*2,V=t(j,F,q,d).minus(P).abs().comparedTo(t(k,N,q,d).minus(P).abs())<1?[j,F]:[k,N],y=z,V},i.toNumber=function(){return+J(this)},i.toPrecision=function(w,A){return w!=null&&$t(w,1,wn),W(this,w,A,2)},i.toString=function(w){var A,N=this,F=N.s,B=N.e;return B===null?F?(A="Infinity",F<0&&(A="-"+A)):A="NaN":(w==null?A=B<=p||B>=m?ch(Ds(N.c),B):ea(Ds(N.c),B,"0"):w===10&&$?(N=G(new x(N),u+B+1,d),A=ea(Ds(N.c),N.e,"0")):($t(w,2,R.length,"Base"),A=s(ea(Ds(N.c),B,"0"),10,w,F,!0)),F<0&&N.c[0]&&(A="-"+A)),A},i.valueOf=i.toJSON=function(){return J(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&x.set(e),x}function Bs(e){var t=e|0;return e>0||e===t?t:t-1}function Ds(e){for(var t,s,r=1,i=e.length,c=e[0]+"";r<i;){for(t=e[r++]+"",s=Ze-t.length;s--;t="0"+t);c+=t}for(i=c.length;c.charCodeAt(--i)===48;);return c.slice(0,i+1||1)}function Wi(e,t){var s,r,i=e.c,c=t.c,u=e.s,d=t.s,p=e.e,m=t.e;if(!u||!d)return null;if(s=i&&!i[0],r=c&&!c[0],s||r)return s?r?0:-d:u;if(u!=d)return u;if(s=u<0,r=p==m,!i||!c)return r?0:!i^s?1:-1;if(!r)return p>m^s?1:-1;for(d=(p=i.length)<(m=c.length)?p:m,u=0;u<d;u++)if(i[u]!=c[u])return i[u]>c[u]^s?1:-1;return p==m?0:p>m^s?1:-1}function $t(e,t,s,r){if(e<t||e>s||e!==Us(e))throw Error(ss+(r||"Argument")+(typeof e=="number"?e<t||e>s?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function oh(e){var t=e.c.length-1;return Bs(e.e/Ze)==t&&e.c[t]%2!=0}function ch(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ea(e,t,s){var r,i;if(t<0){for(i=s+".";++t;i+=s);e=i+e}else if(r=e.length,++t>r){for(i=s,t-=r;--t;i+=s);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}rN();const dq="2.0.12",aN={version:dq},fq=aN.version,hq=()=>{if(typeof process<"u"&&process.versions&&process.versions.node){const e=process.version;return`Node.js ${e.startsWith("v")?e.substring(1):e}`}return"Node/Unknown"},pq=()=>{let e="";return typeof process<"u"&&process.versions&&process.versions.node&&(e=`lending/${fq} (${hq()})`),e},C4=pq(),mq="https://fullnode.mainnet.sui.io:443";let Dy;function gq(){return Dy||(Dy=new bb({network:"mainnet",transport:new lb({baseUrl:mq})})),Dy}function yq(e,t="mainnet"){return gq()}const vq=16*1024;function u1(e){return e.replace(/^0x/i,"")}function I4(e){const t=u1(e),s=new Uint8Array(t.length/2);for(let r=0;r<s.length;r+=1)s[r]=parseInt(t.slice(r*2,r*2+2),16);return s}function bq(e,t){return(e[t]<<8)+e[t+1]}function R4(e){return M.vector(M.U8).serialize(Array.from(e),{maxSize:vq})}function j4(e,t){return{type:e,bcs:t}}function wq(e){return M.vector(M.U8).serialize(Array.from(new TextEncoder().encode(e))).toBytes()}function Tq(e){return M.struct("PriceIdentifier",{bytes:M.vector(M.U8)}).serialize({bytes:Array.from(e)}).toBytes()}function Sq(e){const t=[];let s=0,r=0;for(let i=0;i<e.length;i+=1){const c=e[i];c==="<"?s+=1:c===">"?s-=1:c===","&&s===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}function Eq(e){const t=e.indexOf("::table::Table"),s=e.indexOf("<",t),r=e.lastIndexOf(">"),i="::price_identifier::PriceIdentifier";if(t<0||s<0||r<=s)throw new Error(`Unexpected Pyth price table type: ${e}`);const[c,u]=Sq(e.slice(s+1,r));if(!c?.endsWith(i)||!u?.endsWith("::object::ID"))throw new Error(`Unexpected Pyth price table type arguments: ${e}`);return c.slice(0,-i.length)}function _q(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}class iN{constructor(t,s){this.endpoint=t.replace(/\/$/,""),this.timeout=s?.timeout??1e4}async getLatestPriceFeeds(t){return(await this.get("/api/latest_price_feeds",t)).map(s=>({id:s.id,getPriceUnchecked:()=>({price:s.price.price,conf:s.price.conf,expo:s.price.expo,publishTime:s.price.publish_time})}))}async getPriceFeedsUpdateData(t){const s=await this.get("/v2/updates/price/latest",t,{encoding:"base64",parsed:"false"}),r=s.binary?.encoding,i=s.binary?.data??[];if(r&&r!=="base64")throw new Error(`Unsupported Hermes price update encoding: ${r}`);if(i.length===0)throw new Error("Hermes price update response did not include binary update data");return i.map(_q)}async get(t,s,r){const i=new AbortController,c=setTimeout(()=>i.abort(),this.timeout),u=new URL(`${this.endpoint}${t}`);for(const[d,p]of Object.entries(r??{}))u.searchParams.set(d,p);for(const d of s)u.searchParams.append("ids[]",u1(d));try{const d=await fetch(u,{signal:i.signal});if(!d.ok)throw new Error(`Hermes request failed: ${d.status} ${d.statusText}`);return await d.json()}finally{clearTimeout(c)}}}class kq{constructor(t,s,r){this.provider=t,this.pythStateId=s,this.wormholeStateId=r,this.priceFeedObjectIdCache=new Map}getCoreProvider(){const t=this.provider.core;return t&&typeof t.getObject=="function"&&typeof t.getDynamicObjectField=="function"&&typeof t.getDynamicField=="function"?t:null}async getMoveObjectJson(t){const s=this.getCoreProvider();if(s){const i=await s.getObject({objectId:t,include:{json:!0}});return i.object?{objectId:i.object.objectId,type:i.object.type,fields:i.object.json}:null}if(!this.provider.getObject)throw new Error("Sui Pyth provider does not support getObject");const r=await this.provider.getObject({id:t,options:{showContent:!0}});return!r.data||!r.data.content||r.data.content.dataType!=="moveObject"?null:{objectId:r.data.objectId,type:r.data.type,fields:r.data.content.fields}}async getDynamicMoveObjectJson(t,s){const r=this.getCoreProvider();if(r){const c=await r.getDynamicObjectField({parentId:t,name:s,include:{json:!0}});return c.object?{objectId:c.object.objectId,type:c.object.type,fields:c.object.json}:null}if(!this.provider.getDynamicFieldObject)throw new Error("Sui Pyth provider does not support getDynamicFieldObject");const i=await this.provider.getDynamicFieldObject({parentId:t,name:s});return i.data?i.data.content?i.data.content.dataType!=="moveObject"?null:{objectId:i.data.objectId,type:i.data.type,fields:i.data.content.fields}:{objectId:i.data.objectId,type:i.data.type,fields:void 0}:null}async updatePriceFeeds(t,s,r,i){const c=await this.getPythPackageId(),u=await this.verifyVaasAndGetHotPotato(t,s,c),d=await this.getBaseUpdateFee(),p=t.splitCoins(i?.feeCoin??t.gas,r.map(()=>t.pure.u64(d)));return this.executePriceFeedUpdates(t,c,r,u,p)}async getBaseUpdateFee(){if(this.baseUpdateFee===void 0){const t=await this.getMoveObjectJson(this.pythStateId);if(!t?.fields)throw new Error("Unable to fetch pyth state object");this.baseUpdateFee=Number(t.fields.base_update_fee)}return this.baseUpdateFee}async getPackageId(t){const s=await this.getMoveObjectJson(t);if(s?.fields){const r=s.fields;if("upgrade_cap"in r){const i=r.upgrade_cap,c=i?.package??i?.fields?.package;if(c)return c}}throw new Error(`Cannot fetch package id for object ${t}`)}async verifyVaas(t,s){const r=await this.getWormholePackageId();return t.map(i=>{const[c]=s.moveCall({target:`${r}::vaa::parse_and_verify`,arguments:[s.object(this.wormholeStateId),s.pure(R4(i)),s.object(dh)]});return c})}async verifyVaasAndGetHotPotato(t,s,r){if(s.length>1)throw new Error("SDK does not support sending multiple accumulator messages in a single transaction");const i=this.extractVaaBytesFromAccumulatorMessage(s[0]),[c]=await this.verifyVaas([i],t),[u]=t.moveCall({target:`${r}::pyth::create_authenticated_price_infos_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(R4(s[0])),c,t.object(dh)]});return u}async executePriceFeedUpdates(t,s,r,i,c){const u=[];for(const[d,p]of r.entries()){const m=await this.getPriceFeedObjectId(p);if(!m)throw new Error(`Price feed ${p} not found, please create it first`);u.push(m),[i]=t.moveCall({target:`${s}::pyth::update_single_price_feed`,arguments:[t.object(this.pythStateId),i,t.object(m),c[d],t.object(dh)]})}return t.moveCall({target:`${s}::hot_potato_vector::destroy`,arguments:[i],typeArguments:[`${s}::price_info::PriceInfo`]}),u}async getWormholePackageId(){return this.wormholePackageId||(this.wormholePackageId=await this.getPackageId(this.wormholeStateId)),this.wormholePackageId}async getPythPackageId(){return this.pythPackageId||(this.pythPackageId=await this.getPackageId(this.pythStateId)),this.pythPackageId}async getPriceFeedObjectId(t){const s=u1(t);if(!this.priceFeedObjectIdCache.has(s)){const{id:r,fieldType:i}=await this.getPriceTableInfo(),c=`${i}::price_identifier::PriceIdentifier`,u=this.getCoreProvider();if(u){const{dynamicField:d}=await u.getDynamicField({parentId:r,name:j4(c,Tq(I4(s)))}),p=d?.value?.bcs;this.priceFeedObjectIdCache.set(s,p&&p.length===32?M.Address.parse(Uint8Array.from(p)):void 0)}else{const d=await this.getDynamicMoveObjectJson(r,{type:c,value:{bytes:Array.from(I4(s))}});d?.fields?this.priceFeedObjectIdCache.set(s,d.fields.value):this.priceFeedObjectIdCache.set(s,void 0)}}return this.priceFeedObjectIdCache.get(s)}async getPriceTableInfo(){if(!this.priceTableInfo){const t=this.getCoreProvider()?j4("vector<u8>",wq("price_info")):{type:"vector<u8>",value:"price_info"},s=await this.getDynamicMoveObjectJson(this.pythStateId,t);if(!s?.type)throw new Error("Price Table not found, contract may not be initialized");this.priceTableInfo={id:s.objectId,fieldType:Eq(s.type)}}return this.priceTableInfo}extractVaaBytesFromAccumulatorMessage(t){const s=7+t[6]+1,r=bq(t,s),i=s+2;return t.subarray(i,i+r)}}const Aq="https://open-api.naviprotocol.io/api";let Oq={},Nq=0;function xq(e){return e.replace(/\/+$/,"")}function M4(){return Nq}function oN(e){const t=e?.services?.naviOpenApi??Oq.services?.naviOpenApi;return{baseUrl:xq(t?.baseUrl??Aq),headers:t?.headers}}function Cq(e,t){const s=oN(t),r=e.startsWith("/")?e:`/${e}`;return`${s.baseUrl}${r}`}function Iq(e){if(e instanceof Headers){const t={};return e.forEach((s,r)=>{t[r]=s}),t}return Array.isArray(e)?Object.fromEntries(e):e}function Rq(e,t){return{...Iq(e),...t?.headers??{}}}const cN=yq();function jq(e){return{json:!!e?.showContent,display:!!e?.showDisplay,previousTransaction:!!e?.showPreviousTransaction,objectBcs:!!e?.showBcs}}function Mq(e){return!e||e instanceof Error?{error:e instanceof Error?{code:"notFound",error:e.message}:void 0}:{data:{objectId:e.objectId,version:e.version,digest:e.digest,type:e.type,owner:e.owner,previousTransaction:e.previousTransaction,content:e.json===void 0?void 0:{dataType:"moveObject",type:e.type,fields:e.json},display:e.display}}}async function Dq(e,t){const s=e?.core;if(typeof s?.getObjects!="function")throw new Error("multiGetSuiObjects requires a Sui v2 Core-capable client");const{objects:r}=await s.getObjects({objectIds:t.ids,include:jq(t.options)});return r.map(Mq)}function lN(e){const t=[];let s=!1;return e.forEach((r,i)=>{const c=i===e.length-1;if(typeof r=="object"&&r!==null&&c){const{client:u,disableCache:d,cacheTime:p,...m}=r;m.__naviSdkServiceConfigVersion=M4(),t.push(m),s=!0}else t.push(r)}),s||t.push({__naviSdkServiceConfigVersion:M4()}),JSON.stringify(t)}function Uq(e){const t={};return(...s)=>{const r=lN(s);return t[r]||(t[r]=e(...s).finally(()=>{delete t[r]})),t[r]}}function Bq(e){let t={};return(...s)=>{const r=s[s.length-1],i=lN(s),c=t[i];return!r?.disableCache&&typeof c?.data<"u"&&(typeof r?.cacheTime>"u"||r.cacheTime>Date.now()-c.cacheAt)?Promise.resolve(c.data):e(...s).then(u=>(t[i]={data:u,cacheAt:Date.now()},u))}}new iN("https://hermes.pyth.network",{timeout:2e4});const Lq=C4?{"User-Agent":C4}:{},zq="main",$q={main:{id:0,key:"main",name:"Main Market"},ember:{id:1,key:"ember",name:"eACRED / USDC Market"},rwa:{id:2,key:"rwa",name:"Matrixdock Market"},"sui-eco":{id:3,key:"sui-eco",name:"Sui Eco Market"},"sui-usdc":{id:4,key:"sui-usdc",name:"SUI / USDC Market"},"wbtc-usdc":{id:5,key:"wbtc-usdc",name:"WBTC / USDC Market"},"xbtc-usdc":{id:6,key:"xbtc-usdc",name:"xBTC / USDC Market"},"vsui-usdc":{id:7,key:"vsui-usdc",name:"vSUI / USDC Market"},"vsui-sui":{id:8,key:"vsui-sui",name:"vSUI / SUI Market"},"hasui-sui":{id:9,key:"hasui-sui",name:"haSUI / SUI Market"},"high-usdc":{id:10,key:"high-usdc",name:"HIGH / USDC Market"}},Vq=e=>{const t=Object.values($q).find(s=>typeof e=="number"?s.id===e:typeof e=="string"?s.key===e:s.id===e.id);if(!t)throw new Error("Market not found");return t},d1=Bq(Uq(async e=>{const t=Vq(e?.market||zq),s=oN(e),r=Cq(`/navi/config?env=${e?.env||"prod"}&sdk=${aN.version}&market=${t.key}`,e);return(await fetch(r,{headers:Rq(Lq,s)}).then(i=>i.json())).data})),f1=1e3*60*5,D4=new Map,Pq=e=>{const t=e??"https://hermes.pyth.network";let s=D4.get(t);return s||(s=new iN(t,{timeout:1e4}),D4.set(t,s)),s};async function Gq(e,t){const s=[],r=t?.client??cN,i=e.map(u=>u.priceInfoObject),c=await Dq(r,{ids:Array.from(new Set(i)),options:{showContent:!0}});for(const u of c){const d=u.data;if(!d||!d.content||d.content.dataType!=="moveObject"){console.warn(`fetched object ${d?.objectId} datatype should be moveObject`);continue}const p=e.find(C=>C.priceInfoObject==d.objectId);if(!p){console.warn(`unable to find pyth info from array, priceInfoObject: ${d.objectId}`);continue}const m=d.content.fields?.price_info?.price_feed?.price,g=m?.price;if(!g){console.warn(`unexpected pyth price struct, priceInfoObject: ${d.objectId}`);continue}const{magnitude:y,negative:b}=g,E=m.conf,O=m.timestamp;s.push({priceFeedId:p.priceFeedId,priceInfoObject:p.priceInfoObject,price:b?"-"+y:y,conf:E,publishTime:Number(O),expiration:p.expiration})}return s}async function Fq(e,t){try{const s=[],r=await Gq(e,t);if(!r)return s;const i=Math.floor(new Date().valueOf()/1e3);for(const c of r){if(c.publishTime>i){console.warn(`pyth price feed is invalid, id: ${c.priceFeedId}, publish time: ${c.publishTime}, current timestamp: ${i}`);continue}const u=c.expiration||60;i-c.publishTime>u&&(console.info(`stale price feed, id: ${c.priceFeedId}, publish time: ${c.publishTime}, current timestamp: ${i}`),s.push(c.priceFeedId))}return s}catch(s){throw new Error(`failed to get pyth stale price feed id, msg: ${s.message}`)}}async function Hq(e,t,s){const r=s?.client??cN,i=await d1({...s,cacheTime:f1});try{const c=await Pq(i.oracle.hermesEndpoint).getPriceFeedsUpdateData(t);return await new kq(r,i.oracle.pythStateId,i.oracle.wormholeStateId).updatePriceFeeds(e,c,t,{feeCoin:s?.pythFeeCoin})}catch(c){throw new Error(`failed to update pyth price feeds, msg: ${c.message}`)}}async function qq(e,t,s){const r=await d1({...s,cacheTime:f1});if(s?.updatePythPriceFeeds){const i=t.filter(u=>!!u.pythPriceFeedId&&!!u.pythPriceInfoObject).map(u=>({priceFeedId:u.pythPriceFeedId,priceInfoObject:u.pythPriceInfoObject,expiration:30})),c=await Fq(i,s);c.length>0&&await Hq(e,c,s)}for(const i of t)e.moveCall({target:`${r.oracle.packageId}::oracle_pro::${r.oracle.updateFunction??"update_single_price_v2"}`,arguments:[e.object("0x6"),e.object(r.oracle.oracleConfig),e.object(r.oracle.priceOracle),e.object(r.oracle.supraOracleHolder),e.object(i.pythPriceInfoObject),e.object(r.oracle.switchboardAggregator),e.pure.address(i.feedId)]});return e}async function Zq(e){return(await d1({...e,cacheTime:f1})).oracle.feeds}const Yq="0x6",Wq="0x5";async function h1(e,t){if(t.network!=="mainnet")return;const s=Object.keys(t.protocols.navi.reserves),r=(await Zq({env:"prod"})).filter(i=>s.some(c=>At(c,i.coinType)));await qq(e,r,{env:"prod",client:qt(t),updatePythPriceFeeds:!0})}async function Ep(e,t,s){const r=t.protocols.navi,i=Object.entries(r.reserves),c=new Yn;c.setSender(ye("0x1"));for(const[,g]of i)for(const y of["user_collateral_balance","user_loan_balance"])c.moveCall({target:`${r.publishedAt}::logic::${y}`,arguments:[c.object(r.storageId),c.pure.u8(g.assetId),c.pure.address(s)]});const u=await e.simulateTransaction({transaction:c,include:{commandResults:!0}}),d=u.$kind==="Transaction"?u.Transaction:u.FailedTransaction;if(!d?.status.success)throw new Error(d?.status.error?.message??"Could not read the NAVI position");const p=g=>{const y=u.commandResults?.[g]?.returnValues?.[0]?.bcs;return y?M.u256().parse(y):"0"},m={collateral:{},debt:{}};return i.forEach(([g],y)=>{const b=p(2*y),E=p(2*y+1);b!=="0"&&(m.collateral[De(g)]=b),E!=="0"&&(m.debt[De(g)]=E)}),m}function p1(e,t,s,r,i){const c=t.protocols.navi,u=[];for(const[d,p]of Object.entries(c.reserves)){const m=r.collateral[De(d)];if(!m)continue;const g=(BigInt(m)+BigInt(m)/1000n+1n).toString(),y=e.moveCall({target:`${c.publishedAt}::incentive_v3::withdraw_with_account_cap_v2`,typeArguments:[d],arguments:[e.object(Yq),e.object(c.oracleId),e.object(c.storageId),e.object(p.poolId),e.pure.u8(p.assetId),e.pure.u64(g),e.object(c.incentiveV2Id),e.object(c.incentiveV3Id),s,e.object(Wq)]});u.push(e.moveCall({target:"0x2::coin::from_balance",typeArguments:[d],arguments:[y]}))}u.length&&e.transferObjects(u,i)}const Qu=e=>!!e&&Object.keys(e.collateral).length>0&&Object.keys(e.debt).length===0;async function Xq(e,t,s){const r=`${ye(t.protocols.navi.packageId)}::account::AccountCap`,i=[];let c=null;do{const u=await e.listOwnedObjects({owner:s,cursor:c,limit:50,include:{content:!0}});for(const d of u.objects){const p=Ss(d.type);`${ye(p.address)}::${p.module}::${p.name}`===r&&d.content&&i.push({capId:d.objectId,user:OH(d.content)})}c=u.hasNextPage?u.cursor:null}while(c&&i.length<200);return i}const uN="0x2::allowance::RateLimit",m1="0x6",dN="0x3::staking_pool::StakedSui",am=e=>`0x2::balance::Balance<${e}>`;function fN(e,t,s,r,i){const c=t.publishedAt,u=t.packageId,d=e.object(m1),p=e.object(t.configId),m=(g,y)=>e.moveCall({target:`${c}::pass::add_policy`,typeArguments:[g],arguments:[s,p,y]});for(const g of r.transfers){const y=e.moveCall({target:`${c}::transfer_policy::new`,typeArguments:[g.coin],arguments:[e.pure.u64(g.perTransfer),e.pure.u64(g.daily),d]});for(const b of g.recipients)e.moveCall({target:`${c}::transfer_policy::add_recipient`,typeArguments:[g.coin],arguments:[y,e.pure.string(b.name),e.pure.address(b.address)]});m(`${u}::transfer_policy::TransferPolicy<${g.coin}>`,y)}for(const g of r.swaps)m(`${u}::swap_policy::SwapPolicy<${g.coinIn},${g.coinOut}>`,e.moveCall({target:`${c}::swap_policy::new`,typeArguments:[g.coinIn,g.coinOut],arguments:[e.pure.vector("address",g.pools),e.pure.u64(g.perTrade),e.pure.u64(g.daily),e.pure.u64(g.minPrice),d]}));for(const g of r.lending){const y=t.protocols.navi.reserves[g.coin];if(!y)throw new Error(`NAVI has no reserve for ${g.coin} in this deployment`);m(`${u}::lending_policy::LendingPolicy<${g.coin}>`,e.moveCall({target:`${c}::lending_policy::new`,typeArguments:[g.coin],arguments:[e.pure.id(y.poolId),e.pure.u8(y.assetId),e.pure.bool(g.allowBorrow),e.pure.u64(g.perAction),e.pure.u64(g.daily),e.pure.u256(vH(g.minHealthFactor)),d]}))}r.lending.length&&i&&e.moveCall({target:`${c}::pass::navi_open`,arguments:[s,p]}),r.staking&&m(`${u}::staking_policy::StakingPolicy`,e.moveCall({target:`${c}::staking_policy::new`,arguments:[e.pure.vector("address",r.staking.validators),e.pure.u64(r.staking.perStake),e.pure.u64(r.staking.daily),d]}))}function Kq(e,t,s){e.moveCall({target:"0x2::balance::send_funds",typeArguments:[Lt],arguments:[e.balance({balance:t}),e.pure.address(s)]})}function Jq(e,t,s,r,i){for(const[c,u]of Object.entries(s)){if(BigInt(u)<=0n)continue;const d=t.demoFaucet&&At(t.demoFaucet.coin,c)?t.demoFaucet:null;let p;if(d)p=e.moveCall({target:`${d.packageId}::usdc::mint`,arguments:[e.object(d.faucetId),e.pure.u64(u)]});else if(At(c,Lt))p=e.splitCoins(e.gas,[u])[0];else{const m=r[De(c)]??[];if(!m.length)throw new Error(`No ${c} coin objects to convert`);const[g,...y]=m.map(b=>e.objectRef(b));y.length&&e.mergeCoins(g,y),p=e.splitCoins(g,[u])[0]}e.moveCall({target:"0x2::coin::send_funds",typeArguments:[c],arguments:[p,e.pure.address(i)]})}}function Qq(e,t){const s=e.moveCall({target:"0x2::allowance::periodic_rate_limit",arguments:[e.pure.u64(Tp),e.pure.u256(t)]});return e.moveCall({target:"0x1::option::some",typeArguments:[uN],arguments:[s]})}function hN(e,t,s){e.moveCall({target:"0x2::allowance::new",typeArguments:[am(Lt)],arguments:[e.pure.string(VO),e.pure.address(s),e.pure.option("u256",t.gasCap),e.pure.option("u64",null),e.pure.option("u64",t.expiresMs),Qq(e,t.gasDaily)]})}function eZ(e,t,s,r,i,c={}){const u=new Yn;u.setSender(s);const d=u.moveCall({target:`${e.publishedAt}::pass::create`,arguments:[u.object(e.configId),u.pure.string(t.name),u.pure.address(r),u.pure.u64(t.expiresMs),u.object(m1)]}),p=(m,g)=>pN(u,e,d,t,r,m,g);for(const[m,g]of Object.entries(t.allowances))p(m,g);return hN(u,t,r),fN(u,e,d,t.policy,!0),u.moveCall({target:`${e.publishedAt}::pass::share`,arguments:[d]}),Jq(u,e,i,c,s),Kq(u,t.gasAmount,r),u}function pN(e,t,s,r,i,c,u){e.moveCall({target:`${t.publishedAt}::pass::issue`,typeArguments:[c],arguments:[s,e.object(t.configId),e.moveCall({target:"0x2::allowance::propose_for_app",typeArguments:[am(c),qO(t)],arguments:[e.pure.string(r.name),e.pure.address(i),e.pure.option("u256",u),e.pure.option("u64",null),e.pure.option("u64",r.expiresMs),e.moveCall({target:"0x1::option::none",typeArguments:[uN]})]})]})}function Rh(e,t,s,r){e.moveCall({target:"0x2::allowance::revoke",typeArguments:[am(t)],arguments:[e.object(s),e.object(r)]})}function mN(e,t,s,r){const i=t.publishedAt,c=t.packageId,u=d=>e.moveCall({target:`${i}::pass::remove_policy`,typeArguments:[d],arguments:[s]});for(const d of r.transfers)e.moveCall({target:`${i}::transfer_policy::destroy`,typeArguments:[d.coinType],arguments:[u(`${c}::transfer_policy::TransferPolicy<${d.coinType}>`)]});for(const d of r.swaps)u(`${c}::swap_policy::SwapPolicy<${d.coinIn},${d.coinOut}>`);for(const d of r.lending)u(`${c}::lending_policy::LendingPolicy<${d.coinType}>`);r.staking.length&&u(`${c}::staking_policy::StakingPolicy`)}function tZ(e,t,s,r){const i=new Yn;i.setSender(r);const{active:c,control:u}=t,d=i.object(c.passId),p=u.agent;String(s.expiresMs)!==u.agentExpiresMs&&i.moveCall({target:`${e.publishedAt}::pass::set_term`,arguments:[d,i.object(e.configId),i.pure.u64(s.expiresMs),i.object(m1)]}),mN(i,e,d,u.policies),fN(i,e,d,s.policy,s.policy.lending.length>0&&!u.naviPosition);const m=(g,y,b)=>!!g&&g.lifetimeCap===y&&g.expirationMs===String(s.expiresMs)&&(b===null?g.rateLimit===null:g.rateLimit?.limit===b);for(const[g,y]of Object.entries(s.allowances)){const b=De(g),E=c.allowances[b];E&&m(t.allowances[b]??null,y,null)||(E&&Rh(i,b,E.revokeCap,E.allowance),pN(i,e,d,s,p,b,y))}for(const[g,y]of Object.entries(c.allowances))!(De(g)in s.allowances)&&!Object.keys(s.allowances).some(b=>At(b,g))&&Rh(i,g,y.revokeCap,y.allowance);return m(t.gas,s.gasCap,s.gasDaily)||(Rh(i,Lt,c.gasRevokeCap,c.gasAllowance),hN(i,s,p)),i}function nZ(e,t,s){const r=new Yn;r.setSender(s),r.moveCall({target:`${e.publishedAt}::pass::revoke_agent`,arguments:[r.object(t.passId)]});for(const[i,c,u]of gN(t))r.moveCall({target:"0x2::allowance::revoke",typeArguments:[am(i)],arguments:[r.object(c),r.object(u)]});return r}function gN(e){return[...Object.entries(e.allowances).map(([t,s])=>[t,s.revokeCap,s.allowance]),[Lt,e.gasRevokeCap,e.gasAllowance]]}function yN(e,t,s){const r=e.moveCall({target:`${t.publishedAt}::navi::account_key`});return e.moveCall({target:`${t.publishedAt}::pass::withdraw_object`,typeArguments:[`${t.packageId}::navi::AccountKey`,`${t.protocols.navi.packageId}::account::AccountCap`],arguments:[s,r]})}async function sZ(e,t,s,r=null){const i=new Yn;i.setSender(s),Qu(r)&&await h1(i,e);const c=yN(i,e,i.object(t.passId));return Qu(r)&&p1(i,e,c,r,s),i.transferObjects([c],s),i}function rZ(e,t,s,r,i,c=null){return vN(e,[{pass:t,active:s,control:r,position:c}],i)}async function vN(e,t,s){const r=new Yn;r.setSender(s),t.some(i=>i.control.naviPosition&&Qu(i.position))&&await h1(r,e);for(const i of t)aZ(r,e,i,s);return r}function aZ(e,t,{pass:s,active:r,control:i,position:c},u){const d=t.publishedAt,p=t.packageId,m=e.object(s.passId);if(i.revoked||e.moveCall({target:`${d}::pass::revoke_agent`,arguments:[m]}),r)for(const[y,b,E]of gN(r))Rh(e,y,b,E);mN(e,t,m,i.policies);const g=[];if(i.naviPosition){const y=yN(e,t,m);Qu(c)&&p1(e,t,y,c,u),g.push(y)}for(const y of i.stakes){const b=e.moveCall({target:`${d}::staking::stake_key`,arguments:[e.pure.id(y.id)]});g.push(e.moveCall({target:`${d}::pass::withdraw_object`,typeArguments:[`${p}::staking::StakeKey`,dN],arguments:[m,b]}))}g.length&&e.transferObjects(g,u),e.moveCall({target:`${d}::pass::destroy`,arguments:[m]}),e.moveCall({target:`${d}::pass::burn_receipt`,arguments:[e.object(s.receiptId)]})}function iZ(e,t,s,r){const i=new Yn;i.setSender(s);const c=i.moveCall({target:`${e.packageId}::staking::stake_key`,arguments:[i.pure.id(r)]}),u=i.moveCall({target:`${e.publishedAt}::pass::withdraw_object`,typeArguments:[`${e.packageId}::staking::StakeKey`,dN],arguments:[i.object(t.passId),c]});return i.transferObjects([u],s),i}const Rn=e=>`${e.slice(0,8)}…${e.slice(-6)}`,Rc=e=>`${pd(e,9)} SUI`,oZ=new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}),cZ=e=>`${oZ.format(Number(e))} UTC`,bN=(e,t)=>{if(e===null)return"pending";const s=Math.max(0,Math.floor((t-e)/1e3));return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:`${Math.floor(s/3600)}h ago`},wN=new URLSearchParams(location.search),lZ=wN.has("embed"),U4=wN.has("expose-wallet");function uZ(){const[e,t]=ze.useState(location.hash);ze.useEffect(()=>{const c=()=>t(location.hash);return addEventListener("hashchange",c),()=>removeEventListener("hashchange",c)},[]);const[s="",r="",i=""]=e.replace(/^#\/?/,"").split("/");return{kind:s,value:r,extra:i}}function sa({d:e,kind:t,id:s,children:r}){const i=t==="tx"?YH(e,s):t==="object"?WH(e,s):XH(e,s),c=r??Rn(s);return i?T.jsx("a",{href:i,target:"_blank",rel:"noreferrer",title:s,children:c}):T.jsx("span",{title:s,children:c})}function TN({d:e,attempts:t,now:s,showSender:r}){return t.length===0?T.jsx("p",{className:"empty",children:"Nothing yet."}):T.jsx(T.Fragment,{children:t.map(i=>T.jsxs("div",{className:`attempt ${i.success?"ok":"refused"}`,children:[T.jsx("span",{className:"mark",children:i.success?"✓":"✕"}),T.jsxs("div",{children:[T.jsx("strong",{children:i.what}),i.why&&T.jsxs("p",{className:"why",children:["Refused on chain: ",i.why]}),i.moved.length>0&&T.jsx("p",{className:"moved",children:i.moved.join(" · ")}),T.jsxs("p",{className:"meta",children:[bN(i.timestampMs,s)," · ",T.jsx(sa,{d:e,kind:"tx",id:i.digest}),r&&i.sender&&T.jsxs(T.Fragment,{children:[" ","· agent ",T.jsx(sa,{d:e,kind:"address",id:i.sender})]})]})]})]},i.digest))})}function dZ({d:e,passes:t,now:s}){return t.length===0?T.jsx("p",{className:"empty",children:"No passes yet."}):T.jsx("div",{className:"grid",children:t.map(r=>T.jsxs("a",{className:"card",href:`#/pass/${r.id}`,children:[T.jsx("h3",{children:r.name}),T.jsxs("p",{children:["Pass ",Rn(r.id)]}),T.jsxs("p",{children:["Owner ",Rn(r.owner)]}),T.jsxs("p",{children:["Agent ",Rn(r.agent)]}),T.jsxs("p",{children:["Created ",bN(r.timestampMs,s)]})]},r.id))})}const B4=`npm install -g @mysten-incubation/sui-agent-pass
|
|
842
|
+
`):"Any active validator"},{label:"Max SUI per stake / per UTC day",value:`${r(Lt,d?.perStake??t.staking.perStake)} / ${r(Lt,d?.daily??t.staking.daily)}`})}return u}const JH=new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"short",timeZone:"UTC"});function Uv(e,t){return[...JO(e,t.policy),{starts:!0,label:"Authorization ends",value:`${JH.format(t.expiresMs)} UTC (${t.ttlMs/864e5} ${t.ttlMs===864e5?"day":"days"}); you can revoke earlier`},{label:"Agent may ever withdraw (lifetime caps)",value:Object.entries(t.allowances).map(([s,r])=>hn(e,s,r)).join(", ")},{label:"Max gas allowance, lifetime / per 24 hours from first top-up",value:`${hn(e,Lt,t.gasCap)} / ${hn(e,Lt,t.gasDaily)}`},{label:"Agent gas stipend (outside the rules)",value:hn(e,Lt,t.gasAmount)}]}const QH=new Set(["deposit_object","withdraw_object","navi_open","destroy","issue","add_policy","remove_policy","set_term","revoke_agent"]);function QO(e,t,s,r){const{inputs:i,commands:c}=r.transaction,u=(G,J)=>G?hn(e,A4(G),J):`${J} base units of an unknown coin`,d=G=>G?sr(e,A4(G)):"an unknown coin",p=G=>G&&typeof G=="object"&&"Input"in G?i[G.Input]:void 0,m=(G,J)=>{const w=p(G);if(!w||!("Pure"in w)||!w.Pure)return null;try{const A=Ge(w.Pure.bytes);return J==="u64"?M.u64().parse(A):J==="address"?ye(M.Address.parse(A)):M.string().parse(A)}catch{return null}},g=G=>{const J=p(G);if(!J||!("Object"in J)||!J.Object)return null;const w=J.Object,A="SharedObject"in w?w.SharedObject?.objectId:"ImmOrOwnedObject"in w?w.ImmOrOwnedObject?.objectId:void 0;return A?ye(A):null},y=G=>{const J=p(G);return!J||!("FundsWithdrawal"in J)||!J.FundsWithdrawal?null:J.FundsWithdrawal.reservation?.MaxAmountU64??null},b=G=>{const J=y(G.arguments[1]);return J===null?"SUI":u(Lt,J)},E=G=>{const J=e.pools.find(w=>w.poolId===G);return J?J.venue==="deepbook"?"DeepBook":"Cetus":"a pool you did not list"},O=G=>[e.packageId,e.publishedAt].some(J=>ye(J)===ye(G)),C=c.flatMap(G=>"MoveCall"in G&&G.MoveCall?[G.MoveCall]:[]),R=C.find(G=>O(G.package)&&G.module==="pass")??C.find(G=>O(G.package))??C[0];let $="Custom transaction",x=null;if(R&&O(R.package)){const[G,J]=R.typeArguments,w=R.arguments,A=(N,F=G)=>{const B=m(w[N],"u64")??y(w[N]);return B===null?"an amount":u(F,B)};switch(R.function){case"transfer":x=m(w[w.length-2],"string"),$=`Pay ${A(3)} to ${x?`"${x}"`:"a recipient"}`;break;case"begin_swap":{const F=C.filter(z=>["deepbook_base_to_quote","deepbook_quote_to_base","cetus_a_to_b","cetus_b_to_a"].includes(z.function)).map(z=>E(g(z.arguments[z.function.startsWith("cetus")?3:2]))),B=C.find(z=>z.function==="finish_swap"),q=B?m(B.arguments[2],"u64"):null;$=`Sell ${A(3)} for ${d(J)} on ${F.join(", then ")||"no pool"}, accepting at least ${q===null?"an amount":u(J,q)}`;break}case"navi_supply":$=`Supply ${A(3)} to NAVI`;break;case"navi_repay":$=`Repay ${A(3)} to NAVI`;break;case"navi_withdraw":$=`Withdraw ${A(7)} from NAVI`;break;case"navi_borrow":$=`Borrow ${A(7)} from NAVI`;break;case"stake":{const N=m(w[5],"address");$=`Stake ${A(3,Lt)} with ${N?`validator ${Cy(N)}`:"a validator"}`;break}case"unstake":{const N=m(w[3],"address");$=`Unstake ${N?Cy(N):"a stake"} back to your balance`;break}case"resign":$="Give up the agent key: the pass refuses it from now on";break;default:$=QH.has(R.function)?`Call the owner-only ${R.module}::${R.function}`:`Call ${R.module}::${R.function}`}}else R&&ye(R.package)===ye("0x2")&&R.module==="allowance"&&R.function==="balance_spend"?$=`Top up the agent's gas with ${b(R)}`:R&&($=`Call ${R.module}::${R.function}`);const W=new Map(s.map(G=>[ye(G.address),G.name])),oe=ye(t),me=r.status.success?r.balanceChanges.filter(G=>BigInt(G.amount)>0n&&ye(G.address)!==oe).map(G=>`${u(G.coinType,G.amount)} → ${W.get(ye(G.address))??Cy(G.address)}`):[];return{digest:r.digest,timestampMs:r.timestampMs,success:r.status.success,what:$,why:r.status.success?null:eq(e,r.status.error,x),moved:me}}const Cy=e=>`${e.slice(0,8)}…${e.slice(-6)}`,A4=e=>e.replace(/^0x0*([0-9a-f]+)::/i,(t,s)=>`${ye(s)}::`);function eq(e,t,s){const r=t.MoveAbort;if(t.message==="InsufficientBalanceForWithdraw")return"The owner's address balance does not hold enough of this coin right now. This is not one of the owner's rules: the action can run once the balance covers it (InsufficientBalanceForWithdraw)";if(!r?.location?.module)return t.message;const i=Number(r.cleverError?.errorCode??r.abortCode),c=`${r.location.module} abort ${i}`,u=ye(r.location.package??"0x0"),d={allowance:{3:"Over the lifetime cap of the owner's allowance for this coin (checked before the daily limit, so when the two are equal the day is used up as well)",4:"Over the gas allowance's limit per 24 hours from first top-up"},validator_set:{10:"Below the 1 SUI minimum stake",0:"Not an active validator"}};if(u===ye("0x2")||u===ye("0x3")){const g=d[r.location.module]?.[i];return g?`${g} (${c})`:`Refused in ${c}`}if(u!==ye(e.packageId)){const y={1500:"NAVI is paused",1502:"NAVI has no fresh oracle price for this asset; the price must be refreshed in the same transaction",1503:"NAVI rejected the amount",1506:"NAVI pool has insufficient balance",1508:"NAVI no longer accepts this entry point; the pass must call its current one",1600:"NAVI finds the position unhealthy",1601:"the position holds no collateral",1602:"the position has no debt to repay",1603:"the collateral does not cover that borrow (loan-to-value)",1604:"NAVI's deposit cap for this asset is reached",1605:"NAVI's borrow cap for this asset is reached"}[i];return y?`Refused by NAVI, not by your rules: ${y} (${c})`:`Refused inside the protocol, not by your rules (${c}): ${t.message}`}const m={transfer_policy:{0:`${s?`"${s}"`:"That recipient"} is not a recipient you named`,1:"Over your per-transfer limit",2:"Zero amount"},meter:{0:"Over your daily limit"},swap_policy:{0:"Not a pool you listed",1:"Over your per-trade limit",3:"Below the agent's own minimum output",4:"Worse than your price limit",8:"The venue filled nothing (order under its minimum size)"},lending_policy:{0:"Not the NAVI pool or asset you chose",1:"Borrowing is not allowed",3:"Over your per-action limit"},navi:{0:"Your health-factor floor would be breached",2:"The NAVI account is not in the pass; you reclaimed it"},staking_policy:{0:"Not a validator you listed",1:"Over your per-stake limit",2:"Zero amount"},staking:{0:"No such stake is held by the pass"},pass:{1:"Not an allowance issued for this pass",2:"No such object is held by the pass",7:"A swap begun on one pass cannot end on another"},control:{0:"Only your wallet can do this",1:"This key is not your agent",2:"Your agent's access was revoked or has expired"},policies:{0:"No rule allows this coin or action"}}[r.location.module]?.[i];return m?`${m} (${c})`:`Refused in ${c}`}async function tq(e,t,s){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:t,variables:s})});if(!r.ok)throw new Error(`GraphQL ${e}: HTTP ${r.status}`);const i=await r.json();if(i.errors?.length)throw new Error(`GraphQL ${e}: ${i.errors.map(c=>c.message).join("; ")}`);if(!i.data)throw new Error(`GraphQL ${e}: empty response`);return i.data}async function eN(e,t,s,r,i,c,u){const p=(await tq(e,`query($filter: ${r}, $limit: Int!, $before: String) { ${t}(last: $limit, before: $before, filter: $filter) { pageInfo { hasPreviousPage startCursor } nodes { ${s} } } }`,{filter:i,limit:c,before:u}))[t];return{nodes:p.nodes.slice().reverse(),hasNextPage:p.pageInfo.hasPreviousPage,endCursor:p.pageInfo.startCursor}}async function nq(e,t,s){const{nodes:r}=await eN(e,"transactions","digest","TransactionFilter",t,s,null);return r.map(i=>i.digest)}async function tN(e,t,s,r=null){if(t.graphqlUrl){const{nodes:u,hasNextPage:d,endCursor:p}=await eN(t.graphqlUrl,"events","timestamp contents { bcs } transaction { digest }","EventFilter",{type:jv(t)},s,r);return{summaries:u.filter(g=>g.contents&&g.transaction).map(g=>({...Mv(Ge(g.contents.bcs)),digest:g.transaction.digest,timestampMs:g.timestamp?Date.parse(g.timestamp):null})),hasNextPage:d,endCursor:p}}const i=await e.listEvents({filter:{eventType:jv(t)},order:"descending",limit:s,...r?{before:r}:{}});return{summaries:await Promise.all(i.events.map(async u=>{const d=await e.getTransaction({digest:u.transactionDigest}).catch(()=>null),p=d?.Transaction??d?.FailedTransaction;return{...Mv(u.bcs),digest:u.transactionDigest,timestampMs:p?.timestampMs??null}})),hasNextPage:i.hasNextPage,endCursor:i.endCursor}}const sq=(e,t)=>oj(e.configId,`${e.packageId}::pass::AgentKey`,M.Address.serialize(ye(t)).toBytes());async function rq(e,t,s){const r=sq(t,s),i=await e.getObject({objectId:r,include:{previousTransaction:!0}}).catch(u=>{if(u?.code==="notExists")return null;throw u});if(!i?.object.previousTransaction)return null;const{owner:c}=await md(e,t,r);return{id:r,owner:c,digest:i.object.previousTransaction}}async function aq(e,t,s=50){return(await tN(e,t,s)).summaries}async function rm(e,t,s){const r=ye(s);let i=null;for(let c=0;c<40;c++){const{summaries:u,hasNextPage:d,endCursor:p}=await tN(e,t,50,i),m=u.find(g=>g.id===r);if(m)return m;if(!d||!p)return null;i=p}return null}async function l1(e,t,s){const r=await md(e,t,s.id),{allowances:i,gas:c}=await ZH(e,t,{owner:s.owner,agent:r.agent});return!c||Object.keys(i).length===0?null:{passId:s.id,receiptId:s.receiptId,allowances:i,gasAllowance:c.allowance,gasRevokeCap:c.revokeCap,owner:s.owner,authorizationDigest:s.digest}}const nN={transaction:!0,balanceChanges:!0};async function sN(e,t,s,r,i){return(t.graphqlUrl?await Promise.all((await nq(t.graphqlUrl,"sender"in s?{sentAddress:s.sender}:s,r)).map(u=>e.getTransaction({digest:u,include:i}))):(await e.listTransactions({filter:s,order:"descending",limit:r,include:i})).transactions).map(u=>u.Transaction??u.FailedTransaction)}async function iq(e,t,s,r,i=30){return(await sN(e,t,{sender:s},i,nN)).map(u=>QO(t,s,r,u))}async function oq(e,t,s=40){return(await sN(e,t,{function:`${t.publishedAt}::pass`},s,nN)).map(i=>{const c=ye(i.transaction?.sender??"0x0");return{...QO(t,c,[],i),sender:c}})}const O4=M.bytes(32).transform({input:e=>sd(e),output:e=>Ar(e)});M.struct("IncentiveAPYInfo",{asset_id:M.u8(),apy:M.u256(),coin_types:M.vector(M.string())});const cq=M.struct("IncentivePoolInfo",{pool_id:O4,funds:O4,phase:M.u64(),start_at:M.u64(),end_at:M.u64(),closed_at:M.u64(),total_supply:M.u64(),asset_id:M.u8(),option:M.u8(),factor:M.u256(),distributed:M.u64(),available:M.u256(),total:M.u256()});M.struct("IncentivePoolInfoByPhase",{phase:M.u64(),pools:M.vector(cq)});M.struct("OracleInfo",{oracle_id:M.u8(),price:M.u256(),decimals:M.u8(),valid:M.bool()});M.struct("FlashLoanAssetConfig",{id:M.string(),asset_id:M.u8(),coin_type:M.string(),pool_id:M.string(),rate_to_supplier:M.u64(),rate_to_treasury:M.u64(),max:M.u64(),min:M.u64()});M.struct("ReserveDataInfo",{id:M.u8(),oracle_id:M.u8(),coin_type:M.string(),supply_cap:M.u256(),borrow_cap:M.u256(),supply_rate:M.u256(),borrow_rate:M.u256(),supply_index:M.u256(),borrow_index:M.u256(),total_supply:M.u256(),total_borrow:M.u256(),last_update_at:M.u64(),ltv:M.u256(),treasury_factor:M.u256(),treasury_balance:M.u256(),base_rate:M.u256(),multiplier:M.u256(),jump_rate_multiplier:M.u256(),reserve_factor:M.u256(),optimal_utilization:M.u256(),liquidation_ratio:M.u256(),liquidation_bonus:M.u256(),liquidation_threshold:M.u256()});M.struct("UserStateInfo",{asset_id:M.u8(),borrow_balance:M.u256(),supply_balance:M.u256()});var Iy,N4;function lq(){if(N4)return Iy;N4=1;var e="[object Symbol]",t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,s=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,r="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",c="\\u20d0-\\u20f0",u="\\u2700-\\u27bf",d="a-z\\xdf-\\xf6\\xf8-\\xff",p="\\xac\\xb1\\xd7\\xf7",m="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",g="\\u2000-\\u206f",y=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",b="A-Z\\xc0-\\xd6\\xd8-\\xde",E="\\ufe0e\\ufe0f",O=p+m+g+y,C="['’]",R="["+r+"]",$="["+O+"]",x="["+i+c+"]",W="\\d+",oe="["+u+"]",me="["+d+"]",G="[^"+r+O+W+u+d+b+"]",J="\\ud83c[\\udffb-\\udfff]",w="(?:"+x+"|"+J+")",A="[^"+r+"]",N="(?:\\ud83c[\\udde6-\\uddff]){2}",F="[\\ud800-\\udbff][\\udc00-\\udfff]",B="["+b+"]",q="\\u200d",z="(?:"+me+"|"+G+")",D="(?:"+B+"|"+G+")",k="(?:"+C+"(?:d|ll|m|re|s|t|ve))?",j="(?:"+C+"(?:D|LL|M|RE|S|T|VE))?",U=w+"?",V="["+E+"]?",K="(?:"+q+"(?:"+[A,N,F].join("|")+")"+V+U+")*",P=V+U+K,re="(?:"+[oe,N,F].join("|")+")"+P,ue="(?:"+[A+x+"?",x,N,F,R].join("|")+")",I=RegExp(C,"g"),X=RegExp(x,"g"),ce=RegExp(J+"(?="+J+")|"+ue+P,"g"),he=RegExp([B+"?"+me+"+"+k+"(?="+[$,B,"$"].join("|")+")",D+"+"+j+"(?="+[$,B+z,"$"].join("|")+")",B+"?"+z+"+"+k,B+"+"+j,W,re].join("|"),"g"),Te=RegExp("["+q+r+i+c+E+"]"),Oe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ae={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},be=typeof Ac=="object"&&Ac&&Ac.Object===Object&&Ac,_e=typeof self=="object"&&self&&self.Object===Object&&self,Pe=be||_e||Function("return this")();function at(Ce,Ye,Nt,ks){for(var Mn=-1,Oo=Ce?Ce.length:0;++Mn<Oo;)Nt=Ye(Nt,Ce[Mn],Mn,Ce);return Nt}function H(Ce){return Ce.split("")}function te(Ce){return Ce.match(t)||[]}function de(Ce){return function(Ye){return Ce?.[Ye]}}var fe=de(Ae);function le(Ce){return Te.test(Ce)}function $e(Ce){return Oe.test(Ce)}function Le(Ce){return le(Ce)?Dt(Ce):H(Ce)}function Dt(Ce){return Ce.match(ce)||[]}function _s(Ce){return Ce.match(he)||[]}var ba=Object.prototype,pl=ba.toString,Ti=Pe.Symbol,Ao=Ti?Ti.prototype:void 0,ml=Ao?Ao.toString:void 0;function or(Ce,Ye,Nt){var ks=-1,Mn=Ce.length;Ye<0&&(Ye=-Ye>Mn?0:Mn+Ye),Nt=Nt>Mn?Mn:Nt,Nt<0&&(Nt+=Mn),Mn=Ye>Nt?0:Nt-Ye>>>0,Ye>>>=0;for(var Oo=Array(Mn);++ks<Mn;)Oo[ks]=Ce[ks+Ye];return Oo}function gl(Ce){if(typeof Ce=="string")return Ce;if(bl(Ce))return ml?ml.call(Ce):"";var Ye=Ce+"";return Ye=="0"&&1/Ce==-1/0?"-0":Ye}function yl(Ce,Ye,Nt){var ks=Ce.length;return Nt=Nt===void 0?ks:Nt,!Ye&&Nt>=ks?Ce:or(Ce,Ye,Nt)}function im(Ce){return function(Ye){Ye=wa(Ye);var Nt=le(Ye)?Le(Ye):void 0,ks=Nt?Nt[0]:Ye.charAt(0),Mn=Nt?yl(Nt,1).join(""):Ye.slice(1);return ks[Ce]()+Mn}}function gd(Ce){return function(Ye){return at(yd(zn(Ye).replace(I,"")),Ce,"")}}function vl(Ce){return!!Ce&&typeof Ce=="object"}function bl(Ce){return typeof Ce=="symbol"||vl(Ce)&&pl.call(Ce)==e}function wa(Ce){return Ce==null?"":gl(Ce)}var om=gd(function(Ce,Ye,Nt){return Ye=Ye.toLowerCase(),Ce+(Nt?cm(Ye):Ye)});function cm(Ce){return lm(wa(Ce).toLowerCase())}function zn(Ce){return Ce=wa(Ce),Ce&&Ce.replace(s,fe).replace(X,"")}var lm=im("toUpperCase");function yd(Ce,Ye,Nt){return Ce=wa(Ce),Ye=Ye,Ye===void 0?$e(Ce)?_s(Ce):te(Ce):Ce.match(Ye)||[]}return Iy=om,Iy}lq();var uq=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ry=Math.ceil,Us=Math.floor,ss="[BigNumber Error] ",x4=ss+"Number primitive has more than 15 significant digits: ",Xs=1e14,Ze=14,jy=9007199254740991,My=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Qa=1e7,wn=1e9;function rN(e){var t,s,r,i=x.prototype={constructor:x,toString:null,valueOf:null},c=new x(1),u=20,d=4,p=-7,m=21,g=-1e7,y=1e7,b=!1,E=1,O=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},R="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function x(w,A){var N,F,B,q,z,D,k,j,U=this;if(!(U instanceof x))return new x(w,A);if(A==null){if(w&&w._isBigNumber===!0){U.s=w.s,!w.c||w.e>y?U.c=U.e=null:w.e<g?U.c=[U.e=0]:(U.e=w.e,U.c=w.c.slice());return}if((D=typeof w=="number")&&w*0==0){if(U.s=1/w<0?(w=-w,-1):1,w===~~w){for(q=0,z=w;z>=10;z/=10,q++);q>y?U.c=U.e=null:(U.e=q,U.c=[w]);return}j=String(w)}else{if(!uq.test(j=String(w)))return r(U,j,D);U.s=j.charCodeAt(0)==45?(j=j.slice(1),-1):1}(q=j.indexOf("."))>-1&&(j=j.replace(".","")),(z=j.search(/e/i))>0?(q<0&&(q=z),q+=+j.slice(z+1),j=j.substring(0,z)):q<0&&(q=j.length)}else{if($t(A,2,R.length,"Base"),A==10&&$)return U=new x(w),G(U,u+U.e+1,d);if(j=String(w),D=typeof w=="number"){if(w*0!=0)return r(U,j,D,A);if(U.s=1/w<0?(j=j.slice(1),-1):1,x.DEBUG&&j.replace(/^0\.0*|\./,"").length>15)throw Error(x4+w)}else U.s=j.charCodeAt(0)===45?(j=j.slice(1),-1):1;for(N=R.slice(0,A),q=z=0,k=j.length;z<k;z++)if(N.indexOf(F=j.charAt(z))<0){if(F=="."){if(z>q){q=k;continue}}else if(!B&&(j==j.toUpperCase()&&(j=j.toLowerCase())||j==j.toLowerCase()&&(j=j.toUpperCase()))){B=!0,z=-1,q=0;continue}return r(U,String(w),D,A)}D=!1,j=s(j,A,10,U.s),(q=j.indexOf("."))>-1?j=j.replace(".",""):q=j.length}for(z=0;j.charCodeAt(z)===48;z++);for(k=j.length;j.charCodeAt(--k)===48;);if(j=j.slice(z,++k)){if(k-=z,D&&x.DEBUG&&k>15&&(w>jy||w!==Us(w)))throw Error(x4+U.s*w);if((q=q-z-1)>y)U.c=U.e=null;else if(q<g)U.c=[U.e=0];else{if(U.e=q,U.c=[],z=(q+1)%Ze,q<0&&(z+=Ze),z<k){for(z&&U.c.push(+j.slice(0,z)),k-=Ze;z<k;)U.c.push(+j.slice(z,z+=Ze));z=Ze-(j=j.slice(z)).length}else z-=k;for(;z--;j+="0");U.c.push(+j)}}else U.c=[U.e=0]}x.clone=rN,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(w){var A,N;if(w!=null)if(typeof w=="object"){if(w.hasOwnProperty(A="DECIMAL_PLACES")&&(N=w[A],$t(N,0,wn,A),u=N),w.hasOwnProperty(A="ROUNDING_MODE")&&(N=w[A],$t(N,0,8,A),d=N),w.hasOwnProperty(A="EXPONENTIAL_AT")&&(N=w[A],N&&N.pop?($t(N[0],-wn,0,A),$t(N[1],0,wn,A),p=N[0],m=N[1]):($t(N,-wn,wn,A),p=-(m=N<0?-N:N))),w.hasOwnProperty(A="RANGE"))if(N=w[A],N&&N.pop)$t(N[0],-wn,-1,A),$t(N[1],1,wn,A),g=N[0],y=N[1];else if($t(N,-wn,wn,A),N)g=-(y=N<0?-N:N);else throw Error(ss+A+" cannot be zero: "+N);if(w.hasOwnProperty(A="CRYPTO"))if(N=w[A],N===!!N)if(N)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))b=N;else throw b=!N,Error(ss+"crypto unavailable");else b=N;else throw Error(ss+A+" not true or false: "+N);if(w.hasOwnProperty(A="MODULO_MODE")&&(N=w[A],$t(N,0,9,A),E=N),w.hasOwnProperty(A="POW_PRECISION")&&(N=w[A],$t(N,0,wn,A),O=N),w.hasOwnProperty(A="FORMAT"))if(N=w[A],typeof N=="object")C=N;else throw Error(ss+A+" not an object: "+N);if(w.hasOwnProperty(A="ALPHABET"))if(N=w[A],typeof N=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(N))$=N.slice(0,10)=="0123456789",R=N;else throw Error(ss+A+" invalid: "+N)}else throw Error(ss+"Object expected: "+w);return{DECIMAL_PLACES:u,ROUNDING_MODE:d,EXPONENTIAL_AT:[p,m],RANGE:[g,y],CRYPTO:b,MODULO_MODE:E,POW_PRECISION:O,FORMAT:C,ALPHABET:R}},x.isBigNumber=function(w){if(!w||w._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var A,N,F=w.c,B=w.e,q=w.s;e:if({}.toString.call(F)=="[object Array]"){if((q===1||q===-1)&&B>=-wn&&B<=wn&&B===Us(B)){if(F[0]===0){if(B===0&&F.length===1)return!0;break e}if(A=(B+1)%Ze,A<1&&(A+=Ze),String(F[0]).length==A){for(A=0;A<F.length;A++)if(N=F[A],N<0||N>=Xs||N!==Us(N))break e;if(N!==0)return!0}}}else if(F===null&&B===null&&(q===null||q===1||q===-1))return!0;throw Error(ss+"Invalid BigNumber: "+w)},x.maximum=x.max=function(){return oe(arguments,-1)},x.minimum=x.min=function(){return oe(arguments,1)},x.random=(function(){var w=9007199254740992,A=Math.random()*w&2097151?function(){return Us(Math.random()*w)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(N){var F,B,q,z,D,k=0,j=[],U=new x(c);if(N==null?N=u:$t(N,0,wn),z=Ry(N/Ze),b)if(crypto.getRandomValues){for(F=crypto.getRandomValues(new Uint32Array(z*=2));k<z;)D=F[k]*131072+(F[k+1]>>>11),D>=9e15?(B=crypto.getRandomValues(new Uint32Array(2)),F[k]=B[0],F[k+1]=B[1]):(j.push(D%1e14),k+=2);k=z/2}else if(crypto.randomBytes){for(F=crypto.randomBytes(z*=7);k<z;)D=(F[k]&31)*281474976710656+F[k+1]*1099511627776+F[k+2]*4294967296+F[k+3]*16777216+(F[k+4]<<16)+(F[k+5]<<8)+F[k+6],D>=9e15?crypto.randomBytes(7).copy(F,k):(j.push(D%1e14),k+=7);k=z/7}else throw b=!1,Error(ss+"crypto unavailable");if(!b)for(;k<z;)D=A(),D<9e15&&(j[k++]=D%1e14);for(z=j[--k],N%=Ze,z&&N&&(D=My[Ze-N],j[k]=Us(z/D)*D);j[k]===0;j.pop(),k--);if(k<0)j=[q=0];else{for(q=-1;j[0]===0;j.splice(0,1),q-=Ze);for(k=1,D=j[0];D>=10;D/=10,k++);k<Ze&&(q-=Ze-k)}return U.e=q,U.c=j,U}})(),x.sum=function(){for(var w=1,A=arguments,N=new x(A[0]);w<A.length;)N=N.plus(A[w++]);return N},s=(function(){var w="0123456789";function A(N,F,B,q){for(var z,D=[0],k,j=0,U=N.length;j<U;){for(k=D.length;k--;D[k]*=F);for(D[0]+=q.indexOf(N.charAt(j++)),z=0;z<D.length;z++)D[z]>B-1&&(D[z+1]==null&&(D[z+1]=0),D[z+1]+=D[z]/B|0,D[z]%=B)}return D.reverse()}return function(N,F,B,q,z){var D,k,j,U,V,K,P,re,ue=N.indexOf("."),I=u,X=d;for(ue>=0&&(U=O,O=0,N=N.replace(".",""),re=new x(F),K=re.pow(N.length-ue),O=U,re.c=A(ea(Ds(K.c),K.e,"0"),10,B,w),re.e=re.c.length),P=A(N,F,B,z?(D=R,w):(D=w,R)),j=U=P.length;P[--U]==0;P.pop());if(!P[0])return D.charAt(0);if(ue<0?--j:(K.c=P,K.e=j,K.s=q,K=t(K,re,I,X,B),P=K.c,V=K.r,j=K.e),k=j+I+1,ue=P[k],U=B/2,V=V||k<0||P[k+1]!=null,V=X<4?(ue!=null||V)&&(X==0||X==(K.s<0?3:2)):ue>U||ue==U&&(X==4||V||X==6&&P[k-1]&1||X==(K.s<0?8:7)),k<1||!P[0])N=V?ea(D.charAt(1),-I,D.charAt(0)):D.charAt(0);else{if(P.length=k,V)for(--B;++P[--k]>B;)P[k]=0,k||(++j,P=[1].concat(P));for(U=P.length;!P[--U];);for(ue=0,N="";ue<=U;N+=D.charAt(P[ue++]));N=ea(N,j,D.charAt(0))}return N}})(),t=(function(){function w(F,B,q){var z,D,k,j,U=0,V=F.length,K=B%Qa,P=B/Qa|0;for(F=F.slice();V--;)k=F[V]%Qa,j=F[V]/Qa|0,z=P*k+j*K,D=K*k+z%Qa*Qa+U,U=(D/q|0)+(z/Qa|0)+P*j,F[V]=D%q;return U&&(F=[U].concat(F)),F}function A(F,B,q,z){var D,k;if(q!=z)k=q>z?1:-1;else for(D=k=0;D<q;D++)if(F[D]!=B[D]){k=F[D]>B[D]?1:-1;break}return k}function N(F,B,q,z){for(var D=0;q--;)F[q]-=D,D=F[q]<B[q]?1:0,F[q]=D*z+F[q]-B[q];for(;!F[0]&&F.length>1;F.splice(0,1));}return function(F,B,q,z,D){var k,j,U,V,K,P,re,ue,I,X,ce,he,Te,Oe,Ae,be,_e,Pe=F.s==B.s?1:-1,at=F.c,H=B.c;if(!at||!at[0]||!H||!H[0])return new x(!F.s||!B.s||(at?H&&at[0]==H[0]:!H)?NaN:at&&at[0]==0||!H?Pe*0:Pe/0);for(ue=new x(Pe),I=ue.c=[],j=F.e-B.e,Pe=q+j+1,D||(D=Xs,j=Bs(F.e/Ze)-Bs(B.e/Ze),Pe=Pe/Ze|0),U=0;H[U]==(at[U]||0);U++);if(H[U]>(at[U]||0)&&j--,Pe<0)I.push(1),V=!0;else{for(Oe=at.length,be=H.length,U=0,Pe+=2,K=Us(D/(H[0]+1)),K>1&&(H=w(H,K,D),at=w(at,K,D),be=H.length,Oe=at.length),Te=be,X=at.slice(0,be),ce=X.length;ce<be;X[ce++]=0);_e=H.slice(),_e=[0].concat(_e),Ae=H[0],H[1]>=D/2&&Ae++;do{if(K=0,k=A(H,X,be,ce),k<0){if(he=X[0],be!=ce&&(he=he*D+(X[1]||0)),K=Us(he/Ae),K>1)for(K>=D&&(K=D-1),P=w(H,K,D),re=P.length,ce=X.length;A(P,X,re,ce)==1;)K--,N(P,be<re?_e:H,re,D),re=P.length,k=1;else K==0&&(k=K=1),P=H.slice(),re=P.length;if(re<ce&&(P=[0].concat(P)),N(X,P,ce,D),ce=X.length,k==-1)for(;A(H,X,be,ce)<1;)K++,N(X,be<ce?_e:H,ce,D),ce=X.length}else k===0&&(K++,X=[0]);I[U++]=K,X[0]?X[ce++]=at[Te]||0:(X=[at[Te]],ce=1)}while((Te++<Oe||X[0]!=null)&&Pe--);V=X[0]!=null,I[0]||I.splice(0,1)}if(D==Xs){for(U=1,Pe=I[0];Pe>=10;Pe/=10,U++);G(ue,q+(ue.e=U+j*Ze-1)+1,z,V)}else ue.e=j,ue.r=+V;return ue}})();function W(w,A,N,F){var B,q,z,D,k;if(N==null?N=d:$t(N,0,8),!w.c)return w.toString();if(B=w.c[0],z=w.e,A==null)k=Ds(w.c),k=F==1||F==2&&(z<=p||z>=m)?ch(k,z):ea(k,z,"0");else if(w=G(new x(w),A,N),q=w.e,k=Ds(w.c),D=k.length,F==1||F==2&&(A<=q||q<=p)){for(;D<A;k+="0",D++);k=ch(k,q)}else if(A-=z,k=ea(k,q,"0"),q+1>D){if(--A>0)for(k+=".";A--;k+="0");}else if(A+=q-D,A>0)for(q+1==D&&(k+=".");A--;k+="0");return w.s<0&&B?"-"+k:k}function oe(w,A){for(var N,F,B=1,q=new x(w[0]);B<w.length;B++)F=new x(w[B]),(!F.s||(N=Wi(q,F))===A||N===0&&q.s===A)&&(q=F);return q}function me(w,A,N){for(var F=1,B=A.length;!A[--B];A.pop());for(B=A[0];B>=10;B/=10,F++);return(N=F+N*Ze-1)>y?w.c=w.e=null:N<g?w.c=[w.e=0]:(w.e=N,w.c=A),w}r=(function(){var w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,A=/^([^.]+)\.$/,N=/^\.([^.]+)$/,F=/^-?(Infinity|NaN)$/,B=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(q,z,D,k){var j,U=D?z:z.replace(B,"");if(F.test(U))q.s=isNaN(U)?null:U<0?-1:1;else{if(!D&&(U=U.replace(w,function(V,K,P){return j=(P=P.toLowerCase())=="x"?16:P=="b"?2:8,!k||k==j?K:V}),k&&(j=k,U=U.replace(A,"$1").replace(N,"0.$1")),z!=U))return new x(U,j);if(x.DEBUG)throw Error(ss+"Not a"+(k?" base "+k:"")+" number: "+z);q.s=null}q.c=q.e=null}})();function G(w,A,N,F){var B,q,z,D,k,j,U,V=w.c,K=My;if(V){e:{for(B=1,D=V[0];D>=10;D/=10,B++);if(q=A-B,q<0)q+=Ze,z=A,k=V[j=0],U=Us(k/K[B-z-1]%10);else if(j=Ry((q+1)/Ze),j>=V.length)if(F){for(;V.length<=j;V.push(0));k=U=0,B=1,q%=Ze,z=q-Ze+1}else break e;else{for(k=D=V[j],B=1;D>=10;D/=10,B++);q%=Ze,z=q-Ze+B,U=z<0?0:Us(k/K[B-z-1]%10)}if(F=F||A<0||V[j+1]!=null||(z<0?k:k%K[B-z-1]),F=N<4?(U||F)&&(N==0||N==(w.s<0?3:2)):U>5||U==5&&(N==4||F||N==6&&(q>0?z>0?k/K[B-z]:0:V[j-1])%10&1||N==(w.s<0?8:7)),A<1||!V[0])return V.length=0,F?(A-=w.e+1,V[0]=K[(Ze-A%Ze)%Ze],w.e=-A||0):V[0]=w.e=0,w;if(q==0?(V.length=j,D=1,j--):(V.length=j+1,D=K[Ze-q],V[j]=z>0?Us(k/K[B-z]%K[z])*D:0),F)for(;;)if(j==0){for(q=1,z=V[0];z>=10;z/=10,q++);for(z=V[0]+=D,D=1;z>=10;z/=10,D++);q!=D&&(w.e++,V[0]==Xs&&(V[0]=1));break}else{if(V[j]+=D,V[j]!=Xs)break;V[j--]=0,D=1}for(q=V.length;V[--q]===0;V.pop());}w.e>y?w.c=w.e=null:w.e<g&&(w.c=[w.e=0])}return w}function J(w){var A,N=w.e;return N===null?w.toString():(A=Ds(w.c),A=N<=p||N>=m?ch(A,N):ea(A,N,"0"),w.s<0?"-"+A:A)}return i.absoluteValue=i.abs=function(){var w=new x(this);return w.s<0&&(w.s=1),w},i.comparedTo=function(w,A){return Wi(this,new x(w,A))},i.decimalPlaces=i.dp=function(w,A){var N,F,B,q=this;if(w!=null)return $t(w,0,wn),A==null?A=d:$t(A,0,8),G(new x(q),w+q.e+1,A);if(!(N=q.c))return null;if(F=((B=N.length-1)-Bs(this.e/Ze))*Ze,B=N[B])for(;B%10==0;B/=10,F--);return F<0&&(F=0),F},i.dividedBy=i.div=function(w,A){return t(this,new x(w,A),u,d)},i.dividedToIntegerBy=i.idiv=function(w,A){return t(this,new x(w,A),0,1)},i.exponentiatedBy=i.pow=function(w,A){var N,F,B,q,z,D,k,j,U,V=this;if(w=new x(w),w.c&&!w.isInteger())throw Error(ss+"Exponent not an integer: "+J(w));if(A!=null&&(A=new x(A)),D=w.e>14,!V.c||!V.c[0]||V.c[0]==1&&!V.e&&V.c.length==1||!w.c||!w.c[0])return U=new x(Math.pow(+J(V),D?w.s*(2-oh(w)):+J(w))),A?U.mod(A):U;if(k=w.s<0,A){if(A.c?!A.c[0]:!A.s)return new x(NaN);F=!k&&V.isInteger()&&A.isInteger(),F&&(V=V.mod(A))}else{if(w.e>9&&(V.e>0||V.e<-1||(V.e==0?V.c[0]>1||D&&V.c[1]>=24e7:V.c[0]<8e13||D&&V.c[0]<=9999975e7)))return q=V.s<0&&oh(w)?-0:0,V.e>-1&&(q=1/q),new x(k?1/q:q);O&&(q=Ry(O/Ze+2))}for(D?(N=new x(.5),k&&(w.s=1),j=oh(w)):(B=Math.abs(+J(w)),j=B%2),U=new x(c);;){if(j){if(U=U.times(V),!U.c)break;q?U.c.length>q&&(U.c.length=q):F&&(U=U.mod(A))}if(B){if(B=Us(B/2),B===0)break;j=B%2}else if(w=w.times(N),G(w,w.e+1,1),w.e>14)j=oh(w);else{if(B=+J(w),B===0)break;j=B%2}V=V.times(V),q?V.c&&V.c.length>q&&(V.c.length=q):F&&(V=V.mod(A))}return F?U:(k&&(U=c.div(U)),A?U.mod(A):q?G(U,O,d,z):U)},i.integerValue=function(w){var A=new x(this);return w==null?w=d:$t(w,0,8),G(A,A.e+1,w)},i.isEqualTo=i.eq=function(w,A){return Wi(this,new x(w,A))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(w,A){return Wi(this,new x(w,A))>0},i.isGreaterThanOrEqualTo=i.gte=function(w,A){return(A=Wi(this,new x(w,A)))===1||A===0},i.isInteger=function(){return!!this.c&&Bs(this.e/Ze)>this.c.length-2},i.isLessThan=i.lt=function(w,A){return Wi(this,new x(w,A))<0},i.isLessThanOrEqualTo=i.lte=function(w,A){return(A=Wi(this,new x(w,A)))===-1||A===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(w,A){var N,F,B,q,z=this,D=z.s;if(w=new x(w,A),A=w.s,!D||!A)return new x(NaN);if(D!=A)return w.s=-A,z.plus(w);var k=z.e/Ze,j=w.e/Ze,U=z.c,V=w.c;if(!k||!j){if(!U||!V)return U?(w.s=-A,w):new x(V?z:NaN);if(!U[0]||!V[0])return V[0]?(w.s=-A,w):new x(U[0]?z:d==3?-0:0)}if(k=Bs(k),j=Bs(j),U=U.slice(),D=k-j){for((q=D<0)?(D=-D,B=U):(j=k,B=V),B.reverse(),A=D;A--;B.push(0));B.reverse()}else for(F=(q=(D=U.length)<(A=V.length))?D:A,D=A=0;A<F;A++)if(U[A]!=V[A]){q=U[A]<V[A];break}if(q&&(B=U,U=V,V=B,w.s=-w.s),A=(F=V.length)-(N=U.length),A>0)for(;A--;U[N++]=0);for(A=Xs-1;F>D;){if(U[--F]<V[F]){for(N=F;N&&!U[--N];U[N]=A);--U[N],U[F]+=Xs}U[F]-=V[F]}for(;U[0]==0;U.splice(0,1),--j);return U[0]?me(w,U,j):(w.s=d==3?-1:1,w.c=[w.e=0],w)},i.modulo=i.mod=function(w,A){var N,F,B=this;return w=new x(w,A),!B.c||!w.s||w.c&&!w.c[0]?new x(NaN):!w.c||B.c&&!B.c[0]?new x(B):(E==9?(F=w.s,w.s=1,N=t(B,w,0,3),w.s=F,N.s*=F):N=t(B,w,0,E),w=B.minus(N.times(w)),!w.c[0]&&E==1&&(w.s=B.s),w)},i.multipliedBy=i.times=function(w,A){var N,F,B,q,z,D,k,j,U,V,K,P,re,ue,I,X=this,ce=X.c,he=(w=new x(w,A)).c;if(!ce||!he||!ce[0]||!he[0])return!X.s||!w.s||ce&&!ce[0]&&!he||he&&!he[0]&&!ce?w.c=w.e=w.s=null:(w.s*=X.s,!ce||!he?w.c=w.e=null:(w.c=[0],w.e=0)),w;for(F=Bs(X.e/Ze)+Bs(w.e/Ze),w.s*=X.s,k=ce.length,V=he.length,k<V&&(re=ce,ce=he,he=re,B=k,k=V,V=B),B=k+V,re=[];B--;re.push(0));for(ue=Xs,I=Qa,B=V;--B>=0;){for(N=0,K=he[B]%I,P=he[B]/I|0,z=k,q=B+z;q>B;)j=ce[--z]%I,U=ce[z]/I|0,D=P*j+U*K,j=K*j+D%I*I+re[q]+N,N=(j/ue|0)+(D/I|0)+P*U,re[q--]=j%ue;re[q]=N}return N?++F:re.splice(0,1),me(w,re,F)},i.negated=function(){var w=new x(this);return w.s=-w.s||null,w},i.plus=function(w,A){var N,F=this,B=F.s;if(w=new x(w,A),A=w.s,!B||!A)return new x(NaN);if(B!=A)return w.s=-A,F.minus(w);var q=F.e/Ze,z=w.e/Ze,D=F.c,k=w.c;if(!q||!z){if(!D||!k)return new x(B/0);if(!D[0]||!k[0])return k[0]?w:new x(D[0]?F:B*0)}if(q=Bs(q),z=Bs(z),D=D.slice(),B=q-z){for(B>0?(z=q,N=k):(B=-B,N=D),N.reverse();B--;N.push(0));N.reverse()}for(B=D.length,A=k.length,B-A<0&&(N=k,k=D,D=N,A=B),B=0;A;)B=(D[--A]=D[A]+k[A]+B)/Xs|0,D[A]=Xs===D[A]?0:D[A]%Xs;return B&&(D=[B].concat(D),++z),me(w,D,z)},i.precision=i.sd=function(w,A){var N,F,B,q=this;if(w!=null&&w!==!!w)return $t(w,1,wn),A==null?A=d:$t(A,0,8),G(new x(q),w,A);if(!(N=q.c))return null;if(B=N.length-1,F=B*Ze+1,B=N[B]){for(;B%10==0;B/=10,F--);for(B=N[0];B>=10;B/=10,F++);}return w&&q.e+1>F&&(F=q.e+1),F},i.shiftedBy=function(w){return $t(w,-jy,jy),this.times("1e"+w)},i.squareRoot=i.sqrt=function(){var w,A,N,F,B,q=this,z=q.c,D=q.s,k=q.e,j=u+4,U=new x("0.5");if(D!==1||!z||!z[0])return new x(!D||D<0&&(!z||z[0])?NaN:z?q:1/0);if(D=Math.sqrt(+J(q)),D==0||D==1/0?(A=Ds(z),(A.length+k)%2==0&&(A+="0"),D=Math.sqrt(+A),k=Bs((k+1)/2)-(k<0||k%2),D==1/0?A="5e"+k:(A=D.toExponential(),A=A.slice(0,A.indexOf("e")+1)+k),N=new x(A)):N=new x(D+""),N.c[0]){for(k=N.e,D=k+j,D<3&&(D=0);;)if(B=N,N=U.times(B.plus(t(q,B,j,1))),Ds(B.c).slice(0,D)===(A=Ds(N.c)).slice(0,D))if(N.e<k&&--D,A=A.slice(D-3,D+1),A=="9999"||!F&&A=="4999"){if(!F&&(G(B,B.e+u+2,0),B.times(B).eq(q))){N=B;break}j+=4,D+=4,F=1}else{(!+A||!+A.slice(1)&&A.charAt(0)=="5")&&(G(N,N.e+u+2,1),w=!N.times(N).eq(q));break}}return G(N,N.e+u+1,d,w)},i.toExponential=function(w,A){return w!=null&&($t(w,0,wn),w++),W(this,w,A,1)},i.toFixed=function(w,A){return w!=null&&($t(w,0,wn),w=w+this.e+1),W(this,w,A)},i.toFormat=function(w,A,N){var F,B=this;if(N==null)w!=null&&A&&typeof A=="object"?(N=A,A=null):w&&typeof w=="object"?(N=w,w=A=null):N=C;else if(typeof N!="object")throw Error(ss+"Argument not an object: "+N);if(F=B.toFixed(w,A),B.c){var q,z=F.split("."),D=+N.groupSize,k=+N.secondaryGroupSize,j=N.groupSeparator||"",U=z[0],V=z[1],K=B.s<0,P=K?U.slice(1):U,re=P.length;if(k&&(q=D,D=k,k=q,re-=q),D>0&&re>0){for(q=re%D||D,U=P.substr(0,q);q<re;q+=D)U+=j+P.substr(q,D);k>0&&(U+=j+P.slice(q)),K&&(U="-"+U)}F=V?U+(N.decimalSeparator||"")+((k=+N.fractionGroupSize)?V.replace(new RegExp("\\d{"+k+"}\\B","g"),"$&"+(N.fractionGroupSeparator||"")):V):U}return(N.prefix||"")+F+(N.suffix||"")},i.toFraction=function(w){var A,N,F,B,q,z,D,k,j,U,V,K,P=this,re=P.c;if(w!=null&&(D=new x(w),!D.isInteger()&&(D.c||D.s!==1)||D.lt(c)))throw Error(ss+"Argument "+(D.isInteger()?"out of range: ":"not an integer: ")+J(D));if(!re)return new x(P);for(A=new x(c),j=N=new x(c),F=k=new x(c),K=Ds(re),q=A.e=K.length-P.e-1,A.c[0]=My[(z=q%Ze)<0?Ze+z:z],w=!w||D.comparedTo(A)>0?q>0?A:j:D,z=y,y=1/0,D=new x(K),k.c[0]=0;U=t(D,A,0,1),B=N.plus(U.times(F)),B.comparedTo(w)!=1;)N=F,F=B,j=k.plus(U.times(B=j)),k=B,A=D.minus(U.times(B=A)),D=B;return B=t(w.minus(N),F,0,1),k=k.plus(B.times(j)),N=N.plus(B.times(F)),k.s=j.s=P.s,q=q*2,V=t(j,F,q,d).minus(P).abs().comparedTo(t(k,N,q,d).minus(P).abs())<1?[j,F]:[k,N],y=z,V},i.toNumber=function(){return+J(this)},i.toPrecision=function(w,A){return w!=null&&$t(w,1,wn),W(this,w,A,2)},i.toString=function(w){var A,N=this,F=N.s,B=N.e;return B===null?F?(A="Infinity",F<0&&(A="-"+A)):A="NaN":(w==null?A=B<=p||B>=m?ch(Ds(N.c),B):ea(Ds(N.c),B,"0"):w===10&&$?(N=G(new x(N),u+B+1,d),A=ea(Ds(N.c),N.e,"0")):($t(w,2,R.length,"Base"),A=s(ea(Ds(N.c),B,"0"),10,w,F,!0)),F<0&&N.c[0]&&(A="-"+A)),A},i.valueOf=i.toJSON=function(){return J(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&x.set(e),x}function Bs(e){var t=e|0;return e>0||e===t?t:t-1}function Ds(e){for(var t,s,r=1,i=e.length,c=e[0]+"";r<i;){for(t=e[r++]+"",s=Ze-t.length;s--;t="0"+t);c+=t}for(i=c.length;c.charCodeAt(--i)===48;);return c.slice(0,i+1||1)}function Wi(e,t){var s,r,i=e.c,c=t.c,u=e.s,d=t.s,p=e.e,m=t.e;if(!u||!d)return null;if(s=i&&!i[0],r=c&&!c[0],s||r)return s?r?0:-d:u;if(u!=d)return u;if(s=u<0,r=p==m,!i||!c)return r?0:!i^s?1:-1;if(!r)return p>m^s?1:-1;for(d=(p=i.length)<(m=c.length)?p:m,u=0;u<d;u++)if(i[u]!=c[u])return i[u]>c[u]^s?1:-1;return p==m?0:p>m^s?1:-1}function $t(e,t,s,r){if(e<t||e>s||e!==Us(e))throw Error(ss+(r||"Argument")+(typeof e=="number"?e<t||e>s?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function oh(e){var t=e.c.length-1;return Bs(e.e/Ze)==t&&e.c[t]%2!=0}function ch(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ea(e,t,s){var r,i;if(t<0){for(i=s+".";++t;i+=s);e=i+e}else if(r=e.length,++t>r){for(i=s,t-=r;--t;i+=s);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}rN();const dq="2.0.12",aN={version:dq},fq=aN.version,hq=()=>{if(typeof process<"u"&&process.versions&&process.versions.node){const e=process.version;return`Node.js ${e.startsWith("v")?e.substring(1):e}`}return"Node/Unknown"},pq=()=>{let e="";return typeof process<"u"&&process.versions&&process.versions.node&&(e=`lending/${fq} (${hq()})`),e},C4=pq(),mq="https://fullnode.mainnet.sui.io:443";let Dy;function gq(){return Dy||(Dy=new bb({network:"mainnet",transport:new lb({baseUrl:mq})})),Dy}function yq(e,t="mainnet"){return gq()}const vq=16*1024;function u1(e){return e.replace(/^0x/i,"")}function I4(e){const t=u1(e),s=new Uint8Array(t.length/2);for(let r=0;r<s.length;r+=1)s[r]=parseInt(t.slice(r*2,r*2+2),16);return s}function bq(e,t){return(e[t]<<8)+e[t+1]}function R4(e){return M.vector(M.U8).serialize(Array.from(e),{maxSize:vq})}function j4(e,t){return{type:e,bcs:t}}function wq(e){return M.vector(M.U8).serialize(Array.from(new TextEncoder().encode(e))).toBytes()}function Tq(e){return M.struct("PriceIdentifier",{bytes:M.vector(M.U8)}).serialize({bytes:Array.from(e)}).toBytes()}function Sq(e){const t=[];let s=0,r=0;for(let i=0;i<e.length;i+=1){const c=e[i];c==="<"?s+=1:c===">"?s-=1:c===","&&s===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}function Eq(e){const t=e.indexOf("::table::Table"),s=e.indexOf("<",t),r=e.lastIndexOf(">"),i="::price_identifier::PriceIdentifier";if(t<0||s<0||r<=s)throw new Error(`Unexpected Pyth price table type: ${e}`);const[c,u]=Sq(e.slice(s+1,r));if(!c?.endsWith(i)||!u?.endsWith("::object::ID"))throw new Error(`Unexpected Pyth price table type arguments: ${e}`);return c.slice(0,-i.length)}function _q(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}class iN{constructor(t,s){this.endpoint=t.replace(/\/$/,""),this.timeout=s?.timeout??1e4}async getLatestPriceFeeds(t){return(await this.get("/api/latest_price_feeds",t)).map(s=>({id:s.id,getPriceUnchecked:()=>({price:s.price.price,conf:s.price.conf,expo:s.price.expo,publishTime:s.price.publish_time})}))}async getPriceFeedsUpdateData(t){const s=await this.get("/v2/updates/price/latest",t,{encoding:"base64",parsed:"false"}),r=s.binary?.encoding,i=s.binary?.data??[];if(r&&r!=="base64")throw new Error(`Unsupported Hermes price update encoding: ${r}`);if(i.length===0)throw new Error("Hermes price update response did not include binary update data");return i.map(_q)}async get(t,s,r){const i=new AbortController,c=setTimeout(()=>i.abort(),this.timeout),u=new URL(`${this.endpoint}${t}`);for(const[d,p]of Object.entries(r??{}))u.searchParams.set(d,p);for(const d of s)u.searchParams.append("ids[]",u1(d));try{const d=await fetch(u,{signal:i.signal});if(!d.ok)throw new Error(`Hermes request failed: ${d.status} ${d.statusText}`);return await d.json()}finally{clearTimeout(c)}}}class kq{constructor(t,s,r){this.provider=t,this.pythStateId=s,this.wormholeStateId=r,this.priceFeedObjectIdCache=new Map}getCoreProvider(){const t=this.provider.core;return t&&typeof t.getObject=="function"&&typeof t.getDynamicObjectField=="function"&&typeof t.getDynamicField=="function"?t:null}async getMoveObjectJson(t){const s=this.getCoreProvider();if(s){const i=await s.getObject({objectId:t,include:{json:!0}});return i.object?{objectId:i.object.objectId,type:i.object.type,fields:i.object.json}:null}if(!this.provider.getObject)throw new Error("Sui Pyth provider does not support getObject");const r=await this.provider.getObject({id:t,options:{showContent:!0}});return!r.data||!r.data.content||r.data.content.dataType!=="moveObject"?null:{objectId:r.data.objectId,type:r.data.type,fields:r.data.content.fields}}async getDynamicMoveObjectJson(t,s){const r=this.getCoreProvider();if(r){const c=await r.getDynamicObjectField({parentId:t,name:s,include:{json:!0}});return c.object?{objectId:c.object.objectId,type:c.object.type,fields:c.object.json}:null}if(!this.provider.getDynamicFieldObject)throw new Error("Sui Pyth provider does not support getDynamicFieldObject");const i=await this.provider.getDynamicFieldObject({parentId:t,name:s});return i.data?i.data.content?i.data.content.dataType!=="moveObject"?null:{objectId:i.data.objectId,type:i.data.type,fields:i.data.content.fields}:{objectId:i.data.objectId,type:i.data.type,fields:void 0}:null}async updatePriceFeeds(t,s,r,i){const c=await this.getPythPackageId(),u=await this.verifyVaasAndGetHotPotato(t,s,c),d=await this.getBaseUpdateFee(),p=t.splitCoins(i?.feeCoin??t.gas,r.map(()=>t.pure.u64(d)));return this.executePriceFeedUpdates(t,c,r,u,p)}async getBaseUpdateFee(){if(this.baseUpdateFee===void 0){const t=await this.getMoveObjectJson(this.pythStateId);if(!t?.fields)throw new Error("Unable to fetch pyth state object");this.baseUpdateFee=Number(t.fields.base_update_fee)}return this.baseUpdateFee}async getPackageId(t){const s=await this.getMoveObjectJson(t);if(s?.fields){const r=s.fields;if("upgrade_cap"in r){const i=r.upgrade_cap,c=i?.package??i?.fields?.package;if(c)return c}}throw new Error(`Cannot fetch package id for object ${t}`)}async verifyVaas(t,s){const r=await this.getWormholePackageId();return t.map(i=>{const[c]=s.moveCall({target:`${r}::vaa::parse_and_verify`,arguments:[s.object(this.wormholeStateId),s.pure(R4(i)),s.object(dh)]});return c})}async verifyVaasAndGetHotPotato(t,s,r){if(s.length>1)throw new Error("SDK does not support sending multiple accumulator messages in a single transaction");const i=this.extractVaaBytesFromAccumulatorMessage(s[0]),[c]=await this.verifyVaas([i],t),[u]=t.moveCall({target:`${r}::pyth::create_authenticated_price_infos_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(R4(s[0])),c,t.object(dh)]});return u}async executePriceFeedUpdates(t,s,r,i,c){const u=[];for(const[d,p]of r.entries()){const m=await this.getPriceFeedObjectId(p);if(!m)throw new Error(`Price feed ${p} not found, please create it first`);u.push(m),[i]=t.moveCall({target:`${s}::pyth::update_single_price_feed`,arguments:[t.object(this.pythStateId),i,t.object(m),c[d],t.object(dh)]})}return t.moveCall({target:`${s}::hot_potato_vector::destroy`,arguments:[i],typeArguments:[`${s}::price_info::PriceInfo`]}),u}async getWormholePackageId(){return this.wormholePackageId||(this.wormholePackageId=await this.getPackageId(this.wormholeStateId)),this.wormholePackageId}async getPythPackageId(){return this.pythPackageId||(this.pythPackageId=await this.getPackageId(this.pythStateId)),this.pythPackageId}async getPriceFeedObjectId(t){const s=u1(t);if(!this.priceFeedObjectIdCache.has(s)){const{id:r,fieldType:i}=await this.getPriceTableInfo(),c=`${i}::price_identifier::PriceIdentifier`,u=this.getCoreProvider();if(u){const{dynamicField:d}=await u.getDynamicField({parentId:r,name:j4(c,Tq(I4(s)))}),p=d?.value?.bcs;this.priceFeedObjectIdCache.set(s,p&&p.length===32?M.Address.parse(Uint8Array.from(p)):void 0)}else{const d=await this.getDynamicMoveObjectJson(r,{type:c,value:{bytes:Array.from(I4(s))}});d?.fields?this.priceFeedObjectIdCache.set(s,d.fields.value):this.priceFeedObjectIdCache.set(s,void 0)}}return this.priceFeedObjectIdCache.get(s)}async getPriceTableInfo(){if(!this.priceTableInfo){const t=this.getCoreProvider()?j4("vector<u8>",wq("price_info")):{type:"vector<u8>",value:"price_info"},s=await this.getDynamicMoveObjectJson(this.pythStateId,t);if(!s?.type)throw new Error("Price Table not found, contract may not be initialized");this.priceTableInfo={id:s.objectId,fieldType:Eq(s.type)}}return this.priceTableInfo}extractVaaBytesFromAccumulatorMessage(t){const s=7+t[6]+1,r=bq(t,s),i=s+2;return t.subarray(i,i+r)}}const Aq="https://open-api.naviprotocol.io/api";let Oq={},Nq=0;function xq(e){return e.replace(/\/+$/,"")}function M4(){return Nq}function oN(e){const t=e?.services?.naviOpenApi??Oq.services?.naviOpenApi;return{baseUrl:xq(t?.baseUrl??Aq),headers:t?.headers}}function Cq(e,t){const s=oN(t),r=e.startsWith("/")?e:`/${e}`;return`${s.baseUrl}${r}`}function Iq(e){if(e instanceof Headers){const t={};return e.forEach((s,r)=>{t[r]=s}),t}return Array.isArray(e)?Object.fromEntries(e):e}function Rq(e,t){return{...Iq(e),...t?.headers??{}}}const cN=yq();function jq(e){return{json:!!e?.showContent,display:!!e?.showDisplay,previousTransaction:!!e?.showPreviousTransaction,objectBcs:!!e?.showBcs}}function Mq(e){return!e||e instanceof Error?{error:e instanceof Error?{code:"notFound",error:e.message}:void 0}:{data:{objectId:e.objectId,version:e.version,digest:e.digest,type:e.type,owner:e.owner,previousTransaction:e.previousTransaction,content:e.json===void 0?void 0:{dataType:"moveObject",type:e.type,fields:e.json},display:e.display}}}async function Dq(e,t){const s=e?.core;if(typeof s?.getObjects!="function")throw new Error("multiGetSuiObjects requires a Sui v2 Core-capable client");const{objects:r}=await s.getObjects({objectIds:t.ids,include:jq(t.options)});return r.map(Mq)}function lN(e){const t=[];let s=!1;return e.forEach((r,i)=>{const c=i===e.length-1;if(typeof r=="object"&&r!==null&&c){const{client:u,disableCache:d,cacheTime:p,...m}=r;m.__naviSdkServiceConfigVersion=M4(),t.push(m),s=!0}else t.push(r)}),s||t.push({__naviSdkServiceConfigVersion:M4()}),JSON.stringify(t)}function Uq(e){const t={};return(...s)=>{const r=lN(s);return t[r]||(t[r]=e(...s).finally(()=>{delete t[r]})),t[r]}}function Bq(e){let t={};return(...s)=>{const r=s[s.length-1],i=lN(s),c=t[i];return!r?.disableCache&&typeof c?.data<"u"&&(typeof r?.cacheTime>"u"||r.cacheTime>Date.now()-c.cacheAt)?Promise.resolve(c.data):e(...s).then(u=>(t[i]={data:u,cacheAt:Date.now()},u))}}new iN("https://hermes.pyth.network",{timeout:2e4});const Lq=C4?{"User-Agent":C4}:{},zq="main",$q={main:{id:0,key:"main",name:"Main Market"},ember:{id:1,key:"ember",name:"eACRED / USDC Market"},rwa:{id:2,key:"rwa",name:"Matrixdock Market"},"sui-eco":{id:3,key:"sui-eco",name:"Sui Eco Market"},"sui-usdc":{id:4,key:"sui-usdc",name:"SUI / USDC Market"},"wbtc-usdc":{id:5,key:"wbtc-usdc",name:"WBTC / USDC Market"},"xbtc-usdc":{id:6,key:"xbtc-usdc",name:"xBTC / USDC Market"},"vsui-usdc":{id:7,key:"vsui-usdc",name:"vSUI / USDC Market"},"vsui-sui":{id:8,key:"vsui-sui",name:"vSUI / SUI Market"},"hasui-sui":{id:9,key:"hasui-sui",name:"haSUI / SUI Market"},"high-usdc":{id:10,key:"high-usdc",name:"HIGH / USDC Market"}},Vq=e=>{const t=Object.values($q).find(s=>typeof e=="number"?s.id===e:typeof e=="string"?s.key===e:s.id===e.id);if(!t)throw new Error("Market not found");return t},d1=Bq(Uq(async e=>{const t=Vq(e?.market||zq),s=oN(e),r=Cq(`/navi/config?env=${e?.env||"prod"}&sdk=${aN.version}&market=${t.key}`,e);return(await fetch(r,{headers:Rq(Lq,s)}).then(i=>i.json())).data})),f1=1e3*60*5,D4=new Map,Pq=e=>{const t=e??"https://hermes.pyth.network";let s=D4.get(t);return s||(s=new iN(t,{timeout:1e4}),D4.set(t,s)),s};async function Gq(e,t){const s=[],r=t?.client??cN,i=e.map(u=>u.priceInfoObject),c=await Dq(r,{ids:Array.from(new Set(i)),options:{showContent:!0}});for(const u of c){const d=u.data;if(!d||!d.content||d.content.dataType!=="moveObject"){console.warn(`fetched object ${d?.objectId} datatype should be moveObject`);continue}const p=e.find(C=>C.priceInfoObject==d.objectId);if(!p){console.warn(`unable to find pyth info from array, priceInfoObject: ${d.objectId}`);continue}const m=d.content.fields?.price_info?.price_feed?.price,g=m?.price;if(!g){console.warn(`unexpected pyth price struct, priceInfoObject: ${d.objectId}`);continue}const{magnitude:y,negative:b}=g,E=m.conf,O=m.timestamp;s.push({priceFeedId:p.priceFeedId,priceInfoObject:p.priceInfoObject,price:b?"-"+y:y,conf:E,publishTime:Number(O),expiration:p.expiration})}return s}async function Fq(e,t){try{const s=[],r=await Gq(e,t);if(!r)return s;const i=Math.floor(new Date().valueOf()/1e3);for(const c of r){if(c.publishTime>i){console.warn(`pyth price feed is invalid, id: ${c.priceFeedId}, publish time: ${c.publishTime}, current timestamp: ${i}`);continue}const u=c.expiration||60;i-c.publishTime>u&&(console.info(`stale price feed, id: ${c.priceFeedId}, publish time: ${c.publishTime}, current timestamp: ${i}`),s.push(c.priceFeedId))}return s}catch(s){throw new Error(`failed to get pyth stale price feed id, msg: ${s.message}`)}}async function Hq(e,t,s){const r=s?.client??cN,i=await d1({...s,cacheTime:f1});try{const c=await Pq(i.oracle.hermesEndpoint).getPriceFeedsUpdateData(t);return await new kq(r,i.oracle.pythStateId,i.oracle.wormholeStateId).updatePriceFeeds(e,c,t,{feeCoin:s?.pythFeeCoin})}catch(c){throw new Error(`failed to update pyth price feeds, msg: ${c.message}`)}}async function qq(e,t,s){const r=await d1({...s,cacheTime:f1});if(s?.updatePythPriceFeeds){const i=t.filter(u=>!!u.pythPriceFeedId&&!!u.pythPriceInfoObject).map(u=>({priceFeedId:u.pythPriceFeedId,priceInfoObject:u.pythPriceInfoObject,expiration:30})),c=await Fq(i,s);c.length>0&&await Hq(e,c,s)}for(const i of t)e.moveCall({target:`${r.oracle.packageId}::oracle_pro::${r.oracle.updateFunction??"update_single_price_v2"}`,arguments:[e.object("0x6"),e.object(r.oracle.oracleConfig),e.object(r.oracle.priceOracle),e.object(r.oracle.supraOracleHolder),e.object(i.pythPriceInfoObject),e.object(r.oracle.switchboardAggregator),e.pure.address(i.feedId)]});return e}async function Zq(e){return(await d1({...e,cacheTime:f1})).oracle.feeds}const Yq="0x6",Wq="0x5";async function h1(e,t){if(t.network!=="mainnet")return;const s=Object.keys(t.protocols.navi.reserves),r=(await Zq({env:"prod"})).filter(i=>s.some(c=>At(c,i.coinType)));await qq(e,r,{env:"prod",client:qt(t),updatePythPriceFeeds:!0})}async function Ep(e,t,s){const r=t.protocols.navi,i=Object.entries(r.reserves),c=new Yn;c.setSender(ye("0x1"));for(const[,g]of i)for(const y of["user_collateral_balance","user_loan_balance"])c.moveCall({target:`${r.publishedAt}::logic::${y}`,arguments:[c.object(r.storageId),c.pure.u8(g.assetId),c.pure.address(s)]});const u=await e.simulateTransaction({transaction:c,include:{commandResults:!0}}),d=u.$kind==="Transaction"?u.Transaction:u.FailedTransaction;if(!d?.status.success)throw new Error(d?.status.error?.message??"Could not read the NAVI position");const p=g=>{const y=u.commandResults?.[g]?.returnValues?.[0]?.bcs;return y?M.u256().parse(y):"0"},m={collateral:{},debt:{}};return i.forEach(([g],y)=>{const b=p(2*y),E=p(2*y+1);b!=="0"&&(m.collateral[De(g)]=b),E!=="0"&&(m.debt[De(g)]=E)}),m}function p1(e,t,s,r,i){const c=t.protocols.navi,u=[];for(const[d,p]of Object.entries(c.reserves)){const m=r.collateral[De(d)];if(!m)continue;const g=(BigInt(m)+BigInt(m)/1000n+1n).toString(),y=e.moveCall({target:`${c.publishedAt}::incentive_v3::withdraw_with_account_cap_v2`,typeArguments:[d],arguments:[e.object(Yq),e.object(c.oracleId),e.object(c.storageId),e.object(p.poolId),e.pure.u8(p.assetId),e.pure.u64(g),e.object(c.incentiveV2Id),e.object(c.incentiveV3Id),s,e.object(Wq)]});u.push(e.moveCall({target:"0x2::coin::from_balance",typeArguments:[d],arguments:[y]}))}u.length&&e.transferObjects(u,i)}const Qu=e=>!!e&&Object.keys(e.collateral).length>0&&Object.keys(e.debt).length===0;async function Xq(e,t,s){const r=`${ye(t.protocols.navi.packageId)}::account::AccountCap`,i=[];let c=null;do{const u=await e.listOwnedObjects({owner:s,cursor:c,limit:50,include:{content:!0}});for(const d of u.objects){const p=Ss(d.type);`${ye(p.address)}::${p.module}::${p.name}`===r&&d.content&&i.push({capId:d.objectId,user:OH(d.content)})}c=u.hasNextPage?u.cursor:null}while(c&&i.length<200);return i}const uN="0x2::allowance::RateLimit",m1="0x6",dN="0x3::staking_pool::StakedSui",am=e=>`0x2::balance::Balance<${e}>`;function fN(e,t,s,r,i){const c=t.publishedAt,u=t.packageId,d=e.object(m1),p=e.object(t.configId),m=(g,y)=>e.moveCall({target:`${c}::pass::add_policy`,typeArguments:[g],arguments:[s,p,y]});for(const g of r.transfers){const y=e.moveCall({target:`${c}::transfer_policy::new`,typeArguments:[g.coin],arguments:[e.pure.u64(g.perTransfer),e.pure.u64(g.daily),d]});for(const b of g.recipients)e.moveCall({target:`${c}::transfer_policy::add_recipient`,typeArguments:[g.coin],arguments:[y,e.pure.string(b.name),e.pure.address(b.address)]});m(`${u}::transfer_policy::TransferPolicy<${g.coin}>`,y)}for(const g of r.swaps)m(`${u}::swap_policy::SwapPolicy<${g.coinIn},${g.coinOut}>`,e.moveCall({target:`${c}::swap_policy::new`,typeArguments:[g.coinIn,g.coinOut],arguments:[e.pure.vector("address",g.pools),e.pure.u64(g.perTrade),e.pure.u64(g.daily),e.pure.u64(g.minPrice),d]}));for(const g of r.lending){const y=t.protocols.navi.reserves[g.coin];if(!y)throw new Error(`NAVI has no reserve for ${g.coin} in this deployment`);m(`${u}::lending_policy::LendingPolicy<${g.coin}>`,e.moveCall({target:`${c}::lending_policy::new`,typeArguments:[g.coin],arguments:[e.pure.id(y.poolId),e.pure.u8(y.assetId),e.pure.bool(g.allowBorrow),e.pure.u64(g.perAction),e.pure.u64(g.daily),e.pure.u256(vH(g.minHealthFactor)),d]}))}r.lending.length&&i&&e.moveCall({target:`${c}::pass::navi_open`,arguments:[s,p]}),r.staking&&m(`${u}::staking_policy::StakingPolicy`,e.moveCall({target:`${c}::staking_policy::new`,arguments:[e.pure.vector("address",r.staking.validators),e.pure.u64(r.staking.perStake),e.pure.u64(r.staking.daily),d]}))}function Kq(e,t,s){e.moveCall({target:"0x2::balance::send_funds",typeArguments:[Lt],arguments:[e.balance({balance:t}),e.pure.address(s)]})}function Jq(e,t,s,r,i){for(const[c,u]of Object.entries(s)){if(BigInt(u)<=0n)continue;const d=t.demoFaucet&&At(t.demoFaucet.coin,c)?t.demoFaucet:null;let p;if(d)p=e.moveCall({target:`${d.packageId}::usdc::mint`,arguments:[e.object(d.faucetId),e.pure.u64(u)]});else if(At(c,Lt))p=e.splitCoins(e.gas,[u])[0];else{const m=r[De(c)]??[];if(!m.length)throw new Error(`No ${c} coin objects to convert`);const[g,...y]=m.map(b=>e.objectRef(b));y.length&&e.mergeCoins(g,y),p=e.splitCoins(g,[u])[0]}e.moveCall({target:"0x2::coin::send_funds",typeArguments:[c],arguments:[p,e.pure.address(i)]})}}function Qq(e,t){const s=e.moveCall({target:"0x2::allowance::periodic_rate_limit",arguments:[e.pure.u64(Tp),e.pure.u256(t)]});return e.moveCall({target:"0x1::option::some",typeArguments:[uN],arguments:[s]})}function hN(e,t,s){e.moveCall({target:"0x2::allowance::new",typeArguments:[am(Lt)],arguments:[e.pure.string(VO),e.pure.address(s),e.pure.option("u256",t.gasCap),e.pure.option("u64",null),e.pure.option("u64",t.expiresMs),Qq(e,t.gasDaily)]})}function eZ(e,t,s,r,i,c={}){const u=new Yn;u.setSender(s);const d=u.moveCall({target:`${e.publishedAt}::pass::create`,arguments:[u.object(e.configId),u.pure.string(t.name),u.pure.address(r),u.pure.u64(t.expiresMs),u.object(m1)]}),p=(m,g)=>pN(u,e,d,t,r,m,g);for(const[m,g]of Object.entries(t.allowances))p(m,g);return hN(u,t,r),fN(u,e,d,t.policy,!0),u.moveCall({target:`${e.publishedAt}::pass::share`,arguments:[d]}),Jq(u,e,i,c,s),Kq(u,t.gasAmount,r),u}function pN(e,t,s,r,i,c,u){e.moveCall({target:`${t.publishedAt}::pass::issue`,typeArguments:[c],arguments:[s,e.object(t.configId),e.moveCall({target:"0x2::allowance::propose_for_app",typeArguments:[am(c),qO(t)],arguments:[e.pure.string(r.name),e.pure.address(i),e.pure.option("u256",u),e.pure.option("u64",null),e.pure.option("u64",r.expiresMs),e.moveCall({target:"0x1::option::none",typeArguments:[uN]})]})]})}function Rh(e,t,s,r){e.moveCall({target:"0x2::allowance::revoke",typeArguments:[am(t)],arguments:[e.object(s),e.object(r)]})}function mN(e,t,s,r){const i=t.publishedAt,c=t.packageId,u=d=>e.moveCall({target:`${i}::pass::remove_policy`,typeArguments:[d],arguments:[s]});for(const d of r.transfers)e.moveCall({target:`${i}::transfer_policy::destroy`,typeArguments:[d.coinType],arguments:[u(`${c}::transfer_policy::TransferPolicy<${d.coinType}>`)]});for(const d of r.swaps)u(`${c}::swap_policy::SwapPolicy<${d.coinIn},${d.coinOut}>`);for(const d of r.lending)u(`${c}::lending_policy::LendingPolicy<${d.coinType}>`);r.staking.length&&u(`${c}::staking_policy::StakingPolicy`)}function tZ(e,t,s,r){const i=new Yn;i.setSender(r);const{active:c,control:u}=t,d=i.object(c.passId),p=u.agent;String(s.expiresMs)!==u.agentExpiresMs&&i.moveCall({target:`${e.publishedAt}::pass::set_term`,arguments:[d,i.object(e.configId),i.pure.u64(s.expiresMs),i.object(m1)]}),mN(i,e,d,u.policies),fN(i,e,d,s.policy,s.policy.lending.length>0&&!u.naviPosition);const m=(g,y,b)=>!!g&&g.lifetimeCap===y&&g.expirationMs===String(s.expiresMs)&&(b===null?g.rateLimit===null:g.rateLimit?.limit===b);for(const[g,y]of Object.entries(s.allowances)){const b=De(g),E=c.allowances[b];E&&m(t.allowances[b]??null,y,null)||(E&&Rh(i,b,E.revokeCap,E.allowance),pN(i,e,d,s,p,b,y))}for(const[g,y]of Object.entries(c.allowances))!(De(g)in s.allowances)&&!Object.keys(s.allowances).some(b=>At(b,g))&&Rh(i,g,y.revokeCap,y.allowance);return m(t.gas,s.gasCap,s.gasDaily)||(Rh(i,Lt,c.gasRevokeCap,c.gasAllowance),hN(i,s,p)),i}function nZ(e,t,s){const r=new Yn;r.setSender(s),r.moveCall({target:`${e.publishedAt}::pass::revoke_agent`,arguments:[r.object(t.passId)]});for(const[i,c,u]of gN(t))r.moveCall({target:"0x2::allowance::revoke",typeArguments:[am(i)],arguments:[r.object(c),r.object(u)]});return r}function gN(e){return[...Object.entries(e.allowances).map(([t,s])=>[t,s.revokeCap,s.allowance]),[Lt,e.gasRevokeCap,e.gasAllowance]]}function yN(e,t,s){const r=e.moveCall({target:`${t.publishedAt}::navi::account_key`});return e.moveCall({target:`${t.publishedAt}::pass::withdraw_object`,typeArguments:[`${t.packageId}::navi::AccountKey`,`${t.protocols.navi.packageId}::account::AccountCap`],arguments:[s,r]})}async function sZ(e,t,s,r=null){const i=new Yn;i.setSender(s),Qu(r)&&await h1(i,e);const c=yN(i,e,i.object(t.passId));return Qu(r)&&p1(i,e,c,r,s),i.transferObjects([c],s),i}function rZ(e,t,s,r,i,c=null){return vN(e,[{pass:t,active:s,control:r,position:c}],i)}async function vN(e,t,s){const r=new Yn;r.setSender(s),t.some(i=>i.control.naviPosition&&Qu(i.position))&&await h1(r,e);for(const i of t)aZ(r,e,i,s);return r}function aZ(e,t,{pass:s,active:r,control:i,position:c},u){const d=t.publishedAt,p=t.packageId,m=e.object(s.passId);if(i.revoked||e.moveCall({target:`${d}::pass::revoke_agent`,arguments:[m]}),r)for(const[y,b,E]of gN(r))Rh(e,y,b,E);mN(e,t,m,i.policies);const g=[];if(i.naviPosition){const y=yN(e,t,m);Qu(c)&&p1(e,t,y,c,u),g.push(y)}for(const y of i.stakes){const b=e.moveCall({target:`${d}::staking::stake_key`,arguments:[e.pure.id(y.id)]});g.push(e.moveCall({target:`${d}::pass::withdraw_object`,typeArguments:[`${p}::staking::StakeKey`,dN],arguments:[m,b]}))}g.length&&e.transferObjects(g,u),e.moveCall({target:`${d}::pass::destroy`,arguments:[m]}),e.moveCall({target:`${d}::pass::burn_receipt`,arguments:[e.object(s.receiptId)]})}function iZ(e,t,s,r){const i=new Yn;i.setSender(s);const c=i.moveCall({target:`${e.packageId}::staking::stake_key`,arguments:[i.pure.id(r)]}),u=i.moveCall({target:`${e.publishedAt}::pass::withdraw_object`,typeArguments:[`${e.packageId}::staking::StakeKey`,dN],arguments:[i.object(t.passId),c]});return i.transferObjects([u],s),i}const Rn=e=>`${e.slice(0,8)}…${e.slice(-6)}`,Rc=e=>`${pd(e,9)} SUI`,oZ=new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}),cZ=e=>`${oZ.format(Number(e))} UTC`,bN=(e,t)=>{if(e===null)return"pending";const s=Math.max(0,Math.floor((t-e)/1e3));return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:`${Math.floor(s/3600)}h ago`},wN=new URLSearchParams(location.search),lZ=wN.has("embed"),U4=wN.has("expose-wallet");function uZ(){const[e,t]=ze.useState(location.hash);ze.useEffect(()=>{const c=()=>t(location.hash);return addEventListener("hashchange",c),()=>removeEventListener("hashchange",c)},[]);const[s="",r="",i=""]=e.replace(/^#\/?/,"").split("/");return{kind:s,value:r,extra:i}}function sa({d:e,kind:t,id:s,children:r}){const i=t==="tx"?YH(e,s):t==="object"?WH(e,s):XH(e,s),c=r??Rn(s);return i?T.jsx("a",{href:i,target:"_blank",rel:"noreferrer",title:s,children:c}):T.jsx("span",{title:s,children:c})}function TN({d:e,attempts:t,now:s,showSender:r}){return t.length===0?T.jsx("p",{className:"empty",children:"Nothing yet."}):T.jsx(T.Fragment,{children:t.map(i=>T.jsxs("div",{className:`attempt ${i.success?"ok":"refused"}`,children:[T.jsx("span",{className:"mark",children:i.success?"✓":"✕"}),T.jsxs("div",{children:[T.jsx("strong",{children:i.what}),i.why&&T.jsxs("p",{className:"why",children:["Refused on chain: ",i.why]}),i.moved.length>0&&T.jsx("p",{className:"moved",children:i.moved.join(" · ")}),T.jsxs("p",{className:"meta",children:[bN(i.timestampMs,s)," · ",T.jsx(sa,{d:e,kind:"tx",id:i.digest}),r&&i.sender&&T.jsxs(T.Fragment,{children:[" ","· agent ",T.jsx(sa,{d:e,kind:"address",id:i.sender})]})]})]})]},i.digest))})}function dZ({d:e,passes:t,now:s}){return t.length===0?T.jsx("p",{className:"empty",children:"No passes yet."}):T.jsx("div",{className:"grid",children:t.map(r=>T.jsxs("a",{className:"card",href:`#/pass/${r.id}`,children:[T.jsx("h3",{children:r.name}),T.jsxs("p",{children:["Pass ",Rn(r.id)]}),T.jsxs("p",{children:["Owner ",Rn(r.owner)]}),T.jsxs("p",{children:["Agent ",Rn(r.agent)]}),T.jsxs("p",{children:["Created ",bN(r.timestampMs,s)]})]},r.id))})}const B4=`npm install -g @mysten-incubation/sui-agent-pass
|
|
843
843
|
agent-pass connect`,fZ="Set up a pass that spends up to 0.5 USDC a day buying SUI, max price 1 USDC, for a week.",hZ=()=>new URL("agent-setup.md",`${location.origin}${location.pathname}`).href;function pZ({d:e}){const[t,s]=ze.useState("terminal"),[r,i]=ze.useState(!1),c=t==="terminal"?B4:`Set up Sui Agent Pass by following ${hZ()}`,u=()=>{navigator.clipboard?.writeText(c).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})};return T.jsxs("div",{className:"home",children:[T.jsxs("section",{className:"home-hero",children:[T.jsxs("h1",{children:["Your money. Your rules.",T.jsx("br",{}),T.jsx("span",{children:"AI at work."})]}),T.jsx("p",{className:"intro",children:"A pass lets an AI agent act on your Sui assets within rules you sign once. Your coins stay in your wallet; the chain enforces the rules."})]}),T.jsxs("div",{className:"install",children:[T.jsxs("div",{className:"install-head",children:[T.jsx("div",{role:"tablist","aria-label":"Where your agent runs",children:[["terminal","Run in your terminal"],["app","Send to your AI app"]].map(([d,p])=>T.jsx("button",{type:"button",role:"tab","aria-selected":t===d,className:t===d?"on":"",onClick:()=>{s(d),i(!1)},children:p},d))}),T.jsx("button",{type:"button",className:"copy",onClick:u,children:r?"Copied":"Copy"})]}),T.jsx("code",{role:"tabpanel","aria-label":t==="terminal"?"Install command":"Message for your agent",className:t==="app"?"prose":"",children:t==="terminal"?B4.split(`
|
|
844
844
|
`).map(d=>T.jsxs("span",{children:[T.jsx("i",{children:"$"})," ",d]},d)):c}),T.jsx("p",{className:"install-for",children:t==="terminal"?"For Claude Code, Codex, Hermes and OpenClaw":"For Muse and other AI apps that can run code"})]}),T.jsxs("ol",{className:"three",children:[T.jsxs("li",{children:[T.jsx("span",{className:"n",children:"01"}),t==="terminal"?T.jsxs(T.Fragment,{children:[T.jsx("h3",{children:"Install"}),T.jsx("p",{children:"Run the two commands above. The second one registers the agents on your machine."})]}):T.jsxs(T.Fragment,{children:[T.jsx("h3",{children:"Send it to your agent"}),T.jsx("p",{children:"Copy the message above into a chat with your agent. The agent opens the link and sets itself up; you don't need to."})]})]}),T.jsxs("li",{children:[T.jsx("span",{className:"n",children:"02"}),T.jsx("h3",{children:"Ask your agent"}),T.jsxs("p",{children:['"',fZ,'"']})]}),T.jsxs("li",{children:[T.jsx("span",{className:"n",children:"03"}),T.jsx("h3",{children:"Sign once"}),T.jsx("p",{children:t==="terminal"?"The agent opens the review page here. Connect your wallet, read the rules, sign.":"The agent sends you a link to the review page. Open it, connect your wallet, read the rules, sign."})]})]}),T.jsxs("p",{className:"home-links",children:[T.jsx("a",{href:"#/guide",children:"What a pass can and cannot do"}),T.jsx("a",{href:"#/explorer",children:"Explorer"}),T.jsx("span",{children:e.network==="mainnet"?"Mainnet test build. Use small amounts while we dogfood.":`${e.network}: test coins only.`})]})]})}function mZ({d:e}){const t=e.coins.map(i=>i.symbol).join(", "),s=e.pools.map(i=>`${sr(e,i.coinA)}/${sr(e,i.coinB)} on ${i.venue==="deepbook"?"DeepBook":"Cetus"}`).join(", "),r=Object.keys(e.protocols.navi.reserves).map(i=>sr(e,i)).join(", ");return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Home"})," › Guide"]}),T.jsxs("section",{className:"hero",style:{padding:"28px 0 20px"},children:[T.jsx("h1",{style:{fontSize:44},children:"How a pass works"}),T.jsx("p",{className:"intro",children:"A pass is an on-chain object that says what one agent key may do with your assets, for how long. You create it with one signature, the agent uses it without you, and you end it with one signature."})]}),T.jsxs("div",{className:"guide",children:[T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"What the agent can do"}),T.jsx("p",{children:"Each kind of action needs its own rule, and a coin without a rule cannot be touched."}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Pay"}),T.jsx("strong",{children:"Send a coin to recipients you named, up to an amount per transfer and per UTC day. The agent uses the names; it never gets to choose an address."})]}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Trade"}),T.jsxs("strong",{children:["Buy or sell on the pools you listed (",s||"none on this network","), up to an amount per trade and per day, and only at your price: never paying more than your limit when buying, never taking less when selling. Proceeds go back to your address."]})]}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Lend"}),T.jsxs("strong",{children:["Supply and withdraw a coin on NAVI (",r||"none on this network","), and borrow or repay it only if you allowed borrowing, keeping the health factor above your floor."]})]}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Stake"}),T.jsx("strong",{children:"Stake SUI with validators you listed, or any active one, at least 1 SUI at a time. The stake sits in the pass and comes back to you when the pass ends."})]}),T.jsxs("p",{className:"fine",children:["Coins this network lists: ",t,". The agent can propose rules for other coins you hold by naming their type and a pool."]})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"What it can never do"}),T.jsx("p",{children:"The rules are checked by the Move package on every transaction, not by the agent. There is no way for the agent to move coins to an address you did not name, exceed a limit, act on a coin without a rule, change the rules, or take a held object out of the pass. Your coins never enter the pass or the agent's address: every spend is a withdrawal from your own address balance through an allowance bound to the pass, and whatever comes back lands in your address."}),T.jsx("p",{children:"The one thing outside the rules is gas. The agent key gets a small SUI stipend and a separate gas allowance with its own lifetime limit and a limit per 24 hours, counted from its first top-up rather than per UTC day, so it can pay fees. A stolen agent key could drain that gas allowance at that rate, and nothing else. Keep it small; the default is a fifth of the gas cap per 24 hours."})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Where your money sits"}),T.jsx("p",{children:"Allowances draw from your address balance, not from the coin objects in your wallet. When you sign a pass, the page converts just enough of your coins into your address balance to cover the caps, and shows you the amount first. Converted coins stay yours to spend at any time, and the agent can only ever reach what the caps allow."}),T.jsx("p",{children:"Lifetime caps count what leaves, not net exposure: a stake and unstake, or a supply and withdraw, uses the allowance once. Size the caps for the cycles the agent will run."})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Changing the rules"}),T.jsx("p",{children:"Ask the agent. It proposes the complete new rule set and opens a page that shows the current rules beside the new ones. One signature replaces the rules; the agent key, its gas and anything the pass holds stay. Changed limits start the day's counters at zero."})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Ending it"}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Stop the agent now"}),T.jsx("strong",{children:"Instant. The key is cut off and the allowances deleted; the pass and its history stay on chain. Use it when something is wrong."})]}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Close the pass"}),T.jsx("strong",{children:"Also hands back everything the pass holds, withdrawing a NAVI position into your wallet first, deletes the pass and refunds its storage deposit. The agent key returns its leftover gas to you by itself."})]}),T.jsx("p",{className:"fine",children:"Both are on the pass page. Your owner page lists every pass you have and closes any number of them in one signature."})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Reading this site"}),T.jsx("p",{children:"Everything here is read live from Sui, nothing from the agent. A pass page shows the rules with today's usage, your balances, what the pass holds, and the agent's activity with each refusal decoded into the rule that caused it. The explorer looks up any pass or owner address."}),T.jsxs("p",{className:"fine",children:["During the dogfood on ",e.network,", the package is the test build; the launch will be a fresh package, and passes on this one are closed at that point. Use small amounts and report anything odd to the team."]})]})]})]})}function gZ({d:e}){const t=Eo(),[s,r]=ze.useState(""),[i,c]=ze.useState(null),[u,d]=ze.useState(""),[p,m]=ze.useState("");ze.useEffect(()=>{if(c(null),m(""),!t)return;let y=!1;return ZO(qt(e),e,t.address).then(b=>{y||c(b)}).catch(b=>{y||m(b.message)}),()=>{y=!0}},[t?.address,e]);const g=()=>{const y=s.trim();if(!fa(y))return d("Enter a pass id or an owner address");d(""),rm(qt(e),e,y).then(b=>{location.hash=b?`#/pass/${b.id}`:`#/owner/${ye(y)}`})};return T.jsxs(T.Fragment,{children:[T.jsxs("section",{className:"hero",children:[T.jsxs("p",{className:"eyebrow",children:["AGENT PASS EXPLORER · ",e.network.toUpperCase()]}),T.jsxs("h1",{children:["Every rule.",T.jsx("br",{}),"Every refusal.",T.jsx("br",{}),T.jsx("span",{children:"On chain."})]}),T.jsx("p",{className:"intro",children:"Paste a pass id or an owner address, or connect your wallet to see your own passes, their rules, what the agent did, and what the chain refused."})]}),T.jsxs("div",{className:"search",children:[T.jsx("input",{"aria-label":"Pass id or owner address",placeholder:"0x… pass id or owner address",value:s,onChange:y=>r(y.target.value),onKeyDown:y=>y.key==="Enter"&&g()}),T.jsx("button",{className:"primary",style:{width:"auto",marginTop:0},onClick:g,children:"Open"})]}),u&&T.jsx("div",{role:"alert",className:"message error",children:u}),T.jsxs("section",{className:"panel",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Your passes"}),t&&T.jsxs("span",{className:"badge",children:["Receipts in ",Rn(t.address)]})]}),t?p?T.jsx("div",{role:"alert",className:"message error",children:p}):i===null?T.jsx("p",{className:"empty",children:"Reading your wallet…"}):i.length===0?T.jsx("p",{className:"empty",children:"No pass receipts in this wallet."}):T.jsx("div",{className:"grid",children:i.map(y=>T.jsxs("a",{className:"card",href:`#/pass/${y.pass}`,children:[T.jsx("h3",{children:y.name}),T.jsxs("p",{children:["Pass ",Rn(y.pass)]}),T.jsxs("p",{children:["Receipt ",Rn(y.id)]})]},y.id))}):T.jsxs("div",{className:"empty",children:[T.jsx("p",{children:"Connect your wallet to see your passes."}),T.jsx(kN,{d:e})]})]})]})}function yZ({d:e,owner:t}){const s=bi(),r=Eo(),[i,c]=ze.useState(null),[u,d]=ze.useState(""),[p,m]=ze.useState(""),g=!!r&&ye(r.address)===ye(t);async function y(){const O=qt(e),C=await Xq(O,e,t);c(await Promise.all(C.map(async R=>({...R,position:await Ep(O,e,R.user)}))))}ze.useEffect(()=>{c(null),y().catch(O=>d(O.message))},[t]);async function b(O){if(r){m(O.capId),d("");try{const C=qt(e),R=new Yn;R.setSender(r.address),await h1(R,e),p1(R,e,R.object(O.capId),O.position,r.address);const $=await s.signTransaction({transaction:R}),x=await C.executeTransaction({transaction:Ge($.bytes),signatures:[$.signature]});if(x.$kind==="FailedTransaction")throw new Error(`Chain refused: ${x.FailedTransaction.status.error?.message}`);await C.waitForTransaction({result:x}),await y()}catch(C){d(C.message)}finally{m("")}}}const E=i?.filter(O=>Object.keys(O.position.collateral).length||Object.keys(O.position.debt).length);return E?.length?T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"NAVI positions in this wallet"}),T.jsx("p",{className:"fine",children:"Reclaimed from passes. NAVI's app does not see account-based positions, so withdraw them here: one signature returns the collateral to your wallet."}),u&&T.jsx("div",{className:"message error",children:u}),E.map(O=>T.jsxs("div",{className:"rule",children:[T.jsxs("span",{children:["Account ",T.jsx("span",{className:"mono",children:Rn(O.capId)})]}),T.jsxs("strong",{children:[Object.entries(O.position.collateral).map(([C,R])=>hn(e,C,R)).join(" · ")||"nothing supplied",Object.keys(O.position.debt).length?` · owes ${Object.entries(O.position.debt).map(([C,R])=>hn(e,C,R)).join(" · ")}`:"",g&&Qu(O.position)&&T.jsx("button",{className:"inline",disabled:!!p,onClick:()=>{b(O)},children:p===O.capId?"Confirming…":"Withdraw to my wallet"}),Object.keys(O.position.debt).length>0&&T.jsx("span",{className:"fine",children:" (repay the debt before withdrawing)"})]})]},O.capId))]}):null}function vZ({d:e,owner:t}){const s=bi(),r=Eo(),[i,c]=ze.useState(null),[u,d]=ze.useState(""),[p,m]=ze.useState(""),[g,y]=ze.useState(!1),[b,E]=ze.useState(new Set),O=!!r&&ye(r.address)===ye(t);function C(){return ZO(qt(e),e,t).then(x=>{c(x),E(new Set)}).catch(x=>d(x.message))}ze.useEffect(()=>{C()},[t]);async function R(){if(!(!r||!i)){y(!0),d(""),m("");try{const x=qt(e),W=await Promise.all(i.filter(G=>b.has(G.pass)).map(async G=>{const J=await rm(x,e,G.pass);if(!J)throw new Error(`No pass ${Rn(G.pass)} was created on this package`);const[w,A]=await Promise.all([md(x,e,G.pass),l1(x,e,J)]),N=w.naviPosition?await Ep(x,e,w.naviPosition):null;return{pass:{passId:G.pass,receiptId:G.id},active:A,control:w,position:N}})),oe=await s.signTransaction({transaction:await vN(e,W,r.address)}),me=await x.executeTransaction({transaction:Ge(oe.bytes),signatures:[oe.signature]});if(me.$kind==="FailedTransaction")throw new Error(`Chain refused: ${me.FailedTransaction.status.error?.message}`);await x.waitForTransaction({result:me}),m(`${W.length} ${W.length===1?"pass":"passes"} closed in one transaction; the storage deposits came back with the gas.`),await C()}catch(x){d(x.message)}finally{y(!1)}}}const $=x=>E(W=>{const oe=new Set(W);return oe.has(x)?oe.delete(x):oe.add(x),oe});return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Explorer"})," › Owner ",T.jsx("span",{className:"mono",children:t})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Passes this wallet holds receipts for"}),u&&T.jsx("div",{className:"message error",children:u}),p&&T.jsx("div",{role:"status",className:"message",children:p}),i===null?T.jsx("p",{className:"empty",children:"Reading…"}):i.length===0?T.jsx("p",{className:"empty",children:"No pass receipts at this address."}):T.jsxs(T.Fragment,{children:[O&&T.jsxs("p",{className:"fine",children:["Pick the passes to close, then close them all with one signature. Closing stops the agent, hands back anything the pass holds, deletes it and refunds its storage."," ",T.jsx("button",{className:"inline",disabled:g,onClick:()=>E(b.size===i.length?new Set:new Set(i.map(x=>x.pass))),children:b.size===i.length?"Clear":"Select all"})]}),T.jsx("div",{className:"grid",children:i.map(x=>T.jsxs("div",{className:"card",children:[O&&T.jsxs("label",{className:"pick",children:[T.jsx("input",{type:"checkbox",checked:b.has(x.pass),disabled:g,onChange:()=>$(x.pass)})," ","Close"]}),T.jsxs("a",{href:`#/pass/${x.pass}`,children:[T.jsx("h3",{children:x.name}),T.jsxs("p",{children:["Pass ",Rn(x.pass)]})]})]},x.id))}),O&&T.jsx("button",{className:"primary",disabled:g||b.size===0,onClick:()=>{R()},children:g?"Confirming…":b.size?`Close ${b.size} ${b.size===1?"pass":"passes"} in one signature`:"Close selected"}),!r&&T.jsx("p",{className:"fine",children:"Connect this wallet to close passes from here."})]})]}),T.jsx(yZ,{d:e,owner:t})]})}function SN({rows:e}){return T.jsx(T.Fragment,{children:e.map(t=>T.jsxs("div",{className:t.starts?"rule starts":"rule",children:[T.jsx("span",{children:t.label}),t.label==="Named recipients"||t.value.startsWith("0x")?T.jsx("div",{children:t.value.split(`
|
|
845
845
|
`).map(s=>T.jsx("code",{children:s},s))}):T.jsx("strong",{children:t.value})]},t.label))})}function bZ({d:e,passId:t,ready:s}){const r=bi(),i=Eo(),[c,u]=ze.useState(null),[d,p]=ze.useState(!1),[m,g]=ze.useState(""),[y,b]=ze.useState(""),[E,O]=ze.useState(!1),C=Date.now();async function R(k=!1){const j=qt(e),U=k||!c?await rm(j,e,t):c.summary;if(!U)return void p(!0);const V=await md(j,e,U.id),K=k||!c?await c1(j,e,Sp(Bv(e,V))):c.dx,P=k||!c?await l1(j,K,U):c.active,[re,ue,I]=await Promise.all([P?XO(j,P):null,GH(j,K,U.owner),iq(j,K,V.agent,V.policies.transfers[0]?.recipients??[])]);u({summary:U,control:V,active:P,allowances:re,balances:ue,attempts:I,dx:K})}ze.useEffect(()=>{u(null),p(!1),R(!0).catch(j=>g(j.message));const k=setInterval(()=>{R().catch(()=>{})},5e3);return()=>clearInterval(k)},[t]);async function $(k,j,U){if(i){O(!0),g(""),b("");try{const V=await r.signTransaction({transaction:await k()}),K=qt(e),P=await K.executeTransaction({transaction:Ge(V.bytes),signatures:[V.signature]});if(P.$kind==="FailedTransaction")throw new Error(`Chain refused: ${P.FailedTransaction.status.error?.message}`);if(await K.waitForTransaction({result:P}),b(j),U)return U();await R(!0)}catch(V){g(V.message)}finally{O(!1)}}}if(d)return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Explorer"})," › Pass"]}),T.jsxs("div",{className:"message error",children:["No pass ",Rn(t)," was created on this package."]})]});if(!c)return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Explorer"})," › Pass ",Rn(t)]}),m?T.jsx("div",{className:"message error",children:m}):T.jsx("p",{className:"empty",children:"Reading the chain…"})]});const{summary:x,control:W,active:oe,allowances:me,balances:G,attempts:J,dx:w}=c,A=W.revoked||!oe,N=!A&&Number(W.agentExpiresMs)<=W.chainTimeMs,F=!!i&&ye(i.address)===W.owner,B=k=>sr(w,k),q=k=>k?(BigInt(k.lifetimeCap??"0")-BigInt(k.currentSpend)).toString():null,z=me?Object.entries(me).map(([k,j])=>[k,q(j)]):[],D=[...W.policies.transfers.map(k=>({label:`${B(k.coinType)} paid today`,value:hn(w,k.coinType,k.usage.usedToday)})),...W.policies.swaps.map(k=>({label:`${B(k.coinIn)} sold for ${B(k.coinOut)} today`,value:hn(w,k.coinIn,k.usage.usedToday)})),...W.policies.lending.map(k=>({label:`${B(k.coinType)} ${k.allowBorrow?"lent, borrowed or repaid":"supplied or withdrawn"} today`,value:hn(w,k.coinType,k.usage.usedToday)})),...W.policies.staking.map(k=>({label:"SUI staked today",value:Rc(k.usage.usedToday)}))];return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Explorer"})," ›"," ",T.jsxs("a",{href:`#/owner/${W.owner}`,children:["Owner ",Rn(W.owner)]})," › ",x.name]}),T.jsxs("section",{className:"hero",style:{padding:"28px 0 20px"},children:[T.jsx("h1",{style:{fontSize:44},children:x.name}),T.jsxs("p",{className:"intro",children:["Pass"," ",T.jsx(sa,{d:e,kind:"object",id:x.id,children:x.id})]})]}),m&&T.jsx("div",{role:"alert",className:"message error",children:m}),y&&T.jsx("div",{role:"status",className:"message",children:y}),T.jsxs("div",{className:"layout",children:[T.jsxs("div",{children:[T.jsxs("section",{className:"panel activity",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Agent activity"}),T.jsx("span",{className:"badge",children:"Live from Sui"})]}),T.jsx(TN,{d:e,attempts:J,now:C})]}),T.jsxs("section",{className:"panel rules",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Policies"}),T.jsx("span",{className:`badge ${A||N?"muted":""}`,children:A?"Revoked":N?"Expired":"Authorized"})]}),T.jsx(SN,{rows:JO(w,Bv(w,W),W.policies)}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Agent term ends"}),T.jsx("strong",{children:W.revoked?"Revoked":cZ(W.agentExpiresMs)})]})]})]}),T.jsxs("aside",{children:[T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Owner's address balance"}),w.coins.map(k=>T.jsxs("div",{className:"balance",children:[pd(G[k.type]??"0",k.decimals)," ",T.jsx("span",{children:sr(w,k.type)})]},k.type)),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Key may still withdraw"}),T.jsx("strong",{children:z.length&&z.every(([,k])=>k!==null)?z.map(([k,j])=>hn(w,k,j)).join(" · "):"Nothing; allowances deleted"})]}),D.map(k=>T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:k.label}),T.jsx("strong",{children:k.value})]},k.label)),T.jsx("hr",{}),T.jsx("h2",{children:"Held by the pass"}),W.naviPosition&&T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"NAVI position"}),T.jsxs("strong",{children:[T.jsx(sa,{d:e,kind:"address",id:W.naviPosition}),F&&T.jsx("button",{className:"inline",disabled:E,onClick:()=>{$(async()=>sZ(w,{passId:x.id},i.address,await Ep(qt(e),w,W.naviPosition)),"The NAVI position was withdrawn to your wallet, and its account with it.")},children:"Reclaim"})]})]}),W.stakes.map(k=>T.jsxs("div",{className:"rule",children:[T.jsxs("span",{children:["Stake ",T.jsx(sa,{d:e,kind:"object",id:k.id})]}),T.jsxs("strong",{children:[Rc(k.principal),F&&T.jsx("button",{className:"inline",disabled:E,onClick:()=>{$(()=>iZ(e,{passId:x.id},i.address,k.id),"The stake is in your wallet now.")},children:"Reclaim"})]})]},k.id)),!W.naviPosition&&W.stakes.length===0&&T.jsx("p",{className:"empty",children:"No objects held."}),T.jsx("p",{className:"fine",children:"Coins never rest in the pass. What it holds is what the agent operates: a lending account, stakes. Only the owner takes them out."}),F&&!A&&!N&&oe&&T.jsxs("div",{className:"owner-actions",children:[T.jsx("button",{className:"revoke",disabled:E,onClick:()=>{$(()=>nZ(e,oe,i.address),"Stopped on chain. This key can no longer withdraw from your balance. The pass and its history stay; close it when you are done.")},children:"Stop the agent now"}),T.jsx("p",{className:"fine",children:"Instant and small: the key is cut off and the allowances deleted. The pass and its history stay on chain; a pass belongs to one key, so a new agent needs a new pass."})]}),F&&T.jsxs("div",{className:"owner-actions",children:[T.jsx("button",{className:"revoke",disabled:E,onClick:()=>{$(async()=>rZ(w,{passId:x.id,receiptId:x.receiptId},oe,W,i.address,W.naviPosition?await Ep(qt(e),w,W.naviPosition):null),"Pass closed; its storage deposits came back with the gas.",()=>{location.hash=`#/owner/${W.owner}`})},children:A?"Close the pass and get its storage back":"Stop the agent and close the pass"}),T.jsx("p",{className:"fine",children:"Deletes the pass, its policies, its receipt and any remaining allowances, and hands you anything it still holds; a NAVI position with no debt is withdrawn to your wallet first, since NAVI's app cannot operate it. The storage deposits of everything deleted return to your wallet with this transaction's gas."})]}),!i&&T.jsx("p",{className:"fine",children:"Connect the owner wallet to revoke or reclaim."})]}),T.jsxs("details",{children:[T.jsx("summary",{children:"On-chain details"}),T.jsxs("dl",{children:[T.jsx("dt",{children:"Owner"}),T.jsx("dd",{children:T.jsx(sa,{d:e,kind:"address",id:W.owner,children:W.owner})}),T.jsx("dt",{children:"Agent"}),T.jsx("dd",{children:T.jsx(sa,{d:e,kind:"address",id:W.agent,children:W.agent})}),T.jsx("dt",{children:"Receipt"}),T.jsx("dd",{children:T.jsx(sa,{d:e,kind:"object",id:x.receiptId,children:x.receiptId})}),T.jsx("dt",{children:"Authorization"}),T.jsx("dd",{children:T.jsx(sa,{d:e,kind:"tx",id:x.digest,children:x.digest})}),oe&&T.jsxs(T.Fragment,{children:[Object.entries(oe.allowances).map(([k,j])=>T.jsxs(Fb.Fragment,{children:[T.jsxs("dt",{children:[B(k)," allowance"]}),T.jsx("dd",{children:j.allowance})]},k)),T.jsx("dt",{children:"Gas allowance"}),T.jsx("dd",{children:oe.gasAllowance})]})]})]})]})]}),s&&T.jsxs("section",{className:"panel next",children:[T.jsx("h2",{children:"Your agent is ready"}),T.jsx("p",{children:"Your signature is on chain. The process that proposed this pass finds it there by itself; there is nothing to copy back. Ask your agent to read its rules and make its first transaction."}),T.jsxs("blockquote",{children:['"',wZ(w,W),'"']})]})]})}function wZ(e,t){const s=t.policies,r=s.transfers[0],i=s.swaps[0],c=s.lending[0],u=s.staking[0];return`${r?`Pay ${hn(e,r.coinType,r.perTransfer)} to ${r.recipients[0]?.name??"the recipient in my rules"}`:i?a1(e,i.coinIn,i.coinOut).limit==="max"?`Buy ${sr(e,i.coinOut)} with ${hn(e,i.coinIn,i.perTrade)}`:`Sell ${hn(e,i.coinIn,i.perTrade)} for ${sr(e,i.coinOut)}`:c?`Supply ${hn(e,c.coinType,c.perAction)} to NAVI`:u?`Stake ${Rc(u.perStake)}`:"Make the first action my rules allow"}, then show me the transaction and what you may still do today.`}function Bv(e,t){const s=t.policies;return{transfers:s.transfers.map(r=>({coin:r.coinType,recipients:r.recipients,perTransfer:r.perTransfer,daily:r.daily})),swaps:s.swaps.map(r=>({coinIn:r.coinIn,coinOut:r.coinOut,pools:r.venues,perTrade:r.perTrade,daily:r.daily,minPrice:r.minPrice})),lending:s.lending.map(r=>({coin:r.coinType,allowBorrow:r.allowBorrow,perAction:r.perAction,daily:r.daily,minHealthFactor:BigInt(r.minHealthFactor)===0n?null:Number(BigInt(r.minHealthFactor)/10n**25n)/100})),staking:s.staking[0]?{validators:s.staking[0].validators,perStake:s.staking[0].perStake,daily:s.staking[0].daily}:null}}function TZ({d:e}){const[t,s]=ze.useState([]),[r,i]=ze.useState([]),[c,u]=ze.useState(""),d=Date.now();ze.useEffect(()=>{const m=qt(e),g=()=>{Promise.all([aq(m,e,12),oq(m,e,40)]).then(([b,E])=>{s(b),i(E),u("")}).catch(b=>u(b.message))};g();const y=setInterval(g,4e3);return()=>clearInterval(y)},[e.packageId]);const p=r.filter(m=>!m.success).length;return T.jsxs("div",{className:"booth",children:[T.jsxs("section",{className:"hero",style:{padding:"40px 0 24px"},children:[T.jsxs("p",{className:"eyebrow",children:["LIVE ON SUI ",e.network.toUpperCase()]}),T.jsxs("h1",{children:["Your money. Your rules.",T.jsx("br",{}),T.jsx("span",{children:"AI at work."})]})]}),c&&T.jsx("div",{className:"message error",children:c}),T.jsxs("div",{className:"stats",children:[T.jsxs("div",{className:"stat",children:[T.jsx("span",{children:"Passes"}),T.jsx("strong",{children:t.length})]}),T.jsxs("div",{className:"stat",children:[T.jsx("span",{children:"Recent actions"}),T.jsx("strong",{children:r.length})]}),T.jsxs("div",{className:"stat refused",children:[T.jsx("span",{children:"Refused by the chain"}),T.jsx("strong",{children:p})]})]}),T.jsxs("div",{className:"layout",children:[T.jsxs("section",{className:"panel",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"What agents are doing"}),T.jsx("span",{className:"badge",children:"Refreshes every 4s"})]}),T.jsx(TN,{d:e,attempts:r,now:d,showSender:!0})]}),T.jsxs("section",{className:"panel",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Latest passes"}),T.jsx("a",{className:"badge",href:"#/",children:"Explorer →"})]}),T.jsx(dZ,{d:e,passes:t,now:d})]})]})]})}function SZ({d:e,proposal:t}){const s=bi(),r=Eo(),[i,c]=ze.useState(null),[u,d]=ze.useState(""),[p,m]=ze.useState(!1),g=t.setup;async function y(){const C=qt(e),R=await rm(C,e,t.passId);if(!R)throw new Error(`No pass ${Rn(t.passId)} was created on this package`);const $=await md(C,e,R.id);if($.agent!==ye(t.sessionAddress))throw new Error("This proposal names a different agent key than the pass has");const x=Bv(e,$),W=Sp(g.policy),oe=Sp(x),me=await c1(C,e,{coins:[...W.coins,...oe.coins],pools:[...W.pools,...oe.pools]}),G=await l1(C,me,R);if(!G)throw new Error("This pass has no live allowances; it was stopped or closed");const[J,w]=await Promise.all([XO(C,G),o1(C,G.gasAllowance,Lt)]),A={name:$.name,policy:x,ttlMs:g.ttlMs,expiresMs:Number($.agentExpiresMs),allowances:Object.fromEntries(Object.entries(J).map(([q,z])=>[q,z?.lifetimeCap??"0"])),gasAmount:g.gasAmount,gasCap:w?.lifetimeCap??"0",gasDaily:w?.rateLimit?.limit??"0"},N=Uv(me,A),F=Uv(me,g),B=q=>q.filter(z=>!/^Authorization ends|^Gas to the agent/.test(z.label)).map(z=>`${z.label}=${z.value}`).sort().join(`
|