@mysten-incubation/sui-agent-pass 0.1.8 → 0.1.9

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.
@@ -4,12 +4,12 @@ Keys:
4
4
  ${String(t.keys)}
5
5
 
6
6
  Values:
7
- ${String(r)}`);Iy(t);for(let i=0;i<t.callbacks.length;i++){const c=r[i];c instanceof Error?t.callbacks[i].reject(c):t.callbacks[i].resolve(c)}}).catch(r=>{U0(e,t,r)})}function U0(e,t,s){Iy(t);for(let r=0;r<t.keys.length;r++)e.clear(t.keys[r]),t.callbacks[r].reject(s)}function Iy(e){if(e.cacheHits)for(let t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}function b6(e){if(!(!e||e.batch!==!1))return 1;const t=e&&e.maxBatchSize;if(t===void 0)return 1/0;if(typeof t!="number"||t<1)throw new TypeError(`maxBatchSize must be a positive number: ${t}`);return t}function w6(e){const t=e&&e.batchScheduleFn;if(t===void 0)return g6;if(typeof t!="function")throw new TypeError(`batchScheduleFn must be a function: ${t}`);return t}function T6(e){const t=e&&e.cacheKeyFn;if(t===void 0)return s=>s;if(typeof t!="function")throw new TypeError(`cacheKeyFn must be a function: ${t}`);return t}function E6(e){if(!(!e||e.cache!==!1))return null;const t=e&&e.cacheMap;if(t===void 0)return new Map;if(t!==null){const s=["get","set","delete","clear"].filter(r=>t&&typeof t[r]!="function");if(s.length!==0)throw new TypeError("Custom cacheMap missing methods: "+s.join(", "))}return t}function S6(e){return e&&e.name?e.name:null}function N4(e){return typeof e=="object"&&e!==null&&"length"in e&&typeof e.length=="number"&&(e.length===0||e.length>0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}function x4(e){return e=e||new Map,{all:e,on(t,s){const r=e.get(t);r?r.push(s):e.set(t,[s])},off(t,s){const r=e.get(t);r&&(s?r.splice(r.indexOf(s)>>>0,1):e.set(t,[]))},emit(t,s){let r=e.get(t);r&&r.slice().map(i=>{i(s)}),r=e.get("*"),r&&r.slice().map(i=>{i(t,s)})}}}function _6(e,t){switch(t){case"base58":return Ju(e);case"base64":return st(e);case"hex":return kr(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function C4(e,t=["<",">"]){const[s,r]=t,i=[];let c="",u=0;for(let f=0;f<e.length;f++){const p=e[f];if(p===s&&u++,p===r&&u--,u===0&&p===","){i.push(c.trim()),c="";continue}c+=p}return i.push(c.trim()),i}var k6=class{constructor({initialSize:e=1024,maxSize:t=1/0,allocateSize:s=1024}={}){this.bytePosition=0,this.size=e,this.maxSize=t,this.allocateSize=s,this.dataView=new DataView(new ArrayBuffer(e))}ensureSizeOrGrow(e){const t=this.bytePosition+e;if(t>this.size){const s=Math.min(this.maxSize,Math.max(this.size+t,this.size+this.allocateSize));if(t>s)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${t}`);this.size=s;const r=new ArrayBuffer(this.size);new Uint8Array(r).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(r)}}shift(e){return this.bytePosition+=e,this}write8(e){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(e)),this.shift(1)}writeBytes(e){this.ensureSizeOrGrow(e.length);for(let t=0;t<e.length;t++)this.dataView.setUint8(this.bytePosition+t,e[t]);return this.shift(e.length)}write16(e){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(e),!0),this.shift(2)}write32(e){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(e),!0),this.shift(4)}write64(e){return B0(BigInt(e),8).forEach(t=>this.write8(t)),this}write128(e){return B0(BigInt(e),16).forEach(t=>this.write8(t)),this}write256(e){return B0(BigInt(e),32).forEach(t=>this.write8(t)),this}writeULEB(e){return Nh(e).forEach(t=>this.write8(t)),this}writeVec(e,t){return this.writeULEB(e.length),Array.from(e).forEach((s,r)=>t(this,s,r,e.length)),this}*[Symbol.iterator](){for(let e=0;e<this.bytePosition;e++)yield this.dataView.getUint8(e);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(e){return _6(this.toBytes(),e)}};function B0(e,t){const s=new Uint8Array(t);let r=0;for(;e>0;)s[r]=Number(e%BigInt(256)),e=e/BigInt(256),r+=1;return s}var nr=class I4{#e;#t;constructor(t){this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),this.#e=t.write,this.#t=t.serialize??((s,r)=>{const i=new k6({initialSize:this.serializedSize(s)??void 0,...r});return this.#e(s,i),i.toBytes()}),this.validate=t.validate??(()=>{})}write(t,s){this.validate(t),this.#e(t,s)}serialize(t,s){return this.validate(t),new A6(this,this.#t(t,s))}parse(t){const s=new e6(t);return this.read(s)}fromHex(t){return this.parse(Ku(t))}fromBase58(t){return this.parse(Ih(t))}fromBase64(t){return this.parse(qe(t))}transform({name:t,input:s,output:r,validate:i}){return new I4({name:t??this.name,read:c=>r?r(this.read(c)):this.read(c),write:(c,u)=>this.#e(s?s(c):c,u),serializedSize:c=>this.serializedSize(s?s(c):c),serialize:(c,u)=>this.#t(s?s(c):c,u),validate:c=>{i?.(c),this.validate(s?s(c):c)}})}};const R4=Symbol.for("@mysten/serialized-bcs");function Ry(e){return!!e&&typeof e=="object"&&e[R4]===!0}var A6=class{#e;#t;get[R4](){return!0}constructor(e,t){this.#e=e,this.#t=t}toBytes(){return this.#t}toHex(){return kr(this.#t)}toBase64(){return st(this.#t)}toBase58(){return Ju(this.#t)}parse(){return this.#e.parse(this.#t)}};function jh({size:e,...t}){return new nr({...t,serializedSize:()=>e})}function L0({readMethod:e,writeMethod:t,...s}){return jh({...s,read:r=>r[e](),write:(r,i)=>i[t](r),validate:r=>{if(r<0||r>s.maxValue)throw new TypeError(`Invalid ${s.name} value: ${r}. Expected value in range 0-${s.maxValue}`);s.validate?.(r)}})}function z0({readMethod:e,writeMethod:t,...s}){return jh({...s,read:r=>r[e](),write:(r,i)=>i[t](BigInt(r)),validate:r=>{const i=BigInt(r);if(i<0||i>s.maxValue)throw new TypeError(`Invalid ${s.name} value: ${i}. Expected value in range 0-${s.maxValue}`);s.validate?.(i)}})}function O6({serialize:e,...t}){const s=new nr({...t,serialize:e,write:(r,i)=>{for(const c of s.serialize(r).toBytes())i.write8(c)}});return s}function N6({toBytes:e,fromBytes:t,...s}){return new nr({...s,read:r=>{const i=r.readULEB();return t(r.readBytes(i))},write:(r,i)=>{const c=e(r);i.writeULEB(c.length);for(let u=0;u<c.length;u++)i.write8(c[u])},serialize:r=>{const i=e(r),c=Nh(i.length),u=new Uint8Array(c.length+i.length);return u.set(c,0),u.set(i,c.length),u},validate:r=>{if(typeof r!="string")throw new TypeError(`Invalid ${s.name} value: ${r}. Expected string`);s.validate?.(r)}})}function x6(e){let t=null;function s(){return t||(t=e()),t}return new nr({name:"lazy",read:r=>s().read(r),serializedSize:r=>s().serializedSize(r),write:(r,i)=>s().write(r,i),serialize:(r,i)=>s().serialize(r,i).toBytes()})}var C6=class extends nr{constructor({name:e,fields:t,...s}){const r=Object.entries(t);super({name:e,serializedSize:i=>{let c=0;for(const[u,f]of r){const p=f.serializedSize(i[u]);if(p==null)return null;c+=p}return c},read:i=>{const c={};for(const[u,f]of r)c[u]=f.read(i);return c},write:(i,c)=>{for(const[u,f]of r)f.write(i[u],c)},...s,validate:i=>{if(s?.validate?.(i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})}},I6=class extends nr{constructor({fields:e,...t}){const s=Object.entries(e);super({read:r=>{const i=r.readULEB(),c=s[i];if(!c)throw new TypeError(`Unknown value ${i} for enum ${t.name}`);const[u,f]=c;return{[u]:f?.read(r)??!0,$kind:u}},write:(r,i)=>{const[c,u]=Object.entries(r).filter(([f])=>Object.hasOwn(e,f))[0];for(let f=0;f<s.length;f++){const[p,m]=s[f];if(p===c){i.writeULEB(f),m?.write(u,i);return}}},...t,validate:r=>{if(t?.validate?.(r),typeof r!="object"||r==null)throw new TypeError(`Expected object, found ${typeof r}`);const i=Object.keys(r).filter(u=>r[u]!==void 0&&Object.hasOwn(e,u));if(i.length!==1)throw new TypeError(`Expected object with one key, but found ${i.length} for type ${t.name}}`);const[c]=i;if(!Object.hasOwn(e,c))throw new TypeError(`Invalid enum variant ${c}`)}})}},R6=class extends nr{constructor({fields:e,name:t,...s}){super({name:t??`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let i=0;for(let c=0;c<e.length;c++){const u=e[c].serializedSize(r[c]);if(u==null)return null;i+=u}return i},read:r=>{const i=[];for(const c of e)i.push(c.read(r));return i},write:(r,i)=>{for(let c=0;c<e.length;c++)e[c].write(r[c],i)},...s,validate:r=>{if(s?.validate?.(r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})}};function j6(e,t,s){return new nr({read:r=>{const i=new Array(e);for(let c=0;c<e;c++)i[c]=t.read(r);return i},write:(r,i)=>{for(const c of r)t.write(c,i)},...s,name:s?.name??`${t.name}[${e}]`,validate:r=>{if(s?.validate?.(r),!r||typeof r!="object"||!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})}function M6(e){return E.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>t.$kind==="Some"?t.Some:null})}function D6(e,t){return new nr({read:s=>{const r=s.readULEB(),i=new Array(r);for(let c=0;c<r;c++)i[c]=e.read(s);return i},write:(s,r)=>{r.writeULEB(s.length);for(const i of s)e.write(i,r)},...t,name:t?.name??`vector<${e.name}>`,validate:s=>{if(t?.validate?.(s),!s||typeof s!="object"||!("length"in s))throw new TypeError(`Expected array, found ${typeof s}`)}})}function U6(e,t){for(let s=0;s<Math.min(e.length,t.length);s++)if(e[s]!==t[s])return e[s]-t[s];return e.length-t.length}function B6(e,t){return new nr({name:`Map<${e.name}, ${t.name}>`,read:s=>{const r=s.readULEB(),i=new Map;for(let c=0;c<r;c++)i.set(e.read(s),t.read(s));return i},write:(s,r)=>{const i=[...s.entries()].map(([c,u])=>[e.serialize(c).toBytes(),u]);i.sort(([c],[u])=>U6(c,u)),r.writeULEB(i.length);for(const[c,u]of i)r.writeBytes(c),t.write(u,r)}})}const E={u8(e){return L0({readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e,name:e?.name??"u8"})},u16(e){return L0({readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e,name:e?.name??"u16"})},u32(e){return L0({readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e,name:e?.name??"u32"})},u64(e){return z0({readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e,name:e?.name??"u64"})},u128(e){return z0({readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e,name:e?.name??"u128"})},u256(e){return z0({readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e,name:e?.name??"u256"})},bool(e){return jh({size:1,read:t=>{const s=t.read8();if(s>1)throw new TypeError(`Invalid bool value: expected 0 or 1, found ${s}`);return s===1},write:(t,s)=>s.write8(t?1:0),...e,name:e?.name??"bool",validate:t=>{if(e?.validate?.(t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return O6({read:t=>t.readULEB(),serialize:t=>Uint8Array.from(Nh(t)),...e,name:e?.name??"uleb128"})},bytes(e,t){return jh({size:e,read:s=>s.readBytes(e),write:(s,r)=>{r.writeBytes(new Uint8Array(s))},...t,name:t?.name??`bytes[${e}]`,validate:s=>{if(t?.validate?.(s),!s||typeof s!="object"||!("length"in s))throw new TypeError(`Expected array, found ${typeof s}`);if(s.length!==e)throw new TypeError(`Expected array of length ${e}, found ${s.length}`)}})},byteVector(e){return new nr({read:t=>{const s=t.readULEB();return t.readBytes(s)},write:(t,s)=>{const r=new Uint8Array(t);s.writeULEB(r.length),s.writeBytes(r)},...e,name:e?.name??"vector<u8>",serializedSize:t=>{const s="length"in t?t.length:null;return s==null?null:Nh(s).length+s},validate:t=>{if(e?.validate?.(t),!t||typeof t!="object"||!("length"in t))throw new TypeError(`Expected array, found ${typeof t}`)}})},string(e){return N6({toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t),...e,name:e?.name??"string"})},fixedArray:j6,option:M6,vector:D6,tuple(e,t){return new R6({fields:e,...t})},struct(e,t,s){return new C6({name:e,fields:t,...s})},enum(e,t,s){return new I6({name:e,fields:t,...s})},map:B6,lazy(e){return x6(e)}},Qc=32;function da(e){return V6(e)&&P6(e)===Qc}const L6=/^[a-zA-Z][a-zA-Z0-9_]*$/;function RE(e){return L6.test(e)}const z6=["bool","u8","u16","u32","u64","u128","u256","address","signer"],$6=/^vector<(.+)>$/;function j4(e){if(z6.includes(e))return!0;const t=e.match($6);return t?j4(t[1]):e.includes("::")?D4(e):!1}function M4(e){return!da(e.address)&&!Xu(e.address)||!RE(e.module)||!RE(e.name)?!1:e.typeParams.every(t=>typeof t=="string"?j4(t):M4(t))}function D4(e){try{return M4(ws(e))}catch{return!1}}function U4(e){if(e.startsWith("vector<")){if(!e.endsWith(">"))throw new Error(`Invalid type tag: ${e}`);const t=e.slice(7,-1);if(!t)throw new Error(`Invalid type tag: ${e}`);const s=U4(t);return typeof s=="string"?`vector<${s}>`:`vector<${De(s)}>`}return e.includes("::")?ws(e):e}function ws(e){const t=e.split("::");if(t.length<3)throw new Error(`Invalid struct tag: ${e}`);const[s,r]=t;if(!s||!r)throw new Error(`Invalid struct tag: ${e}`);const i=Xu(s),c=e.slice(s.length+r.length+4),u=c.includes("<")?c.slice(0,c.indexOf("<")):c;if(!u||c.includes("<")&&!c.endsWith(">"))throw new Error(`Invalid struct tag: ${e}`);const f=c.includes("<")?C4(c.slice(c.indexOf("<")+1,c.lastIndexOf(">"))).map(p=>U4(p.trim())):[];return{address:i?s:ye(s),module:r,name:u,typeParams:f}}function De(e){if(typeof e=="string"&&e.startsWith("vector<"))throw new Error("normalizeStructTag does not support vector types. Use normalizeTypeTag instead.");const{address:t,module:s,name:r,typeParams:i}=typeof e=="string"?ws(e):e;return`${t}::${s}::${r}${i?.length>0?`<${i.map(c=>typeof c=="string"?c:De(c)).join(",")}>`:""}`}function ye(e,t=!1){let s=e.toLowerCase();return!t&&s.startsWith("0x")&&(s=s.slice(2)),`0x${s.padStart(Qc*2,"0")}`}function jy(e,t=!1){return ye(e,t)}function V6(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function P6(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}const G6=/^vector<(.+)>$/,F6=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;var Lc=class yc{static parseFromStr(t,s=!1){if(t==="address")return{address:null};if(t==="bool")return{bool:null};if(t==="u8")return{u8:null};if(t==="u16")return{u16:null};if(t==="u32")return{u32:null};if(t==="u64")return{u64:null};if(t==="u128")return{u128:null};if(t==="u256")return{u256:null};if(t==="signer")return{signer:null};const r=t.match(G6);if(r)return{vector:yc.parseFromStr(r[1],s)};const i=t.match(F6);if(i)return{struct:{address:s?ye(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:yc.parseStructTypeArgs(i[5],s)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,s=!1){return C4(t).map(r=>yc.parseFromStr(r,s))}static tagToString(t){if("bool"in t)return"bool";if("u8"in t)return"u8";if("u16"in t)return"u16";if("u32"in t)return"u32";if("u64"in t)return"u64";if("u128"in t)return"u128";if("u256"in t)return"u256";if("address"in t)return"address";if("signer"in t)return"signer";if("vector"in t)return`vector<${yc.tagToString(t.vector)}>`;if("struct"in t){const s=t.struct,r=s.typeParams.map(yc.tagToString).join(", ");return`${s.address}::${s.module}::${s.name}${r?`<${r}>`:""}`}throw new Error("Invalid TypeTag")}};function H6(e){return E.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function q6(e){return E.enum("Option",{None:null,Some:e})}const rt=E.bytes(Qc).transform({validate:e=>{const t=typeof e=="string"?e:kr(e);if(!t||!da(ye(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?Ku(ye(e)):e,output:e=>ye(kr(e))}),qt=E.byteVector().transform({name:"ObjectDigest",input:e=>Ih(e),output:e=>Ju(new Uint8Array(e)),validate:e=>{if(Ih(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),Bs=E.struct("SuiObjectRef",{objectId:rt,version:E.u64(),digest:qt}),B4=E.struct("SharedObjectRef",{objectId:rt,initialSharedVersion:E.u64(),mutable:E.bool()}),L4=E.enum("ObjectArg",{ImmOrOwnedObject:Bs,SharedObject:B4,Receiving:Bs}),oa=E.enum("Owner",{AddressOwner:rt,ObjectOwner:rt,Shared:E.struct("Shared",{initialSharedVersion:E.u64()}),Immutable:null,ConsensusAddressOwner:E.struct("ConsensusAddressOwner",{startVersion:E.u64(),owner:rt})}),Z6=E.enum("Reservation",{MaxAmountU64:E.u64()}),Y6=E.enum("WithdrawalType",{Balance:E.lazy(()=>yo)}),W6=E.enum("WithdrawFrom",{Sender:null,Sponsor:null,SenderAllowance:E.struct("SenderAllowance",{funder:rt,allowance:rt})}),X6=E.struct("FundsWithdrawal",{reservation:Z6,typeArg:Y6,withdrawFrom:W6}),z4=E.enum("CallArg",{Pure:E.struct("Pure",{bytes:E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))})}),Object:L4,FundsWithdrawal:X6}),xv=E.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:E.lazy(()=>xv),struct:E.lazy(()=>Iv),u16:null,u32:null,u256:null}),yo=xv.transform({input:e=>typeof e=="string"?Lc.parseFromStr(e,!0):e,output:e=>Lc.tagToString(e)}),yr=E.enum("Argument",{GasCoin:null,Input:E.u16(),Result:E.u16(),NestedResult:E.tuple([E.u16(),E.u16()])}),$4=E.struct("ProgrammableMoveCall",{package:rt,module:E.string(),function:E.string(),typeArguments:E.vector(yo),arguments:E.vector(yr)}),V4=E.enum("Command",{MoveCall:$4,TransferObjects:E.struct("TransferObjects",{objects:E.vector(yr),address:yr}),SplitCoins:E.struct("SplitCoins",{coin:yr,amounts:E.vector(yr)}),MergeCoins:E.struct("MergeCoins",{destination:yr,sources:E.vector(yr)}),Publish:E.struct("Publish",{modules:E.vector(E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))})),dependencies:E.vector(rt)}),MakeMoveVec:E.struct("MakeMoveVec",{type:q6(yo).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:E.vector(yr)}),Upgrade:E.struct("Upgrade",{modules:E.vector(E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))})),dependencies:E.vector(rt),package:rt,ticket:yr})}),My=E.struct("ProgrammableTransaction",{inputs:E.vector(z4),commands:E.vector(V4)}),J6=E.struct("ValidDuring",{minEpoch:E.option(E.u64()),maxEpoch:E.option(E.u64()),minTimestamp:E.option(E.u64()),maxTimestamp:E.option(E.u64()),chain:qt,nonce:E.u32()});function Cv(e){if(e.length===0)throw new Error("Allowed proposers must not be empty");return e}function P4(e){Cv(e);for(let t=1;t<e.length;t++)if(e[t]<=e[t-1])throw new Error("Allowed proposers must be strictly increasing");return e}const K6=E.vector(E.u32()).transform({input:P4,output:Cv}),Q6=E.struct("AllowedProposers",{epoch:E.u64(),proposers:K6}),eI=E.struct("Validity",{minEpoch:E.option(E.u64()),maxEpoch:E.option(E.u64()),minTimestamp:E.option(E.u64()),maxTimestamp:E.option(E.u64()),chain:qt,nonce:E.u32(),allowedProposers:E.option(Q6)}),G4=E.enum("TransactionExpiration",{None:null,Epoch:H6(),ValidDuring:J6,Validity:eI}),Iv=E.struct("StructTag",{address:rt,module:E.string(),name:E.string(),typeParams:E.vector(xv)}),F4=E.struct("GasData",{payment:E.vector(Bs),owner:rt,price:E.u64(),budget:E.u64()}),H4=E.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),q4=E.enum("IntentVersion",{V0:null}),Z4=E.enum("AppId",{Sui:null}),Y4=E.struct("Intent",{scope:H4,version:q4,appId:Z4});function W4(e){return E.struct(`IntentMessage<${e.name}>`,{intent:Y4,value:e})}const X4=E.enum("CompressedSignature",{ED25519:E.bytes(64),Secp256k1:E.bytes(64),Secp256r1:E.bytes(64),ZkLogin:E.byteVector(),Passkey:E.byteVector()}),J4=E.enum("PublicKey",{ED25519:E.bytes(32),Secp256k1:E.bytes(33),Secp256r1:E.bytes(33),ZkLogin:E.byteVector(),Passkey:E.bytes(33)}),K4=E.struct("MultiSigPkMap",{pubKey:J4,weight:E.u8()}),Q4=E.struct("MultiSigPublicKey",{pk_map:E.vector(K4),threshold:E.u16()}),tI=E.struct("MultiSig",{sigs:E.vector(X4),bitmap:E.u16(),multisig_pk:Q4}),nI=E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))}),ek=E.struct("PasskeyAuthenticator",{authenticatorData:E.byteVector(),clientDataJson:E.string(),userSignature:E.byteVector()}),tk=E.enum("MoveObjectType",{Other:Iv,GasCoin:null,StakedSui:null,Coin:yo,AccumulatorBalanceWrapper:null}),nk=E.struct("TypeOrigin",{moduleName:E.string(),datatypeName:E.string(),package:rt}),sk=E.struct("UpgradeInfo",{upgradedId:rt,upgradedVersion:E.u64()}),rk=E.struct("MovePackage",{id:rt,version:E.u64(),moduleMap:E.map(E.string(),E.byteVector()),typeOriginTable:E.vector(nk),linkageTable:E.map(rt,sk)}),ak=E.struct("MoveObject",{type:tk,hasPublicTransfer:E.bool(),version:E.u64(),contents:E.byteVector()}),Rv=E.enum("Data",{Move:ak,Package:rk}),sI=E.struct("ObjectInner",{data:Rv,owner:oa,previousTransaction:qt,storageRebate:E.u64()}),ik=E.struct("ChangeEpoch",{epoch:E.u64(),protocolVersion:E.u64(),storageCharge:E.u64(),computationCharge:E.u64(),storageRebate:E.u64(),nonRefundableStorageFee:E.u64(),epochStartTimestampMs:E.u64(),systemPackages:E.vector(E.tuple([E.u64(),E.vector(E.byteVector()),E.vector(rt)]))}),rI=E.enum("GenesisObject",{RawObject:E.struct("RawObject",{data:Rv,owner:oa})}),aI=E.struct("GenesisTransaction",{objects:E.vector(rI)}),iI=E.struct("ConsensusCommitPrologue",{epoch:E.u64(),round:E.u64(),commitTimestampMs:E.u64()}),oI=E.struct("ConsensusCommitPrologueV2",{epoch:E.u64(),round:E.u64(),commitTimestampMs:E.u64(),consensusCommitDigest:qt}),ok=E.enum("ConsensusDeterminedVersionAssignments",{CancelledTransactions:E.vector(E.tuple([qt,E.vector(E.tuple([rt,E.u64()]))])),CancelledTransactionsV2:E.vector(E.tuple([qt,E.vector(E.tuple([E.tuple([rt,E.u64()]),E.u64()]))]))}),cI=E.struct("ConsensusCommitPrologueV3",{epoch:E.u64(),round:E.u64(),subDagIndex:E.option(E.u64()),commitTimestampMs:E.u64(),consensusCommitDigest:qt,consensusDeterminedVersionAssignments:ok}),lI=E.struct("ConsensusCommitPrologueV4",{epoch:E.u64(),round:E.u64(),subDagIndex:E.option(E.u64()),commitTimestampMs:E.u64(),consensusCommitDigest:qt,consensusDeterminedVersionAssignments:ok,additionalStateDigest:qt}),uI=E.struct("ActiveJwk",{jwkId:E.struct("JwkId",{iss:E.string(),kid:E.string()}),jwk:E.struct("JWK",{kty:E.string(),e:E.string(),n:E.string(),alg:E.string()}),epoch:E.u64()}),dI=E.struct("AuthenticatorStateUpdate",{epoch:E.u64(),round:E.u64(),newActiveJwks:E.vector(uI),authenticatorObjInitialSharedVersion:E.u64()}),fI=E.struct("RandomnessStateUpdate",{epoch:E.u64(),randomnessRound:E.u64(),randomBytes:E.byteVector(),randomnessObjInitialSharedVersion:E.u64()}),hI=E.struct("AuthenticatorStateExpire",{minEpoch:E.u64(),authenticatorObjInitialSharedVersion:E.u64()}),pI=E.enum("ExecutionTimeObservationKey",{MoveEntryPoint:E.struct("MoveEntryPoint",{package:rt,module:E.string(),function:E.string(),typeArguments:E.vector(yo)}),TransferObjects:null,SplitCoins:null,MergeCoins:null,Publish:null,MakeMoveVec:null,Upgrade:null}),mI=E.enum("StoredExecutionTimeObservations",{V1:E.vector(E.tuple([pI,E.vector(E.tuple([E.byteVector(),E.struct("Duration",{secs:E.u64(),nanos:E.u32()})]))]))}),gI=E.struct("WriteAccumulatorStorageCost",{storageCost:E.u64()}),yI=E.enum("EndOfEpochTransactionKind",{ChangeEpoch:ik,AuthenticatorStateCreate:null,AuthenticatorStateExpire:hI,RandomnessStateCreate:null,DenyListStateCreate:null,BridgeStateCreate:qt,BridgeCommitteeInit:E.u64(),StoreExecutionTimeObservations:mI,AccumulatorRootCreate:null,CoinRegistryCreate:null,DisplayRegistryCreate:null,AddressAliasStateCreate:null,WriteAccumulatorStorageCost:gI,ForwardingAddressRegistryCreate:null}),ck=E.enum("TransactionKind",{ProgrammableTransaction:My,ChangeEpoch:ik,Genesis:aI,ConsensusCommitPrologue:iI,AuthenticatorStateUpdate:dI,EndOfEpochTransaction:E.vector(yI),RandomnessStateUpdate:fI,ConsensusCommitPrologueV2:oI,ConsensusCommitPrologueV3:cI,ConsensusCommitPrologueV4:lI,ProgrammableSystemTransaction:My}),lk=E.struct("TransactionDataV1",{kind:ck,sender:rt,gasData:F4,expiration:G4}),uk=E.enum("TransactionData",{V1:lk}),dk=E.struct("SenderSignedTransaction",{intentMessage:W4(uk),txSignatures:E.vector(nI)}),vI=E.vector(dk,{name:"SenderSignedData"}),bI=E.enum("PackageUpgradeError",{UnableToFetchPackage:E.struct("UnableToFetchPackage",{packageId:rt}),NotAPackage:E.struct("NotAPackage",{objectId:rt}),IncompatibleUpgrade:null,DigestDoesNotMatch:E.struct("DigestDoesNotMatch",{digest:E.byteVector()}),UnknownUpgradePolicy:E.struct("UnknownUpgradePolicy",{policy:E.u8()}),PackageIDDoesNotMatch:E.struct("PackageIDDoesNotMatch",{packageId:rt,ticketId:rt})}),wI=E.struct("ModuleId",{address:rt,name:E.string()}),jE=E.struct("MoveLocation",{module:wI,function:E.u16(),instruction:E.u16(),functionName:E.option(E.string())}),TI=E.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:E.struct("IndexOutOfBounds",{idx:E.u16()}),SecondaryIndexOutOfBounds:E.struct("SecondaryIndexOutOfBounds",{resultIdx:E.u16(),secondaryIdx:E.u16()}),InvalidResultArity:E.struct("InvalidResultArity",{resultIdx:E.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null,InvalidArgumentArity:null,InvalidTransferObject:null,InvalidMakeMoveVecNonObjectArgument:null,ArgumentWithoutValue:null,CannotMoveBorrowedValue:null,CannotWriteToExtendedReference:null,InvalidReferenceArgument:null,InvalidTxContext:null}),EI=E.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),SI=E.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:E.struct("MoveObjectTooBig",{objectSize:E.u64(),maxObjectSize:E.u64()}),MovePackageTooBig:E.struct("MovePackageTooBig",{objectSize:E.u64(),maxObjectSize:E.u64()}),CircularObjectOwnership:E.struct("CircularObjectOwnership",{object:rt}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:E.option(jE),MoveAbort:E.tuple([jE,E.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:E.struct("CommandArgumentError",{argIdx:E.u16(),kind:TI}),TypeArgumentError:E.struct("TypeArgumentError",{argumentIdx:E.u16(),kind:EI}),UnusedValueWithoutDrop:E.struct("UnusedValueWithoutDrop",{resultIdx:E.u16(),secondaryIdx:E.u16()}),InvalidPublicFunctionReturnType:E.struct("InvalidPublicFunctionReturnType",{idx:E.u16()}),InvalidTransferObject:null,EffectsTooLarge:E.struct("EffectsTooLarge",{currentSize:E.u64(),maxSize:E.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:E.struct("PackageUpgradeError",{upgradeError:bI}),WrittenObjectsTooLarge:E.struct("WrittenObjectsTooLarge",{currentSize:E.u64(),maxSize:E.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:E.struct("ExecutionCancelledDueToSharedObjectCongestion",{congested_objects:E.vector(rt)}),AddressDeniedForCoin:E.struct("AddressDeniedForCoin",{address:rt,coinType:E.string()}),CoinTypeGlobalPause:E.struct("CoinTypeGlobalPause",{coinType:E.string()}),ExecutionCancelledDueToRandomnessUnavailable:null,MoveVectorElemTooBig:E.struct("MoveVectorElemTooBig",{valueSize:E.u64(),maxScaledSize:E.u64()}),MoveRawValueTooBig:E.struct("MoveRawValueTooBig",{valueSize:E.u64(),maxScaledSize:E.u64()}),InvalidLinkage:null,InsufficientBalanceForWithdraw:null,NonExclusiveWriteInputObjectModified:E.struct("NonExclusiveWriteInputObjectModified",{id:rt})}),jv=E.enum("ExecutionStatus",{Success:null,Failure:E.struct("Failure",{error:SI,command:E.option(E.u64())})}),fk=E.struct("GasCostSummary",{computationCost:E.u64(),storageCost:E.u64(),storageRebate:E.u64(),nonRefundableStorageFee:E.u64()}),_I=E.struct("TransactionEffectsV1",{status:jv,executedEpoch:E.u64(),gasUsed:fk,modifiedAtVersions:E.vector(E.tuple([rt,E.u64()])),sharedObjects:E.vector(Bs),transactionDigest:qt,created:E.vector(E.tuple([Bs,oa])),mutated:E.vector(E.tuple([Bs,oa])),unwrapped:E.vector(E.tuple([Bs,oa])),deleted:E.vector(Bs),unwrappedThenDeleted:E.vector(Bs),wrapped:E.vector(Bs),gasObject:E.tuple([Bs,oa]),eventsDigest:E.option(qt),dependencies:E.vector(qt)}),Mv=E.tuple([E.u64(),qt]),kI=E.enum("ObjectIn",{NotExist:null,Exist:E.tuple([Mv,oa])}),AI=E.struct("AccumulatorAddress",{address:rt,ty:yo}),OI=E.enum("AccumulatorOperation",{Merge:null,Split:null}),NI=E.enum("AccumulatorValue",{Integer:E.u64(),IntegerTuple:E.tuple([E.u64(),E.u64()]),EventDigest:E.vector(E.tuple([E.u64(),qt]))}),xI=E.struct("AccumulatorWriteV1",{address:AI,operation:OI,value:NI}),CI=E.enum("ObjectOut",{NotExist:null,ObjectWrite:E.tuple([qt,oa]),PackageWrite:Mv,AccumulatorWriteV1:xI}),II=E.enum("IDOperation",{None:null,Created:null,Deleted:null}),RI=E.struct("EffectsObjectChange",{inputState:kI,outputState:CI,idOperation:II}),jI=E.enum("UnchangedConsensusKind",{ReadOnlyRoot:Mv,MutateConsensusStreamEnded:E.u64(),ReadConsensusStreamEnded:E.u64(),Cancelled:E.u64(),PerEpochConfig:null}),MI=E.struct("TransactionEffectsV2",{status:jv,executedEpoch:E.u64(),gasUsed:fk,transactionDigest:qt,gasObjectIndex:E.option(E.u32()),eventsDigest:E.option(qt),dependencies:E.vector(qt),lamportVersion:E.u64(),changedObjects:E.vector(E.tuple([rt,RI])),unchangedConsensusObjects:E.vector(E.tuple([rt,jI])),auxDataDigest:E.option(qt)}),DI=E.enum("TransactionEffects",{V1:_I,V2:MI});function ku(e){switch(e){case"u8":return E.u8();case"u16":return E.u16();case"u32":return E.u32();case"u64":return E.u64();case"u128":return E.u128();case"u256":return E.u256();case"bool":return E.bool();case"string":return E.string();case"id":case"address":return rt}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[s,r]=t.slice(1);return s==="vector"?E.vector(ku(r)):E.option(ku(r))}throw new Error(`Invalid Pure type name: ${e}`)}const F={...E,U8:E.u8(),U16:E.u16(),U32:E.u32(),U64:E.u64(),U128:E.u128(),U256:E.u256(),ULEB128:E.uleb128(),Bool:E.bool(),String:E.string(),Address:rt,AppId:Z4,Argument:yr,CallArg:z4,Command:V4,CompressedSignature:X4,Data:Rv,GasData:F4,Intent:Y4,IntentMessage:W4,IntentScope:H4,IntentVersion:q4,MoveObject:ak,MoveObjectType:tk,MovePackage:rk,MultiSig:tI,MultiSigPkMap:K4,MultiSigPublicKey:Q4,Object:sI,ObjectArg:L4,ObjectDigest:qt,Owner:oa,PasskeyAuthenticator:ek,ProgrammableMoveCall:$4,ProgrammableTransaction:My,PublicKey:J4,SenderSignedData:vI,SenderSignedTransaction:dk,SharedObjectRef:B4,StructTag:Iv,SuiObjectRef:Bs,TransactionData:uk,TransactionDataV1:lk,TransactionEffects:DI,TransactionExpiration:G4,TransactionKind:ck,TypeOrigin:nk,TypeTag:yo,UpgradeInfo:sk},UI={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Dv(e){return UI}let BI;function LI(e){return BI?.get(e)}let zI;function $I(e){return zI?.get(e)}let VI;function PI(e,t){return VI?.get(e)?.get(t)}function Uv(e){const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}function wn(e,t,s,r,i){const c=i&&"input"in i?i.input:s.value,u=i?.expected??e.expects??null,f=i?.received??Uv(c),p={kind:e.kind,type:e.type,input:c,expected:u,received:f,message:`Invalid ${t}: ${u?`Expected ${u} but r`:"R"}eceived ${f}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},m=e.kind==="schema",g=i?.message??e.message??PI(e.reference,p.lang)??(m?$I(p.lang):null)??r.message??LI(p.lang);g!==void 0&&(p.message=typeof g=="function"?g(p):g),m&&(s.typed=!1),s.issues?s.issues.push(p):s.issues=[p]}function GI(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function FI(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function Bv(e,t){const s=[...new Set(e)];return s.length>1?`(${s.join(` ${t} `)})`:s[0]??"never"}function En(e){return e["~standard"]={version:1,vendor:"valibot",validate:t=>e["~run"]({value:t},Dv())},e}var HI=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};const qI=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;function el(e,t){return{kind:"validation",type:"check",reference:el,async:!1,expects:null,requirement:e,message:t,"~run"(s,r){return s.typed&&!this.requirement(s.value)&&wn(this,"input",s,r),s}}}function Hn(e){return{kind:"validation",type:"integer",reference:Hn,async:!1,expects:null,requirement:Number.isInteger,message:e,"~run"(t,s){return t.typed&&!this.requirement(t.value)&&wn(this,"integer",t,s),t}}}function Qu(e){return{kind:"transformation",type:"transform",reference:Qu,async:!1,operation:e,"~run"(t){return t.value=this.operation(t.value),t}}}function hk(e){return{kind:"validation",type:"uuid",reference:hk,async:!1,expects:null,requirement:qI,message:e,"~run"(t,s){return t.typed&&!this.requirement.test(t.value)&&wn(this,"UUID",t,s),t}}}const pk={abortEarly:!0};function ZI(e,t,s){return typeof e.fallback=="function"?e.fallback(t,s):e.fallback}function Tp(e,t,s){return typeof e.default=="function"?e.default(t,s):e.default}function Dy(e,t){return!e["~run"]({value:t},pk).issues}function ct(e,t){return En({kind:"schema",type:"array",reference:ct,expects:"Array",async:!1,item:e,message:t,"~run"(s,r){const i=s.value;if(Array.isArray(i)){s.typed=!0,s.value=[];for(let c=0;c<i.length;c++){const u=i[c],f=this.item["~run"]({value:u},r);if(f.issues){const p={type:"array",origin:"value",input:i,key:c,value:u};for(const m of f.issues)m.path?m.path.unshift(p):m.path=[p],s.issues?.push(m);if(s.issues||(s.issues=f.issues),r.abortEarly){s.typed=!1;break}}f.typed||(s.typed=!1),s.value.push(f.value)}}else wn(this,"type",s,r);return s}})}function Lv(e){return En({kind:"schema",type:"bigint",reference:Lv,expects:"bigint",async:!1,message:e,"~run"(t,s){return typeof t.value=="bigint"?t.typed=!0:wn(this,"type",t,s),t}})}function co(e){return En({kind:"schema",type:"boolean",reference:co,expects:"boolean",async:!1,message:e,"~run"(t,s){return typeof t.value=="boolean"?t.typed=!0:wn(this,"type",t,s),t}})}function Uy(e){return En({kind:"schema",type:"lazy",reference:Uy,expects:"unknown",async:!1,getter:e,"~run"(t,s){return this.getter(t.value)["~run"](t,s)}})}function nt(e,t){return En({kind:"schema",type:"literal",reference:nt,expects:Uv(e),async:!1,literal:e,message:t,"~run"(s,r){return GI(s.value,this.literal)?s.typed=!0:wn(this,"type",s,r),s}})}function Ct(e,t){return En({kind:"schema",type:"nullable",reference:Ct,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,"~run"(s,r){return s.value===null&&(this.default!==void 0&&(s.value=Tp(this,s,r)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,r)}})}function Ru(e,t){return En({kind:"schema",type:"nullish",reference:Ru,expects:`(${e.expects} | null | undefined)`,async:!1,wrapped:e,default:t,"~run"(s,r){return(s.value===null||s.value===void 0)&&(this.default!==void 0&&(s.value=Tp(this,s,r)),s.value===null||s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,r)}})}function Cn(e){return En({kind:"schema",type:"number",reference:Cn,expects:"number",async:!1,message:e,"~run"(t,s){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:wn(this,"type",t,s),t}})}function Ne(e,t){return En({kind:"schema",type:"object",reference:Ne,expects:"Object",async:!1,entries:e,message:t,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){s.typed=!0,s.value={};for(const c in this.entries){const u=this.entries[c];if(c in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const f=c in i?i[c]:Tp(u),p=u["~run"]({value:f},r);if(p.issues){const m={type:"object",origin:"value",input:i,key:c,value:f};for(const g of p.issues)g.path?g.path.unshift(m):g.path=[m],s.issues?.push(g);if(s.issues||(s.issues=p.issues),r.abortEarly){s.typed=!1;break}}p.typed||(s.typed=!1),s.value[c]=p.value}else if(u.fallback!==void 0)s.value[c]=ZI(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(wn(this,"key",s,r,{input:void 0,expected:`"${c}"`,path:[{type:"object",origin:"key",input:i,key:c,value:i[c]}]}),r.abortEarly))break}}else wn(this,"type",s,r);return s}})}function dn(e,t){return En({kind:"schema",type:"optional",reference:dn,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,"~run"(s,r){return s.value===void 0&&(this.default!==void 0&&(s.value=Tp(this,s,r)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,r)}})}function zv(e,t){return En({kind:"schema",type:"picklist",reference:zv,expects:Bv(e.map(Uv),"|"),async:!1,options:e,message:t,"~run"(s,r){return this.options.includes(s.value)?s.typed=!0:wn(this,"type",s,r),s}})}function ju(e,t,s){return En({kind:"schema",type:"record",reference:ju,expects:"Object",async:!1,key:e,value:t,message:s,"~run"(r,i){const c=r.value;if(c&&typeof c=="object"){r.typed=!0,r.value={};for(const u in c)if(FI(c,u)){const f=c[u],p=this.key["~run"]({value:u},i);if(p.issues){const g={type:"object",origin:"key",input:c,key:u,value:f};for(const y of p.issues)y.path=[g],r.issues?.push(y);if(r.issues||(r.issues=p.issues),i.abortEarly){r.typed=!1;break}}const m=this.value["~run"]({value:f},i);if(m.issues){const g={type:"object",origin:"value",input:c,key:u,value:f};for(const y of m.issues)y.path?y.path.unshift(g):y.path=[g],r.issues?.push(y);if(r.issues||(r.issues=m.issues),i.abortEarly){r.typed=!1;break}}(!p.typed||!m.typed)&&(r.typed=!1),p.typed&&(r.value[p.value]=m.value)}}else wn(this,"type",r,i);return r}})}function Be(e){return En({kind:"schema",type:"string",reference:Be,expects:"string",async:!1,message:e,"~run"(t,s){return typeof t.value=="string"?t.typed=!0:wn(this,"type",t,s),t}})}function $v(e,t){return En({kind:"schema",type:"tuple",reference:$v,expects:"Array",async:!1,items:e,message:t,"~run"(s,r){const i=s.value;if(Array.isArray(i)){s.typed=!0,s.value=[];for(let c=0;c<this.items.length;c++){const u=i[c],f=this.items[c]["~run"]({value:u},r);if(f.issues){const p={type:"array",origin:"value",input:i,key:c,value:u};for(const m of f.issues)m.path?m.path.unshift(p):m.path=[p],s.issues?.push(m);if(s.issues||(s.issues=f.issues),r.abortEarly){s.typed=!1;break}}f.typed||(s.typed=!1),s.value.push(f.value)}}else wn(this,"type",s,r);return s}})}function ME(e){let t;if(e)for(const s of e)if(t)for(const r of s.issues)t.push(r);else t=s.issues;return t}function er(e,t){return En({kind:"schema",type:"union",reference:er,expects:Bv(e.map(s=>s.expects),"|"),async:!1,options:e,message:t,"~run"(s,r){let i,c,u;for(const f of this.options){const p=f["~run"]({value:s.value},r);if(p.typed)if(p.issues)c?c.push(p):c=[p];else{i=p;break}else u?u.push(p):u=[p]}if(i)return i;if(c){if(c.length===1)return c[0];wn(this,"type",s,r,{issues:ME(c)}),s.typed=!0}else{if(u?.length===1)return u[0];wn(this,"type",s,r,{issues:ME(u)})}return s}})}function tl(){return En({kind:"schema",type:"unknown",reference:tl,expects:"unknown",async:!1,"~run"(e){return e.typed=!0,e}})}function Ep(e,t,s){return En({kind:"schema",type:"variant",reference:Ep,expects:"Object",async:!1,key:e,options:t,message:s,"~run"(r,i){const c=r.value;if(c&&typeof c=="object"){let u,f=0,p=this.key,m=[];const g=(y,b)=>{for(const S of y.options){if(S.type==="variant")g(S,new Set(b).add(S.key));else{let A=!0,N=0;for(const j of b){const V=S.entries[j];if(j in c?V["~run"]({typed:!1,value:c[j]},pk).issues:V.type!=="exact_optional"&&V.type!=="optional"&&V.type!=="nullish"){A=!1,p!==j&&(f<N||f===N&&j in c&&!(p in c))&&(f=N,p=j,m=[]),p===j&&m.push(S.entries[j].expects);break}N++}if(A){const j=S["~run"]({value:c},i);(!u||!u.typed&&j.typed)&&(u=j)}}if(u&&!u.issues)break}};if(g(this,new Set([this.key])),u)return u;wn(this,"type",r,i,{input:c[p],expected:Bv(m,"|"),path:[{type:"object",origin:"value",input:c,key:p,value:c[p]}]})}else wn(this,"type",r,i);return r}})}function St(e,t,s){const r=e["~run"]({value:t},Dv());if(r.issues)throw new HI(r.issues);return r.value}function Xt(...e){return En({...e[0],pipe:e,"~run"(t,s){for(const r of e)if(r.kind!=="metadata"){if(t.issues&&(r.kind==="schema"||r.kind==="transformation")){t.typed=!1;break}(!t.issues||!s.abortEarly&&!s.abortPipeEarly)&&(t=r["~run"](t,s))}return t}})}function YI(e,t,s){const r=e["~run"]({value:t},Dv());return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}function jr(e){const t=Object.keys(e).map(s=>Ne({[s]:e[s],$kind:nt(s)}));return Xt(tl(),el(s=>DE(s,e)===void 0,({input:s,message:r})=>DE(s,e)??r),Qu(WI),Ep("$kind",t))}function mk(e){return typeof e!="object"||e===null?null:"$kind"in e&&typeof e.$kind=="string"?e.$kind:Object.keys(e).find(t=>t!=="$kind")??null}function WI(e){if(typeof e!="object"||e===null||"$kind"in e)return e;const t=mk(e);return t===null?e:{...e,$kind:t}}function DE(e,t){const s=mk(e);if(!(s===null||Object.hasOwn(t,s)))return`Unsupported enum variant "${s}". Expected one of: ${Object.keys(t).map(r=>`"${r}"`).join(", ")}.`}function Vf(e,t){return Xt(Ne({...t.entries,$kind:dn(nt(e))}),Qu(s=>({...s,$kind:e})))}const vo=Xt(Be(),Qu(e=>ye(e)),el(da)),ss=vo,lo=Be(),nn=Xt(er([Be(),Xt(Cn(),Hn())]),el(e=>{try{return BigInt(e),BigInt(e)>=0&&BigInt(e)<=18446744073709551615n}catch{return!1}},"Invalid u64")),gk=Xt(Cn(),Hn(),el(e=>e>=0&&e<2**32,"Invalid u32")),fi=Ne({objectId:vo,version:nn,digest:Be()}),Dt=er([Vf("GasCoin",Ne({GasCoin:nt(!0)})),Vf("Input",Ne({Input:Xt(Cn(),Hn()),type:dn(er([nt("pure"),nt("object"),nt("withdrawal")]))})),Vf("Result",Ne({Result:Xt(Cn(),Hn())})),Vf("NestedResult",Ne({NestedResult:$v([Xt(Cn(),Hn()),Xt(Cn(),Hn())])}))]),XI=Ne({budget:Ct(nn),price:Ct(nn),owner:Ct(vo),payment:Ct(ct(fi))}),By=er([Ne({$kind:nt("address")}),Ne({$kind:nt("bool")}),Ne({$kind:nt("u8")}),Ne({$kind:nt("u16")}),Ne({$kind:nt("u32")}),Ne({$kind:nt("u64")}),Ne({$kind:nt("u128")}),Ne({$kind:nt("u256")}),Ne({$kind:nt("unknown")}),Ne({$kind:nt("vector"),vector:Uy(()=>By)}),Ne({$kind:nt("datatype"),datatype:Ne({typeName:Be(),typeParameters:ct(Uy(()=>By))})}),Ne({$kind:nt("typeParameter"),index:Xt(Cn(),Hn())})]),JI=Ne({reference:Ct(er([nt("mutable"),nt("immutable"),nt("unknown")])),body:By}),KI=Ne({package:ss,module:Be(),function:Be(),typeArguments:ct(Be()),arguments:ct(Dt),_argumentTypes:dn(Ct(ct(JI)))}),QI=Ne({name:Be(),inputs:ju(Be(),er([Dt,ct(Dt)])),data:ju(Be(),tl())}),eR=jr({MoveCall:KI,TransferObjects:Ne({objects:ct(Dt),address:Dt}),SplitCoins:Ne({coin:Dt,amounts:ct(Dt)}),MergeCoins:Ne({destination:Dt,sources:ct(Dt)}),Publish:Ne({modules:ct(lo),dependencies:ct(ss)}),MakeMoveVec:Ne({type:Ct(Be()),elements:ct(Dt)}),Upgrade:Ne({modules:ct(lo),dependencies:ct(ss),package:ss,ticket:Dt}),$Intent:QI}),yk=jr({ImmOrOwnedObject:fi,SharedObject:Ne({objectId:ss,initialSharedVersion:nn,mutable:co()}),Receiving:fi}),tR=jr({MaxAmountU64:nn}),nR=jr({Balance:Be()}),sR=jr({Sender:nt(!0),Sponsor:nt(!0),SenderAllowance:Ne({funder:vo,allowance:ss})}),vk=Ne({reservation:tR,typeArg:nR,withdrawFrom:sR}),rR=jr({Object:yk,Pure:Ne({bytes:lo}),UnresolvedPure:Ne({value:tl()}),UnresolvedObject:Ne({objectId:ss,version:dn(Ct(nn)),digest:dn(Ct(Be())),initialSharedVersion:dn(Ct(nn)),mutable:dn(Ct(co()))}),FundsWithdrawal:vk}),UE=jr({Object:yk,Pure:Ne({bytes:lo})}),Vv=Ne({minEpoch:Ct(nn),maxEpoch:Ct(nn),minTimestamp:Ct(nn),maxTimestamp:Ct(nn),chain:Be(),nonce:gk}),aR=Ne({epoch:nn,proposers:Xt(ct(gk),el(e=>e.length>0,"Allowed proposers must not be empty"))}),bk=Ne({...Vv.entries,allowedProposers:Ct(aR)}),wk=jr({None:nt(!0),Epoch:nn,ValidDuring:Vv,Validity:bk}),ah=Ne({version:nt(2),sender:Ru(vo),expiration:Ru(wk),gasData:XI,inputs:ct(rR),commands:ct(eR)});function Mh(e){if(typeof e=="string")return ye(e);if(e.Object)return e.Object.ImmOrOwnedObject?ye(e.Object.ImmOrOwnedObject.objectId):e.Object.Receiving?ye(e.Object.Receiving.objectId):ye(e.Object.SharedObject.objectId);if(e.UnresolvedObject)return ye(e.UnresolvedObject.objectId)}function iR(e,t,s){const r=i=>{switch(i.$kind){case"Input":{const c=t.get(i.Input);if(c===void 0)throw new Error(`Input ${i.Input} not found in input mapping`);return{...i,Input:c}}case"Result":{const c=s.get(i.Result);return c!==void 0?{...i,Result:c}:i}case"NestedResult":{const c=s.get(i.NestedResult[0]);return c!==void 0?{...i,NestedResult:[c,i.NestedResult[1]]}:i}default:return i}};switch(e.$kind){case"MoveCall":e.MoveCall.arguments=e.MoveCall.arguments.map(r);break;case"TransferObjects":e.TransferObjects.objects=e.TransferObjects.objects.map(r),e.TransferObjects.address=r(e.TransferObjects.address);break;case"SplitCoins":e.SplitCoins.coin=r(e.SplitCoins.coin),e.SplitCoins.amounts=e.SplitCoins.amounts.map(r);break;case"MergeCoins":e.MergeCoins.destination=r(e.MergeCoins.destination),e.MergeCoins.sources=e.MergeCoins.sources.map(r);break;case"MakeMoveVec":e.MakeMoveVec.elements=e.MakeMoveVec.elements.map(r);break;case"Upgrade":e.Upgrade.ticket=r(e.Upgrade.ticket);break;case"$Intent":{const i=e.$Intent.inputs;e.$Intent.inputs={};for(const[c,u]of Object.entries(i))e.$Intent.inputs[c]=Array.isArray(u)?u.map(r):r(u);break}}}const BE=Ne({digest:Be(),objectId:Be(),version:er([Xt(Cn(),Hn()),Be(),Lv()])}),oR=jr({ImmOrOwned:BE,Shared:Ne({objectId:ss,initialSharedVersion:nn,mutable:co()}),Receiving:BE}),LE=jr({Object:oR,Pure:ct(Xt(Cn(),Hn()))});function cR(e){if(!e)return null;switch(e.$kind){case"Epoch":return{Epoch:Number(e.Epoch)};case"ValidDuring":return{ValidDuring:e.ValidDuring};case"Validity":return{Validity:e.Validity};case"None":return{None:!0};default:throw new Error(`Unknown transaction expiration: ${JSON.stringify(e)}`)}}function lR(e){if(!e)return null;if("Epoch"in e)return{Epoch:e.Epoch};if("ValidDuring"in e)return{ValidDuring:e.ValidDuring};if("Validity"in e)return{Validity:e.Validity};if("None"in e)return{None:!0};throw new Error(`Unknown transaction expiration in v1 transaction data: ${Object.keys(e).join(", ")}`)}function uR(e){const t=e.inputs.map((s,r)=>{if(s.Object)return{kind:"Input",index:r,value:{Object:s.Object.ImmOrOwnedObject?{ImmOrOwned:s.Object.ImmOrOwnedObject}:s.Object.Receiving?{Receiving:{digest:s.Object.Receiving.digest,version:s.Object.Receiving.version,objectId:s.Object.Receiving.objectId}}:{Shared:{mutable:s.Object.SharedObject.mutable,initialSharedVersion:s.Object.SharedObject.initialSharedVersion,objectId:s.Object.SharedObject.objectId}}},type:"object"};if(s.Pure)return{kind:"Input",index:r,value:{Pure:Array.from(qe(s.Pure.bytes))},type:"pure"};if(s.UnresolvedPure)return{kind:"Input",type:"pure",index:r,value:s.UnresolvedPure.value};if(s.UnresolvedObject)return{kind:"Input",type:"object",index:r,value:s.UnresolvedObject.objectId};throw new Error("Invalid input")});return{version:1,sender:e.sender??void 0,expiration:cR(e.expiration),gasConfig:{owner:e.gasData.owner??void 0,budget:e.gasData.budget??void 0,price:e.gasData.price??void 0,payment:e.gasData.payment??void 0},inputs:t,transactions:e.commands.map(s=>{if(s.MakeMoveVec)return{kind:"MakeMoveVec",type:s.MakeMoveVec.type===null?{None:!0}:{Some:Lc.parseFromStr(s.MakeMoveVec.type)},objects:s.MakeMoveVec.elements.map(r=>Wr(r,t))};if(s.MergeCoins)return{kind:"MergeCoins",destination:Wr(s.MergeCoins.destination,t),sources:s.MergeCoins.sources.map(r=>Wr(r,t))};if(s.MoveCall)return{kind:"MoveCall",target:`${s.MoveCall.package}::${s.MoveCall.module}::${s.MoveCall.function}`,typeArguments:s.MoveCall.typeArguments,arguments:s.MoveCall.arguments.map(r=>Wr(r,t))};if(s.Publish)return{kind:"Publish",modules:s.Publish.modules.map(r=>Array.from(qe(r))),dependencies:s.Publish.dependencies};if(s.SplitCoins)return{kind:"SplitCoins",coin:Wr(s.SplitCoins.coin,t),amounts:s.SplitCoins.amounts.map(r=>Wr(r,t))};if(s.TransferObjects)return{kind:"TransferObjects",objects:s.TransferObjects.objects.map(r=>Wr(r,t)),address:Wr(s.TransferObjects.address,t)};if(s.Upgrade)return{kind:"Upgrade",modules:s.Upgrade.modules.map(r=>Array.from(qe(r))),dependencies:s.Upgrade.dependencies,packageId:s.Upgrade.package,ticket:Wr(s.Upgrade.ticket,t)};throw new Error(`Unknown transaction ${Object.keys(s)}`)})}}function Wr(e,t){if(e.$kind==="GasCoin")return{kind:"GasCoin"};if(e.$kind==="Result")return{kind:"Result",index:e.Result};if(e.$kind==="NestedResult")return{kind:"NestedResult",index:e.NestedResult[0],resultIndex:e.NestedResult[1]};if(e.$kind==="Input")return t[e.Input];throw new Error(`Invalid argument ${Object.keys(e)}`)}function dR(e){return St(ah,{version:2,sender:e.sender??null,expiration:lR(e.expiration),gasData:{owner:e.gasConfig.owner??null,budget:e.gasConfig.budget?.toString()??null,price:e.gasConfig.price?.toString()??null,payment:e.gasConfig.payment?.map(t=>({digest:t.digest,objectId:t.objectId,version:t.version.toString()}))??null},inputs:e.inputs.map(t=>{if(t.kind==="Input"){if(Dy(LE,t.value)){const s=St(LE,t.value);if(s.Object){if(s.Object.ImmOrOwned)return{Object:{ImmOrOwnedObject:{objectId:s.Object.ImmOrOwned.objectId,version:String(s.Object.ImmOrOwned.version),digest:s.Object.ImmOrOwned.digest}}};if(s.Object.Shared)return{Object:{SharedObject:{mutable:s.Object.Shared.mutable??null,initialSharedVersion:s.Object.Shared.initialSharedVersion,objectId:s.Object.Shared.objectId}}};if(s.Object.Receiving)return{Object:{Receiving:{digest:s.Object.Receiving.digest,version:String(s.Object.Receiving.version),objectId:s.Object.Receiving.objectId}}};throw new Error("Invalid object input")}return{Pure:{bytes:st(new Uint8Array(s.Pure))}}}return t.type==="object"?{UnresolvedObject:{objectId:t.value}}:{UnresolvedPure:{value:t.value}}}throw new Error("Invalid input")}),commands:e.transactions.map(t=>{switch(t.kind){case"MakeMoveVec":return{MakeMoveVec:{type:"Some"in t.type?Lc.tagToString(t.type.Some):null,elements:t.objects.map(s=>Xr(s))}};case"MergeCoins":return{MergeCoins:{destination:Xr(t.destination),sources:t.sources.map(s=>Xr(s))}};case"MoveCall":{const[s,r,i]=t.target.split("::");return{MoveCall:{package:s,module:r,function:i,typeArguments:t.typeArguments,arguments:t.arguments.map(c=>Xr(c))}}}case"Publish":return{Publish:{modules:t.modules.map(s=>st(Uint8Array.from(s))),dependencies:t.dependencies}};case"SplitCoins":return{SplitCoins:{coin:Xr(t.coin),amounts:t.amounts.map(s=>Xr(s))}};case"TransferObjects":return{TransferObjects:{objects:t.objects.map(s=>Xr(s)),address:Xr(t.address)}};case"Upgrade":return{Upgrade:{modules:t.modules.map(s=>st(Uint8Array.from(s))),dependencies:t.dependencies,package:t.packageId,ticket:Xr(t.ticket)}}}throw new Error(`Unknown transaction ${Object.keys(t)}`)})})}function Xr(e){switch(e.kind){case"GasCoin":return{GasCoin:!0};case"Result":return{Result:e.index};case"NestedResult":return{NestedResult:[e.index,e.resultIndex]};case"Input":return{Input:e.index}}}function Ly(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const zy=e=>e?`"${e}" `:"";function rs(e,t=""){if(typeof e!="number")throw new TypeError(zy(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(zy(t)+"expected integer >= 0, got "+e);return e}function Dn(e,t,s=""){if(Ly(e)&&(t===void 0||e.length===t))return e;t!==void 0&&rs(t,"length");const r=Ly(e),i=t!==void 0?` of length ${t}`:"",c=r?`length=${e.length}`:`type=${typeof e}`,u=zy(s)+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(u):new TypeError(u)}function zE(e){return Uint8Array.from(Dn(e))}function Pv(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("expected hash wrapped by utils.createHasher");if(rs(e.outputLen),rs(e.blockLen),e.outputLen<1||e.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}const fR=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},$E=(e,t)=>{fR(e,t);const s=Object.getPrototypeOf(e);if(s!==Object.prototype&&s!==null)throw new TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw new TypeError(`"${t}.__proto__" is not allowed`)};function zc(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function Gv(e,t){Dn(e,void 0,"output");const s=t.outputLen;if(!(e.length>=s))throw new RangeError('"output" expected length >= '+s)}function Dh(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function zs(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ih(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function mr(e,t){return e<<32-t|e>>>t}const Tk=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ek(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const ea=Tk?e=>e:e=>Ek(e)>>>0;function hR(e){for(let t=0;t<e.length;t++)e[t]=Ek(e[t]);return e}const hc=Tk?e=>e:hR,Sk=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",pR=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ed(e){if(Dn(e),Sk)return e.toHex();let t="";for(let s=0;s<e.length;s++)t+=pR[e[s]];return t}function VE(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function Fv(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);if(Sk)try{return Uint8Array.fromHex(e)}catch(i){throw i instanceof SyntaxError?new RangeError(i.message):i}const t=e.length,s=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(s);for(let i=0,c=0;i<s;i++,c+=2){const u=VE(e.charCodeAt(c)),f=VE(e.charCodeAt(c+1));if(u===void 0||f===void 0){const p=e[c]+e[c+1];throw new RangeError('hex string expected, got non-hex character "'+p+'" at index '+c)}r[i]=u*16+f}return r}function mR(e){if(typeof e!="string")throw new TypeError("string expected");const t=new TextEncoder().encode(e);try{return new Uint8Array(t)}finally{zs(t)}}function PE(e,t=""){return typeof e=="string"?mR(e):Dn(e,void 0,t)}function gR(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];Dn(i),t+=i.length}const s=new Uint8Array(t);for(let r=0,i=0;r<e.length;r++){const c=e[r];s.set(c,i),i+=c.length}return s}function Hv(e,t,s="opts"){return $E(e,"defaults"),t!==void 0&&$E(t,s),Object.assign(Object.create(null),e,t)}function qv(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=Hv({},t,"info");const s=(i,c)=>e(c).update(i).digest(),r=e(void 0);return s.outputLen=r.outputLen,s.blockLen=r.blockLen,s.canXOF=r.canXOF,s.create=i=>e(i),Object.assign(s,t),Object.freeze(s)}function yR(e=32){rs(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof t?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const _k=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),vR=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),Pf=BigInt(2**32-1),GE=BigInt(32);function bR(e,t=!1){return t?{h:Number(e&Pf),l:Number(e>>GE&Pf)}:{h:Number(e>>GE&Pf)|0,l:Number(e&Pf)|0}}function wR(e,t=!1){const s=e.length;let r=new Uint32Array(s),i=new Uint32Array(s);for(let c=0;c<s;c++){const{h:u,l:f}=bR(e[c],t);[r[c],i[c]]=[u,f]}return[r,i]}const kk=e=>e/2**32|0,Ak=e=>e>>>0;function TR(e,t,s,r){const i=kk(s),c=Ak(s);e.setUint32(t,r?c:i,r),e.setUint32(t+4,r?i:c,r)}const FE=(e,t,s)=>e>>>s,HE=(e,t,s)=>e<<32-s|t>>>s,ti=(e,t,s)=>e>>>s|t<<32-s,ni=(e,t,s)=>e<<32-s|t>>>s,yu=(e,t,s)=>e<<64-s|t>>>s-32,vu=(e,t,s)=>e>>>s-32|t<<64-s,ER=(e,t)=>t,SR=(e,t)=>e;function Ys(e,t,s,r){const i=(t>>>0)+(r>>>0);return{h:e+s+(i/2**32|0)|0,l:i|0}}const Zv=(e,t,s)=>(e>>>0)+(t>>>0)+(s>>>0),Yv=(e,t,s,r)=>t+s+r+(e/2**32|0)|0,_R=(e,t,s,r)=>(e>>>0)+(t>>>0)+(s>>>0)+(r>>>0),kR=(e,t,s,r,i)=>t+s+r+i+(e/2**32|0)|0,AR=(e,t,s,r,i)=>(e>>>0)+(t>>>0)+(s>>>0)+(r>>>0)+(i>>>0),OR=(e,t,s,r,i,c)=>t+s+r+i+c+(e/2**32|0)|0;function NR(e,t,s){return e&t^~e&s}function xR(e,t,s){return e&t^e&s^t&s}class Ok{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,s,r,i){this.blockLen=t,this.outputLen=s,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=ih(this.buffer)}update(t){zc(this),Dn(t);const{view:s,buffer:r,blockLen:i}=this,c=t.length;let u=!1;for(let f=0;f<c;){const p=Math.min(i-this.pos,c-f);if(p===i){const m=ih(t);for(;i<=c-f;f+=i)this.process(m,f);u=!0;continue}r.set(f===0&&p===c?t:t.subarray(f,f+p),this.pos),this.pos+=p,f+=p,this.pos===i&&(this.process(s,0),this.pos=0,u=!0)}return this.length+=t.length,u&&this.roundClean(),this}digestInto(t){zc(this),Gv(t,this),this.finished=!0;const{buffer:s,view:r,blockLen:i,isLE:c}=this;let{pos:u}=this;s[u++]=128,s.fill(0,u),this.padOffset>i-u&&(this.process(r,0),s.fill(0)),TR(r,i-8,this.length*8,c),this.process(r,0),this.roundClean();const f=t===s?r:ih(t),p=this.outputLen,m=p/4,g=this.get();if(p%4||m>g.length)throw new Error("invalid outputLen");for(let y=0;y<m;y++)f.setUint32(4*y,g[y],c)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const r=t.slice(0,s);return this.destroy(),r}_cloneIntoMeta(t){const{buffer:s,length:r,finished:i,destroyed:c,pos:u}=this;return t.destroyed=c,t.finished=i,t.length=r,t.pos=u,u&&t.buffer.set(s),t}clone(){return this._cloneInto()}}const CR=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),IR=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),an=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Se=new Uint32Array(32);function Za(e,t,s,r,i,c){const u=i[c],f=i[c+1];let p=Se[2*e],m=Se[2*e+1],g=Se[2*t],y=Se[2*t+1],b=Se[2*s],S=Se[2*s+1],A=Se[2*r],N=Se[2*r+1];const j=Zv(p,g,u);m=Yv(j,m,y,f),p=j|0;let V=N^m,C=A^p;N=ER(V,C),A=SR(V),{h:S,l:b}=Ys(S,b,N,A),V=y^S,C=g^b,y=ti(V,C,24),g=ni(V,C,24),Se[2*e]=p,Se[2*e+1]=m,Se[2*t]=g,Se[2*t+1]=y,Se[2*s]=b,Se[2*s+1]=S,Se[2*r]=A,Se[2*r+1]=N}function Ya(e,t,s,r,i,c){const u=i[c],f=i[c+1];let p=Se[2*e],m=Se[2*e+1],g=Se[2*t],y=Se[2*t+1],b=Se[2*s],S=Se[2*s+1],A=Se[2*r],N=Se[2*r+1];const j=Zv(p,g,u);m=Yv(j,m,y,f),p=j|0;let V=N^m,C=A^p;N=ti(V,C,16),A=ni(V,C,16),{h:S,l:b}=Ys(S,b,N,A),V=y^S,C=g^b,y=yu(V,C,63),g=vu(V,C,63),Se[2*e]=p,Se[2*e+1]=m,Se[2*t]=g,Se[2*t+1]=y,Se[2*s]=b,Se[2*s+1]=S,Se[2*r]=A,Se[2*r+1]=N}function RR(e,t={},s,r,i){if(rs(s),e<=0||e>s)throw new Error('"dkLen" must be 1..'+s+", got "+e);const{key:c,salt:u,personalization:f}=t;if(c!==void 0&&(c.length<1||c.length>s))throw new Error('"key" expected to be undefined or of length=1..'+s);u!==void 0&&Dn(u,r,"salt"),f!==void 0&&Dn(f,i,"personalization")}class jR{buffer;buffer32;finished=!1;destroyed=!1;length=0;pos=0;blockLen;outputLen;canXOF=!1;constructor(t,s){rs(t),rs(s),this.blockLen=t,this.outputLen=s,this.buffer=new Uint8Array(t),this.buffer32=Dh(this.buffer)}update(t){zc(this),Dn(t);const{blockLen:s,buffer:r,buffer32:i}=this,c=t.length,u=t.byteOffset,f=t.buffer;for(let p=0;p<c;){this.pos===s&&(hc(i),this.compress(i,0,!1),hc(i),this.pos=0);const m=Math.min(s-this.pos,c-p),g=u+p;if(m===s&&!(g%4)&&p+m<c){const y=new Uint32Array(f,g,Math.floor((c-p)/4));hc(y);for(let b=0;p+s<c;b+=i.length,p+=s)this.length+=s,this.compress(y,b,!1);hc(y);continue}r.set(p===0&&m===c?t:t.subarray(p,p+m),this.pos),this.pos+=m,this.length+=m,p+=m}return this}digestInto(t){if(zc(this),Gv(t,this),t.byteOffset&3)throw new RangeError('"output" expected 4-byte aligned byteOffset, got '+t.byteOffset);const{pos:s,buffer32:r}=this;this.finished=!0,this.buffer.fill(0,s),hc(r),this.compress(r,0,!0),hc(r);const i=this.get(),c=t===this.buffer?r:Dh(t),u=Math.floor(this.outputLen/4);for(let g=0;g<u;g++)c[g]=ea(i[g]);const f=this.outputLen%4;if(!f)return;const p=u*4,m=i[u];for(let g=0;g<f;g++)t[p+g]=m>>>8*g}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const r=t.slice(0,s);return this.destroy(),r}_cloneInto(t){const{buffer:s,length:r,finished:i,destroyed:c,outputLen:u,pos:f}=this;return t||=new this.constructor({dkLen:u}),t.set(...this.get()),t.buffer.set(s),t.destroyed=c,t.finished=i,t.length=r,t.pos=f,t.outputLen=u,t}clone(){return this._cloneInto()}}class MR extends jR{v0l=an[0]|0;v0h=an[1]|0;v1l=an[2]|0;v1h=an[3]|0;v2l=an[4]|0;v2h=an[5]|0;v3l=an[6]|0;v3h=an[7]|0;v4l=an[8]|0;v4h=an[9]|0;v5l=an[10]|0;v5h=an[11]|0;v6l=an[12]|0;v6h=an[13]|0;v7l=an[14]|0;v7h=an[15]|0;constructor(t={}){t=Hv({},t);const s=t.dkLen===void 0?64:t.dkLen;super(128,s),RR(s,t,64,16,16);let{key:r,personalization:i,salt:c}=t,u=0;if(r!==void 0&&(Dn(r,void 0,"key"),u=r.length),this.v0l^=this.outputLen|u<<8|65536|1<<24,c!==void 0){Dn(c,void 0,"salt");const f=Dh(zE(c));this.v4l^=ea(f[0]),this.v4h^=ea(f[1]),this.v5l^=ea(f[2]),this.v5h^=ea(f[3])}if(i!==void 0){Dn(i,void 0,"personalization");const f=Dh(zE(i));this.v6l^=ea(f[0]),this.v6h^=ea(f[1]),this.v7l^=ea(f[2]),this.v7h^=ea(f[3])}if(r!==void 0){const f=new Uint8Array(this.blockLen);f.set(r),this.update(f),zs(f)}}get(){let{v0l:t,v0h:s,v1l:r,v1h:i,v2l:c,v2h:u,v3l:f,v3h:p,v4l:m,v4h:g,v5l:y,v5h:b,v6l:S,v6h:A,v7l:N,v7h:j}=this;return[t,s,r,i,c,u,f,p,m,g,y,b,S,A,N,j]}set(t,s,r,i,c,u,f,p,m,g,y,b,S,A,N,j){this.v0l=t|0,this.v0h=s|0,this.v1l=r|0,this.v1h=i|0,this.v2l=c|0,this.v2h=u|0,this.v3l=f|0,this.v3h=p|0,this.v4l=m|0,this.v4h=g|0,this.v5l=y|0,this.v5h=b|0,this.v6l=S|0,this.v6h=A|0,this.v7l=N|0,this.v7h=j|0}compress(t,s,r){const{v0l:i,v0h:c,v1l:u,v1h:f,v2l:p,v2h:m,v3l:g,v3h:y,v4l:b,v4h:S,v5l:A,v5h:N,v6l:j,v6h:V,v7l:C,v7h:W}=this;Se[0]=i,Se[1]=c,Se[2]=u,Se[3]=f,Se[4]=p,Se[5]=m,Se[6]=g,Se[7]=y,Se[8]=b,Se[9]=S,Se[10]=A,Se[11]=N,Se[12]=j,Se[13]=V,Se[14]=C,Se[15]=W,Se.set(an,16);const ce=Ak(this.length),ae=kk(this.length);Se[24]=an[8]^ce,Se[25]=an[9]^ae,r&&(Se[28]=~Se[28],Se[29]=~Se[29]);let Y=0;const K=vR;for(let w=0;w<12;w++)Za(0,4,8,12,t,s+2*K[Y++]),Ya(0,4,8,12,t,s+2*K[Y++]),Za(1,5,9,13,t,s+2*K[Y++]),Ya(1,5,9,13,t,s+2*K[Y++]),Za(2,6,10,14,t,s+2*K[Y++]),Ya(2,6,10,14,t,s+2*K[Y++]),Za(3,7,11,15,t,s+2*K[Y++]),Ya(3,7,11,15,t,s+2*K[Y++]),Za(0,5,10,15,t,s+2*K[Y++]),Ya(0,5,10,15,t,s+2*K[Y++]),Za(1,6,11,12,t,s+2*K[Y++]),Ya(1,6,11,12,t,s+2*K[Y++]),Za(2,7,8,13,t,s+2*K[Y++]),Ya(2,7,8,13,t,s+2*K[Y++]),Za(3,4,9,14,t,s+2*K[Y++]),Ya(3,4,9,14,t,s+2*K[Y++]);this.v0l^=Se[0]^Se[16],this.v0h^=Se[1]^Se[17],this.v1l^=Se[2]^Se[18],this.v1h^=Se[3]^Se[19],this.v2l^=Se[4]^Se[20],this.v2h^=Se[5]^Se[21],this.v3l^=Se[6]^Se[22],this.v3h^=Se[7]^Se[23],this.v4l^=Se[8]^Se[24],this.v4h^=Se[9]^Se[25],this.v5l^=Se[10]^Se[26],this.v5h^=Se[11]^Se[27],this.v6l^=Se[12]^Se[28],this.v6h^=Se[13]^Se[29],this.v7l^=Se[14]^Se[30],this.v7h^=Se[15]^Se[31],zs(Se)}destroy(){this.destroyed=!0,zs(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const $c=qv(e=>new MR(e));function DR(e,t){const s=Array.from(`${e}::`).map(i=>i.charCodeAt(0)),r=new Uint8Array(s.length+t.length);return r.set(s),r.set(t,s.length),$c(r,{dkLen:32})}function qE(e){return ye(e).replace("0x","")}var Xi=class Yi{static fromKindBytes(t){const s=F.TransactionKind.parse(t).ProgrammableTransaction;if(!s)throw new Error("Unable to deserialize from bytes.");return Yi.restore({version:2,sender:null,expiration:null,gasData:{budget:null,owner:null,payment:null,price:null},inputs:s.inputs,commands:s.commands})}static fromBytes(t){const s=F.TransactionData.parse(t)?.V1,r=s.kind.ProgrammableTransaction;if(!s||!r)throw new Error("Unable to deserialize from bytes.");return Yi.restore({version:2,sender:s.sender,expiration:s.expiration,gasData:s.gasData,inputs:r.inputs,commands:r.commands})}static restore(t){return t.version===2?new Yi(St(ah,t)):new Yi(St(ah,dR(t)))}static getDigestFromBytes(t){return Ju(DR("TransactionData",t))}constructor(t){this.version=2,this.sender=t?.sender??null,this.expiration=t?.expiration??null,this.inputs=t?.inputs??[],this.commands=t?.commands??[],this.gasData=t?.gasData??{budget:null,price:null,owner:null,payment:null}}build({maxSizeBytes:t=1/0,overrides:s,onlyTransactionKind:r}={}){const i=this.inputs,c=this.commands,u={ProgrammableTransaction:{inputs:i,commands:c}};if(r)return F.TransactionKind.serialize(u,{maxSize:t}).toBytes();const f=s?.expiration??this.expiration,p=s?.sender??this.sender,m={...this.gasData,...s?.gasData};if(!p)throw new Error("Missing transaction sender");if(!m.budget)throw new Error("Missing gas budget");if(!m.payment)throw new Error("Missing gas payment");if(!m.price)throw new Error("Missing gas price");const g={sender:qE(p),expiration:f||{None:!0},gasData:{payment:m.payment,owner:qE(this.gasData.owner??p),price:BigInt(m.price),budget:BigInt(m.budget)},kind:{ProgrammableTransaction:{inputs:i,commands:c}}};return F.TransactionData.serialize({V1:g},{maxSize:t}).toBytes()}addInput(t,s){const r=this.inputs.length;return this.inputs.push(s),{Input:r,type:t,$kind:"Input"}}getInputUses(t,s){this.mapArguments((r,i)=>(r.$kind==="Input"&&r.Input===t&&s(r,i),r))}mapCommandArguments(t,s){const r=this.commands[t];switch(r.$kind){case"MoveCall":r.MoveCall.arguments=r.MoveCall.arguments.map(c=>s(c,r,t));break;case"TransferObjects":r.TransferObjects.objects=r.TransferObjects.objects.map(c=>s(c,r,t)),r.TransferObjects.address=s(r.TransferObjects.address,r,t);break;case"SplitCoins":r.SplitCoins.coin=s(r.SplitCoins.coin,r,t),r.SplitCoins.amounts=r.SplitCoins.amounts.map(c=>s(c,r,t));break;case"MergeCoins":r.MergeCoins.destination=s(r.MergeCoins.destination,r,t),r.MergeCoins.sources=r.MergeCoins.sources.map(c=>s(c,r,t));break;case"MakeMoveVec":r.MakeMoveVec.elements=r.MakeMoveVec.elements.map(c=>s(c,r,t));break;case"Upgrade":r.Upgrade.ticket=s(r.Upgrade.ticket,r,t);break;case"$Intent":const i=r.$Intent.inputs;r.$Intent.inputs={};for(const[c,u]of Object.entries(i))r.$Intent.inputs[c]=Array.isArray(u)?u.map(f=>s(f,r,t)):s(u,r,t);break;case"Publish":break;default:throw new Error(`Unexpected transaction kind: ${r.$kind}`)}}mapArguments(t){for(const s of this.commands.keys())this.mapCommandArguments(s,t)}replaceCommand(t,s,r=t){if(!Array.isArray(s)){this.commands[t]=s;return}const i=s.length-1;this.commands.splice(t,1,...structuredClone(s)),this.mapArguments((c,u,f)=>{if(f<t+s.length)return c;if(typeof r!="number"&&(c.$kind==="Result"&&c.Result===t||c.$kind==="NestedResult"&&c.NestedResult[0]===t)){if(!("NestedResult"in c)||c.NestedResult[1]===0)return St(Dt,structuredClone(r));throw new Error(`Cannot replace command ${t} with a specific result type: NestedResult[${t}, ${c.NestedResult[1]}] references a nested element that cannot be mapped to the replacement result`)}switch(c.$kind){case"Result":c.Result===t&&typeof r=="number"&&(c.Result=r),c.Result>t&&(c.Result+=i);break;case"NestedResult":if(c.NestedResult[0]===t&&typeof r=="number")return{$kind:"NestedResult",NestedResult:[r,c.NestedResult[1]]};c.NestedResult[0]>t&&(c.NestedResult[0]+=i);break}return c})}replaceCommandWithTransaction(t,s,r){if(r.$kind!=="Result"&&r.$kind!=="NestedResult")throw new Error("Result must be of kind Result or NestedResult");this.insertTransaction(t,s),this.replaceCommand(t+s.commands.length,[],"Result"in r?{NestedResult:[r.Result+t,0]}:{NestedResult:[r.NestedResult[0]+t,r.NestedResult[1]]})}insertTransaction(t,s){const r=new Map,i=new Map;for(let f=0;f<s.inputs.length;f++){const p=s.inputs[f],m=Mh(p);let g=-1;if(m!==void 0&&(g=this.inputs.findIndex(y=>Mh(y)===m),g!==-1&&this.inputs[g].Object?.SharedObject&&p.Object?.SharedObject&&(this.inputs[g].Object.SharedObject.mutable=this.inputs[g].Object.SharedObject.mutable||p.Object.SharedObject.mutable)),g!==-1)r.set(f,g);else{const y=this.inputs.length;this.inputs.push(p),r.set(f,y)}}for(let f=0;f<s.commands.length;f++)i.set(f,t+f);const c=[];for(let f=0;f<s.commands.length;f++){const p=structuredClone(s.commands[f]);iR(p,r,i),c.push(p)}this.commands.splice(t,0,...c);const u=c.length;u>0&&this.mapArguments((f,p,m)=>{if(m>=t&&m<t+c.length)return f;switch(f.$kind){case"Result":f.Result>=t&&(f.Result+=u);break;case"NestedResult":f.NestedResult[0]>=t&&(f.NestedResult[0]+=u);break}return f})}getDigest(){const t=this.build({onlyTransactionKind:!1});return Yi.getDigestFromBytes(t)}snapshot(){return St(ah,this)}getData(){return this.snapshot()}shallowClone(){return new Yi({version:this.version,sender:this.sender,expiration:this.expiration,gasData:{...this.gasData},inputs:[...this.inputs],commands:[...this.commands]})}applyResolvedData(t){this.sender||(this.sender=t.sender??null),this.expiration||(this.expiration=t.expiration??null),this.gasData.budget||(this.gasData.budget=t.gasData.budget),this.gasData.owner||(this.gasData.owner=t.gasData.owner??null),this.gasData.payment||(this.gasData.payment=t.gasData.payment),this.gasData.price||(this.gasData.price=t.gasData.price);for(let s=0;s<this.inputs.length;s++){const r=this.inputs[s],i=t.inputs[s];switch(r.$kind){case"UnresolvedPure":if(i.$kind!=="Pure")throw new Error(`Expected input at index ${s} to resolve to a Pure argument, but got ${JSON.stringify(i)}`);this.inputs[s]=i;break;case"UnresolvedObject":if(i.$kind!=="Object")throw new Error(`Expected input at index ${s} to resolve to an Object argument, but got ${JSON.stringify(i)}`);if(i.Object.$kind==="ImmOrOwnedObject"||i.Object.$kind==="Receiving"){const c=r.UnresolvedObject,u=i.Object.ImmOrOwnedObject??i.Object.Receiving;if(ye(c.objectId)!==ye(u.objectId)||c.version!=null&&c.version!==u.version||c.digest!=null&&c.digest!==u.digest||c.mutable!=null||c.initialSharedVersion!=null)throw new Error(`Input at index ${s} did not match unresolved object. ${JSON.stringify(c)} is not compatible with ${JSON.stringify(u)}`)}else if(i.Object.$kind==="SharedObject"){const c=r.UnresolvedObject,u=i.Object.SharedObject;if(ye(c.objectId)!==ye(u.objectId)||c.initialSharedVersion!=null&&c.initialSharedVersion!==u.initialSharedVersion||c.mutable!=null&&c.mutable!==u.mutable||c.version!=null||c.digest!=null)throw new Error(`Input at index ${s} did not match unresolved object. ${JSON.stringify(c)} is not compatible with ${JSON.stringify(u)}`)}else throw new Error(`Input at index ${s} resolved to an unexpected Object kind: ${JSON.stringify(i.Object)}`);this.inputs[s]=i;break}}}};const Wt={MoveCall(e){const[t,s="",r=""]="target"in e?e.target.split("::"):[e.package,e.module,e.function];return{$kind:"MoveCall",MoveCall:{package:t,module:s,function:r,typeArguments:e.typeArguments??[],arguments:e.arguments??[]}}},TransferObjects(e,t){return{$kind:"TransferObjects",TransferObjects:{objects:e.map(s=>St(Dt,s)),address:St(Dt,t)}}},SplitCoins(e,t){return{$kind:"SplitCoins",SplitCoins:{coin:St(Dt,e),amounts:t.map(s=>St(Dt,s))}}},MergeCoins(e,t){return{$kind:"MergeCoins",MergeCoins:{destination:St(Dt,e),sources:t.map(s=>St(Dt,s))}}},Publish({modules:e,dependencies:t}){return{$kind:"Publish",Publish:{modules:e.map(s=>typeof s=="string"?s:st(new Uint8Array(s))),dependencies:t.map(s=>jy(s))}}},Upgrade({modules:e,dependencies:t,package:s,ticket:r}){return{$kind:"Upgrade",Upgrade:{modules:e.map(i=>typeof i=="string"?i:st(new Uint8Array(i))),dependencies:t.map(i=>jy(i)),package:s,ticket:St(Dt,r)}}},MakeMoveVec({type:e,elements:t}){return{$kind:"MakeMoveVec",MakeMoveVec:{type:e??null,elements:t.map(s=>St(Dt,s))}}},Intent({name:e,inputs:t={},data:s={}}){return{$kind:"$Intent",$Intent:{name:e,inputs:Object.fromEntries(Object.entries(t).map(([r,i])=>[r,Array.isArray(i)?i.map(c=>St(Dt,c)):St(Dt,i)])),data:s}}}};function UR(e){return{$kind:"Pure",Pure:{bytes:e instanceof Uint8Array?st(e):e.toBase64()}}}const cn={Pure:UR,ObjectRef({objectId:e,digest:t,version:s}){return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{digest:t,version:s,objectId:ye(e)}}}},SharedObjectRef({objectId:e,mutable:t,initialSharedVersion:s}){return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{mutable:t,initialSharedVersion:s,objectId:ye(e)}}}},ReceivingRef({objectId:e,digest:t,version:s}){return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{digest:t,version:s,objectId:ye(e)}}}},FundsWithdrawal({reservation:e,typeArg:t,withdrawFrom:s}){return{$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:e,typeArg:t,withdrawFrom:s}}}};BigInt(1e9);const Nk="0x0000000000000000000000000000000000000000000000000000000000000001",Wv="0x0000000000000000000000000000000000000000000000000000000000000002",oh="0x0000000000000000000000000000000000000000000000000000000000000006",Uh=`${Wv}::sui::SUI`,ZE="0x0000000000000000000000000000000000000000000000000000000000000005",BR="0x0000000000000000000000000000000000000000000000000000000000000008",LR="0x0000000000000000000000000000000000000000000000000000000000000403";function xk(e){const t=e.split("::");if(t.length!==3)throw new Error(`Invalid type name format: ${e}`);return{package:t[0],module:t[1],name:t[2]}}function zR(e){if(e.body.$kind!=="datatype")return!1;const{package:t,module:s,name:r}=xk(e.body.datatype.typeName);return ye(t)===Wv&&s==="tx_context"&&r==="TxContext"}function $y(e){switch(e.$kind){case"address":return F.Address;case"bool":return F.Bool;case"u8":return F.U8;case"u16":return F.U16;case"u32":return F.U32;case"u64":return F.U64;case"u128":return F.U128;case"u256":return F.U256;case"vector":{if(e.vector.$kind==="u8")return F.byteVector().transform({input:s=>typeof s=="string"?new TextEncoder().encode(s):s,output:s=>s});const t=$y(e.vector);return t?F.vector(t):null}case"datatype":{const{package:t,module:s,name:r}=xk(e.datatype.typeName),i=ye(t);if(i===Nk){if(s==="ascii"&&r==="String"||s==="string"&&r==="String")return F.String;if(s==="option"&&r==="Option"){const c=$y(e.datatype.typeParameters[0]);return c?F.vector(c):null}}return i===Wv&&s==="object"&&r==="ID"?F.Address:null}case"typeParameter":case"unknown":return null}}const hi="AllowanceBalance",fa="CoinWithBalance",$R=e=>{const t=e.split(/::|<|>|,/);for(const s of t)if(s.includes(E4)&&!Xu(s))return!1;return D4(e)},VR="2.33.1",PR="/",GR={"Mvr-Source":`@mysten/sui@${VR}`};var FR=class{#e;#t;#r;#s;constructor({cache:e,url:t,pageSize:s=50,overrides:r}){this.#e=e,this.#t=t,this.#r=s,this.#s={packages:r?.packages,types:r?.types},HR(this.#s)}get#a(){return this.#e.readSync(["#mvrPackageDataLoader",this.#t??""],()=>{const e=new IE(async s=>{if(!this.#t)throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const r=await this.#o(s);return s.map(i=>r[i]??new Error(`Failed to resolve package: ${i}`))}),t=this.#s?.packages;if(t)for(const[s,r]of Object.entries(t))e.prime(s,r);return e})}get#i(){return this.#e.readSync(["#mvrTypeDataLoader",this.#t??""],()=>{const e=new IE(async s=>{if(!this.#t)throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const r=await this.#c(s);return s.map(i=>r[i]??new Error(`Failed to resolve type: ${i}`))}),t=this.#s?.types;if(t)for(const[s,r]of Object.entries(t))e.prime(s,r);return e})}async#o(e){if(e.length===0)return{};const t=Rh(e,this.#r),s={};return await Promise.all(t.map(async r=>{const i=await this.#n("/v1/resolution/bulk",{names:r});if(i?.resolution)for(const c of Object.keys(i?.resolution)){const u=i.resolution[c]?.package_id;u&&(s[c]=u)}})),s}async#c(e){if(e.length===0)return{};const t=Rh(e,this.#r),s={};return await Promise.all(t.map(async r=>{const i=await this.#n("/v1/struct-definition/bulk",{types:r});if(i?.resolution)for(const c of Object.keys(i?.resolution)){const u=i.resolution[c]?.type_tag;u&&(s[c]=u)}})),s}async#n(e,t){if(!this.#t)throw new Error("MVR Api URL is not set for the current client");const s=await fetch(`${this.#t}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...GR},body:JSON.stringify(t)});if(!s.ok){const r=await s.json().catch(()=>({}));throw new Error(`Failed to resolve types: ${r?.message}`)}return s.json()}async resolvePackage({package:e,signal:t}){return t?.throwIfAborted(),ys(e)?{package:await ch(this.#a.load(e),t)}:{package:e}}async resolveType({type:e,signal:t}){if(t?.throwIfAborted(),!ys(e))return{type:e};const s=[...Bh(e)],r=await ch(this.#i.loadMany(s),t),i={};for(let c=0;c<s.length;c++){const u=r[c];if(u instanceof Error)throw u;i[s[c]]=u}return{type:Lh(e,i)}}async resolve({types:e=[],packages:t=[],signal:s}){s?.throwIfAborted();const r=new Set;for(const g of e??[])Bh(g,r);const i=[...r],[c,u]=await ch(Promise.all([i.length>0?this.#i.loadMany(i):[],t.length>0?this.#a.loadMany(t):[]]),s),f={...this.#s?.types};for(const[g,y]of i.entries()){const b=c[g];if(b instanceof Error)throw b;f[y]=b}const p={};for(const g of e??[])p[g]={type:Lh(g,f)};const m={};for(const[g,y]of(t??[]).entries()){const b=this.#s?.packages?.[y]??u[g];if(b instanceof Error)throw b;m[y]={package:b}}return{types:p,packages:m}}};function HR(e){if(e?.packages)for(const[t,s]of Object.entries(e.packages)){if(!Xu(t))throw new Error(`Invalid package name: ${t}`);if(!da(ye(s)))throw new Error(`Invalid package ID: ${s}`)}if(e?.types)for(const[t,s]of Object.entries(e.types)){if(ws(t).typeParams.length>0)throw new Error("Type overrides must be first-level only. If you want to supply generic types, just pass each type individually.");if(!da(ws(s).address))throw new Error(`Invalid type: ${s}`)}}function Bh(e,t=new Set){if(typeof e=="string"&&!ys(e))return t;if(typeof e=="string"&&e.startsWith("vector<")&&e.endsWith(">"))return Bh(e.slice(7,-1),t);const s=Ck(e)?e:ws(e);ys(s.address)&&t.add(`${s.address}::${s.module}::${s.name}`);for(const r of s.typeParams)Bh(r,t);return t}function Lh(e,t){if(typeof e=="string"&&!e.includes("::"))return e;if(typeof e=="string"&&e.startsWith("vector<")&&e.endsWith(">"))return`vector<${Lh(e.slice(7,-1),t)}>`;const s=Ck(e)?e:ws(e),r=t[`${s.address}::${s.module}::${s.name}`];return De({...s,address:r?r.split("::")[0]:s.address,typeParams:s.typeParams.map(i=>Lh(i,t))})}function ys(e){return e.includes(PR)||e.includes("@")||e.includes(".sui")}function ch(e,t){return t?t.aborted?Promise.reject(t.reason):new Promise((s,r)=>{const i=()=>r(t.reason);t.addEventListener("abort",i,{once:!0}),e.then(s,r).finally(()=>{t.removeEventListener("abort",i)})}):e}function Ck(e){return typeof e=="object"&&"address"in e&&"module"in e&&"name"in e&&"typeParams"in e}function qR(e){const t=new Set,s=new Set;for(const r of e.commands)switch(r.$kind){case"MakeMoveVec":r.MakeMoveVec.type&&YE([r.MakeMoveVec.type]).forEach(u=>{s.add(u)});break;case"MoveCall":const i=r.MoveCall,c=i.package.split("::")[0];if(ys(c)){if(!Xu(c))throw new Error(`Invalid package name: ${c}`);t.add(c)}YE(i.typeArguments??[]).forEach(u=>{s.add(u)});break}return{packages:[...t],types:[...s]}}function ZR(e,t){for(const s of e.commands){if(s.MakeMoveVec?.type){if(!ys(s.MakeMoveVec.type))continue;if(!t.types[s.MakeMoveVec.type])throw new Error(`No resolution found for type: ${s.MakeMoveVec.type}`);s.MakeMoveVec.type=t.types[s.MakeMoveVec.type].type}const r=s.MoveCall;if(!r)continue;const i=r.package.split("::"),c=i[0];if(ys(c)&&!t.packages[c])throw new Error(`No address found for package: ${c}`);ys(c)&&(i[0]=t.packages[c].package,r.package=i.join("::"));const u=r.typeArguments;if(u){for(let f=0;f<u.length;f++)if(ys(u[f])){if(!t.types[u[f]])throw new Error(`No resolution found for type: ${u[f]}`);u[f]=t.types[u[f]].type}r.typeArguments=u}}}function YE(e){const t=new Set;for(const s of e)if(ys(s)){if(!$R(s))throw new Error(`Invalid type with names: ${s}`);t.add(s)}return t}function Ik(e){let t=!1;return e.mapArguments(s=>(s.$kind==="GasCoin"&&(t=!0),s)),t}var Xv=class extends Error{},Vy=class extends Xv{constructor(e,t){super(e,{cause:t?.cause}),this.executionError=t?.executionError}},lh=class extends Xv{constructor(e,t,s){super(t,{cause:s?.cause}),this.code=e,this.reason=s?.reason??"unknown",this.objectId=s?.objectId}};const YR={notFound:e=>`Transaction ${e} not found`};var WE=class extends Xv{constructor(e,t,s){super(YR[e](t),s),this.reason=e,this.digest=t}};function Rk(e,t,s){const r=F.Address.serialize(e).toBytes(),i=F.TypeTag.serialize(t).toBytes(),c=F.u64().serialize(s.length).toBytes(),u=$c.create({dkLen:32});return u.update(new Uint8Array([240])),u.update(r),u.update(c),u.update(s),u.update(i),`0x${kr(u.digest().slice(0,32))}`}const WR=ye("0xacc"),XR=Lc.parseFromStr("0x2::accumulator::Key<0x2::balance::Balance<0x2::sui::SUI>>"),JR=new Uint8Array([172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172]);function KR(e,t){const s=Ku(Rk(WR,XR,F.Address.serialize(e).toBytes()).slice(2)),r=Ih(t);if(r.length!==32)throw new Error(`Invalid chain identifier length: expected 32 bytes, got ${r.length}`);const i=new Uint8Array(32);for(let c=0;c<32;c++)i[c]=s[c]^r[c];return`0x${kr(i)}`}function QR(e,t,s,r){const i=new Uint8Array(32),c=new DataView(i.buffer);c.setBigUint64(0,e,!0);const u=Number(r);if(!Number.isSafeInteger(u)||u<0||u>4294967295)throw new Error(`Epoch ${r} out of u32 range for coin reservation digest`);return c.setUint32(8,u,!0),i.set(JR,12),St(fi,{objectId:KR(t,s),version:"0",digest:Ju(i)})}const e5=50,XE=256,t5=1000n,n5=5e10;function s5(e,t=1n){const s=t5*BigInt(t),r=BigInt(e.computationCost)+s,i=r+BigInt(e.storageCost)-BigInt(e.storageRebate);return String(i>r?i:r)}function r5(e){if(!e.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return e.client}async function a5(e,t,s){const r=r5(t),i=!t.onlyTransactionKind&&!e.gasData.price,c=!t.onlyTransactionKind&&!e.gasData.payment,u=e.gasData.owner??e.sender,f=Ik(e);let p=0n;const m=u?ye(u):null;for(const V of e.inputs){if(V.$kind!=="FundsWithdrawal"||!m||De(V.FundsWithdrawal.typeArg.Balance)!==Uh)continue;const C=V.FundsWithdrawal.withdrawFrom,W=C.SenderAllowance?C.SenderAllowance.funder:C.Sender?e.sender:u;W&&ye(W)===m&&V.FundsWithdrawal.reservation.$kind==="MaxAmountU64"&&(p+=BigInt(V.FundsWithdrawal.reservation.MaxAmountU64))}const g=!t.onlyTransactionKind&&!e.expiration&&!e.gasData.budget,y=i||c&&f||g,b=c&&f||g,[,S,A,N,j]=await Promise.all([u5(e,r),y?r.core.getCurrentSystemState():null,c&&u?r.core.getBalance({owner:u}):null,c&&u?r.core.listCoins({owner:u,coinType:Uh}):null,b?r.core.getChainIdentifier():null]);if(await l5(e,r),!t.onlyTransactionKind){const V=S?.systemState??null,C=j?.chainIdentifier??null;if(V&&!e.gasData.price&&(e.gasData.price=V.referenceGasPrice),await i5(e,r,g&&V&&C?jk(V,C):void 0),c){if(!A||!N)throw new Error("Could not resolve gas payment: a gas owner or sender must be set to fetch balance and coins.");o5({transactionData:e,balance:A,coins:N,usesGasCoin:f,withdrawals:p,gasPayer:u,chainIdentifier:C,epoch:V?.epoch??null})}!e.expiration&&e.gasData.payment?.length===0&&await c5(e,r,V,C)}return await s()}async function i5(e,t,s){if(e.gasData.budget)return;const r=await t.core.simulateTransaction({transaction:e.build({overrides:{gasData:{budget:String(n5),payment:[]},...s&&{expiration:s}}}),include:{effects:!0},doGasSelection:!1});if(r.$kind==="FailedTransaction"){const i=r.FailedTransaction.status.error??void 0;throw new Vy(`Transaction resolution failed: ${i?.message??"Unknown error"}`,{cause:r,executionError:i})}e.gasData.budget=s5(r.Transaction.effects.gasUsed,e.gasData.price?String(e.gasData.price):void 0)}function o5({transactionData:e,balance:t,coins:s,usesGasCoin:r,withdrawals:i,gasPayer:c,chainIdentifier:u,epoch:f}){const p=BigInt(e.gasData.budget),m=BigInt(t.balance.addressBalance);if(p===0n||!r&&m>=p+i){e.gasData.payment=[];return}const g=s.objects.filter(S=>!e.inputs.find(A=>A.Object?.ImmOrOwnedObject?S.objectId===A.Object.ImmOrOwnedObject.objectId:!1)),y=g.map(S=>({objectId:S.objectId,digest:S.digest,version:S.version})),b=m-i;if(r&&b>0n&&u&&f)e.gasData.payment=[QR(b,c,u,f),...y.slice(0,XE-1)];else if(g.length)e.gasData.payment=y.slice(0,XE);else throw new Error("No valid gas coins found for the transaction.")}async function c5(e,t,s,r=null){const[i,c]=await Promise.all([r??t.core.getChainIdentifier().then(u=>u.chainIdentifier),s??t.core.getCurrentSystemState().then(u=>u.systemState)]);e.expiration=jk(c,i)}function jk(e,t){const s=BigInt(e.epoch);return{$kind:"ValidDuring",ValidDuring:{minEpoch:String(s),maxEpoch:String(s+1n),minTimestamp:null,maxTimestamp:null,chain:t,nonce:Math.random()*4294967296>>>0}}}async function l5(e,t){const s=e.inputs.filter(g=>g.UnresolvedObject&&!(g.UnresolvedObject.version||g.UnresolvedObject?.initialSharedVersion)),r=[...new Set(s.map(g=>jy(g.UnresolvedObject.objectId)))],i=r.length?Rh(r,e5):[],c=(await Promise.all(i.map(g=>t.core.getObjects({objectIds:g})))).flatMap(g=>g.objects),u=new Map(r.map((g,y)=>[g,c[y]])),f=Array.from(u).filter(([g,y])=>y instanceof Error).map(([g,y])=>y.message);if(f.length)throw new Error(`The following input objects are invalid: ${f.join(", ")}`);const p=c.map(g=>{if(g instanceof Error)throw new Error(`Failed to fetch object: ${g.message}`);const y=g.owner,b=y&&typeof y=="object"?y.$kind==="Shared"?y.Shared.initialSharedVersion:y.$kind==="ConsensusAddressOwner"?y.ConsensusAddressOwner.startVersion:null:null;return{objectId:g.objectId,digest:g.digest,version:g.version,initialSharedVersion:b}}),m=new Map(r.map((g,y)=>[g,p[y]]));for(const[g,y]of e.inputs.entries()){if(!y.UnresolvedObject)continue;let b;const S=ye(y.UnresolvedObject.objectId),A=m.get(S);y.UnresolvedObject.initialSharedVersion??A?.initialSharedVersion?b=cn.SharedObjectRef({objectId:S,initialSharedVersion:y.UnresolvedObject.initialSharedVersion||A?.initialSharedVersion,mutable:y.UnresolvedObject.mutable||d5(e,g)}):f5(e,g)&&(b=cn.ReceivingRef({objectId:S,digest:y.UnresolvedObject.digest??A?.digest,version:y.UnresolvedObject.version??A?.version})),e.inputs[e.inputs.indexOf(y)]=b??cn.ObjectRef({objectId:S,digest:y.UnresolvedObject.digest??A?.digest,version:y.UnresolvedObject.version??A?.version})}}async function u5(e,t){const{inputs:s,commands:r}=e,i=[],c=new Set;r.forEach(f=>{if(f.MoveCall){if(f.MoveCall._argumentTypes)return;if(f.MoveCall.arguments.map(p=>p.$kind==="Input"?e.inputs[p.Input]:null).some(p=>p?.UnresolvedPure||p?.UnresolvedObject&&typeof p?.UnresolvedObject.mutable!="boolean")){const p=`${f.MoveCall.package}::${f.MoveCall.module}::${f.MoveCall.function}`;c.add(p),i.push(f.MoveCall)}}});const u=new Map;c.size>0&&await Promise.all([...c].map(async f=>{const[p,m,g]=f.split("::"),{function:y}=await t.core.getMoveFunction({packageId:p,moduleName:m,name:g});u.set(f,y.parameters)})),i.length&&await Promise.all(i.map(async f=>{const p=u.get(`${f.package}::${f.module}::${f.function}`);p&&(f._argumentTypes=p.length>0&&zR(p.at(-1))?p.slice(0,p.length-1):p)})),r.forEach(f=>{if(!f.MoveCall)return;const p=f.MoveCall,m=`${p.package}::${p.module}::${p.function}`,g=p._argumentTypes;if(g){if(g.length!==f.MoveCall.arguments.length)throw new Error(`Incorrect number of arguments for ${m}`);g.forEach((y,b)=>{const S=p.arguments[b];if(S.$kind!=="Input")return;const A=s[S.Input];if(!A.UnresolvedPure&&!A.UnresolvedObject)return;const N=A.UnresolvedPure?.value??A.UnresolvedObject?.objectId,j=$y(y.body);if(j){S.type="pure",s[s.indexOf(A)]=cn.Pure(j.serialize(N));return}if(typeof N!="string")throw new Error(`Expect the argument to be an object id string, got ${JSON.stringify(N,null,2)}`);S.type="object";const V=A.UnresolvedPure?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:N}}:A;s[S.Input]=V})}})}function d5(e,t){let s=!1;return e.getInputUses(t,(r,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const c=i.MoveCall.arguments.indexOf(r);s=i.MoveCall._argumentTypes[c].reference!=="immutable"||s}(i.$kind==="MakeMoveVec"||i.$kind==="MergeCoins"||i.$kind==="SplitCoins"||i.$kind==="TransferObjects")&&(s=!0)}),s}function f5(e,t){let s=!1;return e.getInputUses(t,(r,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const c=i.MoveCall.arguments.indexOf(r);s=p5(i.MoveCall._argumentTypes[c])||s}}),s}const h5="0x0000000000000000000000000000000000000000000000000000000000000002::transfer::Receiving";function p5(e){return e.body.$kind!=="datatype"?!1:e.body.datatype.typeName===h5}function Mk(e,t){if(e.inputs.some(s=>s.UnresolvedObject||s.UnresolvedPure))return!0;if(!t.onlyTransactionKind){if(!e.gasData.price||!e.gasData.budget)return!0;if(e.gasData.payment){if(e.gasData.payment.length===0&&!e.expiration)return!0}else if(!(t.assumeSufficientAddressBalances&&!Ik(e))||e.expiration?.$kind!=="ValidDuring"&&e.expiration?.$kind!=="Validity")return!0}return!1}async function m5(e,t,s){return g5(e),Mk(e,t)?(Py(t).core?.resolveTransactionPlugin()??a5)(e,t,async()=>{await JE(e),await s()}):(!t.onlyTransactionKind&&!e.gasData.payment&&(e.gasData.payment=[]),await JE(e),s())}function JE(e){e.inputs.forEach((t,s)=>{if(t.$kind!=="Object"&&t.$kind!=="Pure"&&t.$kind!=="FundsWithdrawal")throw new Error(`Input at index ${s} has not been resolved. Expected a Pure, Object, or FundsWithdrawal input, but found ${JSON.stringify(t)}`)})}function Py(e){if(!e.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return e.client}function g5(e){for(const t of e.commands)switch(t.$kind){case"SplitCoins":t.SplitCoins.amounts.forEach(s=>{KE(s,F.U64,e)});break;case"TransferObjects":KE(t.TransferObjects.address,F.Address,e);break}}function KE(e,t,s){if(e.$kind!=="Input")return;const r=s.inputs[e.Input];r.$kind==="UnresolvedPure"&&(s.inputs[e.Input]=cn.Pure(t.serialize(r.UnresolvedPure.value)))}const QE=Ne({objectId:Be(),funder:dn(Be()),appType:dn(Be()),type:Be(),amount:Be(),outputKind:zv(["coin","balance"])}),y5=F.struct("AllowanceMetadata",{id:F.Address,funder:F.Address,spender:F.option(F.Address),app:F.option(F.string())});function eS({allowance:e,amount:t,type:s="0x2::sui::SUI",outputKind:r}){F.U64.validate(t);const i=ye(typeof e=="string"?e:e.objectId),c=typeof e=="string"?{}:e;return u=>(u.addIntentResolver(hi,Mu),u.add(Wt.Intent({name:hi,inputs:{allowance:u.object(i),clock:u.object.clock(),...c.app?{permit:u.object(c.app.permit)}:{}},data:{objectId:i,funder:c.funder?ye(c.funder):void 0,appType:c.app?De(c.app.type):void 0,type:De(s),amount:String(t),outputKind:r}})))}const v5=async(e,t,s)=>{const r=new Set,i=new Set;for(const p of e.commands){if(p.$kind!=="$Intent"||p.$Intent.name!==hi)continue;const m=St(QE,p.$Intent.data);m.funder||r.add(m.objectId);for(const g of[m.type,m.appType])g&&ys(g)&&i.add(g)}const[c,u]=await Promise.all([i.size?Py(t).core.mvr.resolve({types:[...i]}):void 0,r.size?Py(t).core.getObjects({objectIds:[...r],include:{content:!0}}).then(p=>p.objects):[]]),f=new Map;for(const p of u){if(p instanceof Error)throw p;f.set(p.objectId,p)}for(let p=0;p<e.commands.length;p++){const m=e.commands[p];if(m.$kind!=="$Intent"||m.$Intent.name!==hi)continue;const g=St(QE,m.$Intent.data);if(ys(g.type)){const N=c?.types[g.type];if(!N)throw new Error(`No resolution found for type: ${g.type}`);g.type=De(N.type)}if(g.appType&&ys(g.appType)){const N=c?.types[g.appType];if(!N)throw new Error(`No resolution found for type: ${g.appType}`);g.appType=De(N.type)}let y=g.funder;if(!y){const N=f.get(g.objectId),j=De(`0x2::allowance::Allowance<0x2::balance::Balance<${g.type}>>`);if(!N||N.type!==j||N.owner.$kind!=="Shared")throw new Error(`Expected a shared ${j} allowance at ${g.objectId}`);const V=y5.parse(N.content);if(V.app!==null&&!g.appType)throw new Error(`Allowance ${g.objectId} is app-bound; pass allowance.app with the app type and SpendPermit`);if(g.appType&&(V.app===null||De(V.app)!==g.appType))throw new Error(`Allowance ${g.objectId} is not bound to app ${g.appType}`);y=V.funder;const C=m.$Intent.inputs.allowance;C.$kind==="Input"&&(e.inputs[C.Input]=cn.SharedObjectRef({objectId:g.objectId,initialSharedVersion:N.owner.Shared.initialSharedVersion,mutable:!0}))}const b=m.$Intent.inputs.allowance;if(b.$kind==="Input"){const N=e.inputs[b.Input];N.Object?.SharedObject&&(N.Object.SharedObject.mutable=!0),N.UnresolvedObject&&(N.UnresolvedObject.mutable=!0)}const S=e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:g.amount},typeArg:{$kind:"Balance",Balance:g.type},withdrawFrom:{$kind:"SenderAllowance",SenderAllowance:{funder:y,allowance:g.objectId}}})),A=[Wt.MoveCall({target:g.appType?"0x2::allowance::app_balance_spend":"0x2::allowance::balance_spend",typeArguments:g.appType?[g.type,g.appType]:[g.type],arguments:[m.$Intent.inputs.allowance,...g.appType?[m.$Intent.inputs.permit]:[],S,m.$Intent.inputs.clock]})];g.outputKind==="coin"&&A.push(Wt.MoveCall({target:"0x2::coin::from_balance",typeArguments:[g.type],arguments:[{$kind:"Result",Result:p}]})),e.replaceCommand(p,A,{NestedResult:[p+A.length-1,0]}),p+=A.length-1}return s()};async function Mu(e,t,s){const r=new Set(t.intentNames??[hi,fa]),i=c=>r.has(c)&&!t.supportedIntents?.includes(c)&&e.commands.some(u=>u.$Intent?.name===c);i(hi)&&await v5(e,t,async()=>{}),i(fa)&&await T5(e,t,async()=>{}),await s()}const ra=De("0x2::sui::SUI");function b5({type:e=ra,balance:t,useGasCoin:s=!0}){let r=null;return i=>{if(r)return r;i.addIntentResolver(fa,Mu);const c=e==="gas"?e:De(e);return r=i.add(Wt.Intent({name:fa,inputs:{},data:{type:c===ra&&s?"gas":c,balance:BigInt(t),outputKind:"coin"}})),r}}function w5({type:e=ra,balance:t,useGasCoin:s=!0}){let r=null;return i=>{if(r)return r;i.addIntentResolver(fa,Mu);const c=e==="gas"?e:De(e);return r=i.add(Wt.Intent({name:fa,inputs:{},data:{type:c===ra&&s?"gas":c,balance:BigInt(t),outputKind:"balance"}})),r}}const tS=Ne({type:Be(),balance:Xt(er([Lv(),Be(),Xt(Cn(),Hn())]),Qu(e=>BigInt(e))),outputKind:dn(zv(["coin","balance"]))});async function T5(e,t,s){const r=new Set,i=new Map,c=new Map;if(!e.sender)throw new Error("Sender must be set to resolve CoinWithBalance");if(e.commands.some(j=>j.$Intent?.name===hi))throw new Error("Resolve AllowanceBalance together with CoinWithBalance, or preserve both intents");const u=new Map;for(const j of e.inputs){if(!j.FundsWithdrawal)continue;const{withdrawFrom:V,typeArg:C,reservation:W}=j.FundsWithdrawal;if(ye(V.SenderAllowance?.funder??(V.Sender?e.sender:e.gasData.owner??e.sender))!==ye(e.sender))continue;const ce=De(C.Balance);u.set(ce,(u.get(ce)??0n)+BigInt(W.MaxAmountU64))}for(const[j,V]of e.commands.entries()){if(V.$kind!=="$Intent"||V.$Intent.name!==fa)continue;const{type:C,balance:W,outputKind:ce}=St(tS,V.$Intent.data);if(W===0n){const ae=C==="gas"?ra:C;e.replaceCommand(j,Wt.MoveCall({target:(ce??"coin")==="balance"?"0x2::balance::zero":"0x2::coin::zero",typeArguments:[ae]}));continue}C!=="gas"&&r.add(C),i.set(C,(i.get(C)??0n)+W),c.has(C)||c.set(C,[]),c.get(C).push({balance:W,outputKind:ce??"coin"})}if(i.has("gas")&&i.has(ra))throw new Error("Cannot mix SUI CoinWithBalance intents that use the gas coin with ones that do not (useGasCoin: false). Use one or the other.");const f=new Set;for(const j of e.inputs)j.Object?.ImmOrOwnedObject&&f.add(j.Object.ImmOrOwnedObject.objectId),j.UnresolvedObject?.objectId&&f.add(j.UnresolvedObject.objectId);const p=new Map,m=new Map,g=t.client,y=t.assumeSufficientAddressBalances;if(!g&&!y)throw new Error("Client must be provided to build or serialize transactions with CoinWithBalance intents");if(y)for(const[j,V]of i)m.set(j,V);else await Promise.all([...[...r].map(async j=>{const{coins:V,addressBalance:C}=await E5({coinType:j,balance:i.get(j),client:g,owner:e.sender,usedIds:f,reserved:u.get(j)??0n});p.set(j,V),m.set(j,C)}),i.has("gas")?await g.core.getBalance({owner:e.sender,coinType:ra}).then(({balance:j})=>{m.set("gas",Dk(j.addressBalance,u.get(ra)??0n))}):null]);const b=new Map,S=new Set,A=new Map;let N=0;for(;N<e.commands.length;){const j=e.commands[N];if(j.$kind!=="$Intent"||j.$Intent.name!==fa){N++;continue}const{type:V,balance:C}=St(tS,j.$Intent.data),W=V==="gas"?ra:V,ce=i.get(V),ae=m.get(V)??0n,Y=[];let K;const w=c.get(V)??[];if(w.every(O=>O.outputKind==="balance")&&ae>=ce)Y.push(Wt.MoveCall({target:"0x2::balance::redeem_funds",typeArguments:[W],arguments:[e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(C)},typeArg:{$kind:"Balance",Balance:W},withdrawFrom:{$kind:"Sender",Sender:!0}}))]})),K={$kind:"NestedResult",NestedResult:[N+Y.length-1,0]};else{if(!A.has(V)){const x=w,G=[];if(ae>=ce)S.add(V),Y.push(Wt.MoveCall({target:"0x2::coin::redeem_funds",typeArguments:[W],arguments:[e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(ce)},typeArg:{$kind:"Balance",Balance:W},withdrawFrom:{$kind:"Sender",Sender:!0}}))]})),G.push({$kind:"Result",Result:N+Y.length-1});else if(V==="gas")G.push({$kind:"GasCoin",GasCoin:!0});else{const k=p.get(V),I=k.reduce((L,X)=>L+BigInt(X.balance),0n),D=ce>I?ce-I:0n;b.set(V,I+D===ce);for(const L of k)G.push(e.addInput("object",cn.ObjectRef({objectId:L.objectId,digest:L.digest,version:L.version})));D>0n&&(S.add(V),Y.push(Wt.MoveCall({target:"0x2::coin::redeem_funds",typeArguments:[W],arguments:[e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(D)},typeArg:{$kind:"Balance",Balance:W},withdrawFrom:{$kind:"Sender",Sender:!0}}))]})),G.push({$kind:"Result",Result:N+Y.length-1}))}const U=G[0],H=G.slice(1);for(let k=0;k<H.length;k+=500)Y.push(Wt.MergeCoins(U,H.slice(k,k+500)));const $=N+Y.length;Y.push(Wt.SplitCoins(U,x.map(k=>e.addInput("pure",cn.Pure(F.u64().serialize(k.balance))))));const M=[];for(let k=0;k<x.length;k++){const I={$kind:"NestedResult",NestedResult:[$,k]};x[k].outputKind==="balance"?(Y.push(Wt.MoveCall({target:"0x2::coin::into_balance",typeArguments:[W],arguments:[I]})),M.push({$kind:"NestedResult",NestedResult:[N+Y.length-1,0]})):M.push(I)}if(V!=="gas"||S.has(V)){const k=x.some(D=>D.outputKind==="balance"),I=S.has(V);k||I?Y.push(Wt.MoveCall({target:"0x2::coin::send_funds",typeArguments:[W],arguments:[U,e.addInput("pure",cn.Pure(F.Address.serialize(e.sender)))]})):b.get(V)&&Y.push(Wt.MoveCall({target:"0x2::coin::destroy_zero",typeArguments:[W],arguments:[U]}))}A.set(V,{results:M,nextIntent:0})}const O=A.get(V);K=O.results[O.nextIntent++]}e.replaceCommand(N,Y,K),N+=Y.length}return s()}async function E5({coinType:e,balance:t,client:s,owner:r,usedIds:i,reserved:c}){let u=t;const f=[],p=s.core.getBalance({owner:r,coinType:e}).then(({balance:b})=>{const S=Dk(b.addressBalance,c);return u-=S,{...b,addressBalance:String(S),balance:String(BigInt(b.balance)-c)}}),[m,g]=await Promise.all([y(),p]);if(BigInt(g.balance)<t)throw new Error(`Insufficient balance of ${e} for owner ${r}. Required: ${t}, Available: ${t-u}`);return{coins:m,balance:BigInt(g.coinBalance),addressBalance:BigInt(g.addressBalance),coinBalance:BigInt(g.coinBalance)};async function y(b=null){const{objects:S,hasNextPage:A,cursor:N}=await s.core.listCoins({owner:r,coinType:e,cursor:b});await p;for(const j of S)i.has(j.objectId)||(f.push(j),u-=BigInt(j.balance));return u>0n&&A?y(N):f}}function Dk(e,t){const s=BigInt(e)-t;if(s<0n)throw new Error(`Insufficient address balance for existing withdrawals. Required: ${t}, Available: ${e}`);return s}function Du(e){return er(Object.entries(e).map(([t,s])=>Ne({[t]:s})))}const Ws=Du({GasCoin:nt(!0),Input:Xt(Cn(),Hn()),Result:Xt(Cn(),Hn()),NestedResult:$v([Xt(Cn(),Hn()),Xt(Cn(),Hn())])}),S5=Ne({budget:Ct(nn),price:Ct(nn),owner:Ct(vo),payment:Ct(ct(fi))}),_5=Ne({package:ss,module:Be(),function:Be(),typeArguments:ct(Be()),arguments:ct(Ws)}),k5=Ne({name:Be(),inputs:ju(Be(),er([Ws,ct(Ws)])),data:ju(Be(),tl())}),A5=Du({MoveCall:_5,TransferObjects:Ne({objects:ct(Ws),address:Ws}),SplitCoins:Ne({coin:Ws,amounts:ct(Ws)}),MergeCoins:Ne({destination:Ws,sources:ct(Ws)}),Publish:Ne({modules:ct(lo),dependencies:ct(ss)}),MakeMoveVec:Ne({type:Ct(Be()),elements:ct(Ws)}),Upgrade:Ne({modules:ct(lo),dependencies:ct(ss),package:ss,ticket:Ws}),$Intent:k5}),O5=Du({Object:Du({ImmOrOwnedObject:fi,SharedObject:Ne({objectId:ss,initialSharedVersion:nn,mutable:co()}),Receiving:fi}),Pure:Ne({bytes:lo}),UnresolvedPure:Ne({value:tl()}),UnresolvedObject:Ne({objectId:ss,version:dn(Ct(nn)),digest:dn(Ct(Be())),initialSharedVersion:dn(Ct(nn)),mutable:dn(Ct(co()))}),FundsWithdrawal:vk}),N5=Du({None:nt(!0),Epoch:nn,ValidDuring:Vv,Validity:bk}),x5=Ne({version:nt(2),sender:Ru(vo),expiration:Ru(N5),gasData:S5,inputs:ct(O5),commands:ct(A5),digest:dn(Ct(Be()))});function C5(e){function t(s){return e(s)}return t.system=s=>{const r=s?.mutable;return t(r!==void 0?cn.SharedObjectRef({objectId:ZE,initialSharedVersion:1,mutable:r}):{$kind:"UnresolvedObject",UnresolvedObject:{objectId:ZE,initialSharedVersion:1}})},t.clock=()=>t(cn.SharedObjectRef({objectId:oh,initialSharedVersion:1,mutable:!1})),t.random=()=>t({$kind:"UnresolvedObject",UnresolvedObject:{objectId:BR,mutable:!1}}),t.denyList=s=>t({$kind:"UnresolvedObject",UnresolvedObject:{objectId:LR,mutable:s?.mutable}}),t.option=({type:s,value:r})=>i=>i.moveCall({typeArguments:[s],target:`${Nk}::option::${r===null?"none":"some"}`,arguments:r===null?[]:[i.object(r)]}),t}function I5(e){function t(s,r){if(typeof s=="string")return e(ku(s).serialize(r));if(s instanceof Uint8Array||Ry(s))return e(s);throw new Error("tx.pure must be called either a bcs type name, or a serialized bcs value")}return t.u8=s=>e(F.U8.serialize(s)),t.u16=s=>e(F.U16.serialize(s)),t.u32=s=>e(F.U32.serialize(s)),t.u64=s=>e(F.U64.serialize(s)),t.u128=s=>e(F.U128.serialize(s)),t.u256=s=>e(F.U256.serialize(s)),t.bool=s=>e(F.Bool.serialize(s)),t.string=s=>e(F.String.serialize(s)),t.address=s=>e(F.Address.serialize(s)),t.id=t.address,t.vector=(s,r)=>e(F.vector(ku(s)).serialize(r)),t.option=(s,r)=>e(F.option(ku(s)).serialize(r)),t}function R5(){return async(e,t,s)=>{const r=qR(e);if(r.types.length===0&&r.packages.length===0)return s();if(!t.client)throw new Error("Transaction contains MVR names but no client was provided to resolve them. Please pass a client to Transaction#build()");ZR(e,await t.client.core.mvr.resolve({types:r.types,packages:r.packages})),await s()}}function nS(e){if(e.allowance!==void 0&&e.useGasCoin!==void 0)throw new Error("useGasCoin cannot be combined with allowance");const t=e.balance;if(typeof t=="string"&&!/^[0-9]+$/.test(t))throw new Error("Amount must be a non-empty string of decimal digits");if(typeof t=="number"&&!Number.isSafeInteger(t))throw new Error("Amount must be a safe integer; use bigint or a string for larger amounts");return BigInt(t)}function $0(e,t=1/0){const s={$kind:"Result",get Result(){return typeof e=="function"?e():e}},r=[],i=c=>r[c]??={$kind:"NestedResult",get NestedResult(){return[typeof e=="function"?e():e,c]}};return new Proxy(s,{set(){throw new Error("The transaction result is a proxy, and does not support setting properties directly")},get(c,u){if(u in c)return Reflect.get(c,u);if(u===Symbol.iterator)return function*(){let p=0;for(;p<t;)yield i(p),p++};if(typeof u=="symbol")return;const f=parseInt(u,10);if(!(Number.isNaN(f)||f<0))return i(f)}})}const j5=Symbol.for("@mysten/transaction");var Zn=class uh{#e;#t;#r=new Map;#s=[];#a=[];#i=new Set;#o=new Set;#c=new Map;static fromKind(t){const s=new uh;return s.#n=Xi.fromKindBytes(typeof t=="string"?qe(t):t),s.#s=s.#n.inputs.slice(),s.#a=s.#n.commands.slice(),s.#i=new Set(s.#a.map((r,i)=>i)),s}static from(t,s={}){const r=new uh;typeof t=="object"&&"getData"in t?r.#n=Xi.restore(t.getData()):typeof t!="string"||!t.startsWith("{")?r.#n=Xi.fromBytes(typeof t=="string"?qe(t):t):r.#n=Xi.restore(JSON.parse(t)),r.#s=r.#n.inputs.slice(),r.#a=r.#n.commands.slice(),r.#i=new Set(r.#a.map((c,u)=>u));const i=new Map([[fa,Mu],[hi,Mu],...Object.entries(s.intentResolvers??{})]);if(!r.isPreparedForSerialization({supportedIntents:[...i.keys()]}))throw new Error("Transaction has unresolved intents or async thunks. Provide resolvers for any custom intents via the `intentResolvers` option, or call `prepareForSerialization` before copying.");for(const[c,u]of i)r.addIntentResolver(c,u);return r}addSerializationPlugin(t){this.#e.push(t)}addBuildPlugin(t){this.#t.push(t)}addIntentResolver(t,s){if(this.#r.has(t)&&this.#r.get(t)!==s)throw new Error(`Intent resolver for ${t} already exists`);this.#r.set(t,s)}setSender(t){this.#n.sender=t}setSenderIfNotSet(t){this.#n.sender||(this.#n.sender=t)}setExpiration(t){this.#n.expiration=t?St(wk,t):null}setGasPrice(t){this.#n.gasData.price=String(t)}setGasBudget(t){this.#n.gasData.budget=String(t)}setGasBudgetIfNotSet(t){this.#n.gasData.budget==null&&(this.#n.gasData.budget=String(t))}setGasOwner(t){this.#n.gasData.owner=t}setGasPayment(t){this.#n.gasData.payment=t.map(s=>St(fi,s))}#n;getData(){return this.#n.snapshot()}get[j5](){return!0}get pure(){return Object.defineProperty(this,"pure",{enumerable:!1,value:I5(t=>Ry(t)?this.#f("pure",{$kind:"Pure",Pure:{bytes:t.toBase64()}}):this.#f("pure",Dy(UE,t)?St(UE,t):t instanceof Uint8Array?cn.Pure(t):{$kind:"UnresolvedPure",UnresolvedPure:{value:t}}))}),this.pure}constructor(){this.object=C5(t=>{if(typeof t=="function")return this.object(this.add(t));if(typeof t=="object"&&Dy(Dt,t))return t;const s=Mh(t),r=this.#n.inputs.find(i=>s===Mh(i));return r?.Object?.SharedObject&&typeof t=="object"&&t.Object?.SharedObject&&(r.Object.SharedObject.mutable=r.Object.SharedObject.mutable||t.Object.SharedObject.mutable),r?{$kind:"Input",Input:this.#n.inputs.indexOf(r),type:"object"}:this.#f("object",typeof t=="string"?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:ye(t)}}:t)}),this.#n=new Xi,this.#t=[],this.#e=[]}get gas(){return{$kind:"GasCoin",GasCoin:!0}}coin(t){const s=nS(t);return this.add(t.allowance!==void 0?eS({...t,amount:s,outputKind:"coin"}):b5({...t,balance:s}))}balance(t){const s=nS(t);return this.add(t.allowance!==void 0?eS({...t,amount:s,outputKind:"balance"}):w5({...t,balance:s}))}objectRef(...t){return this.object(cn.ObjectRef(...t))}receivingRef(...t){return this.object(cn.ReceivingRef(...t))}sharedObjectRef(...t){return this.object(cn.SharedObjectRef(...t))}#m(){const t=new uh;return t.#n=this.#n,t.#e=this.#e,t.#t=this.#t,t.#r=this.#r,t.#o=this.#o,t.#i=new Set(this.#i),t.#c=this.#c,this.#s.push(t.#s),this.#a.push(t.#a),t}add(t){if(typeof t=="function"){if(this.#c.has(t))return this.#c.get(t);const s=this.#m(),r=t(s);if(!(r&&typeof r=="object"&&"then"in r))return this.#i=s.#i,this.#c.set(t,r),r;const i=this.#h({$kind:"$Intent",$Intent:{name:"AsyncTransactionThunk",inputs:{},data:{resultIndex:this.#n.commands.length,result:null}}});this.#o.add(Promise.resolve(r).then(u=>{i.$Intent.data.result=u}));const c=$0(()=>i.$Intent.data.resultIndex);return this.#c.set(t,c),c}else this.#h(t);return $0(this.#n.commands.length-1)}#h(t){const s=this.#n.commands.length;return this.#a.push(t),this.#i.add(s),this.#n.commands.push(t),this.#n.mapCommandArguments(s,r=>{if(r.$kind==="Result"&&!this.#i.has(r.Result))throw new Error(`Result { Result: ${r.Result} } is not available to use in the current transaction`);if(r.$kind==="NestedResult"&&!this.#i.has(r.NestedResult[0]))throw new Error(`Result { NestedResult: [${r.NestedResult[0]}, ${r.NestedResult[1]}] } is not available to use in the current transaction`);if(r.$kind==="Input"&&r.Input>=this.#n.inputs.length)throw new Error(`Input { Input: ${r.Input} } references an input that does not exist in the current transaction`);return r}),t}#f(t,s){return this.#s.push(s),this.#n.addInput(t,s)}#p(t){return Ry(t)?this.pure(t):this.#l(t)}#l(t){if(typeof t=="function"){const s=this.add(t);return typeof s=="function"?this.#l(s):St(Dt,s)}return St(Dt,t)}splitCoins(t,s){const r=Wt.SplitCoins(typeof t=="string"?this.object(t):this.#l(t),s.map(i=>typeof i=="number"||typeof i=="bigint"||typeof i=="string"?this.pure.u64(i):this.#p(i)));return this.#h(r),$0(this.#n.commands.length-1,s.length)}mergeCoins(t,s){return this.add(Wt.MergeCoins(this.object(t),s.map(r=>this.object(r))))}publish({modules:t,dependencies:s}){return this.add(Wt.Publish({modules:t,dependencies:s}))}upgrade({modules:t,dependencies:s,package:r,ticket:i}){return this.add(Wt.Upgrade({modules:t,dependencies:s,package:r,ticket:this.object(i)}))}moveCall({arguments:t,...s}){return this.add(Wt.MoveCall({...s,arguments:t?.map(r=>this.#p(r))}))}transferObjects(t,s){return this.add(Wt.TransferObjects(t.map(r=>this.object(r)),typeof s=="string"?this.pure.address(s):this.#p(s)))}makeMoveVec({type:t,elements:s}){return this.add(Wt.MakeMoveVec({type:t,elements:s.map(r=>this.object(r))}))}withdrawal(t){const s={$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(t.amount)},typeArg:{$kind:"Balance",Balance:t.type??"0x2::sui::SUI"},withdrawFrom:t.from==="allowance"?{$kind:"SenderAllowance",SenderAllowance:{funder:ye(t.funder),allowance:ye(t.allowance)}}:t.from==="sponsor"?{$kind:"Sponsor",Sponsor:!0}:{$kind:"Sender",Sender:!0}}};return this.#f("object",s)}serialize(){return JSON.stringify(uR(this.#n.snapshot()))}async toJSON(t={}){await this.prepareForSerialization(t);const s=this.isFullyResolved();return JSON.stringify(St(x5,s?{...this.#n.snapshot(),digest:this.#n.getDigest()}:this.#n.snapshot()),(r,i)=>typeof i=="bigint"?i.toString():i,2)}async sign(t){const{signer:s,...r}=t,i=await this.build(r);return s.signTransaction(i)}isPreparedForSerialization(t={}){return!(this.#o.size>0||this.#n.commands.some(s=>s.$Intent&&!t.supportedIntents?.includes(s.$Intent.name)))}isFullyResolved(){return!(!this.isPreparedForSerialization()||!this.#n.sender||Mk(this.#n,{}))}async build(t={}){return await this.prepareForSerialization(t),await this.#g(t),this.#n.build({onlyTransactionKind:t.onlyTransactionKind})}async getDigest(t={}){return await this.prepareForSerialization(t),await this.#g(t),this.#n.getDigest()}async#g(t){if(!t.onlyTransactionKind&&!this.#n.sender)throw new Error("Missing transaction sender");await this.#d([...this.#t,m5],t)}async#d(t,s){try{const r=i=>{if(i>=t.length)return()=>{};const c=t[i];return async()=>{const u=r(i+1);let f=!1,p=!1;if(await c(this.#n,s,async()=>{if(f)throw new Error(`next() was call multiple times in TransactionPlugin ${i}`);f=!0,await u(),p=!0}),!f)throw new Error(`next() was not called in TransactionPlugin ${i}`);if(!p)throw new Error(`next() was not awaited in TransactionPlugin ${i}`)}};await r(0)()}finally{this.#s=this.#n.inputs.slice(),this.#a=this.#n.commands.slice(),this.#i=new Set(this.#a.map((r,i)=>i))}}async#y(){for(;this.#o.size>0;){const t=Promise.all(this.#o);this.#o.clear(),this.#o.add(t),await t,this.#o.delete(t)}}#u(){const t=this.#n.commands,s=this.#n.inputs,r=this.#a.flat(1/0),i=this.#s.flat(1/0);if(r.length!==t.length)throw new Error("Unexpected number of commands found in transaction data");if(i.length!==s.length)throw new Error("Unexpected number of inputs found in transaction data");const c=r.filter(f=>f.$Intent?.name!=="AsyncTransactionThunk");this.#n.commands=c,this.#n.inputs=i,this.#a=c,this.#s=i,this.#i=new Set(c.map((f,p)=>p));function u(f){const p=t[f];if(p.$Intent?.name==="AsyncTransactionThunk"){const g=p.$Intent.data.result;if(g==null)throw new Error("AsyncTransactionThunk has not been resolved");return u(g.Result)}const m=c.indexOf(p);if(m===-1)throw new Error("Unable to find original index for command");return m}this.#n.mapArguments(f=>{if(f.$kind==="Input"){const p=i.indexOf(s[f.Input]);if(p===-1)throw new Error("Input has not been resolved");return{...f,Input:p}}else if(f.$kind==="Result"){const p=u(f.Result);return{...f,Result:p}}else if(f.$kind==="NestedResult"){const p=u(f.NestedResult[0]);return{...f,NestedResult:[p,f.NestedResult[1]]}}return f});for(const[f,p]of t.entries())if(p.$Intent?.name==="AsyncTransactionThunk")try{p.$Intent.data.resultIndex=u(f)}catch{}}async prepareForSerialization(t){await this.#y(),this.#u();const s=new Set;for(const c of this.#n.commands)c.$Intent&&s.add(c.$Intent.name);const r=[...this.#e],i=new Map;for(const c of s){if(t.supportedIntents?.includes(c))continue;const u=this.#r.get(c);if(!u)throw new Error(`Missing intent resolver for ${c}`);const f=i.get(u)??[];f.push(c),i.set(u,f)}for(const[c,u]of i)r.push((f,p,m)=>c(f,{...p,intentNames:u},m));r.push(R5()),await this.#d(r,t)}};const M5="…";function Uk(e){if(e.length<=6)return e;const t=e.startsWith("0x")?2:0;return`0x${e.slice(t,t+4)}${M5}${e.slice(-4)}`}const Bk="sui:signTransactionBlock",zh="sui:signTransaction",D5="sui:signAndExecuteTransactionBlock",Gy="sui:signAndExecuteTransaction",Fy="sui:signPersonalMessage";var U5=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)},B5=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},dh;let lu;const Sp=new Set;function L5(e){Au=void 0,Sp.add(e)}function z5(e){Au=void 0,Sp.delete(e)}const Sc={};function _p(){if(lu||(lu=Object.freeze({register:sS,get:$5,on:V5}),typeof window>"u"))return lu;const e=Object.freeze({register:sS});try{window.addEventListener("wallet-standard:register-wallet",({detail:t})=>t(e))}catch(t){console.error(`wallet-standard:register-wallet event listener could not be added
7
+ ${String(r)}`);Iy(t);for(let i=0;i<t.callbacks.length;i++){const c=r[i];c instanceof Error?t.callbacks[i].reject(c):t.callbacks[i].resolve(c)}}).catch(r=>{U0(e,t,r)})}function U0(e,t,s){Iy(t);for(let r=0;r<t.keys.length;r++)e.clear(t.keys[r]),t.callbacks[r].reject(s)}function Iy(e){if(e.cacheHits)for(let t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}function b6(e){if(!(!e||e.batch!==!1))return 1;const t=e&&e.maxBatchSize;if(t===void 0)return 1/0;if(typeof t!="number"||t<1)throw new TypeError(`maxBatchSize must be a positive number: ${t}`);return t}function w6(e){const t=e&&e.batchScheduleFn;if(t===void 0)return g6;if(typeof t!="function")throw new TypeError(`batchScheduleFn must be a function: ${t}`);return t}function T6(e){const t=e&&e.cacheKeyFn;if(t===void 0)return s=>s;if(typeof t!="function")throw new TypeError(`cacheKeyFn must be a function: ${t}`);return t}function E6(e){if(!(!e||e.cache!==!1))return null;const t=e&&e.cacheMap;if(t===void 0)return new Map;if(t!==null){const s=["get","set","delete","clear"].filter(r=>t&&typeof t[r]!="function");if(s.length!==0)throw new TypeError("Custom cacheMap missing methods: "+s.join(", "))}return t}function S6(e){return e&&e.name?e.name:null}function N4(e){return typeof e=="object"&&e!==null&&"length"in e&&typeof e.length=="number"&&(e.length===0||e.length>0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}function x4(e){return e=e||new Map,{all:e,on(t,s){const r=e.get(t);r?r.push(s):e.set(t,[s])},off(t,s){const r=e.get(t);r&&(s?r.splice(r.indexOf(s)>>>0,1):e.set(t,[]))},emit(t,s){let r=e.get(t);r&&r.slice().map(i=>{i(s)}),r=e.get("*"),r&&r.slice().map(i=>{i(t,s)})}}}function _6(e,t){switch(t){case"base58":return Ju(e);case"base64":return st(e);case"hex":return kr(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function C4(e,t=["<",">"]){const[s,r]=t,i=[];let c="",u=0;for(let f=0;f<e.length;f++){const p=e[f];if(p===s&&u++,p===r&&u--,u===0&&p===","){i.push(c.trim()),c="";continue}c+=p}return i.push(c.trim()),i}var k6=class{constructor({initialSize:e=1024,maxSize:t=1/0,allocateSize:s=1024}={}){this.bytePosition=0,this.size=e,this.maxSize=t,this.allocateSize=s,this.dataView=new DataView(new ArrayBuffer(e))}ensureSizeOrGrow(e){const t=this.bytePosition+e;if(t>this.size){const s=Math.min(this.maxSize,Math.max(this.size+t,this.size+this.allocateSize));if(t>s)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${t}`);this.size=s;const r=new ArrayBuffer(this.size);new Uint8Array(r).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(r)}}shift(e){return this.bytePosition+=e,this}write8(e){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(e)),this.shift(1)}writeBytes(e){this.ensureSizeOrGrow(e.length);for(let t=0;t<e.length;t++)this.dataView.setUint8(this.bytePosition+t,e[t]);return this.shift(e.length)}write16(e){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(e),!0),this.shift(2)}write32(e){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(e),!0),this.shift(4)}write64(e){return B0(BigInt(e),8).forEach(t=>this.write8(t)),this}write128(e){return B0(BigInt(e),16).forEach(t=>this.write8(t)),this}write256(e){return B0(BigInt(e),32).forEach(t=>this.write8(t)),this}writeULEB(e){return Nh(e).forEach(t=>this.write8(t)),this}writeVec(e,t){return this.writeULEB(e.length),Array.from(e).forEach((s,r)=>t(this,s,r,e.length)),this}*[Symbol.iterator](){for(let e=0;e<this.bytePosition;e++)yield this.dataView.getUint8(e);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(e){return _6(this.toBytes(),e)}};function B0(e,t){const s=new Uint8Array(t);let r=0;for(;e>0;)s[r]=Number(e%BigInt(256)),e=e/BigInt(256),r+=1;return s}var sr=class I4{#e;#t;constructor(t){this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),this.#e=t.write,this.#t=t.serialize??((s,r)=>{const i=new k6({initialSize:this.serializedSize(s)??void 0,...r});return this.#e(s,i),i.toBytes()}),this.validate=t.validate??(()=>{})}write(t,s){this.validate(t),this.#e(t,s)}serialize(t,s){return this.validate(t),new A6(this,this.#t(t,s))}parse(t){const s=new e6(t);return this.read(s)}fromHex(t){return this.parse(Ku(t))}fromBase58(t){return this.parse(Ih(t))}fromBase64(t){return this.parse(qe(t))}transform({name:t,input:s,output:r,validate:i}){return new I4({name:t??this.name,read:c=>r?r(this.read(c)):this.read(c),write:(c,u)=>this.#e(s?s(c):c,u),serializedSize:c=>this.serializedSize(s?s(c):c),serialize:(c,u)=>this.#t(s?s(c):c,u),validate:c=>{i?.(c),this.validate(s?s(c):c)}})}};const R4=Symbol.for("@mysten/serialized-bcs");function Ry(e){return!!e&&typeof e=="object"&&e[R4]===!0}var A6=class{#e;#t;get[R4](){return!0}constructor(e,t){this.#e=e,this.#t=t}toBytes(){return this.#t}toHex(){return kr(this.#t)}toBase64(){return st(this.#t)}toBase58(){return Ju(this.#t)}parse(){return this.#e.parse(this.#t)}};function jh({size:e,...t}){return new sr({...t,serializedSize:()=>e})}function L0({readMethod:e,writeMethod:t,...s}){return jh({...s,read:r=>r[e](),write:(r,i)=>i[t](r),validate:r=>{if(r<0||r>s.maxValue)throw new TypeError(`Invalid ${s.name} value: ${r}. Expected value in range 0-${s.maxValue}`);s.validate?.(r)}})}function z0({readMethod:e,writeMethod:t,...s}){return jh({...s,read:r=>r[e](),write:(r,i)=>i[t](BigInt(r)),validate:r=>{const i=BigInt(r);if(i<0||i>s.maxValue)throw new TypeError(`Invalid ${s.name} value: ${i}. Expected value in range 0-${s.maxValue}`);s.validate?.(i)}})}function O6({serialize:e,...t}){const s=new sr({...t,serialize:e,write:(r,i)=>{for(const c of s.serialize(r).toBytes())i.write8(c)}});return s}function N6({toBytes:e,fromBytes:t,...s}){return new sr({...s,read:r=>{const i=r.readULEB();return t(r.readBytes(i))},write:(r,i)=>{const c=e(r);i.writeULEB(c.length);for(let u=0;u<c.length;u++)i.write8(c[u])},serialize:r=>{const i=e(r),c=Nh(i.length),u=new Uint8Array(c.length+i.length);return u.set(c,0),u.set(i,c.length),u},validate:r=>{if(typeof r!="string")throw new TypeError(`Invalid ${s.name} value: ${r}. Expected string`);s.validate?.(r)}})}function x6(e){let t=null;function s(){return t||(t=e()),t}return new sr({name:"lazy",read:r=>s().read(r),serializedSize:r=>s().serializedSize(r),write:(r,i)=>s().write(r,i),serialize:(r,i)=>s().serialize(r,i).toBytes()})}var C6=class extends sr{constructor({name:e,fields:t,...s}){const r=Object.entries(t);super({name:e,serializedSize:i=>{let c=0;for(const[u,f]of r){const p=f.serializedSize(i[u]);if(p==null)return null;c+=p}return c},read:i=>{const c={};for(const[u,f]of r)c[u]=f.read(i);return c},write:(i,c)=>{for(const[u,f]of r)f.write(i[u],c)},...s,validate:i=>{if(s?.validate?.(i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})}},I6=class extends sr{constructor({fields:e,...t}){const s=Object.entries(e);super({read:r=>{const i=r.readULEB(),c=s[i];if(!c)throw new TypeError(`Unknown value ${i} for enum ${t.name}`);const[u,f]=c;return{[u]:f?.read(r)??!0,$kind:u}},write:(r,i)=>{const[c,u]=Object.entries(r).filter(([f])=>Object.hasOwn(e,f))[0];for(let f=0;f<s.length;f++){const[p,m]=s[f];if(p===c){i.writeULEB(f),m?.write(u,i);return}}},...t,validate:r=>{if(t?.validate?.(r),typeof r!="object"||r==null)throw new TypeError(`Expected object, found ${typeof r}`);const i=Object.keys(r).filter(u=>r[u]!==void 0&&Object.hasOwn(e,u));if(i.length!==1)throw new TypeError(`Expected object with one key, but found ${i.length} for type ${t.name}}`);const[c]=i;if(!Object.hasOwn(e,c))throw new TypeError(`Invalid enum variant ${c}`)}})}},R6=class extends sr{constructor({fields:e,name:t,...s}){super({name:t??`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let i=0;for(let c=0;c<e.length;c++){const u=e[c].serializedSize(r[c]);if(u==null)return null;i+=u}return i},read:r=>{const i=[];for(const c of e)i.push(c.read(r));return i},write:(r,i)=>{for(let c=0;c<e.length;c++)e[c].write(r[c],i)},...s,validate:r=>{if(s?.validate?.(r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})}};function j6(e,t,s){return new sr({read:r=>{const i=new Array(e);for(let c=0;c<e;c++)i[c]=t.read(r);return i},write:(r,i)=>{for(const c of r)t.write(c,i)},...s,name:s?.name??`${t.name}[${e}]`,validate:r=>{if(s?.validate?.(r),!r||typeof r!="object"||!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})}function M6(e){return E.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>t.$kind==="Some"?t.Some:null})}function D6(e,t){return new sr({read:s=>{const r=s.readULEB(),i=new Array(r);for(let c=0;c<r;c++)i[c]=e.read(s);return i},write:(s,r)=>{r.writeULEB(s.length);for(const i of s)e.write(i,r)},...t,name:t?.name??`vector<${e.name}>`,validate:s=>{if(t?.validate?.(s),!s||typeof s!="object"||!("length"in s))throw new TypeError(`Expected array, found ${typeof s}`)}})}function U6(e,t){for(let s=0;s<Math.min(e.length,t.length);s++)if(e[s]!==t[s])return e[s]-t[s];return e.length-t.length}function B6(e,t){return new sr({name:`Map<${e.name}, ${t.name}>`,read:s=>{const r=s.readULEB(),i=new Map;for(let c=0;c<r;c++)i.set(e.read(s),t.read(s));return i},write:(s,r)=>{const i=[...s.entries()].map(([c,u])=>[e.serialize(c).toBytes(),u]);i.sort(([c],[u])=>U6(c,u)),r.writeULEB(i.length);for(const[c,u]of i)r.writeBytes(c),t.write(u,r)}})}const E={u8(e){return L0({readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e,name:e?.name??"u8"})},u16(e){return L0({readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e,name:e?.name??"u16"})},u32(e){return L0({readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e,name:e?.name??"u32"})},u64(e){return z0({readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e,name:e?.name??"u64"})},u128(e){return z0({readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e,name:e?.name??"u128"})},u256(e){return z0({readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e,name:e?.name??"u256"})},bool(e){return jh({size:1,read:t=>{const s=t.read8();if(s>1)throw new TypeError(`Invalid bool value: expected 0 or 1, found ${s}`);return s===1},write:(t,s)=>s.write8(t?1:0),...e,name:e?.name??"bool",validate:t=>{if(e?.validate?.(t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return O6({read:t=>t.readULEB(),serialize:t=>Uint8Array.from(Nh(t)),...e,name:e?.name??"uleb128"})},bytes(e,t){return jh({size:e,read:s=>s.readBytes(e),write:(s,r)=>{r.writeBytes(new Uint8Array(s))},...t,name:t?.name??`bytes[${e}]`,validate:s=>{if(t?.validate?.(s),!s||typeof s!="object"||!("length"in s))throw new TypeError(`Expected array, found ${typeof s}`);if(s.length!==e)throw new TypeError(`Expected array of length ${e}, found ${s.length}`)}})},byteVector(e){return new sr({read:t=>{const s=t.readULEB();return t.readBytes(s)},write:(t,s)=>{const r=new Uint8Array(t);s.writeULEB(r.length),s.writeBytes(r)},...e,name:e?.name??"vector<u8>",serializedSize:t=>{const s="length"in t?t.length:null;return s==null?null:Nh(s).length+s},validate:t=>{if(e?.validate?.(t),!t||typeof t!="object"||!("length"in t))throw new TypeError(`Expected array, found ${typeof t}`)}})},string(e){return N6({toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t),...e,name:e?.name??"string"})},fixedArray:j6,option:M6,vector:D6,tuple(e,t){return new R6({fields:e,...t})},struct(e,t,s){return new C6({name:e,fields:t,...s})},enum(e,t,s){return new I6({name:e,fields:t,...s})},map:B6,lazy(e){return x6(e)}},Qc=32;function da(e){return V6(e)&&P6(e)===Qc}const L6=/^[a-zA-Z][a-zA-Z0-9_]*$/;function RE(e){return L6.test(e)}const z6=["bool","u8","u16","u32","u64","u128","u256","address","signer"],$6=/^vector<(.+)>$/;function j4(e){if(z6.includes(e))return!0;const t=e.match($6);return t?j4(t[1]):e.includes("::")?D4(e):!1}function M4(e){return!da(e.address)&&!Xu(e.address)||!RE(e.module)||!RE(e.name)?!1:e.typeParams.every(t=>typeof t=="string"?j4(t):M4(t))}function D4(e){try{return M4(ws(e))}catch{return!1}}function U4(e){if(e.startsWith("vector<")){if(!e.endsWith(">"))throw new Error(`Invalid type tag: ${e}`);const t=e.slice(7,-1);if(!t)throw new Error(`Invalid type tag: ${e}`);const s=U4(t);return typeof s=="string"?`vector<${s}>`:`vector<${De(s)}>`}return e.includes("::")?ws(e):e}function ws(e){const t=e.split("::");if(t.length<3)throw new Error(`Invalid struct tag: ${e}`);const[s,r]=t;if(!s||!r)throw new Error(`Invalid struct tag: ${e}`);const i=Xu(s),c=e.slice(s.length+r.length+4),u=c.includes("<")?c.slice(0,c.indexOf("<")):c;if(!u||c.includes("<")&&!c.endsWith(">"))throw new Error(`Invalid struct tag: ${e}`);const f=c.includes("<")?C4(c.slice(c.indexOf("<")+1,c.lastIndexOf(">"))).map(p=>U4(p.trim())):[];return{address:i?s:ye(s),module:r,name:u,typeParams:f}}function De(e){if(typeof e=="string"&&e.startsWith("vector<"))throw new Error("normalizeStructTag does not support vector types. Use normalizeTypeTag instead.");const{address:t,module:s,name:r,typeParams:i}=typeof e=="string"?ws(e):e;return`${t}::${s}::${r}${i?.length>0?`<${i.map(c=>typeof c=="string"?c:De(c)).join(",")}>`:""}`}function ye(e,t=!1){let s=e.toLowerCase();return!t&&s.startsWith("0x")&&(s=s.slice(2)),`0x${s.padStart(Qc*2,"0")}`}function jy(e,t=!1){return ye(e,t)}function V6(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function P6(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}const G6=/^vector<(.+)>$/,F6=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;var Lc=class yc{static parseFromStr(t,s=!1){if(t==="address")return{address:null};if(t==="bool")return{bool:null};if(t==="u8")return{u8:null};if(t==="u16")return{u16:null};if(t==="u32")return{u32:null};if(t==="u64")return{u64:null};if(t==="u128")return{u128:null};if(t==="u256")return{u256:null};if(t==="signer")return{signer:null};const r=t.match(G6);if(r)return{vector:yc.parseFromStr(r[1],s)};const i=t.match(F6);if(i)return{struct:{address:s?ye(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:yc.parseStructTypeArgs(i[5],s)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,s=!1){return C4(t).map(r=>yc.parseFromStr(r,s))}static tagToString(t){if("bool"in t)return"bool";if("u8"in t)return"u8";if("u16"in t)return"u16";if("u32"in t)return"u32";if("u64"in t)return"u64";if("u128"in t)return"u128";if("u256"in t)return"u256";if("address"in t)return"address";if("signer"in t)return"signer";if("vector"in t)return`vector<${yc.tagToString(t.vector)}>`;if("struct"in t){const s=t.struct,r=s.typeParams.map(yc.tagToString).join(", ");return`${s.address}::${s.module}::${s.name}${r?`<${r}>`:""}`}throw new Error("Invalid TypeTag")}};function H6(e){return E.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function q6(e){return E.enum("Option",{None:null,Some:e})}const rt=E.bytes(Qc).transform({validate:e=>{const t=typeof e=="string"?e:kr(e);if(!t||!da(ye(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?Ku(ye(e)):e,output:e=>ye(kr(e))}),qt=E.byteVector().transform({name:"ObjectDigest",input:e=>Ih(e),output:e=>Ju(new Uint8Array(e)),validate:e=>{if(Ih(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),Bs=E.struct("SuiObjectRef",{objectId:rt,version:E.u64(),digest:qt}),B4=E.struct("SharedObjectRef",{objectId:rt,initialSharedVersion:E.u64(),mutable:E.bool()}),L4=E.enum("ObjectArg",{ImmOrOwnedObject:Bs,SharedObject:B4,Receiving:Bs}),oa=E.enum("Owner",{AddressOwner:rt,ObjectOwner:rt,Shared:E.struct("Shared",{initialSharedVersion:E.u64()}),Immutable:null,ConsensusAddressOwner:E.struct("ConsensusAddressOwner",{startVersion:E.u64(),owner:rt})}),Z6=E.enum("Reservation",{MaxAmountU64:E.u64()}),Y6=E.enum("WithdrawalType",{Balance:E.lazy(()=>yo)}),W6=E.enum("WithdrawFrom",{Sender:null,Sponsor:null,SenderAllowance:E.struct("SenderAllowance",{funder:rt,allowance:rt})}),X6=E.struct("FundsWithdrawal",{reservation:Z6,typeArg:Y6,withdrawFrom:W6}),z4=E.enum("CallArg",{Pure:E.struct("Pure",{bytes:E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))})}),Object:L4,FundsWithdrawal:X6}),xv=E.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:E.lazy(()=>xv),struct:E.lazy(()=>Iv),u16:null,u32:null,u256:null}),yo=xv.transform({input:e=>typeof e=="string"?Lc.parseFromStr(e,!0):e,output:e=>Lc.tagToString(e)}),vr=E.enum("Argument",{GasCoin:null,Input:E.u16(),Result:E.u16(),NestedResult:E.tuple([E.u16(),E.u16()])}),$4=E.struct("ProgrammableMoveCall",{package:rt,module:E.string(),function:E.string(),typeArguments:E.vector(yo),arguments:E.vector(vr)}),V4=E.enum("Command",{MoveCall:$4,TransferObjects:E.struct("TransferObjects",{objects:E.vector(vr),address:vr}),SplitCoins:E.struct("SplitCoins",{coin:vr,amounts:E.vector(vr)}),MergeCoins:E.struct("MergeCoins",{destination:vr,sources:E.vector(vr)}),Publish:E.struct("Publish",{modules:E.vector(E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))})),dependencies:E.vector(rt)}),MakeMoveVec:E.struct("MakeMoveVec",{type:q6(yo).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:E.vector(vr)}),Upgrade:E.struct("Upgrade",{modules:E.vector(E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))})),dependencies:E.vector(rt),package:rt,ticket:vr})}),My=E.struct("ProgrammableTransaction",{inputs:E.vector(z4),commands:E.vector(V4)}),J6=E.struct("ValidDuring",{minEpoch:E.option(E.u64()),maxEpoch:E.option(E.u64()),minTimestamp:E.option(E.u64()),maxTimestamp:E.option(E.u64()),chain:qt,nonce:E.u32()});function Cv(e){if(e.length===0)throw new Error("Allowed proposers must not be empty");return e}function P4(e){Cv(e);for(let t=1;t<e.length;t++)if(e[t]<=e[t-1])throw new Error("Allowed proposers must be strictly increasing");return e}const K6=E.vector(E.u32()).transform({input:P4,output:Cv}),Q6=E.struct("AllowedProposers",{epoch:E.u64(),proposers:K6}),eI=E.struct("Validity",{minEpoch:E.option(E.u64()),maxEpoch:E.option(E.u64()),minTimestamp:E.option(E.u64()),maxTimestamp:E.option(E.u64()),chain:qt,nonce:E.u32(),allowedProposers:E.option(Q6)}),G4=E.enum("TransactionExpiration",{None:null,Epoch:H6(),ValidDuring:J6,Validity:eI}),Iv=E.struct("StructTag",{address:rt,module:E.string(),name:E.string(),typeParams:E.vector(xv)}),F4=E.struct("GasData",{payment:E.vector(Bs),owner:rt,price:E.u64(),budget:E.u64()}),H4=E.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),q4=E.enum("IntentVersion",{V0:null}),Z4=E.enum("AppId",{Sui:null}),Y4=E.struct("Intent",{scope:H4,version:q4,appId:Z4});function W4(e){return E.struct(`IntentMessage<${e.name}>`,{intent:Y4,value:e})}const X4=E.enum("CompressedSignature",{ED25519:E.bytes(64),Secp256k1:E.bytes(64),Secp256r1:E.bytes(64),ZkLogin:E.byteVector(),Passkey:E.byteVector()}),J4=E.enum("PublicKey",{ED25519:E.bytes(32),Secp256k1:E.bytes(33),Secp256r1:E.bytes(33),ZkLogin:E.byteVector(),Passkey:E.bytes(33)}),K4=E.struct("MultiSigPkMap",{pubKey:J4,weight:E.u8()}),Q4=E.struct("MultiSigPublicKey",{pk_map:E.vector(K4),threshold:E.u16()}),tI=E.struct("MultiSig",{sigs:E.vector(X4),bitmap:E.u16(),multisig_pk:Q4}),nI=E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))}),ek=E.struct("PasskeyAuthenticator",{authenticatorData:E.byteVector(),clientDataJson:E.string(),userSignature:E.byteVector()}),tk=E.enum("MoveObjectType",{Other:Iv,GasCoin:null,StakedSui:null,Coin:yo,AccumulatorBalanceWrapper:null}),nk=E.struct("TypeOrigin",{moduleName:E.string(),datatypeName:E.string(),package:rt}),sk=E.struct("UpgradeInfo",{upgradedId:rt,upgradedVersion:E.u64()}),rk=E.struct("MovePackage",{id:rt,version:E.u64(),moduleMap:E.map(E.string(),E.byteVector()),typeOriginTable:E.vector(nk),linkageTable:E.map(rt,sk)}),ak=E.struct("MoveObject",{type:tk,hasPublicTransfer:E.bool(),version:E.u64(),contents:E.byteVector()}),Rv=E.enum("Data",{Move:ak,Package:rk}),sI=E.struct("ObjectInner",{data:Rv,owner:oa,previousTransaction:qt,storageRebate:E.u64()}),ik=E.struct("ChangeEpoch",{epoch:E.u64(),protocolVersion:E.u64(),storageCharge:E.u64(),computationCharge:E.u64(),storageRebate:E.u64(),nonRefundableStorageFee:E.u64(),epochStartTimestampMs:E.u64(),systemPackages:E.vector(E.tuple([E.u64(),E.vector(E.byteVector()),E.vector(rt)]))}),rI=E.enum("GenesisObject",{RawObject:E.struct("RawObject",{data:Rv,owner:oa})}),aI=E.struct("GenesisTransaction",{objects:E.vector(rI)}),iI=E.struct("ConsensusCommitPrologue",{epoch:E.u64(),round:E.u64(),commitTimestampMs:E.u64()}),oI=E.struct("ConsensusCommitPrologueV2",{epoch:E.u64(),round:E.u64(),commitTimestampMs:E.u64(),consensusCommitDigest:qt}),ok=E.enum("ConsensusDeterminedVersionAssignments",{CancelledTransactions:E.vector(E.tuple([qt,E.vector(E.tuple([rt,E.u64()]))])),CancelledTransactionsV2:E.vector(E.tuple([qt,E.vector(E.tuple([E.tuple([rt,E.u64()]),E.u64()]))]))}),cI=E.struct("ConsensusCommitPrologueV3",{epoch:E.u64(),round:E.u64(),subDagIndex:E.option(E.u64()),commitTimestampMs:E.u64(),consensusCommitDigest:qt,consensusDeterminedVersionAssignments:ok}),lI=E.struct("ConsensusCommitPrologueV4",{epoch:E.u64(),round:E.u64(),subDagIndex:E.option(E.u64()),commitTimestampMs:E.u64(),consensusCommitDigest:qt,consensusDeterminedVersionAssignments:ok,additionalStateDigest:qt}),uI=E.struct("ActiveJwk",{jwkId:E.struct("JwkId",{iss:E.string(),kid:E.string()}),jwk:E.struct("JWK",{kty:E.string(),e:E.string(),n:E.string(),alg:E.string()}),epoch:E.u64()}),dI=E.struct("AuthenticatorStateUpdate",{epoch:E.u64(),round:E.u64(),newActiveJwks:E.vector(uI),authenticatorObjInitialSharedVersion:E.u64()}),fI=E.struct("RandomnessStateUpdate",{epoch:E.u64(),randomnessRound:E.u64(),randomBytes:E.byteVector(),randomnessObjInitialSharedVersion:E.u64()}),hI=E.struct("AuthenticatorStateExpire",{minEpoch:E.u64(),authenticatorObjInitialSharedVersion:E.u64()}),pI=E.enum("ExecutionTimeObservationKey",{MoveEntryPoint:E.struct("MoveEntryPoint",{package:rt,module:E.string(),function:E.string(),typeArguments:E.vector(yo)}),TransferObjects:null,SplitCoins:null,MergeCoins:null,Publish:null,MakeMoveVec:null,Upgrade:null}),mI=E.enum("StoredExecutionTimeObservations",{V1:E.vector(E.tuple([pI,E.vector(E.tuple([E.byteVector(),E.struct("Duration",{secs:E.u64(),nanos:E.u32()})]))]))}),gI=E.struct("WriteAccumulatorStorageCost",{storageCost:E.u64()}),yI=E.enum("EndOfEpochTransactionKind",{ChangeEpoch:ik,AuthenticatorStateCreate:null,AuthenticatorStateExpire:hI,RandomnessStateCreate:null,DenyListStateCreate:null,BridgeStateCreate:qt,BridgeCommitteeInit:E.u64(),StoreExecutionTimeObservations:mI,AccumulatorRootCreate:null,CoinRegistryCreate:null,DisplayRegistryCreate:null,AddressAliasStateCreate:null,WriteAccumulatorStorageCost:gI,ForwardingAddressRegistryCreate:null}),ck=E.enum("TransactionKind",{ProgrammableTransaction:My,ChangeEpoch:ik,Genesis:aI,ConsensusCommitPrologue:iI,AuthenticatorStateUpdate:dI,EndOfEpochTransaction:E.vector(yI),RandomnessStateUpdate:fI,ConsensusCommitPrologueV2:oI,ConsensusCommitPrologueV3:cI,ConsensusCommitPrologueV4:lI,ProgrammableSystemTransaction:My}),lk=E.struct("TransactionDataV1",{kind:ck,sender:rt,gasData:F4,expiration:G4}),uk=E.enum("TransactionData",{V1:lk}),dk=E.struct("SenderSignedTransaction",{intentMessage:W4(uk),txSignatures:E.vector(nI)}),vI=E.vector(dk,{name:"SenderSignedData"}),bI=E.enum("PackageUpgradeError",{UnableToFetchPackage:E.struct("UnableToFetchPackage",{packageId:rt}),NotAPackage:E.struct("NotAPackage",{objectId:rt}),IncompatibleUpgrade:null,DigestDoesNotMatch:E.struct("DigestDoesNotMatch",{digest:E.byteVector()}),UnknownUpgradePolicy:E.struct("UnknownUpgradePolicy",{policy:E.u8()}),PackageIDDoesNotMatch:E.struct("PackageIDDoesNotMatch",{packageId:rt,ticketId:rt})}),wI=E.struct("ModuleId",{address:rt,name:E.string()}),jE=E.struct("MoveLocation",{module:wI,function:E.u16(),instruction:E.u16(),functionName:E.option(E.string())}),TI=E.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:E.struct("IndexOutOfBounds",{idx:E.u16()}),SecondaryIndexOutOfBounds:E.struct("SecondaryIndexOutOfBounds",{resultIdx:E.u16(),secondaryIdx:E.u16()}),InvalidResultArity:E.struct("InvalidResultArity",{resultIdx:E.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null,InvalidArgumentArity:null,InvalidTransferObject:null,InvalidMakeMoveVecNonObjectArgument:null,ArgumentWithoutValue:null,CannotMoveBorrowedValue:null,CannotWriteToExtendedReference:null,InvalidReferenceArgument:null,InvalidTxContext:null}),EI=E.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),SI=E.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:E.struct("MoveObjectTooBig",{objectSize:E.u64(),maxObjectSize:E.u64()}),MovePackageTooBig:E.struct("MovePackageTooBig",{objectSize:E.u64(),maxObjectSize:E.u64()}),CircularObjectOwnership:E.struct("CircularObjectOwnership",{object:rt}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:E.option(jE),MoveAbort:E.tuple([jE,E.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:E.struct("CommandArgumentError",{argIdx:E.u16(),kind:TI}),TypeArgumentError:E.struct("TypeArgumentError",{argumentIdx:E.u16(),kind:EI}),UnusedValueWithoutDrop:E.struct("UnusedValueWithoutDrop",{resultIdx:E.u16(),secondaryIdx:E.u16()}),InvalidPublicFunctionReturnType:E.struct("InvalidPublicFunctionReturnType",{idx:E.u16()}),InvalidTransferObject:null,EffectsTooLarge:E.struct("EffectsTooLarge",{currentSize:E.u64(),maxSize:E.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:E.struct("PackageUpgradeError",{upgradeError:bI}),WrittenObjectsTooLarge:E.struct("WrittenObjectsTooLarge",{currentSize:E.u64(),maxSize:E.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:E.struct("ExecutionCancelledDueToSharedObjectCongestion",{congested_objects:E.vector(rt)}),AddressDeniedForCoin:E.struct("AddressDeniedForCoin",{address:rt,coinType:E.string()}),CoinTypeGlobalPause:E.struct("CoinTypeGlobalPause",{coinType:E.string()}),ExecutionCancelledDueToRandomnessUnavailable:null,MoveVectorElemTooBig:E.struct("MoveVectorElemTooBig",{valueSize:E.u64(),maxScaledSize:E.u64()}),MoveRawValueTooBig:E.struct("MoveRawValueTooBig",{valueSize:E.u64(),maxScaledSize:E.u64()}),InvalidLinkage:null,InsufficientBalanceForWithdraw:null,NonExclusiveWriteInputObjectModified:E.struct("NonExclusiveWriteInputObjectModified",{id:rt})}),jv=E.enum("ExecutionStatus",{Success:null,Failure:E.struct("Failure",{error:SI,command:E.option(E.u64())})}),fk=E.struct("GasCostSummary",{computationCost:E.u64(),storageCost:E.u64(),storageRebate:E.u64(),nonRefundableStorageFee:E.u64()}),_I=E.struct("TransactionEffectsV1",{status:jv,executedEpoch:E.u64(),gasUsed:fk,modifiedAtVersions:E.vector(E.tuple([rt,E.u64()])),sharedObjects:E.vector(Bs),transactionDigest:qt,created:E.vector(E.tuple([Bs,oa])),mutated:E.vector(E.tuple([Bs,oa])),unwrapped:E.vector(E.tuple([Bs,oa])),deleted:E.vector(Bs),unwrappedThenDeleted:E.vector(Bs),wrapped:E.vector(Bs),gasObject:E.tuple([Bs,oa]),eventsDigest:E.option(qt),dependencies:E.vector(qt)}),Mv=E.tuple([E.u64(),qt]),kI=E.enum("ObjectIn",{NotExist:null,Exist:E.tuple([Mv,oa])}),AI=E.struct("AccumulatorAddress",{address:rt,ty:yo}),OI=E.enum("AccumulatorOperation",{Merge:null,Split:null}),NI=E.enum("AccumulatorValue",{Integer:E.u64(),IntegerTuple:E.tuple([E.u64(),E.u64()]),EventDigest:E.vector(E.tuple([E.u64(),qt]))}),xI=E.struct("AccumulatorWriteV1",{address:AI,operation:OI,value:NI}),CI=E.enum("ObjectOut",{NotExist:null,ObjectWrite:E.tuple([qt,oa]),PackageWrite:Mv,AccumulatorWriteV1:xI}),II=E.enum("IDOperation",{None:null,Created:null,Deleted:null}),RI=E.struct("EffectsObjectChange",{inputState:kI,outputState:CI,idOperation:II}),jI=E.enum("UnchangedConsensusKind",{ReadOnlyRoot:Mv,MutateConsensusStreamEnded:E.u64(),ReadConsensusStreamEnded:E.u64(),Cancelled:E.u64(),PerEpochConfig:null}),MI=E.struct("TransactionEffectsV2",{status:jv,executedEpoch:E.u64(),gasUsed:fk,transactionDigest:qt,gasObjectIndex:E.option(E.u32()),eventsDigest:E.option(qt),dependencies:E.vector(qt),lamportVersion:E.u64(),changedObjects:E.vector(E.tuple([rt,RI])),unchangedConsensusObjects:E.vector(E.tuple([rt,jI])),auxDataDigest:E.option(qt)}),DI=E.enum("TransactionEffects",{V1:_I,V2:MI});function ku(e){switch(e){case"u8":return E.u8();case"u16":return E.u16();case"u32":return E.u32();case"u64":return E.u64();case"u128":return E.u128();case"u256":return E.u256();case"bool":return E.bool();case"string":return E.string();case"id":case"address":return rt}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[s,r]=t.slice(1);return s==="vector"?E.vector(ku(r)):E.option(ku(r))}throw new Error(`Invalid Pure type name: ${e}`)}const F={...E,U8:E.u8(),U16:E.u16(),U32:E.u32(),U64:E.u64(),U128:E.u128(),U256:E.u256(),ULEB128:E.uleb128(),Bool:E.bool(),String:E.string(),Address:rt,AppId:Z4,Argument:vr,CallArg:z4,Command:V4,CompressedSignature:X4,Data:Rv,GasData:F4,Intent:Y4,IntentMessage:W4,IntentScope:H4,IntentVersion:q4,MoveObject:ak,MoveObjectType:tk,MovePackage:rk,MultiSig:tI,MultiSigPkMap:K4,MultiSigPublicKey:Q4,Object:sI,ObjectArg:L4,ObjectDigest:qt,Owner:oa,PasskeyAuthenticator:ek,ProgrammableMoveCall:$4,ProgrammableTransaction:My,PublicKey:J4,SenderSignedData:vI,SenderSignedTransaction:dk,SharedObjectRef:B4,StructTag:Iv,SuiObjectRef:Bs,TransactionData:uk,TransactionDataV1:lk,TransactionEffects:DI,TransactionExpiration:G4,TransactionKind:ck,TypeOrigin:nk,TypeTag:yo,UpgradeInfo:sk},UI={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Dv(e){return UI}let BI;function LI(e){return BI?.get(e)}let zI;function $I(e){return zI?.get(e)}let VI;function PI(e,t){return VI?.get(e)?.get(t)}function Uv(e){const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}function wn(e,t,s,r,i){const c=i&&"input"in i?i.input:s.value,u=i?.expected??e.expects??null,f=i?.received??Uv(c),p={kind:e.kind,type:e.type,input:c,expected:u,received:f,message:`Invalid ${t}: ${u?`Expected ${u} but r`:"R"}eceived ${f}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},m=e.kind==="schema",g=i?.message??e.message??PI(e.reference,p.lang)??(m?$I(p.lang):null)??r.message??LI(p.lang);g!==void 0&&(p.message=typeof g=="function"?g(p):g),m&&(s.typed=!1),s.issues?s.issues.push(p):s.issues=[p]}function GI(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function FI(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function Bv(e,t){const s=[...new Set(e)];return s.length>1?`(${s.join(` ${t} `)})`:s[0]??"never"}function En(e){return e["~standard"]={version:1,vendor:"valibot",validate:t=>e["~run"]({value:t},Dv())},e}var HI=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};const qI=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;function el(e,t){return{kind:"validation",type:"check",reference:el,async:!1,expects:null,requirement:e,message:t,"~run"(s,r){return s.typed&&!this.requirement(s.value)&&wn(this,"input",s,r),s}}}function Hn(e){return{kind:"validation",type:"integer",reference:Hn,async:!1,expects:null,requirement:Number.isInteger,message:e,"~run"(t,s){return t.typed&&!this.requirement(t.value)&&wn(this,"integer",t,s),t}}}function Qu(e){return{kind:"transformation",type:"transform",reference:Qu,async:!1,operation:e,"~run"(t){return t.value=this.operation(t.value),t}}}function hk(e){return{kind:"validation",type:"uuid",reference:hk,async:!1,expects:null,requirement:qI,message:e,"~run"(t,s){return t.typed&&!this.requirement.test(t.value)&&wn(this,"UUID",t,s),t}}}const pk={abortEarly:!0};function ZI(e,t,s){return typeof e.fallback=="function"?e.fallback(t,s):e.fallback}function Tp(e,t,s){return typeof e.default=="function"?e.default(t,s):e.default}function Dy(e,t){return!e["~run"]({value:t},pk).issues}function ct(e,t){return En({kind:"schema",type:"array",reference:ct,expects:"Array",async:!1,item:e,message:t,"~run"(s,r){const i=s.value;if(Array.isArray(i)){s.typed=!0,s.value=[];for(let c=0;c<i.length;c++){const u=i[c],f=this.item["~run"]({value:u},r);if(f.issues){const p={type:"array",origin:"value",input:i,key:c,value:u};for(const m of f.issues)m.path?m.path.unshift(p):m.path=[p],s.issues?.push(m);if(s.issues||(s.issues=f.issues),r.abortEarly){s.typed=!1;break}}f.typed||(s.typed=!1),s.value.push(f.value)}}else wn(this,"type",s,r);return s}})}function Lv(e){return En({kind:"schema",type:"bigint",reference:Lv,expects:"bigint",async:!1,message:e,"~run"(t,s){return typeof t.value=="bigint"?t.typed=!0:wn(this,"type",t,s),t}})}function co(e){return En({kind:"schema",type:"boolean",reference:co,expects:"boolean",async:!1,message:e,"~run"(t,s){return typeof t.value=="boolean"?t.typed=!0:wn(this,"type",t,s),t}})}function Uy(e){return En({kind:"schema",type:"lazy",reference:Uy,expects:"unknown",async:!1,getter:e,"~run"(t,s){return this.getter(t.value)["~run"](t,s)}})}function nt(e,t){return En({kind:"schema",type:"literal",reference:nt,expects:Uv(e),async:!1,literal:e,message:t,"~run"(s,r){return GI(s.value,this.literal)?s.typed=!0:wn(this,"type",s,r),s}})}function Ct(e,t){return En({kind:"schema",type:"nullable",reference:Ct,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,"~run"(s,r){return s.value===null&&(this.default!==void 0&&(s.value=Tp(this,s,r)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,r)}})}function Ru(e,t){return En({kind:"schema",type:"nullish",reference:Ru,expects:`(${e.expects} | null | undefined)`,async:!1,wrapped:e,default:t,"~run"(s,r){return(s.value===null||s.value===void 0)&&(this.default!==void 0&&(s.value=Tp(this,s,r)),s.value===null||s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,r)}})}function Cn(e){return En({kind:"schema",type:"number",reference:Cn,expects:"number",async:!1,message:e,"~run"(t,s){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:wn(this,"type",t,s),t}})}function Ne(e,t){return En({kind:"schema",type:"object",reference:Ne,expects:"Object",async:!1,entries:e,message:t,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){s.typed=!0,s.value={};for(const c in this.entries){const u=this.entries[c];if(c in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const f=c in i?i[c]:Tp(u),p=u["~run"]({value:f},r);if(p.issues){const m={type:"object",origin:"value",input:i,key:c,value:f};for(const g of p.issues)g.path?g.path.unshift(m):g.path=[m],s.issues?.push(g);if(s.issues||(s.issues=p.issues),r.abortEarly){s.typed=!1;break}}p.typed||(s.typed=!1),s.value[c]=p.value}else if(u.fallback!==void 0)s.value[c]=ZI(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(wn(this,"key",s,r,{input:void 0,expected:`"${c}"`,path:[{type:"object",origin:"key",input:i,key:c,value:i[c]}]}),r.abortEarly))break}}else wn(this,"type",s,r);return s}})}function dn(e,t){return En({kind:"schema",type:"optional",reference:dn,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,"~run"(s,r){return s.value===void 0&&(this.default!==void 0&&(s.value=Tp(this,s,r)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,r)}})}function zv(e,t){return En({kind:"schema",type:"picklist",reference:zv,expects:Bv(e.map(Uv),"|"),async:!1,options:e,message:t,"~run"(s,r){return this.options.includes(s.value)?s.typed=!0:wn(this,"type",s,r),s}})}function ju(e,t,s){return En({kind:"schema",type:"record",reference:ju,expects:"Object",async:!1,key:e,value:t,message:s,"~run"(r,i){const c=r.value;if(c&&typeof c=="object"){r.typed=!0,r.value={};for(const u in c)if(FI(c,u)){const f=c[u],p=this.key["~run"]({value:u},i);if(p.issues){const g={type:"object",origin:"key",input:c,key:u,value:f};for(const y of p.issues)y.path=[g],r.issues?.push(y);if(r.issues||(r.issues=p.issues),i.abortEarly){r.typed=!1;break}}const m=this.value["~run"]({value:f},i);if(m.issues){const g={type:"object",origin:"value",input:c,key:u,value:f};for(const y of m.issues)y.path?y.path.unshift(g):y.path=[g],r.issues?.push(y);if(r.issues||(r.issues=m.issues),i.abortEarly){r.typed=!1;break}}(!p.typed||!m.typed)&&(r.typed=!1),p.typed&&(r.value[p.value]=m.value)}}else wn(this,"type",r,i);return r}})}function Be(e){return En({kind:"schema",type:"string",reference:Be,expects:"string",async:!1,message:e,"~run"(t,s){return typeof t.value=="string"?t.typed=!0:wn(this,"type",t,s),t}})}function $v(e,t){return En({kind:"schema",type:"tuple",reference:$v,expects:"Array",async:!1,items:e,message:t,"~run"(s,r){const i=s.value;if(Array.isArray(i)){s.typed=!0,s.value=[];for(let c=0;c<this.items.length;c++){const u=i[c],f=this.items[c]["~run"]({value:u},r);if(f.issues){const p={type:"array",origin:"value",input:i,key:c,value:u};for(const m of f.issues)m.path?m.path.unshift(p):m.path=[p],s.issues?.push(m);if(s.issues||(s.issues=f.issues),r.abortEarly){s.typed=!1;break}}f.typed||(s.typed=!1),s.value.push(f.value)}}else wn(this,"type",s,r);return s}})}function ME(e){let t;if(e)for(const s of e)if(t)for(const r of s.issues)t.push(r);else t=s.issues;return t}function tr(e,t){return En({kind:"schema",type:"union",reference:tr,expects:Bv(e.map(s=>s.expects),"|"),async:!1,options:e,message:t,"~run"(s,r){let i,c,u;for(const f of this.options){const p=f["~run"]({value:s.value},r);if(p.typed)if(p.issues)c?c.push(p):c=[p];else{i=p;break}else u?u.push(p):u=[p]}if(i)return i;if(c){if(c.length===1)return c[0];wn(this,"type",s,r,{issues:ME(c)}),s.typed=!0}else{if(u?.length===1)return u[0];wn(this,"type",s,r,{issues:ME(u)})}return s}})}function tl(){return En({kind:"schema",type:"unknown",reference:tl,expects:"unknown",async:!1,"~run"(e){return e.typed=!0,e}})}function Ep(e,t,s){return En({kind:"schema",type:"variant",reference:Ep,expects:"Object",async:!1,key:e,options:t,message:s,"~run"(r,i){const c=r.value;if(c&&typeof c=="object"){let u,f=0,p=this.key,m=[];const g=(y,b)=>{for(const S of y.options){if(S.type==="variant")g(S,new Set(b).add(S.key));else{let A=!0,N=0;for(const j of b){const V=S.entries[j];if(j in c?V["~run"]({typed:!1,value:c[j]},pk).issues:V.type!=="exact_optional"&&V.type!=="optional"&&V.type!=="nullish"){A=!1,p!==j&&(f<N||f===N&&j in c&&!(p in c))&&(f=N,p=j,m=[]),p===j&&m.push(S.entries[j].expects);break}N++}if(A){const j=S["~run"]({value:c},i);(!u||!u.typed&&j.typed)&&(u=j)}}if(u&&!u.issues)break}};if(g(this,new Set([this.key])),u)return u;wn(this,"type",r,i,{input:c[p],expected:Bv(m,"|"),path:[{type:"object",origin:"value",input:c,key:p,value:c[p]}]})}else wn(this,"type",r,i);return r}})}function St(e,t,s){const r=e["~run"]({value:t},Dv());if(r.issues)throw new HI(r.issues);return r.value}function Xt(...e){return En({...e[0],pipe:e,"~run"(t,s){for(const r of e)if(r.kind!=="metadata"){if(t.issues&&(r.kind==="schema"||r.kind==="transformation")){t.typed=!1;break}(!t.issues||!s.abortEarly&&!s.abortPipeEarly)&&(t=r["~run"](t,s))}return t}})}function YI(e,t,s){const r=e["~run"]({value:t},Dv());return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}function jr(e){const t=Object.keys(e).map(s=>Ne({[s]:e[s],$kind:nt(s)}));return Xt(tl(),el(s=>DE(s,e)===void 0,({input:s,message:r})=>DE(s,e)??r),Qu(WI),Ep("$kind",t))}function mk(e){return typeof e!="object"||e===null?null:"$kind"in e&&typeof e.$kind=="string"?e.$kind:Object.keys(e).find(t=>t!=="$kind")??null}function WI(e){if(typeof e!="object"||e===null||"$kind"in e)return e;const t=mk(e);return t===null?e:{...e,$kind:t}}function DE(e,t){const s=mk(e);if(!(s===null||Object.hasOwn(t,s)))return`Unsupported enum variant "${s}". Expected one of: ${Object.keys(t).map(r=>`"${r}"`).join(", ")}.`}function Vf(e,t){return Xt(Ne({...t.entries,$kind:dn(nt(e))}),Qu(s=>({...s,$kind:e})))}const vo=Xt(Be(),Qu(e=>ye(e)),el(da)),ss=vo,lo=Be(),nn=Xt(tr([Be(),Xt(Cn(),Hn())]),el(e=>{try{return BigInt(e),BigInt(e)>=0&&BigInt(e)<=18446744073709551615n}catch{return!1}},"Invalid u64")),gk=Xt(Cn(),Hn(),el(e=>e>=0&&e<2**32,"Invalid u32")),fi=Ne({objectId:vo,version:nn,digest:Be()}),Dt=tr([Vf("GasCoin",Ne({GasCoin:nt(!0)})),Vf("Input",Ne({Input:Xt(Cn(),Hn()),type:dn(tr([nt("pure"),nt("object"),nt("withdrawal")]))})),Vf("Result",Ne({Result:Xt(Cn(),Hn())})),Vf("NestedResult",Ne({NestedResult:$v([Xt(Cn(),Hn()),Xt(Cn(),Hn())])}))]),XI=Ne({budget:Ct(nn),price:Ct(nn),owner:Ct(vo),payment:Ct(ct(fi))}),By=tr([Ne({$kind:nt("address")}),Ne({$kind:nt("bool")}),Ne({$kind:nt("u8")}),Ne({$kind:nt("u16")}),Ne({$kind:nt("u32")}),Ne({$kind:nt("u64")}),Ne({$kind:nt("u128")}),Ne({$kind:nt("u256")}),Ne({$kind:nt("unknown")}),Ne({$kind:nt("vector"),vector:Uy(()=>By)}),Ne({$kind:nt("datatype"),datatype:Ne({typeName:Be(),typeParameters:ct(Uy(()=>By))})}),Ne({$kind:nt("typeParameter"),index:Xt(Cn(),Hn())})]),JI=Ne({reference:Ct(tr([nt("mutable"),nt("immutable"),nt("unknown")])),body:By}),KI=Ne({package:ss,module:Be(),function:Be(),typeArguments:ct(Be()),arguments:ct(Dt),_argumentTypes:dn(Ct(ct(JI)))}),QI=Ne({name:Be(),inputs:ju(Be(),tr([Dt,ct(Dt)])),data:ju(Be(),tl())}),eR=jr({MoveCall:KI,TransferObjects:Ne({objects:ct(Dt),address:Dt}),SplitCoins:Ne({coin:Dt,amounts:ct(Dt)}),MergeCoins:Ne({destination:Dt,sources:ct(Dt)}),Publish:Ne({modules:ct(lo),dependencies:ct(ss)}),MakeMoveVec:Ne({type:Ct(Be()),elements:ct(Dt)}),Upgrade:Ne({modules:ct(lo),dependencies:ct(ss),package:ss,ticket:Dt}),$Intent:QI}),yk=jr({ImmOrOwnedObject:fi,SharedObject:Ne({objectId:ss,initialSharedVersion:nn,mutable:co()}),Receiving:fi}),tR=jr({MaxAmountU64:nn}),nR=jr({Balance:Be()}),sR=jr({Sender:nt(!0),Sponsor:nt(!0),SenderAllowance:Ne({funder:vo,allowance:ss})}),vk=Ne({reservation:tR,typeArg:nR,withdrawFrom:sR}),rR=jr({Object:yk,Pure:Ne({bytes:lo}),UnresolvedPure:Ne({value:tl()}),UnresolvedObject:Ne({objectId:ss,version:dn(Ct(nn)),digest:dn(Ct(Be())),initialSharedVersion:dn(Ct(nn)),mutable:dn(Ct(co()))}),FundsWithdrawal:vk}),UE=jr({Object:yk,Pure:Ne({bytes:lo})}),Vv=Ne({minEpoch:Ct(nn),maxEpoch:Ct(nn),minTimestamp:Ct(nn),maxTimestamp:Ct(nn),chain:Be(),nonce:gk}),aR=Ne({epoch:nn,proposers:Xt(ct(gk),el(e=>e.length>0,"Allowed proposers must not be empty"))}),bk=Ne({...Vv.entries,allowedProposers:Ct(aR)}),wk=jr({None:nt(!0),Epoch:nn,ValidDuring:Vv,Validity:bk}),ah=Ne({version:nt(2),sender:Ru(vo),expiration:Ru(wk),gasData:XI,inputs:ct(rR),commands:ct(eR)});function Mh(e){if(typeof e=="string")return ye(e);if(e.Object)return e.Object.ImmOrOwnedObject?ye(e.Object.ImmOrOwnedObject.objectId):e.Object.Receiving?ye(e.Object.Receiving.objectId):ye(e.Object.SharedObject.objectId);if(e.UnresolvedObject)return ye(e.UnresolvedObject.objectId)}function iR(e,t,s){const r=i=>{switch(i.$kind){case"Input":{const c=t.get(i.Input);if(c===void 0)throw new Error(`Input ${i.Input} not found in input mapping`);return{...i,Input:c}}case"Result":{const c=s.get(i.Result);return c!==void 0?{...i,Result:c}:i}case"NestedResult":{const c=s.get(i.NestedResult[0]);return c!==void 0?{...i,NestedResult:[c,i.NestedResult[1]]}:i}default:return i}};switch(e.$kind){case"MoveCall":e.MoveCall.arguments=e.MoveCall.arguments.map(r);break;case"TransferObjects":e.TransferObjects.objects=e.TransferObjects.objects.map(r),e.TransferObjects.address=r(e.TransferObjects.address);break;case"SplitCoins":e.SplitCoins.coin=r(e.SplitCoins.coin),e.SplitCoins.amounts=e.SplitCoins.amounts.map(r);break;case"MergeCoins":e.MergeCoins.destination=r(e.MergeCoins.destination),e.MergeCoins.sources=e.MergeCoins.sources.map(r);break;case"MakeMoveVec":e.MakeMoveVec.elements=e.MakeMoveVec.elements.map(r);break;case"Upgrade":e.Upgrade.ticket=r(e.Upgrade.ticket);break;case"$Intent":{const i=e.$Intent.inputs;e.$Intent.inputs={};for(const[c,u]of Object.entries(i))e.$Intent.inputs[c]=Array.isArray(u)?u.map(r):r(u);break}}}const BE=Ne({digest:Be(),objectId:Be(),version:tr([Xt(Cn(),Hn()),Be(),Lv()])}),oR=jr({ImmOrOwned:BE,Shared:Ne({objectId:ss,initialSharedVersion:nn,mutable:co()}),Receiving:BE}),LE=jr({Object:oR,Pure:ct(Xt(Cn(),Hn()))});function cR(e){if(!e)return null;switch(e.$kind){case"Epoch":return{Epoch:Number(e.Epoch)};case"ValidDuring":return{ValidDuring:e.ValidDuring};case"Validity":return{Validity:e.Validity};case"None":return{None:!0};default:throw new Error(`Unknown transaction expiration: ${JSON.stringify(e)}`)}}function lR(e){if(!e)return null;if("Epoch"in e)return{Epoch:e.Epoch};if("ValidDuring"in e)return{ValidDuring:e.ValidDuring};if("Validity"in e)return{Validity:e.Validity};if("None"in e)return{None:!0};throw new Error(`Unknown transaction expiration in v1 transaction data: ${Object.keys(e).join(", ")}`)}function uR(e){const t=e.inputs.map((s,r)=>{if(s.Object)return{kind:"Input",index:r,value:{Object:s.Object.ImmOrOwnedObject?{ImmOrOwned:s.Object.ImmOrOwnedObject}:s.Object.Receiving?{Receiving:{digest:s.Object.Receiving.digest,version:s.Object.Receiving.version,objectId:s.Object.Receiving.objectId}}:{Shared:{mutable:s.Object.SharedObject.mutable,initialSharedVersion:s.Object.SharedObject.initialSharedVersion,objectId:s.Object.SharedObject.objectId}}},type:"object"};if(s.Pure)return{kind:"Input",index:r,value:{Pure:Array.from(qe(s.Pure.bytes))},type:"pure"};if(s.UnresolvedPure)return{kind:"Input",type:"pure",index:r,value:s.UnresolvedPure.value};if(s.UnresolvedObject)return{kind:"Input",type:"object",index:r,value:s.UnresolvedObject.objectId};throw new Error("Invalid input")});return{version:1,sender:e.sender??void 0,expiration:cR(e.expiration),gasConfig:{owner:e.gasData.owner??void 0,budget:e.gasData.budget??void 0,price:e.gasData.price??void 0,payment:e.gasData.payment??void 0},inputs:t,transactions:e.commands.map(s=>{if(s.MakeMoveVec)return{kind:"MakeMoveVec",type:s.MakeMoveVec.type===null?{None:!0}:{Some:Lc.parseFromStr(s.MakeMoveVec.type)},objects:s.MakeMoveVec.elements.map(r=>Wr(r,t))};if(s.MergeCoins)return{kind:"MergeCoins",destination:Wr(s.MergeCoins.destination,t),sources:s.MergeCoins.sources.map(r=>Wr(r,t))};if(s.MoveCall)return{kind:"MoveCall",target:`${s.MoveCall.package}::${s.MoveCall.module}::${s.MoveCall.function}`,typeArguments:s.MoveCall.typeArguments,arguments:s.MoveCall.arguments.map(r=>Wr(r,t))};if(s.Publish)return{kind:"Publish",modules:s.Publish.modules.map(r=>Array.from(qe(r))),dependencies:s.Publish.dependencies};if(s.SplitCoins)return{kind:"SplitCoins",coin:Wr(s.SplitCoins.coin,t),amounts:s.SplitCoins.amounts.map(r=>Wr(r,t))};if(s.TransferObjects)return{kind:"TransferObjects",objects:s.TransferObjects.objects.map(r=>Wr(r,t)),address:Wr(s.TransferObjects.address,t)};if(s.Upgrade)return{kind:"Upgrade",modules:s.Upgrade.modules.map(r=>Array.from(qe(r))),dependencies:s.Upgrade.dependencies,packageId:s.Upgrade.package,ticket:Wr(s.Upgrade.ticket,t)};throw new Error(`Unknown transaction ${Object.keys(s)}`)})}}function Wr(e,t){if(e.$kind==="GasCoin")return{kind:"GasCoin"};if(e.$kind==="Result")return{kind:"Result",index:e.Result};if(e.$kind==="NestedResult")return{kind:"NestedResult",index:e.NestedResult[0],resultIndex:e.NestedResult[1]};if(e.$kind==="Input")return t[e.Input];throw new Error(`Invalid argument ${Object.keys(e)}`)}function dR(e){return St(ah,{version:2,sender:e.sender??null,expiration:lR(e.expiration),gasData:{owner:e.gasConfig.owner??null,budget:e.gasConfig.budget?.toString()??null,price:e.gasConfig.price?.toString()??null,payment:e.gasConfig.payment?.map(t=>({digest:t.digest,objectId:t.objectId,version:t.version.toString()}))??null},inputs:e.inputs.map(t=>{if(t.kind==="Input"){if(Dy(LE,t.value)){const s=St(LE,t.value);if(s.Object){if(s.Object.ImmOrOwned)return{Object:{ImmOrOwnedObject:{objectId:s.Object.ImmOrOwned.objectId,version:String(s.Object.ImmOrOwned.version),digest:s.Object.ImmOrOwned.digest}}};if(s.Object.Shared)return{Object:{SharedObject:{mutable:s.Object.Shared.mutable??null,initialSharedVersion:s.Object.Shared.initialSharedVersion,objectId:s.Object.Shared.objectId}}};if(s.Object.Receiving)return{Object:{Receiving:{digest:s.Object.Receiving.digest,version:String(s.Object.Receiving.version),objectId:s.Object.Receiving.objectId}}};throw new Error("Invalid object input")}return{Pure:{bytes:st(new Uint8Array(s.Pure))}}}return t.type==="object"?{UnresolvedObject:{objectId:t.value}}:{UnresolvedPure:{value:t.value}}}throw new Error("Invalid input")}),commands:e.transactions.map(t=>{switch(t.kind){case"MakeMoveVec":return{MakeMoveVec:{type:"Some"in t.type?Lc.tagToString(t.type.Some):null,elements:t.objects.map(s=>Xr(s))}};case"MergeCoins":return{MergeCoins:{destination:Xr(t.destination),sources:t.sources.map(s=>Xr(s))}};case"MoveCall":{const[s,r,i]=t.target.split("::");return{MoveCall:{package:s,module:r,function:i,typeArguments:t.typeArguments,arguments:t.arguments.map(c=>Xr(c))}}}case"Publish":return{Publish:{modules:t.modules.map(s=>st(Uint8Array.from(s))),dependencies:t.dependencies}};case"SplitCoins":return{SplitCoins:{coin:Xr(t.coin),amounts:t.amounts.map(s=>Xr(s))}};case"TransferObjects":return{TransferObjects:{objects:t.objects.map(s=>Xr(s)),address:Xr(t.address)}};case"Upgrade":return{Upgrade:{modules:t.modules.map(s=>st(Uint8Array.from(s))),dependencies:t.dependencies,package:t.packageId,ticket:Xr(t.ticket)}}}throw new Error(`Unknown transaction ${Object.keys(t)}`)})})}function Xr(e){switch(e.kind){case"GasCoin":return{GasCoin:!0};case"Result":return{Result:e.index};case"NestedResult":return{NestedResult:[e.index,e.resultIndex]};case"Input":return{Input:e.index}}}function Ly(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const zy=e=>e?`"${e}" `:"";function rs(e,t=""){if(typeof e!="number")throw new TypeError(zy(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(zy(t)+"expected integer >= 0, got "+e);return e}function Dn(e,t,s=""){if(Ly(e)&&(t===void 0||e.length===t))return e;t!==void 0&&rs(t,"length");const r=Ly(e),i=t!==void 0?` of length ${t}`:"",c=r?`length=${e.length}`:`type=${typeof e}`,u=zy(s)+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(u):new TypeError(u)}function zE(e){return Uint8Array.from(Dn(e))}function Pv(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("expected hash wrapped by utils.createHasher");if(rs(e.outputLen),rs(e.blockLen),e.outputLen<1||e.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}const fR=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},$E=(e,t)=>{fR(e,t);const s=Object.getPrototypeOf(e);if(s!==Object.prototype&&s!==null)throw new TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw new TypeError(`"${t}.__proto__" is not allowed`)};function zc(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function Gv(e,t){Dn(e,void 0,"output");const s=t.outputLen;if(!(e.length>=s))throw new RangeError('"output" expected length >= '+s)}function Dh(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function $s(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ih(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function gr(e,t){return e<<32-t|e>>>t}const Tk=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ek(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const ea=Tk?e=>e:e=>Ek(e)>>>0;function hR(e){for(let t=0;t<e.length;t++)e[t]=Ek(e[t]);return e}const hc=Tk?e=>e:hR,Sk=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",pR=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ed(e){if(Dn(e),Sk)return e.toHex();let t="";for(let s=0;s<e.length;s++)t+=pR[e[s]];return t}function VE(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function Fv(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);if(Sk)try{return Uint8Array.fromHex(e)}catch(i){throw i instanceof SyntaxError?new RangeError(i.message):i}const t=e.length,s=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(s);for(let i=0,c=0;i<s;i++,c+=2){const u=VE(e.charCodeAt(c)),f=VE(e.charCodeAt(c+1));if(u===void 0||f===void 0){const p=e[c]+e[c+1];throw new RangeError('hex string expected, got non-hex character "'+p+'" at index '+c)}r[i]=u*16+f}return r}function mR(e){if(typeof e!="string")throw new TypeError("string expected");const t=new TextEncoder().encode(e);try{return new Uint8Array(t)}finally{$s(t)}}function PE(e,t=""){return typeof e=="string"?mR(e):Dn(e,void 0,t)}function gR(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];Dn(i),t+=i.length}const s=new Uint8Array(t);for(let r=0,i=0;r<e.length;r++){const c=e[r];s.set(c,i),i+=c.length}return s}function Hv(e,t,s="opts"){return $E(e,"defaults"),t!==void 0&&$E(t,s),Object.assign(Object.create(null),e,t)}function qv(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=Hv({},t,"info");const s=(i,c)=>e(c).update(i).digest(),r=e(void 0);return s.outputLen=r.outputLen,s.blockLen=r.blockLen,s.canXOF=r.canXOF,s.create=i=>e(i),Object.assign(s,t),Object.freeze(s)}function yR(e=32){rs(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof t?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const _k=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),vR=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),Pf=BigInt(2**32-1),GE=BigInt(32);function bR(e,t=!1){return t?{h:Number(e&Pf),l:Number(e>>GE&Pf)}:{h:Number(e>>GE&Pf)|0,l:Number(e&Pf)|0}}function wR(e,t=!1){const s=e.length;let r=new Uint32Array(s),i=new Uint32Array(s);for(let c=0;c<s;c++){const{h:u,l:f}=bR(e[c],t);[r[c],i[c]]=[u,f]}return[r,i]}const kk=e=>e/2**32|0,Ak=e=>e>>>0;function TR(e,t,s,r){const i=kk(s),c=Ak(s);e.setUint32(t,r?c:i,r),e.setUint32(t+4,r?i:c,r)}const FE=(e,t,s)=>e>>>s,HE=(e,t,s)=>e<<32-s|t>>>s,ti=(e,t,s)=>e>>>s|t<<32-s,ni=(e,t,s)=>e<<32-s|t>>>s,yu=(e,t,s)=>e<<64-s|t>>>s-32,vu=(e,t,s)=>e>>>s-32|t<<64-s,ER=(e,t)=>t,SR=(e,t)=>e;function Ws(e,t,s,r){const i=(t>>>0)+(r>>>0);return{h:e+s+(i/2**32|0)|0,l:i|0}}const Zv=(e,t,s)=>(e>>>0)+(t>>>0)+(s>>>0),Yv=(e,t,s,r)=>t+s+r+(e/2**32|0)|0,_R=(e,t,s,r)=>(e>>>0)+(t>>>0)+(s>>>0)+(r>>>0),kR=(e,t,s,r,i)=>t+s+r+i+(e/2**32|0)|0,AR=(e,t,s,r,i)=>(e>>>0)+(t>>>0)+(s>>>0)+(r>>>0)+(i>>>0),OR=(e,t,s,r,i,c)=>t+s+r+i+c+(e/2**32|0)|0;function NR(e,t,s){return e&t^~e&s}function xR(e,t,s){return e&t^e&s^t&s}class Ok{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,s,r,i){this.blockLen=t,this.outputLen=s,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=ih(this.buffer)}update(t){zc(this),Dn(t);const{view:s,buffer:r,blockLen:i}=this,c=t.length;let u=!1;for(let f=0;f<c;){const p=Math.min(i-this.pos,c-f);if(p===i){const m=ih(t);for(;i<=c-f;f+=i)this.process(m,f);u=!0;continue}r.set(f===0&&p===c?t:t.subarray(f,f+p),this.pos),this.pos+=p,f+=p,this.pos===i&&(this.process(s,0),this.pos=0,u=!0)}return this.length+=t.length,u&&this.roundClean(),this}digestInto(t){zc(this),Gv(t,this),this.finished=!0;const{buffer:s,view:r,blockLen:i,isLE:c}=this;let{pos:u}=this;s[u++]=128,s.fill(0,u),this.padOffset>i-u&&(this.process(r,0),s.fill(0)),TR(r,i-8,this.length*8,c),this.process(r,0),this.roundClean();const f=t===s?r:ih(t),p=this.outputLen,m=p/4,g=this.get();if(p%4||m>g.length)throw new Error("invalid outputLen");for(let y=0;y<m;y++)f.setUint32(4*y,g[y],c)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const r=t.slice(0,s);return this.destroy(),r}_cloneIntoMeta(t){const{buffer:s,length:r,finished:i,destroyed:c,pos:u}=this;return t.destroyed=c,t.finished=i,t.length=r,t.pos=u,u&&t.buffer.set(s),t}clone(){return this._cloneInto()}}const CR=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),IR=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),an=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Se=new Uint32Array(32);function Za(e,t,s,r,i,c){const u=i[c],f=i[c+1];let p=Se[2*e],m=Se[2*e+1],g=Se[2*t],y=Se[2*t+1],b=Se[2*s],S=Se[2*s+1],A=Se[2*r],N=Se[2*r+1];const j=Zv(p,g,u);m=Yv(j,m,y,f),p=j|0;let V=N^m,C=A^p;N=ER(V,C),A=SR(V),{h:S,l:b}=Ws(S,b,N,A),V=y^S,C=g^b,y=ti(V,C,24),g=ni(V,C,24),Se[2*e]=p,Se[2*e+1]=m,Se[2*t]=g,Se[2*t+1]=y,Se[2*s]=b,Se[2*s+1]=S,Se[2*r]=A,Se[2*r+1]=N}function Ya(e,t,s,r,i,c){const u=i[c],f=i[c+1];let p=Se[2*e],m=Se[2*e+1],g=Se[2*t],y=Se[2*t+1],b=Se[2*s],S=Se[2*s+1],A=Se[2*r],N=Se[2*r+1];const j=Zv(p,g,u);m=Yv(j,m,y,f),p=j|0;let V=N^m,C=A^p;N=ti(V,C,16),A=ni(V,C,16),{h:S,l:b}=Ws(S,b,N,A),V=y^S,C=g^b,y=yu(V,C,63),g=vu(V,C,63),Se[2*e]=p,Se[2*e+1]=m,Se[2*t]=g,Se[2*t+1]=y,Se[2*s]=b,Se[2*s+1]=S,Se[2*r]=A,Se[2*r+1]=N}function RR(e,t={},s,r,i){if(rs(s),e<=0||e>s)throw new Error('"dkLen" must be 1..'+s+", got "+e);const{key:c,salt:u,personalization:f}=t;if(c!==void 0&&(c.length<1||c.length>s))throw new Error('"key" expected to be undefined or of length=1..'+s);u!==void 0&&Dn(u,r,"salt"),f!==void 0&&Dn(f,i,"personalization")}class jR{buffer;buffer32;finished=!1;destroyed=!1;length=0;pos=0;blockLen;outputLen;canXOF=!1;constructor(t,s){rs(t),rs(s),this.blockLen=t,this.outputLen=s,this.buffer=new Uint8Array(t),this.buffer32=Dh(this.buffer)}update(t){zc(this),Dn(t);const{blockLen:s,buffer:r,buffer32:i}=this,c=t.length,u=t.byteOffset,f=t.buffer;for(let p=0;p<c;){this.pos===s&&(hc(i),this.compress(i,0,!1),hc(i),this.pos=0);const m=Math.min(s-this.pos,c-p),g=u+p;if(m===s&&!(g%4)&&p+m<c){const y=new Uint32Array(f,g,Math.floor((c-p)/4));hc(y);for(let b=0;p+s<c;b+=i.length,p+=s)this.length+=s,this.compress(y,b,!1);hc(y);continue}r.set(p===0&&m===c?t:t.subarray(p,p+m),this.pos),this.pos+=m,this.length+=m,p+=m}return this}digestInto(t){if(zc(this),Gv(t,this),t.byteOffset&3)throw new RangeError('"output" expected 4-byte aligned byteOffset, got '+t.byteOffset);const{pos:s,buffer32:r}=this;this.finished=!0,this.buffer.fill(0,s),hc(r),this.compress(r,0,!0),hc(r);const i=this.get(),c=t===this.buffer?r:Dh(t),u=Math.floor(this.outputLen/4);for(let g=0;g<u;g++)c[g]=ea(i[g]);const f=this.outputLen%4;if(!f)return;const p=u*4,m=i[u];for(let g=0;g<f;g++)t[p+g]=m>>>8*g}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const r=t.slice(0,s);return this.destroy(),r}_cloneInto(t){const{buffer:s,length:r,finished:i,destroyed:c,outputLen:u,pos:f}=this;return t||=new this.constructor({dkLen:u}),t.set(...this.get()),t.buffer.set(s),t.destroyed=c,t.finished=i,t.length=r,t.pos=f,t.outputLen=u,t}clone(){return this._cloneInto()}}class MR extends jR{v0l=an[0]|0;v0h=an[1]|0;v1l=an[2]|0;v1h=an[3]|0;v2l=an[4]|0;v2h=an[5]|0;v3l=an[6]|0;v3h=an[7]|0;v4l=an[8]|0;v4h=an[9]|0;v5l=an[10]|0;v5h=an[11]|0;v6l=an[12]|0;v6h=an[13]|0;v7l=an[14]|0;v7h=an[15]|0;constructor(t={}){t=Hv({},t);const s=t.dkLen===void 0?64:t.dkLen;super(128,s),RR(s,t,64,16,16);let{key:r,personalization:i,salt:c}=t,u=0;if(r!==void 0&&(Dn(r,void 0,"key"),u=r.length),this.v0l^=this.outputLen|u<<8|65536|1<<24,c!==void 0){Dn(c,void 0,"salt");const f=Dh(zE(c));this.v4l^=ea(f[0]),this.v4h^=ea(f[1]),this.v5l^=ea(f[2]),this.v5h^=ea(f[3])}if(i!==void 0){Dn(i,void 0,"personalization");const f=Dh(zE(i));this.v6l^=ea(f[0]),this.v6h^=ea(f[1]),this.v7l^=ea(f[2]),this.v7h^=ea(f[3])}if(r!==void 0){const f=new Uint8Array(this.blockLen);f.set(r),this.update(f),$s(f)}}get(){let{v0l:t,v0h:s,v1l:r,v1h:i,v2l:c,v2h:u,v3l:f,v3h:p,v4l:m,v4h:g,v5l:y,v5h:b,v6l:S,v6h:A,v7l:N,v7h:j}=this;return[t,s,r,i,c,u,f,p,m,g,y,b,S,A,N,j]}set(t,s,r,i,c,u,f,p,m,g,y,b,S,A,N,j){this.v0l=t|0,this.v0h=s|0,this.v1l=r|0,this.v1h=i|0,this.v2l=c|0,this.v2h=u|0,this.v3l=f|0,this.v3h=p|0,this.v4l=m|0,this.v4h=g|0,this.v5l=y|0,this.v5h=b|0,this.v6l=S|0,this.v6h=A|0,this.v7l=N|0,this.v7h=j|0}compress(t,s,r){const{v0l:i,v0h:c,v1l:u,v1h:f,v2l:p,v2h:m,v3l:g,v3h:y,v4l:b,v4h:S,v5l:A,v5h:N,v6l:j,v6h:V,v7l:C,v7h:W}=this;Se[0]=i,Se[1]=c,Se[2]=u,Se[3]=f,Se[4]=p,Se[5]=m,Se[6]=g,Se[7]=y,Se[8]=b,Se[9]=S,Se[10]=A,Se[11]=N,Se[12]=j,Se[13]=V,Se[14]=C,Se[15]=W,Se.set(an,16);const ce=Ak(this.length),ae=kk(this.length);Se[24]=an[8]^ce,Se[25]=an[9]^ae,r&&(Se[28]=~Se[28],Se[29]=~Se[29]);let Y=0;const K=vR;for(let w=0;w<12;w++)Za(0,4,8,12,t,s+2*K[Y++]),Ya(0,4,8,12,t,s+2*K[Y++]),Za(1,5,9,13,t,s+2*K[Y++]),Ya(1,5,9,13,t,s+2*K[Y++]),Za(2,6,10,14,t,s+2*K[Y++]),Ya(2,6,10,14,t,s+2*K[Y++]),Za(3,7,11,15,t,s+2*K[Y++]),Ya(3,7,11,15,t,s+2*K[Y++]),Za(0,5,10,15,t,s+2*K[Y++]),Ya(0,5,10,15,t,s+2*K[Y++]),Za(1,6,11,12,t,s+2*K[Y++]),Ya(1,6,11,12,t,s+2*K[Y++]),Za(2,7,8,13,t,s+2*K[Y++]),Ya(2,7,8,13,t,s+2*K[Y++]),Za(3,4,9,14,t,s+2*K[Y++]),Ya(3,4,9,14,t,s+2*K[Y++]);this.v0l^=Se[0]^Se[16],this.v0h^=Se[1]^Se[17],this.v1l^=Se[2]^Se[18],this.v1h^=Se[3]^Se[19],this.v2l^=Se[4]^Se[20],this.v2h^=Se[5]^Se[21],this.v3l^=Se[6]^Se[22],this.v3h^=Se[7]^Se[23],this.v4l^=Se[8]^Se[24],this.v4h^=Se[9]^Se[25],this.v5l^=Se[10]^Se[26],this.v5h^=Se[11]^Se[27],this.v6l^=Se[12]^Se[28],this.v6h^=Se[13]^Se[29],this.v7l^=Se[14]^Se[30],this.v7h^=Se[15]^Se[31],$s(Se)}destroy(){this.destroyed=!0,$s(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const $c=qv(e=>new MR(e));function DR(e,t){const s=Array.from(`${e}::`).map(i=>i.charCodeAt(0)),r=new Uint8Array(s.length+t.length);return r.set(s),r.set(t,s.length),$c(r,{dkLen:32})}function qE(e){return ye(e).replace("0x","")}var Xi=class Yi{static fromKindBytes(t){const s=F.TransactionKind.parse(t).ProgrammableTransaction;if(!s)throw new Error("Unable to deserialize from bytes.");return Yi.restore({version:2,sender:null,expiration:null,gasData:{budget:null,owner:null,payment:null,price:null},inputs:s.inputs,commands:s.commands})}static fromBytes(t){const s=F.TransactionData.parse(t)?.V1,r=s.kind.ProgrammableTransaction;if(!s||!r)throw new Error("Unable to deserialize from bytes.");return Yi.restore({version:2,sender:s.sender,expiration:s.expiration,gasData:s.gasData,inputs:r.inputs,commands:r.commands})}static restore(t){return t.version===2?new Yi(St(ah,t)):new Yi(St(ah,dR(t)))}static getDigestFromBytes(t){return Ju(DR("TransactionData",t))}constructor(t){this.version=2,this.sender=t?.sender??null,this.expiration=t?.expiration??null,this.inputs=t?.inputs??[],this.commands=t?.commands??[],this.gasData=t?.gasData??{budget:null,price:null,owner:null,payment:null}}build({maxSizeBytes:t=1/0,overrides:s,onlyTransactionKind:r}={}){const i=this.inputs,c=this.commands,u={ProgrammableTransaction:{inputs:i,commands:c}};if(r)return F.TransactionKind.serialize(u,{maxSize:t}).toBytes();const f=s?.expiration??this.expiration,p=s?.sender??this.sender,m={...this.gasData,...s?.gasData};if(!p)throw new Error("Missing transaction sender");if(!m.budget)throw new Error("Missing gas budget");if(!m.payment)throw new Error("Missing gas payment");if(!m.price)throw new Error("Missing gas price");const g={sender:qE(p),expiration:f||{None:!0},gasData:{payment:m.payment,owner:qE(this.gasData.owner??p),price:BigInt(m.price),budget:BigInt(m.budget)},kind:{ProgrammableTransaction:{inputs:i,commands:c}}};return F.TransactionData.serialize({V1:g},{maxSize:t}).toBytes()}addInput(t,s){const r=this.inputs.length;return this.inputs.push(s),{Input:r,type:t,$kind:"Input"}}getInputUses(t,s){this.mapArguments((r,i)=>(r.$kind==="Input"&&r.Input===t&&s(r,i),r))}mapCommandArguments(t,s){const r=this.commands[t];switch(r.$kind){case"MoveCall":r.MoveCall.arguments=r.MoveCall.arguments.map(c=>s(c,r,t));break;case"TransferObjects":r.TransferObjects.objects=r.TransferObjects.objects.map(c=>s(c,r,t)),r.TransferObjects.address=s(r.TransferObjects.address,r,t);break;case"SplitCoins":r.SplitCoins.coin=s(r.SplitCoins.coin,r,t),r.SplitCoins.amounts=r.SplitCoins.amounts.map(c=>s(c,r,t));break;case"MergeCoins":r.MergeCoins.destination=s(r.MergeCoins.destination,r,t),r.MergeCoins.sources=r.MergeCoins.sources.map(c=>s(c,r,t));break;case"MakeMoveVec":r.MakeMoveVec.elements=r.MakeMoveVec.elements.map(c=>s(c,r,t));break;case"Upgrade":r.Upgrade.ticket=s(r.Upgrade.ticket,r,t);break;case"$Intent":const i=r.$Intent.inputs;r.$Intent.inputs={};for(const[c,u]of Object.entries(i))r.$Intent.inputs[c]=Array.isArray(u)?u.map(f=>s(f,r,t)):s(u,r,t);break;case"Publish":break;default:throw new Error(`Unexpected transaction kind: ${r.$kind}`)}}mapArguments(t){for(const s of this.commands.keys())this.mapCommandArguments(s,t)}replaceCommand(t,s,r=t){if(!Array.isArray(s)){this.commands[t]=s;return}const i=s.length-1;this.commands.splice(t,1,...structuredClone(s)),this.mapArguments((c,u,f)=>{if(f<t+s.length)return c;if(typeof r!="number"&&(c.$kind==="Result"&&c.Result===t||c.$kind==="NestedResult"&&c.NestedResult[0]===t)){if(!("NestedResult"in c)||c.NestedResult[1]===0)return St(Dt,structuredClone(r));throw new Error(`Cannot replace command ${t} with a specific result type: NestedResult[${t}, ${c.NestedResult[1]}] references a nested element that cannot be mapped to the replacement result`)}switch(c.$kind){case"Result":c.Result===t&&typeof r=="number"&&(c.Result=r),c.Result>t&&(c.Result+=i);break;case"NestedResult":if(c.NestedResult[0]===t&&typeof r=="number")return{$kind:"NestedResult",NestedResult:[r,c.NestedResult[1]]};c.NestedResult[0]>t&&(c.NestedResult[0]+=i);break}return c})}replaceCommandWithTransaction(t,s,r){if(r.$kind!=="Result"&&r.$kind!=="NestedResult")throw new Error("Result must be of kind Result or NestedResult");this.insertTransaction(t,s),this.replaceCommand(t+s.commands.length,[],"Result"in r?{NestedResult:[r.Result+t,0]}:{NestedResult:[r.NestedResult[0]+t,r.NestedResult[1]]})}insertTransaction(t,s){const r=new Map,i=new Map;for(let f=0;f<s.inputs.length;f++){const p=s.inputs[f],m=Mh(p);let g=-1;if(m!==void 0&&(g=this.inputs.findIndex(y=>Mh(y)===m),g!==-1&&this.inputs[g].Object?.SharedObject&&p.Object?.SharedObject&&(this.inputs[g].Object.SharedObject.mutable=this.inputs[g].Object.SharedObject.mutable||p.Object.SharedObject.mutable)),g!==-1)r.set(f,g);else{const y=this.inputs.length;this.inputs.push(p),r.set(f,y)}}for(let f=0;f<s.commands.length;f++)i.set(f,t+f);const c=[];for(let f=0;f<s.commands.length;f++){const p=structuredClone(s.commands[f]);iR(p,r,i),c.push(p)}this.commands.splice(t,0,...c);const u=c.length;u>0&&this.mapArguments((f,p,m)=>{if(m>=t&&m<t+c.length)return f;switch(f.$kind){case"Result":f.Result>=t&&(f.Result+=u);break;case"NestedResult":f.NestedResult[0]>=t&&(f.NestedResult[0]+=u);break}return f})}getDigest(){const t=this.build({onlyTransactionKind:!1});return Yi.getDigestFromBytes(t)}snapshot(){return St(ah,this)}getData(){return this.snapshot()}shallowClone(){return new Yi({version:this.version,sender:this.sender,expiration:this.expiration,gasData:{...this.gasData},inputs:[...this.inputs],commands:[...this.commands]})}applyResolvedData(t){this.sender||(this.sender=t.sender??null),this.expiration||(this.expiration=t.expiration??null),this.gasData.budget||(this.gasData.budget=t.gasData.budget),this.gasData.owner||(this.gasData.owner=t.gasData.owner??null),this.gasData.payment||(this.gasData.payment=t.gasData.payment),this.gasData.price||(this.gasData.price=t.gasData.price);for(let s=0;s<this.inputs.length;s++){const r=this.inputs[s],i=t.inputs[s];switch(r.$kind){case"UnresolvedPure":if(i.$kind!=="Pure")throw new Error(`Expected input at index ${s} to resolve to a Pure argument, but got ${JSON.stringify(i)}`);this.inputs[s]=i;break;case"UnresolvedObject":if(i.$kind!=="Object")throw new Error(`Expected input at index ${s} to resolve to an Object argument, but got ${JSON.stringify(i)}`);if(i.Object.$kind==="ImmOrOwnedObject"||i.Object.$kind==="Receiving"){const c=r.UnresolvedObject,u=i.Object.ImmOrOwnedObject??i.Object.Receiving;if(ye(c.objectId)!==ye(u.objectId)||c.version!=null&&c.version!==u.version||c.digest!=null&&c.digest!==u.digest||c.mutable!=null||c.initialSharedVersion!=null)throw new Error(`Input at index ${s} did not match unresolved object. ${JSON.stringify(c)} is not compatible with ${JSON.stringify(u)}`)}else if(i.Object.$kind==="SharedObject"){const c=r.UnresolvedObject,u=i.Object.SharedObject;if(ye(c.objectId)!==ye(u.objectId)||c.initialSharedVersion!=null&&c.initialSharedVersion!==u.initialSharedVersion||c.mutable!=null&&c.mutable!==u.mutable||c.version!=null||c.digest!=null)throw new Error(`Input at index ${s} did not match unresolved object. ${JSON.stringify(c)} is not compatible with ${JSON.stringify(u)}`)}else throw new Error(`Input at index ${s} resolved to an unexpected Object kind: ${JSON.stringify(i.Object)}`);this.inputs[s]=i;break}}}};const Wt={MoveCall(e){const[t,s="",r=""]="target"in e?e.target.split("::"):[e.package,e.module,e.function];return{$kind:"MoveCall",MoveCall:{package:t,module:s,function:r,typeArguments:e.typeArguments??[],arguments:e.arguments??[]}}},TransferObjects(e,t){return{$kind:"TransferObjects",TransferObjects:{objects:e.map(s=>St(Dt,s)),address:St(Dt,t)}}},SplitCoins(e,t){return{$kind:"SplitCoins",SplitCoins:{coin:St(Dt,e),amounts:t.map(s=>St(Dt,s))}}},MergeCoins(e,t){return{$kind:"MergeCoins",MergeCoins:{destination:St(Dt,e),sources:t.map(s=>St(Dt,s))}}},Publish({modules:e,dependencies:t}){return{$kind:"Publish",Publish:{modules:e.map(s=>typeof s=="string"?s:st(new Uint8Array(s))),dependencies:t.map(s=>jy(s))}}},Upgrade({modules:e,dependencies:t,package:s,ticket:r}){return{$kind:"Upgrade",Upgrade:{modules:e.map(i=>typeof i=="string"?i:st(new Uint8Array(i))),dependencies:t.map(i=>jy(i)),package:s,ticket:St(Dt,r)}}},MakeMoveVec({type:e,elements:t}){return{$kind:"MakeMoveVec",MakeMoveVec:{type:e??null,elements:t.map(s=>St(Dt,s))}}},Intent({name:e,inputs:t={},data:s={}}){return{$kind:"$Intent",$Intent:{name:e,inputs:Object.fromEntries(Object.entries(t).map(([r,i])=>[r,Array.isArray(i)?i.map(c=>St(Dt,c)):St(Dt,i)])),data:s}}}};function UR(e){return{$kind:"Pure",Pure:{bytes:e instanceof Uint8Array?st(e):e.toBase64()}}}const cn={Pure:UR,ObjectRef({objectId:e,digest:t,version:s}){return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{digest:t,version:s,objectId:ye(e)}}}},SharedObjectRef({objectId:e,mutable:t,initialSharedVersion:s}){return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{mutable:t,initialSharedVersion:s,objectId:ye(e)}}}},ReceivingRef({objectId:e,digest:t,version:s}){return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{digest:t,version:s,objectId:ye(e)}}}},FundsWithdrawal({reservation:e,typeArg:t,withdrawFrom:s}){return{$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:e,typeArg:t,withdrawFrom:s}}}};BigInt(1e9);const Nk="0x0000000000000000000000000000000000000000000000000000000000000001",Wv="0x0000000000000000000000000000000000000000000000000000000000000002",oh="0x0000000000000000000000000000000000000000000000000000000000000006",Uh=`${Wv}::sui::SUI`,ZE="0x0000000000000000000000000000000000000000000000000000000000000005",BR="0x0000000000000000000000000000000000000000000000000000000000000008",LR="0x0000000000000000000000000000000000000000000000000000000000000403";function xk(e){const t=e.split("::");if(t.length!==3)throw new Error(`Invalid type name format: ${e}`);return{package:t[0],module:t[1],name:t[2]}}function zR(e){if(e.body.$kind!=="datatype")return!1;const{package:t,module:s,name:r}=xk(e.body.datatype.typeName);return ye(t)===Wv&&s==="tx_context"&&r==="TxContext"}function $y(e){switch(e.$kind){case"address":return F.Address;case"bool":return F.Bool;case"u8":return F.U8;case"u16":return F.U16;case"u32":return F.U32;case"u64":return F.U64;case"u128":return F.U128;case"u256":return F.U256;case"vector":{if(e.vector.$kind==="u8")return F.byteVector().transform({input:s=>typeof s=="string"?new TextEncoder().encode(s):s,output:s=>s});const t=$y(e.vector);return t?F.vector(t):null}case"datatype":{const{package:t,module:s,name:r}=xk(e.datatype.typeName),i=ye(t);if(i===Nk){if(s==="ascii"&&r==="String"||s==="string"&&r==="String")return F.String;if(s==="option"&&r==="Option"){const c=$y(e.datatype.typeParameters[0]);return c?F.vector(c):null}}return i===Wv&&s==="object"&&r==="ID"?F.Address:null}case"typeParameter":case"unknown":return null}}const hi="AllowanceBalance",fa="CoinWithBalance",$R=e=>{const t=e.split(/::|<|>|,/);for(const s of t)if(s.includes(E4)&&!Xu(s))return!1;return D4(e)},VR="2.33.1",PR="/",GR={"Mvr-Source":`@mysten/sui@${VR}`};var FR=class{#e;#t;#r;#s;constructor({cache:e,url:t,pageSize:s=50,overrides:r}){this.#e=e,this.#t=t,this.#r=s,this.#s={packages:r?.packages,types:r?.types},HR(this.#s)}get#a(){return this.#e.readSync(["#mvrPackageDataLoader",this.#t??""],()=>{const e=new IE(async s=>{if(!this.#t)throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const r=await this.#o(s);return s.map(i=>r[i]??new Error(`Failed to resolve package: ${i}`))}),t=this.#s?.packages;if(t)for(const[s,r]of Object.entries(t))e.prime(s,r);return e})}get#i(){return this.#e.readSync(["#mvrTypeDataLoader",this.#t??""],()=>{const e=new IE(async s=>{if(!this.#t)throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const r=await this.#c(s);return s.map(i=>r[i]??new Error(`Failed to resolve type: ${i}`))}),t=this.#s?.types;if(t)for(const[s,r]of Object.entries(t))e.prime(s,r);return e})}async#o(e){if(e.length===0)return{};const t=Rh(e,this.#r),s={};return await Promise.all(t.map(async r=>{const i=await this.#n("/v1/resolution/bulk",{names:r});if(i?.resolution)for(const c of Object.keys(i?.resolution)){const u=i.resolution[c]?.package_id;u&&(s[c]=u)}})),s}async#c(e){if(e.length===0)return{};const t=Rh(e,this.#r),s={};return await Promise.all(t.map(async r=>{const i=await this.#n("/v1/struct-definition/bulk",{types:r});if(i?.resolution)for(const c of Object.keys(i?.resolution)){const u=i.resolution[c]?.type_tag;u&&(s[c]=u)}})),s}async#n(e,t){if(!this.#t)throw new Error("MVR Api URL is not set for the current client");const s=await fetch(`${this.#t}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...GR},body:JSON.stringify(t)});if(!s.ok){const r=await s.json().catch(()=>({}));throw new Error(`Failed to resolve types: ${r?.message}`)}return s.json()}async resolvePackage({package:e,signal:t}){return t?.throwIfAborted(),ys(e)?{package:await ch(this.#a.load(e),t)}:{package:e}}async resolveType({type:e,signal:t}){if(t?.throwIfAborted(),!ys(e))return{type:e};const s=[...Bh(e)],r=await ch(this.#i.loadMany(s),t),i={};for(let c=0;c<s.length;c++){const u=r[c];if(u instanceof Error)throw u;i[s[c]]=u}return{type:Lh(e,i)}}async resolve({types:e=[],packages:t=[],signal:s}){s?.throwIfAborted();const r=new Set;for(const g of e??[])Bh(g,r);const i=[...r],[c,u]=await ch(Promise.all([i.length>0?this.#i.loadMany(i):[],t.length>0?this.#a.loadMany(t):[]]),s),f={...this.#s?.types};for(const[g,y]of i.entries()){const b=c[g];if(b instanceof Error)throw b;f[y]=b}const p={};for(const g of e??[])p[g]={type:Lh(g,f)};const m={};for(const[g,y]of(t??[]).entries()){const b=this.#s?.packages?.[y]??u[g];if(b instanceof Error)throw b;m[y]={package:b}}return{types:p,packages:m}}};function HR(e){if(e?.packages)for(const[t,s]of Object.entries(e.packages)){if(!Xu(t))throw new Error(`Invalid package name: ${t}`);if(!da(ye(s)))throw new Error(`Invalid package ID: ${s}`)}if(e?.types)for(const[t,s]of Object.entries(e.types)){if(ws(t).typeParams.length>0)throw new Error("Type overrides must be first-level only. If you want to supply generic types, just pass each type individually.");if(!da(ws(s).address))throw new Error(`Invalid type: ${s}`)}}function Bh(e,t=new Set){if(typeof e=="string"&&!ys(e))return t;if(typeof e=="string"&&e.startsWith("vector<")&&e.endsWith(">"))return Bh(e.slice(7,-1),t);const s=Ck(e)?e:ws(e);ys(s.address)&&t.add(`${s.address}::${s.module}::${s.name}`);for(const r of s.typeParams)Bh(r,t);return t}function Lh(e,t){if(typeof e=="string"&&!e.includes("::"))return e;if(typeof e=="string"&&e.startsWith("vector<")&&e.endsWith(">"))return`vector<${Lh(e.slice(7,-1),t)}>`;const s=Ck(e)?e:ws(e),r=t[`${s.address}::${s.module}::${s.name}`];return De({...s,address:r?r.split("::")[0]:s.address,typeParams:s.typeParams.map(i=>Lh(i,t))})}function ys(e){return e.includes(PR)||e.includes("@")||e.includes(".sui")}function ch(e,t){return t?t.aborted?Promise.reject(t.reason):new Promise((s,r)=>{const i=()=>r(t.reason);t.addEventListener("abort",i,{once:!0}),e.then(s,r).finally(()=>{t.removeEventListener("abort",i)})}):e}function Ck(e){return typeof e=="object"&&"address"in e&&"module"in e&&"name"in e&&"typeParams"in e}function qR(e){const t=new Set,s=new Set;for(const r of e.commands)switch(r.$kind){case"MakeMoveVec":r.MakeMoveVec.type&&YE([r.MakeMoveVec.type]).forEach(u=>{s.add(u)});break;case"MoveCall":const i=r.MoveCall,c=i.package.split("::")[0];if(ys(c)){if(!Xu(c))throw new Error(`Invalid package name: ${c}`);t.add(c)}YE(i.typeArguments??[]).forEach(u=>{s.add(u)});break}return{packages:[...t],types:[...s]}}function ZR(e,t){for(const s of e.commands){if(s.MakeMoveVec?.type){if(!ys(s.MakeMoveVec.type))continue;if(!t.types[s.MakeMoveVec.type])throw new Error(`No resolution found for type: ${s.MakeMoveVec.type}`);s.MakeMoveVec.type=t.types[s.MakeMoveVec.type].type}const r=s.MoveCall;if(!r)continue;const i=r.package.split("::"),c=i[0];if(ys(c)&&!t.packages[c])throw new Error(`No address found for package: ${c}`);ys(c)&&(i[0]=t.packages[c].package,r.package=i.join("::"));const u=r.typeArguments;if(u){for(let f=0;f<u.length;f++)if(ys(u[f])){if(!t.types[u[f]])throw new Error(`No resolution found for type: ${u[f]}`);u[f]=t.types[u[f]].type}r.typeArguments=u}}}function YE(e){const t=new Set;for(const s of e)if(ys(s)){if(!$R(s))throw new Error(`Invalid type with names: ${s}`);t.add(s)}return t}function Ik(e){let t=!1;return e.mapArguments(s=>(s.$kind==="GasCoin"&&(t=!0),s)),t}var Xv=class extends Error{},Vy=class extends Xv{constructor(e,t){super(e,{cause:t?.cause}),this.executionError=t?.executionError}},lh=class extends Xv{constructor(e,t,s){super(t,{cause:s?.cause}),this.code=e,this.reason=s?.reason??"unknown",this.objectId=s?.objectId}};const YR={notFound:e=>`Transaction ${e} not found`};var WE=class extends Xv{constructor(e,t,s){super(YR[e](t),s),this.reason=e,this.digest=t}};function Rk(e,t,s){const r=F.Address.serialize(e).toBytes(),i=F.TypeTag.serialize(t).toBytes(),c=F.u64().serialize(s.length).toBytes(),u=$c.create({dkLen:32});return u.update(new Uint8Array([240])),u.update(r),u.update(c),u.update(s),u.update(i),`0x${kr(u.digest().slice(0,32))}`}const WR=ye("0xacc"),XR=Lc.parseFromStr("0x2::accumulator::Key<0x2::balance::Balance<0x2::sui::SUI>>"),JR=new Uint8Array([172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172]);function KR(e,t){const s=Ku(Rk(WR,XR,F.Address.serialize(e).toBytes()).slice(2)),r=Ih(t);if(r.length!==32)throw new Error(`Invalid chain identifier length: expected 32 bytes, got ${r.length}`);const i=new Uint8Array(32);for(let c=0;c<32;c++)i[c]=s[c]^r[c];return`0x${kr(i)}`}function QR(e,t,s,r){const i=new Uint8Array(32),c=new DataView(i.buffer);c.setBigUint64(0,e,!0);const u=Number(r);if(!Number.isSafeInteger(u)||u<0||u>4294967295)throw new Error(`Epoch ${r} out of u32 range for coin reservation digest`);return c.setUint32(8,u,!0),i.set(JR,12),St(fi,{objectId:KR(t,s),version:"0",digest:Ju(i)})}const e5=50,XE=256,t5=1000n,n5=5e10;function s5(e,t=1n){const s=t5*BigInt(t),r=BigInt(e.computationCost)+s,i=r+BigInt(e.storageCost)-BigInt(e.storageRebate);return String(i>r?i:r)}function r5(e){if(!e.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return e.client}async function a5(e,t,s){const r=r5(t),i=!t.onlyTransactionKind&&!e.gasData.price,c=!t.onlyTransactionKind&&!e.gasData.payment,u=e.gasData.owner??e.sender,f=Ik(e);let p=0n;const m=u?ye(u):null;for(const V of e.inputs){if(V.$kind!=="FundsWithdrawal"||!m||De(V.FundsWithdrawal.typeArg.Balance)!==Uh)continue;const C=V.FundsWithdrawal.withdrawFrom,W=C.SenderAllowance?C.SenderAllowance.funder:C.Sender?e.sender:u;W&&ye(W)===m&&V.FundsWithdrawal.reservation.$kind==="MaxAmountU64"&&(p+=BigInt(V.FundsWithdrawal.reservation.MaxAmountU64))}const g=!t.onlyTransactionKind&&!e.expiration&&!e.gasData.budget,y=i||c&&f||g,b=c&&f||g,[,S,A,N,j]=await Promise.all([u5(e,r),y?r.core.getCurrentSystemState():null,c&&u?r.core.getBalance({owner:u}):null,c&&u?r.core.listCoins({owner:u,coinType:Uh}):null,b?r.core.getChainIdentifier():null]);if(await l5(e,r),!t.onlyTransactionKind){const V=S?.systemState??null,C=j?.chainIdentifier??null;if(V&&!e.gasData.price&&(e.gasData.price=V.referenceGasPrice),await i5(e,r,g&&V&&C?jk(V,C):void 0),c){if(!A||!N)throw new Error("Could not resolve gas payment: a gas owner or sender must be set to fetch balance and coins.");o5({transactionData:e,balance:A,coins:N,usesGasCoin:f,withdrawals:p,gasPayer:u,chainIdentifier:C,epoch:V?.epoch??null})}!e.expiration&&e.gasData.payment?.length===0&&await c5(e,r,V,C)}return await s()}async function i5(e,t,s){if(e.gasData.budget)return;const r=await t.core.simulateTransaction({transaction:e.build({overrides:{gasData:{budget:String(n5),payment:[]},...s&&{expiration:s}}}),include:{effects:!0},doGasSelection:!1});if(r.$kind==="FailedTransaction"){const i=r.FailedTransaction.status.error??void 0;throw new Vy(`Transaction resolution failed: ${i?.message??"Unknown error"}`,{cause:r,executionError:i})}e.gasData.budget=s5(r.Transaction.effects.gasUsed,e.gasData.price?String(e.gasData.price):void 0)}function o5({transactionData:e,balance:t,coins:s,usesGasCoin:r,withdrawals:i,gasPayer:c,chainIdentifier:u,epoch:f}){const p=BigInt(e.gasData.budget),m=BigInt(t.balance.addressBalance);if(p===0n||!r&&m>=p+i){e.gasData.payment=[];return}const g=s.objects.filter(S=>!e.inputs.find(A=>A.Object?.ImmOrOwnedObject?S.objectId===A.Object.ImmOrOwnedObject.objectId:!1)),y=g.map(S=>({objectId:S.objectId,digest:S.digest,version:S.version})),b=m-i;if(r&&b>0n&&u&&f)e.gasData.payment=[QR(b,c,u,f),...y.slice(0,XE-1)];else if(g.length)e.gasData.payment=y.slice(0,XE);else throw new Error("No valid gas coins found for the transaction.")}async function c5(e,t,s,r=null){const[i,c]=await Promise.all([r??t.core.getChainIdentifier().then(u=>u.chainIdentifier),s??t.core.getCurrentSystemState().then(u=>u.systemState)]);e.expiration=jk(c,i)}function jk(e,t){const s=BigInt(e.epoch);return{$kind:"ValidDuring",ValidDuring:{minEpoch:String(s),maxEpoch:String(s+1n),minTimestamp:null,maxTimestamp:null,chain:t,nonce:Math.random()*4294967296>>>0}}}async function l5(e,t){const s=e.inputs.filter(g=>g.UnresolvedObject&&!(g.UnresolvedObject.version||g.UnresolvedObject?.initialSharedVersion)),r=[...new Set(s.map(g=>jy(g.UnresolvedObject.objectId)))],i=r.length?Rh(r,e5):[],c=(await Promise.all(i.map(g=>t.core.getObjects({objectIds:g})))).flatMap(g=>g.objects),u=new Map(r.map((g,y)=>[g,c[y]])),f=Array.from(u).filter(([g,y])=>y instanceof Error).map(([g,y])=>y.message);if(f.length)throw new Error(`The following input objects are invalid: ${f.join(", ")}`);const p=c.map(g=>{if(g instanceof Error)throw new Error(`Failed to fetch object: ${g.message}`);const y=g.owner,b=y&&typeof y=="object"?y.$kind==="Shared"?y.Shared.initialSharedVersion:y.$kind==="ConsensusAddressOwner"?y.ConsensusAddressOwner.startVersion:null:null;return{objectId:g.objectId,digest:g.digest,version:g.version,initialSharedVersion:b}}),m=new Map(r.map((g,y)=>[g,p[y]]));for(const[g,y]of e.inputs.entries()){if(!y.UnresolvedObject)continue;let b;const S=ye(y.UnresolvedObject.objectId),A=m.get(S);y.UnresolvedObject.initialSharedVersion??A?.initialSharedVersion?b=cn.SharedObjectRef({objectId:S,initialSharedVersion:y.UnresolvedObject.initialSharedVersion||A?.initialSharedVersion,mutable:y.UnresolvedObject.mutable||d5(e,g)}):f5(e,g)&&(b=cn.ReceivingRef({objectId:S,digest:y.UnresolvedObject.digest??A?.digest,version:y.UnresolvedObject.version??A?.version})),e.inputs[e.inputs.indexOf(y)]=b??cn.ObjectRef({objectId:S,digest:y.UnresolvedObject.digest??A?.digest,version:y.UnresolvedObject.version??A?.version})}}async function u5(e,t){const{inputs:s,commands:r}=e,i=[],c=new Set;r.forEach(f=>{if(f.MoveCall){if(f.MoveCall._argumentTypes)return;if(f.MoveCall.arguments.map(p=>p.$kind==="Input"?e.inputs[p.Input]:null).some(p=>p?.UnresolvedPure||p?.UnresolvedObject&&typeof p?.UnresolvedObject.mutable!="boolean")){const p=`${f.MoveCall.package}::${f.MoveCall.module}::${f.MoveCall.function}`;c.add(p),i.push(f.MoveCall)}}});const u=new Map;c.size>0&&await Promise.all([...c].map(async f=>{const[p,m,g]=f.split("::"),{function:y}=await t.core.getMoveFunction({packageId:p,moduleName:m,name:g});u.set(f,y.parameters)})),i.length&&await Promise.all(i.map(async f=>{const p=u.get(`${f.package}::${f.module}::${f.function}`);p&&(f._argumentTypes=p.length>0&&zR(p.at(-1))?p.slice(0,p.length-1):p)})),r.forEach(f=>{if(!f.MoveCall)return;const p=f.MoveCall,m=`${p.package}::${p.module}::${p.function}`,g=p._argumentTypes;if(g){if(g.length!==f.MoveCall.arguments.length)throw new Error(`Incorrect number of arguments for ${m}`);g.forEach((y,b)=>{const S=p.arguments[b];if(S.$kind!=="Input")return;const A=s[S.Input];if(!A.UnresolvedPure&&!A.UnresolvedObject)return;const N=A.UnresolvedPure?.value??A.UnresolvedObject?.objectId,j=$y(y.body);if(j){S.type="pure",s[s.indexOf(A)]=cn.Pure(j.serialize(N));return}if(typeof N!="string")throw new Error(`Expect the argument to be an object id string, got ${JSON.stringify(N,null,2)}`);S.type="object";const V=A.UnresolvedPure?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:N}}:A;s[S.Input]=V})}})}function d5(e,t){let s=!1;return e.getInputUses(t,(r,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const c=i.MoveCall.arguments.indexOf(r);s=i.MoveCall._argumentTypes[c].reference!=="immutable"||s}(i.$kind==="MakeMoveVec"||i.$kind==="MergeCoins"||i.$kind==="SplitCoins"||i.$kind==="TransferObjects")&&(s=!0)}),s}function f5(e,t){let s=!1;return e.getInputUses(t,(r,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const c=i.MoveCall.arguments.indexOf(r);s=p5(i.MoveCall._argumentTypes[c])||s}}),s}const h5="0x0000000000000000000000000000000000000000000000000000000000000002::transfer::Receiving";function p5(e){return e.body.$kind!=="datatype"?!1:e.body.datatype.typeName===h5}function Mk(e,t){if(e.inputs.some(s=>s.UnresolvedObject||s.UnresolvedPure))return!0;if(!t.onlyTransactionKind){if(!e.gasData.price||!e.gasData.budget)return!0;if(e.gasData.payment){if(e.gasData.payment.length===0&&!e.expiration)return!0}else if(!(t.assumeSufficientAddressBalances&&!Ik(e))||e.expiration?.$kind!=="ValidDuring"&&e.expiration?.$kind!=="Validity")return!0}return!1}async function m5(e,t,s){return g5(e),Mk(e,t)?(Py(t).core?.resolveTransactionPlugin()??a5)(e,t,async()=>{await JE(e),await s()}):(!t.onlyTransactionKind&&!e.gasData.payment&&(e.gasData.payment=[]),await JE(e),s())}function JE(e){e.inputs.forEach((t,s)=>{if(t.$kind!=="Object"&&t.$kind!=="Pure"&&t.$kind!=="FundsWithdrawal")throw new Error(`Input at index ${s} has not been resolved. Expected a Pure, Object, or FundsWithdrawal input, but found ${JSON.stringify(t)}`)})}function Py(e){if(!e.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return e.client}function g5(e){for(const t of e.commands)switch(t.$kind){case"SplitCoins":t.SplitCoins.amounts.forEach(s=>{KE(s,F.U64,e)});break;case"TransferObjects":KE(t.TransferObjects.address,F.Address,e);break}}function KE(e,t,s){if(e.$kind!=="Input")return;const r=s.inputs[e.Input];r.$kind==="UnresolvedPure"&&(s.inputs[e.Input]=cn.Pure(t.serialize(r.UnresolvedPure.value)))}const QE=Ne({objectId:Be(),funder:dn(Be()),appType:dn(Be()),type:Be(),amount:Be(),outputKind:zv(["coin","balance"])}),y5=F.struct("AllowanceMetadata",{id:F.Address,funder:F.Address,spender:F.option(F.Address),app:F.option(F.string())});function eS({allowance:e,amount:t,type:s="0x2::sui::SUI",outputKind:r}){F.U64.validate(t);const i=ye(typeof e=="string"?e:e.objectId),c=typeof e=="string"?{}:e;return u=>(u.addIntentResolver(hi,Mu),u.add(Wt.Intent({name:hi,inputs:{allowance:u.object(i),clock:u.object.clock(),...c.app?{permit:u.object(c.app.permit)}:{}},data:{objectId:i,funder:c.funder?ye(c.funder):void 0,appType:c.app?De(c.app.type):void 0,type:De(s),amount:String(t),outputKind:r}})))}const v5=async(e,t,s)=>{const r=new Set,i=new Set;for(const p of e.commands){if(p.$kind!=="$Intent"||p.$Intent.name!==hi)continue;const m=St(QE,p.$Intent.data);m.funder||r.add(m.objectId);for(const g of[m.type,m.appType])g&&ys(g)&&i.add(g)}const[c,u]=await Promise.all([i.size?Py(t).core.mvr.resolve({types:[...i]}):void 0,r.size?Py(t).core.getObjects({objectIds:[...r],include:{content:!0}}).then(p=>p.objects):[]]),f=new Map;for(const p of u){if(p instanceof Error)throw p;f.set(p.objectId,p)}for(let p=0;p<e.commands.length;p++){const m=e.commands[p];if(m.$kind!=="$Intent"||m.$Intent.name!==hi)continue;const g=St(QE,m.$Intent.data);if(ys(g.type)){const N=c?.types[g.type];if(!N)throw new Error(`No resolution found for type: ${g.type}`);g.type=De(N.type)}if(g.appType&&ys(g.appType)){const N=c?.types[g.appType];if(!N)throw new Error(`No resolution found for type: ${g.appType}`);g.appType=De(N.type)}let y=g.funder;if(!y){const N=f.get(g.objectId),j=De(`0x2::allowance::Allowance<0x2::balance::Balance<${g.type}>>`);if(!N||N.type!==j||N.owner.$kind!=="Shared")throw new Error(`Expected a shared ${j} allowance at ${g.objectId}`);const V=y5.parse(N.content);if(V.app!==null&&!g.appType)throw new Error(`Allowance ${g.objectId} is app-bound; pass allowance.app with the app type and SpendPermit`);if(g.appType&&(V.app===null||De(V.app)!==g.appType))throw new Error(`Allowance ${g.objectId} is not bound to app ${g.appType}`);y=V.funder;const C=m.$Intent.inputs.allowance;C.$kind==="Input"&&(e.inputs[C.Input]=cn.SharedObjectRef({objectId:g.objectId,initialSharedVersion:N.owner.Shared.initialSharedVersion,mutable:!0}))}const b=m.$Intent.inputs.allowance;if(b.$kind==="Input"){const N=e.inputs[b.Input];N.Object?.SharedObject&&(N.Object.SharedObject.mutable=!0),N.UnresolvedObject&&(N.UnresolvedObject.mutable=!0)}const S=e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:g.amount},typeArg:{$kind:"Balance",Balance:g.type},withdrawFrom:{$kind:"SenderAllowance",SenderAllowance:{funder:y,allowance:g.objectId}}})),A=[Wt.MoveCall({target:g.appType?"0x2::allowance::app_balance_spend":"0x2::allowance::balance_spend",typeArguments:g.appType?[g.type,g.appType]:[g.type],arguments:[m.$Intent.inputs.allowance,...g.appType?[m.$Intent.inputs.permit]:[],S,m.$Intent.inputs.clock]})];g.outputKind==="coin"&&A.push(Wt.MoveCall({target:"0x2::coin::from_balance",typeArguments:[g.type],arguments:[{$kind:"Result",Result:p}]})),e.replaceCommand(p,A,{NestedResult:[p+A.length-1,0]}),p+=A.length-1}return s()};async function Mu(e,t,s){const r=new Set(t.intentNames??[hi,fa]),i=c=>r.has(c)&&!t.supportedIntents?.includes(c)&&e.commands.some(u=>u.$Intent?.name===c);i(hi)&&await v5(e,t,async()=>{}),i(fa)&&await T5(e,t,async()=>{}),await s()}const ra=De("0x2::sui::SUI");function b5({type:e=ra,balance:t,useGasCoin:s=!0}){let r=null;return i=>{if(r)return r;i.addIntentResolver(fa,Mu);const c=e==="gas"?e:De(e);return r=i.add(Wt.Intent({name:fa,inputs:{},data:{type:c===ra&&s?"gas":c,balance:BigInt(t),outputKind:"coin"}})),r}}function w5({type:e=ra,balance:t,useGasCoin:s=!0}){let r=null;return i=>{if(r)return r;i.addIntentResolver(fa,Mu);const c=e==="gas"?e:De(e);return r=i.add(Wt.Intent({name:fa,inputs:{},data:{type:c===ra&&s?"gas":c,balance:BigInt(t),outputKind:"balance"}})),r}}const tS=Ne({type:Be(),balance:Xt(tr([Lv(),Be(),Xt(Cn(),Hn())]),Qu(e=>BigInt(e))),outputKind:dn(zv(["coin","balance"]))});async function T5(e,t,s){const r=new Set,i=new Map,c=new Map;if(!e.sender)throw new Error("Sender must be set to resolve CoinWithBalance");if(e.commands.some(j=>j.$Intent?.name===hi))throw new Error("Resolve AllowanceBalance together with CoinWithBalance, or preserve both intents");const u=new Map;for(const j of e.inputs){if(!j.FundsWithdrawal)continue;const{withdrawFrom:V,typeArg:C,reservation:W}=j.FundsWithdrawal;if(ye(V.SenderAllowance?.funder??(V.Sender?e.sender:e.gasData.owner??e.sender))!==ye(e.sender))continue;const ce=De(C.Balance);u.set(ce,(u.get(ce)??0n)+BigInt(W.MaxAmountU64))}for(const[j,V]of e.commands.entries()){if(V.$kind!=="$Intent"||V.$Intent.name!==fa)continue;const{type:C,balance:W,outputKind:ce}=St(tS,V.$Intent.data);if(W===0n){const ae=C==="gas"?ra:C;e.replaceCommand(j,Wt.MoveCall({target:(ce??"coin")==="balance"?"0x2::balance::zero":"0x2::coin::zero",typeArguments:[ae]}));continue}C!=="gas"&&r.add(C),i.set(C,(i.get(C)??0n)+W),c.has(C)||c.set(C,[]),c.get(C).push({balance:W,outputKind:ce??"coin"})}if(i.has("gas")&&i.has(ra))throw new Error("Cannot mix SUI CoinWithBalance intents that use the gas coin with ones that do not (useGasCoin: false). Use one or the other.");const f=new Set;for(const j of e.inputs)j.Object?.ImmOrOwnedObject&&f.add(j.Object.ImmOrOwnedObject.objectId),j.UnresolvedObject?.objectId&&f.add(j.UnresolvedObject.objectId);const p=new Map,m=new Map,g=t.client,y=t.assumeSufficientAddressBalances;if(!g&&!y)throw new Error("Client must be provided to build or serialize transactions with CoinWithBalance intents");if(y)for(const[j,V]of i)m.set(j,V);else await Promise.all([...[...r].map(async j=>{const{coins:V,addressBalance:C}=await E5({coinType:j,balance:i.get(j),client:g,owner:e.sender,usedIds:f,reserved:u.get(j)??0n});p.set(j,V),m.set(j,C)}),i.has("gas")?await g.core.getBalance({owner:e.sender,coinType:ra}).then(({balance:j})=>{m.set("gas",Dk(j.addressBalance,u.get(ra)??0n))}):null]);const b=new Map,S=new Set,A=new Map;let N=0;for(;N<e.commands.length;){const j=e.commands[N];if(j.$kind!=="$Intent"||j.$Intent.name!==fa){N++;continue}const{type:V,balance:C}=St(tS,j.$Intent.data),W=V==="gas"?ra:V,ce=i.get(V),ae=m.get(V)??0n,Y=[];let K;const w=c.get(V)??[];if(w.every(O=>O.outputKind==="balance")&&ae>=ce)Y.push(Wt.MoveCall({target:"0x2::balance::redeem_funds",typeArguments:[W],arguments:[e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(C)},typeArg:{$kind:"Balance",Balance:W},withdrawFrom:{$kind:"Sender",Sender:!0}}))]})),K={$kind:"NestedResult",NestedResult:[N+Y.length-1,0]};else{if(!A.has(V)){const x=w,G=[];if(ae>=ce)S.add(V),Y.push(Wt.MoveCall({target:"0x2::coin::redeem_funds",typeArguments:[W],arguments:[e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(ce)},typeArg:{$kind:"Balance",Balance:W},withdrawFrom:{$kind:"Sender",Sender:!0}}))]})),G.push({$kind:"Result",Result:N+Y.length-1});else if(V==="gas")G.push({$kind:"GasCoin",GasCoin:!0});else{const k=p.get(V),I=k.reduce((L,X)=>L+BigInt(X.balance),0n),D=ce>I?ce-I:0n;b.set(V,I+D===ce);for(const L of k)G.push(e.addInput("object",cn.ObjectRef({objectId:L.objectId,digest:L.digest,version:L.version})));D>0n&&(S.add(V),Y.push(Wt.MoveCall({target:"0x2::coin::redeem_funds",typeArguments:[W],arguments:[e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(D)},typeArg:{$kind:"Balance",Balance:W},withdrawFrom:{$kind:"Sender",Sender:!0}}))]})),G.push({$kind:"Result",Result:N+Y.length-1}))}const U=G[0],H=G.slice(1);for(let k=0;k<H.length;k+=500)Y.push(Wt.MergeCoins(U,H.slice(k,k+500)));const $=N+Y.length;Y.push(Wt.SplitCoins(U,x.map(k=>e.addInput("pure",cn.Pure(F.u64().serialize(k.balance))))));const M=[];for(let k=0;k<x.length;k++){const I={$kind:"NestedResult",NestedResult:[$,k]};x[k].outputKind==="balance"?(Y.push(Wt.MoveCall({target:"0x2::coin::into_balance",typeArguments:[W],arguments:[I]})),M.push({$kind:"NestedResult",NestedResult:[N+Y.length-1,0]})):M.push(I)}if(V!=="gas"||S.has(V)){const k=x.some(D=>D.outputKind==="balance"),I=S.has(V);k||I?Y.push(Wt.MoveCall({target:"0x2::coin::send_funds",typeArguments:[W],arguments:[U,e.addInput("pure",cn.Pure(F.Address.serialize(e.sender)))]})):b.get(V)&&Y.push(Wt.MoveCall({target:"0x2::coin::destroy_zero",typeArguments:[W],arguments:[U]}))}A.set(V,{results:M,nextIntent:0})}const O=A.get(V);K=O.results[O.nextIntent++]}e.replaceCommand(N,Y,K),N+=Y.length}return s()}async function E5({coinType:e,balance:t,client:s,owner:r,usedIds:i,reserved:c}){let u=t;const f=[],p=s.core.getBalance({owner:r,coinType:e}).then(({balance:b})=>{const S=Dk(b.addressBalance,c);return u-=S,{...b,addressBalance:String(S),balance:String(BigInt(b.balance)-c)}}),[m,g]=await Promise.all([y(),p]);if(BigInt(g.balance)<t)throw new Error(`Insufficient balance of ${e} for owner ${r}. Required: ${t}, Available: ${t-u}`);return{coins:m,balance:BigInt(g.coinBalance),addressBalance:BigInt(g.addressBalance),coinBalance:BigInt(g.coinBalance)};async function y(b=null){const{objects:S,hasNextPage:A,cursor:N}=await s.core.listCoins({owner:r,coinType:e,cursor:b});await p;for(const j of S)i.has(j.objectId)||(f.push(j),u-=BigInt(j.balance));return u>0n&&A?y(N):f}}function Dk(e,t){const s=BigInt(e)-t;if(s<0n)throw new Error(`Insufficient address balance for existing withdrawals. Required: ${t}, Available: ${e}`);return s}function Du(e){return tr(Object.entries(e).map(([t,s])=>Ne({[t]:s})))}const Xs=Du({GasCoin:nt(!0),Input:Xt(Cn(),Hn()),Result:Xt(Cn(),Hn()),NestedResult:$v([Xt(Cn(),Hn()),Xt(Cn(),Hn())])}),S5=Ne({budget:Ct(nn),price:Ct(nn),owner:Ct(vo),payment:Ct(ct(fi))}),_5=Ne({package:ss,module:Be(),function:Be(),typeArguments:ct(Be()),arguments:ct(Xs)}),k5=Ne({name:Be(),inputs:ju(Be(),tr([Xs,ct(Xs)])),data:ju(Be(),tl())}),A5=Du({MoveCall:_5,TransferObjects:Ne({objects:ct(Xs),address:Xs}),SplitCoins:Ne({coin:Xs,amounts:ct(Xs)}),MergeCoins:Ne({destination:Xs,sources:ct(Xs)}),Publish:Ne({modules:ct(lo),dependencies:ct(ss)}),MakeMoveVec:Ne({type:Ct(Be()),elements:ct(Xs)}),Upgrade:Ne({modules:ct(lo),dependencies:ct(ss),package:ss,ticket:Xs}),$Intent:k5}),O5=Du({Object:Du({ImmOrOwnedObject:fi,SharedObject:Ne({objectId:ss,initialSharedVersion:nn,mutable:co()}),Receiving:fi}),Pure:Ne({bytes:lo}),UnresolvedPure:Ne({value:tl()}),UnresolvedObject:Ne({objectId:ss,version:dn(Ct(nn)),digest:dn(Ct(Be())),initialSharedVersion:dn(Ct(nn)),mutable:dn(Ct(co()))}),FundsWithdrawal:vk}),N5=Du({None:nt(!0),Epoch:nn,ValidDuring:Vv,Validity:bk}),x5=Ne({version:nt(2),sender:Ru(vo),expiration:Ru(N5),gasData:S5,inputs:ct(O5),commands:ct(A5),digest:dn(Ct(Be()))});function C5(e){function t(s){return e(s)}return t.system=s=>{const r=s?.mutable;return t(r!==void 0?cn.SharedObjectRef({objectId:ZE,initialSharedVersion:1,mutable:r}):{$kind:"UnresolvedObject",UnresolvedObject:{objectId:ZE,initialSharedVersion:1}})},t.clock=()=>t(cn.SharedObjectRef({objectId:oh,initialSharedVersion:1,mutable:!1})),t.random=()=>t({$kind:"UnresolvedObject",UnresolvedObject:{objectId:BR,mutable:!1}}),t.denyList=s=>t({$kind:"UnresolvedObject",UnresolvedObject:{objectId:LR,mutable:s?.mutable}}),t.option=({type:s,value:r})=>i=>i.moveCall({typeArguments:[s],target:`${Nk}::option::${r===null?"none":"some"}`,arguments:r===null?[]:[i.object(r)]}),t}function I5(e){function t(s,r){if(typeof s=="string")return e(ku(s).serialize(r));if(s instanceof Uint8Array||Ry(s))return e(s);throw new Error("tx.pure must be called either a bcs type name, or a serialized bcs value")}return t.u8=s=>e(F.U8.serialize(s)),t.u16=s=>e(F.U16.serialize(s)),t.u32=s=>e(F.U32.serialize(s)),t.u64=s=>e(F.U64.serialize(s)),t.u128=s=>e(F.U128.serialize(s)),t.u256=s=>e(F.U256.serialize(s)),t.bool=s=>e(F.Bool.serialize(s)),t.string=s=>e(F.String.serialize(s)),t.address=s=>e(F.Address.serialize(s)),t.id=t.address,t.vector=(s,r)=>e(F.vector(ku(s)).serialize(r)),t.option=(s,r)=>e(F.option(ku(s)).serialize(r)),t}function R5(){return async(e,t,s)=>{const r=qR(e);if(r.types.length===0&&r.packages.length===0)return s();if(!t.client)throw new Error("Transaction contains MVR names but no client was provided to resolve them. Please pass a client to Transaction#build()");ZR(e,await t.client.core.mvr.resolve({types:r.types,packages:r.packages})),await s()}}function nS(e){if(e.allowance!==void 0&&e.useGasCoin!==void 0)throw new Error("useGasCoin cannot be combined with allowance");const t=e.balance;if(typeof t=="string"&&!/^[0-9]+$/.test(t))throw new Error("Amount must be a non-empty string of decimal digits");if(typeof t=="number"&&!Number.isSafeInteger(t))throw new Error("Amount must be a safe integer; use bigint or a string for larger amounts");return BigInt(t)}function $0(e,t=1/0){const s={$kind:"Result",get Result(){return typeof e=="function"?e():e}},r=[],i=c=>r[c]??={$kind:"NestedResult",get NestedResult(){return[typeof e=="function"?e():e,c]}};return new Proxy(s,{set(){throw new Error("The transaction result is a proxy, and does not support setting properties directly")},get(c,u){if(u in c)return Reflect.get(c,u);if(u===Symbol.iterator)return function*(){let p=0;for(;p<t;)yield i(p),p++};if(typeof u=="symbol")return;const f=parseInt(u,10);if(!(Number.isNaN(f)||f<0))return i(f)}})}const j5=Symbol.for("@mysten/transaction");var Zn=class uh{#e;#t;#r=new Map;#s=[];#a=[];#i=new Set;#o=new Set;#c=new Map;static fromKind(t){const s=new uh;return s.#n=Xi.fromKindBytes(typeof t=="string"?qe(t):t),s.#s=s.#n.inputs.slice(),s.#a=s.#n.commands.slice(),s.#i=new Set(s.#a.map((r,i)=>i)),s}static from(t,s={}){const r=new uh;typeof t=="object"&&"getData"in t?r.#n=Xi.restore(t.getData()):typeof t!="string"||!t.startsWith("{")?r.#n=Xi.fromBytes(typeof t=="string"?qe(t):t):r.#n=Xi.restore(JSON.parse(t)),r.#s=r.#n.inputs.slice(),r.#a=r.#n.commands.slice(),r.#i=new Set(r.#a.map((c,u)=>u));const i=new Map([[fa,Mu],[hi,Mu],...Object.entries(s.intentResolvers??{})]);if(!r.isPreparedForSerialization({supportedIntents:[...i.keys()]}))throw new Error("Transaction has unresolved intents or async thunks. Provide resolvers for any custom intents via the `intentResolvers` option, or call `prepareForSerialization` before copying.");for(const[c,u]of i)r.addIntentResolver(c,u);return r}addSerializationPlugin(t){this.#e.push(t)}addBuildPlugin(t){this.#t.push(t)}addIntentResolver(t,s){if(this.#r.has(t)&&this.#r.get(t)!==s)throw new Error(`Intent resolver for ${t} already exists`);this.#r.set(t,s)}setSender(t){this.#n.sender=t}setSenderIfNotSet(t){this.#n.sender||(this.#n.sender=t)}setExpiration(t){this.#n.expiration=t?St(wk,t):null}setGasPrice(t){this.#n.gasData.price=String(t)}setGasBudget(t){this.#n.gasData.budget=String(t)}setGasBudgetIfNotSet(t){this.#n.gasData.budget==null&&(this.#n.gasData.budget=String(t))}setGasOwner(t){this.#n.gasData.owner=t}setGasPayment(t){this.#n.gasData.payment=t.map(s=>St(fi,s))}#n;getData(){return this.#n.snapshot()}get[j5](){return!0}get pure(){return Object.defineProperty(this,"pure",{enumerable:!1,value:I5(t=>Ry(t)?this.#f("pure",{$kind:"Pure",Pure:{bytes:t.toBase64()}}):this.#f("pure",Dy(UE,t)?St(UE,t):t instanceof Uint8Array?cn.Pure(t):{$kind:"UnresolvedPure",UnresolvedPure:{value:t}}))}),this.pure}constructor(){this.object=C5(t=>{if(typeof t=="function")return this.object(this.add(t));if(typeof t=="object"&&Dy(Dt,t))return t;const s=Mh(t),r=this.#n.inputs.find(i=>s===Mh(i));return r?.Object?.SharedObject&&typeof t=="object"&&t.Object?.SharedObject&&(r.Object.SharedObject.mutable=r.Object.SharedObject.mutable||t.Object.SharedObject.mutable),r?{$kind:"Input",Input:this.#n.inputs.indexOf(r),type:"object"}:this.#f("object",typeof t=="string"?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:ye(t)}}:t)}),this.#n=new Xi,this.#t=[],this.#e=[]}get gas(){return{$kind:"GasCoin",GasCoin:!0}}coin(t){const s=nS(t);return this.add(t.allowance!==void 0?eS({...t,amount:s,outputKind:"coin"}):b5({...t,balance:s}))}balance(t){const s=nS(t);return this.add(t.allowance!==void 0?eS({...t,amount:s,outputKind:"balance"}):w5({...t,balance:s}))}objectRef(...t){return this.object(cn.ObjectRef(...t))}receivingRef(...t){return this.object(cn.ReceivingRef(...t))}sharedObjectRef(...t){return this.object(cn.SharedObjectRef(...t))}#m(){const t=new uh;return t.#n=this.#n,t.#e=this.#e,t.#t=this.#t,t.#r=this.#r,t.#o=this.#o,t.#i=new Set(this.#i),t.#c=this.#c,this.#s.push(t.#s),this.#a.push(t.#a),t}add(t){if(typeof t=="function"){if(this.#c.has(t))return this.#c.get(t);const s=this.#m(),r=t(s);if(!(r&&typeof r=="object"&&"then"in r))return this.#i=s.#i,this.#c.set(t,r),r;const i=this.#h({$kind:"$Intent",$Intent:{name:"AsyncTransactionThunk",inputs:{},data:{resultIndex:this.#n.commands.length,result:null}}});this.#o.add(Promise.resolve(r).then(u=>{i.$Intent.data.result=u}));const c=$0(()=>i.$Intent.data.resultIndex);return this.#c.set(t,c),c}else this.#h(t);return $0(this.#n.commands.length-1)}#h(t){const s=this.#n.commands.length;return this.#a.push(t),this.#i.add(s),this.#n.commands.push(t),this.#n.mapCommandArguments(s,r=>{if(r.$kind==="Result"&&!this.#i.has(r.Result))throw new Error(`Result { Result: ${r.Result} } is not available to use in the current transaction`);if(r.$kind==="NestedResult"&&!this.#i.has(r.NestedResult[0]))throw new Error(`Result { NestedResult: [${r.NestedResult[0]}, ${r.NestedResult[1]}] } is not available to use in the current transaction`);if(r.$kind==="Input"&&r.Input>=this.#n.inputs.length)throw new Error(`Input { Input: ${r.Input} } references an input that does not exist in the current transaction`);return r}),t}#f(t,s){return this.#s.push(s),this.#n.addInput(t,s)}#p(t){return Ry(t)?this.pure(t):this.#l(t)}#l(t){if(typeof t=="function"){const s=this.add(t);return typeof s=="function"?this.#l(s):St(Dt,s)}return St(Dt,t)}splitCoins(t,s){const r=Wt.SplitCoins(typeof t=="string"?this.object(t):this.#l(t),s.map(i=>typeof i=="number"||typeof i=="bigint"||typeof i=="string"?this.pure.u64(i):this.#p(i)));return this.#h(r),$0(this.#n.commands.length-1,s.length)}mergeCoins(t,s){return this.add(Wt.MergeCoins(this.object(t),s.map(r=>this.object(r))))}publish({modules:t,dependencies:s}){return this.add(Wt.Publish({modules:t,dependencies:s}))}upgrade({modules:t,dependencies:s,package:r,ticket:i}){return this.add(Wt.Upgrade({modules:t,dependencies:s,package:r,ticket:this.object(i)}))}moveCall({arguments:t,...s}){return this.add(Wt.MoveCall({...s,arguments:t?.map(r=>this.#p(r))}))}transferObjects(t,s){return this.add(Wt.TransferObjects(t.map(r=>this.object(r)),typeof s=="string"?this.pure.address(s):this.#p(s)))}makeMoveVec({type:t,elements:s}){return this.add(Wt.MakeMoveVec({type:t,elements:s.map(r=>this.object(r))}))}withdrawal(t){const s={$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(t.amount)},typeArg:{$kind:"Balance",Balance:t.type??"0x2::sui::SUI"},withdrawFrom:t.from==="allowance"?{$kind:"SenderAllowance",SenderAllowance:{funder:ye(t.funder),allowance:ye(t.allowance)}}:t.from==="sponsor"?{$kind:"Sponsor",Sponsor:!0}:{$kind:"Sender",Sender:!0}}};return this.#f("object",s)}serialize(){return JSON.stringify(uR(this.#n.snapshot()))}async toJSON(t={}){await this.prepareForSerialization(t);const s=this.isFullyResolved();return JSON.stringify(St(x5,s?{...this.#n.snapshot(),digest:this.#n.getDigest()}:this.#n.snapshot()),(r,i)=>typeof i=="bigint"?i.toString():i,2)}async sign(t){const{signer:s,...r}=t,i=await this.build(r);return s.signTransaction(i)}isPreparedForSerialization(t={}){return!(this.#o.size>0||this.#n.commands.some(s=>s.$Intent&&!t.supportedIntents?.includes(s.$Intent.name)))}isFullyResolved(){return!(!this.isPreparedForSerialization()||!this.#n.sender||Mk(this.#n,{}))}async build(t={}){return await this.prepareForSerialization(t),await this.#g(t),this.#n.build({onlyTransactionKind:t.onlyTransactionKind})}async getDigest(t={}){return await this.prepareForSerialization(t),await this.#g(t),this.#n.getDigest()}async#g(t){if(!t.onlyTransactionKind&&!this.#n.sender)throw new Error("Missing transaction sender");await this.#d([...this.#t,m5],t)}async#d(t,s){try{const r=i=>{if(i>=t.length)return()=>{};const c=t[i];return async()=>{const u=r(i+1);let f=!1,p=!1;if(await c(this.#n,s,async()=>{if(f)throw new Error(`next() was call multiple times in TransactionPlugin ${i}`);f=!0,await u(),p=!0}),!f)throw new Error(`next() was not called in TransactionPlugin ${i}`);if(!p)throw new Error(`next() was not awaited in TransactionPlugin ${i}`)}};await r(0)()}finally{this.#s=this.#n.inputs.slice(),this.#a=this.#n.commands.slice(),this.#i=new Set(this.#a.map((r,i)=>i))}}async#y(){for(;this.#o.size>0;){const t=Promise.all(this.#o);this.#o.clear(),this.#o.add(t),await t,this.#o.delete(t)}}#u(){const t=this.#n.commands,s=this.#n.inputs,r=this.#a.flat(1/0),i=this.#s.flat(1/0);if(r.length!==t.length)throw new Error("Unexpected number of commands found in transaction data");if(i.length!==s.length)throw new Error("Unexpected number of inputs found in transaction data");const c=r.filter(f=>f.$Intent?.name!=="AsyncTransactionThunk");this.#n.commands=c,this.#n.inputs=i,this.#a=c,this.#s=i,this.#i=new Set(c.map((f,p)=>p));function u(f){const p=t[f];if(p.$Intent?.name==="AsyncTransactionThunk"){const g=p.$Intent.data.result;if(g==null)throw new Error("AsyncTransactionThunk has not been resolved");return u(g.Result)}const m=c.indexOf(p);if(m===-1)throw new Error("Unable to find original index for command");return m}this.#n.mapArguments(f=>{if(f.$kind==="Input"){const p=i.indexOf(s[f.Input]);if(p===-1)throw new Error("Input has not been resolved");return{...f,Input:p}}else if(f.$kind==="Result"){const p=u(f.Result);return{...f,Result:p}}else if(f.$kind==="NestedResult"){const p=u(f.NestedResult[0]);return{...f,NestedResult:[p,f.NestedResult[1]]}}return f});for(const[f,p]of t.entries())if(p.$Intent?.name==="AsyncTransactionThunk")try{p.$Intent.data.resultIndex=u(f)}catch{}}async prepareForSerialization(t){await this.#y(),this.#u();const s=new Set;for(const c of this.#n.commands)c.$Intent&&s.add(c.$Intent.name);const r=[...this.#e],i=new Map;for(const c of s){if(t.supportedIntents?.includes(c))continue;const u=this.#r.get(c);if(!u)throw new Error(`Missing intent resolver for ${c}`);const f=i.get(u)??[];f.push(c),i.set(u,f)}for(const[c,u]of i)r.push((f,p,m)=>c(f,{...p,intentNames:u},m));r.push(R5()),await this.#d(r,t)}};const M5="…";function Uk(e){if(e.length<=6)return e;const t=e.startsWith("0x")?2:0;return`0x${e.slice(t,t+4)}${M5}${e.slice(-4)}`}const Bk="sui:signTransactionBlock",zh="sui:signTransaction",D5="sui:signAndExecuteTransactionBlock",Gy="sui:signAndExecuteTransaction",Fy="sui:signPersonalMessage";var U5=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)},B5=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},dh;let lu;const Sp=new Set;function L5(e){Au=void 0,Sp.add(e)}function z5(e){Au=void 0,Sp.delete(e)}const Sc={};function _p(){if(lu||(lu=Object.freeze({register:sS,get:$5,on:V5}),typeof window>"u"))return lu;const e=Object.freeze({register:sS});try{window.addEventListener("wallet-standard:register-wallet",({detail:t})=>t(e))}catch(t){console.error(`wallet-standard:register-wallet event listener could not be added
8
8
  `,t)}try{window.dispatchEvent(new P5(e))}catch(t){console.error(`wallet-standard:app-ready event could not be dispatched
9
9
  `,t)}return lu}function sS(...e){return e=e.filter(t=>!Sp.has(t)),e.length?(e.forEach(t=>L5(t)),Sc.register?.forEach(t=>rS(()=>t(...e))),function(){e.forEach(s=>z5(s)),Sc.unregister?.forEach(s=>rS(()=>s(...e)))}):()=>{}}let Au;function $5(){return Au||(Au=[...Sp]),Au}function V5(e,t){return Sc[e]?.push(t)||(Sc[e]=[t]),function(){Sc[e]=Sc[e]?.filter(r=>t!==r)}}function rS(e){try{e()}catch(t){console.error(t)}}class P5 extends Event{get detail(){return U5(this,dh,"f")}get type(){return"wallet-standard:app-ready"}constructor(t){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),dh.set(this,void 0),B5(this,dh,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")}}dh=new WeakMap;const G5=3834e3,F5=3834001,H5=4001e3,q5=616e4,Z5=6160001,Y5=6160002;function Lk(e){return Array.isArray(e)?"%5B"+e.map(Lk).join("%2C%20")+"%5D":typeof e=="bigint"?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function W5([e,t]){return`${e}=${Lk(t)}`}function X5(e){const t=Object.entries(e).map(W5).join("&");return btoa(t)}var aS;(function(e){e[e.EscapeSequence=0]="EscapeSequence",e[e.Text=1]="Text",e[e.Variable=2]="Variable"})(aS||(aS={}));function J5(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+=` '${X5(t)}'`),`${s}\``}}function K5(e,t){return e instanceof Error&&e.name==="WalletStandardError"?e.context.__code===t:!1}class td extends Error{constructor(...[t,s]){let r,i;if(s){const{cause:u,...f}=s;u&&(i={cause:u}),Object.keys(f).length>0&&(r=f)}const c=J5(t,r);super(c,i),this.context={__code:t,...r},this.name="WalletStandardError"}}function kp(...e){"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...e)}const Jv="standard:connect",Q5="standard:disconnect",Ap="standard:events";var pc=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)},mc=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},fh,hh,ph,mh,gh,yh;class nd{get address(){return pc(this,fh,"f")}get publicKey(){return pc(this,hh,"f").slice()}get chains(){return pc(this,ph,"f").slice()}get features(){return pc(this,mh,"f").slice()}get label(){return pc(this,gh,"f")}get icon(){return pc(this,yh,"f")}constructor(t){fh.set(this,void 0),hh.set(this,void 0),ph.set(this,void 0),mh.set(this,void 0),gh.set(this,void 0),yh.set(this,void 0),new.target===nd&&Object.freeze(this),mc(this,fh,t.address,"f"),mc(this,hh,t.publicKey.slice(),"f"),mc(this,ph,t.chains.slice(),"f"),mc(this,mh,t.features.slice(),"f"),mc(this,gh,t.label,"f"),mc(this,yh,t.icon,"f")}}fh=new WeakMap,hh=new WeakMap,ph=new WeakMap,mh=new WeakMap,gh=new WeakMap,yh=new WeakMap;const ej="sui:devnet",tj="sui:testnet",nj="sui:localnet",zk="sui:mainnet",Uu=[ej,tj,nj,zk],sj=["sui:signTransaction","sui:signAndExecuteTransaction","sui:signPersonalMessage"];function rj(e){const t=[...Uu],s=new Set(Uu);for(const r of e??[]){const i=`sui:${r}`;s.has(i)||(s.add(i),t.push(i))}return t}function Hy(e,t,s,r,i){return{address:t,label:s,signer:e,walletAccount:new nd({address:t,label:s,publicKey:e.getPublicKey().toSuiBytes(),chains:[...Uu],features:[...sj]})}}function aj(e){return e.split(":")[1]}async function ij({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 Zn.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 Zn.from(s).sign({client:r,signer:t}),u=await r.core.executeTransaction({transaction:qe(i),signatures:[c],include:{effects:!0}}),f=u.Transaction??u.FailedTransaction;if(!f)throw new Error("Transaction execution returned empty result");if(!f.status.success)throw new Error(f.status.error?.message??"Transaction execution failed");return{type:e,bytes:i,signature:c,digest:f.digest,effects:f.effects?.bcs?st(f.effects.bcs):""}}}}const $k="x-sui-client-protocol-version",Vk=138;function ma(e){let t=typeof e;if(t=="object"){if(Array.isArray(e))return"array";if(e===null)return"null"}return t}function $h(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}let aa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Op=[];for(let e=0;e<aa.length;e++)Op[aa[e].charCodeAt(0)]=e;Op[45]=aa.indexOf("+");Op[95]=aa.indexOf("/");function Pk(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 f=0;f<e.length;f++){if(c=Op[e.charCodeAt(f)],c===void 0)switch(e[f]){case"=":i=0;case`
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 Gk(e){let t="",s=0,r,i=0;for(let c=0;c<e.length;c++)switch(r=e[c],s){case 0:t+=aa[r>>2],i=(r&3)<<4,s=1;break;case 1:t+=aa[i|r>>4],i=(r&15)<<2,s=2;break;case 2:t+=aa[i|r>>6],t+=aa[r&63],s=0;break}return s&&(t+=aa[i],t+="=",s==1&&(t+="=")),t}var Vh;(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:f}of e.list(r))i.tag(c,u).raw(f)},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])})(Vh||(Vh={}));function oj(e,t){return Object.assign(Object.assign({},e),t)}var Yt;(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"})(Yt||(Yt={}));function cj(){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 V0(e,t,s){for(let c=0;c<28;c=c+7){const u=e>>>c,f=!(!(u>>>7)&&t==0),p=(f?u|128:u)&255;if(s.push(p),!f)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,f=!!(u>>>7),p=(f?u|128:u)&255;if(s.push(p),!f)return}s.push(t>>>31&1)}}const vh=65536*65536;function Fk(e){let t=e[0]=="-";t&&(e=e.slice(1));const s=1e6;let r=0,i=0;function c(u,f){const p=Number(e.slice(u,f));i*=s,r=r*s+p,r>=vh&&(i=i+(r/vh|0),r=r%vh)}return c(-24,-18),c(-18,-12),c(-12,-6),c(-6),[t,r,i]}function qy(e,t){if(t>>>0<=2097151)return""+(vh*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,f=i*2,p=1e7;c>=p&&(u+=Math.floor(c/p),c%=p),u>=p&&(f+=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(f,0)+m(u,f)+m(c,1)}function iS(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 lj(){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 xt;function uj(){const e=new DataView(new ArrayBuffer(8));xt=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}uj();function Hk(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const qk=/^-?[0-9]+$/,Ph=4294967296,Gf=2147483648;class Zk{constructor(t,s){this.lo=t|0,this.hi=s|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let t=this.hi*Ph+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class Un extends Zk{static from(t){if(xt)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=xt.C(t);case"number":if(t===0)return this.ZERO;t=xt.C(t);case"bigint":if(!t)return this.ZERO;if(t<xt.UMIN)throw new Error("signed value for ulong");if(t>xt.UMAX)throw new Error("ulong too large");return xt.V.setBigUint64(0,t,!0),new Un(xt.V.getInt32(0,!0),xt.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!qk.test(t))throw new Error("string is no integer");let[s,r,i]=Fk(t);if(s)throw new Error("signed value for ulong");return new Un(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 Un(t,t/Ph)}throw new Error("unknown value "+typeof t)}toString(){return xt?this.toBigInt().toString():qy(this.lo,this.hi)}toBigInt(){return Hk(xt),xt.V.setInt32(0,this.lo,!0),xt.V.setInt32(4,this.hi,!0),xt.V.getBigUint64(0,!0)}}Un.ZERO=new Un(0,0);class At extends Zk{static from(t){if(xt)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=xt.C(t);case"number":if(t===0)return this.ZERO;t=xt.C(t);case"bigint":if(!t)return this.ZERO;if(t<xt.MIN)throw new Error("signed long too small");if(t>xt.MAX)throw new Error("signed long too large");return xt.V.setBigInt64(0,t,!0),new At(xt.V.getInt32(0,!0),xt.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!qk.test(t))throw new Error("string is no integer");let[s,r,i]=Fk(t);if(s){if(i>Gf||i==Gf&&r!=0)throw new Error("signed long too small")}else if(i>=Gf)throw new Error("signed long too large");let c=new At(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 At(t,t/Ph):new At(-t,-t/Ph).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return(this.hi&Gf)!==0}negate(){let t=~this.hi,s=this.lo;return s?s=~s+1:t+=1,new At(s,t)}toString(){if(xt)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 Hk(xt),xt.V.setInt32(0,this.lo,!0),xt.V.setInt32(4,this.hi,!0),xt.V.getBigInt64(0,!0)}}At.ZERO=new At(0,0);const oS={readUnknownField:!0,readerFactory:e=>new fj(e)};function dj(e){return e?Object.assign(Object.assign({},oS),e):oS}class fj{constructor(t,s){this.varint64=cj,this.uint32=lj,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 Yt.Varint:for(;this.buf[this.pos++]&128;);break;case Yt.Bit64:this.pos+=4;case Yt.Bit32:this.pos+=4;break;case Yt.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Yt.StartGroup:let i;for(;(i=this.tag()[1])!==Yt.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 At(...this.varint64())}uint64(){return new Un(...this.varint64())}sint64(){let[t,s]=this.varint64(),r=-(t&1);return t=(t>>>1|(s&1)<<31)^r,s=s>>>1^r,new At(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 Un(this.sfixed32(),this.sfixed32())}sfixed64(){return new At(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 Qe(e,t){if(!e)throw new Error(t)}function hj(e,t){throw new Error("Unexpected object: "+e)}const pj=34028234663852886e22,mj=-34028234663852886e22,gj=4294967295,yj=2147483647,vj=-2147483648;function Ou(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>yj||e<vj)throw new Error("invalid int 32: "+e)}function Gh(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 Kv(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>pj||e<mj))throw new Error("invalid float 32: "+e)}const cS={writeUnknownFields:!0,writerFactory:()=>new wj};function bj(e){return e?Object.assign(Object.assign({},cS),e):cS}class wj{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(Gh(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Ou(t),iS(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){Kv(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){Gh(t);let s=new Uint8Array(4);return new DataView(s.buffer).setUint32(0,t,!0),this.raw(s)}sfixed32(t){Ou(t);let s=new Uint8Array(4);return new DataView(s.buffer).setInt32(0,t,!0),this.raw(s)}sint32(t){return Ou(t),t=(t<<1^t>>31)>>>0,iS(t,this.buf),this}sfixed64(t){let s=new Uint8Array(8),r=new DataView(s.buffer),i=At.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=Un.from(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(s)}int64(t){let s=At.from(t);return V0(s.lo,s.hi,this.buf),this}sint64(t){let s=At.from(t),r=s.hi>>31,i=s.lo<<1^r,c=(s.hi<<1|s.lo>>>31)^r;return V0(i,c,this.buf),this}uint64(t){let s=Un.from(t);return V0(s.lo,s.hi,this.buf),this}}const lS={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},uS={ignoreUnknownFields:!1};function Tj(e){return e?Object.assign(Object.assign({},uS),e):uS}function Yk(e){return e?Object.assign(Object.assign({},lS),e):lS}function Ej(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 Wk=Symbol.for("protobuf-ts/message-type");function Fh(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 wr;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER"})(wr||(wr={}));var Hh;(function(e){e[e.NO=0]="NO",e[e.PACKED=1]="PACKED",e[e.UNPACKED=2]="UNPACKED"})(Hh||(Hh={}));function Sj(e){var t,s,r,i;return e.localName=(t=e.localName)!==null&&t!==void 0?t:Fh(e.name),e.jsonName=(s=e.jsonName)!==null&&s!==void 0?s:Fh(e.name),e.repeat=(r=e.repeat)!==null&&r!==void 0?r:Hh.NO,e.opt=(i=e.opt)!==null&&i!==void 0?i:e.repeat||e.oneof?!1:e.kind=="message",e}function _j(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 kj{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 f=t[u];if(!_j(f))return!1;if(f.oneofKind===void 0)continue;const p=this.fields.find(m=>m.localName===f.oneofKind);if(!p||!this.field(f[f.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 wr.BIGINT:return i=="bigint";case wr.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,wr.STRING)}}}function Js(e,t){switch(t){case wr.BIGINT:return e.toBigInt();case wr.NUMBER:return e.toNumber();default:return e.toString()}}class Aj{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=ma(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 f=this.fMap[c];if(!f){if(!r.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${c}`);continue}const p=f.localName;let m;if(f.oneof){if(u===null&&(f.kind!=="enum"||f.T()[0]!=="google.protobuf.NullValue"))continue;if(i.includes(f.oneof))throw new Error(`Multiple members of the oneof group "${f.oneof}" of ${this.info.typeName} are present in JSON.`);i.push(f.oneof),m=s[f.oneof]={oneofKind:p}}else m=s;if(f.kind=="map"){if(u===null)continue;this.assert($h(u),f.name,u);const g=m[p];for(const[y,b]of Object.entries(u)){this.assert(b!==null,f.name+" map value",null);let S;switch(f.V.kind){case"message":S=f.V.T().internalJsonRead(b,r);break;case"enum":if(S=this.enum(f.V.T(),b,f.name,r.ignoreUnknownFields),S===!1)continue;break;case"scalar":S=this.scalar(b,f.V.T,f.V.L,f.name);break}this.assert(S!==void 0,f.name+" map value",b);let A=y;f.K==ve.BOOL&&(A=A=="true"?!0:A=="false"?!1:A),A=this.scalar(A,f.K,wr.STRING,f.name).toString(),g[A]=S}}else if(f.repeat){if(u===null)continue;this.assert(Array.isArray(u),f.name,u);const g=m[p];for(const y of u){this.assert(y!==null,f.name,null);let b;switch(f.kind){case"message":b=f.T().internalJsonRead(y,r);break;case"enum":if(b=this.enum(f.T(),y,f.name,r.ignoreUnknownFields),b===!1)continue;break;case"scalar":b=this.scalar(y,f.T,f.L,f.name);break}this.assert(b!==void 0,f.name,u),g.push(b)}}else switch(f.kind){case"message":if(u===null&&f.T().typeName!="google.protobuf.Value"){this.assert(f.oneof===void 0,f.name+" (oneof member)",null);continue}m[p]=f.T().internalJsonRead(u,r,m[p]);break;case"enum":if(u===null)continue;let g=this.enum(f.T(),u,f.name,r.ignoreUnknownFields);if(g===!1)continue;m[p]=g;break;case"scalar":if(u===null)continue;m[p]=this.scalar(u,f.T,f.L,f.name);break}}}enum(t,s,r,i){if(t[0]=="google.protobuf.NullValue"&&Qe(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 Qe(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:(Qe(typeof u=="number",`Unable to parse field ${this.info.typeName}#${r}, enum ${t[0]} has no value for "${s}".`),u)}Qe(!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&&Kv(u),u;case ve.INT32:case ve.FIXED32:case ve.SFIXED32:case ve.SINT32:case ve.UINT32:if(t===null)return 0;let f;if(typeof t=="number"?f=t:t===""?c="empty string":typeof t=="string"&&(t.trim().length!==t.length?c="extra whitespace":f=Number(t)),f===void 0)break;return s==ve.UINT32?Gh(f):Ou(f),f;case ve.INT64:case ve.SFIXED64:case ve.SINT64:if(t===null)return Js(At.ZERO,r);if(typeof t!="number"&&typeof t!="string")break;return Js(At.from(t),r);case ve.FIXED64:case ve.UINT64:if(t===null)return Js(Un.ZERO,r);if(typeof t!="number"&&typeof t!="string")break;return Js(Un.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 Pk(t)}}catch(u){c=u.message}this.assert(!1,i+(c?" - "+c:""),t)}}class Oj{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 f=c.kind=="scalar"||c.kind=="enum"?Object.assign(Object.assign({},s),{emitDefaultValues:!0}):s;let p=this.field(c,u[c.localName],f);Qe(p!==void 0),r[s.useProtoFieldName?c.name:c.jsonName]=p}return r}field(t,s,r){let i;if(t.kind=="map"){Qe(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);Qe(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);Qe(g!==void 0),c[p.toString()]=g}break;case"enum":const f=t.V.T();for(const[p,m]of Object.entries(s)){Qe(m===void 0||typeof m=="number");const g=this.enum(f,m,t.name,!1,!0,r.enumAsInteger);Qe(g!==void 0),c[p.toString()]=g}break}(r.emitDefaultValues||Object.keys(c).length>0)&&(i=c)}else if(t.repeat){Qe(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);Qe(m!==void 0),c.push(m)}break;case"enum":const u=t.T();for(let p=0;p<s.length;p++){Qe(s[p]===void 0||typeof s[p]=="number");const m=this.enum(u,s[p],t.name,t.opt,!0,r.enumAsInteger);Qe(m!==void 0),c.push(m)}break;case"message":const f=t.T();for(let p=0;p<s.length;p++){const m=this.message(f,s[p],t.name,r);Qe(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){Qe(i);return}if(!(s===0&&!c&&!i))return Qe(typeof s=="number"),Qe(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){Qe(i);return}const u=c||i;switch(t){case ve.INT32:case ve.SFIXED32:case ve.SINT32:return s===0?u?0:void 0:(Ou(s),s);case ve.FIXED32:case ve.UINT32:return s===0?u?0:void 0:(Gh(s),s);case ve.FLOAT:Kv(s);case ve.DOUBLE:return s===0?u?0:void 0:(Qe(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:(Qe(typeof s=="string"),s);case ve.BOOL:return s===!1?u?!1:void 0:(Qe(typeof s=="boolean"),s);case ve.UINT64:case ve.FIXED64:Qe(typeof s=="number"||typeof s=="string"||typeof s=="bigint");let f=Un.from(s);return f.isZero()&&!u?void 0:f.toString();case ve.INT64:case ve.SFIXED64:case ve.SINT64:Qe(typeof s=="number"||typeof s=="string"||typeof s=="bigint");let p=At.from(s);return p.isZero()&&!u?void 0:p.toString();case ve.BYTES:return Qe(s instanceof Uint8Array),s.byteLength?Gk(s):u?"":void 0}}}function Zy(e,t=wr.STRING){switch(e){case ve.BOOL:return!1;case ve.UINT64:case ve.FIXED64:return Js(Un.ZERO,t);case ve.INT64:case ve.SFIXED64:case ve.SINT64:return Js(At.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 Nj{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,f]=t.tag(),p=this.fieldNoToField.get(u);if(!p){let b=r.readUnknownField;if(b=="throw")throw new Error(`Unknown field ${u} (wire type ${f}) for ${this.info.typeName}`);let S=t.skip(f);b!==!1&&(b===!0?Vh.onRead:b)(this.info.typeName,s,u,f,S);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,S=p.kind=="scalar"?p.L:void 0;if(g){let j=m[y];if(f==Yt.LengthDelimited&&b!=ve.STRING&&b!=ve.BYTES){let V=t.uint32()+t.pos;for(;t.pos<V;)j.push(this.scalar(t,b,S))}else j.push(this.scalar(t,b,S))}else m[y]=this.scalar(t,b,S);break;case"message":if(g){let j=m[y],V=p.T().internalBinaryRead(t,t.uint32(),r);j.push(V)}else m[y]=p.T().internalBinaryRead(t,t.uint32(),r,m[y]);break;case"map":let[A,N]=this.mapEntry(p,t,r);m[y][A]=N;break}}}mapEntry(t,s,r){let i=s.uint32(),c=s.pos+i,u,f;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,wr.STRING);break;case 2:switch(t.V.kind){case"scalar":f=this.scalar(s,t.V.T,t.V.L);break;case"enum":f=s.int32();break;case"message":f=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=Zy(t.K);u=t.K==ve.BOOL?p.toString():p}if(f===void 0)switch(t.V.kind){case"scalar":f=Zy(t.V.T,t.V.L);break;case"enum":f=0;break;case"message":f=t.V.T().create();break}return[u,f]}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 Js(t.int64(),r);case ve.UINT64:return Js(t.uint64(),r);case ve.FIXED64:return Js(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 Js(t.sfixed64(),r);case ve.SINT32:return t.sint32();case ve.SINT64:return Js(t.sint64(),r)}}}class xj{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,f,p=c.repeat,m=c.localName;if(c.oneof){const g=t[c.oneof];if(g.oneofKind!==m)continue;u=g[m],f=!0}else u=t[m],f=!1;switch(c.kind){case"scalar":case"enum":let g=c.kind=="enum"?ve.INT32:c.T;if(p)if(Qe(Array.isArray(u)),p==Hh.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?Qe(c.opt):this.scalar(s,g,c.no,u,f||c.opt);break;case"message":if(p){Qe(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":Qe(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?Vh.onWrite:i)(this.info.typeName,t,s)}mapEntry(t,s,r,i,c){t.tag(r.no,Yt.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:Qe(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,Yt.LengthDelimited).fork(),s),t.join())}scalar(t,s,r,i,c){let[u,f,p]=this.scalarInfo(s,i);(!p||c)&&(t.tag(r,u),t[f](i))}packed(t,s,r,i){if(!i.length)return;Qe(s!==ve.BYTES&&s!==ve.STRING),t.tag(r,Yt.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=Yt.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=Yt.LengthDelimited,i="string";break;case ve.BOOL:u=s===!1,i="bool";break;case ve.UINT32:i="uint32";break;case ve.DOUBLE:r=Yt.Bit64,i="double";break;case ve.FLOAT:r=Yt.Bit32,i="float";break;case ve.INT64:u=c||At.from(s).isZero(),i="int64";break;case ve.UINT64:u=c||Un.from(s).isZero(),i="uint64";break;case ve.FIXED64:u=c||Un.from(s).isZero(),r=Yt.Bit64,i="fixed64";break;case ve.BYTES:u=c||!s.byteLength,r=Yt.LengthDelimited,i="bytes";break;case ve.FIXED32:r=Yt.Bit32,i="fixed32";break;case ve.SFIXED32:r=Yt.Bit32,i="sfixed32";break;case ve.SFIXED64:u=c||At.from(s).isZero(),r=Yt.Bit64,i="sfixed64";break;case ve.SINT32:i="sint32";break;case ve.SINT64:u=c||At.from(s).isZero(),i="sint64";break}return[r,i,c||u]}}function Cj(e){const t=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},Wk,{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]=Zy(s.T,s.L);break;case"enum":t[r]=0;break;case"map":t[r]={};break}}return t}function P0(e,t,s){let r,i=s,c;for(let u of e.fields){let f=u.localName;if(u.oneof){const p=i[u.oneof];if(p?.oneofKind==null)continue;if(r=p[f],c=t[u.oneof],c.oneofKind=p.oneofKind,r==null){delete c[f];continue}}else if(r=i[f],c=t,r==null)continue;switch(u.repeat&&(c[f].length=r.length),u.kind){case"scalar":case"enum":if(u.repeat)for(let m=0;m<r.length;m++)c[f][m]=r[m];else c[f]=r;break;case"message":let p=u.T();if(u.repeat)for(let m=0;m<r.length;m++)c[f][m]=p.create(r[m]);else c[f]===void 0?c[f]=p.create(r):p.mergePartial(c[f],r);break;case"map":switch(u.V.kind){case"scalar":case"enum":Object.assign(c[f],r);break;case"message":let m=u.V.T();for(let g of Object.keys(r))c[f][g]=m.create(r[g]);break}break}}}function Ij(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 f=r.kind=="enum"?ve.INT32:r.T;if(!(r.repeat?dS(f,c,u):Xk(f,c,u)))return!1;break;case"map":if(!(r.V.kind=="message"?fS(r.V.T(),Ff(c),Ff(u)):dS(r.V.kind=="enum"?ve.INT32:r.V.T,Ff(c),Ff(u))))return!1;break;case"message":let p=r.T();if(!(r.repeat?fS(p,c,u):p.equals(c,u)))return!1;break}}return!0}const Ff=Object.values;function Xk(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 dS(e,t,s){if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(!Xk(e,t[r],s[r]))return!1;return!0}function fS(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 Jk=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),Rj=Jk[Wk]={};class Z{constructor(t,s,r){this.defaultCheckDepth=16,this.typeName=t,this.fields=s.map(Sj),this.options=r??{},Rj.value=this,this.messagePrototype=Object.create(null,Jk),this.refTypeCheck=new kj(this),this.refJsonReader=new Aj(this),this.refJsonWriter=new Oj(this),this.refBinReader=new Nj(this),this.refBinWriter=new xj(this)}create(t){let s=Cj(this);return t!==void 0&&P0(this,s,t),s}clone(t){let s=this.create();return P0(this,s,t),s}equals(t,s){return Ij(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){P0(this,t,s)}fromBinary(t,s){let r=dj(s);return this.internalBinaryRead(r.readerFactory(t),t.byteLength,r)}fromJson(t,s){return this.internalJsonRead(t,Tj(s))}fromJsonString(t,s){let r=JSON.parse(t);return this.fromJson(r,s)}toJson(t,s){return this.internalJsonWrite(t,Yk(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=bj(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 ${ma(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 jj(e,t){var s,r,i;let c=e;return c.service=t,c.localName=(s=c.localName)!==null&&s!==void 0?s:Fh(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 gi{constructor(t,s,r){this.typeName=t,this.methods=s.map(i=>jj(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
- `)}}function Mj(e,t){if(!t)return e;let s={};Hf(e,s),Hf(t,s);for(let r of Object.keys(t)){let i=t[r];switch(r){case"jsonOptions":s.jsonOptions=Ej(e.jsonOptions,s.jsonOptions);break;case"binaryOptions":s.binaryOptions=oj(e.binaryOptions,s.binaryOptions);break;case"meta":s.meta={},Hf(e.meta,s.meta),Hf(t.meta,s.meta);break;case"interceptors":s.interceptors=e.interceptors?e.interceptors.concat(i):i.concat();break}}return s}function Hf(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 Us;(function(e){e[e.PENDING=0]="PENDING",e[e.REJECTED=1]="REJECTED",e[e.RESOLVED=2]="RESOLVED"})(Us||(Us={}));class Qa{constructor(t=!0){this._state=Us.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!==Us.PENDING)throw new Error(`cannot resolve ${Us[this.state].toLowerCase()}`);this._resolve(t),this._state=Us.RESOLVED}reject(t){if(this.state!==Us.PENDING)throw new Error(`cannot reject ${Us[this.state].toLowerCase()}`);this._reject(t),this._state=Us.REJECTED}resolvePending(t){this._state===Us.PENDING&&this.resolve(t)}rejectPending(t){this._state===Us.PENDING&&this.reject(t)}}class Dj{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){Qe((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){Qe(!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){Qe(!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(){Qe(!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;Qe(t,"bad state"),Qe(!t.p,"iterator contract broken");let s=t.q.shift();return s?"value"in s?Promise.resolve(s):Promise.reject(s):(t.p=new Qa,t.p.promise)}}}pushIt(t){let s=this._itState;if(s.p){const r=s.p;Qe(r.state==Us.PENDING,"iterator contract broken"),"value"in t?r.resolve(t):r.reject(t),delete s.p}else s.q.push(t)}}var Uj=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 f(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(f,p)}m((r=r.apply(e,t||[])).next())})};class Kk{constructor(t,s,r,i,c,u,f){this.method=t,this.requestHeaders=s,this.request=r,this.headers=i,this.response=c,this.status=u,this.trailers=f}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 Uj(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 Bj=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 f(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(f,p)}m((r=r.apply(e,t||[])).next())})};class Lj{constructor(t,s,r,i,c,u,f){this.method=t,this.requestHeaders=s,this.request=r,this.headers=i,this.responses=c,this.status=u,this.trailers=f}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 Bj(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,f,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,S,A)=>g.interceptUnary(y,b,S,A)}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,S,A)=>g.interceptServerStreaming(y,b,S,A)}return m(s,i,r)}if(e=="clientStreaming"){let m=(g,y)=>t.clientStreaming(g,y);for(const g of((f=r.interceptors)!==null&&f!==void 0?f:[]).filter(y=>y.interceptClientStreaming).reverse()){const y=m;m=(b,S)=>g.interceptClientStreaming(y,b,S)}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,S)=>g.interceptDuplex(y,b,S)}return m(s,r)}hj(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 zj=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 f(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(f,p)}m((r=r.apply(e,t||[])).next())})};function hS(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 f of u)e.append(c,f);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 pS(e,t){let s=new Uint8Array(5+e.length);s[0]=Qs.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:Gk(s)}function Yy(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 Yy(Gj(p.headers),p.status,p.statusText)}let r=e,i=t>=200&&t<300,c=eA(r),[u,f]=Qk(r);return(u===void 0||u===we.OK)&&!i&&(u=Fj(t),f=s),[u,f,c]}function mS(e){let t=Pj(e),[s,r]=Qk(t),i=eA(t);return[s??we.OK,r,i]}var Qs;(function(e){e[e.DATA=0]="DATA",e[e.TRAILER=128]="TRAILER"})(Qs||(Qs={}));function gS(e,t,s){return zj(this,void 0,void 0,function*(){let r,i="",c=new Uint8Array(0),u=Vj(t);if($j(e)){let f=e.getReader();r={next:()=>f.read()}}else r=e[Symbol.asyncIterator]();for(;;){let f=yield r.next();if(f.value!==void 0){if(u==="text"){for(let m=0;m<f.value.length;m++)i+=String.fromCharCode(f.value[m]);let p=i.length-i.length%4;if(p===0)continue;c=yS(c,Pk(i.substring(0,p))),i=i.substring(p)}else c=yS(c,f.value);for(;c.length>=5&&c[0]===Qs.DATA;){let p=0;for(let m=1;m<5;m++)p=(p<<8)+c[m];if(c.length-5>=p)s(Qs.DATA,c.subarray(5,5+p)),c=c.subarray(5+p);else break}}if(f.done){if(c.length===0)break;if(c[0]!==Qs.TRAILER||c.length<5)throw new gt("premature EOF",we[we.DATA_LOSS]);s(Qs.TRAILER,c.subarray(5));break}}})}const $j=e=>typeof e.getReader=="function";function yS(e,t){let s=new Uint8Array(e.length+t.length);return s.set(e),s.set(t,e.length),s}function Vj(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 Qk(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 eA(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 Pj(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 Gj(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 Fj(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 Hj{constructor(t){this.defaultOptions=t}mergeOptions(t){return Mj(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,f,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:{},S=this.makeUrl(t,m),A=t.I.toBinary(s,m.binaryOptions),N=new Qa,j=new Dj,V=!0,C,W=new Qa,ce,ae=new Qa;return y(S,Object.assign(Object.assign({},b),{method:"POST",headers:hS(new globalThis.Headers,g,m.timeout,m.meta),body:pS(A,g),signal:(f=r.abort)!==null&&f!==void 0?f:null})).then(Y=>{let[K,w,O]=Yy(Y);if(N.resolve(O),K!=null&&K!==we.OK)throw new gt(w??we[K],we[K],O);return K!=null&&(C={code:we[K],detail:w??we[K]}),Y}).then(Y=>{if(!Y.body)throw new gt("missing response body",we[we.INTERNAL]);return gS(Y.body,Y.headers.get("content-type"),(K,w)=>{switch(K){case Qs.DATA:j.notifyMessage(t.O.fromBinary(w,m.binaryOptions)),V=!1;break;case Qs.TRAILER:let O,x;[O,x,ce]=mS(w),C={code:we[O],detail:x??we[O]};break}})}).then(()=>{if(!ce&&!V)throw new gt("missing trailers",we[we.DATA_LOSS]);if(!C)throw new gt("missing status",we[we.INTERNAL]);if(C.code!=="OK")throw new gt(C.detail,C.code,ce);j.notifyComplete(),W.resolve(C),ae.resolve(ce||{})}).catch(Y=>{let K;Y instanceof gt?K=Y:Y instanceof Error&&Y.name==="AbortError"?K=new gt(Y.message,we[we.CANCELLED]):K=new gt(Y instanceof Error?Y.message:""+Y,we[we.INTERNAL]),K.methodName=t.name,K.serviceName=t.service.typeName,N.rejectPending(K),j.notifyError(K),W.rejectPending(K),ae.rejectPending(K)}),new Lj(t,(p=m.meta)!==null&&p!==void 0?p:{},s,N.promise,j,W.promise,ae.promise)}unary(t,s,r){var i,c,u,f,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:{},S=this.makeUrl(t,m),A=t.I.toBinary(s,m.binaryOptions),N=new Qa,j,V=new Qa,C,W=new Qa,ce,ae=new Qa;return y(S,Object.assign(Object.assign({},b),{method:"POST",headers:hS(new globalThis.Headers,g,m.timeout,m.meta),body:pS(A,g),signal:(f=r.abort)!==null&&f!==void 0?f:null})).then(Y=>{let[K,w,O]=Yy(Y);if(N.resolve(O),K!=null&&K!==we.OK)throw new gt(w??we[K],we[K],O);return K!=null&&(C={code:we[K],detail:w??we[K]}),Y}).then(Y=>{if(!Y.body)throw new gt("missing response body",we[we.INTERNAL]);return gS(Y.body,Y.headers.get("content-type"),(K,w)=>{switch(K){case Qs.DATA:if(j)throw new gt("unary call received 2nd message",we[we.DATA_LOSS]);j=t.O.fromBinary(w,m.binaryOptions);break;case Qs.TRAILER:let O,x;[O,x,ce]=mS(w),C={code:we[O],detail:x??we[O]};break}})}).then(()=>{if(!ce&&j)throw new gt("missing trailers",we[we.DATA_LOSS]);if(!C)throw new gt("missing status",we[we.INTERNAL]);if(!j&&C.code==="OK")throw new gt("expected error status",we[we.DATA_LOSS]);if(!j)throw new gt(C.detail,C.code,ce);if(V.resolve(j),C.code!=="OK")throw new gt(C.detail,C.code,ce);W.resolve(C),ae.resolve(ce||{})}).catch(Y=>{let K;Y instanceof gt?K=Y:Y instanceof Error&&Y.name==="AbortError"?K=new gt(Y.message,we[we.CANCELLED]):K=new gt(Y instanceof Error?Y.message:""+Y,we[we.INTERNAL]),K.methodName=t.name,K.serviceName=t.service.typeName,N.rejectPending(K),V.rejectPending(K),W.rejectPending(K),ae.rejectPending(K)}),new Kk(t,(p=m.meta)!==null&&p!==void 0?p:{},s,N.promise,V.promise,W.promise,ae.promise)}}const Wy=Symbol.for("@mysten/sui/grpc/decoded-status-message");function qj(e){if(!e.includes("%"))return e;try{return decodeURIComponent(e)}catch{return e}}function tA(e){return Wy in e?!1:(Object.defineProperty(e,Wy,{value:!0,configurable:!0}),!0)}function vS(e){tA(e)&&(e.message=qj(e.message))}function Zj(e){return Wy in e}function Xy(e,t){if(!(typeof e!="object"||e===null))try{return e[t]}catch{return}}function Yj(e){const t=Xy(e,"code");return typeof t=="string"&&typeof we[t]=="number"?t:Xy(e,"name")==="TimeoutError"?we[we.DEADLINE_EXCEEDED]:we[we.CANCELLED]}function Wj(e,t){if(typeof t=="string")return e===t;const s=Xy(t,"message");return typeof s=="string"&&e===s}function nA(e,t){try{Xj(e,t)}catch{}}function Xj(e,t){if(e instanceof gt){if(t?.aborted&&(e.code===we[we.INTERNAL]||e.code===we[we.CANCELLED])){e.code=Yj(t.reason),Wj(e.message,t.reason)?tA(e):vS(e);return}vS(e)}}function bS(e,t){for(const s of e)s.then(void 0,r=>nA(r,t))}var Qv=class extends Hj{constructor(e){super({...e,meta:{[$k]:String(Vk),...e.meta}})}unary(e,t,s){const r=super.unary(e,t,s);return bS([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=>nA(i,s.abort)),bS([r.headers,r.status,r.trailers],s.abort),r}};function Jj(e){return{mergeOptions(t){const s=e.mergeOptions(t);return{...s,meta:{[$k]:String(Vk),...s.meta}}},unary:e.unary.bind(e),serverStreaming:e.serverStreaming.bind(e),clientStreaming:e.clientStreaming.bind(e),duplex:e.duplex.bind(e)}}var Kj=class sA{#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 sA({prefix:[...this.#e,...Array.isArray(t)?t:[t]],cache:this.#t})}},rA=class{constructor({network:e,base:t,cache:s=t?.cache??new Kj}){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 Qj={mainnet:"https://mainnet.mvr.mystenlabs.com",testnet:"https://testnet.mvr.mystenlabs.com"};var e8=class extends rA{constructor(e){super(e),this.core=this,this.mvr=new FR({cache:this.cache.scope("core.mvr"),url:e.mvr?.url??Qj[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=Lc.parseFromStr((await this.core.mvr.resolveType({type:e.name.type,signal:e.signal})).type),s=Rk(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=ws(r.type),c=await r.content,u=i.typeParams[0],f=typeof u!="string"&&u.module==="dynamic_object_field"&&u.name==="Wrapper",p=c.slice(Qc+e.name.bcs.length),m=typeof i.typeParams[1]=="string"?i.typeParams[1]:De(i.typeParams[1]);return{dynamicField:{$kind:f?"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:f?F.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),f=new Promise((b,S)=>{u.addEventListener("abort",()=>S(u.reason))});f.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(S=>setTimeout(S,b)),f])}else await Promise.race([new Promise(b=>setTimeout(b,y)),f]);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 t8=new Intl.PluralRules("en-US",{type:"ordinal"}),n8=new Map([["one","st"],["two","nd"],["few","rd"],["other","th"]]);function s8(e){return`${e}${n8.get(t8.select(e))}`}function aA(e){const{command:t,location:s,abortCode:r,cleverError:i}=e,c=[];if(t!=null?c.push(`MoveAbort in ${s8(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 wS=F.struct("MinimalEffectsWithError",{status:jv}),r8=F.enum("MinimalTransactionEffectsWithError",{V1:wS,V2:wS}),a8=F.enum("MinimalExecutionStatusNoError",{Success:null,Failed:null}),TS=F.struct("MinimalEffectsNoError",{status:a8}),i8=F.enum("MinimalTransactionEffectsNoError",{V1:TS,V2:TS});function ts(e,t){return t!=null&&typeof t!="boolean"?`${e}(${JSON.stringify(t,(s,r)=>typeof r=="bigint"?r.toString():r)})`:e}function eb(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:aA({command:s,location:c,abortCode:String(i)}),command:s,MoveAbort:{abortCode:String(i),location:c}}}case"MoveObjectTooBig":return{$kind:"SizeError",message:ts("MoveObjectTooBig",t.MoveObjectTooBig),command:s,SizeError:{name:"ObjectTooBig",size:Number(t.MoveObjectTooBig.objectSize),maxSize:Number(t.MoveObjectTooBig.maxObjectSize)}};case"MovePackageTooBig":return{$kind:"SizeError",message:ts("MovePackageTooBig",t.MovePackageTooBig),command:s,SizeError:{name:"PackageTooBig",size:Number(t.MovePackageTooBig.objectSize),maxSize:Number(t.MovePackageTooBig.maxObjectSize)}};case"EffectsTooLarge":return{$kind:"SizeError",message:ts("EffectsTooLarge",t.EffectsTooLarge),command:s,SizeError:{name:"EffectsTooLarge",size:Number(t.EffectsTooLarge.currentSize),maxSize:Number(t.EffectsTooLarge.maxSize)}};case"WrittenObjectsTooLarge":return{$kind:"SizeError",message:ts("WrittenObjectsTooLarge",t.WrittenObjectsTooLarge),command:s,SizeError:{name:"WrittenObjectsTooLarge",size:Number(t.WrittenObjectsTooLarge.currentSize),maxSize:Number(t.WrittenObjectsTooLarge.maxSize)}};case"MoveVectorElemTooBig":return{$kind:"SizeError",message:ts("MoveVectorElemTooBig",t.MoveVectorElemTooBig),command:s,SizeError:{name:"MoveVectorElemTooBig",size:Number(t.MoveVectorElemTooBig.valueSize),maxSize:Number(t.MoveVectorElemTooBig.maxScaledSize)}};case"MoveRawValueTooBig":return{$kind:"SizeError",message:ts("MoveRawValueTooBig",t.MoveRawValueTooBig),command:s,SizeError:{name:"MoveRawValueTooBig",size:Number(t.MoveRawValueTooBig.valueSize),maxSize:Number(t.MoveRawValueTooBig.maxScaledSize)}};case"CommandArgumentError":return{$kind:"CommandArgumentError",message:ts("CommandArgumentError",t.CommandArgumentError),command:s,CommandArgumentError:{argument:t.CommandArgumentError.argIdx,name:t.CommandArgumentError.kind.$kind}};case"TypeArgumentError":return{$kind:"TypeArgumentError",message:ts("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:ts("PackageUpgradeError",t.PackageUpgradeError),command:s,PackageUpgradeError:{name:r.$kind,packageId:r.$kind==="UnableToFetchPackage"?r.UnableToFetchPackage.packageId:void 0,digest:r.$kind==="DigestDoesNotMatch"?st(r.DigestDoesNotMatch.digest):void 0}}}case"ExecutionCancelledDueToSharedObjectCongestion":return{$kind:"CongestedObjects",message:ts("ExecutionCancelledDueToSharedObjectCongestion",t.ExecutionCancelledDueToSharedObjectCongestion),command:s,CongestedObjects:{name:"ExecutionCanceledDueToConsensusObjectCongestion",objects:t.ExecutionCancelledDueToSharedObjectCongestion.congested_objects}};case"AddressDeniedForCoin":return{$kind:"CoinDenyListError",message:ts("AddressDeniedForCoin",t.AddressDeniedForCoin),command:s,CoinDenyListError:{name:"AddressDeniedForCoin",address:t.AddressDeniedForCoin.address,coinType:t.AddressDeniedForCoin.coinType}};case"CoinTypeGlobalPause":return{$kind:"CoinDenyListError",message:ts("CoinTypeGlobalPause",t.CoinTypeGlobalPause),command:s,CoinDenyListError:{name:"CoinTypeGlobalPause",coinType:t.CoinTypeGlobalPause.coinType}};case"CircularObjectOwnership":return{$kind:"ObjectIdError",message:ts("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:ts("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 o8(e,t=!1){return(t?Xi.fromKindBytes(e):Xi.fromBytes(e)).snapshot()}function c8(e){try{return F.TransactionData.parse(e).V1?.gasData.payment?.length===0}catch{return!1}}function l8(e){let t=null;try{t=r8.parse(e)}catch{const r=i8.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:eb(s.Failure)}}function u8(e){const t=F.TransactionEffects.parse(e);switch(t.$kind){case"V1":return d8({bytes:e,effects:t.V1});case"V2":return f8({bytes:e,effects:t.V2});default:throw new Error(`Unknown transaction effects version: ${t.$kind}`)}}function d8({bytes:e,effects:t}){const s=new Map(t.modifiedAtVersions),r=new Map(t.sharedObjects.map(b=>[b.objectId,b])),i=(b,S)=>{const A=r.get(b.objectId);return{objectId:b.objectId,inputState:S.inputState,inputVersion:S.inputState==="Exists"?A?.version??s.get(b.objectId)??null:null,inputDigest:S.inputState==="Exists"?A?.digest??null:null,inputOwner:null,outputState:S.outputState,outputVersion:S.outputState==="DoesNotExist"?null:b.version,outputDigest:S.outputState==="DoesNotExist"?null:b.digest,outputOwner:S.outputOwner,idOperation:S.idOperation}},c=(b,S,A)=>b.map(([N,j])=>i(N,{inputState:S,outputState:"ObjectWrite",outputOwner:j,idOperation:A})),u=(b,S,A)=>b.map(N=>i(N,{inputState:S,outputState:"DoesNotExist",outputOwner:null,idOperation:A})),f=[...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=f.find(b=>b.objectId===p)??null,g=new Set(f.map(b=>b.objectId)),y=t.modifiedAtVersions.reduce((b,[,S])=>BigInt(S)>b?BigInt(S):b,0n);return{bcs:e,version:1,status:t.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:eb(t.status.Failure)},gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:m,eventsDigest:t.eventsDigest,dependencies:t.dependencies,lamportVersion:(y+1n).toString(),changedObjects:f,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 f8({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:eb(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 ES=(function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e})({});var h8=class extends Z{constructor(){super("google.protobuf.Struct",[{no:1,name:"fields",kind:"map",K:9,V:{kind:"message",T:()=>fn}}])}internalJsonWrite(e,t){let s={};for(let[r,i]of Object.entries(e.fields))s[r]=fn.toJson(i);return s}internalJsonRead(e,t,s){if(!$h(e))throw new globalThis.Error("Unable to parse message "+this.typeName+" from JSON "+ma(e)+".");s||(s=this.create());for(let[r,i]of globalThis.Object.entries(e))s.fields[r]=fn.fromJson(i);return s}};const SS=new h8;var p8=class extends Z{constructor(){super("google.protobuf.Value",[{no:1,name:"null_value",kind:"enum",oneof:"kind",T:()=>["google.protobuf.NullValue",ES]},{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:()=>SS},{no:6,name:"list_value",kind:"message",oneof:"kind",T:()=>_S}])}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:ES.NULL_VALUE}:globalThis.Array.isArray(e)?s.kind={oneofKind:"listValue",listValue:_S.fromJson(e)}:s.kind={oneofKind:"structValue",structValue:SS.fromJson(e)};break;default:throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+ma(e))}return s}};const fn=new p8;var m8=class extends Z{constructor(){super("google.protobuf.ListValue",[{no:1,name:"values",kind:"message",repeat:2,T:()=>fn}])}internalJsonWrite(e,t){return e.values.map(s=>fn.toJson(s))}internalJsonRead(e,t,s){if(!globalThis.Array.isArray(e))throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+ma(e));s||(s=this.create());let r=e.map(i=>fn.fromJson(i));return s.values.push(...r),s}};const _S=new m8;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})({}),gs=(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})({}),bh=(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})({}),Jy=(function(e){return e[e.REFERENCE_UNKNOWN=0]="REFERENCE_UNKNOWN",e[e.IMMUTABLE=1]="IMMUTABLE",e[e.MUTABLE=2]="MUTABLE",e})({}),_c=(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 y8=class extends Z{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:()=>b8},{no:5,name:"type_origins",kind:"message",repeat:2,T:()=>x8},{no:6,name:"linkage",kind:"message",repeat:2,T:()=>I8}])}};const iA=new y8;var v8=class extends Z{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:()=>oA},{no:4,name:"functions",kind:"message",repeat:2,T:()=>uA}])}};const b8=new v8;var w8=class extends Z{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",_c]},{no:6,name:"type_parameters",kind:"message",repeat:2,T:()=>cA},{no:7,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.DatatypeDescriptor.DatatypeKind",g8]},{no:8,name:"fields",kind:"message",repeat:2,T:()=>lA},{no:9,name:"variants",kind:"message",repeat:2,T:()=>_8}])}};const oA=new w8;var T8=class extends Z{constructor(){super("sui.rpc.v2.TypeParameter",[{no:1,name:"constraints",kind:"enum",repeat:1,T:()=>["sui.rpc.v2.Ability",_c]},{no:2,name:"is_phantom",kind:"scalar",opt:!0,T:8}])}};const cA=new T8;var E8=class extends Z{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:()=>tb}])}};const lA=new E8;var S8=class extends Z{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:()=>lA}])}};const _8=new S8;var k8=class extends Z{constructor(){super("sui.rpc.v2.OpenSignatureBody",[{no:1,name:"type",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.OpenSignatureBody.Type",gs]},{no:2,name:"type_name",kind:"scalar",opt:!0,T:9},{no:3,name:"type_parameter_instantiation",kind:"message",repeat:2,T:()=>tb},{no:4,name:"type_parameter",kind:"scalar",opt:!0,T:13}])}};const tb=new k8;var A8=class extends Z{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",bh]},{no:6,name:"is_entry",kind:"scalar",opt:!0,T:8},{no:7,name:"type_parameters",kind:"message",repeat:2,T:()=>cA},{no:8,name:"parameters",kind:"message",repeat:2,T:()=>kS},{no:9,name:"returns",kind:"message",repeat:2,T:()=>kS}])}};const uA=new A8;var O8=class extends Z{constructor(){super("sui.rpc.v2.OpenSignature",[{no:1,name:"reference",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.OpenSignature.Reference",Jy]},{no:2,name:"body",kind:"message",T:()=>tb}])}};const kS=new O8;var N8=class extends Z{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 x8=new N8;var C8=class extends Z{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 I8=new C8;let vc=(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 R8=class extends Z{constructor(){super("sui.rpc.v2.Owner",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Owner.OwnerKind",vc]},{no:2,name:"address",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const Ky=new R8;let ii=(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 j8=class extends Z{constructor(){super("sui.rpc.v2.Argument",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Argument.ArgumentKind",ii]},{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 Ar=new j8;let Ks=(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})({}),M8=(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})({}),kc=(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 D8=class extends Z{constructor(){super("sui.rpc.v2.Input",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Input.InputKind",Ks]},{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",M8]},{no:8,name:"funds_withdrawal",kind:"message",T:()=>L8},{no:1e3,name:"literal",kind:"message",T:()=>fn}])}};const U8=new D8;var B8=class extends Z{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",kc]},{no:4,name:"funder",kind:"scalar",opt:!0,T:9},{no:5,name:"allowance",kind:"scalar",opt:!0,T:9}])}};const L8=new B8;var z8=class extends Z{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=At.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 "+ma(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,f=At.from(i+c);if(f.toNumber()>315576e6||f.toNumber()<-315576e6)throw new Error("Unable to parse Duration from JSON string. Value out of range.");if(s.seconds=f.toBigInt(),typeof u=="string"){let p=i+u+"0".repeat(9-u.length);s.nanos=parseInt(p)}return s}};const $8=new z8;var V8=class extends Z{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 dA=new V8;var P8=class extends Z{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 G8=new P8;var F8=class extends Z{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 Ts=new F8;var H8=class extends Z{constructor(){super("sui.rpc.v2.Object",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{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:()=>Ky},{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:()=>Ts},{no:9,name:"package",kind:"message",T:()=>iA},{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:()=>fn},{no:101,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:102,name:"display",kind:"message",T:()=>Y8}])}};const uo=new H8;var q8=class extends Z{constructor(){super("sui.rpc.v2.ObjectSet",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>uo}])}};const fA=new q8;var Z8=class extends Z{constructor(){super("sui.rpc.v2.Display",[{no:1,name:"output",kind:"message",T:()=>fn},{no:2,name:"errors",kind:"message",T:()=>fn}])}};const Y8=new Z8;var W8=class extends Z{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=At.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(At.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){const t=this.create(),s=e.getTime();return t.seconds=At.from(Math.floor(s/1e3)).toBigInt(),t.nanos=(s%1e3+(s<0&&s%1e3!==0?1e3:0))*1e6,t}internalJsonWrite(e,t){let s=At.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 "+ma(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=At.from(i/1e3).toBigInt(),s.nanos=0,r[7]&&(s.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),s}};const Or=new W8;var X8=class extends Z{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 hA=new X8;let ca=(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})({}),J8=(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})({}),K8=(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})({}),Q8=(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 eM=class extends Z{constructor(){super("sui.rpc.v2.Transaction",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{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:()=>cM},{no:5,name:"sender",kind:"scalar",opt:!0,T:9},{no:6,name:"gas_payment",kind:"message",T:()=>nM},{no:7,name:"expiration",kind:"message",T:()=>rM}])}};const nb=new eM;var tM=class extends Z{constructor(){super("sui.rpc.v2.GasPayment",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>hA},{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 nM=new tM;var sM=class extends Z{constructor(){super("sui.rpc.v2.TransactionExpiration",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TransactionExpiration.TransactionExpirationKind",ca]},{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:()=>Or},{no:5,name:"max_timestamp",kind:"message",T:()=>Or},{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:()=>iM}])}};const rM=new sM;var aM=class extends Z{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 iM=new aM;var oM=class extends Z{constructor(){super("sui.rpc.v2.TransactionKind",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TransactionKind.Kind",J8]},{no:2,name:"programmable_transaction",kind:"message",oneof:"data",T:()=>uM},{no:3,name:"change_epoch",kind:"message",oneof:"data",T:()=>mA},{no:4,name:"genesis",kind:"message",oneof:"data",T:()=>RM},{no:5,name:"consensus_commit_prologue",kind:"message",oneof:"data",T:()=>MM},{no:6,name:"authenticator_state_update",kind:"message",oneof:"data",T:()=>PM},{no:7,name:"end_of_epoch",kind:"message",oneof:"data",T:()=>HM},{no:8,name:"randomness_state_update",kind:"message",oneof:"data",T:()=>OM}])}};const cM=new oM;var lM=class extends Z{constructor(){super("sui.rpc.v2.ProgrammableTransaction",[{no:1,name:"inputs",kind:"message",repeat:2,T:()=>U8},{no:2,name:"commands",kind:"message",repeat:2,T:()=>fM}])}};const uM=new lM;var dM=class extends Z{constructor(){super("sui.rpc.v2.Command",[{no:1,name:"move_call",kind:"message",oneof:"command",T:()=>pA},{no:2,name:"transfer_objects",kind:"message",oneof:"command",T:()=>mM},{no:3,name:"split_coins",kind:"message",oneof:"command",T:()=>yM},{no:4,name:"merge_coins",kind:"message",oneof:"command",T:()=>bM},{no:5,name:"publish",kind:"message",oneof:"command",T:()=>TM},{no:6,name:"make_move_vector",kind:"message",oneof:"command",T:()=>SM},{no:7,name:"upgrade",kind:"message",oneof:"command",T:()=>kM}])}};const fM=new dM;var hM=class extends Z{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:()=>Ar}])}};const pA=new hM;var pM=class extends Z{constructor(){super("sui.rpc.v2.TransferObjects",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>Ar},{no:2,name:"address",kind:"message",T:()=>Ar}])}};const mM=new pM;var gM=class extends Z{constructor(){super("sui.rpc.v2.SplitCoins",[{no:1,name:"coin",kind:"message",T:()=>Ar},{no:2,name:"amounts",kind:"message",repeat:2,T:()=>Ar}])}};const yM=new gM;var vM=class extends Z{constructor(){super("sui.rpc.v2.MergeCoins",[{no:1,name:"coin",kind:"message",T:()=>Ar},{no:2,name:"coins_to_merge",kind:"message",repeat:2,T:()=>Ar}])}};const bM=new vM;var wM=class extends Z{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 TM=new wM;var EM=class extends Z{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:()=>Ar}])}};const SM=new EM;var _M=class extends Z{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:()=>Ar}])}};const kM=new _M;var AM=class extends Z{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 OM=new AM;var NM=class extends Z{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:()=>Or},{no:8,name:"system_packages",kind:"message",repeat:2,T:()=>CM}])}};const mA=new NM;var xM=class extends Z{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 CM=new xM;var IM=class extends Z{constructor(){super("sui.rpc.v2.GenesisTransaction",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>uo}])}};const RM=new IM;var jM=class extends Z{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:()=>Or},{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:()=>$M},{no:7,name:"additional_state_digest",kind:"scalar",opt:!0,T:9}])}};const MM=new jM;var DM=class extends Z{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 UM=new DM;var BM=class extends Z{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:()=>UM}])}};const LM=new BM;var zM=class extends Z{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:()=>LM}])}};const $M=new zM;var VM=class extends Z{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:()=>gA},{no:4,name:"authenticator_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const PM=new VM;var GM=class extends Z{constructor(){super("sui.rpc.v2.ActiveJwk",[{no:1,name:"id",kind:"message",T:()=>dA},{no:2,name:"jwk",kind:"message",T:()=>G8},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0}])}};const gA=new GM;var FM=class extends Z{constructor(){super("sui.rpc.v2.EndOfEpochTransaction",[{no:1,name:"transactions",kind:"message",repeat:2,T:()=>ZM}])}};const HM=new FM;var qM=class extends Z{constructor(){super("sui.rpc.v2.EndOfEpochTransactionKind",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.EndOfEpochTransactionKind.Kind",K8]},{no:2,name:"change_epoch",kind:"message",oneof:"data",T:()=>mA},{no:3,name:"authenticator_state_expire",kind:"message",oneof:"data",T:()=>WM},{no:4,name:"execution_time_observations",kind:"message",oneof:"data",T:()=>JM},{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 ZM=new qM;var YM=class extends Z{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 WM=new YM;var XM=class extends Z{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:()=>QM}])}};const JM=new XM;var KM=class extends Z{constructor(){super("sui.rpc.v2.ExecutionTimeObservation",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ExecutionTimeObservation.ExecutionTimeObservationKind",Q8]},{no:2,name:"move_entry_point",kind:"message",T:()=>pA},{no:3,name:"validator_observations",kind:"message",repeat:2,T:()=>t9}])}};const QM=new KM;var e9=class extends Z{constructor(){super("sui.rpc.v2.ValidatorExecutionTimeObservation",[{no:1,name:"validator",kind:"scalar",opt:!0,T:12},{no:2,name:"duration",kind:"message",T:()=>$8}])}};const t9=new e9;function AS(e){const t=BigInt(e);return{seconds:t/1000n,nanos:Number(t%1000n)*1e6}}function qf(e){return(e.seconds*1000n+BigInt(Math.floor(e.nanos/1e6))).toString()}function n9(e){switch(e.$kind){case"Pure":return{kind:Ks.PURE,pure:qe(e.Pure.bytes)};case"Object":if(e.Object.$kind==="ImmOrOwnedObject")return{kind:Ks.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:Ks.SHARED,objectId:e.Object.SharedObject.objectId,version:BigInt(e.Object.SharedObject.initialSharedVersion),mutable:e.Object.SharedObject.mutable};if(e.Object.$kind==="Receiving")return{kind:Ks.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:Ks.FUNDS_WITHDRAWAL,fundsWithdrawal:{amount:s.reservation.$kind==="MaxAmountU64"?BigInt(s.reservation.MaxAmountU64):void 0,coinType:s.typeArg.$kind==="Balance"?s.typeArg.Balance:void 0,...s9(s.withdrawFrom)}}}default:throw new Error(`Unknown CallArg kind: ${JSON.stringify(e)}`)}}function s9(e){switch(e.$kind){case"Sender":return{source:kc.SENDER};case"Sponsor":return{source:kc.SPONSOR};case"SenderAllowance":return{source:kc.SENDER_ALLOWANCE,funder:e.SenderAllowance.funder,allowance:e.SenderAllowance.allowance};default:throw new Error(`Unknown WithdrawFrom kind: ${JSON.stringify(e)}`)}}function r9(e){switch(e?.source){case kc.SPONSOR:return{$kind:"Sponsor",Sponsor:!0};case kc.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:ii.GAS};if("Input"in e)return{kind:ii.INPUT,input:e.Input};if("Result"in e)return{kind:ii.RESULT,result:e.Result};if("NestedResult"in e)return{kind:ii.RESULT,result:e.NestedResult[0],subresult:e.NestedResult[1]};throw new Error(`Unknown Argument: ${JSON.stringify(e)}`)}function a9(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=>qe(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=>qe(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 yA(e){const t={version:1,kind:{data:{oneofKind:"programmableTransaction",programmableTransaction:{inputs:e.inputs.map(n9),commands:e.commands.map(a9)}}}};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:ca.NONE};else if(e.expiration.$kind==="Epoch")t.expiration={kind:ca.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"?ca.VALID_DURING:ca.VALIDITY,minEpoch:r.minEpoch!=null?BigInt(r.minEpoch):void 0,epoch:r.maxEpoch!=null?BigInt(r.maxEpoch):void 0,minTimestamp:r.minTimestamp!=null?AS(r.minTimestamp):void 0,maxTimestamp:r.maxTimestamp!=null?AS(r.maxTimestamp):void 0,chain:r.chain,nonce:r.nonce,allowedProposers:i?{epoch:BigInt(i.epoch),proposers:P4(i.proposers)}:void 0}}}return t}function i9(e,t,s){const r=vA(t);s?.onlyTransactionKind?e.applyResolvedData({...r,sender:null,gasData:{budget:null,owner:null,payment:null,price:null},expiration:null}):e.applyResolvedData(r)}function o9(e){const t=e.getData();return t.sender||(t.sender="0x0000000000000000000000000000000000000000000000000000000000000000"),yA(t)}function c9(e){switch(e.kind){case Ks.PURE:return{$kind:"Pure",Pure:{bytes:st(e.pure)}};case Ks.IMMUTABLE_OR_OWNED:return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{objectId:e.objectId,version:e.version.toString(),digest:e.digest}}};case Ks.SHARED:return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{objectId:e.objectId,initialSharedVersion:e.version.toString(),mutable:e.mutable??!1}}};case Ks.RECEIVING:return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{objectId:e.objectId,version:e.version.toString(),digest:e.digest}}};case Ks.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:r9(e.fundsWithdrawal)}};default:throw new Error(`Unknown Input kind: ${JSON.stringify(e)}`)}}function Kr(e){switch(e.kind){case ii.GAS:return{$kind:"GasCoin",GasCoin:!0};case ii.INPUT:return{$kind:"Input",Input:e.input};case ii.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 l9(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(Kr)}};case"transferObjects":return{$kind:"TransferObjects",TransferObjects:{objects:t.transferObjects.objects.map(Kr),address:Kr(t.transferObjects.address)}};case"splitCoins":return{$kind:"SplitCoins",SplitCoins:{coin:Kr(t.splitCoins.coin),amounts:t.splitCoins.amounts.map(Kr)}};case"mergeCoins":return{$kind:"MergeCoins",MergeCoins:{destination:Kr(t.mergeCoins.coin),sources:t.mergeCoins.coinsToMerge.map(Kr)}};case"publish":return{$kind:"Publish",Publish:{modules:t.publish.modules.map(s=>st(s)),dependencies:t.publish.dependencies??[]}};case"makeMoveVector":return{$kind:"MakeMoveVec",MakeMoveVec:{type:t.makeMoveVector.elementType??null,elements:t.makeMoveVector.elements.map(Kr)}};case"upgrade":return{$kind:"Upgrade",Upgrade:{modules:t.upgrade.modules.map(s=>st(s)),dependencies:t.upgrade.dependencies??[],package:t.upgrade.package,ticket:Kr(t.upgrade.ticket)}};default:throw new Error(`Unknown Command kind: ${JSON.stringify(t)}`)}}function vA(e){const t=e.kind?.data;if(t?.oneofKind!=="programmableTransaction")throw new Error("Only programmable transactions are supported");const s=t.programmableTransaction.inputs.map(c9),r=t.programmableTransaction.commands.map(l9);let i=null;if(e.expiration)switch(e.expiration.kind){case ca.NONE:i={$kind:"None",None:!0};break;case ca.EPOCH:i={$kind:"Epoch",Epoch:e.expiration.epoch.toString()};break;case ca.VALID_DURING:i={$kind:"ValidDuring",ValidDuring:{minEpoch:e.expiration.minEpoch?.toString()??null,maxEpoch:e.expiration.epoch?.toString()??null,minTimestamp:e.expiration.minTimestamp?qf(e.expiration.minTimestamp):null,maxTimestamp:e.expiration.maxTimestamp?qf(e.expiration.maxTimestamp):null,chain:e.expiration.chain??"",nonce:e.expiration.nonce??0}};break;case ca.VALIDITY:i={$kind:"Validity",Validity:{minEpoch:e.expiration.minEpoch?.toString()??null,maxEpoch:e.expiration.epoch?.toString()??null,minTimestamp:e.expiration.minTimestamp?qf(e.expiration.minTimestamp):null,maxTimestamp:e.expiration.maxTimestamp?qf(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:Cv(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 u9({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},f]=await Promise.all([t.core.getChainIdentifier(),s==null?t.core.getCurrentSystemState():null]),p=BigInt(s??f.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 d9=(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})({}),bA=(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})({}),f9=(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})({}),h9=(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 p9=class extends Z{constructor(){super("sui.rpc.v2.ExecutionStatus",[{no:1,name:"success",kind:"scalar",opt:!0,T:8},{no:2,name:"error",kind:"message",T:()=>y9}])}};const m9=new p9;var g9=class extends Z{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",d9]},{no:4,name:"abort",kind:"message",oneof:"errorDetails",T:()=>b9},{no:5,name:"size_error",kind:"message",oneof:"errorDetails",T:()=>k9},{no:6,name:"command_argument_error",kind:"message",oneof:"errorDetails",T:()=>R9},{no:7,name:"type_argument_error",kind:"message",oneof:"errorDetails",T:()=>U9},{no:8,name:"package_upgrade_error",kind:"message",oneof:"errorDetails",T:()=>M9},{no:9,name:"index_error",kind:"message",oneof:"errorDetails",T:()=>wA},{no:10,name:"object_id",kind:"scalar",oneof:"errorDetails",T:9},{no:11,name:"coin_deny_list_error",kind:"message",oneof:"errorDetails",T:()=>N9},{no:12,name:"congested_objects",kind:"message",oneof:"errorDetails",T:()=>C9}])}};const y9=new g9;var v9=class extends Z{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:()=>T9},{no:3,name:"clever_error",kind:"message",T:()=>S9}])}};const b9=new v9;var w9=class extends Z{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 T9=new w9;var E9=class extends Z{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 S9=new E9;var _9=class extends Z{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 k9=new _9;var A9=class extends Z{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 wA=new A9;var O9=class extends Z{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 N9=new O9;var x9=class extends Z{constructor(){super("sui.rpc.v2.CongestedObjects",[{no:1,name:"objects",kind:"scalar",repeat:2,T:9}])}};const C9=new x9;var I9=class extends Z{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",bA]},{no:3,name:"index_error",kind:"message",T:()=>wA}])}};const R9=new I9;var j9=class extends Z{constructor(){super("sui.rpc.v2.PackageUpgradeError",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.PackageUpgradeError.PackageUpgradeErrorKind",f9]},{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 M9=new j9;var D9=class extends Z{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",h9]}])}};const U9=new D9;var B9=class extends Z{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 TA=new B9;let wh=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.DOES_NOT_EXIST=1]="DOES_NOT_EXIST",e[e.EXISTS=2]="EXISTS",e})({}),bc=(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})({}),bu=(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})({}),L9=(function(e){return e[e.ACCUMULATOR_OPERATION_UNKNOWN=0]="ACCUMULATOR_OPERATION_UNKNOWN",e[e.MERGE=1]="MERGE",e[e.SPLIT=2]="SPLIT",e})({}),z9=(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})({}),Wi=(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 $9=class extends Z{constructor(){super("sui.rpc.v2.TransactionEffects",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{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:()=>m9},{no:5,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"gas_used",kind:"message",T:()=>TA},{no:7,name:"transaction_digest",kind:"scalar",opt:!0,T:9},{no:8,name:"gas_object",kind:"message",T:()=>OS},{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:()=>OS},{no:13,name:"unchanged_consensus_objects",kind:"message",repeat:2,T:()=>Y9},{no:14,name:"auxiliary_data_digest",kind:"scalar",opt:!0,T:9},{no:15,name:"unchanged_loaded_runtime_objects",kind:"message",repeat:2,T:()=>hA}])}};const V9=new $9;var P9=class extends Z{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",wh,"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:()=>Ky},{no:6,name:"output_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.OutputObjectState",bc,"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:()=>Ky},{no:12,name:"accumulator_write",kind:"message",T:()=>q9},{no:10,name:"id_operation",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.IdOperation",bu]},{no:11,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const OS=new P9;var G9=class extends Z{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 F9=new G9;var H9=class extends Z{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",L9]},{no:4,name:"value_kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.AccumulatorWrite.AccumulatorValue",z9]},{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:()=>F9}])}};const q9=new H9;var Z9=class extends Z{constructor(){super("sui.rpc.v2.UnchangedConsensusObject",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.UnchangedConsensusObject.UnchangedConsensusObjectKind",Wi]},{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 Y9=new Z9,W9=50;function NS(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??W9}}function X9(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 J9(e,t,s){if(EA(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 K9(e,t,s){if(EA(t,["sender","emitModule","eventType"],"event"),t.sender!=null)return{$kind:"sender",sender:ye(t.sender)};if(t.emitModule!=null){const[c,u,...f]=t.emitModule.split("::");if(!c||!u||f.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 EA(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 Q9=class extends Z{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 eD=new Q9;var tD=class extends Z{constructor(){super("sui.rpc.v2.TransactionEvents",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"events",kind:"message",repeat:2,T:()=>sb}])}};const nD=new tD;var sD=class extends Z{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:()=>Ts},{no:6,name:"json",kind:"message",T:()=>fn},{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 sb=new sD;let Np=(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 rD=class extends Z{constructor(){super("sui.rpc.v2.UserSignature",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:3,name:"simple",kind:"message",oneof:"signature",T:()=>rb},{no:4,name:"multisig",kind:"message",oneof:"signature",T:()=>pD},{no:5,name:"zklogin",kind:"message",oneof:"signature",T:()=>_A},{no:6,name:"passkey",kind:"message",oneof:"signature",T:()=>kA}])}};const xp=new rD;var aD=class extends Z{constructor(){super("sui.rpc.v2.SimpleSignature",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"public_key",kind:"scalar",opt:!0,T:12}])}};const rb=new aD;var iD=class extends Z{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 SA=new iD;var oD=class extends Z{constructor(){super("sui.rpc.v2.MultisigMemberPublicKey",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:2,name:"public_key",kind:"scalar",opt:!0,T:12},{no:3,name:"zklogin",kind:"message",T:()=>SA}])}};const cD=new oD;var lD=class extends Z{constructor(){super("sui.rpc.v2.MultisigMember",[{no:1,name:"public_key",kind:"message",T:()=>cD},{no:2,name:"weight",kind:"scalar",opt:!0,T:13}])}};const uD=new lD;var dD=class extends Z{constructor(){super("sui.rpc.v2.MultisigCommittee",[{no:1,name:"members",kind:"message",repeat:2,T:()=>uD},{no:2,name:"threshold",kind:"scalar",opt:!0,T:13}])}};const fD=new dD;var hD=class extends Z{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:()=>fD}])}};const pD=new hD;var mD=class extends Z{constructor(){super("sui.rpc.v2.MultisigMemberSignature",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"zklogin",kind:"message",T:()=>_A},{no:4,name:"passkey",kind:"message",T:()=>kA}])}};const gD=new mD;var yD=class extends Z{constructor(){super("sui.rpc.v2.ZkLoginAuthenticator",[{no:1,name:"inputs",kind:"message",T:()=>bD},{no:2,name:"max_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"signature",kind:"message",T:()=>rb},{no:4,name:"public_identifier",kind:"message",T:()=>SA},{no:5,name:"jwk_id",kind:"message",T:()=>dA}])}};const _A=new yD;var vD=class extends Z{constructor(){super("sui.rpc.v2.ZkLoginInputs",[{no:1,name:"proof_points",kind:"message",T:()=>TD},{no:2,name:"iss_base64_details",kind:"message",T:()=>SD},{no:3,name:"header_base64",kind:"scalar",opt:!0,T:9},{no:4,name:"address_seed",kind:"scalar",opt:!0,T:9}])}};const bD=new vD;var wD=class extends Z{constructor(){super("sui.rpc.v2.ZkLoginProof",[{no:1,name:"a",kind:"message",T:()=>xS},{no:2,name:"b",kind:"message",T:()=>AD},{no:3,name:"c",kind:"message",T:()=>xS}])}};const TD=new wD;var ED=class extends Z{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 SD=new ED;var _D=class extends Z{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 xS=new _D;var kD=class extends Z{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 AD=new kD;var OD=class extends Z{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:()=>rb}])}};const kA=new OD;var ND=class extends Z{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:()=>AA}])}};const xD=new ND;var CD=class extends Z{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 AA=new CD;var ID=class extends Z{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 RD=new ID;var jD=class extends Z{constructor(){super("sui.rpc.v2.ExecutedTransaction",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"transaction",kind:"message",T:()=>nb},{no:3,name:"signatures",kind:"message",repeat:2,T:()=>xp},{no:4,name:"effects",kind:"message",T:()=>V9},{no:5,name:"events",kind:"message",T:()=>nD},{no:6,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"timestamp",kind:"message",T:()=>Or},{no:8,name:"balance_changes",kind:"message",repeat:2,T:()=>eD},{no:9,name:"objects",kind:"message",T:()=>fA},{no:10,name:"transaction_index",kind:"scalar",opt:!0,T:4,L:0}])}};const ha=new jD;var MD=class extends Z{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 Fh(r)}).join(",")}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse FieldMask from JSON "+ma(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 Bn=new MD;let wu=(function(e){return e[e.ENABLED=0]="ENABLED",e[e.DISABLED=1]="DISABLED",e})({});var DD=class extends Z{constructor(){super("sui.rpc.v2.ExecuteTransactionRequest",[{no:1,name:"transaction",kind:"message",T:()=>nb},{no:2,name:"signatures",kind:"message",repeat:2,T:()=>xp},{no:3,name:"read_mask",kind:"message",T:()=>Bn}])}};const UD=new DD;var BD=class extends Z{constructor(){super("sui.rpc.v2.ExecuteTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha}])}};const LD=new BD;var zD=class extends Z{constructor(){super("sui.rpc.v2.SimulateTransactionRequest",[{no:1,name:"transaction",kind:"message",T:()=>nb},{no:2,name:"read_mask",kind:"message",T:()=>Bn},{no:3,name:"checks",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SimulateTransactionRequest.TransactionChecks",wu]},{no:4,name:"do_gas_selection",kind:"scalar",opt:!0,T:8}])}};const $D=new zD;var VD=class extends Z{constructor(){super("sui.rpc.v2.SimulateTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha},{no:2,name:"command_outputs",kind:"message",repeat:2,T:()=>GD},{no:3,name:"suggested_gas_price",kind:"scalar",opt:!0,T:4,L:0}])}};const OA=new VD;var PD=class extends Z{constructor(){super("sui.rpc.v2.CommandResult",[{no:1,name:"return_values",kind:"message",repeat:2,T:()=>CS},{no:2,name:"mutated_by_ref",kind:"message",repeat:2,T:()=>CS}])}};const GD=new PD;var FD=class extends Z{constructor(){super("sui.rpc.v2.CommandOutput",[{no:1,name:"argument",kind:"message",T:()=>Ar},{no:2,name:"value",kind:"message",T:()=>Ts},{no:3,name:"json",kind:"message",T:()=>fn}])}};const CS=new FD,G0=new gi("sui.rpc.v2.TransactionExecutionService",[{name:"ExecuteTransaction",options:{},I:UD,O:LD},{name:"SimulateTransaction",options:{},I:$D,O:OA}]);let Qy=(function(e){return e[e.ASCENDING=0]="ASCENDING",e[e.DESCENDING=1]="DESCENDING",e})({}),Tu=(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 HD=class extends Z{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",Qy,"ORDERING_"]}])}};const ab=new HD;var qD=class extends Z{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 sd=new qD;var ZD=class extends Z{constructor(){super("sui.rpc.v2.QueryEnd",[{no:1,name:"reason",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.QueryEndReason",Tu,"QUERY_END_REASON_"]}])}};const ib=new ZD;function YD(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 WD(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 XD(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:!Zj(e)&&s==="name%20has%20expired"}var JD=class extends e8{#e;constructor({client:e,...t}){super(t),this.#e=e}async getObjects(e){const t=Rh(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,f)=>{if(u.result.oneofKind==="error"){const A=u.result.error;return A.code===we.NOT_FOUND?new lh("notExists",A.message,{cause:A,reason:"notFound",objectId:i[f]}):new lh(we[A.code]??"unknown",A.message,{cause:A,reason:"unknown",objectId:i[f]})}if(u.result.oneofKind!=="object")return new lh("unknown","Unexpected result type",{reason:"unknown",objectId:i[f]});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?fn.toJson(u.result.object.json):null:void 0,S=RS(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:Ji(u.result.object.owner),type:y,previousTransaction:u.result.object.previousTransaction??void 0,objectBcs:m,json:b,display:S}}))}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?qe(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:Ji(r.owner),type:r.objectType,previousTransaction:r.previousTransaction??void 0,objectBcs:r.bcs?.value,json:e.include?.json?r.json?fn.toJson(r.json):null:void 0,display:RS(e.include?.display,r.display)})),cursor:s.response.nextPageToken?st(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??Uh,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?qe(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:Ji(i.owner),type:i.objectType,balance:i.balance?.toString()})),cursor:r.response.nextPageToken?st(r.response.nextPageToken):null,hasNextPage:r.response.nextPageToken!==void 0}}async getBalance(e){const t=e.coinType??Uh,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?qe(e.cursor):void 0,pageSize:e.limit},{abort:e.signal});return{hasNextPage:!!t.response.nextPageToken,cursor:t.response.nextPageToken?st(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:Zf(e.include)}},{abort:e.signal});if(!t.transaction)throw new WE("notFound",e.digest);return F0(Th(t.transaction,{include:e.include}),e.include,()=>ha.toJson(t.transaction))}catch(t){throw t instanceof gt&&t.code===we[we.NOT_FOUND]?new WE("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:qe(s)},signature:{oneofKind:void 0}})),readMask:{paths:Zf(e.include)}},{abort:e.signal});return F0(Th(t.transaction,{include:e.include}),e.include,()=>ha.toJson(t.transaction))}async simulateTransaction(e){const t=Zf(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?c8(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}}:o9(e.transaction),readMask:{paths:t},doGasSelection:s,checks:e.checksEnabled===!1?wu.DISABLED:wu.ENABLED},{abort:e.signal});return F0(tU(r,{include:e.include}),e.include,()=>OA.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=Zf(e.include),s=e.filter?await J9(this.mvr,e.filter,e.signal):void 0,r=NS(e);X9(s,r);const i=this.#e.ledgerService.listTransactions({readMask:{paths:t},filter:s&&YD(s),options:IS(r,r.limit+1)},{abort:e.signal}),c=[];let u=null,f=null,p=null,m,g=!1;for await(const b of i.responses)b.watermark?.cursor&&(p=st(b.watermark.cursor)),b.transaction&&(c.length>=r.limit?g=!0:(u??=p,f=p,c.push(Th(b.transaction,{include:e.include})))),b.end&&(m=b.end);const y=g||m?.reason===Tu.SCAN_LIMIT||m?.reason===Tu.ITEM_LIMIT;return{transactions:c,hasNextPage:y,startCursor:u,endCursor:g?f:y?p??f:f}}async listEvents(e){const t=NS(e),s=this.#e.ledgerService.listEvents({readMask:{paths:["package_id","module","sender","event_type","contents","json","checkpoint","transaction_digest","event_index"]},filter:e.filter?WD(await K9(this.mvr,e.filter,e.signal)):void 0,options:IS(t,t.limit+1)},{abort:e.signal}),r=[];let i=null,c=null,u=null,f,p=!1;for await(const g of s.responses){if(g.watermark?.cursor&&(u=st(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?fn.toJson(y.json):null,checkpoint:y.checkpoint?.toString()??null,transactionDigest:y.transactionDigest,eventIndex:y.eventIndex})}g.end&&(f=g.end)}const m=p||f?.reason===Tu.SCAN_LIMIT||f?.reason===Tu.ITEM_LIMIT;return{events:r,hasNextPage:m,startCursor:i,endCursor:p?c:m?u??c:c}}async verifyZkLoginSignature(e){const t=qe(e.bytes),s=e.intentScope==="PersonalMessage"?F.byteVector().serialize(t).toBytes():t,{response:r}=await this.#e.signatureVerificationService.verifySignature({message:{name:e.intentScope,value:s},signature:{bcs:{value:qe(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(XD(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 bh.PUBLIC:r="public";break;case bh.PRIVATE:r="private";break;case bh.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 _c.COPY:return"copy";case _c.DROP:return"drop";case _c.STORE:return"store";case _c.KEY:return"key";default:return"unknown"}})??[]}))??[],parameters:s.function?.parameters?.map(i=>US(i))??[],returns:s.function?.returns?.map(i=>US(i))??[]}}}async getChainIdentifier(e){return ch(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=yA(c),f=!r.onlyTransactionKind&&(c.gasData.budget==null||c.gasData.payment==null);let p;try{p=(await e.transactionExecutionService.simulateTransaction({transaction:u,doGasSelection:f,checks:r.onlyTransactionKind?wu.DISABLED:wu.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 Vy(m.message,{cause:m}):m}if(!r.onlyTransactionKind&&p.transaction?.effects?.status&&!p.transaction.effects.status.success){const m=p.transaction.effects.status.error?ob(p.transaction.effects.status.error):void 0;throw new Vy(`Transaction resolution failed: ${m?.message??"Transaction failed"}`,{executionError:m})}if(!p.transaction?.transaction)throw new Error("simulateTransaction did not return resolved transaction data");return i9(s,p.transaction.transaction,r),await u9({transactionData:s,client:e,epoch:p.transaction.effects?.epoch,originalTransactionData:c,isTransactionKindOnly:!!r.onlyTransactionKind,doGasSelection:f}),await i()}}};function IS(e,t){return{limit:t,ordering:e.descending?Qy.DESCENDING:Qy.ASCENDING,after:e.after?qe(e.after):void 0,before:e.before?qe(e.before):void 0}}function Zf(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 F0(e,t,s){return t?.protoJson?{...e,protoJson:s()}:e}function RS(e,t){if(e)return t===void 0?null:{output:t.output!==void 0?fn.toJson(t.output):null,errors:t.errors!==void 0?fn.toJson(t.errors):null}}function Ji(e){if(!e)return null;if(e.kind===vc.IMMUTABLE)return{$kind:"Immutable",Immutable:!0};if(e.kind===vc.ADDRESS)return{AddressOwner:e.address,$kind:"AddressOwner"};if(e.kind===vc.OBJECT)return{$kind:"ObjectOwner",ObjectOwner:e.address};if(e.kind===vc.SHARED)return{$kind:"Shared",Shared:{initialSharedVersion:e.version?.toString()}};if(e.kind===vc.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 ob(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:aA({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:KD(i)}}case"sizeError":return{$kind:"SizeError",message:t,command:s,SizeError:{name:Gi(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:Gi(r.commandArgumentError.kind)}};case"typeArgumentError":return{$kind:"TypeArgumentError",message:t,command:s,TypeArgumentError:{typeArgument:r.typeArgumentError.typeArgument??0,name:Gi(r.typeArgumentError.kind)}};case"packageUpgradeError":return{$kind:"PackageUpgradeError",message:t,command:s,PackageUpgradeError:{name:Gi(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:Gi(e.kind),coinType:r.coinDenyListError.coinType,address:r.coinDenyListError.address}};case"congestedObjects":return{$kind:"CongestedObjects",message:t,command:s,CongestedObjects:{name:Gi(e.kind),objects:r.congestedObjects.objects}};case"objectId":return{$kind:"ObjectIdError",message:t,command:s,ObjectIdError:{name:Gi(e.kind),objectId:r.objectId}};default:return{$kind:"Unknown",message:t,command:s,Unknown:null}}}function KD(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"?st(e.cleverError.value.raw):void 0}:void 0}}function Gi(e){if(e==null)return"Unknown";const t=bA[e];return!t||t.endsWith("_UNKNOWN")?"Unknown":t.split("_").map(s=>s.charAt(0)+s.slice(1).toLowerCase()).join("")}function jS(e){if(e==null)return null;switch(e){case bu.CREATED:return"Created";case bu.DELETED:return"Deleted";case bu.NONE:case bu.ID_OPERATION_UNKNOWN:return"None";default:return"Unknown"}}function MS(e){if(e==null)return null;switch(e){case wh.EXISTS:return"Exists";case wh.DOES_NOT_EXIST:return"DoesNotExist";case wh.UNKNOWN:return"Unknown";default:return"Unknown"}}function DS(e){if(e==null)return null;switch(e){case bc.OBJECT_WRITE:return"ObjectWrite";case bc.PACKAGE_WRITE:return"PackageWrite";case bc.DOES_NOT_EXIST:return"DoesNotExist";case bc.ACCUMULATOR_WRITE:return"AccumulatorWriteV1";case bc.UNKNOWN:return"Unknown";default:return"Unknown"}}function QD(e){if(e==null)return null;switch(e){case Wi.UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN:return"Unknown";case Wi.READ_ONLY_ROOT:return"ReadOnlyRoot";case Wi.MUTATE_CONSENSUS_STREAM_ENDED:return"MutateConsensusStreamEnded";case Wi.READ_CONSENSUS_STREAM_ENDED:return"ReadConsensusStreamEnded";case Wi.CANCELED:return"Cancelled";case Wi.PER_EPOCH_CONFIG:return"PerEpochConfig";default:return"Unknown"}}function eU({effects:e}){if(!e)return null;const t=e.changedObjects.map(s=>({objectId:s.objectId,inputState:MS(s.inputState),inputVersion:s.inputVersion?.toString()??null,inputDigest:s.inputDigest??null,inputOwner:Ji(s.inputOwner),outputState:DS(s.outputState),outputVersion:s.outputVersion?.toString()??null,outputDigest:s.outputDigest??null,outputOwner:Ji(s.outputOwner),idOperation:jS(s.idOperation)}));return{bcs:e.bcs?.value,version:e.version??2,status:e.status?.success?{success:!0,error:null}:{success:!1,error:ob(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:MS(e.gasObject.inputState),inputVersion:e.gasObject.inputVersion?.toString()??null,inputDigest:e.gasObject.inputDigest??null,inputOwner:Ji(e.gasObject.inputOwner),outputState:DS(e.gasObject.outputState),outputVersion:e.gasObject.outputVersion?.toString()??null,outputDigest:e.gasObject.outputDigest??null,outputOwner:Ji(e.gasObject.outputOwner),idOperation:jS(e.gasObject.idOperation)}:null,eventsDigest:e.eventsDigest??null,dependencies:e.dependencies,lamportVersion:e.lamportVersion?.toString()??null,changedObjects:t,unchangedConsensusObjects:e.unchangedConsensusObjects.map(s=>({kind:QD(s.kind),objectId:s.objectId,version:s.version?.toString()??null,digest:s.digest??null})),auxiliaryDataDigest:e.auxiliaryDataDigest??null}}function Th(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=vA(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?eU({effects:e.effects}):void 0,f=e.effects?.status?.success?{success:!0,error:null}:{success:!1,error:e.effects?.status?.error?ob(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:f,effects:u,objectTypes:s?.objectTypes?r:void 0,transaction:i,bcs:c,signatures:e.signatures?.map(m=>st(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?fn.toJson(m.json):null}))??[]:void 0};return f.success?{$kind:"Transaction",Transaction:p}:{$kind:"FailedTransaction",FailedTransaction:p}}function tU(e,t){const s=t?.include,r=Th(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 US(e){let t=null;return e.reference===Jy.IMMUTABLE?t="immutable":e.reference===Jy.MUTABLE&&(t="mutable"),{reference:t,body:ev(e.body)}}function ev(e){switch(e.type){case gs.TYPE_UNKNOWN:return{$kind:"unknown"};case gs.ADDRESS:return{$kind:"address"};case gs.BOOL:return{$kind:"bool"};case gs.U8:return{$kind:"u8"};case gs.U16:return{$kind:"u16"};case gs.U32:return{$kind:"u32"};case gs.U64:return{$kind:"u64"};case gs.U128:return{$kind:"u128"};case gs.U256:return{$kind:"u256"};case gs.VECTOR:return{$kind:"vector",vector:ev(e.typeParameterInstantiation[0])};case gs.DATATYPE:return{$kind:"datatype",datatype:{typeName:e.typeName,typeParameters:e.typeParameterInstantiation.map(t=>ev(t))}};case gs.TYPE_PARAMETER:return{$kind:"typeParameter",index:e.typeParameter};default:return{$kind:"unknown"}}}var nU=class{constructor(e){this._transport=e,this.typeName=G0.typeName,this.methods=G0.methods,this.options=G0.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)}},sU=class extends Z{constructor(){super("sui.rpc.v2.TransactionFilter",[{no:1,name:"terms",kind:"message",repeat:2,T:()=>aU}])}};const Cp=new sU;var rU=class extends Z{constructor(){super("sui.rpc.v2.TransactionTerm",[{no:1,name:"literals",kind:"message",repeat:2,T:()=>oU}])}};const aU=new rU;var iU=class extends Z{constructor(){super("sui.rpc.v2.TransactionLiteral",[{no:1,name:"negated",kind:"scalar",T:8},{no:2,name:"sender",kind:"message",oneof:"predicate",T:()=>xA},{no:3,name:"affected_address",kind:"message",oneof:"predicate",T:()=>mU},{no:4,name:"affected_object",kind:"message",oneof:"predicate",T:()=>yU},{no:5,name:"move_call",kind:"message",oneof:"predicate",T:()=>bU},{no:6,name:"emit_module",kind:"message",oneof:"predicate",T:()=>CA},{no:7,name:"event_type",kind:"message",oneof:"predicate",T:()=>IA},{no:8,name:"event_stream_head",kind:"message",oneof:"predicate",T:()=>RA},{no:9,name:"package_write",kind:"message",oneof:"predicate",T:()=>_U}])}};const oU=new iU;var cU=class extends Z{constructor(){super("sui.rpc.v2.EventFilter",[{no:1,name:"terms",kind:"message",repeat:2,T:()=>uU}])}};const NA=new cU;var lU=class extends Z{constructor(){super("sui.rpc.v2.EventTerm",[{no:1,name:"literals",kind:"message",repeat:2,T:()=>fU}])}};const uU=new lU;var dU=class extends Z{constructor(){super("sui.rpc.v2.EventLiteral",[{no:1,name:"negated",kind:"scalar",T:8},{no:2,name:"sender",kind:"message",oneof:"predicate",T:()=>xA},{no:3,name:"emit_module",kind:"message",oneof:"predicate",T:()=>CA},{no:4,name:"event_type",kind:"message",oneof:"predicate",T:()=>IA},{no:5,name:"event_stream_head",kind:"message",oneof:"predicate",T:()=>RA}])}};const fU=new dU;var hU=class extends Z{constructor(){super("sui.rpc.v2.SenderFilter",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const xA=new hU;var pU=class extends Z{constructor(){super("sui.rpc.v2.AffectedAddressFilter",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const mU=new pU;var gU=class extends Z{constructor(){super("sui.rpc.v2.AffectedObjectFilter",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9}])}};const yU=new gU;var vU=class extends Z{constructor(){super("sui.rpc.v2.MoveCallFilter",[{no:1,name:"function",kind:"scalar",opt:!0,T:9}])}};const bU=new vU;var wU=class extends Z{constructor(){super("sui.rpc.v2.EmitModuleFilter",[{no:1,name:"module",kind:"scalar",opt:!0,T:9}])}};const CA=new wU;var TU=class extends Z{constructor(){super("sui.rpc.v2.EventTypeFilter",[{no:1,name:"event_type",kind:"scalar",opt:!0,T:9}])}};const IA=new TU;var EU=class extends Z{constructor(){super("sui.rpc.v2.EventStreamHeadFilter",[{no:1,name:"stream_id",kind:"scalar",opt:!0,T:9}])}};const RA=new EU;var SU=class extends Z{constructor(){super("sui.rpc.v2.PackageWriteFilter",[])}};const _U=new SU;var kU=class extends Z{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:()=>fn}}])}};const AU=new kU;var OU=class extends Z{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:()=>zU},{no:5,name:"storage_fund",kind:"message",T:()=>BU},{no:6,name:"parameters",kind:"message",T:()=>RU},{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:()=>CU},{no:9,name:"stake_subsidy",kind:"message",T:()=>DU},{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:()=>Ls}])}};const NU=new OU;var xU=class extends Z{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 CU=new xU;var IU=class extends Z{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:()=>Ls}])}};const RU=new IU;var jU=class extends Z{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 Ls=new jU;var MU=class extends Z{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:()=>Ls}])}};const DU=new MU;var UU=class extends Z{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 BU=new UU;var LU=class extends Z{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:()=>VU},{no:3,name:"pending_active_validators",kind:"message",T:()=>Ls},{no:4,name:"pending_removals",kind:"scalar",repeat:1,T:4,L:0},{no:5,name:"staking_pool_mappings",kind:"message",T:()=>Ls},{no:6,name:"inactive_validators",kind:"message",T:()=>Ls},{no:7,name:"validator_candidates",kind:"message",T:()=>Ls},{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:()=>Ls}])}};const zU=new LU;var $U=class extends Z{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:()=>Ls},{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:()=>GU},{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:()=>Ls}])}};const VU=new $U;var PU=class extends Z{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:()=>Ls},{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:()=>Ls}])}};const GU=new PU;var FU=class extends Z{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:()=>xD},{no:3,name:"system_state",kind:"message",T:()=>NU},{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:()=>Or},{no:7,name:"end",kind:"message",T:()=>Or},{no:8,name:"reference_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"protocol_config",kind:"message",T:()=>AU}])}};const HU=new FU;var qU=class extends Z{constructor(){super("sui.rpc.v2.CheckpointContents",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{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:()=>WU}])}};const ZU=new qU;var YU=class extends Z{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:()=>xp},{no:4,name:"address_aliases_versions",kind:"message",repeat:2,T:()=>JU}])}};const WU=new YU;var XU=class extends Z{constructor(){super("sui.rpc.v2.AddressAliasesVersion",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const JU=new XU;let KU=(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 QU=class extends Z{constructor(){super("sui.rpc.v2.CheckpointSummary",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{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:()=>TA},{no:9,name:"timestamp",kind:"message",T:()=>Or},{no:10,name:"commitments",kind:"message",repeat:2,T:()=>jA},{no:11,name:"end_of_epoch_data",kind:"message",T:()=>n7},{no:12,name:"version_specific_data",kind:"scalar",opt:!0,T:12}])}};const e7=new QU;var t7=class extends Z{constructor(){super("sui.rpc.v2.EndOfEpochData",[{no:1,name:"next_epoch_committee",kind:"message",repeat:2,T:()=>AA},{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:()=>jA}])}};const n7=new t7;var s7=class extends Z{constructor(){super("sui.rpc.v2.CheckpointCommitment",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CheckpointCommitment.CheckpointCommitmentKind",KU]},{no:2,name:"digest",kind:"scalar",opt:!0,T:9}])}};const jA=new s7;var r7=class extends Z{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:()=>e7},{no:4,name:"signature",kind:"message",T:()=>RD},{no:5,name:"contents",kind:"message",T:()=>ZU},{no:6,name:"transactions",kind:"message",repeat:2,T:()=>ha},{no:7,name:"objects",kind:"message",T:()=>fA}])}};const cb=new r7;var a7=class extends Z{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=Yk(t),i=r.typeRegistry?.find(f=>f.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.")||!$h(u))&&(u={value:u}),u["@type"]=e.typeUrl,u}internalJsonRead(e,t,s){if(!$h(e))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+ma(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 i7=new a7;var o7=class extends Z{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:()=>i7}])}};const MA=new o7;var c7=class extends Z{constructor(){super("sui.rpc.v2.GetServiceInfoRequest",[])}};const l7=new c7;var u7=class extends Z{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:()=>Or},{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 d7=new u7;var f7=class extends Z{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:()=>Bn}])}};const DA=new f7;var h7=class extends Z{constructor(){super("sui.rpc.v2.GetObjectResponse",[{no:1,name:"object",kind:"message",T:()=>uo}])}};const p7=new h7;var m7=class extends Z{constructor(){super("sui.rpc.v2.BatchGetObjectsRequest",[{no:1,name:"requests",kind:"message",repeat:2,T:()=>DA},{no:2,name:"read_mask",kind:"message",T:()=>Bn}])}};const g7=new m7;var y7=class extends Z{constructor(){super("sui.rpc.v2.BatchGetObjectsResponse",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>w7}])}};const v7=new y7;var b7=class extends Z{constructor(){super("sui.rpc.v2.GetObjectResult",[{no:1,name:"object",kind:"message",oneof:"result",T:()=>uo},{no:2,name:"error",kind:"message",oneof:"result",T:()=>MA}])}};const w7=new b7;var T7=class extends Z{constructor(){super("sui.rpc.v2.GetTransactionRequest",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"read_mask",kind:"message",T:()=>Bn}])}};const E7=new T7;var S7=class extends Z{constructor(){super("sui.rpc.v2.GetTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha}])}};const _7=new S7;var k7=class extends Z{constructor(){super("sui.rpc.v2.BatchGetTransactionsRequest",[{no:1,name:"digests",kind:"scalar",repeat:2,T:9},{no:2,name:"read_mask",kind:"message",T:()=>Bn}])}};const A7=new k7;var O7=class extends Z{constructor(){super("sui.rpc.v2.BatchGetTransactionsResponse",[{no:1,name:"transactions",kind:"message",repeat:2,T:()=>C7}])}};const N7=new O7;var x7=class extends Z{constructor(){super("sui.rpc.v2.GetTransactionResult",[{no:1,name:"transaction",kind:"message",oneof:"result",T:()=>ha},{no:2,name:"error",kind:"message",oneof:"result",T:()=>MA}])}};const C7=new x7;var I7=class extends Z{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:()=>Bn}])}};const R7=new I7;var j7=class extends Z{constructor(){super("sui.rpc.v2.GetCheckpointResponse",[{no:1,name:"checkpoint",kind:"message",T:()=>cb}])}};const M7=new j7;var D7=class extends Z{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:()=>Bn}])}};const U7=new D7;var B7=class extends Z{constructor(){super("sui.rpc.v2.GetEpochResponse",[{no:1,name:"epoch",kind:"message",T:()=>HU}])}};const L7=new B7;var z7=class extends Z{constructor(){super("sui.rpc.v2.ListCheckpointsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{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:()=>Cp},{no:5,name:"options",kind:"message",T:()=>ab}])}};const $7=new z7;var V7=class extends Z{constructor(){super("sui.rpc.v2.ListCheckpointsResponse",[{no:1,name:"checkpoint",kind:"message",T:()=>cb},{no:2,name:"watermark",kind:"message",T:()=>sd},{no:3,name:"end",kind:"message",T:()=>ib}])}};const P7=new V7;var G7=class extends Z{constructor(){super("sui.rpc.v2.ListTransactionsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{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:()=>Cp},{no:5,name:"options",kind:"message",T:()=>ab}])}};const F7=new G7;var H7=class extends Z{constructor(){super("sui.rpc.v2.ListTransactionsResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha},{no:2,name:"watermark",kind:"message",T:()=>sd},{no:3,name:"end",kind:"message",T:()=>ib}])}};const q7=new H7;var Z7=class extends Z{constructor(){super("sui.rpc.v2.ListEventsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{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:()=>NA},{no:5,name:"options",kind:"message",T:()=>ab}])}};const Y7=new Z7;var W7=class extends Z{constructor(){super("sui.rpc.v2.ListEventsResponse",[{no:1,name:"event",kind:"message",T:()=>sb},{no:2,name:"watermark",kind:"message",T:()=>sd},{no:3,name:"end",kind:"message",T:()=>ib}])}};const X7=new W7,H0=new gi("sui.rpc.v2.LedgerService",[{name:"GetServiceInfo",options:{},I:l7,O:d7},{name:"GetObject",options:{},I:DA,O:p7},{name:"BatchGetObjects",options:{},I:g7,O:v7},{name:"GetTransaction",options:{},I:E7,O:_7},{name:"BatchGetTransactions",options:{},I:A7,O:N7},{name:"GetCheckpoint",options:{},I:R7,O:M7},{name:"GetEpoch",options:{},I:U7,O:L7},{name:"ListCheckpoints",serverStreaming:!0,options:{},I:$7,O:P7},{name:"ListTransactions",serverStreaming:!0,options:{},I:F7,O:q7},{name:"ListEvents",serverStreaming:!0,options:{},I:Y7,O:X7}]);var J7=class{constructor(e){this._transport=e,this.typeName=H0.typeName,this.methods=H0.methods,this.options=H0.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)}},K7=class extends Z{constructor(){super("sui.rpc.v2.GetPackageRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9}])}};const Q7=new K7;var eB=class extends Z{constructor(){super("sui.rpc.v2.GetPackageResponse",[{no:1,name:"package",kind:"message",T:()=>iA}])}};const tB=new eB;var nB=class extends Z{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 sB=new nB;var rB=class extends Z{constructor(){super("sui.rpc.v2.GetDatatypeResponse",[{no:1,name:"datatype",kind:"message",T:()=>oA}])}};const aB=new rB;var iB=class extends Z{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 oB=new iB;var cB=class extends Z{constructor(){super("sui.rpc.v2.GetFunctionResponse",[{no:1,name:"function",kind:"message",T:()=>uA}])}};const lB=new cB;var uB=class extends Z{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 dB=new uB;var fB=class extends Z{constructor(){super("sui.rpc.v2.ListPackageVersionsResponse",[{no:1,name:"versions",kind:"message",repeat:2,T:()=>mB},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const hB=new fB;var pB=class extends Z{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 mB=new pB,q0=new gi("sui.rpc.v2.MovePackageService",[{name:"GetPackage",options:{},I:Q7,O:tB},{name:"GetDatatype",options:{},I:sB,O:aB},{name:"GetFunction",options:{},I:oB,O:lB},{name:"ListPackageVersions",options:{},I:dB,O:hB}]);var gB=class{constructor(e){this._transport=e,this.typeName=q0.typeName,this.methods=q0.methods,this.options=q0.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)}},yB=class extends Z{constructor(){super("sui.rpc.v2.VerifySignatureRequest",[{no:1,name:"message",kind:"message",T:()=>Ts},{no:2,name:"signature",kind:"message",T:()=>xp},{no:3,name:"address",kind:"scalar",opt:!0,T:9},{no:4,name:"jwks",kind:"message",repeat:2,T:()=>gA}])}};const vB=new yB;var bB=class extends Z{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 wB=new bB,Z0=new gi("sui.rpc.v2.SignatureVerificationService",[{name:"VerifySignature",options:{},I:vB,O:wB}]);var TB=class{constructor(e){this._transport=e,this.typeName=Z0.typeName,this.methods=Z0.methods,this.options=Z0.options}verifySignature(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}};let EB=(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})({}),SB=(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})({}),_B=(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})({}),UA=(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 kB=class extends Z{constructor(){super("sui.rpc.v2.GetCoinInfoRequest",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const AB=new kB;var OB=class extends Z{constructor(){super("sui.rpc.v2.GetCoinInfoResponse",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:2,name:"metadata",kind:"message",T:()=>CB},{no:3,name:"treasury",kind:"message",T:()=>RB},{no:4,name:"regulated_metadata",kind:"message",T:()=>MB}])}};const NB=new OB;var xB=class extends Z{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",EB]}])}};const CB=new xB;var IB=class extends Z{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",SB]}])}};const RB=new IB;var jB=class extends Z{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",_B]}])}};const MB=new jB;var DB=class extends Z{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 UB=new DB;var BB=class extends Z{constructor(){super("sui.rpc.v2.GetBalanceResponse",[{no:1,name:"balance",kind:"message",T:()=>BA}])}};const LB=new BB;var zB=class extends Z{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 $B=new zB;var VB=class extends Z{constructor(){super("sui.rpc.v2.ListBalancesResponse",[{no:1,name:"balances",kind:"message",repeat:2,T:()=>BA},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const PB=new VB;var GB=class extends Z{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 BA=new GB;var FB=class extends Z{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:()=>Bn}])}};const HB=new FB;var qB=class extends Z{constructor(){super("sui.rpc.v2.ListDynamicFieldsResponse",[{no:1,name:"dynamic_fields",kind:"message",repeat:2,T:()=>WB},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const ZB=new qB;var YB=class extends Z{constructor(){super("sui.rpc.v2.DynamicField",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.DynamicField.DynamicFieldKind",UA]},{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:()=>uo},{no:5,name:"name",kind:"message",T:()=>Ts},{no:6,name:"value",kind:"message",T:()=>Ts},{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:()=>uo}])}};const WB=new YB;var XB=class extends Z{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:()=>Bn},{no:5,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const JB=new XB;var KB=class extends Z{constructor(){super("sui.rpc.v2.ListOwnedObjectsResponse",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>uo},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const QB=new KB,Y0=new gi("sui.rpc.v2.StateService",[{name:"ListDynamicFields",options:{},I:HB,O:ZB},{name:"ListOwnedObjects",options:{},I:JB,O:QB},{name:"GetCoinInfo",options:{},I:AB,O:NB},{name:"GetBalance",options:{},I:UB,O:LB},{name:"ListBalances",options:{},I:$B,O:PB}]);var eL=class{constructor(e){this._transport=e,this.typeName=Y0.typeName,this.methods=Y0.methods,this.options=Y0.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)}},tL=class extends Z{constructor(){super("sui.rpc.v2.SubscribeCheckpointsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"filter",kind:"message",T:()=>Cp}])}};const nL=new tL;var sL=class extends Z{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:()=>cb}])}};const rL=new sL;var aL=class extends Z{constructor(){super("sui.rpc.v2.SubscribeTransactionsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"filter",kind:"message",T:()=>Cp}])}};const iL=new aL;var oL=class extends Z{constructor(){super("sui.rpc.v2.SubscribeTransactionsResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha},{no:2,name:"watermark",kind:"message",T:()=>sd}])}};const cL=new oL;var lL=class extends Z{constructor(){super("sui.rpc.v2.SubscribeEventsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"filter",kind:"message",T:()=>NA}])}};const uL=new lL;var dL=class extends Z{constructor(){super("sui.rpc.v2.SubscribeEventsResponse",[{no:1,name:"event",kind:"message",T:()=>sb},{no:2,name:"watermark",kind:"message",T:()=>sd}])}};const fL=new dL,W0=new gi("sui.rpc.v2.SubscriptionService",[{name:"SubscribeCheckpoints",serverStreaming:!0,options:{},I:nL,O:rL},{name:"SubscribeTransactions",serverStreaming:!0,options:{},I:iL,O:cL},{name:"SubscribeEvents",serverStreaming:!0,options:{},I:uL,O:fL}]);var hL=class{constructor(e){this._transport=e,this.typeName=W0.typeName,this.methods=W0.methods,this.options=W0.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)}},pL=class extends Z{constructor(){super("sui.rpc.v2.LookupNameRequest",[{no:1,name:"name",kind:"scalar",opt:!0,T:9}])}};const mL=new pL;var gL=class extends Z{constructor(){super("sui.rpc.v2.LookupNameResponse",[{no:1,name:"record",kind:"message",T:()=>LA}])}};const yL=new gL;var vL=class extends Z{constructor(){super("sui.rpc.v2.ReverseLookupNameRequest",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const bL=new vL;var wL=class extends Z{constructor(){super("sui.rpc.v2.ReverseLookupNameResponse",[{no:1,name:"record",kind:"message",T:()=>LA}])}};const TL=new wL;var EL=class extends Z{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:()=>Or},{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 LA=new EL,X0=new gi("sui.rpc.v2.NameService",[{name:"LookupName",options:{},I:mL,O:yL},{name:"ReverseLookupName",options:{},I:bL,O:TL}]);var SL=class{constructor(e){this._transport=e,this.typeName=X0.typeName,this.methods=X0.methods,this.options=X0.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)}},_L=class extends Z{constructor(){super("sui.forking.v1alpha.AdvanceClockRequest",[{no:1,name:"duration_ms",kind:"scalar",opt:!0,T:4,L:0}])}};const kL=new _L;var AL=class extends Z{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 OL=new AL;var NL=class extends Z{constructor(){super("sui.forking.v1alpha.AdvanceCheckpointRequest",[])}};const xL=new NL;var CL=class extends Z{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 IL=new CL;var RL=class extends Z{constructor(){super("sui.forking.v1alpha.GetStatusRequest",[])}};const jL=new RL;var ML=class extends Z{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 DL=new ML,J0=new gi("sui.forking.v1alpha.ForkingService",[{name:"AdvanceClock",options:{},I:kL,O:OL},{name:"AdvanceCheckpoint",options:{},I:xL,O:IL},{name:"GetStatus",options:{},I:jL,O:DL}]);var UL=class{constructor(e){this._transport=e,this.typeName=J0.typeName,this.methods=J0.methods,this.options=J0.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 BL=Symbol.for("@mysten/SuiGrpcClient");var lb=class extends rA{get mvr(){return this.core.mvr}get[BL](){return!0}constructor(e){super({network:e.network});const{network:t,mvr:s,abort:r,transport:i,...c}=e,u=Jj(i??new Qv(c));this.transactionExecutionService=new nU(u),this.ledgerService=new J7(u),this.stateService=new eL(u),this.subscriptionService=new hL(u),this.movePackageService=new gB(u),this.signatureVerificationService=new TB(u),this.nameService=new SL(u),this.forkingService=new UL(u),this.core=new JD({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?qe(e.cursor):void 0,pageSize:e.limit,readMask:{paths:s}},{abort:e.signal});return{dynamicFields:r.response.dynamicFields.map(i=>{const c=i.kind===UA.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?st(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 LL="Dev Wallet",BS="dev-wallet:networks",zL={devnet:"https://fullnode.devnet.sui.io:443",testnet:"https://fullnode.testnet.sui.io:443",localnet:"http://127.0.0.1:9000"};var $L=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??zL),this.#r={...e.faucets},this.#s={},this.#a=e.activeNetwork??Object.keys(this.#t)[0]??"",this.#i=e.name??LL,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 lb({baseUrl:s,network:t})),this.#f=this.#A(),this.#l=x4(),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 rj(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.#E(e);return{...this.#s}}getClient(e){return this.#E(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.#E(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."),_p().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.#S(),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.#S(),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)}#S(){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.#S()}));#j=async()=>{};#M(e){const t=aj(e);if(!t)throw new Error(`Invalid chain identifier: ${e}`);return this.#E(t)}#D(e){if(!this.#h||typeof localStorage>"u")return{...e};try{const t=localStorage.getItem(BS);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(BS,JSON.stringify(this.#t))}#E(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 ij({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 VL="modulepreload",PL=function(e,t){return new URL(e,t).href},LS={},GL=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"),f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");i=m(s.map(g=>{if(g=PL(g,r),g in LS)return;LS[g]=!0;const y=g.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(r)for(let A=u.length-1;A>=0;A--){const N=u[A];if(N.href===g&&(!y||N.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${b}`))return;const S=document.createElement("link");if(S.rel=y?"stylesheet":VL,y||(S.as="script"),S.crossOrigin="",S.href=g,p&&S.setAttribute("nonce",p),document.head.appendChild(S),y)return new Promise((A,N)=>{S.addEventListener("load",A),S.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${g}`)))})}))}function c(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return i.then(u=>{for(const f of u||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};async function FL(e){const{autoInitialize:t=!0,createInitialAccount:s=!1,mountUI:r=!0,dockStyle:i,container:c,onWalletCreated:u,...f}=e;if(t&&await Promise.all(f.adapters.map(y=>y.initialize())),s&&!f.adapters.some(y=>y.getAccounts().length>0)){const y=f.adapters.find(b=>b.createAccount&&b.getAccounts().length===0);y?.createAccount&&await y.createAccount({label:"Dev Account"})}const p=new $L(f);u?.(p);let m;if(r&&typeof document<"u"){const{mountDevWallet:y}=await GL(async()=>{const{mountDevWallet:b}=await import("./mount-BV2Q3os4.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 HL(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 FL({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 qL=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,Hy(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 yi={ED25519:0,Secp256k1:1,Secp256r1:2,MultiSig:3,ZkLogin:5,Passkey:6},ZL={ED25519:32,Secp256k1:33,Secp256r1:33,Passkey:33},ub={0:"ED25519",1:"Secp256k1",2:"Secp256r1",3:"MultiSig",5:"ZkLogin",6:"Passkey"};function zA(e,t){return F.IntentMessage(F.bytes(t.length)).serialize({intent:{scope:{[e]:!0},version:{V0:!0},appId:{Sui:!0}},value:t}).toBytes()}function Bu(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 Ip=class{equals(e){return Bu(this.toRawBytes(),e.toRawBytes())}toBase64(){return st(this.toRawBytes())}toString(){throw new Error("`toString` is not implemented on public keys. Use `toBase64()` or `toRawBytes()` instead.")}toSuiPublicKey(){return st(this.toSuiBytes())}verifyWithIntent(e,t,s){const r=$c(zA(s,e),{dkLen:32});return this.verify(r,t)}verifyPersonalMessage(e,t){return this.verifyWithIntent(F.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(ed($c(this.toSuiBytes(),{dkLen:32})).slice(0,Qc*2))}};function $A(e){const t=qe(e),s=ub[t[0]];switch(s){case"ED25519":case"Secp256k1":case"Secp256r1":const r=ZL[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 YL=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]),Wa=new Uint32Array(64);class WL extends Ok{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:f,H:p}=this;return[t,s,r,i,c,u,f,p]}set(t,s,r,i,c,u,f,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=f|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)Wa[y]=t.getUint32(s,!1);for(let y=16;y<64;y++){const b=Wa[y-15],S=Wa[y-2],A=mr(b,7)^mr(b,18)^b>>>3,N=mr(S,17)^mr(S,19)^S>>>10;Wa[y]=N+Wa[y-7]+A+Wa[y-16]|0}let{A:r,B:i,C:c,D:u,E:f,F:p,G:m,H:g}=this;for(let y=0;y<64;y++){const b=mr(f,6)^mr(f,11)^mr(f,25),S=g+b+NR(f,p,m)+YL[y]+Wa[y]|0,N=(mr(r,2)^mr(r,13)^mr(r,22))+xR(r,i,c)|0;g=m,m=p,p=f,f=u+S|0,u=c,c=i,i=r,r=S+N|0}r=r+this.A|0,i=i+this.B|0,c=c+this.C|0,u=u+this.D|0,f=f+this.E|0,p=p+this.F|0,m=m+this.G|0,g=g+this.H|0,this.set(r,i,c,u,f,p,m,g)}roundClean(){zs(Wa)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),zs(this.buffer)}}class XL extends WL{constructor(){super(32,CR)}}const VA=wR(["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))),JL=VA[0],KL=VA[1],Xa=new Uint32Array(80),Ja=new Uint32Array(80);class QL extends Ok{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:f,Dl:p,Eh:m,El:g,Fh:y,Fl:b,Gh:S,Gl:A,Hh:N,Hl:j}=this;return[t,s,r,i,c,u,f,p,m,g,y,b,S,A,N,j]}set(t,s,r,i,c,u,f,p,m,g,y,b,S,A,N,j){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=f|0,this.Dl=p|0,this.Eh=m|0,this.El=g|0,this.Fh=y|0,this.Fl=b|0,this.Gh=S|0,this.Gl=A|0,this.Hh=N|0,this.Hl=j|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)Xa[W]=t.getUint32(s),Ja[W]=t.getUint32(s+=4);for(let W=16;W<80;W++){const ce=Xa[W-15]|0,ae=Ja[W-15]|0,Y=ti(ce,ae,1)^ti(ce,ae,8)^FE(ce,ae,7),K=ni(ce,ae,1)^ni(ce,ae,8)^HE(ce,ae,7),w=Xa[W-2]|0,O=Ja[W-2]|0,x=ti(w,O,19)^yu(w,O,61)^FE(w,O,6),G=ni(w,O,19)^vu(w,O,61)^HE(w,O,6),U=_R(K,G,Ja[W-7],Ja[W-16]),H=kR(U,Y,x,Xa[W-7],Xa[W-16]);Xa[W]=H|0,Ja[W]=U|0}let{Ah:r,Al:i,Bh:c,Bl:u,Ch:f,Cl:p,Dh:m,Dl:g,Eh:y,El:b,Fh:S,Fl:A,Gh:N,Gl:j,Hh:V,Hl:C}=this;for(let W=0;W<80;W++){const ce=ti(y,b,14)^ti(y,b,18)^yu(y,b,41),ae=ni(y,b,14)^ni(y,b,18)^vu(y,b,41),Y=y&S^~y&N,K=b&A^~b&j,w=AR(C,ae,K,KL[W],Ja[W]),O=OR(w,V,ce,Y,JL[W],Xa[W]),x=w|0,G=ti(r,i,28)^yu(r,i,34)^yu(r,i,39),U=ni(r,i,28)^vu(r,i,34)^vu(r,i,39),H=r&c^r&f^c&f,$=i&u^i&p^u&p;V=N|0,C=j|0,N=S|0,j=A|0,S=y|0,A=b|0,{h:y,l:b}=Ys(m|0,g|0,O|0,x|0),m=f|0,g=p|0,f=c|0,p=u|0,c=r|0,u=i|0;const M=Zv(x,U,$);r=Yv(M,O,G,H),i=M|0}({h:r,l:i}=Ys(this.Ah|0,this.Al|0,r|0,i|0)),{h:c,l:u}=Ys(this.Bh|0,this.Bl|0,c|0,u|0),{h:f,l:p}=Ys(this.Ch|0,this.Cl|0,f|0,p|0),{h:m,l:g}=Ys(this.Dh|0,this.Dl|0,m|0,g|0),{h:y,l:b}=Ys(this.Eh|0,this.El|0,y|0,b|0),{h:S,l:A}=Ys(this.Fh|0,this.Fl|0,S|0,A|0),{h:N,l:j}=Ys(this.Gh|0,this.Gl|0,N|0,j|0),{h:V,l:C}=Ys(this.Hh|0,this.Hl|0,V|0,C|0),this.set(r,i,c,u,f,p,m,g,y,b,S,A,N,j,V,C)}roundClean(){zs(Xa,Ja)}destroy(){this.destroyed=!0,zs(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class ez extends QL{constructor(){super(64,IR)}}const PA=qv(()=>new XL,_k(1)),rd=qv(()=>new ez,_k(3));function GA(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 jt=(e,t,s)=>Dn(e,t,s),FA=rs;function tz(e,t=""){if(typeof e!="string"){const s=t&&`"${t}" `;throw new TypeError(s+"expected string, got type="+typeof e)}return e}function Ac(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 Nu(e,t){if(typeof e!="function")throw new TypeError(`"${t}" is invalid: expected function, got ${typeof e}`);return e}const db=ed,br=(...e)=>gR(...e),qh=e=>Fv(e),ad=Ly,id=e=>yR(e),Zh=BigInt(0),zS=BigInt(1),nz=e=>e?`"${e}" `:"";function Nr(e,t=""){if(typeof e!="boolean")throw new TypeError(nz(t)+"expected boolean, got type="+typeof e);return e}function fb(e){if(typeof e=="bigint"){if(!no(e))throw new RangeError("positive bigint expected, got "+e)}else FA(e);return e}function Vc(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 Yf(e){const t=fb(e).toString(16);return t.length&1?"0"+t:t}function HA(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?Zh:BigInt("0x"+e)}function Pc(e){return HA(ed(e))}function Lu(e){return HA(ed(Yh(Dn(e)).reverse()))}function hb(e,t){if(rs(t),t===0)throw new Error("zero output length is invalid");e=fb(e);const s=t*2,r=e.toString(16);if(r.length>s)throw new RangeError("number is too large");return Fv(r.padStart(s,"0"))}function qA(e,t){return hb(e,t).reverse()}function Yh(e){return Uint8Array.from(jt(e))}function no(e){return typeof e=="bigint"&&Zh<=e}function ZA(e,t,s){return no(e)&&no(t)&&no(s)&&t<=e&&e<s}function Wh(e,t,s,r){if(!ZA(t,s,r))throw new RangeError("expected valid "+e+": "+s+" <= n < "+r+", got "+t)}function pb(e){if(e<Zh)throw new Error("expected non-negative bigint, got "+e);return e===Zh?0:e.toString(2).length}const mb=e=>(Vc(e,"n"),(zS<<BigInt(e))-zS);function sz(e,t,s){if(rs(e,"hashLen"),rs(t,"qByteLen"),typeof s!="function")throw new TypeError("hmacFn must be a function");const r=j=>new Uint8Array(j),i=Uint8Array.of(),c=Uint8Array.of(0),u=Uint8Array.of(1),f=1e3;let p=r(e),m=r(e),g=0;const y=()=>{p.fill(1),m.fill(0),g=0},b=(...j)=>s(m,br(p,...j)),S=(j=i)=>{m=b(c,j),p=b(),j.length!==0&&(m=b(u,j),p=b())},A=()=>{if(g++>=f)throw new Error("drbg: tried max amount of iterations");let j=0;const V=[];for(;j<t;){p=b();const C=p.slice();V.push(C),j+=p.length}return br(...V)};return(j,V)=>{y(),S(j);let C;for(;(C=V(A()))===void 0;)S();return y(),C}}function Tr(e,t={},s={},r="object"){Ac(e,r),Ac(t,"fields"),Ac(s,"optFields");function i(u,f,p){const m=r==="object"?`param "${String(u)}"`:`"${r}.${String(u)}"`,g=e[u];if(!Object.hasOwn(e,u)&&(p?g!==void 0:f!=="function"))throw new TypeError(`${m} is invalid: expected own property`);if(p&&g===void 0)return;const y=typeof g;if(y!==f||g===null)throw new TypeError(`${m} is invalid: expected ${f}, got ${y}`)}const c=(u,f)=>Object.entries(u).forEach(([p,m])=>i(p,m,f));c(t,!1),c(s,!0)}const un=BigInt(0),vt=BigInt(1),oi=BigInt(2),YA=BigInt(3),gb=BigInt(4),WA=BigInt(5),rz=BigInt(7),XA=BigInt(8),az=BigInt(9),iz=BigInt(15),JA=BigInt(16),oz=BigInt("0x10000000000000000");function Ht(e,t){if(t<=un)throw new Error("mod: expected positive modulus, got "+t);const s=e%t;return s>=un?s:t+s}function KA(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<un)throw new Error("invalid exponent, negatives unsupported");if(t===un)return vt;if(t===vt)return e;let r=e%s;if(r<un&&(r+=s),t<oz){let f=vt;for(;t>un;)t&vt&&(f=f*r%s),r=r*r%s,t>>=vt;return f}const i=[];for(;t>un;)i.push(Number(t&iz)),t>>=gb;const c=new Array(16);c[0]=vt,c[1]=r;for(let f=2;f<16;f++)c[f]=c[f-1]*r%s;let u=c[i[i.length-1]];for(let f=i.length-2;f>=0;f--){u=u*u%s,u=u*u%s,u=u*u%s,u=u*u%s;const p=i[f];p!==0&&(u=u*c[p]%s)}return u}function gr(e,t,s){if(s<=vt)throw new Error("pow2: expected modulus > 1, got "+s);if(t<un)throw new Error("pow2: expected non-negative exponent, got "+t);let r=e;for(;t-- >un;)r*=r,r%=s;return r}function $S(e,t){if(e===un)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=un,c=vt;for(;s!==un;){const f=r/s,p=r-s*f,m=i-c*f;r=s,s=p,i=c,c=m}if(r!==vt)throw new Error("invert: does not exist");return Ht(i,t)}function cz(e,t){if(t<=vt)throw new Error("invertCt: expected prime modulus > 1, got "+t);const s=Ht(e,t);if(s===un)throw new Error("invertCt: expected non-zero number");const r=KA(s,t-oi,t);if(Ht(s*r,t)!==vt)throw new Error("invertCt: does not exist");return r}function yb(e,t,s){const r=e;if(!r.eql(r.sqr(t),s))throw new Error("Cannot find square root")}function vb(e,t){if((e&vt)===un)throw new Error(t+": expected odd modulus, got "+e)}function QA(e,t){const s=e,r=(s.ORDER+vt)/gb,i=s.pow(t,r);return yb(s,i,t),i}function lz(e,t){const s=e,r=(s.ORDER-WA)/XA,i=s.mul(t,oi),c=s.pow(i,r),u=s.mul(t,c),f=s.mul(s.mul(u,oi),c),p=s.mul(u,s.sub(f,s.ONE));return yb(s,p,t),p}function uz(e){const t=bb(e),s=e3(e),r=s(t,t.neg(t.ONE)),i=s(t,r),c=s(t,t.neg(r)),u=(e+rz)/JA;return((f,p)=>{const m=f;let g=m.pow(p,u),y=m.mul(g,r);const b=m.mul(g,i),S=m.mul(g,c),A=m.eql(m.sqr(y),p),N=m.eql(m.sqr(b),p);g=m.cmov(g,y,A),y=m.cmov(S,b,N);const j=m.eql(m.sqr(y),p),V=m.cmov(g,y,j);return yb(m,V,p),V})}function e3(e){if(e<YA)throw new Error("sqrt is not defined for small field");vb(e,"tonelliShanks");let t=e-vt,s=0;for(;t%oi===un;)t/=oi,s++;let r=oi;const i=bb(e);for(;Xh(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(s===1)return QA;let c=i.pow(r,t);const u=(t+vt)/oi;return function(p,m){const g=p;if(g.is0(m))return m;if(Xh(g,m)!==1)throw new Error("Cannot find square root");let y=s,b=g.mul(g.ONE,c),S=g.pow(m,t),A=g.pow(m,u);for(;!g.eql(S,g.ONE);){if(g.is0(S))throw new Error("Cannot find square root: probably non-prime P");let N=1,j=g.sqr(S);for(;!g.eql(j,g.ONE);)if(N++,j=g.sqr(j),N===y)throw new Error("Cannot find square root");const V=vt<<BigInt(y-N-1),C=g.pow(b,V);y=N,b=g.sqr(C),S=g.mul(S,b),A=g.mul(A,C)}return A}}function dz(e){return vb(e,"Fp.sqrt"),e%gb===YA?QA:e%XA===WA?lz:e%JA===az?uz(e):e3(e)}const fz=(e,t)=>(Ht(e,t)&vt)===vt,hz=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function zu(e){if(Ac(e,"field"),typeof e.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof e.ORDER);Vc(e.BYTES,"BYTES"),Vc(e.BITS,"BITS");for(const t of hz)Nu(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 t3(e,t,s=!1){zu(e),GA(t,"nums"),Nr(s,"passZero");const r=e,i=new Array(t.length).fill(s?r.ZERO:void 0),c=t.reduce((f,p,m)=>r.is0(p)?f:(i[m]=f,r.mul(f,p)),r.ONE),u=r.inv(c);return t.reduceRight((f,p,m)=>r.is0(p)?f:(i[m]=r.mul(f,i[m]),r.mul(f,p)),u),i}function Xh(e,t){zu(e);const s=e;vb(s.ORDER,"FpLegendre");const r=(s.ORDER-vt)/oi,i=s.pow(t,r),c=s.eql(i,s.ONE),u=s.eql(i,s.ZERO),f=s.eql(i,s.neg(s.ONE));if(!c&&!u&&!f)throw new Error("invalid Legendre symbol result");return c?1:u?0:-1}function pz(e,t){if(t!==void 0&&FA(t),e<=un)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=pb(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 VS=new WeakMap;class PS{ORDER;BITS;BYTES;isLE;ZERO=un;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}=pz(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 un<=t&&t<this.ORDER}is0(t){return t===un}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 KA(t,s,this.ORDER)}div(t,s){return Ht(t*$S(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 $S(t,this.ORDER)}sqrt(t){let s=VS.get(this);return s||VS.set(this,s=dz(this.ORDER)),s(this,t)}toBytes(t){return this.isLE?qA(t,this.BYTES):hb(t,this.BYTES)}fromBytes(t,s=!1){jt(t);const{_lengths:r,BYTES:i,isLE:c,ORDER:u,_mod:f}=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?Lu(t):Pc(t);if(f&&(p=Ht(p,u)),!s&&!this.isValid(p))throw new Error("invalid field element: outside of range 0..ORDER");return p}invertBatch(t){return t3(this,t,!0)}cmov(t,s,r){return Nr(r,"condition"),r?s:t}}function bb(e,t={}){return Object.freeze(PS.prototype),new PS(e,t)}function n3(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=pb(e-vt);return Math.ceil(t/8)}function wb(e){const t=n3(e);return t+Math.ceil(t/2)}function s3(e,t,s=!1){jt(e);const r=e.length,i=n3(t),c=Math.max(wb(t),16);if(r<c||r>1024)throw new Error("expected "+c+"-1024 bytes of input, got "+r);const u=s?Lu(e):Pc(e),f=Ht(u,t-vt)+vt;return s?qA(f,i):hb(f,i)}const Tb=BigInt(0),$u=BigInt(1),mz=BigInt(4),K0=16,GS=128,gz=5,FS=2**31;function nl(e){const t=e;if(typeof t!="function")throw new TypeError('"Point" expected constructor, got type='+typeof e);Nu(t.fromAffine,"Point.fromAffine"),Nu(t.fromBytes,"Point.fromBytes"),Nu(t.fromHex,"Point.fromHex"),Ac(t.BASE,"Point.BASE"),Ac(t.ZERO,"Point.ZERO"),zu(t.Fp),zu(t.Fn)}function r3(e,t){nl(e),i3(t,e);const s=t3(e.Fp,t.map(r=>r.Z));return t.map((r,i)=>e.fromAffine(r.toAffine(s[i])))}function yz(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 vz(e,t){const s=e*(4*t+128);if(s>FS)throw new Error("invalid window size: table would need ~"+Math.ceil(s/2**20)+" MiB, max "+FS/2**20+" MiB")}function a3(e,t){if(e!==void 0){Nu(e,"randomBytes");try{const s=e(t);if(!ad(s)||s.length!==t)return}catch{return}return e}}function i3(e,t){GA(e,"points"),e.forEach((s,r)=>{if(!(s instanceof t))throw new Error("invalid point at index "+r)})}function bz(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):no(r)&&r<s))throw new Error("invalid scalar at index "+i)})}const o3=new WeakMap;function Q0(e){return o3.get(e)||1}function wz(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 Tz(e,t){const s=2**t,r=s/2,i=BigInt(s-1),c=[];for(;e>Tb;){let u=0;e&$u&&(u=Number(e&i),u>=r&&(u-=s),e-=BigInt(u)),c.push(u),e>>=$u}return c}function Ez(e,t,s){const r=2**t,i=r/2,c=BigInt(r-1),u=BigInt(t),f=[];for(let p=0;p<s;p++){let m=Number(e&c);e>>=u,m>i&&(m-=r,e+=$u),f.push(m)}if(e!==Tb)throw new Error("invalid wnaf");return f}function Sz(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 f=s[u][c];if(f){const p=t[u][Math.abs(f)-1>>1];i=i.add(f<0?p.negate():p)}}}return i}class c3{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(t,s){nl(t),this.randomBytes=a3(s,K0),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 f=t;for(let p=0;p<i;p++){let m=f;for(let g=0;g<c;g++)u.push(m),m=m.add(f);f=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),f=Ez(s,r,i);let p=this.ZERO,m=this.BASE;for(let g=0;g<i;g++){const y=f[g],b=g*u,S=Math.abs(y)-1;let A=c[b];for(let j=1;j<u;j++)A=j===S?c[b+j]:A;const N=A.negate();y===0?m=m.add(c[b]):p=p.add(y<0?N:A)}return{p,f:m}}getWnafPrecomputes(t,s,r,i){let c=this.wnafPrecomputes.get(s),u=c?.find(f=>f.W===t&&f.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),!ZA(s,$u,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(t,s,r,i){const c=Q0(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+GS,c=this.randomBytes(K0);if(!ad(c)||c.length!==K0)throw new Error("randomBytes returned invalid byte array");c[0]=c[0]&63|128;const u=s+Pc(c)*this.Point.Fn.ORDER;return this.runCT(t,u,i,r)}fixedWindowCT(t,s,r){const i=gz,c=1<<i,u=mb(i),f=new Array(c);f[0]=this.ZERO;for(let g=1;g<c;g++)f[g]=f[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 S=0;S<i;S++)m=m.double();const y=Number(s>>BigInt(g*i)&u);let b=f[0];for(let S=1;S<c;S++)b=S===y?f[S]:b;m=m.add(b)}return{p:m,f:m}}shouldBlind(t,s){return this.randomBytes===void 0?!1:s===$u?!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),!no(s))throw new Error("invalid scalar");const i=Q0(t);if(i===1||s>=this.Point.Fn.ORDER)return tv(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),yz(s,this.bits);const r=Math.ceil((this.bits+GS)/s)+1;vz(r*2**(s-1),this.Point.Fp.BYTES),o3.set(t,s),this.wnafPrecomputes.delete(t)}hasWindowSize(t){return Q0(t)!==1}}function tv(e,t,s,r=!1){if(nl(e),i3(t,e),Nr(r,"allowOversized"),bz(s,e.Fn,r?e.Fn.ORDER**mz:void 0),t.length!==s.length)throw new Error("arrays of points and scalars must have equal length");const i=t.map(u=>wz(u,4)),c=s.map(u=>Tz(u,4));return Sz(e.ZERO,i,c)}function HS(e,t,s){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return zu(t),t}else return bb(e,{isLE:s})}function l3(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`);Tr(s);for(const p of["p","n","h"]){const m=t[p];if(!(no(m)&&m!==Tb))throw new Error(`CURVE.${p} must be positive bigint`)}const i=HS(t.p,s.Fp,r),c=HS(t.n,s.Fn,r),f=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(const p of f)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 u3(e,t){return function(r){const i=e(r);return{secretKey:i,publicKey:t(i)}}}const Wf=BigInt(0),Xf=BigInt(1),Jf=BigInt(2),_z=BigInt(4),qS=BigInt(8);function kz(e,t,s,r){const i=e.sqr(s),c=e.sqr(r),u=e.add(e.mul(t.a,i),c),f=e.add(e.ONE,e.mul(t.d,e.mul(i,c)));return e.eql(u,f)}function Az(e,t={}){Tr(t,{},{},"extraOpts");const s=t,r=l3("edwards",e,s,s.FpFnLE),{Fp:i,Fn:c}=r;let u=r.CURVE;const{h:f}=u;if(Xh(i,u.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(Xh(i,u.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");Tr(s,{},{uvRatio:"function",randomBytes:"function"});const p=s.randomBytes===void 0?id:s.randomBytes,m=Jf<<BigInt(i.BYTES*8)-Xf;function g(C){if(!i.isOdd)throw new Error("Field does not have .isOdd()");return i.isOdd(C)}const y=s.uvRatio===void 0?(C,W)=>{try{return{isValid:!0,value:i.sqrt(i.div(C,W))}}catch{return{isValid:!1,value:Wf}}}:s.uvRatio;if(!kz(i,u,u.Gx,u.Gy))throw new Error("bad curve params: generator point");const b=i.eql(u.a,i.neg(i.ONE))?C=>i.neg(C):i.eql(u.a,i.ONE)?C=>C:C=>i.mul(u.a,C);function S(C,W,ce=!1){const ae=ce?Xf:Wf;return Wh("coordinate "+C,W,ae,m),W}function A(C){if(!(C instanceof N))throw new Error("EdwardsPoint expected")}class N{static BASE=new N(u.Gx,u.Gy,i.ONE,i.mul(u.Gx,u.Gy));static ZERO=new N(i.ZERO,i.ONE,i.ONE,i.ZERO);static Fp=i;static Fn=c;X;Y;Z;T;constructor(W,ce,ae,Y){this.X=S("x",W),this.Y=S("y",ce),this.Z=S("z",ae,!0),this.T=S("t",Y),Object.freeze(this)}static CURVE(){return u}static fromAffine(W){if(W instanceof N)throw new Error("extended point not allowed");const{x:ce,y:ae}=W||{};return S("x",ce),S("y",ae),new N(ce,ae,i.ONE,i.mul(ce,ae))}static fromBytes(W,ce=!1){const ae=i.BYTES,{a:Y,d:K}=u;W=Yh(jt(W,ae,"point")),Nr(ce,"zip215");const w=Yh(W),O=W[ae-1];w[ae-1]=O&-129;const x=Lu(w),G=ce?m:i.ORDER;Wh("point.y",x,Wf,G);const U=i.sqr(x),H=i.sub(U,i.ONE),$=i.sub(i.mulN(K,U),Y);let{isValid:M,value:k}=y(H,$);if(!M)throw new Error("bad point: invalid y coordinate");const I=g(k),D=(O&128)!==0;if(!ce&&i.is0(k)&&D)throw new Error("bad point: x=0 and x_0=1");return D!==I&&(k=i.neg(k)),N.fromAffine({x:k,y:x})}static fromHex(W,ce=!1){return N.fromBytes(qh(W),ce)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(W=6,ce=!0){return V.setWindowSize(this,W),ce||this.multiply(Jf),this}assertValidity(){const W=this,{a:ce,d:ae}=u;if(W.is0())throw new Error("bad point: ZERO");const{X:Y,Y:K,Z:w,T:O}=W,x=i.sqr(Y),G=i.sqr(K),U=i.sqr(w),H=i.sqr(U),$=i.mul(x,ce),M=i.mul(i.add($,G),U),k=i.add(H,i.mul(ae,i.mul(x,G)));if(!i.eql(M,k))throw new Error("bad point: equation left != right (1)");const I=i.mul(Y,K),D=i.mul(w,O);if(!i.eql(I,D))throw new Error("bad point: equation left != right (2)")}equals(W){A(W);const{X:ce,Y:ae,Z:Y}=this,{X:K,Y:w,Z:O}=W,x=i.mul(ce,O),G=i.mul(K,Y),U=i.mul(ae,O),H=i.mul(w,Y);return i.eql(x,G)&&i.eql(U,H)}is0(){return this.equals(N.ZERO)}negate(){return new N(i.neg(this.X),this.Y,this.Z,i.neg(this.T))}double(){const{X:W,Y:ce,Z:ae}=this,Y=i.sqr(W),K=i.sqr(ce),w=i.mul(i.sqr(ae),Jf),O=b(Y),x=i.addN(W,ce),G=i.sub(i.subN(i.sqr(x),Y),K),U=i.addN(O,K),H=i.subN(U,w),$=i.subN(O,K),M=i.mul(G,H),k=i.mul(U,$),I=i.mul(G,$),D=i.mul(H,U);return new N(M,k,D,I)}add(W){A(W);const{d:ce}=u,{X:ae,Y,Z:K,T:w}=this,{X:O,Y:x,Z:G,T:U}=W,H=i.mul(ae,O),$=i.mul(Y,x),M=i.mul(i.mulN(w,ce),U),k=i.mul(K,G),I=i.sub(i.subN(i.mulN(i.addN(ae,Y),i.addN(O,x)),H),$),D=i.subN(k,M),L=i.addN(k,M),X=i.sub($,b(H)),z=i.mul(I,D),ie=i.mul(L,X),fe=i.mul(I,X),R=i.mul(D,L);return new N(z,ie,R,fe)}subtract(W){return A(W),this.add(W.negate())}multiply(W){if(!c.isValidNot0(W))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:ce,f:ae}=V.mulSecret(this,W,f,j);return j([ce,ae])[0]}multiplyUnsafe(W){if(!c.isValid(W))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return W===Wf?N.ZERO:this.is0()||W===Xf?this:V.mulUnsafe(this,W,j)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return V.mulUnsafe(this,u.n).is0()}toAffine(W){const ce=this;let ae=W;if(ae!=null&&typeof ae!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof ae);const{X:Y,Y:K,Z:w}=ce,O=ce.is0();ae==null&&(ae=O?i.create(qS):i.inv(w));const x=i.mul(Y,ae),G=i.mul(K,ae),U=i.mul(w,ae);if(O)return{x:i.ZERO,y:i.ONE};if(!i.eql(U,i.ONE))throw new Error("invZ was invalid");return{x,y:G}}clearCofactor(){return f===Xf?this:f===Jf?this.double():f===_z?this.double().double():f===qS?this.double().double().double():this.multiplyUnsafe(f)}toBytes(){const{x:W,y:ce}=this.toAffine(),ae=i.toBytes(ce);return ae[ae.length-1]|=g(W)?128:0,ae}toHex(){return db(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const j=C=>r3(N,C),V=new c3(N,p);return V.bits>=6&&N.BASE.precompute(6),Object.freeze(N.prototype),Object.freeze(N),N}function Oz(e,t,s={}){if(nl(e),typeof t!="function")throw new Error('"hash" function param is required');const r=t,i=s;Tr(i,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function",toMontgomery:"function",toMontgomerySecret:"function"});const{prehash:c}=i,{BASE:u,Fp:f,Fn:p}=e,m=r.outputLen,g=2*f.BYTES;if(m!==void 0&&(Vc(m,"hash.outputLen"),m!==g))throw new Error(`hash.outputLen must be ${g}, got ${m}`);const y=i.randomBytes===void 0?id:i.randomBytes,b=i.toMontgomery,S=i.toMontgomerySecret,A=i.adjustScalarBytes===void 0?$=>$:i.adjustScalarBytes,N=i.domain===void 0?($,M,k)=>{if(Nr(k,"phflag"),M.length||k)throw new Error("Contexts/pre-hash are not supported");return $}:i.domain;function j($){return p.create(Lu($))}function V($){const M=O.secretKey;jt($,O.secretKey,"secretKey");const k=jt(r($),2*M,"hashedSecretKey"),I=A(k.slice(0,M)),D=k.slice(M,2*M),L=j(I);return{head:I,prefix:D,scalar:L}}function C($){const{head:M,prefix:k,scalar:I}=V($),D=u.multiply(I),L=D.toBytes();return{head:M,prefix:k,scalar:I,point:D,pointBytes:L}}function W($){return C($).pointBytes}function ce($=Uint8Array.of(),...M){const k=br(...M);return j(r(N(k,jt($,void 0,"context"),!!c)))}function ae($,M,k={}){Tr(k,{},{},"options"),$=Yh(jt($,void 0,"message")),c&&($=c($));const{prefix:I,scalar:D,pointBytes:L}=C(M),X=ce(k.context,I,$),z=u.multiply(X).toBytes(),ie=ce(k.context,z,L,$),fe=p.create(X+ie*D);if(!p.isValid(fe))throw new Error("sign failed: invalid s");const R=br(z,p.toBytes(fe));return jt(R,O.signature,"result")}const Y={zip215:i.zip215};function K($,M,k,I=Y){Tr(I);const{context:D}=I,L=I.zip215===void 0?!!Y.zip215:I.zip215,X=O.signature;$=jt($,X,"signature"),M=jt(M,void 0,"message"),k=jt(k,O.publicKey,"publicKey"),L!==void 0&&Nr(L,"zip215"),c&&(M=c(M));const z=X/2,ie=$.subarray(0,z),fe=Lu($.subarray(z,X));let R,J,le;try{R=e.fromBytes(k,L),J=e.fromBytes(ie,L),le=u.multiplyUnsafe(fe)}catch{return!1}if(!L&&R.isSmallOrder())return!1;const pe=ce(D,ie,k,M);return J.add(R.multiplyUnsafe(pe)).subtract(le).clearCofactor().is0()}const w=f.BYTES,O={secretKey:w,publicKey:w,signature:2*w,seed:w};function x($){return $=$===void 0?y(O.seed):$,jt($,O.seed,"seed")}function G($){return ad($)&&$.length===O.secretKey}function U($,M){try{return!!e.fromBytes($,M===void 0?Y.zip215:M)}catch{return!1}}const H={getExtendedPublicKey:C,randomSecretKey:x,isValidSecretKey:G,isValidPublicKey:U,toMontgomery($){if(b===void 0)throw new Error("Montgomery conversion is not supported for this curve");return b(e.fromBytes($))},toMontgomerySecret($){if(S===void 0)throw new Error("Montgomery conversion is not supported for this curve");return S($)}};return Object.freeze(O),Object.freeze(H),Object.freeze({keygen:u3(x,W),getPublicKey:W,sign:ae,verify:K,utils:H,Point:e,lengths:O})}const nv=BigInt(1),ZS=BigInt(2),Nz=BigInt(5),xz=BigInt(8),Eb=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Cz={p:Eb,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:xz,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Iz(e){const t=BigInt(10),s=BigInt(20),r=BigInt(40),i=BigInt(80),c=Eb,f=e*e%c*e%c,p=gr(f,ZS,c)*f%c,m=gr(p,nv,c)*e%c,g=gr(m,Nz,c)*m%c,y=gr(g,t,c)*g%c,b=gr(y,s,c)*y%c,S=gr(b,r,c)*b%c,A=gr(S,i,c)*S%c,N=gr(A,i,c)*S%c,j=gr(N,t,c)*g%c;return{pow_p_5_8:gr(j,ZS,c)*e%c,b2:f}}function d3(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const YS=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function Rz(e,t){const s=Eb,r=Ht(t*t*t,s),i=Ht(r*r*t,s),c=Iz(e*i).pow_p_5_8;let u=Ht(e*r*c,s);const f=Ht(t*u*u,s),p=u,m=Ht(u*YS,s),g=f===e,y=f===Ht(-e,s),b=f===Ht(-e*YS,s);return g&&(u=p),(y||b)&&(u=m),fz(u,s)&&(u=Ht(-u,s)),{isValid:g||y,value:u}}const Sb=Az(Cz,{uvRatio:Rz}),WS=Sb.Fp;function jz(e){const{y:t}=e;return WS.toBytes(WS.div(nv+t,nv-t))}function Mz(e){const t=Sb.Fp.BYTES;return Dn(e,t),d3(rd(e.subarray(0,t))).subarray(0,t)}function Dz(e){return Oz(Sb,rd,Object.assign({adjustScalarBytes:d3,toMontgomery:jz,toMontgomerySecret:Mz,zip215:!0},e))}const ta=Dz({}),ey=32;var Nc,Uz=(Nc=class extends Ip{constructor(t){if(super(),typeof t=="string"?this.data=qe(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==ey)throw new Error(`Invalid public key input. Expected ${ey} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return yi.ED25519}async verify(t,s){let r;if(typeof s=="string"){const i=$A(s);if(i.signatureScheme!=="ED25519")throw new Error("Invalid signature scheme");if(!Bu(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return ta.verify(r,t,this.toRawBytes())}},Nc.SIZE=ey,Nc);class XS{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(t,s){if(Pv(t),Dn(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),zs(i)}update(t){return zc(this),this.iHash.update(t),this}digestInto(t){zc(this),Gv(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:f,canXOF:p}=this;return t=t,t.finished=i,t.destroyed=c,t.blockLen=u,t.outputLen=f,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 Rp=(()=>{const e=((t,s,r)=>new XS(t,s).update(r).digest());return e.create=(t,s)=>new XS(t,s),e})();function Bz(e,t,s,r){Pv(e);const i=Hv({dkLen:32,asyncTick:10},r),{c,dkLen:u,asyncTick:f}=i;if(rs(c,"c"),rs(u,"dkLen"),rs(f,"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=PE(t,"password");try{const m=PE(s,"salt");try{const g=new Uint8Array(u),{iHash:y,oHash:b,outputLen:S}=Rp.create(e,p),A=new Uint8Array(S),N=Lz(y,b,m,A);return{c,dkLen:u,asyncTick:f,DK:g,outputLen:S,eng:N}}finally{typeof s=="string"&&zs(m)}}finally{typeof t=="string"&&zs(p)}}function Lz(e,t,s,r){const i=new Uint8Array(4),c=ih(i),u=e._cloneInto().update(s),f=t._cloneInto(),p=e._cloneInto,m=t._cloneInto;return{u1:(g,y)=>{c.setInt32(0,g,!1),u._cloneInto(f).update(i).digestInto(r),t._cloneInto(f).update(r).digestInto(r),y.set(r.subarray(0,y.length))},rounds:(g,y)=>{for(let b=1;b<g;b++){p.call(e,f).update(r).digestInto(r),m.call(t,f).update(r).digestInto(r);for(let S=0;S<y.length;S++)y[S]^=r[S]}},output:g=>(e.destroy(),t.destroy(),u.destroy(),f.destroy(),zs(r),g)}}function zz(e,t,s,r){const{c:i,dkLen:c,DK:u,outputLen:f,eng:p}=Bz(e,t,s,r);for(let m=1,g=0;g<c;m++,g+=f){const y=u.subarray(g,g+f);p.u1(m,y),p.rounds(i,y)}return p.output(u)}function $z(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 f3(e){if(typeof e!="string")throw new TypeError("invalid mnemonic type: "+typeof e);if(!$z(e))throw new TypeError("expected well-formed Unicode string");return e.normalize("NFKD")}function Vz(e){const t=f3(e),s=t.split(" ");if(![12,15,18,21,24].includes(s.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:s}}const Pz=e=>{if(typeof e!="string")throw new TypeError("invalid passphrase type: "+typeof e);return f3("mnemonic"+e)};function Gz(e,t=""){return zz(rd,Vz(e).nfkd,Pz(t),{c:2048,dkLen:64})}function JS(e){return!!new RegExp("^m\\/44'\\/784'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'+$").test(e)}function Fz(e){return Gz(e,"")}function Hz(e){return kr(Fz(e))}const qz=BigInt(0);class Zz extends Error{constructor(t=""){super(t)}}const sa={Err:Zz,_tlv:{encode:(e,t)=>{const{Err:s}=sa;if(Vc(e,"tag"),e<0||e>255)throw new s("tlv.encode: wrong tag");if(tz(t,"data"),t.length&1)throw new s("tlv.encode: unpadded data");const r=t.length/2,i=Yf(r);if(i.length/2&128)throw new s("tlv.encode: long form length too big");const c=r>127?Yf(i.length/2|128):"";return Yf(e)+c+i+t},decode(e,t){const{Err:s}=sa;t=jt(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 f=t.subarray(r,r+u);if(f.length!==u)throw new s("tlv.decode: wrong value length");return{v:f,l:t.subarray(r+u)}}},_int:{encode(e){const{Err:t}=sa;if(fb(e),e<qz)throw new t("integer: negative integers are not allowed");let s=Yf(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}=sa;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 Pc(e)}},toSig(e,t){const{Err:s,_int:r,_tlv:i}=sa;if(t!==void 0&&(Vc(t,"maxScalarBytes"),t<1))throw new s("invalid signature: maxScalarBytes must be positive");const c=jt(e,void 0,"signature"),{v:u,l:f}=i.decode(48,c);if(f.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}=sa;Tr(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)}},ty=(Object.freeze(sa._tlv),Object.freeze(sa._int),Object.freeze(sa));const KS=(e,t)=>(e+(e>=0?t:-t)/h3)/t;function Yz(e,t,s){Wh("scalar",e,ia,s);const[[r,i],[c,u]]=t,f=KS(u*e,s),p=KS(-i*e,s);let m=e-f*r-p*c,g=-f*i-p*u;const y=m<ia,b=g<ia;y&&(m=-m),b&&(g=-g);const S=mb(Math.ceil(pb(s)/2))+Ki;if(m<ia||m>=S||g<ia||g>=S)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:y,k1:m,k2neg:b,k2:g}}function sv(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function ny(e,t){Tr(e);const s={};for(let r of Object.keys(t))s[r]=e[r]===void 0?t[r]:e[r];return Nr(s.lowS,"lowS"),Nr(s.prehash,"prehash"),s.format!==void 0&&sv(s.format),s}const ia=BigInt(0),Ki=BigInt(1),h3=BigInt(2),sy=BigInt(3),Wz=BigInt(4);function Xz(e,t={}){const s=l3("weierstrass",e,t),r=s.Fp,i=s.Fn;let c=s.CURVE;const{h:u,n:f}=c;Tr(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:S}=t,A=t.randomBytes===void 0?id: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 N=p?{beta:p.beta,basises:p.basises.map(X=>[...X])}:void 0,j=m3(r,i);function V(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function C(X,z,ie){if(z.is0()){if(!m)throw new Error("bad point: ZERO");return Uint8Array.of(0)}const{x:fe,y:R}=z.toAffine(),J=r.toBytes(fe);if(Nr(ie,"isCompressed"),ie){V();const le=!r.isOdd(R);return br(p3(le),J)}else return br(Uint8Array.of(4),J,r.toBytes(R))}function W(X){jt(X,void 0,"Point");const{publicKey:z,publicKeyUncompressed:ie}=j,fe=X.length,R=X[0],J=X.subarray(1);if(m&&fe===1&&R===0)return{x:r.ZERO,y:r.ZERO};if(fe===z&&(R===2||R===3)){const le=r.fromBytes(J);if(!r.isValid(le))throw new Error("bad point: is not on curve, wrong x");const pe=w(le);let Te;try{Te=r.sqrt(pe)}catch(be){const _e=be instanceof Error?": "+be.message:"";throw new Error("bad point: is not on curve, sqrt error"+_e)}V();const Oe=r.isOdd(Te);return(R&1)===1!==Oe&&(Te=r.neg(Te)),{x:le,y:Te}}else if(fe===ie&&R===4){const le=r.BYTES,pe=r.fromBytes(J.subarray(0,le)),Te=r.fromBytes(J.subarray(le,le*2));if(!O(pe,Te))throw new Error("bad point: is not on curve");return{x:pe,y:Te}}else throw new Error(`bad point: got length ${fe}, expected compressed=${z} or uncompressed=${ie}`)}const ce=S===void 0?C:S,ae=b===void 0?W:b,Y=r.mul(c.b,sy),K=r.is0(c.a)?X=>r.ZERO:X=>r.mul(c.a,X);function w(X){const z=r.sqr(X),ie=r.mul(z,X);return r.add(r.add(ie,r.mul(X,c.a)),c.b)}function O(X,z){const ie=r.sqr(z),fe=w(X);return r.eql(ie,fe)}if(!O(c.Gx,c.Gy))throw new Error("bad curve params: generator point");const x=r.mul(r.pow(c.a,sy),Wz),G=r.mul(r.sqr(c.b),BigInt(27));if(r.is0(r.add(x,G)))throw new Error("bad curve params: a or b");function U(X,z,ie=!1){if(!r.isValid(z)||ie&&r.is0(z))throw new Error(`bad point coordinate ${X}`);return typeof z=="object"&&z!==null?r.create(z):z}function H(X){if(!(X instanceof I))throw new Error("Weierstrass Point expected")}function $(X){if(!N||!N.basises)throw new Error("no endo");return Yz(X,N.basises,i.ORDER)}function M(X,z,ie,fe){if(!i.isValid(fe))throw new RangeError("invalid scalar: out of range");if(N){const{k1neg:R,k1:J,k2neg:le,k2:pe}=$(fe),Te=new I(r.mul(ie.X,N.beta),ie.Y,ie.Z);X.push(R?ie.negate():ie,le?Te.negate():Te),z.push(J,pe)}else X.push(ie),z.push(fe)}const k=new WeakSet;class I{static BASE=new I(c.Gx,c.Gy,r.ONE);static ZERO=new I(r.ZERO,r.ONE,r.ZERO);static Fp=r;static Fn=i;X;Y;Z;constructor(z,ie,fe){this.X=U("x",z),this.Y=U("y",ie,!0),this.Z=U("z",fe),Object.freeze(this)}static CURVE(){return c}static fromAffine(z){const{x:ie,y:fe}=z||{};if(!z||!r.isValid(ie)||!r.isValid(fe))throw new Error("invalid affine point");if(z instanceof I)throw new Error("projective point not allowed");return r.is0(ie)&&r.is0(fe)?I.ZERO:new I(ie,fe,r.ONE)}static fromBytes(z){const ie=I.fromAffine(ae(jt(z,void 0,"point")));return ie.assertValidity(),ie}static fromHex(z){return I.fromBytes(qh(z))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(z=6,ie=!0){return L.setWindowSize(this,z),ie||this.multiply(sy),this}assertValidity(){const z=this;if(z.is0()){if(m&&r.is0(z.X)&&r.eql(z.Y,r.ONE)&&r.is0(z.Z))return;throw new Error("bad point: ZERO")}if(k.has(z))return;const{x:ie,y:fe}=z.toAffine();if(!r.isValid(ie)||!r.isValid(fe))throw new Error("bad point: x or y not field elements");if(!O(ie,fe))throw new Error("bad point: equation left != right");if(!z.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");k.add(z)}hasEvenY(){const{y:z}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(z)}equals(z){H(z);const{X:ie,Y:fe,Z:R}=this,{X:J,Y:le,Z:pe}=z,Te=r.eql(r.mul(ie,pe),r.mul(J,R)),Oe=r.eql(r.mul(fe,pe),r.mul(le,R));return Te&&Oe}negate(){return new I(this.X,r.neg(this.Y),this.Z)}double(){const{X:z,Y:ie,Z:fe}=this;let R=r.ZERO,J=r.ZERO,le=r.ZERO,pe=r.mul(z,z),Te=r.mul(ie,ie),Oe=r.mul(fe,fe),Ae=r.mul(z,ie);return Ae=r.add(Ae,Ae),le=r.mul(z,fe),le=r.add(le,le),R=K(le),J=r.mul(Y,Oe),J=r.add(R,J),R=r.sub(Te,J),J=r.add(Te,J),J=r.mul(R,J),R=r.mul(Ae,R),le=r.mul(Y,le),Oe=K(Oe),Ae=r.sub(pe,Oe),Ae=K(Ae),Ae=r.add(Ae,le),le=r.add(pe,pe),pe=r.add(le,pe),pe=r.add(pe,Oe),pe=r.mul(pe,Ae),J=r.add(J,pe),Oe=r.mul(ie,fe),Oe=r.add(Oe,Oe),pe=r.mul(Oe,Ae),R=r.sub(R,pe),le=r.mul(Oe,Te),le=r.add(le,le),le=r.add(le,le),new I(R,J,le)}add(z){H(z);const{X:ie,Y:fe,Z:R}=this,{X:J,Y:le,Z:pe}=z;let Te=r.ZERO,Oe=r.ZERO,Ae=r.ZERO,be=r.mul(ie,J),_e=r.mul(fe,le),Pe=r.mul(R,pe),at=r.add(ie,fe),P=r.add(J,le);at=r.mul(at,P),P=r.add(be,_e),at=r.sub(at,P),P=r.add(ie,R);let te=r.add(J,pe);return P=r.mul(P,te),te=r.add(be,Pe),P=r.sub(P,te),te=r.add(fe,R),Te=r.add(le,pe),te=r.mul(te,Te),Te=r.add(_e,Pe),te=r.sub(te,Te),Ae=K(P),Te=r.mul(Y,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=K(Pe),P=r.mul(Y,P),_e=r.add(_e,Pe),Pe=r.sub(be,Pe),Pe=K(Pe),P=r.add(P,Pe),be=r.mul(_e,P),Oe=r.add(Oe,be),be=r.mul(te,P),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 I(Te,Oe,Ae)}subtract(z){return H(z),this.add(z.negate())}is0(){return this.equals(I.ZERO)}multiply(z){if(!i.isValidNot0(z))throw new RangeError("invalid scalar: out of range");const{p:ie,f:fe}=L.mulSecret(this,z,u,D);return D([ie,fe])[0]}multiplyUnsafe(z){const ie=this,fe=z;if(!i.isValid(fe))throw new RangeError("invalid scalar: out of range");if(fe===ia||ie.is0())return I.ZERO;if(fe===Ki)return ie;if(L.hasWindowSize(this))return L.mulUnsafe(ie,fe,D);const R=[],J=[];return M(R,J,ie,fe),tv(I,R,J)}mulAddUnsafe(z,ie,fe){H(ie);const R=[],J=[];return M(R,J,this,z),M(R,J,ie,fe),tv(I,R,J)}toAffine(z){const ie=this;let fe=z;if(fe!=null&&!r.isValid(fe))throw new RangeError('"invertedZ" expected valid field element');const{X:R,Y:J,Z:le}=ie;if(r.eql(le,r.ONE))return{x:R,y:J};const pe=ie.is0();fe==null&&(fe=pe?r.ONE:r.inv(le));const Te=r.mul(R,fe),Oe=r.mul(J,fe),Ae=r.mul(le,fe);if(pe)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===Ki?!0:y?y(I,this):L.mulUnsafe(this,f).is0()}clearCofactor(){return u===Ki?this:g?g(I,this):this.multiplyUnsafe(u)}isSmallOrder(){return u===Ki?this.is0():this.clearCofactor().is0()}toBytes(z=!0){return Nr(z,"isCompressed"),this.assertValidity(),ce(I,this,z)}toHex(z=!0){return db(this.toBytes(z))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const D=X=>r3(I,X),L=new c3(I,A);return L.bits>=6&&I.BASE.precompute(6),Object.freeze(I.prototype),Object.freeze(I),I}function p3(e){return Uint8Array.of(e?2:3)}function m3(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Jz(e,t={}){nl(e);const{Fn:s}=e,r=t.randomBytes===void 0?id:t.randomBytes,i=Object.assign(m3(e.Fp,s),{seed:Math.max(wb(s.ORDER),16)});function c(S){try{const A=s.fromBytes(S);return s.isValidNot0(A)}catch{return!1}}function u(S,A){const{publicKey:N,publicKeyUncompressed:j}=i;try{const V=S.length;return A===!0&&V!==N||A===!1&&V!==j?!1:!e.fromBytes(S).is0()}catch{return!1}}function f(S){return S=S===void 0?r(i.seed):S,s3(jt(S,i.seed,"seed"),s.ORDER)}function p(S,A=!0){return e.BASE.multiply(s.fromBytes(S)).toBytes(A)}function m(S){const{secretKey:A,publicKey:N,publicKeyUncompressed:j}=i,V=s._lengths;if(!ad(S))return;const C=jt(S,void 0,"key").length,W=C===N||C===j,ce=C===A||!!V?.includes(C);if(!(W&&ce))return W}function g(S,A,N=!0){if(m(S)===!0)throw new Error("first arg must be private key");if(m(A)===!1)throw new Error("second arg must be public key");const j=s.fromBytes(S),V=e.fromBytes(A);if(V.is0())throw new Error("invalid public key: point at infinity");return V.multiply(j).toBytes(N)}const y={isValidSecretKey:c,isValidPublicKey:u,randomSecretKey:f},b=u3(f,p);return Object.freeze(y),Object.freeze(i),Object.freeze({getPublicKey:p,getSharedSecret:g,keygen:b,Point:e,utils:y,lengths:i})}function Kz(e,t,s={}){nl(e);const r=t;Pv(r),Tr(s,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const i=Object.assign({},s),c=i.randomBytes===void 0?id:i.randomBytes,u=i.hmac===void 0?(X,z)=>Rp(r,X,z):i.hmac,{Fp:f,Fn:p}=e,{ORDER:m,BITS:g}=p,y=wb(m),b=a3(c,y),{keygen:S,getPublicKey:A,getSharedSecret:N,utils:j,lengths:V}=Jz(e,i),C={prehash:!0,lowS:typeof i.lowS=="boolean"?i.lowS:!0,format:"compact",extraEntropy:!1},W=m*h3+Ki<f.ORDER;function ce(X){const z=m>>Ki;return X>z}function ae(X,z){if(!p.isValidNot0(z))throw new Error(`invalid signature ${X}: out of range 1..Point.Fn.ORDER`);return z}function Y(){if(!f.isOdd)throw new Error("Field doesn't support isOdd")}function K(X,z,ie){return Y(),(X===ie?0:2)|Number(f.isOdd(z))}function w(){if(W)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function O(X,z){sv(z);const ie=V.signature,fe=z==="compact"?ie:z==="recovered"?ie+1:void 0;return jt(X,fe)}class x{r;s;recovery;constructor(z,ie,fe){if(this.r=ae("r",z),this.s=ae("s",ie),fe!=null){if(w(),![0,1,2,3].includes(fe))throw new Error("invalid recovery id");this.recovery=fe}Object.freeze(this)}static fromBytes(z,ie=C.format){O(z,ie);let fe;if(ie==="der"){if(z.length>2*p.BYTES+16)throw new ty.Err("invalid signature: DER signature too long");const{r:pe,s:Te}=ty.toSig(jt(z),p.BYTES+1);return new x(pe,Te)}ie==="recovered"&&(fe=z[0],ie="compact",z=z.subarray(1));const R=V.signature/2,J=z.subarray(0,R),le=z.subarray(R,R*2);return new x(p.fromBytes(J),p.fromBytes(le),fe)}static fromHex(z,ie){return this.fromBytes(qh(z),ie)}assertRecovery(){const{recovery:z}=this;if(z==null)throw new Error("invalid recovery id: must be present");return z}addRecoveryBit(z){return new x(this.r,this.s,z)}recoverPublicKey(z){const{r:ie,s:fe}=this,R=this.assertRecovery(),J=R===2||R===3?ie+m:ie;if(!f.isValid(J))throw new Error("invalid recovery id: sig.r+curve.n != R.x");const le=f.toBytes(J),pe=e.fromBytes(br(p3((R&1)===0),le)),Te=p.inv(J),Oe=U(jt(z,void 0,"msgHash")),Ae=p.create(-Oe*Te),be=p.create(fe*Te),_e=e.BASE.mulAddUnsafe(Ae,pe,be);if(_e.is0())throw new Error("invalid recovery: point at infinify");return _e.assertValidity(),_e}hasHighS(){return ce(this.s)}toBytes(z=C.format){if(sv(z),z==="der")return qh(ty.hexFromSig(this));const{r:ie,s:fe}=this,R=p.toBytes(ie),J=p.toBytes(fe);return z==="recovered"?(w(),br(Uint8Array.of(this.assertRecovery()),R,J)):br(R,J)}toHex(z){return db(this.toBytes(z))}}Object.freeze(x.prototype),Object.freeze(x);const G=i.bits2int===void 0?function(z){if(z.length>8192)throw new Error("input is too large");const ie=Pc(z),fe=z.length*8-g;return fe>0?ie>>BigInt(fe):ie}:i.bits2int,U=i.bits2int_modN===void 0?function(z){return p.create(G(z))}:i.bits2int_modN,H=mb(g);function $(X){return Wh("num < 2^"+g,X,ia,H),p.toBytes(X)}function M(X,z){return jt(X,void 0,"message"),z?jt(r(X),void 0,"prehashed message"):X}function k(X,z,ie){const{lowS:fe,prehash:R,extraEntropy:J}=ny(ie,C);X=M(X,R);const le=U(X),pe=p.fromBytes(z);if(!p.isValidNot0(pe))throw new Error("invalid private key");const Te=[$(pe),$(le)];if(J!=null&&J!==!1){const _e=J===!0?c(V.secretKey):J;Te.push(jt(_e,void 0,"extraEntropy"))}const Oe=br(...Te),Ae=le;function be(_e){const Pe=G(_e);if(!p.isValidNot0(Pe))return;const at=e.BASE.multiply(Pe).toAffine(),P=p.create(at.x);if(P===ia)return;let te;if(b!==void 0){const ue=Pc(s3(b(y),m)),ze=p.inv(p.mul(ue,Pe)),Le=p.mul(ue,Ae),Mt=p.mul(ue,pe);te=p.create(ze*p.create(Le+Mt*P))}else{const ue=cz(Pe,m);te=p.create(ue*p.create(Ae+P*pe))}if(te===ia)return;let de=K(at.x,at.y,P),he=te;return fe&&ce(te)&&(he=p.neg(te),de^=1),new x(P,he,W?void 0:de)}return{seed:Oe,k2sig:be}}function I(X,z,ie={}){const{seed:fe,k2sig:R}=k(X,z,ie);return sz(r.outputLen,p.BYTES,u)(fe,R).toBytes(ie.format)}function D(X,z,ie,fe={}){const{lowS:R,prehash:J,format:le}=ny(fe,C);if(ie=jt(ie,void 0,"publicKey"),z=M(z,J),!ad(X)){const pe=X instanceof x?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+pe)}O(X,le);try{const pe=x.fromBytes(X,le),Te=e.fromBytes(ie);if(Te.is0()||R&&pe.hasHighS())return!1;const{r:Oe,s:Ae}=pe,be=U(z),_e=p.inv(Ae),Pe=p.create(be*_e),at=p.create(Oe*_e),P=e.BASE.mulAddUnsafe(Pe,Te,at);if(P.is0())return!1;const te=P.toAffine();return!(p.create(te.x)!==Oe||le==="recovered"&&pe.recovery!==K(te.x,te.y,Oe))}catch{return!1}}function L(X,z,ie={}){const{prehash:fe}=ny(ie,C);return z=M(z,fe),x.fromBytes(X,"recovered").recoverPublicKey(z).toBytes()}return Object.freeze({keygen:S,getPublicKey:A,getSharedSecret:N,utils:j,lengths:V,Point:e,sign:I,verify:D,recoverPublicKey:L,Signature:x,hash:r})}const Qz={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},e$=Xz(Qz),xu=Kz(e$,PA),ry=33,rv=64;var xc;xc=class extends Ip{constructor(t){if(super(),typeof t=="string"?this.data=qe(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==ry)throw new Error(`Invalid public key input. Expected ${ry} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return yi.Passkey}async verify(t,s){const r=g3(s),i=JSON.parse(r.clientDataJson);if(i.type!=="webauthn.get"||!Bu(t,qe(i.challenge.replace(/-/g,"+").replace(/_/g,"/"))))return!1;const c=r.userSignature.slice(1+rv);if(!Bu(this.toRawBytes(),c))return!1;const u=new Uint8Array([...r.authenticatorData,...PA(new TextEncoder().encode(r.clientDataJson))]),f=r.userSignature.slice(1,rv+1);return xu.verify(f,u,c)}},xc.SIZE=ry;function g3(e){const t=typeof e=="string"?qe(e):e;if(t[0]!==yi.Passkey)throw new Error("Invalid signature scheme");const s=ek.parse(t.slice(1));return{signatureScheme:"Passkey",serializedSignature:st(t),signature:t,authenticatorData:s.authenticatorData,clientDataJson:s.clientDataJson,userSignature:new Uint8Array(s.userSignature),publicKey:new Uint8Array(s.userSignature.slice(1+rv))}}function t$(e){for(let t=0;t<e.length;t++)if(e[t]!==0)return t;return-1}function _b(e,t){return Fv(e.toString(16).padStart(t*2,"0").slice(-t*2))}function y3(e,t){const s=_b(e,t),r=t$(s);return r===-1?new Uint8Array([0]):s.slice(r)}function n$(e){return e==="accounts.google.com"?"https://accounts.google.com":e}function s$(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 r$(e){let t=[];for(let s=0;s<e.length;s++){const r=s$(e.charAt(s));t=t.concat(r)}return t}function a$(e,t){if(e.length<2)throw new Error(`Input (s = ${e}) is not tightly packed because s.length < 2`);let s=r$(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 f=0;f<s.length;f+=8){const p=s.slice(f,f+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 v3(e,t){const[s,r]=i$(a$(e.value,e.indexMod4));if(s!==t)throw new Error(`Invalid field name: found ${s} expected ${t}`);return r}const o$=E.struct("ZkLoginSignature",{inputs:E.struct("ZkLoginSignatureInputs",{proofPoints:E.struct("ZkLoginSignatureInputsProofPoints",{a:E.vector(E.string()),b:E.vector(E.vector(E.string())),c:E.vector(E.string())}),issBase64Details:E.struct("ZkLoginSignatureInputsClaim",{value:E.string(),indexMod4:E.u8()}),headerBase64:E.string(),addressSeed:E.string()}),maxEpoch:E.u64(),userSignature:E.byteVector()});function c$(e){return o$.parse(typeof e=="string"?qe(e):e)}var l$=class ei extends Ip{#e;#t;#r;constructor(t,{client:s}={}){super(),this.#t=s,typeof t=="string"?this.#e=qe(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=gc(this.#e,!1))}get legacyAddress(){return this.#r}static fromBytes(t,{client:s,address:r,legacyAddress:i}={}){let c;if(i===!0?c=new ei(gc(t,!0),{client:s}):i===!1?c=new ei(gc(t,!1),{client:s}):r?(c=new ei(gc(t,!1),{client:s}),c.toSuiAddress()!==r&&(c=new ei(gc(t,!0),{client:s}))):c=new ei(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=v3(r,"iss"),u=av(BigInt(i),c,{legacyAddress:!0});if(u.toSuiAddress()===t)return u;const f=av(BigInt(i),c,{legacyAddress:!1});if(f.toSuiAddress()!==t)throw new Error("Proof does not match address");return f}equals(t){return super.equals(t)}toSuiAddress(){return this.#r?this.#s():super.toSuiAddress()}#s(){const t=gc(this.#e,!0),s=new Uint8Array(t.length+1);return s[0]=this.flag(),s.set(t,1),ye(ed($c(s,{dkLen:32})).slice(0,Qc*2))}toRawBytes(){return this.#e}flag(){return yi.ZkLogin}async verify(t,s){throw Error("does not support")}verifyPersonalMessage(t,s){const r=iv(s);return QS({address:new ei(r.publicKey).toSuiAddress(),bytes:st(t),signature:r.serializedSignature,intentScope:"PersonalMessage",client:this.#t})}verifyTransaction(t,s){const r=iv(s);return QS({address:new ei(r.publicKey).toSuiAddress(),bytes:st(t),signature:r.serializedSignature,intentScope:"TransactionData",client:this.#t})}verifyAddress(t){return t===super.toSuiAddress()||t===this.#s()}};function av(e,t,s){if(s.legacyAddress===void 0)throw new Error("legacyAddress parameter must be specified");const r=s.legacyAddress?y3(e,32):_b(e,32),i=new TextEncoder().encode(n$(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 l$(c,s)}function gc(e,t){const s=e[0]+1,r=BigInt(`0x${kr(e.slice(s))}`),i=t?y3(r,32):_b(r,32),c=new Uint8Array(s+i.length);return c.set(e.slice(0,s),0),c.set(i,s),c}async function QS({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 iv(e){const t=typeof e=="string"?qe(e):e;if(t[0]!==yi.ZkLogin)throw new Error("Invalid signature scheme");const{inputs:s,maxEpoch:r,userSignature:i}=c$(t.slice(1)),{issBase64Details:c,addressSeed:u}=s,f=v3(c,"iss"),p=av(BigInt(u),f,{legacyAddress:!1});return{serializedSignature:st(t),signatureScheme:"ZkLogin",zkLogin:{inputs:s,maxEpoch:r,userSignature:i,iss:f,addressSeed:BigInt(u)},signature:t,publicKey:p.toRawBytes()}}function u$({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([yi[t]]),i.set(e,1),i.set(r,1+e.length),st(i)}function d$(e){const t=qe(e),s=ub[t[0]];switch(s){case"Passkey":return g3(e);case"MultiSig":return{serializedSignature:e,signatureScheme:s,multisig:F.MultiSig.parse(t.slice(1)),bytes:t,signature:void 0};case"ZkLogin":return iv(e);case"ED25519":case"Secp256k1":case"Secp256r1":return $A(e);default:throw new Error("Unsupported signature scheme")}}const Eh=32,b3="suiprivkey";var w3=class{async signWithIntent(e,t){const s=$c(zA(t,e),{dkLen:32});return{signature:u$({signature:await this.sign(s),signatureScheme:this.getKeyScheme(),publicKey:this.getPublicKey()}),bytes:st(e)}}async signTransaction(e){return this.signWithIntent(e,"TransactionData")}async signPersonalMessage(e){const{signature:t}=await this.signWithIntent(E.byteVector().serialize(e).toBytes(),"PersonalMessage");return{bytes:st(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()}},f$=class extends w3{};function h$(e){const{prefix:t,words:s}=Ch.decode(e);if(t!==b3)throw new Error("invalid private key prefix");const r=new Uint8Array(Ch.fromWords(s)),i=r.slice(1);return{scheme:ub[r[0]],secretKey:i}}function p$(e,t){if(e.length!==Eh)throw new Error("Invalid bytes length");const s=yi[t],r=new Uint8Array(e.length+1);return r.set([s]),r.set(e,1),Ch.encode(b3,Ch.toWords(r))}const m$="ed25519 seed",g$=2147483648,y$=new RegExp("^m(\\/[0-9]+')+$"),T3=e=>e.replace("'",""),v$=e=>{const t=Rp.create(rd,new TextEncoder().encode(m$)).update(Ku(e)).digest();return{key:t.slice(0,32),chainCode:t.slice(32)}},b$=({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=Rp.create(rd,t).update(i).digest();return{key:c.slice(0,32),chainCode:c.slice(32)}},w$=e=>y$.test(e)?!e.split("/").slice(1).map(T3).some(isNaN):!1,e_=(e,t,s=g$)=>{if(!w$(e))throw new Error("Invalid derivation path");const{key:r,chainCode:i}=v$(t);return e.split("/").slice(1).map(T3).map(c=>parseInt(c,10)).reduce((c,u)=>b$(c,u+s),{key:r,chainCode:i})},t_="m/44'/784'/0'/0'/0'";var T$=class Eu extends f${constructor(t){if(super(),t)this.keypair={publicKey:t.publicKey,secretKey:t.secretKey.slice(0,32)};else{const s=ta.utils.randomSecretKey();this.keypair={publicKey:ta.getPublicKey(s),secretKey:s}}}getKeyScheme(){return"ED25519"}static generate(){const t=ta.utils.randomSecretKey();return new Eu({publicKey:ta.getPublicKey(t),secretKey:t})}static fromSecretKey(t,s){if(typeof t=="string"){const c=h$(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!==Eh)throw new Error(`Wrong secretKey size. Expected ${Eh} bytes, got ${r}.`);const i={publicKey:ta.getPublicKey(t),secretKey:t};if(!s||!s.skipValidation){const c=new TextEncoder().encode("sui validation"),u=ta.sign(c,t);if(!ta.verify(u,c,i.publicKey))throw new Error("provided secretKey is invalid")}return new Eu(i)}getPublicKey(){return new Uz(this.keypair.publicKey)}getSecretKey(){return p$(this.keypair.secretKey.slice(0,Eh),this.getKeyScheme())}async sign(t){return ta.sign(t,this.keypair.secretKey)}static deriveKeypair(t,s){if(s==null&&(s=t_),!JS(s))throw new Error("Invalid derivation path");const{key:r}=e_(s,Hz(t));return Eu.fromSecretKey(r)}static deriveKeypairFromSeed(t,s){if(s==null&&(s=t_),!JS(s))throw new Error("Invalid derivation path");const r=typeof t=="string"?t:kr(t),{key:i}=e_(s,r);return Eu.fromSecretKey(i)}};const ay=33;var Cc,E3=(Cc=class extends Ip{constructor(t){if(super(),typeof t=="string"?this.data=qe(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==ay)throw new Error(`Invalid public key input. Expected ${ay} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return yi.Secp256r1}async verify(t,s){let r;if(typeof s=="string"){const i=d$(s);if(i.signatureScheme!=="Secp256r1")throw new Error("Invalid signature scheme");if(!Bu(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return xu.verify(r,t,this.toRawBytes())}},Cc.SIZE=ay,Cc),E$=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 f=u.result;f&&(c.push([f.key,f.value]),f.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 S$(e){const t=new Uint8Array(e),s=t.slice(1,33),r=(t.slice(33,65)[31]&1)===0?2:3,i=new Uint8Array(E3.SIZE);return i[0]=r,i.set(s,1),i}var n_=class ov extends w3{#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 ov(s.privateKey,S$(new Uint8Array(r)))}static import(t){return new ov(t.privateKey,t.publicKey)}getKeyScheme(){return"Secp256r1"}constructor(t,s){super(),this.privateKey=t,this.#e=new E3(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=xu.Signature.fromBytes(new Uint8Array(s));return(r.hasHighS()?new xu.Signature(r.r,xu.Point.Fn.neg(r.s)):r).toBytes("compact")}};const _$="dev-wallet-webcrypto",k$="accounts",iy="__account_meta__";var A$=class extends qL{#e;constructor(e){super(),this.id="webcrypto",this.name="WebCrypto Signer",this.#e=new E$(e?.dbName??_$,e?.storeName??k$)}async initialize(){const e=await this.#e.entries(),t=await this.#e.get(iy)??[],s=[];for(const[r,i]of e){if(r===iy)continue;const c=r;try{const u=i,f=n_.import(u),p=t.find(m=>m.address===c);s.push(Hy(f,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 n_.generate(),s=t.getPublicKey().toSuiAddress(),r=Hy(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(iy,e)}},oy={exports:{}},Ge={};var s_;function O$(){if(s_)return Ge;s_=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"),f=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"),S=Symbol.iterator;function A(R){return R===null||typeof R!="object"?null:(R=S&&R[S]||R["@@iterator"],typeof R=="function"?R:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,V={};function C(R,J,le){this.props=R,this.context=J,this.refs=V,this.updater=le||N}C.prototype.isReactComponent={},C.prototype.setState=function(R,J){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,J,"setState")},C.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function W(){}W.prototype=C.prototype;function ce(R,J,le){this.props=R,this.context=J,this.refs=V,this.updater=le||N}var ae=ce.prototype=new W;ae.constructor=ce,j(ae,C.prototype),ae.isPureReactComponent=!0;var Y=Array.isArray;function K(){}var w={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function x(R,J,le){var pe=le.ref;return{$$typeof:e,type:R,key:J,ref:pe!==void 0?pe:null,props:le}}function G(R,J){return x(R.type,J,R.props)}function U(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function H(R){var J={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(le){return J[le]})}var $=/\/+/g;function M(R,J){return typeof R=="object"&&R!==null&&R.key!=null?H(""+R.key):J.toString(36)}function k(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(K,K):(R.status="pending",R.then(function(J){R.status==="pending"&&(R.status="fulfilled",R.value=J)},function(J){R.status==="pending"&&(R.status="rejected",R.reason=J)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function I(R,J,le,pe,Te){var Oe=typeof R;(Oe==="undefined"||Oe==="boolean")&&(R=null);var Ae=!1;if(R===null)Ae=!0;else switch(Oe){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(R.$$typeof){case e:case t:Ae=!0;break;case g:return Ae=R._init,I(Ae(R._payload),J,le,pe,Te)}}if(Ae)return Te=Te(R),Ae=pe===""?"."+M(R,0):pe,Y(Te)?(le="",Ae!=null&&(le=Ae.replace($,"$&/")+"/"),I(Te,J,le,"",function(Pe){return Pe})):Te!=null&&(U(Te)&&(Te=G(Te,le+(Te.key==null||R&&R.key===Te.key?"":(""+Te.key).replace($,"$&/")+"/")+Ae)),J.push(Te)),1;Ae=0;var be=pe===""?".":pe+":";if(Y(R))for(var _e=0;_e<R.length;_e++)pe=R[_e],Oe=be+M(pe,_e),Ae+=I(pe,J,le,Oe,Te);else if(_e=A(R),typeof _e=="function")for(R=_e.call(R),_e=0;!(pe=R.next()).done;)pe=pe.value,Oe=be+M(pe,_e++),Ae+=I(pe,J,le,Oe,Te);else if(Oe==="object"){if(typeof R.then=="function")return I(k(R),J,le,pe,Te);throw J=String(R),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function D(R,J,le){if(R==null)return R;var pe=[],Te=0;return I(R,pe,"","",function(Oe){return J.call(le,Oe,Te++)}),pe}function L(R){if(R._status===-1){var J=R._result,le=J();le.then(function(pe){(R._status===0||R._status===-1)&&(R._status=1,R._result=pe,le.status===void 0&&(le.status="fulfilled",le.value=pe))},function(pe){(R._status===0||R._status===-1)&&(R._status=2,R._result=pe,le.status===void 0&&(le.status="rejected",le.reason=pe))}),R._status===-1&&(R._status=0,R._result=le)}if(R._status===1)return R._result.default;throw R._result}var X=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var J=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)};function z(R){var J=w.T,le={};le.types=J!==null?J.types:null,w.T=le;try{var pe=R(),Te=w.S;Te!==null&&Te(le,pe),typeof pe=="object"&&pe!==null&&typeof pe.then=="function"&&pe.then(K,X)}catch(Oe){X(Oe)}finally{J!==null&&le.types!==null&&(J.types=le.types),w.T=J}}function ie(R){var J=w.T;if(J!==null){var le=J.types;le===null?J.types=[R]:le.indexOf(R)===-1&&le.push(R)}else z(ie.bind(null,R))}var fe={map:D,forEach:function(R,J,le){D(R,function(){J.apply(this,arguments)},le)},count:function(R){var J=0;return D(R,function(){J++}),J},toArray:function(R){return D(R,function(J){return J})||[]},only:function(R){if(!U(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Ge.Activity=y,Ge.Children=fe,Ge.Component=C,Ge.Fragment=s,Ge.Profiler=i,Ge.PureComponent=ce,Ge.StrictMode=r,Ge.Suspense=p,Ge.ViewTransition=b,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(R){return w.H.useMemoCache(R)}},Ge.addTransitionType=ie,Ge.cache=function(R){return function(){return R.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(R,J,le){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var pe=j({},R.props),Te=R.key;if(J!=null)for(Oe in J.key!==void 0&&(Te=""+J.key),J)!O.call(J,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&J.ref===void 0||(pe[Oe]=J[Oe]);var Oe=arguments.length-2;if(Oe===1)pe.children=le;else if(1<Oe){for(var Ae=Array(Oe),be=0;be<Oe;be++)Ae[be]=arguments[be+2];pe.children=Ae}return x(R.type,Te,pe)},Ge.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:c,_context:R},R},Ge.createElement=function(R,J,le){var pe,Te={},Oe=null;if(J!=null)for(pe in J.key!==void 0&&(Oe=""+J.key),J)O.call(J,pe)&&pe!=="key"&&pe!=="__self"&&pe!=="__source"&&(Te[pe]=J[pe]);var Ae=arguments.length-2;if(Ae===1)Te.children=le;else if(1<Ae){for(var be=Array(Ae),_e=0;_e<Ae;_e++)be[_e]=arguments[_e+2];Te.children=be}if(R&&R.defaultProps)for(pe in Ae=R.defaultProps,Ae)Te[pe]===void 0&&(Te[pe]=Ae[pe]);return x(R,Oe,Te)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(R){return{$$typeof:f,render:R}},Ge.isValidElement=U,Ge.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:L}},Ge.memo=function(R,J){return{$$typeof:m,type:R,compare:J===void 0?null:J}},Ge.startTransition=z,Ge.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},Ge.use=function(R){return w.H.use(R)},Ge.useActionState=function(R,J,le){return w.H.useActionState(R,J,le)},Ge.useCallback=function(R,J){return w.H.useCallback(R,J)},Ge.useContext=function(R){return w.H.useContext(R)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(R,J){return w.H.useDeferredValue(R,J)},Ge.useEffect=function(R,J){return w.H.useEffect(R,J)},Ge.useEffectEvent=function(R){return w.H.useEffectEvent(R)},Ge.useId=function(){return w.H.useId()},Ge.useImperativeHandle=function(R,J,le){return w.H.useImperativeHandle(R,J,le)},Ge.useInsertionEffect=function(R,J){return w.H.useInsertionEffect(R,J)},Ge.useLayoutEffect=function(R,J){return w.H.useLayoutEffect(R,J)},Ge.useMemo=function(R,J){return w.H.useMemo(R,J)},Ge.useOptimistic=function(R,J){return w.H.useOptimistic(R,J)},Ge.useReducer=function(R,J,le){return w.H.useReducer(R,J,le)},Ge.useRef=function(R){return w.H.useRef(R)},Ge.useState=function(R){return w.H.useState(R)},Ge.useSyncExternalStore=function(R,J,le){return w.H.useSyncExternalStore(R,J,le)},Ge.useTransition=function(){return w.H.useTransition()},Ge.version="19.3.0",Ge}var r_;function kb(){return r_||(r_=1,oy.exports=O$()),oy.exports}var Ve=kb();const S3=FC(Ve),_3=GC({__proto__:null,default:S3},[Ve]),k3=Ve.createContext(null);function N$({dAppKit:e,children:t}){return T.jsx(k3.Provider,{value:e,children:t})}function bo(e){const t=Ve.useContext(k3);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 cy=0,a_=[];function x$(){return cy+=1,()=>{if(cy-=1,cy===0){let e=a_;a_=[];for(let t of e)t()}}}function Jh(e){let t=x$(),s;try{s=Promise.resolve(e()).finally(t)}catch(r){throw t(),r}return s.t=!0,s}let Xs=[],Su=0;const cv=4,Sh=globalThis.nanostoresGlobal||={epoch:0};let C$=()=>{let e,t;for(;Su<Xs.length;){t=Su,Su+=cv;try{Xs[t](Xs[t+1].value,Xs[t+2],Xs[t+3])}catch(s){e=s}}if(Xs.length=Su=0,e)throw e};const Kh=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=Su;c<Xs.length;)Xs[c]===r?Xs.splice(c,cv):c+=cv;let i=t.indexOf(r);~i&&(t.splice(i,1),--s.lc||s.off())}},notify(r,i){Sh.epoch++;let c=!Xs.length&&!0;for(let u of t)Xs.push(u,s,r,i);c&&C$()},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},I$=e=>e,R$=5,Kf=6,Qf=10;let j$=(e,t,s,r)=>(e.events=e.events||{},e.events[s+Qf]||(e.events[s+Qf]=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+Qf](),delete e.events[s+Qf]))});const M$=1e3;let jp=(e,t)=>j$(e,r=>{let i=t(r);i&&e.events[Kf].push(i)},R$,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[Kf]=[],e.off=()=>{c(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let u of e.events[Kf])u();e.events[Kf]=[]}},M$)},()=>{e.listen=i,e.off=c}}),D$=(e,t,s)=>{Array.isArray(e)||(e=[e]);let r,i,c=()=>{if(i===Sh.epoch)return;i=Sh.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=Sh.epoch)}},u=Kh(),f=u.get;u.get=()=>(c(),f());let p=c;return jp(u,()=>{let m=e.map(g=>g.listen(p));return c(),()=>{for(let g of m)g()}}),u};const ly=(e,t)=>D$(e,t);function i_(e,t){let s=U$(t),r=e;for(let i of s){if(r==null)return;r=r[i]}return r}const o_=/(.*)\[(\d+)\]/;function U$(e){return e.split(".").flatMap(t=>A3(t))}function A3(e){if(o_.test(e)){let[,t,s]=e.match(o_);return[...A3(t),s]}return[e]}function B$(e,t,s){let r=new Set(t);return e.listen((i,c,u)=>{(u===void 0?t.some(f=>c===void 0||i[f]!==c[f]||i_(i,f)!==i_(c,f)):r.has(u)||r.has(u.split(/\.|\[/)[0]))&&s(i,c,u)})}const L$=(e={})=>{let t=Kh(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};let uy=(e,t)=>s=>{e.current!==s&&(e.current=s,t())};function z$(e,{keys:t,deps:s=[e,t],ssr:r}={}){let i=Ve.useRef();i.current=e.get();let c=Ve.useCallback(p=>(uy(i,p)(e.value),t?.length>0?B$(e,t,uy(i,p)):e.listen(uy(i,p))),s),u=()=>i.current,f=u;return r&&"init"in e&&(f=r==="initial"?()=>e.init:r),Ve.useSyncExternalStore(c,u,f)}const O3=new WeakMap;function N3(e,t){O3.set(e,t)}function Mp(e){const t=xr(e),s=t.accounts.find(({address:r})=>r===e.address);if(!s){const r=new td(F5,{address:e.address,walletName:t.name});throw kp(r,Mp),r}return s}function xr(e){const t=O3.get(e);if(!t){const s=new td(G5);throw kp(s,xr),s}return t}function Qh(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 $$(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 c_=new WeakMap;function lv(e,t){let s=c_.get(t);if(s)try{xr(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||Qh(i.chains,t.chains))&&(u(),i.chains=Object.freeze([...t.chains])),(r||Qh(i.features,t.features))&&(u(),i.features=Object.freeze([...t.features])),(r||i.address!==t.address||i.icon!==t.icon||i.label!==t.label||$$(i.publicKey,t.publicKey))&&(u(),i.address=t.address,i.icon=t.icon,i.label=t.label,i.publicKey=t.publicKey),c&&(c_.set(t,i),N3(i,e)),Object.freeze(i)}const l_=new WeakMap;function V$(e){const t=l_.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 f of e.accounts.slice(this._cache.length)){const p=lv(e,f);this._cache.push(p),yield p}},some(f){if(this._cache.some(f))return!0;for(const p of e.accounts.slice(this._cache.length)){const m=lv(e,p);if(this._cache.push(m),f(m))return!0}return!1},get length(){return e.accounts.length}};return(s||r.accounts.length!==e.accounts.length||u.some(f=>!r.accounts.includes(f)))&&(c(),r.accounts=Object.freeze(Array.from(u))),(s||Qh(r.features,Object.keys(e.features)))&&(c(),r.features=Object.freeze(Object.keys(e.features))),(s||Qh(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&&(l_.set(e,r),N3(r,e)),Object.freeze(r)}function P$(e,t){if(e.address!==t.address)return!1;const s=xr(e),r=xr(t);return s===r}function Gc(e,t){const s=xr(t),r=xr(e);return s===r}function od(e,t){const s=xr(e);if(!(t in s.features)){const r=new td(Y5,{featureName:t,supportedChains:[...s.chains],supportedFeatures:Object.keys(s.features),walletName:s.name});throw kp(r,od),r}return s.features[t]}function x3(e,t){if(!e.features.includes(t)){const s=new td(Z5,{address:e.address,featureName:t,supportedChains:[...e.chains],supportedFeatures:[...e.features]});throw kp(s,x3),s}return od(e,t)}new TextEncoder;const G$=new TextDecoder,F$=new TextDecoder("utf-8",{fatal:!0});function H$(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 q$ 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 Fi extends q${static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}const Z$="The input to be decoded is not correctly encoded.";function Y$(e){try{return H$(typeof e=="string"?e:G$.decode(e),!0)}catch(t){throw new TypeError(Z$,{cause:t})}}function W$(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 X$(e){if(typeof e!="string")throw new Fi("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:s}=e.split(".");if(s===5)throw new Fi("Only JWTs using Compact JWS serialization can be decoded");if(s!==3)throw new Fi("Invalid JWT");if(!t)throw new Fi("JWTs must contain a payload");let r;try{r=Y$(t)}catch{throw new Fi("Failed to base64url decode the payload")}let i;try{i=JSON.parse(F$.decode(r))}catch{throw new Fi("Failed to parse the decoded payload as JSON")}if(!W$(i))throw new Fi("Invalid JWT Claims Set");return i}const J$=Ne({address:Be(),publicKey:Be(),label:dn(Be()),features:dn(ct(Be()))}),K$=Ne({exp:Cn(),iat:Cn(),iss:Be(),aud:Be(),payload:Ne({accounts:ct(J$)})});function Q$(e){const t=X$(e);return St(K$,t)}const eV=Ep("type",[Ne({type:nt("connect"),session:Be("`session` is required")}),Ne({type:nt("sign-transaction"),bytes:Be(),signature:Be()}),Ne({type:nt("sign-and-execute-transaction"),bytes:Be(),signature:Be(),digest:Be(),effects:Be()}),Ne({type:nt("sign-personal-message"),bytes:Be(),signature:Be()})]),tV=Ep("type",[Ne({type:nt("reject"),reason:dn(Be("`reason` must be a string"))}),Ne({type:nt("resolve"),data:eV})]),nV=Ne({id:Xt(Be(),hk()),source:nt("web-wallet-channel"),payload:tV,version:nt("1")});function sV(){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 rV=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:f,reject:p}=O4();this.#c=u,this.#n=f,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:sV(),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}=YI(nV,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 aV="https://my.slush.app",ep="slush:session",iV="Slush",oV="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgMjRDMCAxMC43NDUyIDEwLjc0NTIgMCAyNCAwQzM3LjI1NDggMCA0OCAxMC43NDUyIDQ4IDI0QzQ4IDM3LjI1NDggMzcuMjU0OCA0OCAyNCA0OEMxMC43NDUyIDQ4IDAgMzcuMjU0OCAwIDI0WiIgZmlsbD0iIzBDMEExRiIvPgo8cGF0aCBkPSJNMTMuMTM1OCAzMi4xMDg1QzE0LjE3MDEgMzUuOTY4MyAxOC4wMzMxIDM5LjQ2MjQgMjYuMDI1NSAzNy4zMjA4QzMzLjY1MTUgMzUuMjc3NCAzOC40MzA5IDI5LjAwNCAzNy4xOTE2IDI0LjM3ODlDMzYuNzYzNiAyMi43ODE3IDM1LjQ3NDYgMjEuNzAwNiAzMy40ODcyIDIxLjg3NjVMMTUuNzE2NSAyMy4zNTcyQzE0LjU5NzMgMjMuNDQzIDE0LjA4NDIgMjMuMjU5NiAxMy43ODgxIDIyLjU1NDNDMTMuNTAxIDIxLjg4MjMgMTMuNjY0NiAyMS4xNjA5IDE1LjAxNjMgMjAuNDc3N0wyOC41NDAxIDEzLjUzNzRDMjkuNTc2NyAxMy4wMSAzMC4yNjcxIDEyLjc4OTMgMzAuODk4IDEzLjAxMjZDMzEuMjkzNCAxMy4xNTYzIDMxLjU1MzggMTMuNzI4NCAzMS4zMTQ3IDE0LjQzNDRMMzAuNDM3OCAxNy4wMjMyQzI5LjM2MTcgMjAuMjAwMiAzMS42NjUzIDIwLjkzODIgMzIuOTY0MSAyMC41OTAyQzM0LjkyODkgMjAuMDYzNyAzNS4zOTExIDE4LjE5MjMgMzQuNzU4MSAxNS44Mjk5QzMzLjE1MzMgOS44NDA1NCAyNi43OTkgOC45MDQxMSAyMS4wMzc4IDEwLjQ0NzhDMTUuMTc2NyAxMi4wMTgzIDEwLjA5NiAxNi43Njc2IDExLjY0NzQgMjIuNTU3M0MxMi4wMTI5IDIzLjkyMTYgMTMuMjY4NyAyNS4wMTE2IDE0LjcyMzIgMjQuOTc4NUwxNi45NDM4IDI0Ljk3MzFDMTcuNDAwNCAyNC45NjI1IDE3LjIzNiAyNSAxOC4xMTcgMjQuOTI3MUMxOC45OTggMjQuODU0MSAyMS4zNTA5IDI0LjU2NDYgMjEuMzUwOSAyNC41NjQ2TDMyLjg5NjIgMjMuMjU4TDMzLjE5MzcgMjMuMjE0OEMzMy44Njg5IDIzLjA5OTcgMzQuMzc5MiAyMy4yNzUgMzQuODEwNiAyNC4wMTgzQzM1LjQ1NjMgMjUuMTMwNCAzNC40NzEyIDI1Ljk2OTEgMzMuMjkyIDI2Ljk3MzFDMzMuMjYwNSAyNyAzMy4yMjg4IDI3LjAyNyAzMy4xOTcgMjcuMDU0MUwyMy4wNDgyIDM1LjgwMDVDMjEuMzA4NyAzNy4zMDA4IDIwLjA4NjcgMzYuNzM2NyAxOS42NTg4IDM1LjEzOTVMMTguMTQzMSAyOS40ODI5QzE3Ljc2ODcgMjguMDg1NCAxNi40MDQxIDI2Ljk4ODkgMTQuODA1NiAyNy40MTcyQzEyLjgwNzUgMjcuOTUyNiAxMi42NDU1IDMwLjI3ODQgMTMuMTM1OCAzMi4xMDg1WiIgZmlsbD0iI0ZCRkFGRiIvPgo8L3N2Zz4K",dy="com.mystenlabs.suiwallet",cV="https://api.slush.app/api/wallet/metadata",lV={id:"com.mystenlabs.suiwallet.web",walletName:"Slush",description:"Trade and earn on Sui.",icon:oV,enabled:!0},uV=Ne({id:Be("Wallet ID is required"),walletName:Be("Wallet name is required"),icon:Be("Icon must be a valid wallet icon format"),enabled:co("Enabled is required")});function dV(e){localStorage.setItem(ep,e)}function uu(){const e=localStorage.getItem(ep);if(!e)throw new Error("No session found");return e}const u_=["sui:signTransaction","sui:signAndExecuteTransaction","sui:signPersonalMessage","sui:signTransactionBlock"];function d_(e){const{payload:t}=Q$(e);return t.accounts.map(s=>new nd({address:s.address,chains:Uu,features:s.features?u_.filter(r=>s.features?.includes(r)):u_,publicKey:qe(s.publicKey)}))}var fV=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 Uu}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=x4(),this.#s=t||aV,this.#o=e,this.#a=s.walletName,this.#i=s.icon,typeof window<"u"){const r=window,i=c=>{c.storageArea!==localStorage||c.key!==ep&&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:uu()});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:uu()});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:uu()});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:st(e),address:t.address,chain:s??zk,session:uu()});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 dV(t.session),this.#l(d_(t.session)),{accounts:this.accounts}};#d(){try{return d_(uu())}catch{return[]}}#y=async()=>{localStorage.removeItem(ep),this.#l([])};#u(){return new rV({appName:this.#o,hostOrigin:this.#s})}updateMetadata(e){this.#e=e.id,this.#a=e.walletName,this.#i=e.icon}};async function hV(e){const t=await fetch(e);if(!t.ok)throw new Error("Failed to fetch wallet metadata");return St(uV,await t.json())}function pV(e,{origin:t,metadataApiUrl:s=cV}={}){const r=_p();if(r.get().some(m=>m.id===dy))return;const i=new fV({name:e,origin:t,metadata:lV}),c=r.register(i);let u=!1;const f=()=>{u||(u=!0,i.dispose(),p(),c())},p=r.on("register",m=>{m.id===dy&&f()});return r.get().some(m=>m.id===dy)&&f(),hV(s).then(m=>{if(!u){if(!m.enabled){console.log("Slush wallet is not currently enabled."),f();return}i.updateMetadata(m)}}).catch(m=>{console.error("Error fetching metadata",m)}),{wallet:i,unregister:f}}var sl=class extends Error{},Ab=class extends sl{},mV=class extends sl{},Dp=class extends sl{},gV=class extends sl{},Ob=class extends sl{};function rl(e){return`sui:${e}`}function yV(e,t){if(e.length===0)throw new sl("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 vV=[Jv,Ap],bV=[zh,Bk];function C3(e){const t=xr(e);return t.id??t.name}function Nb(e,t){if(!e.wallet||!e.account)throw new Ab("No wallet is connected.");if(t&&!Gc(t,e.wallet))throw new Ob(`No account with address ${t.address} is connected to ${e.wallet.name}.`);return t??e.account}function I3({account:e,featureName:t,chain:s}){if(!e.chains.includes(s)){const r=new td(q5,{chain:s,featureName:t,supportedChains:[...e.chains],supportedFeatures:[...e.features],address:e.address});throw new mV(`The account ${r.context.address} does not support the chain "${r.context.chain}".`,{cause:r})}try{return x3(e,t)}catch(r){throw new Dp(`The account ${e.address} does not support the feature "${t}".`,{cause:r})}}function tp(...e){try{return I3(...e)}catch(t){if(t instanceof Dp)return null;throw t}}function wV({defaultNetwork:e,getClient:t}){const s=L$({status:"disconnected",currentAccount:null}),r=Kh(e),i=Kh([]),c=ly([i,r],(u,f)=>u.filter(p=>{const m=p.chains.some(b=>rl(f)===b),g=vV.every(b=>p.features.includes(b)),y=bV.some(b=>p.features.includes(b));return m&&g&&y}));return{$currentNetwork:r,$registeredWallets:i,$compatibleWallets:c,$baseConnection:s,$currentClient:ly(r,t),$connection:ly([s,c],(u,f)=>{switch(u.status){case"connected":{const p=f.find(m=>Gc(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?f.find(g=>Gc(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 TV({$registeredWallets:e}){jp(e,()=>{const t=_p(),s=new Map,r=()=>{const f=t.get(),p=[];for(const m of f)try{p.push(V$(m))}catch{console.warn(`[dapp-kit] Skipping wallet "${m.name}" because it does not comply with the Wallet Standard.`)}e.set(p)},i=f=>{const p=f.features[Ap].on("change",()=>{r()});s.set(f,p)},c=t.on("register",(...f)=>{f.filter(fy).forEach(i),r()}),u=t.on("unregister",(...f)=>{f.filter(fy).forEach(p=>{const m=s.get(p);m&&(s.delete(p),m())}),r()});return t.get().filter(fy).forEach(i),r(),()=>{c(),u(),s.forEach(f=>f()),s.clear()}})}function fy(e){return Ap in e.features}const EV="mysten-dapp-kit:selected-wallet-and-address";function SV(){return _V()?localStorage:R3()}function R3(){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 j3(e,t,s,r){const i=C3(s).replace(":","_"),c=r.join(","),u=[i,s.address,c].join(":");e.setItem(t,u)}function _V(){try{const e="__storage_test__";return localStorage.setItem(e,"test"),localStorage.removeItem(e),!0}catch{return!1}}function kV({$baseConnection:e},t,{storage:s,storageKey:r}){return async function({wallet:c,account:u,...f}){return await Jh(async()=>{const p=e.get().status==="connected";try{e.setKey("status",p?"reconnecting":"connecting");const{accounts:m,supportedIntents:g}=await M3(c,t,f);if(!p&&m.length===0)throw new gV("No accounts were authorized.");if(u&&!Gc(u,c))throw new Ob(`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}),j3(s,r,y,b),{accounts:m}}catch(m){throw e.setKey("status",p?"connected":"disconnected"),m}})}}async function M3(e,t,s){const{connect:r}=od(e,Jv),i=await r(s),c=xr(e),u=t.map(rl),f=i.supportedIntents??await D3(e);return{accounts:i.accounts.filter(p=>p.chains.some(m=>u.includes(m))).map(lv.bind(null,c)),supportedIntents:f}}async function D3(e){return e.features.includes("sui:getCapabilities")?(await od(e,"sui:getCapabilities")?.getCapabilities())?.supportedIntents??[]:[]}function AV({networks:e,stores:{$baseConnection:t,$compatibleWallets:s},storage:r,storageKey:i,walletsRegistered:c,timeout:u}){jp(s,()=>{let f=!1,p;const m=()=>{f=!0,p?.()},g=y=>Jh(async()=>{if(f)return;const{status:b}=t.get();if(b!=="disconnected"&&b!=="reconnecting"){m();return}const S=await OV({networks:e,storage:r,storageKey:i,wallets:y});f||S&&(t.set({status:"connected",currentAccount:S.account,supportedIntents:S.supportedIntents}),m())});return p=s.subscribe((y,b)=>{y&&(b&&b.length>y.length||g(y))}),Jh(async()=>{const y=!!await r.getItem(i);if(f)return;if(!y){m();return}t.get().status==="disconnected"&&t.set({status:"reconnecting",currentAccount:null,supportedIntents:[]});const b=new Promise(S=>setTimeout(S,u));await Promise.all([c.catch(()=>{}),b]),!f&&(await g(s.get()??[]),!f&&t.get().status==="reconnecting"&&t.set({status:"disconnected",currentAccount:null}))}),m})}async function OV({networks:e,storage:t,storageKey:s,wallets:r}){const i=await t.getItem(s);if(!i)return null;const[c,u,f]=i.split(":");if(!c||!u)return null;const p=r.find(S=>C3(S)===c);if(!p)return null;const m=p.accounts.find(S=>S.address===u);if(m)return{account:m,supportedIntents:(f?f.split(","):null)??await D3(p)};const{accounts:g,supportedIntents:y}=await M3(p,e,{silent:!0}),b=g.find(S=>S.address===u);return b?{account:b,supportedIntents:y}:null}function NV({$compatibleWallets:e,$baseConnection:t}){jp(e,()=>e.listen(async s=>{const r=t.get();if(r.status!=="connected")return;const i=xV(r.currentAccount,s);i?t.setKey("currentAccount",i):t.set({status:"disconnected",currentAccount:null})}))}function xV(e,t){for(const s of t){for(const r of s.accounts)if(P$(e,r))return r;if(Gc(e,s)&&s.accounts[0])return s.accounts[0]}return null}function CV({$currentNetwork:e}){return function(s){e.set(s)}}function IV({$baseConnection:e,$connection:t},{storage:s,storageKey:r}){return async function(...c){return await Jh(async()=>{const{wallet:u}=t.get();if(!u)throw new Ab("No wallet is connected.");try{const{disconnect:f}=od(u,Q5);await f(...c)}catch(f){console.warn("Failed to disconnect the current wallet from the application.",f)}finally{s.removeItem(r),e.set({status:"disconnected",currentAccount:null})}})}}function RV({$baseConnection:e,$connection:t},{storage:s,storageKey:r}){return function({account:c}){const u=t.get();if(!u.wallet)throw new Ab("No wallet is connected.");if(!Gc(c,u.wallet))throw new Ob(`No account with address ${c.address} is connected to ${u.wallet.name}.`);e.setKey("currentAccount",c),j3(s,r,c,u.supportedIntents)}}function jV({$connection:e,$currentNetwork:t}){return async function({account:r,network:i,...c}){const u=Nb(e.get(),r),f=rl(i??t.get());return await I3({account:u,chain:f,featureName:Fy}).signPersonalMessage({...c,account:Mp(u),chain:f})}}function f_(e,t,s,r){const i=l8(r);let c=null;try{c=u8(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:o8(s),balanceChanges:void 0,events:void 0,objectTypes:void 0,bcs:s};return i.success?{$kind:"Transaction",Transaction:u}:{$kind:"FailedTransaction",FailedTransaction:u}}function MV({$connection:e,$currentNetwork:t},s){return async function({transaction:i,account:c,network:u,...f}){const p=e.get(),m=Nb(p,c),g=[...p.supportedIntents],y=Mp(m),b=u??t.get(),S=s(b),A=rl(b),N={toJSON:async()=>typeof i=="string"?i:(i.setSenderIfNotSet(m.address),await i.toJSON({client:S,supportedIntents:g}))},j=tp({account:m,chain:A,featureName:Gy});if(j){const C=await j.signAndExecuteTransaction({...f,account:y,transaction:N,chain:A}),W=qe(C.bytes),ce=qe(C.effects);return f_(C.digest,C.signature,W,ce)}const V=tp({account:m,chain:A,featureName:D5});if(V){const C=Zn.from(await N.toJSON()),{digest:W,rawEffects:ce,rawTransaction:ae}=await V.signAndExecuteTransactionBlock({account:y,chain:A,transactionBlock:C,options:{showRawEffects:!0,showRawInput:!0}}),[{txSignatures:[Y],intentMessage:{value:K}}]=F.SenderSignedData.parse(qe(ae));return f_(W,Y,F.TransactionData.serialize(K).toBytes(),new Uint8Array(ce))}throw new Dp(`The account ${m.address} does not support signing and executing transactions.`)}}function DV({$connection:e,$currentNetwork:t},s){return async function({transaction:i,account:c,network:u,...f}){const p=e.get(),m=Nb(p,c),g=[...p.supportedIntents],y=Mp(m),b=u??t.get(),S=s(b),A=rl(b),N={toJSON:async()=>typeof i=="string"?i:(i.setSenderIfNotSet(m.address),await i.toJSON({client:S,supportedIntents:g}))},j=tp({account:m,chain:A,featureName:zh});if(j)return await j.signTransaction({...f,transaction:N,account:y,chain:A});const V=tp({account:m,chain:A,featureName:Bk});if(V){const C=Zn.from(await N.toJSON()),{transactionBlockBytes:W,signature:ce}=await V.signTransactionBlock({transactionBlock:C,account:y,chain:A});return{bytes:W,signature:ce}}throw new Dp(`The account ${m.address} does not support signing transactions.`)}}function UV(e){return{id:"slush-web-wallet-initializer",async initialize(){const t=await pV(e?.appName||BV(),{origin:e?.origin,metadataApiUrl:e?.metadataApiUrl});if(!t)throw new Error("Registration un-successful.");return{unregister:t.unregister}}}}function BV(){return document.querySelector('meta[name="application-name"]')?.content||document.title}const hy=new Map;async function LV(e,t){hy.forEach(i=>i()),hy.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;hy.set(c.id,u.unregister)}else console.warn(`Skipping wallet initializer: "${i.reason}".`)}function zV(){return{id:"unsafe-burner-initalizer",async initialize({networks:e,getClient:t}){const s=new $V({clients:e.map(t)});return{unregister:_p().register(s)}}}}var $V=class{#e;#t=new T$;#r;constructor({clients:e}){this.#e=e.reduce((t,s)=>{const r=rl(s.network);return t[r]=s,t},{}),this.#r=new nd({address:this.#t.getPublicKey().toSuiAddress(),publicKey:this.#t.getPublicKey().toSuiBytes(),chains:this.chains,features:[zh,Gy,Fy]}),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{[Jv]:{version:"1.0.0",connect:this.#a},[Ap]:{version:"1.0.0",on:this.#s},[Fy]:{version:"1.1.0",signPersonalMessage:this.#i},[zh]:{version:"2.0.0",signTransaction:this.#o},[Gy]:{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 Zn.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=Zn.from(await e.toJSON()),c=await i.build({client:r}),u=await this.#t.signAndExecuteTransaction({transaction:i,client:r}),f=u.Transaction??u.FailedTransaction;return{bytes:st(c),signature:f.signatures[0],digest:f.digest,effects:st(f.effects.bcs)}}};function VV({autoConnect:e=!0,networks:t,createClient:s,defaultNetwork:r=t[0],enableBurnerWallet:i=!1,slushWalletConfig:c,storage:u=SV(),storageKey:f=EV,walletInitializers:p=[],autoConnectTimeout:m=5e3}){const g=yV(t,s),y=wV({defaultNetwork:r,getClient:g.getClient});function b(A){return A?g.getClient(A):y.$currentClient.get()}u||=R3(),TV(y),NV(y);const S=LV([...p,...i?[zV()]:[],...c!==null?[UV(c)]:[]],{networks:t,getClient:b});return e&&AV({networks:t,stores:y,storageKey:f,storage:u,walletsRegistered:S,timeout:m}),{networks:t,getClient:b,signTransaction:DV(y,g.getClient),signAndExecuteTransaction:MV(y,g.getClient),signPersonalMessage:jV(y),connectWallet:kV(y,t,{storage:u,storageKey:f}),disconnectWallet:IV(y,{storage:u,storageKey:f}),switchAccount:RV(y,{storage:u,storageKey:f}),switchNetwork:CV(y),stores:{$wallets:y.$compatibleWallets,$connection:y.$connection,$currentNetwork:I$(y.$currentNetwork),$currentClient:y.$currentClient}}}function PV({dAppKit:e}={}){return z$(bo(e).stores.$connection)}function al({dAppKit:e}={}){return PV({dAppKit:e}).account}const GV=new Set(["children","localName","ref","style","className"]),h_=new WeakMap,p_=(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,f,p)=>{let m=h_.get(u);m===void 0&&h_.set(u,m=new Map);let g=m.get(f);p!==void 0?g===void 0?(m.set(f,g={handleEvent:p}),u.addEventListener(f,g)):g.handleEvent=p:g!==void 0&&(m.delete(f),u.removeEventListener(f,g))})(e,c,s)},U3=({react:e,tagName:t,elementClass:s,events:r,displayName:i})=>{const c=new Set(Object.keys(r??{})),u=e.forwardRef(((f,p)=>{const m=e.useRef(new Map),g=e.useRef(null),y={},b={};for(const[S,A]of Object.entries(f))GV.has(S)?y[S==="className"?"class":S]=A:c.has(S)||S in s.prototype?b[S]=A:y[S]=A;return e.useLayoutEffect((()=>{if(g.current===null)return;const S=new Map;for(const A in b)p_(g.current,A,f[A],m.current.get(A),r),m.current.delete(A),S.set(A,f[A]);for(const[A,N]of m.current)p_(g.current,A,void 0,N,r);m.current=S})),e.useLayoutEffect((()=>{g.current?.removeAttribute("defer-hydration")}),[]),y.suppressHydrationWarning=!0,e.createElement(t,{...y,ref:e.useCallback((S=>{g.current=S,typeof p=="function"?p(S):p!==null&&(p.current=S)}),[p])})}));return u.displayName=i??s.name,u};var m_={},g_;function FV(){return g_||(g_=1,(function(){function e(P){var te=0;return function(){return te<P.length?{done:!1,value:P[te++]}:{done:!0}}}var t=typeof Object.defineProperties=="function"?Object.defineProperty:function(P,te,de){return P==Array.prototype||P==Object.prototype||(P[te]=de.value),P};function s(P){P=[typeof globalThis=="object"&&globalThis,P,typeof window=="object"&&window,typeof self=="object"&&self,typeof Ec=="object"&&Ec];for(var te=0;te<P.length;++te){var de=P[te];if(de&&de.Math==Math)return de}throw Error("Cannot find global object")}var r=s(this);function i(P,te){if(te)e:{var de=r;P=P.split(".");for(var he=0;he<P.length-1;he++){var ue=P[he];if(!(ue in de))break e;de=de[ue]}P=P[P.length-1],he=de[P],te=te(he),te!=he&&te!=null&&t(de,P,{configurable:!0,writable:!0,value:te})}}i("Symbol",function(P){function te(ue){if(this instanceof te)throw new TypeError("Symbol is not a constructor");return new de("jscomp_symbol_"+(ue||"")+"_"+he++,ue)}function de(ue,ze){this.l=ue,t(this,"description",{configurable:!0,writable:!0,value:ze})}if(P)return P;de.prototype.toString=function(){return this.l};var he=0;return te}),i("Symbol.iterator",function(P){if(P)return P;P=Symbol("Symbol.iterator");for(var te="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),de=0;de<te.length;de++){var he=r[te[de]];typeof he=="function"&&typeof he.prototype[P]!="function"&&t(he.prototype,P,{configurable:!0,writable:!0,value:function(){return c(e(this))}})}return P});function c(P){return P={next:P},P[Symbol.iterator]=function(){return this},P}function u(P){var te=typeof Symbol<"u"&&Symbol.iterator&&P[Symbol.iterator];return te?te.call(P):{next:e(P)}}function f(P){if(!(P instanceof Array)){P=u(P);for(var te,de=[];!(te=P.next()).done;)de.push(te.value);P=de}return P}var p=typeof Object.create=="function"?Object.create:function(P){function te(){}return te.prototype=P,new te},m=(function(){function P(){function de(){}return Reflect.construct(de,[],function(){}),new de instanceof de}if(typeof Reflect<"u"&&Reflect.construct){if(P())return Reflect.construct;var te=Reflect.construct;return function(de,he,ue){return de=te(de,he),ue&&Reflect.setPrototypeOf(de,ue.prototype),de}}return function(de,he,ue){return ue===void 0&&(ue=de),ue=p(ue.prototype||Object.prototype),Function.prototype.apply.call(de,ue,he)||ue}})(),g;if(typeof Object.setPrototypeOf=="function")g=Object.setPrototypeOf;else{var y;e:{var b={a:!0},S={};try{S.__proto__=b,y=S.a;break e}catch{}y=!1}g=y?function(P,te){if(P.__proto__=te,P.__proto__!==te)throw new TypeError(P+" is not extensible");return P}:null}var A=g,N=window,j;if(((j=N.CustomElementRegistryPolyfill)==null?void 0:j.formAssociated)===void 0){var V={};N.CustomElementRegistryPolyfill=(V.formAssociated=new Set,V)}var C=window.HTMLElement,W=window.customElements.define,ce=window.customElements.get,ae=window.customElements,Y=new WeakMap,K=new WeakMap,w=new WeakMap,O=new WeakMap;function x(){var P;this.promise=new Promise(function(te){P=te}),this.resolve=P}function G(){this.h=new Map,this.m=new Map,this.j=new Map,this.i=new Map}G.prototype.define=function(P,te){if(P=P.toLowerCase(),this.h.get(P)!==void 0)throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "`+P+'" 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,he=new Set(te.observedAttributes||[]);M(te,he,de);var ue=ce.call(ae,P),ze,Le,Mt=(Le=(ze=ue)==null?void 0:ze.s)!=null?Le:te.formAssociated||N.CustomElementRegistryPolyfill.formAssociated.has(P);if(Mt&&N.CustomElementRegistryPolyfill.formAssociated.add(P),Mt!=te.formAssociated)try{te.formAssociated=Mt}catch{}if(de={tagName:P,g:te,connectedCallback:te.prototype.connectedCallback,disconnectedCallback:te.prototype.disconnectedCallback,adoptedCallback:te.prototype.adoptedCallback,attributeChangedCallback:de,formAssociated:Mt,formAssociatedCallback:te.prototype.formAssociatedCallback,formDisabledCallback:te.prototype.formDisabledCallback,formResetCallback:te.prototype.formResetCallback,formStateRestoreCallback:te.prototype.formStateRestoreCallback,observedAttributes:he},this.h.set(P,de),this.m.set(te,de),ue||(ue=$(P),W.call(ae,P,ue)),this===window.customElements&&(w.set(te,de),de.o=ue),ue=this.i.get(P))for(this.i.delete(P),ue=u(ue),he=ue.next();!he.done;he=ue.next())he=he.value,K.delete(he),X(he,de,!0);return ue=this.j.get(P),ue!==void 0&&(ue.resolve(te),this.j.delete(P)),te},G.prototype.upgrade=function(P){for(var te=[],de=0;de<arguments.length;++de)te[de]=arguments[de];ie.push(this),ae.upgrade.apply(ae,f(te)),ie.pop()},G.prototype.get=function(P){var te;return(te=this.h.get(P))==null?void 0:te.g},G.prototype.whenDefined=function(P){var te=this.h.get(P);return te!==void 0?Promise.resolve(te.g):(te=this.j.get(P),te===void 0&&(te=new x,this.j.set(P,te)),te.promise)};function U(P,te,de,he){var ue=P.i.get(de);ue||P.i.set(de,ue=new Set),he?ue.add(te):ue.delete(te)}var H;window.HTMLElement=function(){var P=H;if(P)return H=void 0,P;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 P=Reflect.construct(C,[],te.o),Object.setPrototypeOf(P,this.constructor.prototype),Y.set(P,te),P},window.HTMLElement.prototype=C.prototype;function $(P){function te(){var de=Reflect.construct(C,[],this.constructor);Object.setPrototypeOf(de,HTMLElement.prototype);e:{var he=de.getRootNode();if(!(he===document||he instanceof ShadowRoot)){if(he=ie[ie.length-1],he instanceof CustomElementRegistry){var ue=he;break e}he=he.getRootNode(),he===document||he instanceof ShadowRoot||(he=((ue=O.get(he))==null?void 0:ue.getRootNode())||document)}ue=he.registry}return ue=ue||window.customElements,(he=ue.h.get(P))?X(de,he):K.set(de,ue),de}return r.Object.defineProperty(te,"formAssociated",{configurable:!0,enumerable:!0,get:function(){return N.CustomElementRegistryPolyfill.formAssociated.has(P)}}),te.prototype.connectedCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];I(this),(ue=Y.get(this))?ue.connectedCallback&&ue.connectedCallback.apply(this,he):U(K.get(this),this,P,!0)},te.prototype.disconnectedCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];(ue=Y.get(this))?ue.disconnectedCallback&&ue.disconnectedCallback.apply(this,he):U(K.get(this),this,P,!1)},te.prototype.adoptedCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];var ze,Le;(ze=Y.get(this))==null||(Le=ze.adoptedCallback)==null||Le.apply(this,he)},te.prototype.formAssociatedCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];if(ue=Y.get(this),ue!=null&&ue.formAssociated){var ze;ue==null||(ze=ue.formAssociatedCallback)==null||ze.apply(this,he)}},te.prototype.formDisabledCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];if(ue=Y.get(this),ue!=null&&ue.formAssociated){var ze;ue==null||(ze=ue.formDisabledCallback)==null||ze.apply(this,he)}},te.prototype.formResetCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];if(ue=Y.get(this),ue!=null&&ue.formAssociated){var ze;ue==null||(ze=ue.formResetCallback)==null||ze.apply(this,he)}},te.prototype.formStateRestoreCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];if(ue=Y.get(this),ue!=null&&ue.formAssociated){var ze;ue==null||(ze=ue.formStateRestoreCallback)==null||ze.apply(this,he)}},te}window.CustomElementRegistry=G;function M(P,te,de){if(te.size!==0&&de!==void 0){var he=P.prototype.setAttribute;he&&(P.prototype.setAttribute=function(Le,Mt){if(I(this),Le=Le.toLowerCase(),te.has(Le)){var Es=this.getAttribute(Le);he.call(this,Le,Mt),de.call(this,Le,Es,Mt)}else he.call(this,Le,Mt)});var ue=P.prototype.removeAttribute;ue&&(P.prototype.removeAttribute=function(Le){if(I(this),Le=Le.toLowerCase(),te.has(Le)){var Mt=this.getAttribute(Le);ue.call(this,Le),de.call(this,Le,Mt,null)}else ue.call(this,Le)});var ze=P.prototype.toggleAttribute;ze&&(P.prototype.toggleAttribute=function(Le,Mt){if(I(this),Le=Le.toLowerCase(),te.has(Le)){var Es=this.getAttribute(Le);ze.call(this,Le,Mt),Mt=this.getAttribute(Le),Es!==Mt&&de.call(this,Le,Es,Mt)}else ze.call(this,Le,Mt)})}}var k;document.readyState==="loading"&&(k=new Set,document.addEventListener("readystatechange",function(){k.forEach(function(P){return D(P,Y.get(P))})},{once:!0}));function I(P){var te;(te=k)!=null&&te.has(P)&&D(P,Y.get(P))}function D(P,te){var de;(de=k)==null||de.delete(P),te.attributeChangedCallback&&te.observedAttributes.forEach(function(he){P.hasAttribute(he)&&te.attributeChangedCallback.call(P,he,null,P.getAttribute(he))})}function L(P){var te=Object.getPrototypeOf(P);if(te!==window.HTMLElement)return te===C?Object.setPrototypeOf(P,window.HTMLElement):L(te)}function X(P,te,de){de=de===void 0?!1:de,Object.setPrototypeOf(P,te.g.prototype),Y.set(P,te),H=P;try{new te.g}catch{L(te.g),new te.g}te.attributeChangedCallback&&(k===void 0||P.hasAttributes()?D(P,te):k.add(P)),de&&te.connectedCallback&&P.isConnected&&te.connectedCallback.call(P)}var z=Element.prototype.attachShadow;Element.prototype.attachShadow=function(P,te){for(var de=[],he=1;he<arguments.length;++he)de[he-1]=arguments[he];var ue=Object.assign({},P);return he=P.customElements,he=P.registry===void 0?he:P.registry,ue=(delete ue.customElements,delete ue.registry,ue),de=z.call.apply(z,[this,ue].concat(f(de))),he!==void 0&&(de.customElements=de.registry=he),de};var ie=[document];function fe(P,te,de){var he=(de?Object.getPrototypeOf(de):P.prototype)[te];P.prototype[te]=function(ue){for(var ze=[],Le=0;Le<arguments.length;++Le)ze[Le]=arguments[Le];return ie.push(this),ze=he.apply(de||this,ze),ze!==void 0&&O.set(ze,this),ie.pop(),ze}}fe(ShadowRoot,"createElement",document),fe(ShadowRoot,"createElementNS",document),fe(ShadowRoot,"importNode",document),fe(Element,"insertAdjacentHTML");function R(P){var te=Object.getOwnPropertyDescriptor(P.prototype,"innerHTML");Object.defineProperty(P.prototype,"innerHTML",Object.assign({},te,{set:function(de){ie.push(this),te.set.call(this,de),ie.pop()}}))}if(R(Element),R(ShadowRoot),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){var J=new WeakMap,le=HTMLElement.prototype.attachInternals,pe=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(P){for(var te=[],de=0;de<arguments.length;++de)te[de]=arguments[de];return te=le.call.apply(le,[this].concat(f(te))),J.set(te,this),te},pe.forEach(function(P){var te=window.ElementInternals.prototype,de=te[P];te[P]=function(he){for(var ue=[],ze=0;ze<arguments.length;++ze)ue[ze]=arguments[ze];if(ze=J.get(this),Y.get(ze).formAssociated===!0)return de?.call.apply(de,[this].concat(f(ue)));throw new DOMException("Failed to execute "+de+" on 'ElementInternals': The target element is not a form-associated custom element.")}});var Te=function(P){var te=m(Array,[].concat(f(P)),this.constructor);return te.l=P,te},Oe=Te,Ae=Array;if(Oe.prototype=p(Ae.prototype),Oe.prototype.constructor=Oe,A)A(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 P;return((P=this.l.find(function(te){return te.checked===!0}))==null?void 0:P.value)||""}});var Pe=function(P){var te=this,de=new Map;P.forEach(function(he,ue){var ze=he.getAttribute("name"),Le=de.get(ze)||[];te[+ue]=he,Le.push(he),de.set(ze,Le)}),this.length=P.length,de.forEach(function(he,ue){he&&ue!=="length"&&ue!=="item"&&ue!=="namedItem"&&(te[ue]=he.length===1?he[0]:new Te(he))})};Pe.prototype.item=function(P){var te;return(te=this[P])!=null?te:null},Pe.prototype[Symbol.iterator]=function(){throw Error("Method not implemented.")},Pe.prototype.namedItem=function(P){var te;return(te=this[P])!=null?te:null};var at=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){var P=at.get.call(this),te=[];P=u(P);for(var de=P.next();!de.done;de=P.next()){de=de.value;var he=Y.get(de);he&&he.formAssociated!==!0||te.push(de)}return new Pe(te)}})}}).call(typeof globalThis=="object"?globalThis:window)),m_}FV();const _h=globalThis,xb=_h.ShadowRoot&&(_h.ShadyCSS===void 0||_h.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Cb=Symbol(),y_=new WeakMap;let B3=class{constructor(t,s,r){if(this._$cssResult$=!0,r!==Cb)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(xb&&t===void 0){const r=s!==void 0&&s.length===1;r&&(t=y_.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&y_.set(s,t))}return t}toString(){return this.cssText}};const HV=e=>new B3(typeof e=="string"?e:e+"",void 0,Cb),ga=(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 B3(s,e,Cb)},L3=(e,t)=>{if(xb)e.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of t){const r=document.createElement("style"),i=_h.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=s.cssText,e.appendChild(r)}},v_=xb?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(const r of t.cssRules)s+=r.cssText;return HV(s)})(e):e;const{is:qV,defineProperty:ZV,getOwnPropertyDescriptor:YV,getOwnPropertyNames:WV,getOwnPropertySymbols:XV,getPrototypeOf:JV}=Object,Up=globalThis,b_=Up.trustedTypes,KV=b_?b_.emptyScript:"",QV=Up.reactiveElementPolyfillSupport,Cu=(e,t)=>e,np={toAttribute(e,t){switch(t){case Boolean:e=e?KV: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}},Bp=(e,t)=>!qV(e,t),w_={attribute:!0,type:String,converter:np,reflect:!1,useDefault:!1,hasChanged:Bp};Symbol.metadata??=Symbol("metadata"),Up.litPropertyMetadata??=new WeakMap;let wc=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=w_){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&&ZV(this.prototype,t,i)}}static getPropertyDescriptor(t,s,r){const{get:i,set:c}=YV(this.prototype,t)??{get(){return this[s]},set(u){this[s]=u}};return{get:i,set(u){const f=i?.call(this);c?.call(this,u),this.requestUpdate(t,f,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w_}static _$Ei(){if(this.hasOwnProperty(Cu("elementProperties")))return;const t=JV(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Cu("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Cu("properties"))){const s=this.properties,r=[...WV(s),...XV(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(v_(i))}else t!==void 0&&s.push(v_(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 L3(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:np).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:np;this._$Em=i;const f=u.fromAttribute(s,c.type);this[i]=f??this._$Ej?.get(i)??f,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??Bp)(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,f=this[i];u!==!0||this._$AL.has(i)||f===void 0||this.C(i,void 0,c,f)}}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){}};wc.elementStyles=[],wc.shadowRootOptions={mode:"open"},wc[Cu("elementProperties")]=new Map,wc[Cu("finalized")]=new Map,QV?.({ReactiveElement:wc}),(Up.reactiveElementVersions??=[]).push("2.1.2");const Ib=globalThis,T_=e=>e,sp=Ib.trustedTypes,E_=sp?sp.createPolicy("lit-html",{createHTML:e=>e}):void 0,z3="$lit$",ri=`lit$${Math.random().toFixed(9).slice(2)}$`,$3="?"+ri,eP=`<${$3}>`,fo=document,Vu=()=>fo.createComment(""),Pu=e=>e===null||typeof e!="object"&&typeof e!="function",Rb=Array.isArray,tP=e=>Rb(e)||typeof e?.[Symbol.iterator]=="function",py=`[
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 Gk(e){let t="",s=0,r,i=0;for(let c=0;c<e.length;c++)switch(r=e[c],s){case 0:t+=aa[r>>2],i=(r&3)<<4,s=1;break;case 1:t+=aa[i|r>>4],i=(r&15)<<2,s=2;break;case 2:t+=aa[i|r>>6],t+=aa[r&63],s=0;break}return s&&(t+=aa[i],t+="=",s==1&&(t+="=")),t}var Vh;(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:f}of e.list(r))i.tag(c,u).raw(f)},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])})(Vh||(Vh={}));function oj(e,t){return Object.assign(Object.assign({},e),t)}var Yt;(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"})(Yt||(Yt={}));function cj(){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 V0(e,t,s){for(let c=0;c<28;c=c+7){const u=e>>>c,f=!(!(u>>>7)&&t==0),p=(f?u|128:u)&255;if(s.push(p),!f)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,f=!!(u>>>7),p=(f?u|128:u)&255;if(s.push(p),!f)return}s.push(t>>>31&1)}}const vh=65536*65536;function Fk(e){let t=e[0]=="-";t&&(e=e.slice(1));const s=1e6;let r=0,i=0;function c(u,f){const p=Number(e.slice(u,f));i*=s,r=r*s+p,r>=vh&&(i=i+(r/vh|0),r=r%vh)}return c(-24,-18),c(-18,-12),c(-12,-6),c(-6),[t,r,i]}function qy(e,t){if(t>>>0<=2097151)return""+(vh*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,f=i*2,p=1e7;c>=p&&(u+=Math.floor(c/p),c%=p),u>=p&&(f+=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(f,0)+m(u,f)+m(c,1)}function iS(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 lj(){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 xt;function uj(){const e=new DataView(new ArrayBuffer(8));xt=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}uj();function Hk(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const qk=/^-?[0-9]+$/,Ph=4294967296,Gf=2147483648;class Zk{constructor(t,s){this.lo=t|0,this.hi=s|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let t=this.hi*Ph+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class Un extends Zk{static from(t){if(xt)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=xt.C(t);case"number":if(t===0)return this.ZERO;t=xt.C(t);case"bigint":if(!t)return this.ZERO;if(t<xt.UMIN)throw new Error("signed value for ulong");if(t>xt.UMAX)throw new Error("ulong too large");return xt.V.setBigUint64(0,t,!0),new Un(xt.V.getInt32(0,!0),xt.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!qk.test(t))throw new Error("string is no integer");let[s,r,i]=Fk(t);if(s)throw new Error("signed value for ulong");return new Un(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 Un(t,t/Ph)}throw new Error("unknown value "+typeof t)}toString(){return xt?this.toBigInt().toString():qy(this.lo,this.hi)}toBigInt(){return Hk(xt),xt.V.setInt32(0,this.lo,!0),xt.V.setInt32(4,this.hi,!0),xt.V.getBigUint64(0,!0)}}Un.ZERO=new Un(0,0);class At extends Zk{static from(t){if(xt)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=xt.C(t);case"number":if(t===0)return this.ZERO;t=xt.C(t);case"bigint":if(!t)return this.ZERO;if(t<xt.MIN)throw new Error("signed long too small");if(t>xt.MAX)throw new Error("signed long too large");return xt.V.setBigInt64(0,t,!0),new At(xt.V.getInt32(0,!0),xt.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!qk.test(t))throw new Error("string is no integer");let[s,r,i]=Fk(t);if(s){if(i>Gf||i==Gf&&r!=0)throw new Error("signed long too small")}else if(i>=Gf)throw new Error("signed long too large");let c=new At(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 At(t,t/Ph):new At(-t,-t/Ph).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return(this.hi&Gf)!==0}negate(){let t=~this.hi,s=this.lo;return s?s=~s+1:t+=1,new At(s,t)}toString(){if(xt)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 Hk(xt),xt.V.setInt32(0,this.lo,!0),xt.V.setInt32(4,this.hi,!0),xt.V.getBigInt64(0,!0)}}At.ZERO=new At(0,0);const oS={readUnknownField:!0,readerFactory:e=>new fj(e)};function dj(e){return e?Object.assign(Object.assign({},oS),e):oS}class fj{constructor(t,s){this.varint64=cj,this.uint32=lj,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 Yt.Varint:for(;this.buf[this.pos++]&128;);break;case Yt.Bit64:this.pos+=4;case Yt.Bit32:this.pos+=4;break;case Yt.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Yt.StartGroup:let i;for(;(i=this.tag()[1])!==Yt.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 At(...this.varint64())}uint64(){return new Un(...this.varint64())}sint64(){let[t,s]=this.varint64(),r=-(t&1);return t=(t>>>1|(s&1)<<31)^r,s=s>>>1^r,new At(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 Un(this.sfixed32(),this.sfixed32())}sfixed64(){return new At(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 Qe(e,t){if(!e)throw new Error(t)}function hj(e,t){throw new Error("Unexpected object: "+e)}const pj=34028234663852886e22,mj=-34028234663852886e22,gj=4294967295,yj=2147483647,vj=-2147483648;function Ou(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>yj||e<vj)throw new Error("invalid int 32: "+e)}function Gh(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 Kv(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>pj||e<mj))throw new Error("invalid float 32: "+e)}const cS={writeUnknownFields:!0,writerFactory:()=>new wj};function bj(e){return e?Object.assign(Object.assign({},cS),e):cS}class wj{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(Gh(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Ou(t),iS(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){Kv(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){Gh(t);let s=new Uint8Array(4);return new DataView(s.buffer).setUint32(0,t,!0),this.raw(s)}sfixed32(t){Ou(t);let s=new Uint8Array(4);return new DataView(s.buffer).setInt32(0,t,!0),this.raw(s)}sint32(t){return Ou(t),t=(t<<1^t>>31)>>>0,iS(t,this.buf),this}sfixed64(t){let s=new Uint8Array(8),r=new DataView(s.buffer),i=At.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=Un.from(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(s)}int64(t){let s=At.from(t);return V0(s.lo,s.hi,this.buf),this}sint64(t){let s=At.from(t),r=s.hi>>31,i=s.lo<<1^r,c=(s.hi<<1|s.lo>>>31)^r;return V0(i,c,this.buf),this}uint64(t){let s=Un.from(t);return V0(s.lo,s.hi,this.buf),this}}const lS={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},uS={ignoreUnknownFields:!1};function Tj(e){return e?Object.assign(Object.assign({},uS),e):uS}function Yk(e){return e?Object.assign(Object.assign({},lS),e):lS}function Ej(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 Wk=Symbol.for("protobuf-ts/message-type");function Fh(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 Tr;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER"})(Tr||(Tr={}));var Hh;(function(e){e[e.NO=0]="NO",e[e.PACKED=1]="PACKED",e[e.UNPACKED=2]="UNPACKED"})(Hh||(Hh={}));function Sj(e){var t,s,r,i;return e.localName=(t=e.localName)!==null&&t!==void 0?t:Fh(e.name),e.jsonName=(s=e.jsonName)!==null&&s!==void 0?s:Fh(e.name),e.repeat=(r=e.repeat)!==null&&r!==void 0?r:Hh.NO,e.opt=(i=e.opt)!==null&&i!==void 0?i:e.repeat||e.oneof?!1:e.kind=="message",e}function _j(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 kj{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 f=t[u];if(!_j(f))return!1;if(f.oneofKind===void 0)continue;const p=this.fields.find(m=>m.localName===f.oneofKind);if(!p||!this.field(f[f.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 Tr.BIGINT:return i=="bigint";case Tr.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,Tr.STRING)}}}function Ks(e,t){switch(t){case Tr.BIGINT:return e.toBigInt();case Tr.NUMBER:return e.toNumber();default:return e.toString()}}class Aj{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=ma(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 f=this.fMap[c];if(!f){if(!r.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${c}`);continue}const p=f.localName;let m;if(f.oneof){if(u===null&&(f.kind!=="enum"||f.T()[0]!=="google.protobuf.NullValue"))continue;if(i.includes(f.oneof))throw new Error(`Multiple members of the oneof group "${f.oneof}" of ${this.info.typeName} are present in JSON.`);i.push(f.oneof),m=s[f.oneof]={oneofKind:p}}else m=s;if(f.kind=="map"){if(u===null)continue;this.assert($h(u),f.name,u);const g=m[p];for(const[y,b]of Object.entries(u)){this.assert(b!==null,f.name+" map value",null);let S;switch(f.V.kind){case"message":S=f.V.T().internalJsonRead(b,r);break;case"enum":if(S=this.enum(f.V.T(),b,f.name,r.ignoreUnknownFields),S===!1)continue;break;case"scalar":S=this.scalar(b,f.V.T,f.V.L,f.name);break}this.assert(S!==void 0,f.name+" map value",b);let A=y;f.K==ve.BOOL&&(A=A=="true"?!0:A=="false"?!1:A),A=this.scalar(A,f.K,Tr.STRING,f.name).toString(),g[A]=S}}else if(f.repeat){if(u===null)continue;this.assert(Array.isArray(u),f.name,u);const g=m[p];for(const y of u){this.assert(y!==null,f.name,null);let b;switch(f.kind){case"message":b=f.T().internalJsonRead(y,r);break;case"enum":if(b=this.enum(f.T(),y,f.name,r.ignoreUnknownFields),b===!1)continue;break;case"scalar":b=this.scalar(y,f.T,f.L,f.name);break}this.assert(b!==void 0,f.name,u),g.push(b)}}else switch(f.kind){case"message":if(u===null&&f.T().typeName!="google.protobuf.Value"){this.assert(f.oneof===void 0,f.name+" (oneof member)",null);continue}m[p]=f.T().internalJsonRead(u,r,m[p]);break;case"enum":if(u===null)continue;let g=this.enum(f.T(),u,f.name,r.ignoreUnknownFields);if(g===!1)continue;m[p]=g;break;case"scalar":if(u===null)continue;m[p]=this.scalar(u,f.T,f.L,f.name);break}}}enum(t,s,r,i){if(t[0]=="google.protobuf.NullValue"&&Qe(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 Qe(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:(Qe(typeof u=="number",`Unable to parse field ${this.info.typeName}#${r}, enum ${t[0]} has no value for "${s}".`),u)}Qe(!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&&Kv(u),u;case ve.INT32:case ve.FIXED32:case ve.SFIXED32:case ve.SINT32:case ve.UINT32:if(t===null)return 0;let f;if(typeof t=="number"?f=t:t===""?c="empty string":typeof t=="string"&&(t.trim().length!==t.length?c="extra whitespace":f=Number(t)),f===void 0)break;return s==ve.UINT32?Gh(f):Ou(f),f;case ve.INT64:case ve.SFIXED64:case ve.SINT64:if(t===null)return Ks(At.ZERO,r);if(typeof t!="number"&&typeof t!="string")break;return Ks(At.from(t),r);case ve.FIXED64:case ve.UINT64:if(t===null)return Ks(Un.ZERO,r);if(typeof t!="number"&&typeof t!="string")break;return Ks(Un.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 Pk(t)}}catch(u){c=u.message}this.assert(!1,i+(c?" - "+c:""),t)}}class Oj{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 f=c.kind=="scalar"||c.kind=="enum"?Object.assign(Object.assign({},s),{emitDefaultValues:!0}):s;let p=this.field(c,u[c.localName],f);Qe(p!==void 0),r[s.useProtoFieldName?c.name:c.jsonName]=p}return r}field(t,s,r){let i;if(t.kind=="map"){Qe(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);Qe(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);Qe(g!==void 0),c[p.toString()]=g}break;case"enum":const f=t.V.T();for(const[p,m]of Object.entries(s)){Qe(m===void 0||typeof m=="number");const g=this.enum(f,m,t.name,!1,!0,r.enumAsInteger);Qe(g!==void 0),c[p.toString()]=g}break}(r.emitDefaultValues||Object.keys(c).length>0)&&(i=c)}else if(t.repeat){Qe(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);Qe(m!==void 0),c.push(m)}break;case"enum":const u=t.T();for(let p=0;p<s.length;p++){Qe(s[p]===void 0||typeof s[p]=="number");const m=this.enum(u,s[p],t.name,t.opt,!0,r.enumAsInteger);Qe(m!==void 0),c.push(m)}break;case"message":const f=t.T();for(let p=0;p<s.length;p++){const m=this.message(f,s[p],t.name,r);Qe(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){Qe(i);return}if(!(s===0&&!c&&!i))return Qe(typeof s=="number"),Qe(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){Qe(i);return}const u=c||i;switch(t){case ve.INT32:case ve.SFIXED32:case ve.SINT32:return s===0?u?0:void 0:(Ou(s),s);case ve.FIXED32:case ve.UINT32:return s===0?u?0:void 0:(Gh(s),s);case ve.FLOAT:Kv(s);case ve.DOUBLE:return s===0?u?0:void 0:(Qe(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:(Qe(typeof s=="string"),s);case ve.BOOL:return s===!1?u?!1:void 0:(Qe(typeof s=="boolean"),s);case ve.UINT64:case ve.FIXED64:Qe(typeof s=="number"||typeof s=="string"||typeof s=="bigint");let f=Un.from(s);return f.isZero()&&!u?void 0:f.toString();case ve.INT64:case ve.SFIXED64:case ve.SINT64:Qe(typeof s=="number"||typeof s=="string"||typeof s=="bigint");let p=At.from(s);return p.isZero()&&!u?void 0:p.toString();case ve.BYTES:return Qe(s instanceof Uint8Array),s.byteLength?Gk(s):u?"":void 0}}}function Zy(e,t=Tr.STRING){switch(e){case ve.BOOL:return!1;case ve.UINT64:case ve.FIXED64:return Ks(Un.ZERO,t);case ve.INT64:case ve.SFIXED64:case ve.SINT64:return Ks(At.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 Nj{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,f]=t.tag(),p=this.fieldNoToField.get(u);if(!p){let b=r.readUnknownField;if(b=="throw")throw new Error(`Unknown field ${u} (wire type ${f}) for ${this.info.typeName}`);let S=t.skip(f);b!==!1&&(b===!0?Vh.onRead:b)(this.info.typeName,s,u,f,S);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,S=p.kind=="scalar"?p.L:void 0;if(g){let j=m[y];if(f==Yt.LengthDelimited&&b!=ve.STRING&&b!=ve.BYTES){let V=t.uint32()+t.pos;for(;t.pos<V;)j.push(this.scalar(t,b,S))}else j.push(this.scalar(t,b,S))}else m[y]=this.scalar(t,b,S);break;case"message":if(g){let j=m[y],V=p.T().internalBinaryRead(t,t.uint32(),r);j.push(V)}else m[y]=p.T().internalBinaryRead(t,t.uint32(),r,m[y]);break;case"map":let[A,N]=this.mapEntry(p,t,r);m[y][A]=N;break}}}mapEntry(t,s,r){let i=s.uint32(),c=s.pos+i,u,f;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,Tr.STRING);break;case 2:switch(t.V.kind){case"scalar":f=this.scalar(s,t.V.T,t.V.L);break;case"enum":f=s.int32();break;case"message":f=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=Zy(t.K);u=t.K==ve.BOOL?p.toString():p}if(f===void 0)switch(t.V.kind){case"scalar":f=Zy(t.V.T,t.V.L);break;case"enum":f=0;break;case"message":f=t.V.T().create();break}return[u,f]}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 Ks(t.int64(),r);case ve.UINT64:return Ks(t.uint64(),r);case ve.FIXED64:return Ks(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 Ks(t.sfixed64(),r);case ve.SINT32:return t.sint32();case ve.SINT64:return Ks(t.sint64(),r)}}}class xj{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,f,p=c.repeat,m=c.localName;if(c.oneof){const g=t[c.oneof];if(g.oneofKind!==m)continue;u=g[m],f=!0}else u=t[m],f=!1;switch(c.kind){case"scalar":case"enum":let g=c.kind=="enum"?ve.INT32:c.T;if(p)if(Qe(Array.isArray(u)),p==Hh.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?Qe(c.opt):this.scalar(s,g,c.no,u,f||c.opt);break;case"message":if(p){Qe(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":Qe(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?Vh.onWrite:i)(this.info.typeName,t,s)}mapEntry(t,s,r,i,c){t.tag(r.no,Yt.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:Qe(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,Yt.LengthDelimited).fork(),s),t.join())}scalar(t,s,r,i,c){let[u,f,p]=this.scalarInfo(s,i);(!p||c)&&(t.tag(r,u),t[f](i))}packed(t,s,r,i){if(!i.length)return;Qe(s!==ve.BYTES&&s!==ve.STRING),t.tag(r,Yt.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=Yt.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=Yt.LengthDelimited,i="string";break;case ve.BOOL:u=s===!1,i="bool";break;case ve.UINT32:i="uint32";break;case ve.DOUBLE:r=Yt.Bit64,i="double";break;case ve.FLOAT:r=Yt.Bit32,i="float";break;case ve.INT64:u=c||At.from(s).isZero(),i="int64";break;case ve.UINT64:u=c||Un.from(s).isZero(),i="uint64";break;case ve.FIXED64:u=c||Un.from(s).isZero(),r=Yt.Bit64,i="fixed64";break;case ve.BYTES:u=c||!s.byteLength,r=Yt.LengthDelimited,i="bytes";break;case ve.FIXED32:r=Yt.Bit32,i="fixed32";break;case ve.SFIXED32:r=Yt.Bit32,i="sfixed32";break;case ve.SFIXED64:u=c||At.from(s).isZero(),r=Yt.Bit64,i="sfixed64";break;case ve.SINT32:i="sint32";break;case ve.SINT64:u=c||At.from(s).isZero(),i="sint64";break}return[r,i,c||u]}}function Cj(e){const t=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},Wk,{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]=Zy(s.T,s.L);break;case"enum":t[r]=0;break;case"map":t[r]={};break}}return t}function P0(e,t,s){let r,i=s,c;for(let u of e.fields){let f=u.localName;if(u.oneof){const p=i[u.oneof];if(p?.oneofKind==null)continue;if(r=p[f],c=t[u.oneof],c.oneofKind=p.oneofKind,r==null){delete c[f];continue}}else if(r=i[f],c=t,r==null)continue;switch(u.repeat&&(c[f].length=r.length),u.kind){case"scalar":case"enum":if(u.repeat)for(let m=0;m<r.length;m++)c[f][m]=r[m];else c[f]=r;break;case"message":let p=u.T();if(u.repeat)for(let m=0;m<r.length;m++)c[f][m]=p.create(r[m]);else c[f]===void 0?c[f]=p.create(r):p.mergePartial(c[f],r);break;case"map":switch(u.V.kind){case"scalar":case"enum":Object.assign(c[f],r);break;case"message":let m=u.V.T();for(let g of Object.keys(r))c[f][g]=m.create(r[g]);break}break}}}function Ij(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 f=r.kind=="enum"?ve.INT32:r.T;if(!(r.repeat?dS(f,c,u):Xk(f,c,u)))return!1;break;case"map":if(!(r.V.kind=="message"?fS(r.V.T(),Ff(c),Ff(u)):dS(r.V.kind=="enum"?ve.INT32:r.V.T,Ff(c),Ff(u))))return!1;break;case"message":let p=r.T();if(!(r.repeat?fS(p,c,u):p.equals(c,u)))return!1;break}}return!0}const Ff=Object.values;function Xk(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 dS(e,t,s){if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(!Xk(e,t[r],s[r]))return!1;return!0}function fS(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 Jk=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),Rj=Jk[Wk]={};class Z{constructor(t,s,r){this.defaultCheckDepth=16,this.typeName=t,this.fields=s.map(Sj),this.options=r??{},Rj.value=this,this.messagePrototype=Object.create(null,Jk),this.refTypeCheck=new kj(this),this.refJsonReader=new Aj(this),this.refJsonWriter=new Oj(this),this.refBinReader=new Nj(this),this.refBinWriter=new xj(this)}create(t){let s=Cj(this);return t!==void 0&&P0(this,s,t),s}clone(t){let s=this.create();return P0(this,s,t),s}equals(t,s){return Ij(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){P0(this,t,s)}fromBinary(t,s){let r=dj(s);return this.internalBinaryRead(r.readerFactory(t),t.byteLength,r)}fromJson(t,s){return this.internalJsonRead(t,Tj(s))}fromJsonString(t,s){let r=JSON.parse(t);return this.fromJson(r,s)}toJson(t,s){return this.internalJsonWrite(t,Yk(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=bj(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 ${ma(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 jj(e,t){var s,r,i;let c=e;return c.service=t,c.localName=(s=c.localName)!==null&&s!==void 0?s:Fh(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 gi{constructor(t,s,r){this.typeName=t,this.methods=s.map(i=>jj(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
+ `)}}function Mj(e,t){if(!t)return e;let s={};Hf(e,s),Hf(t,s);for(let r of Object.keys(t)){let i=t[r];switch(r){case"jsonOptions":s.jsonOptions=Ej(e.jsonOptions,s.jsonOptions);break;case"binaryOptions":s.binaryOptions=oj(e.binaryOptions,s.binaryOptions);break;case"meta":s.meta={},Hf(e.meta,s.meta),Hf(t.meta,s.meta);break;case"interceptors":s.interceptors=e.interceptors?e.interceptors.concat(i):i.concat();break}}return s}function Hf(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 Us;(function(e){e[e.PENDING=0]="PENDING",e[e.REJECTED=1]="REJECTED",e[e.RESOLVED=2]="RESOLVED"})(Us||(Us={}));class Qa{constructor(t=!0){this._state=Us.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!==Us.PENDING)throw new Error(`cannot resolve ${Us[this.state].toLowerCase()}`);this._resolve(t),this._state=Us.RESOLVED}reject(t){if(this.state!==Us.PENDING)throw new Error(`cannot reject ${Us[this.state].toLowerCase()}`);this._reject(t),this._state=Us.REJECTED}resolvePending(t){this._state===Us.PENDING&&this.resolve(t)}rejectPending(t){this._state===Us.PENDING&&this.reject(t)}}class Dj{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){Qe((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){Qe(!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){Qe(!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(){Qe(!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;Qe(t,"bad state"),Qe(!t.p,"iterator contract broken");let s=t.q.shift();return s?"value"in s?Promise.resolve(s):Promise.reject(s):(t.p=new Qa,t.p.promise)}}}pushIt(t){let s=this._itState;if(s.p){const r=s.p;Qe(r.state==Us.PENDING,"iterator contract broken"),"value"in t?r.resolve(t):r.reject(t),delete s.p}else s.q.push(t)}}var Uj=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 f(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(f,p)}m((r=r.apply(e,t||[])).next())})};class Kk{constructor(t,s,r,i,c,u,f){this.method=t,this.requestHeaders=s,this.request=r,this.headers=i,this.response=c,this.status=u,this.trailers=f}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 Uj(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 Bj=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 f(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(f,p)}m((r=r.apply(e,t||[])).next())})};class Lj{constructor(t,s,r,i,c,u,f){this.method=t,this.requestHeaders=s,this.request=r,this.headers=i,this.responses=c,this.status=u,this.trailers=f}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 Bj(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,f,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,S,A)=>g.interceptUnary(y,b,S,A)}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,S,A)=>g.interceptServerStreaming(y,b,S,A)}return m(s,i,r)}if(e=="clientStreaming"){let m=(g,y)=>t.clientStreaming(g,y);for(const g of((f=r.interceptors)!==null&&f!==void 0?f:[]).filter(y=>y.interceptClientStreaming).reverse()){const y=m;m=(b,S)=>g.interceptClientStreaming(y,b,S)}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,S)=>g.interceptDuplex(y,b,S)}return m(s,r)}hj(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 zj=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 f(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(f,p)}m((r=r.apply(e,t||[])).next())})};function hS(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 f of u)e.append(c,f);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 pS(e,t){let s=new Uint8Array(5+e.length);s[0]=er.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:Gk(s)}function Yy(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 Yy(Gj(p.headers),p.status,p.statusText)}let r=e,i=t>=200&&t<300,c=eA(r),[u,f]=Qk(r);return(u===void 0||u===we.OK)&&!i&&(u=Fj(t),f=s),[u,f,c]}function mS(e){let t=Pj(e),[s,r]=Qk(t),i=eA(t);return[s??we.OK,r,i]}var er;(function(e){e[e.DATA=0]="DATA",e[e.TRAILER=128]="TRAILER"})(er||(er={}));function gS(e,t,s){return zj(this,void 0,void 0,function*(){let r,i="",c=new Uint8Array(0),u=Vj(t);if($j(e)){let f=e.getReader();r={next:()=>f.read()}}else r=e[Symbol.asyncIterator]();for(;;){let f=yield r.next();if(f.value!==void 0){if(u==="text"){for(let m=0;m<f.value.length;m++)i+=String.fromCharCode(f.value[m]);let p=i.length-i.length%4;if(p===0)continue;c=yS(c,Pk(i.substring(0,p))),i=i.substring(p)}else c=yS(c,f.value);for(;c.length>=5&&c[0]===er.DATA;){let p=0;for(let m=1;m<5;m++)p=(p<<8)+c[m];if(c.length-5>=p)s(er.DATA,c.subarray(5,5+p)),c=c.subarray(5+p);else break}}if(f.done){if(c.length===0)break;if(c[0]!==er.TRAILER||c.length<5)throw new gt("premature EOF",we[we.DATA_LOSS]);s(er.TRAILER,c.subarray(5));break}}})}const $j=e=>typeof e.getReader=="function";function yS(e,t){let s=new Uint8Array(e.length+t.length);return s.set(e),s.set(t,e.length),s}function Vj(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 Qk(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 eA(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 Pj(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 Gj(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 Fj(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 Hj{constructor(t){this.defaultOptions=t}mergeOptions(t){return Mj(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,f,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:{},S=this.makeUrl(t,m),A=t.I.toBinary(s,m.binaryOptions),N=new Qa,j=new Dj,V=!0,C,W=new Qa,ce,ae=new Qa;return y(S,Object.assign(Object.assign({},b),{method:"POST",headers:hS(new globalThis.Headers,g,m.timeout,m.meta),body:pS(A,g),signal:(f=r.abort)!==null&&f!==void 0?f:null})).then(Y=>{let[K,w,O]=Yy(Y);if(N.resolve(O),K!=null&&K!==we.OK)throw new gt(w??we[K],we[K],O);return K!=null&&(C={code:we[K],detail:w??we[K]}),Y}).then(Y=>{if(!Y.body)throw new gt("missing response body",we[we.INTERNAL]);return gS(Y.body,Y.headers.get("content-type"),(K,w)=>{switch(K){case er.DATA:j.notifyMessage(t.O.fromBinary(w,m.binaryOptions)),V=!1;break;case er.TRAILER:let O,x;[O,x,ce]=mS(w),C={code:we[O],detail:x??we[O]};break}})}).then(()=>{if(!ce&&!V)throw new gt("missing trailers",we[we.DATA_LOSS]);if(!C)throw new gt("missing status",we[we.INTERNAL]);if(C.code!=="OK")throw new gt(C.detail,C.code,ce);j.notifyComplete(),W.resolve(C),ae.resolve(ce||{})}).catch(Y=>{let K;Y instanceof gt?K=Y:Y instanceof Error&&Y.name==="AbortError"?K=new gt(Y.message,we[we.CANCELLED]):K=new gt(Y instanceof Error?Y.message:""+Y,we[we.INTERNAL]),K.methodName=t.name,K.serviceName=t.service.typeName,N.rejectPending(K),j.notifyError(K),W.rejectPending(K),ae.rejectPending(K)}),new Lj(t,(p=m.meta)!==null&&p!==void 0?p:{},s,N.promise,j,W.promise,ae.promise)}unary(t,s,r){var i,c,u,f,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:{},S=this.makeUrl(t,m),A=t.I.toBinary(s,m.binaryOptions),N=new Qa,j,V=new Qa,C,W=new Qa,ce,ae=new Qa;return y(S,Object.assign(Object.assign({},b),{method:"POST",headers:hS(new globalThis.Headers,g,m.timeout,m.meta),body:pS(A,g),signal:(f=r.abort)!==null&&f!==void 0?f:null})).then(Y=>{let[K,w,O]=Yy(Y);if(N.resolve(O),K!=null&&K!==we.OK)throw new gt(w??we[K],we[K],O);return K!=null&&(C={code:we[K],detail:w??we[K]}),Y}).then(Y=>{if(!Y.body)throw new gt("missing response body",we[we.INTERNAL]);return gS(Y.body,Y.headers.get("content-type"),(K,w)=>{switch(K){case er.DATA:if(j)throw new gt("unary call received 2nd message",we[we.DATA_LOSS]);j=t.O.fromBinary(w,m.binaryOptions);break;case er.TRAILER:let O,x;[O,x,ce]=mS(w),C={code:we[O],detail:x??we[O]};break}})}).then(()=>{if(!ce&&j)throw new gt("missing trailers",we[we.DATA_LOSS]);if(!C)throw new gt("missing status",we[we.INTERNAL]);if(!j&&C.code==="OK")throw new gt("expected error status",we[we.DATA_LOSS]);if(!j)throw new gt(C.detail,C.code,ce);if(V.resolve(j),C.code!=="OK")throw new gt(C.detail,C.code,ce);W.resolve(C),ae.resolve(ce||{})}).catch(Y=>{let K;Y instanceof gt?K=Y:Y instanceof Error&&Y.name==="AbortError"?K=new gt(Y.message,we[we.CANCELLED]):K=new gt(Y instanceof Error?Y.message:""+Y,we[we.INTERNAL]),K.methodName=t.name,K.serviceName=t.service.typeName,N.rejectPending(K),V.rejectPending(K),W.rejectPending(K),ae.rejectPending(K)}),new Kk(t,(p=m.meta)!==null&&p!==void 0?p:{},s,N.promise,V.promise,W.promise,ae.promise)}}const Wy=Symbol.for("@mysten/sui/grpc/decoded-status-message");function qj(e){if(!e.includes("%"))return e;try{return decodeURIComponent(e)}catch{return e}}function tA(e){return Wy in e?!1:(Object.defineProperty(e,Wy,{value:!0,configurable:!0}),!0)}function vS(e){tA(e)&&(e.message=qj(e.message))}function Zj(e){return Wy in e}function Xy(e,t){if(!(typeof e!="object"||e===null))try{return e[t]}catch{return}}function Yj(e){const t=Xy(e,"code");return typeof t=="string"&&typeof we[t]=="number"?t:Xy(e,"name")==="TimeoutError"?we[we.DEADLINE_EXCEEDED]:we[we.CANCELLED]}function Wj(e,t){if(typeof t=="string")return e===t;const s=Xy(t,"message");return typeof s=="string"&&e===s}function nA(e,t){try{Xj(e,t)}catch{}}function Xj(e,t){if(e instanceof gt){if(t?.aborted&&(e.code===we[we.INTERNAL]||e.code===we[we.CANCELLED])){e.code=Yj(t.reason),Wj(e.message,t.reason)?tA(e):vS(e);return}vS(e)}}function bS(e,t){for(const s of e)s.then(void 0,r=>nA(r,t))}var Qv=class extends Hj{constructor(e){super({...e,meta:{[$k]:String(Vk),...e.meta}})}unary(e,t,s){const r=super.unary(e,t,s);return bS([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=>nA(i,s.abort)),bS([r.headers,r.status,r.trailers],s.abort),r}};function Jj(e){return{mergeOptions(t){const s=e.mergeOptions(t);return{...s,meta:{[$k]:String(Vk),...s.meta}}},unary:e.unary.bind(e),serverStreaming:e.serverStreaming.bind(e),clientStreaming:e.clientStreaming.bind(e),duplex:e.duplex.bind(e)}}var Kj=class sA{#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 sA({prefix:[...this.#e,...Array.isArray(t)?t:[t]],cache:this.#t})}},rA=class{constructor({network:e,base:t,cache:s=t?.cache??new Kj}){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 Qj={mainnet:"https://mainnet.mvr.mystenlabs.com",testnet:"https://testnet.mvr.mystenlabs.com"};var e8=class extends rA{constructor(e){super(e),this.core=this,this.mvr=new FR({cache:this.cache.scope("core.mvr"),url:e.mvr?.url??Qj[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=Lc.parseFromStr((await this.core.mvr.resolveType({type:e.name.type,signal:e.signal})).type),s=Rk(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=ws(r.type),c=await r.content,u=i.typeParams[0],f=typeof u!="string"&&u.module==="dynamic_object_field"&&u.name==="Wrapper",p=c.slice(Qc+e.name.bcs.length),m=typeof i.typeParams[1]=="string"?i.typeParams[1]:De(i.typeParams[1]);return{dynamicField:{$kind:f?"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:f?F.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),f=new Promise((b,S)=>{u.addEventListener("abort",()=>S(u.reason))});f.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(S=>setTimeout(S,b)),f])}else await Promise.race([new Promise(b=>setTimeout(b,y)),f]);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 t8=new Intl.PluralRules("en-US",{type:"ordinal"}),n8=new Map([["one","st"],["two","nd"],["few","rd"],["other","th"]]);function s8(e){return`${e}${n8.get(t8.select(e))}`}function aA(e){const{command:t,location:s,abortCode:r,cleverError:i}=e,c=[];if(t!=null?c.push(`MoveAbort in ${s8(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 wS=F.struct("MinimalEffectsWithError",{status:jv}),r8=F.enum("MinimalTransactionEffectsWithError",{V1:wS,V2:wS}),a8=F.enum("MinimalExecutionStatusNoError",{Success:null,Failed:null}),TS=F.struct("MinimalEffectsNoError",{status:a8}),i8=F.enum("MinimalTransactionEffectsNoError",{V1:TS,V2:TS});function ts(e,t){return t!=null&&typeof t!="boolean"?`${e}(${JSON.stringify(t,(s,r)=>typeof r=="bigint"?r.toString():r)})`:e}function eb(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:aA({command:s,location:c,abortCode:String(i)}),command:s,MoveAbort:{abortCode:String(i),location:c}}}case"MoveObjectTooBig":return{$kind:"SizeError",message:ts("MoveObjectTooBig",t.MoveObjectTooBig),command:s,SizeError:{name:"ObjectTooBig",size:Number(t.MoveObjectTooBig.objectSize),maxSize:Number(t.MoveObjectTooBig.maxObjectSize)}};case"MovePackageTooBig":return{$kind:"SizeError",message:ts("MovePackageTooBig",t.MovePackageTooBig),command:s,SizeError:{name:"PackageTooBig",size:Number(t.MovePackageTooBig.objectSize),maxSize:Number(t.MovePackageTooBig.maxObjectSize)}};case"EffectsTooLarge":return{$kind:"SizeError",message:ts("EffectsTooLarge",t.EffectsTooLarge),command:s,SizeError:{name:"EffectsTooLarge",size:Number(t.EffectsTooLarge.currentSize),maxSize:Number(t.EffectsTooLarge.maxSize)}};case"WrittenObjectsTooLarge":return{$kind:"SizeError",message:ts("WrittenObjectsTooLarge",t.WrittenObjectsTooLarge),command:s,SizeError:{name:"WrittenObjectsTooLarge",size:Number(t.WrittenObjectsTooLarge.currentSize),maxSize:Number(t.WrittenObjectsTooLarge.maxSize)}};case"MoveVectorElemTooBig":return{$kind:"SizeError",message:ts("MoveVectorElemTooBig",t.MoveVectorElemTooBig),command:s,SizeError:{name:"MoveVectorElemTooBig",size:Number(t.MoveVectorElemTooBig.valueSize),maxSize:Number(t.MoveVectorElemTooBig.maxScaledSize)}};case"MoveRawValueTooBig":return{$kind:"SizeError",message:ts("MoveRawValueTooBig",t.MoveRawValueTooBig),command:s,SizeError:{name:"MoveRawValueTooBig",size:Number(t.MoveRawValueTooBig.valueSize),maxSize:Number(t.MoveRawValueTooBig.maxScaledSize)}};case"CommandArgumentError":return{$kind:"CommandArgumentError",message:ts("CommandArgumentError",t.CommandArgumentError),command:s,CommandArgumentError:{argument:t.CommandArgumentError.argIdx,name:t.CommandArgumentError.kind.$kind}};case"TypeArgumentError":return{$kind:"TypeArgumentError",message:ts("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:ts("PackageUpgradeError",t.PackageUpgradeError),command:s,PackageUpgradeError:{name:r.$kind,packageId:r.$kind==="UnableToFetchPackage"?r.UnableToFetchPackage.packageId:void 0,digest:r.$kind==="DigestDoesNotMatch"?st(r.DigestDoesNotMatch.digest):void 0}}}case"ExecutionCancelledDueToSharedObjectCongestion":return{$kind:"CongestedObjects",message:ts("ExecutionCancelledDueToSharedObjectCongestion",t.ExecutionCancelledDueToSharedObjectCongestion),command:s,CongestedObjects:{name:"ExecutionCanceledDueToConsensusObjectCongestion",objects:t.ExecutionCancelledDueToSharedObjectCongestion.congested_objects}};case"AddressDeniedForCoin":return{$kind:"CoinDenyListError",message:ts("AddressDeniedForCoin",t.AddressDeniedForCoin),command:s,CoinDenyListError:{name:"AddressDeniedForCoin",address:t.AddressDeniedForCoin.address,coinType:t.AddressDeniedForCoin.coinType}};case"CoinTypeGlobalPause":return{$kind:"CoinDenyListError",message:ts("CoinTypeGlobalPause",t.CoinTypeGlobalPause),command:s,CoinDenyListError:{name:"CoinTypeGlobalPause",coinType:t.CoinTypeGlobalPause.coinType}};case"CircularObjectOwnership":return{$kind:"ObjectIdError",message:ts("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:ts("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 o8(e,t=!1){return(t?Xi.fromKindBytes(e):Xi.fromBytes(e)).snapshot()}function c8(e){try{return F.TransactionData.parse(e).V1?.gasData.payment?.length===0}catch{return!1}}function l8(e){let t=null;try{t=r8.parse(e)}catch{const r=i8.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:eb(s.Failure)}}function u8(e){const t=F.TransactionEffects.parse(e);switch(t.$kind){case"V1":return d8({bytes:e,effects:t.V1});case"V2":return f8({bytes:e,effects:t.V2});default:throw new Error(`Unknown transaction effects version: ${t.$kind}`)}}function d8({bytes:e,effects:t}){const s=new Map(t.modifiedAtVersions),r=new Map(t.sharedObjects.map(b=>[b.objectId,b])),i=(b,S)=>{const A=r.get(b.objectId);return{objectId:b.objectId,inputState:S.inputState,inputVersion:S.inputState==="Exists"?A?.version??s.get(b.objectId)??null:null,inputDigest:S.inputState==="Exists"?A?.digest??null:null,inputOwner:null,outputState:S.outputState,outputVersion:S.outputState==="DoesNotExist"?null:b.version,outputDigest:S.outputState==="DoesNotExist"?null:b.digest,outputOwner:S.outputOwner,idOperation:S.idOperation}},c=(b,S,A)=>b.map(([N,j])=>i(N,{inputState:S,outputState:"ObjectWrite",outputOwner:j,idOperation:A})),u=(b,S,A)=>b.map(N=>i(N,{inputState:S,outputState:"DoesNotExist",outputOwner:null,idOperation:A})),f=[...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=f.find(b=>b.objectId===p)??null,g=new Set(f.map(b=>b.objectId)),y=t.modifiedAtVersions.reduce((b,[,S])=>BigInt(S)>b?BigInt(S):b,0n);return{bcs:e,version:1,status:t.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:eb(t.status.Failure)},gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:m,eventsDigest:t.eventsDigest,dependencies:t.dependencies,lamportVersion:(y+1n).toString(),changedObjects:f,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 f8({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:eb(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 ES=(function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e})({});var h8=class extends Z{constructor(){super("google.protobuf.Struct",[{no:1,name:"fields",kind:"map",K:9,V:{kind:"message",T:()=>fn}}])}internalJsonWrite(e,t){let s={};for(let[r,i]of Object.entries(e.fields))s[r]=fn.toJson(i);return s}internalJsonRead(e,t,s){if(!$h(e))throw new globalThis.Error("Unable to parse message "+this.typeName+" from JSON "+ma(e)+".");s||(s=this.create());for(let[r,i]of globalThis.Object.entries(e))s.fields[r]=fn.fromJson(i);return s}};const SS=new h8;var p8=class extends Z{constructor(){super("google.protobuf.Value",[{no:1,name:"null_value",kind:"enum",oneof:"kind",T:()=>["google.protobuf.NullValue",ES]},{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:()=>SS},{no:6,name:"list_value",kind:"message",oneof:"kind",T:()=>_S}])}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:ES.NULL_VALUE}:globalThis.Array.isArray(e)?s.kind={oneofKind:"listValue",listValue:_S.fromJson(e)}:s.kind={oneofKind:"structValue",structValue:SS.fromJson(e)};break;default:throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+ma(e))}return s}};const fn=new p8;var m8=class extends Z{constructor(){super("google.protobuf.ListValue",[{no:1,name:"values",kind:"message",repeat:2,T:()=>fn}])}internalJsonWrite(e,t){return e.values.map(s=>fn.toJson(s))}internalJsonRead(e,t,s){if(!globalThis.Array.isArray(e))throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+ma(e));s||(s=this.create());let r=e.map(i=>fn.fromJson(i));return s.values.push(...r),s}};const _S=new m8;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})({}),gs=(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})({}),bh=(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})({}),Jy=(function(e){return e[e.REFERENCE_UNKNOWN=0]="REFERENCE_UNKNOWN",e[e.IMMUTABLE=1]="IMMUTABLE",e[e.MUTABLE=2]="MUTABLE",e})({}),_c=(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 y8=class extends Z{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:()=>b8},{no:5,name:"type_origins",kind:"message",repeat:2,T:()=>x8},{no:6,name:"linkage",kind:"message",repeat:2,T:()=>I8}])}};const iA=new y8;var v8=class extends Z{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:()=>oA},{no:4,name:"functions",kind:"message",repeat:2,T:()=>uA}])}};const b8=new v8;var w8=class extends Z{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",_c]},{no:6,name:"type_parameters",kind:"message",repeat:2,T:()=>cA},{no:7,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.DatatypeDescriptor.DatatypeKind",g8]},{no:8,name:"fields",kind:"message",repeat:2,T:()=>lA},{no:9,name:"variants",kind:"message",repeat:2,T:()=>_8}])}};const oA=new w8;var T8=class extends Z{constructor(){super("sui.rpc.v2.TypeParameter",[{no:1,name:"constraints",kind:"enum",repeat:1,T:()=>["sui.rpc.v2.Ability",_c]},{no:2,name:"is_phantom",kind:"scalar",opt:!0,T:8}])}};const cA=new T8;var E8=class extends Z{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:()=>tb}])}};const lA=new E8;var S8=class extends Z{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:()=>lA}])}};const _8=new S8;var k8=class extends Z{constructor(){super("sui.rpc.v2.OpenSignatureBody",[{no:1,name:"type",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.OpenSignatureBody.Type",gs]},{no:2,name:"type_name",kind:"scalar",opt:!0,T:9},{no:3,name:"type_parameter_instantiation",kind:"message",repeat:2,T:()=>tb},{no:4,name:"type_parameter",kind:"scalar",opt:!0,T:13}])}};const tb=new k8;var A8=class extends Z{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",bh]},{no:6,name:"is_entry",kind:"scalar",opt:!0,T:8},{no:7,name:"type_parameters",kind:"message",repeat:2,T:()=>cA},{no:8,name:"parameters",kind:"message",repeat:2,T:()=>kS},{no:9,name:"returns",kind:"message",repeat:2,T:()=>kS}])}};const uA=new A8;var O8=class extends Z{constructor(){super("sui.rpc.v2.OpenSignature",[{no:1,name:"reference",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.OpenSignature.Reference",Jy]},{no:2,name:"body",kind:"message",T:()=>tb}])}};const kS=new O8;var N8=class extends Z{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 x8=new N8;var C8=class extends Z{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 I8=new C8;let vc=(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 R8=class extends Z{constructor(){super("sui.rpc.v2.Owner",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Owner.OwnerKind",vc]},{no:2,name:"address",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const Ky=new R8;let ii=(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 j8=class extends Z{constructor(){super("sui.rpc.v2.Argument",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Argument.ArgumentKind",ii]},{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 Ar=new j8;let Qs=(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})({}),M8=(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})({}),kc=(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 D8=class extends Z{constructor(){super("sui.rpc.v2.Input",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Input.InputKind",Qs]},{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",M8]},{no:8,name:"funds_withdrawal",kind:"message",T:()=>L8},{no:1e3,name:"literal",kind:"message",T:()=>fn}])}};const U8=new D8;var B8=class extends Z{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",kc]},{no:4,name:"funder",kind:"scalar",opt:!0,T:9},{no:5,name:"allowance",kind:"scalar",opt:!0,T:9}])}};const L8=new B8;var z8=class extends Z{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=At.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 "+ma(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,f=At.from(i+c);if(f.toNumber()>315576e6||f.toNumber()<-315576e6)throw new Error("Unable to parse Duration from JSON string. Value out of range.");if(s.seconds=f.toBigInt(),typeof u=="string"){let p=i+u+"0".repeat(9-u.length);s.nanos=parseInt(p)}return s}};const $8=new z8;var V8=class extends Z{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 dA=new V8;var P8=class extends Z{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 G8=new P8;var F8=class extends Z{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 Ts=new F8;var H8=class extends Z{constructor(){super("sui.rpc.v2.Object",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{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:()=>Ky},{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:()=>Ts},{no:9,name:"package",kind:"message",T:()=>iA},{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:()=>fn},{no:101,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:102,name:"display",kind:"message",T:()=>Y8}])}};const uo=new H8;var q8=class extends Z{constructor(){super("sui.rpc.v2.ObjectSet",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>uo}])}};const fA=new q8;var Z8=class extends Z{constructor(){super("sui.rpc.v2.Display",[{no:1,name:"output",kind:"message",T:()=>fn},{no:2,name:"errors",kind:"message",T:()=>fn}])}};const Y8=new Z8;var W8=class extends Z{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=At.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(At.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){const t=this.create(),s=e.getTime();return t.seconds=At.from(Math.floor(s/1e3)).toBigInt(),t.nanos=(s%1e3+(s<0&&s%1e3!==0?1e3:0))*1e6,t}internalJsonWrite(e,t){let s=At.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 "+ma(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=At.from(i/1e3).toBigInt(),s.nanos=0,r[7]&&(s.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),s}};const Or=new W8;var X8=class extends Z{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 hA=new X8;let ca=(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})({}),J8=(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})({}),K8=(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})({}),Q8=(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 eM=class extends Z{constructor(){super("sui.rpc.v2.Transaction",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{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:()=>cM},{no:5,name:"sender",kind:"scalar",opt:!0,T:9},{no:6,name:"gas_payment",kind:"message",T:()=>nM},{no:7,name:"expiration",kind:"message",T:()=>rM}])}};const nb=new eM;var tM=class extends Z{constructor(){super("sui.rpc.v2.GasPayment",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>hA},{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 nM=new tM;var sM=class extends Z{constructor(){super("sui.rpc.v2.TransactionExpiration",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TransactionExpiration.TransactionExpirationKind",ca]},{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:()=>Or},{no:5,name:"max_timestamp",kind:"message",T:()=>Or},{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:()=>iM}])}};const rM=new sM;var aM=class extends Z{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 iM=new aM;var oM=class extends Z{constructor(){super("sui.rpc.v2.TransactionKind",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TransactionKind.Kind",J8]},{no:2,name:"programmable_transaction",kind:"message",oneof:"data",T:()=>uM},{no:3,name:"change_epoch",kind:"message",oneof:"data",T:()=>mA},{no:4,name:"genesis",kind:"message",oneof:"data",T:()=>RM},{no:5,name:"consensus_commit_prologue",kind:"message",oneof:"data",T:()=>MM},{no:6,name:"authenticator_state_update",kind:"message",oneof:"data",T:()=>PM},{no:7,name:"end_of_epoch",kind:"message",oneof:"data",T:()=>HM},{no:8,name:"randomness_state_update",kind:"message",oneof:"data",T:()=>OM}])}};const cM=new oM;var lM=class extends Z{constructor(){super("sui.rpc.v2.ProgrammableTransaction",[{no:1,name:"inputs",kind:"message",repeat:2,T:()=>U8},{no:2,name:"commands",kind:"message",repeat:2,T:()=>fM}])}};const uM=new lM;var dM=class extends Z{constructor(){super("sui.rpc.v2.Command",[{no:1,name:"move_call",kind:"message",oneof:"command",T:()=>pA},{no:2,name:"transfer_objects",kind:"message",oneof:"command",T:()=>mM},{no:3,name:"split_coins",kind:"message",oneof:"command",T:()=>yM},{no:4,name:"merge_coins",kind:"message",oneof:"command",T:()=>bM},{no:5,name:"publish",kind:"message",oneof:"command",T:()=>TM},{no:6,name:"make_move_vector",kind:"message",oneof:"command",T:()=>SM},{no:7,name:"upgrade",kind:"message",oneof:"command",T:()=>kM}])}};const fM=new dM;var hM=class extends Z{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:()=>Ar}])}};const pA=new hM;var pM=class extends Z{constructor(){super("sui.rpc.v2.TransferObjects",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>Ar},{no:2,name:"address",kind:"message",T:()=>Ar}])}};const mM=new pM;var gM=class extends Z{constructor(){super("sui.rpc.v2.SplitCoins",[{no:1,name:"coin",kind:"message",T:()=>Ar},{no:2,name:"amounts",kind:"message",repeat:2,T:()=>Ar}])}};const yM=new gM;var vM=class extends Z{constructor(){super("sui.rpc.v2.MergeCoins",[{no:1,name:"coin",kind:"message",T:()=>Ar},{no:2,name:"coins_to_merge",kind:"message",repeat:2,T:()=>Ar}])}};const bM=new vM;var wM=class extends Z{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 TM=new wM;var EM=class extends Z{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:()=>Ar}])}};const SM=new EM;var _M=class extends Z{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:()=>Ar}])}};const kM=new _M;var AM=class extends Z{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 OM=new AM;var NM=class extends Z{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:()=>Or},{no:8,name:"system_packages",kind:"message",repeat:2,T:()=>CM}])}};const mA=new NM;var xM=class extends Z{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 CM=new xM;var IM=class extends Z{constructor(){super("sui.rpc.v2.GenesisTransaction",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>uo}])}};const RM=new IM;var jM=class extends Z{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:()=>Or},{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:()=>$M},{no:7,name:"additional_state_digest",kind:"scalar",opt:!0,T:9}])}};const MM=new jM;var DM=class extends Z{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 UM=new DM;var BM=class extends Z{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:()=>UM}])}};const LM=new BM;var zM=class extends Z{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:()=>LM}])}};const $M=new zM;var VM=class extends Z{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:()=>gA},{no:4,name:"authenticator_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const PM=new VM;var GM=class extends Z{constructor(){super("sui.rpc.v2.ActiveJwk",[{no:1,name:"id",kind:"message",T:()=>dA},{no:2,name:"jwk",kind:"message",T:()=>G8},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0}])}};const gA=new GM;var FM=class extends Z{constructor(){super("sui.rpc.v2.EndOfEpochTransaction",[{no:1,name:"transactions",kind:"message",repeat:2,T:()=>ZM}])}};const HM=new FM;var qM=class extends Z{constructor(){super("sui.rpc.v2.EndOfEpochTransactionKind",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.EndOfEpochTransactionKind.Kind",K8]},{no:2,name:"change_epoch",kind:"message",oneof:"data",T:()=>mA},{no:3,name:"authenticator_state_expire",kind:"message",oneof:"data",T:()=>WM},{no:4,name:"execution_time_observations",kind:"message",oneof:"data",T:()=>JM},{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 ZM=new qM;var YM=class extends Z{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 WM=new YM;var XM=class extends Z{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:()=>QM}])}};const JM=new XM;var KM=class extends Z{constructor(){super("sui.rpc.v2.ExecutionTimeObservation",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ExecutionTimeObservation.ExecutionTimeObservationKind",Q8]},{no:2,name:"move_entry_point",kind:"message",T:()=>pA},{no:3,name:"validator_observations",kind:"message",repeat:2,T:()=>t9}])}};const QM=new KM;var e9=class extends Z{constructor(){super("sui.rpc.v2.ValidatorExecutionTimeObservation",[{no:1,name:"validator",kind:"scalar",opt:!0,T:12},{no:2,name:"duration",kind:"message",T:()=>$8}])}};const t9=new e9;function AS(e){const t=BigInt(e);return{seconds:t/1000n,nanos:Number(t%1000n)*1e6}}function qf(e){return(e.seconds*1000n+BigInt(Math.floor(e.nanos/1e6))).toString()}function n9(e){switch(e.$kind){case"Pure":return{kind:Qs.PURE,pure:qe(e.Pure.bytes)};case"Object":if(e.Object.$kind==="ImmOrOwnedObject")return{kind:Qs.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:Qs.SHARED,objectId:e.Object.SharedObject.objectId,version:BigInt(e.Object.SharedObject.initialSharedVersion),mutable:e.Object.SharedObject.mutable};if(e.Object.$kind==="Receiving")return{kind:Qs.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:Qs.FUNDS_WITHDRAWAL,fundsWithdrawal:{amount:s.reservation.$kind==="MaxAmountU64"?BigInt(s.reservation.MaxAmountU64):void 0,coinType:s.typeArg.$kind==="Balance"?s.typeArg.Balance:void 0,...s9(s.withdrawFrom)}}}default:throw new Error(`Unknown CallArg kind: ${JSON.stringify(e)}`)}}function s9(e){switch(e.$kind){case"Sender":return{source:kc.SENDER};case"Sponsor":return{source:kc.SPONSOR};case"SenderAllowance":return{source:kc.SENDER_ALLOWANCE,funder:e.SenderAllowance.funder,allowance:e.SenderAllowance.allowance};default:throw new Error(`Unknown WithdrawFrom kind: ${JSON.stringify(e)}`)}}function r9(e){switch(e?.source){case kc.SPONSOR:return{$kind:"Sponsor",Sponsor:!0};case kc.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:ii.GAS};if("Input"in e)return{kind:ii.INPUT,input:e.Input};if("Result"in e)return{kind:ii.RESULT,result:e.Result};if("NestedResult"in e)return{kind:ii.RESULT,result:e.NestedResult[0],subresult:e.NestedResult[1]};throw new Error(`Unknown Argument: ${JSON.stringify(e)}`)}function a9(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=>qe(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=>qe(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 yA(e){const t={version:1,kind:{data:{oneofKind:"programmableTransaction",programmableTransaction:{inputs:e.inputs.map(n9),commands:e.commands.map(a9)}}}};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:ca.NONE};else if(e.expiration.$kind==="Epoch")t.expiration={kind:ca.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"?ca.VALID_DURING:ca.VALIDITY,minEpoch:r.minEpoch!=null?BigInt(r.minEpoch):void 0,epoch:r.maxEpoch!=null?BigInt(r.maxEpoch):void 0,minTimestamp:r.minTimestamp!=null?AS(r.minTimestamp):void 0,maxTimestamp:r.maxTimestamp!=null?AS(r.maxTimestamp):void 0,chain:r.chain,nonce:r.nonce,allowedProposers:i?{epoch:BigInt(i.epoch),proposers:P4(i.proposers)}:void 0}}}return t}function i9(e,t,s){const r=vA(t);s?.onlyTransactionKind?e.applyResolvedData({...r,sender:null,gasData:{budget:null,owner:null,payment:null,price:null},expiration:null}):e.applyResolvedData(r)}function o9(e){const t=e.getData();return t.sender||(t.sender="0x0000000000000000000000000000000000000000000000000000000000000000"),yA(t)}function c9(e){switch(e.kind){case Qs.PURE:return{$kind:"Pure",Pure:{bytes:st(e.pure)}};case Qs.IMMUTABLE_OR_OWNED:return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{objectId:e.objectId,version:e.version.toString(),digest:e.digest}}};case Qs.SHARED:return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{objectId:e.objectId,initialSharedVersion:e.version.toString(),mutable:e.mutable??!1}}};case Qs.RECEIVING:return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{objectId:e.objectId,version:e.version.toString(),digest:e.digest}}};case Qs.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:r9(e.fundsWithdrawal)}};default:throw new Error(`Unknown Input kind: ${JSON.stringify(e)}`)}}function Kr(e){switch(e.kind){case ii.GAS:return{$kind:"GasCoin",GasCoin:!0};case ii.INPUT:return{$kind:"Input",Input:e.input};case ii.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 l9(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(Kr)}};case"transferObjects":return{$kind:"TransferObjects",TransferObjects:{objects:t.transferObjects.objects.map(Kr),address:Kr(t.transferObjects.address)}};case"splitCoins":return{$kind:"SplitCoins",SplitCoins:{coin:Kr(t.splitCoins.coin),amounts:t.splitCoins.amounts.map(Kr)}};case"mergeCoins":return{$kind:"MergeCoins",MergeCoins:{destination:Kr(t.mergeCoins.coin),sources:t.mergeCoins.coinsToMerge.map(Kr)}};case"publish":return{$kind:"Publish",Publish:{modules:t.publish.modules.map(s=>st(s)),dependencies:t.publish.dependencies??[]}};case"makeMoveVector":return{$kind:"MakeMoveVec",MakeMoveVec:{type:t.makeMoveVector.elementType??null,elements:t.makeMoveVector.elements.map(Kr)}};case"upgrade":return{$kind:"Upgrade",Upgrade:{modules:t.upgrade.modules.map(s=>st(s)),dependencies:t.upgrade.dependencies??[],package:t.upgrade.package,ticket:Kr(t.upgrade.ticket)}};default:throw new Error(`Unknown Command kind: ${JSON.stringify(t)}`)}}function vA(e){const t=e.kind?.data;if(t?.oneofKind!=="programmableTransaction")throw new Error("Only programmable transactions are supported");const s=t.programmableTransaction.inputs.map(c9),r=t.programmableTransaction.commands.map(l9);let i=null;if(e.expiration)switch(e.expiration.kind){case ca.NONE:i={$kind:"None",None:!0};break;case ca.EPOCH:i={$kind:"Epoch",Epoch:e.expiration.epoch.toString()};break;case ca.VALID_DURING:i={$kind:"ValidDuring",ValidDuring:{minEpoch:e.expiration.minEpoch?.toString()??null,maxEpoch:e.expiration.epoch?.toString()??null,minTimestamp:e.expiration.minTimestamp?qf(e.expiration.minTimestamp):null,maxTimestamp:e.expiration.maxTimestamp?qf(e.expiration.maxTimestamp):null,chain:e.expiration.chain??"",nonce:e.expiration.nonce??0}};break;case ca.VALIDITY:i={$kind:"Validity",Validity:{minEpoch:e.expiration.minEpoch?.toString()??null,maxEpoch:e.expiration.epoch?.toString()??null,minTimestamp:e.expiration.minTimestamp?qf(e.expiration.minTimestamp):null,maxTimestamp:e.expiration.maxTimestamp?qf(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:Cv(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 u9({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},f]=await Promise.all([t.core.getChainIdentifier(),s==null?t.core.getCurrentSystemState():null]),p=BigInt(s??f.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 d9=(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})({}),bA=(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})({}),f9=(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})({}),h9=(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 p9=class extends Z{constructor(){super("sui.rpc.v2.ExecutionStatus",[{no:1,name:"success",kind:"scalar",opt:!0,T:8},{no:2,name:"error",kind:"message",T:()=>y9}])}};const m9=new p9;var g9=class extends Z{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",d9]},{no:4,name:"abort",kind:"message",oneof:"errorDetails",T:()=>b9},{no:5,name:"size_error",kind:"message",oneof:"errorDetails",T:()=>k9},{no:6,name:"command_argument_error",kind:"message",oneof:"errorDetails",T:()=>R9},{no:7,name:"type_argument_error",kind:"message",oneof:"errorDetails",T:()=>U9},{no:8,name:"package_upgrade_error",kind:"message",oneof:"errorDetails",T:()=>M9},{no:9,name:"index_error",kind:"message",oneof:"errorDetails",T:()=>wA},{no:10,name:"object_id",kind:"scalar",oneof:"errorDetails",T:9},{no:11,name:"coin_deny_list_error",kind:"message",oneof:"errorDetails",T:()=>N9},{no:12,name:"congested_objects",kind:"message",oneof:"errorDetails",T:()=>C9}])}};const y9=new g9;var v9=class extends Z{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:()=>T9},{no:3,name:"clever_error",kind:"message",T:()=>S9}])}};const b9=new v9;var w9=class extends Z{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 T9=new w9;var E9=class extends Z{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 S9=new E9;var _9=class extends Z{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 k9=new _9;var A9=class extends Z{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 wA=new A9;var O9=class extends Z{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 N9=new O9;var x9=class extends Z{constructor(){super("sui.rpc.v2.CongestedObjects",[{no:1,name:"objects",kind:"scalar",repeat:2,T:9}])}};const C9=new x9;var I9=class extends Z{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",bA]},{no:3,name:"index_error",kind:"message",T:()=>wA}])}};const R9=new I9;var j9=class extends Z{constructor(){super("sui.rpc.v2.PackageUpgradeError",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.PackageUpgradeError.PackageUpgradeErrorKind",f9]},{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 M9=new j9;var D9=class extends Z{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",h9]}])}};const U9=new D9;var B9=class extends Z{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 TA=new B9;let wh=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.DOES_NOT_EXIST=1]="DOES_NOT_EXIST",e[e.EXISTS=2]="EXISTS",e})({}),bc=(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})({}),bu=(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})({}),L9=(function(e){return e[e.ACCUMULATOR_OPERATION_UNKNOWN=0]="ACCUMULATOR_OPERATION_UNKNOWN",e[e.MERGE=1]="MERGE",e[e.SPLIT=2]="SPLIT",e})({}),z9=(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})({}),Wi=(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 $9=class extends Z{constructor(){super("sui.rpc.v2.TransactionEffects",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{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:()=>m9},{no:5,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"gas_used",kind:"message",T:()=>TA},{no:7,name:"transaction_digest",kind:"scalar",opt:!0,T:9},{no:8,name:"gas_object",kind:"message",T:()=>OS},{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:()=>OS},{no:13,name:"unchanged_consensus_objects",kind:"message",repeat:2,T:()=>Y9},{no:14,name:"auxiliary_data_digest",kind:"scalar",opt:!0,T:9},{no:15,name:"unchanged_loaded_runtime_objects",kind:"message",repeat:2,T:()=>hA}])}};const V9=new $9;var P9=class extends Z{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",wh,"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:()=>Ky},{no:6,name:"output_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.OutputObjectState",bc,"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:()=>Ky},{no:12,name:"accumulator_write",kind:"message",T:()=>q9},{no:10,name:"id_operation",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.IdOperation",bu]},{no:11,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const OS=new P9;var G9=class extends Z{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 F9=new G9;var H9=class extends Z{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",L9]},{no:4,name:"value_kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.AccumulatorWrite.AccumulatorValue",z9]},{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:()=>F9}])}};const q9=new H9;var Z9=class extends Z{constructor(){super("sui.rpc.v2.UnchangedConsensusObject",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.UnchangedConsensusObject.UnchangedConsensusObjectKind",Wi]},{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 Y9=new Z9,W9=50;function NS(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??W9}}function X9(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 J9(e,t,s){if(EA(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 K9(e,t,s){if(EA(t,["sender","emitModule","eventType"],"event"),t.sender!=null)return{$kind:"sender",sender:ye(t.sender)};if(t.emitModule!=null){const[c,u,...f]=t.emitModule.split("::");if(!c||!u||f.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 EA(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 Q9=class extends Z{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 eD=new Q9;var tD=class extends Z{constructor(){super("sui.rpc.v2.TransactionEvents",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"events",kind:"message",repeat:2,T:()=>sb}])}};const nD=new tD;var sD=class extends Z{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:()=>Ts},{no:6,name:"json",kind:"message",T:()=>fn},{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 sb=new sD;let Np=(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 rD=class extends Z{constructor(){super("sui.rpc.v2.UserSignature",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:3,name:"simple",kind:"message",oneof:"signature",T:()=>rb},{no:4,name:"multisig",kind:"message",oneof:"signature",T:()=>pD},{no:5,name:"zklogin",kind:"message",oneof:"signature",T:()=>_A},{no:6,name:"passkey",kind:"message",oneof:"signature",T:()=>kA}])}};const xp=new rD;var aD=class extends Z{constructor(){super("sui.rpc.v2.SimpleSignature",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"public_key",kind:"scalar",opt:!0,T:12}])}};const rb=new aD;var iD=class extends Z{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 SA=new iD;var oD=class extends Z{constructor(){super("sui.rpc.v2.MultisigMemberPublicKey",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:2,name:"public_key",kind:"scalar",opt:!0,T:12},{no:3,name:"zklogin",kind:"message",T:()=>SA}])}};const cD=new oD;var lD=class extends Z{constructor(){super("sui.rpc.v2.MultisigMember",[{no:1,name:"public_key",kind:"message",T:()=>cD},{no:2,name:"weight",kind:"scalar",opt:!0,T:13}])}};const uD=new lD;var dD=class extends Z{constructor(){super("sui.rpc.v2.MultisigCommittee",[{no:1,name:"members",kind:"message",repeat:2,T:()=>uD},{no:2,name:"threshold",kind:"scalar",opt:!0,T:13}])}};const fD=new dD;var hD=class extends Z{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:()=>fD}])}};const pD=new hD;var mD=class extends Z{constructor(){super("sui.rpc.v2.MultisigMemberSignature",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"zklogin",kind:"message",T:()=>_A},{no:4,name:"passkey",kind:"message",T:()=>kA}])}};const gD=new mD;var yD=class extends Z{constructor(){super("sui.rpc.v2.ZkLoginAuthenticator",[{no:1,name:"inputs",kind:"message",T:()=>bD},{no:2,name:"max_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"signature",kind:"message",T:()=>rb},{no:4,name:"public_identifier",kind:"message",T:()=>SA},{no:5,name:"jwk_id",kind:"message",T:()=>dA}])}};const _A=new yD;var vD=class extends Z{constructor(){super("sui.rpc.v2.ZkLoginInputs",[{no:1,name:"proof_points",kind:"message",T:()=>TD},{no:2,name:"iss_base64_details",kind:"message",T:()=>SD},{no:3,name:"header_base64",kind:"scalar",opt:!0,T:9},{no:4,name:"address_seed",kind:"scalar",opt:!0,T:9}])}};const bD=new vD;var wD=class extends Z{constructor(){super("sui.rpc.v2.ZkLoginProof",[{no:1,name:"a",kind:"message",T:()=>xS},{no:2,name:"b",kind:"message",T:()=>AD},{no:3,name:"c",kind:"message",T:()=>xS}])}};const TD=new wD;var ED=class extends Z{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 SD=new ED;var _D=class extends Z{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 xS=new _D;var kD=class extends Z{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 AD=new kD;var OD=class extends Z{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:()=>rb}])}};const kA=new OD;var ND=class extends Z{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:()=>AA}])}};const xD=new ND;var CD=class extends Z{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 AA=new CD;var ID=class extends Z{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 RD=new ID;var jD=class extends Z{constructor(){super("sui.rpc.v2.ExecutedTransaction",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"transaction",kind:"message",T:()=>nb},{no:3,name:"signatures",kind:"message",repeat:2,T:()=>xp},{no:4,name:"effects",kind:"message",T:()=>V9},{no:5,name:"events",kind:"message",T:()=>nD},{no:6,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"timestamp",kind:"message",T:()=>Or},{no:8,name:"balance_changes",kind:"message",repeat:2,T:()=>eD},{no:9,name:"objects",kind:"message",T:()=>fA},{no:10,name:"transaction_index",kind:"scalar",opt:!0,T:4,L:0}])}};const ha=new jD;var MD=class extends Z{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 Fh(r)}).join(",")}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse FieldMask from JSON "+ma(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 Bn=new MD;let wu=(function(e){return e[e.ENABLED=0]="ENABLED",e[e.DISABLED=1]="DISABLED",e})({});var DD=class extends Z{constructor(){super("sui.rpc.v2.ExecuteTransactionRequest",[{no:1,name:"transaction",kind:"message",T:()=>nb},{no:2,name:"signatures",kind:"message",repeat:2,T:()=>xp},{no:3,name:"read_mask",kind:"message",T:()=>Bn}])}};const UD=new DD;var BD=class extends Z{constructor(){super("sui.rpc.v2.ExecuteTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha}])}};const LD=new BD;var zD=class extends Z{constructor(){super("sui.rpc.v2.SimulateTransactionRequest",[{no:1,name:"transaction",kind:"message",T:()=>nb},{no:2,name:"read_mask",kind:"message",T:()=>Bn},{no:3,name:"checks",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SimulateTransactionRequest.TransactionChecks",wu]},{no:4,name:"do_gas_selection",kind:"scalar",opt:!0,T:8}])}};const $D=new zD;var VD=class extends Z{constructor(){super("sui.rpc.v2.SimulateTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha},{no:2,name:"command_outputs",kind:"message",repeat:2,T:()=>GD},{no:3,name:"suggested_gas_price",kind:"scalar",opt:!0,T:4,L:0}])}};const OA=new VD;var PD=class extends Z{constructor(){super("sui.rpc.v2.CommandResult",[{no:1,name:"return_values",kind:"message",repeat:2,T:()=>CS},{no:2,name:"mutated_by_ref",kind:"message",repeat:2,T:()=>CS}])}};const GD=new PD;var FD=class extends Z{constructor(){super("sui.rpc.v2.CommandOutput",[{no:1,name:"argument",kind:"message",T:()=>Ar},{no:2,name:"value",kind:"message",T:()=>Ts},{no:3,name:"json",kind:"message",T:()=>fn}])}};const CS=new FD,G0=new gi("sui.rpc.v2.TransactionExecutionService",[{name:"ExecuteTransaction",options:{},I:UD,O:LD},{name:"SimulateTransaction",options:{},I:$D,O:OA}]);let Qy=(function(e){return e[e.ASCENDING=0]="ASCENDING",e[e.DESCENDING=1]="DESCENDING",e})({}),Tu=(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 HD=class extends Z{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",Qy,"ORDERING_"]}])}};const ab=new HD;var qD=class extends Z{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 sd=new qD;var ZD=class extends Z{constructor(){super("sui.rpc.v2.QueryEnd",[{no:1,name:"reason",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.QueryEndReason",Tu,"QUERY_END_REASON_"]}])}};const ib=new ZD;function YD(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 WD(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 XD(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:!Zj(e)&&s==="name%20has%20expired"}var JD=class extends e8{#e;constructor({client:e,...t}){super(t),this.#e=e}async getObjects(e){const t=Rh(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,f)=>{if(u.result.oneofKind==="error"){const A=u.result.error;return A.code===we.NOT_FOUND?new lh("notExists",A.message,{cause:A,reason:"notFound",objectId:i[f]}):new lh(we[A.code]??"unknown",A.message,{cause:A,reason:"unknown",objectId:i[f]})}if(u.result.oneofKind!=="object")return new lh("unknown","Unexpected result type",{reason:"unknown",objectId:i[f]});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?fn.toJson(u.result.object.json):null:void 0,S=RS(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:Ji(u.result.object.owner),type:y,previousTransaction:u.result.object.previousTransaction??void 0,objectBcs:m,json:b,display:S}}))}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?qe(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:Ji(r.owner),type:r.objectType,previousTransaction:r.previousTransaction??void 0,objectBcs:r.bcs?.value,json:e.include?.json?r.json?fn.toJson(r.json):null:void 0,display:RS(e.include?.display,r.display)})),cursor:s.response.nextPageToken?st(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??Uh,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?qe(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:Ji(i.owner),type:i.objectType,balance:i.balance?.toString()})),cursor:r.response.nextPageToken?st(r.response.nextPageToken):null,hasNextPage:r.response.nextPageToken!==void 0}}async getBalance(e){const t=e.coinType??Uh,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?qe(e.cursor):void 0,pageSize:e.limit},{abort:e.signal});return{hasNextPage:!!t.response.nextPageToken,cursor:t.response.nextPageToken?st(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:Zf(e.include)}},{abort:e.signal});if(!t.transaction)throw new WE("notFound",e.digest);return F0(Th(t.transaction,{include:e.include}),e.include,()=>ha.toJson(t.transaction))}catch(t){throw t instanceof gt&&t.code===we[we.NOT_FOUND]?new WE("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:qe(s)},signature:{oneofKind:void 0}})),readMask:{paths:Zf(e.include)}},{abort:e.signal});return F0(Th(t.transaction,{include:e.include}),e.include,()=>ha.toJson(t.transaction))}async simulateTransaction(e){const t=Zf(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?c8(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}}:o9(e.transaction),readMask:{paths:t},doGasSelection:s,checks:e.checksEnabled===!1?wu.DISABLED:wu.ENABLED},{abort:e.signal});return F0(tU(r,{include:e.include}),e.include,()=>OA.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=Zf(e.include),s=e.filter?await J9(this.mvr,e.filter,e.signal):void 0,r=NS(e);X9(s,r);const i=this.#e.ledgerService.listTransactions({readMask:{paths:t},filter:s&&YD(s),options:IS(r,r.limit+1)},{abort:e.signal}),c=[];let u=null,f=null,p=null,m,g=!1;for await(const b of i.responses)b.watermark?.cursor&&(p=st(b.watermark.cursor)),b.transaction&&(c.length>=r.limit?g=!0:(u??=p,f=p,c.push(Th(b.transaction,{include:e.include})))),b.end&&(m=b.end);const y=g||m?.reason===Tu.SCAN_LIMIT||m?.reason===Tu.ITEM_LIMIT;return{transactions:c,hasNextPage:y,startCursor:u,endCursor:g?f:y?p??f:f}}async listEvents(e){const t=NS(e),s=this.#e.ledgerService.listEvents({readMask:{paths:["package_id","module","sender","event_type","contents","json","checkpoint","transaction_digest","event_index"]},filter:e.filter?WD(await K9(this.mvr,e.filter,e.signal)):void 0,options:IS(t,t.limit+1)},{abort:e.signal}),r=[];let i=null,c=null,u=null,f,p=!1;for await(const g of s.responses){if(g.watermark?.cursor&&(u=st(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?fn.toJson(y.json):null,checkpoint:y.checkpoint?.toString()??null,transactionDigest:y.transactionDigest,eventIndex:y.eventIndex})}g.end&&(f=g.end)}const m=p||f?.reason===Tu.SCAN_LIMIT||f?.reason===Tu.ITEM_LIMIT;return{events:r,hasNextPage:m,startCursor:i,endCursor:p?c:m?u??c:c}}async verifyZkLoginSignature(e){const t=qe(e.bytes),s=e.intentScope==="PersonalMessage"?F.byteVector().serialize(t).toBytes():t,{response:r}=await this.#e.signatureVerificationService.verifySignature({message:{name:e.intentScope,value:s},signature:{bcs:{value:qe(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(XD(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 bh.PUBLIC:r="public";break;case bh.PRIVATE:r="private";break;case bh.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 _c.COPY:return"copy";case _c.DROP:return"drop";case _c.STORE:return"store";case _c.KEY:return"key";default:return"unknown"}})??[]}))??[],parameters:s.function?.parameters?.map(i=>US(i))??[],returns:s.function?.returns?.map(i=>US(i))??[]}}}async getChainIdentifier(e){return ch(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=yA(c),f=!r.onlyTransactionKind&&(c.gasData.budget==null||c.gasData.payment==null);let p;try{p=(await e.transactionExecutionService.simulateTransaction({transaction:u,doGasSelection:f,checks:r.onlyTransactionKind?wu.DISABLED:wu.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 Vy(m.message,{cause:m}):m}if(!r.onlyTransactionKind&&p.transaction?.effects?.status&&!p.transaction.effects.status.success){const m=p.transaction.effects.status.error?ob(p.transaction.effects.status.error):void 0;throw new Vy(`Transaction resolution failed: ${m?.message??"Transaction failed"}`,{executionError:m})}if(!p.transaction?.transaction)throw new Error("simulateTransaction did not return resolved transaction data");return i9(s,p.transaction.transaction,r),await u9({transactionData:s,client:e,epoch:p.transaction.effects?.epoch,originalTransactionData:c,isTransactionKindOnly:!!r.onlyTransactionKind,doGasSelection:f}),await i()}}};function IS(e,t){return{limit:t,ordering:e.descending?Qy.DESCENDING:Qy.ASCENDING,after:e.after?qe(e.after):void 0,before:e.before?qe(e.before):void 0}}function Zf(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 F0(e,t,s){return t?.protoJson?{...e,protoJson:s()}:e}function RS(e,t){if(e)return t===void 0?null:{output:t.output!==void 0?fn.toJson(t.output):null,errors:t.errors!==void 0?fn.toJson(t.errors):null}}function Ji(e){if(!e)return null;if(e.kind===vc.IMMUTABLE)return{$kind:"Immutable",Immutable:!0};if(e.kind===vc.ADDRESS)return{AddressOwner:e.address,$kind:"AddressOwner"};if(e.kind===vc.OBJECT)return{$kind:"ObjectOwner",ObjectOwner:e.address};if(e.kind===vc.SHARED)return{$kind:"Shared",Shared:{initialSharedVersion:e.version?.toString()}};if(e.kind===vc.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 ob(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:aA({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:KD(i)}}case"sizeError":return{$kind:"SizeError",message:t,command:s,SizeError:{name:Gi(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:Gi(r.commandArgumentError.kind)}};case"typeArgumentError":return{$kind:"TypeArgumentError",message:t,command:s,TypeArgumentError:{typeArgument:r.typeArgumentError.typeArgument??0,name:Gi(r.typeArgumentError.kind)}};case"packageUpgradeError":return{$kind:"PackageUpgradeError",message:t,command:s,PackageUpgradeError:{name:Gi(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:Gi(e.kind),coinType:r.coinDenyListError.coinType,address:r.coinDenyListError.address}};case"congestedObjects":return{$kind:"CongestedObjects",message:t,command:s,CongestedObjects:{name:Gi(e.kind),objects:r.congestedObjects.objects}};case"objectId":return{$kind:"ObjectIdError",message:t,command:s,ObjectIdError:{name:Gi(e.kind),objectId:r.objectId}};default:return{$kind:"Unknown",message:t,command:s,Unknown:null}}}function KD(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"?st(e.cleverError.value.raw):void 0}:void 0}}function Gi(e){if(e==null)return"Unknown";const t=bA[e];return!t||t.endsWith("_UNKNOWN")?"Unknown":t.split("_").map(s=>s.charAt(0)+s.slice(1).toLowerCase()).join("")}function jS(e){if(e==null)return null;switch(e){case bu.CREATED:return"Created";case bu.DELETED:return"Deleted";case bu.NONE:case bu.ID_OPERATION_UNKNOWN:return"None";default:return"Unknown"}}function MS(e){if(e==null)return null;switch(e){case wh.EXISTS:return"Exists";case wh.DOES_NOT_EXIST:return"DoesNotExist";case wh.UNKNOWN:return"Unknown";default:return"Unknown"}}function DS(e){if(e==null)return null;switch(e){case bc.OBJECT_WRITE:return"ObjectWrite";case bc.PACKAGE_WRITE:return"PackageWrite";case bc.DOES_NOT_EXIST:return"DoesNotExist";case bc.ACCUMULATOR_WRITE:return"AccumulatorWriteV1";case bc.UNKNOWN:return"Unknown";default:return"Unknown"}}function QD(e){if(e==null)return null;switch(e){case Wi.UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN:return"Unknown";case Wi.READ_ONLY_ROOT:return"ReadOnlyRoot";case Wi.MUTATE_CONSENSUS_STREAM_ENDED:return"MutateConsensusStreamEnded";case Wi.READ_CONSENSUS_STREAM_ENDED:return"ReadConsensusStreamEnded";case Wi.CANCELED:return"Cancelled";case Wi.PER_EPOCH_CONFIG:return"PerEpochConfig";default:return"Unknown"}}function eU({effects:e}){if(!e)return null;const t=e.changedObjects.map(s=>({objectId:s.objectId,inputState:MS(s.inputState),inputVersion:s.inputVersion?.toString()??null,inputDigest:s.inputDigest??null,inputOwner:Ji(s.inputOwner),outputState:DS(s.outputState),outputVersion:s.outputVersion?.toString()??null,outputDigest:s.outputDigest??null,outputOwner:Ji(s.outputOwner),idOperation:jS(s.idOperation)}));return{bcs:e.bcs?.value,version:e.version??2,status:e.status?.success?{success:!0,error:null}:{success:!1,error:ob(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:MS(e.gasObject.inputState),inputVersion:e.gasObject.inputVersion?.toString()??null,inputDigest:e.gasObject.inputDigest??null,inputOwner:Ji(e.gasObject.inputOwner),outputState:DS(e.gasObject.outputState),outputVersion:e.gasObject.outputVersion?.toString()??null,outputDigest:e.gasObject.outputDigest??null,outputOwner:Ji(e.gasObject.outputOwner),idOperation:jS(e.gasObject.idOperation)}:null,eventsDigest:e.eventsDigest??null,dependencies:e.dependencies,lamportVersion:e.lamportVersion?.toString()??null,changedObjects:t,unchangedConsensusObjects:e.unchangedConsensusObjects.map(s=>({kind:QD(s.kind),objectId:s.objectId,version:s.version?.toString()??null,digest:s.digest??null})),auxiliaryDataDigest:e.auxiliaryDataDigest??null}}function Th(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=vA(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?eU({effects:e.effects}):void 0,f=e.effects?.status?.success?{success:!0,error:null}:{success:!1,error:e.effects?.status?.error?ob(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:f,effects:u,objectTypes:s?.objectTypes?r:void 0,transaction:i,bcs:c,signatures:e.signatures?.map(m=>st(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?fn.toJson(m.json):null}))??[]:void 0};return f.success?{$kind:"Transaction",Transaction:p}:{$kind:"FailedTransaction",FailedTransaction:p}}function tU(e,t){const s=t?.include,r=Th(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 US(e){let t=null;return e.reference===Jy.IMMUTABLE?t="immutable":e.reference===Jy.MUTABLE&&(t="mutable"),{reference:t,body:ev(e.body)}}function ev(e){switch(e.type){case gs.TYPE_UNKNOWN:return{$kind:"unknown"};case gs.ADDRESS:return{$kind:"address"};case gs.BOOL:return{$kind:"bool"};case gs.U8:return{$kind:"u8"};case gs.U16:return{$kind:"u16"};case gs.U32:return{$kind:"u32"};case gs.U64:return{$kind:"u64"};case gs.U128:return{$kind:"u128"};case gs.U256:return{$kind:"u256"};case gs.VECTOR:return{$kind:"vector",vector:ev(e.typeParameterInstantiation[0])};case gs.DATATYPE:return{$kind:"datatype",datatype:{typeName:e.typeName,typeParameters:e.typeParameterInstantiation.map(t=>ev(t))}};case gs.TYPE_PARAMETER:return{$kind:"typeParameter",index:e.typeParameter};default:return{$kind:"unknown"}}}var nU=class{constructor(e){this._transport=e,this.typeName=G0.typeName,this.methods=G0.methods,this.options=G0.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)}},sU=class extends Z{constructor(){super("sui.rpc.v2.TransactionFilter",[{no:1,name:"terms",kind:"message",repeat:2,T:()=>aU}])}};const Cp=new sU;var rU=class extends Z{constructor(){super("sui.rpc.v2.TransactionTerm",[{no:1,name:"literals",kind:"message",repeat:2,T:()=>oU}])}};const aU=new rU;var iU=class extends Z{constructor(){super("sui.rpc.v2.TransactionLiteral",[{no:1,name:"negated",kind:"scalar",T:8},{no:2,name:"sender",kind:"message",oneof:"predicate",T:()=>xA},{no:3,name:"affected_address",kind:"message",oneof:"predicate",T:()=>mU},{no:4,name:"affected_object",kind:"message",oneof:"predicate",T:()=>yU},{no:5,name:"move_call",kind:"message",oneof:"predicate",T:()=>bU},{no:6,name:"emit_module",kind:"message",oneof:"predicate",T:()=>CA},{no:7,name:"event_type",kind:"message",oneof:"predicate",T:()=>IA},{no:8,name:"event_stream_head",kind:"message",oneof:"predicate",T:()=>RA},{no:9,name:"package_write",kind:"message",oneof:"predicate",T:()=>_U}])}};const oU=new iU;var cU=class extends Z{constructor(){super("sui.rpc.v2.EventFilter",[{no:1,name:"terms",kind:"message",repeat:2,T:()=>uU}])}};const NA=new cU;var lU=class extends Z{constructor(){super("sui.rpc.v2.EventTerm",[{no:1,name:"literals",kind:"message",repeat:2,T:()=>fU}])}};const uU=new lU;var dU=class extends Z{constructor(){super("sui.rpc.v2.EventLiteral",[{no:1,name:"negated",kind:"scalar",T:8},{no:2,name:"sender",kind:"message",oneof:"predicate",T:()=>xA},{no:3,name:"emit_module",kind:"message",oneof:"predicate",T:()=>CA},{no:4,name:"event_type",kind:"message",oneof:"predicate",T:()=>IA},{no:5,name:"event_stream_head",kind:"message",oneof:"predicate",T:()=>RA}])}};const fU=new dU;var hU=class extends Z{constructor(){super("sui.rpc.v2.SenderFilter",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const xA=new hU;var pU=class extends Z{constructor(){super("sui.rpc.v2.AffectedAddressFilter",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const mU=new pU;var gU=class extends Z{constructor(){super("sui.rpc.v2.AffectedObjectFilter",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9}])}};const yU=new gU;var vU=class extends Z{constructor(){super("sui.rpc.v2.MoveCallFilter",[{no:1,name:"function",kind:"scalar",opt:!0,T:9}])}};const bU=new vU;var wU=class extends Z{constructor(){super("sui.rpc.v2.EmitModuleFilter",[{no:1,name:"module",kind:"scalar",opt:!0,T:9}])}};const CA=new wU;var TU=class extends Z{constructor(){super("sui.rpc.v2.EventTypeFilter",[{no:1,name:"event_type",kind:"scalar",opt:!0,T:9}])}};const IA=new TU;var EU=class extends Z{constructor(){super("sui.rpc.v2.EventStreamHeadFilter",[{no:1,name:"stream_id",kind:"scalar",opt:!0,T:9}])}};const RA=new EU;var SU=class extends Z{constructor(){super("sui.rpc.v2.PackageWriteFilter",[])}};const _U=new SU;var kU=class extends Z{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:()=>fn}}])}};const AU=new kU;var OU=class extends Z{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:()=>zU},{no:5,name:"storage_fund",kind:"message",T:()=>BU},{no:6,name:"parameters",kind:"message",T:()=>RU},{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:()=>CU},{no:9,name:"stake_subsidy",kind:"message",T:()=>DU},{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:()=>Ls}])}};const NU=new OU;var xU=class extends Z{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 CU=new xU;var IU=class extends Z{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:()=>Ls}])}};const RU=new IU;var jU=class extends Z{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 Ls=new jU;var MU=class extends Z{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:()=>Ls}])}};const DU=new MU;var UU=class extends Z{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 BU=new UU;var LU=class extends Z{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:()=>VU},{no:3,name:"pending_active_validators",kind:"message",T:()=>Ls},{no:4,name:"pending_removals",kind:"scalar",repeat:1,T:4,L:0},{no:5,name:"staking_pool_mappings",kind:"message",T:()=>Ls},{no:6,name:"inactive_validators",kind:"message",T:()=>Ls},{no:7,name:"validator_candidates",kind:"message",T:()=>Ls},{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:()=>Ls}])}};const zU=new LU;var $U=class extends Z{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:()=>Ls},{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:()=>GU},{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:()=>Ls}])}};const VU=new $U;var PU=class extends Z{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:()=>Ls},{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:()=>Ls}])}};const GU=new PU;var FU=class extends Z{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:()=>xD},{no:3,name:"system_state",kind:"message",T:()=>NU},{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:()=>Or},{no:7,name:"end",kind:"message",T:()=>Or},{no:8,name:"reference_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"protocol_config",kind:"message",T:()=>AU}])}};const HU=new FU;var qU=class extends Z{constructor(){super("sui.rpc.v2.CheckpointContents",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{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:()=>WU}])}};const ZU=new qU;var YU=class extends Z{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:()=>xp},{no:4,name:"address_aliases_versions",kind:"message",repeat:2,T:()=>JU}])}};const WU=new YU;var XU=class extends Z{constructor(){super("sui.rpc.v2.AddressAliasesVersion",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const JU=new XU;let KU=(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 QU=class extends Z{constructor(){super("sui.rpc.v2.CheckpointSummary",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{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:()=>TA},{no:9,name:"timestamp",kind:"message",T:()=>Or},{no:10,name:"commitments",kind:"message",repeat:2,T:()=>jA},{no:11,name:"end_of_epoch_data",kind:"message",T:()=>n7},{no:12,name:"version_specific_data",kind:"scalar",opt:!0,T:12}])}};const e7=new QU;var t7=class extends Z{constructor(){super("sui.rpc.v2.EndOfEpochData",[{no:1,name:"next_epoch_committee",kind:"message",repeat:2,T:()=>AA},{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:()=>jA}])}};const n7=new t7;var s7=class extends Z{constructor(){super("sui.rpc.v2.CheckpointCommitment",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CheckpointCommitment.CheckpointCommitmentKind",KU]},{no:2,name:"digest",kind:"scalar",opt:!0,T:9}])}};const jA=new s7;var r7=class extends Z{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:()=>e7},{no:4,name:"signature",kind:"message",T:()=>RD},{no:5,name:"contents",kind:"message",T:()=>ZU},{no:6,name:"transactions",kind:"message",repeat:2,T:()=>ha},{no:7,name:"objects",kind:"message",T:()=>fA}])}};const cb=new r7;var a7=class extends Z{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=Yk(t),i=r.typeRegistry?.find(f=>f.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.")||!$h(u))&&(u={value:u}),u["@type"]=e.typeUrl,u}internalJsonRead(e,t,s){if(!$h(e))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+ma(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 i7=new a7;var o7=class extends Z{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:()=>i7}])}};const MA=new o7;var c7=class extends Z{constructor(){super("sui.rpc.v2.GetServiceInfoRequest",[])}};const l7=new c7;var u7=class extends Z{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:()=>Or},{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 d7=new u7;var f7=class extends Z{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:()=>Bn}])}};const DA=new f7;var h7=class extends Z{constructor(){super("sui.rpc.v2.GetObjectResponse",[{no:1,name:"object",kind:"message",T:()=>uo}])}};const p7=new h7;var m7=class extends Z{constructor(){super("sui.rpc.v2.BatchGetObjectsRequest",[{no:1,name:"requests",kind:"message",repeat:2,T:()=>DA},{no:2,name:"read_mask",kind:"message",T:()=>Bn}])}};const g7=new m7;var y7=class extends Z{constructor(){super("sui.rpc.v2.BatchGetObjectsResponse",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>w7}])}};const v7=new y7;var b7=class extends Z{constructor(){super("sui.rpc.v2.GetObjectResult",[{no:1,name:"object",kind:"message",oneof:"result",T:()=>uo},{no:2,name:"error",kind:"message",oneof:"result",T:()=>MA}])}};const w7=new b7;var T7=class extends Z{constructor(){super("sui.rpc.v2.GetTransactionRequest",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"read_mask",kind:"message",T:()=>Bn}])}};const E7=new T7;var S7=class extends Z{constructor(){super("sui.rpc.v2.GetTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha}])}};const _7=new S7;var k7=class extends Z{constructor(){super("sui.rpc.v2.BatchGetTransactionsRequest",[{no:1,name:"digests",kind:"scalar",repeat:2,T:9},{no:2,name:"read_mask",kind:"message",T:()=>Bn}])}};const A7=new k7;var O7=class extends Z{constructor(){super("sui.rpc.v2.BatchGetTransactionsResponse",[{no:1,name:"transactions",kind:"message",repeat:2,T:()=>C7}])}};const N7=new O7;var x7=class extends Z{constructor(){super("sui.rpc.v2.GetTransactionResult",[{no:1,name:"transaction",kind:"message",oneof:"result",T:()=>ha},{no:2,name:"error",kind:"message",oneof:"result",T:()=>MA}])}};const C7=new x7;var I7=class extends Z{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:()=>Bn}])}};const R7=new I7;var j7=class extends Z{constructor(){super("sui.rpc.v2.GetCheckpointResponse",[{no:1,name:"checkpoint",kind:"message",T:()=>cb}])}};const M7=new j7;var D7=class extends Z{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:()=>Bn}])}};const U7=new D7;var B7=class extends Z{constructor(){super("sui.rpc.v2.GetEpochResponse",[{no:1,name:"epoch",kind:"message",T:()=>HU}])}};const L7=new B7;var z7=class extends Z{constructor(){super("sui.rpc.v2.ListCheckpointsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{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:()=>Cp},{no:5,name:"options",kind:"message",T:()=>ab}])}};const $7=new z7;var V7=class extends Z{constructor(){super("sui.rpc.v2.ListCheckpointsResponse",[{no:1,name:"checkpoint",kind:"message",T:()=>cb},{no:2,name:"watermark",kind:"message",T:()=>sd},{no:3,name:"end",kind:"message",T:()=>ib}])}};const P7=new V7;var G7=class extends Z{constructor(){super("sui.rpc.v2.ListTransactionsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{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:()=>Cp},{no:5,name:"options",kind:"message",T:()=>ab}])}};const F7=new G7;var H7=class extends Z{constructor(){super("sui.rpc.v2.ListTransactionsResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha},{no:2,name:"watermark",kind:"message",T:()=>sd},{no:3,name:"end",kind:"message",T:()=>ib}])}};const q7=new H7;var Z7=class extends Z{constructor(){super("sui.rpc.v2.ListEventsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{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:()=>NA},{no:5,name:"options",kind:"message",T:()=>ab}])}};const Y7=new Z7;var W7=class extends Z{constructor(){super("sui.rpc.v2.ListEventsResponse",[{no:1,name:"event",kind:"message",T:()=>sb},{no:2,name:"watermark",kind:"message",T:()=>sd},{no:3,name:"end",kind:"message",T:()=>ib}])}};const X7=new W7,H0=new gi("sui.rpc.v2.LedgerService",[{name:"GetServiceInfo",options:{},I:l7,O:d7},{name:"GetObject",options:{},I:DA,O:p7},{name:"BatchGetObjects",options:{},I:g7,O:v7},{name:"GetTransaction",options:{},I:E7,O:_7},{name:"BatchGetTransactions",options:{},I:A7,O:N7},{name:"GetCheckpoint",options:{},I:R7,O:M7},{name:"GetEpoch",options:{},I:U7,O:L7},{name:"ListCheckpoints",serverStreaming:!0,options:{},I:$7,O:P7},{name:"ListTransactions",serverStreaming:!0,options:{},I:F7,O:q7},{name:"ListEvents",serverStreaming:!0,options:{},I:Y7,O:X7}]);var J7=class{constructor(e){this._transport=e,this.typeName=H0.typeName,this.methods=H0.methods,this.options=H0.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)}},K7=class extends Z{constructor(){super("sui.rpc.v2.GetPackageRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9}])}};const Q7=new K7;var eB=class extends Z{constructor(){super("sui.rpc.v2.GetPackageResponse",[{no:1,name:"package",kind:"message",T:()=>iA}])}};const tB=new eB;var nB=class extends Z{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 sB=new nB;var rB=class extends Z{constructor(){super("sui.rpc.v2.GetDatatypeResponse",[{no:1,name:"datatype",kind:"message",T:()=>oA}])}};const aB=new rB;var iB=class extends Z{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 oB=new iB;var cB=class extends Z{constructor(){super("sui.rpc.v2.GetFunctionResponse",[{no:1,name:"function",kind:"message",T:()=>uA}])}};const lB=new cB;var uB=class extends Z{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 dB=new uB;var fB=class extends Z{constructor(){super("sui.rpc.v2.ListPackageVersionsResponse",[{no:1,name:"versions",kind:"message",repeat:2,T:()=>mB},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const hB=new fB;var pB=class extends Z{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 mB=new pB,q0=new gi("sui.rpc.v2.MovePackageService",[{name:"GetPackage",options:{},I:Q7,O:tB},{name:"GetDatatype",options:{},I:sB,O:aB},{name:"GetFunction",options:{},I:oB,O:lB},{name:"ListPackageVersions",options:{},I:dB,O:hB}]);var gB=class{constructor(e){this._transport=e,this.typeName=q0.typeName,this.methods=q0.methods,this.options=q0.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)}},yB=class extends Z{constructor(){super("sui.rpc.v2.VerifySignatureRequest",[{no:1,name:"message",kind:"message",T:()=>Ts},{no:2,name:"signature",kind:"message",T:()=>xp},{no:3,name:"address",kind:"scalar",opt:!0,T:9},{no:4,name:"jwks",kind:"message",repeat:2,T:()=>gA}])}};const vB=new yB;var bB=class extends Z{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 wB=new bB,Z0=new gi("sui.rpc.v2.SignatureVerificationService",[{name:"VerifySignature",options:{},I:vB,O:wB}]);var TB=class{constructor(e){this._transport=e,this.typeName=Z0.typeName,this.methods=Z0.methods,this.options=Z0.options}verifySignature(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}};let EB=(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})({}),SB=(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})({}),_B=(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})({}),UA=(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 kB=class extends Z{constructor(){super("sui.rpc.v2.GetCoinInfoRequest",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const AB=new kB;var OB=class extends Z{constructor(){super("sui.rpc.v2.GetCoinInfoResponse",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:2,name:"metadata",kind:"message",T:()=>CB},{no:3,name:"treasury",kind:"message",T:()=>RB},{no:4,name:"regulated_metadata",kind:"message",T:()=>MB}])}};const NB=new OB;var xB=class extends Z{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",EB]}])}};const CB=new xB;var IB=class extends Z{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",SB]}])}};const RB=new IB;var jB=class extends Z{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",_B]}])}};const MB=new jB;var DB=class extends Z{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 UB=new DB;var BB=class extends Z{constructor(){super("sui.rpc.v2.GetBalanceResponse",[{no:1,name:"balance",kind:"message",T:()=>BA}])}};const LB=new BB;var zB=class extends Z{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 $B=new zB;var VB=class extends Z{constructor(){super("sui.rpc.v2.ListBalancesResponse",[{no:1,name:"balances",kind:"message",repeat:2,T:()=>BA},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const PB=new VB;var GB=class extends Z{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 BA=new GB;var FB=class extends Z{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:()=>Bn}])}};const HB=new FB;var qB=class extends Z{constructor(){super("sui.rpc.v2.ListDynamicFieldsResponse",[{no:1,name:"dynamic_fields",kind:"message",repeat:2,T:()=>WB},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const ZB=new qB;var YB=class extends Z{constructor(){super("sui.rpc.v2.DynamicField",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.DynamicField.DynamicFieldKind",UA]},{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:()=>uo},{no:5,name:"name",kind:"message",T:()=>Ts},{no:6,name:"value",kind:"message",T:()=>Ts},{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:()=>uo}])}};const WB=new YB;var XB=class extends Z{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:()=>Bn},{no:5,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const JB=new XB;var KB=class extends Z{constructor(){super("sui.rpc.v2.ListOwnedObjectsResponse",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>uo},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const QB=new KB,Y0=new gi("sui.rpc.v2.StateService",[{name:"ListDynamicFields",options:{},I:HB,O:ZB},{name:"ListOwnedObjects",options:{},I:JB,O:QB},{name:"GetCoinInfo",options:{},I:AB,O:NB},{name:"GetBalance",options:{},I:UB,O:LB},{name:"ListBalances",options:{},I:$B,O:PB}]);var eL=class{constructor(e){this._transport=e,this.typeName=Y0.typeName,this.methods=Y0.methods,this.options=Y0.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)}},tL=class extends Z{constructor(){super("sui.rpc.v2.SubscribeCheckpointsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"filter",kind:"message",T:()=>Cp}])}};const nL=new tL;var sL=class extends Z{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:()=>cb}])}};const rL=new sL;var aL=class extends Z{constructor(){super("sui.rpc.v2.SubscribeTransactionsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"filter",kind:"message",T:()=>Cp}])}};const iL=new aL;var oL=class extends Z{constructor(){super("sui.rpc.v2.SubscribeTransactionsResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha},{no:2,name:"watermark",kind:"message",T:()=>sd}])}};const cL=new oL;var lL=class extends Z{constructor(){super("sui.rpc.v2.SubscribeEventsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"filter",kind:"message",T:()=>NA}])}};const uL=new lL;var dL=class extends Z{constructor(){super("sui.rpc.v2.SubscribeEventsResponse",[{no:1,name:"event",kind:"message",T:()=>sb},{no:2,name:"watermark",kind:"message",T:()=>sd}])}};const fL=new dL,W0=new gi("sui.rpc.v2.SubscriptionService",[{name:"SubscribeCheckpoints",serverStreaming:!0,options:{},I:nL,O:rL},{name:"SubscribeTransactions",serverStreaming:!0,options:{},I:iL,O:cL},{name:"SubscribeEvents",serverStreaming:!0,options:{},I:uL,O:fL}]);var hL=class{constructor(e){this._transport=e,this.typeName=W0.typeName,this.methods=W0.methods,this.options=W0.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)}},pL=class extends Z{constructor(){super("sui.rpc.v2.LookupNameRequest",[{no:1,name:"name",kind:"scalar",opt:!0,T:9}])}};const mL=new pL;var gL=class extends Z{constructor(){super("sui.rpc.v2.LookupNameResponse",[{no:1,name:"record",kind:"message",T:()=>LA}])}};const yL=new gL;var vL=class extends Z{constructor(){super("sui.rpc.v2.ReverseLookupNameRequest",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const bL=new vL;var wL=class extends Z{constructor(){super("sui.rpc.v2.ReverseLookupNameResponse",[{no:1,name:"record",kind:"message",T:()=>LA}])}};const TL=new wL;var EL=class extends Z{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:()=>Or},{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 LA=new EL,X0=new gi("sui.rpc.v2.NameService",[{name:"LookupName",options:{},I:mL,O:yL},{name:"ReverseLookupName",options:{},I:bL,O:TL}]);var SL=class{constructor(e){this._transport=e,this.typeName=X0.typeName,this.methods=X0.methods,this.options=X0.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)}},_L=class extends Z{constructor(){super("sui.forking.v1alpha.AdvanceClockRequest",[{no:1,name:"duration_ms",kind:"scalar",opt:!0,T:4,L:0}])}};const kL=new _L;var AL=class extends Z{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 OL=new AL;var NL=class extends Z{constructor(){super("sui.forking.v1alpha.AdvanceCheckpointRequest",[])}};const xL=new NL;var CL=class extends Z{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 IL=new CL;var RL=class extends Z{constructor(){super("sui.forking.v1alpha.GetStatusRequest",[])}};const jL=new RL;var ML=class extends Z{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 DL=new ML,J0=new gi("sui.forking.v1alpha.ForkingService",[{name:"AdvanceClock",options:{},I:kL,O:OL},{name:"AdvanceCheckpoint",options:{},I:xL,O:IL},{name:"GetStatus",options:{},I:jL,O:DL}]);var UL=class{constructor(e){this._transport=e,this.typeName=J0.typeName,this.methods=J0.methods,this.options=J0.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 BL=Symbol.for("@mysten/SuiGrpcClient");var lb=class extends rA{get mvr(){return this.core.mvr}get[BL](){return!0}constructor(e){super({network:e.network});const{network:t,mvr:s,abort:r,transport:i,...c}=e,u=Jj(i??new Qv(c));this.transactionExecutionService=new nU(u),this.ledgerService=new J7(u),this.stateService=new eL(u),this.subscriptionService=new hL(u),this.movePackageService=new gB(u),this.signatureVerificationService=new TB(u),this.nameService=new SL(u),this.forkingService=new UL(u),this.core=new JD({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?qe(e.cursor):void 0,pageSize:e.limit,readMask:{paths:s}},{abort:e.signal});return{dynamicFields:r.response.dynamicFields.map(i=>{const c=i.kind===UA.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?st(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 LL="Dev Wallet",BS="dev-wallet:networks",zL={devnet:"https://fullnode.devnet.sui.io:443",testnet:"https://fullnode.testnet.sui.io:443",localnet:"http://127.0.0.1:9000"};var $L=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??zL),this.#r={...e.faucets},this.#s={},this.#a=e.activeNetwork??Object.keys(this.#t)[0]??"",this.#i=e.name??LL,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 lb({baseUrl:s,network:t})),this.#f=this.#A(),this.#l=x4(),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 rj(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.#E(e);return{...this.#s}}getClient(e){return this.#E(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.#E(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."),_p().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.#S(),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.#S(),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)}#S(){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.#S()}));#j=async()=>{};#M(e){const t=aj(e);if(!t)throw new Error(`Invalid chain identifier: ${e}`);return this.#E(t)}#D(e){if(!this.#h||typeof localStorage>"u")return{...e};try{const t=localStorage.getItem(BS);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(BS,JSON.stringify(this.#t))}#E(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 ij({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 VL="modulepreload",PL=function(e,t){return new URL(e,t).href},LS={},GL=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"),f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");i=m(s.map(g=>{if(g=PL(g,r),g in LS)return;LS[g]=!0;const y=g.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(r)for(let A=u.length-1;A>=0;A--){const N=u[A];if(N.href===g&&(!y||N.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${b}`))return;const S=document.createElement("link");if(S.rel=y?"stylesheet":VL,y||(S.as="script"),S.crossOrigin="",S.href=g,p&&S.setAttribute("nonce",p),document.head.appendChild(S),y)return new Promise((A,N)=>{S.addEventListener("load",A),S.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${g}`)))})}))}function c(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return i.then(u=>{for(const f of u||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};async function FL(e){const{autoInitialize:t=!0,createInitialAccount:s=!1,mountUI:r=!0,dockStyle:i,container:c,onWalletCreated:u,...f}=e;if(t&&await Promise.all(f.adapters.map(y=>y.initialize())),s&&!f.adapters.some(y=>y.getAccounts().length>0)){const y=f.adapters.find(b=>b.createAccount&&b.getAccounts().length===0);y?.createAccount&&await y.createAccount({label:"Dev Account"})}const p=new $L(f);u?.(p);let m;if(r&&typeof document<"u"){const{mountDevWallet:y}=await GL(async()=>{const{mountDevWallet:b}=await import("./mount-D_hAnWmA.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 HL(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 FL({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 qL=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,Hy(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 yi={ED25519:0,Secp256k1:1,Secp256r1:2,MultiSig:3,ZkLogin:5,Passkey:6},ZL={ED25519:32,Secp256k1:33,Secp256r1:33,Passkey:33},ub={0:"ED25519",1:"Secp256k1",2:"Secp256r1",3:"MultiSig",5:"ZkLogin",6:"Passkey"};function zA(e,t){return F.IntentMessage(F.bytes(t.length)).serialize({intent:{scope:{[e]:!0},version:{V0:!0},appId:{Sui:!0}},value:t}).toBytes()}function Bu(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 Ip=class{equals(e){return Bu(this.toRawBytes(),e.toRawBytes())}toBase64(){return st(this.toRawBytes())}toString(){throw new Error("`toString` is not implemented on public keys. Use `toBase64()` or `toRawBytes()` instead.")}toSuiPublicKey(){return st(this.toSuiBytes())}verifyWithIntent(e,t,s){const r=$c(zA(s,e),{dkLen:32});return this.verify(r,t)}verifyPersonalMessage(e,t){return this.verifyWithIntent(F.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(ed($c(this.toSuiBytes(),{dkLen:32})).slice(0,Qc*2))}};function $A(e){const t=qe(e),s=ub[t[0]];switch(s){case"ED25519":case"Secp256k1":case"Secp256r1":const r=ZL[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 YL=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]),Wa=new Uint32Array(64);class WL extends Ok{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:f,H:p}=this;return[t,s,r,i,c,u,f,p]}set(t,s,r,i,c,u,f,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=f|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)Wa[y]=t.getUint32(s,!1);for(let y=16;y<64;y++){const b=Wa[y-15],S=Wa[y-2],A=gr(b,7)^gr(b,18)^b>>>3,N=gr(S,17)^gr(S,19)^S>>>10;Wa[y]=N+Wa[y-7]+A+Wa[y-16]|0}let{A:r,B:i,C:c,D:u,E:f,F:p,G:m,H:g}=this;for(let y=0;y<64;y++){const b=gr(f,6)^gr(f,11)^gr(f,25),S=g+b+NR(f,p,m)+YL[y]+Wa[y]|0,N=(gr(r,2)^gr(r,13)^gr(r,22))+xR(r,i,c)|0;g=m,m=p,p=f,f=u+S|0,u=c,c=i,i=r,r=S+N|0}r=r+this.A|0,i=i+this.B|0,c=c+this.C|0,u=u+this.D|0,f=f+this.E|0,p=p+this.F|0,m=m+this.G|0,g=g+this.H|0,this.set(r,i,c,u,f,p,m,g)}roundClean(){$s(Wa)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),$s(this.buffer)}}class XL extends WL{constructor(){super(32,CR)}}const VA=wR(["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))),JL=VA[0],KL=VA[1],Xa=new Uint32Array(80),Ja=new Uint32Array(80);class QL extends Ok{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:f,Dl:p,Eh:m,El:g,Fh:y,Fl:b,Gh:S,Gl:A,Hh:N,Hl:j}=this;return[t,s,r,i,c,u,f,p,m,g,y,b,S,A,N,j]}set(t,s,r,i,c,u,f,p,m,g,y,b,S,A,N,j){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=f|0,this.Dl=p|0,this.Eh=m|0,this.El=g|0,this.Fh=y|0,this.Fl=b|0,this.Gh=S|0,this.Gl=A|0,this.Hh=N|0,this.Hl=j|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)Xa[W]=t.getUint32(s),Ja[W]=t.getUint32(s+=4);for(let W=16;W<80;W++){const ce=Xa[W-15]|0,ae=Ja[W-15]|0,Y=ti(ce,ae,1)^ti(ce,ae,8)^FE(ce,ae,7),K=ni(ce,ae,1)^ni(ce,ae,8)^HE(ce,ae,7),w=Xa[W-2]|0,O=Ja[W-2]|0,x=ti(w,O,19)^yu(w,O,61)^FE(w,O,6),G=ni(w,O,19)^vu(w,O,61)^HE(w,O,6),U=_R(K,G,Ja[W-7],Ja[W-16]),H=kR(U,Y,x,Xa[W-7],Xa[W-16]);Xa[W]=H|0,Ja[W]=U|0}let{Ah:r,Al:i,Bh:c,Bl:u,Ch:f,Cl:p,Dh:m,Dl:g,Eh:y,El:b,Fh:S,Fl:A,Gh:N,Gl:j,Hh:V,Hl:C}=this;for(let W=0;W<80;W++){const ce=ti(y,b,14)^ti(y,b,18)^yu(y,b,41),ae=ni(y,b,14)^ni(y,b,18)^vu(y,b,41),Y=y&S^~y&N,K=b&A^~b&j,w=AR(C,ae,K,KL[W],Ja[W]),O=OR(w,V,ce,Y,JL[W],Xa[W]),x=w|0,G=ti(r,i,28)^yu(r,i,34)^yu(r,i,39),U=ni(r,i,28)^vu(r,i,34)^vu(r,i,39),H=r&c^r&f^c&f,$=i&u^i&p^u&p;V=N|0,C=j|0,N=S|0,j=A|0,S=y|0,A=b|0,{h:y,l:b}=Ws(m|0,g|0,O|0,x|0),m=f|0,g=p|0,f=c|0,p=u|0,c=r|0,u=i|0;const M=Zv(x,U,$);r=Yv(M,O,G,H),i=M|0}({h:r,l:i}=Ws(this.Ah|0,this.Al|0,r|0,i|0)),{h:c,l:u}=Ws(this.Bh|0,this.Bl|0,c|0,u|0),{h:f,l:p}=Ws(this.Ch|0,this.Cl|0,f|0,p|0),{h:m,l:g}=Ws(this.Dh|0,this.Dl|0,m|0,g|0),{h:y,l:b}=Ws(this.Eh|0,this.El|0,y|0,b|0),{h:S,l:A}=Ws(this.Fh|0,this.Fl|0,S|0,A|0),{h:N,l:j}=Ws(this.Gh|0,this.Gl|0,N|0,j|0),{h:V,l:C}=Ws(this.Hh|0,this.Hl|0,V|0,C|0),this.set(r,i,c,u,f,p,m,g,y,b,S,A,N,j,V,C)}roundClean(){$s(Xa,Ja)}destroy(){this.destroyed=!0,$s(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class ez extends QL{constructor(){super(64,IR)}}const PA=qv(()=>new XL,_k(1)),rd=qv(()=>new ez,_k(3));function GA(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 jt=(e,t,s)=>Dn(e,t,s),FA=rs;function tz(e,t=""){if(typeof e!="string"){const s=t&&`"${t}" `;throw new TypeError(s+"expected string, got type="+typeof e)}return e}function Ac(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 Nu(e,t){if(typeof e!="function")throw new TypeError(`"${t}" is invalid: expected function, got ${typeof e}`);return e}const db=ed,wr=(...e)=>gR(...e),qh=e=>Fv(e),ad=Ly,id=e=>yR(e),Zh=BigInt(0),zS=BigInt(1),nz=e=>e?`"${e}" `:"";function Nr(e,t=""){if(typeof e!="boolean")throw new TypeError(nz(t)+"expected boolean, got type="+typeof e);return e}function fb(e){if(typeof e=="bigint"){if(!no(e))throw new RangeError("positive bigint expected, got "+e)}else FA(e);return e}function Vc(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 Yf(e){const t=fb(e).toString(16);return t.length&1?"0"+t:t}function HA(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?Zh:BigInt("0x"+e)}function Pc(e){return HA(ed(e))}function Lu(e){return HA(ed(Yh(Dn(e)).reverse()))}function hb(e,t){if(rs(t),t===0)throw new Error("zero output length is invalid");e=fb(e);const s=t*2,r=e.toString(16);if(r.length>s)throw new RangeError("number is too large");return Fv(r.padStart(s,"0"))}function qA(e,t){return hb(e,t).reverse()}function Yh(e){return Uint8Array.from(jt(e))}function no(e){return typeof e=="bigint"&&Zh<=e}function ZA(e,t,s){return no(e)&&no(t)&&no(s)&&t<=e&&e<s}function Wh(e,t,s,r){if(!ZA(t,s,r))throw new RangeError("expected valid "+e+": "+s+" <= n < "+r+", got "+t)}function pb(e){if(e<Zh)throw new Error("expected non-negative bigint, got "+e);return e===Zh?0:e.toString(2).length}const mb=e=>(Vc(e,"n"),(zS<<BigInt(e))-zS);function sz(e,t,s){if(rs(e,"hashLen"),rs(t,"qByteLen"),typeof s!="function")throw new TypeError("hmacFn must be a function");const r=j=>new Uint8Array(j),i=Uint8Array.of(),c=Uint8Array.of(0),u=Uint8Array.of(1),f=1e3;let p=r(e),m=r(e),g=0;const y=()=>{p.fill(1),m.fill(0),g=0},b=(...j)=>s(m,wr(p,...j)),S=(j=i)=>{m=b(c,j),p=b(),j.length!==0&&(m=b(u,j),p=b())},A=()=>{if(g++>=f)throw new Error("drbg: tried max amount of iterations");let j=0;const V=[];for(;j<t;){p=b();const C=p.slice();V.push(C),j+=p.length}return wr(...V)};return(j,V)=>{y(),S(j);let C;for(;(C=V(A()))===void 0;)S();return y(),C}}function Er(e,t={},s={},r="object"){Ac(e,r),Ac(t,"fields"),Ac(s,"optFields");function i(u,f,p){const m=r==="object"?`param "${String(u)}"`:`"${r}.${String(u)}"`,g=e[u];if(!Object.hasOwn(e,u)&&(p?g!==void 0:f!=="function"))throw new TypeError(`${m} is invalid: expected own property`);if(p&&g===void 0)return;const y=typeof g;if(y!==f||g===null)throw new TypeError(`${m} is invalid: expected ${f}, got ${y}`)}const c=(u,f)=>Object.entries(u).forEach(([p,m])=>i(p,m,f));c(t,!1),c(s,!0)}const un=BigInt(0),vt=BigInt(1),oi=BigInt(2),YA=BigInt(3),gb=BigInt(4),WA=BigInt(5),rz=BigInt(7),XA=BigInt(8),az=BigInt(9),iz=BigInt(15),JA=BigInt(16),oz=BigInt("0x10000000000000000");function Ht(e,t){if(t<=un)throw new Error("mod: expected positive modulus, got "+t);const s=e%t;return s>=un?s:t+s}function KA(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<un)throw new Error("invalid exponent, negatives unsupported");if(t===un)return vt;if(t===vt)return e;let r=e%s;if(r<un&&(r+=s),t<oz){let f=vt;for(;t>un;)t&vt&&(f=f*r%s),r=r*r%s,t>>=vt;return f}const i=[];for(;t>un;)i.push(Number(t&iz)),t>>=gb;const c=new Array(16);c[0]=vt,c[1]=r;for(let f=2;f<16;f++)c[f]=c[f-1]*r%s;let u=c[i[i.length-1]];for(let f=i.length-2;f>=0;f--){u=u*u%s,u=u*u%s,u=u*u%s,u=u*u%s;const p=i[f];p!==0&&(u=u*c[p]%s)}return u}function yr(e,t,s){if(s<=vt)throw new Error("pow2: expected modulus > 1, got "+s);if(t<un)throw new Error("pow2: expected non-negative exponent, got "+t);let r=e;for(;t-- >un;)r*=r,r%=s;return r}function $S(e,t){if(e===un)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=un,c=vt;for(;s!==un;){const f=r/s,p=r-s*f,m=i-c*f;r=s,s=p,i=c,c=m}if(r!==vt)throw new Error("invert: does not exist");return Ht(i,t)}function cz(e,t){if(t<=vt)throw new Error("invertCt: expected prime modulus > 1, got "+t);const s=Ht(e,t);if(s===un)throw new Error("invertCt: expected non-zero number");const r=KA(s,t-oi,t);if(Ht(s*r,t)!==vt)throw new Error("invertCt: does not exist");return r}function yb(e,t,s){const r=e;if(!r.eql(r.sqr(t),s))throw new Error("Cannot find square root")}function vb(e,t){if((e&vt)===un)throw new Error(t+": expected odd modulus, got "+e)}function QA(e,t){const s=e,r=(s.ORDER+vt)/gb,i=s.pow(t,r);return yb(s,i,t),i}function lz(e,t){const s=e,r=(s.ORDER-WA)/XA,i=s.mul(t,oi),c=s.pow(i,r),u=s.mul(t,c),f=s.mul(s.mul(u,oi),c),p=s.mul(u,s.sub(f,s.ONE));return yb(s,p,t),p}function uz(e){const t=bb(e),s=e3(e),r=s(t,t.neg(t.ONE)),i=s(t,r),c=s(t,t.neg(r)),u=(e+rz)/JA;return((f,p)=>{const m=f;let g=m.pow(p,u),y=m.mul(g,r);const b=m.mul(g,i),S=m.mul(g,c),A=m.eql(m.sqr(y),p),N=m.eql(m.sqr(b),p);g=m.cmov(g,y,A),y=m.cmov(S,b,N);const j=m.eql(m.sqr(y),p),V=m.cmov(g,y,j);return yb(m,V,p),V})}function e3(e){if(e<YA)throw new Error("sqrt is not defined for small field");vb(e,"tonelliShanks");let t=e-vt,s=0;for(;t%oi===un;)t/=oi,s++;let r=oi;const i=bb(e);for(;Xh(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(s===1)return QA;let c=i.pow(r,t);const u=(t+vt)/oi;return function(p,m){const g=p;if(g.is0(m))return m;if(Xh(g,m)!==1)throw new Error("Cannot find square root");let y=s,b=g.mul(g.ONE,c),S=g.pow(m,t),A=g.pow(m,u);for(;!g.eql(S,g.ONE);){if(g.is0(S))throw new Error("Cannot find square root: probably non-prime P");let N=1,j=g.sqr(S);for(;!g.eql(j,g.ONE);)if(N++,j=g.sqr(j),N===y)throw new Error("Cannot find square root");const V=vt<<BigInt(y-N-1),C=g.pow(b,V);y=N,b=g.sqr(C),S=g.mul(S,b),A=g.mul(A,C)}return A}}function dz(e){return vb(e,"Fp.sqrt"),e%gb===YA?QA:e%XA===WA?lz:e%JA===az?uz(e):e3(e)}const fz=(e,t)=>(Ht(e,t)&vt)===vt,hz=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function zu(e){if(Ac(e,"field"),typeof e.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof e.ORDER);Vc(e.BYTES,"BYTES"),Vc(e.BITS,"BITS");for(const t of hz)Nu(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 t3(e,t,s=!1){zu(e),GA(t,"nums"),Nr(s,"passZero");const r=e,i=new Array(t.length).fill(s?r.ZERO:void 0),c=t.reduce((f,p,m)=>r.is0(p)?f:(i[m]=f,r.mul(f,p)),r.ONE),u=r.inv(c);return t.reduceRight((f,p,m)=>r.is0(p)?f:(i[m]=r.mul(f,i[m]),r.mul(f,p)),u),i}function Xh(e,t){zu(e);const s=e;vb(s.ORDER,"FpLegendre");const r=(s.ORDER-vt)/oi,i=s.pow(t,r),c=s.eql(i,s.ONE),u=s.eql(i,s.ZERO),f=s.eql(i,s.neg(s.ONE));if(!c&&!u&&!f)throw new Error("invalid Legendre symbol result");return c?1:u?0:-1}function pz(e,t){if(t!==void 0&&FA(t),e<=un)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=pb(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 VS=new WeakMap;class PS{ORDER;BITS;BYTES;isLE;ZERO=un;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}=pz(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 un<=t&&t<this.ORDER}is0(t){return t===un}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 KA(t,s,this.ORDER)}div(t,s){return Ht(t*$S(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 $S(t,this.ORDER)}sqrt(t){let s=VS.get(this);return s||VS.set(this,s=dz(this.ORDER)),s(this,t)}toBytes(t){return this.isLE?qA(t,this.BYTES):hb(t,this.BYTES)}fromBytes(t,s=!1){jt(t);const{_lengths:r,BYTES:i,isLE:c,ORDER:u,_mod:f}=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?Lu(t):Pc(t);if(f&&(p=Ht(p,u)),!s&&!this.isValid(p))throw new Error("invalid field element: outside of range 0..ORDER");return p}invertBatch(t){return t3(this,t,!0)}cmov(t,s,r){return Nr(r,"condition"),r?s:t}}function bb(e,t={}){return Object.freeze(PS.prototype),new PS(e,t)}function n3(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=pb(e-vt);return Math.ceil(t/8)}function wb(e){const t=n3(e);return t+Math.ceil(t/2)}function s3(e,t,s=!1){jt(e);const r=e.length,i=n3(t),c=Math.max(wb(t),16);if(r<c||r>1024)throw new Error("expected "+c+"-1024 bytes of input, got "+r);const u=s?Lu(e):Pc(e),f=Ht(u,t-vt)+vt;return s?qA(f,i):hb(f,i)}const Tb=BigInt(0),$u=BigInt(1),mz=BigInt(4),K0=16,GS=128,gz=5,FS=2**31;function nl(e){const t=e;if(typeof t!="function")throw new TypeError('"Point" expected constructor, got type='+typeof e);Nu(t.fromAffine,"Point.fromAffine"),Nu(t.fromBytes,"Point.fromBytes"),Nu(t.fromHex,"Point.fromHex"),Ac(t.BASE,"Point.BASE"),Ac(t.ZERO,"Point.ZERO"),zu(t.Fp),zu(t.Fn)}function r3(e,t){nl(e),i3(t,e);const s=t3(e.Fp,t.map(r=>r.Z));return t.map((r,i)=>e.fromAffine(r.toAffine(s[i])))}function yz(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 vz(e,t){const s=e*(4*t+128);if(s>FS)throw new Error("invalid window size: table would need ~"+Math.ceil(s/2**20)+" MiB, max "+FS/2**20+" MiB")}function a3(e,t){if(e!==void 0){Nu(e,"randomBytes");try{const s=e(t);if(!ad(s)||s.length!==t)return}catch{return}return e}}function i3(e,t){GA(e,"points"),e.forEach((s,r)=>{if(!(s instanceof t))throw new Error("invalid point at index "+r)})}function bz(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):no(r)&&r<s))throw new Error("invalid scalar at index "+i)})}const o3=new WeakMap;function Q0(e){return o3.get(e)||1}function wz(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 Tz(e,t){const s=2**t,r=s/2,i=BigInt(s-1),c=[];for(;e>Tb;){let u=0;e&$u&&(u=Number(e&i),u>=r&&(u-=s),e-=BigInt(u)),c.push(u),e>>=$u}return c}function Ez(e,t,s){const r=2**t,i=r/2,c=BigInt(r-1),u=BigInt(t),f=[];for(let p=0;p<s;p++){let m=Number(e&c);e>>=u,m>i&&(m-=r,e+=$u),f.push(m)}if(e!==Tb)throw new Error("invalid wnaf");return f}function Sz(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 f=s[u][c];if(f){const p=t[u][Math.abs(f)-1>>1];i=i.add(f<0?p.negate():p)}}}return i}class c3{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(t,s){nl(t),this.randomBytes=a3(s,K0),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 f=t;for(let p=0;p<i;p++){let m=f;for(let g=0;g<c;g++)u.push(m),m=m.add(f);f=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),f=Ez(s,r,i);let p=this.ZERO,m=this.BASE;for(let g=0;g<i;g++){const y=f[g],b=g*u,S=Math.abs(y)-1;let A=c[b];for(let j=1;j<u;j++)A=j===S?c[b+j]:A;const N=A.negate();y===0?m=m.add(c[b]):p=p.add(y<0?N:A)}return{p,f:m}}getWnafPrecomputes(t,s,r,i){let c=this.wnafPrecomputes.get(s),u=c?.find(f=>f.W===t&&f.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),!ZA(s,$u,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(t,s,r,i){const c=Q0(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+GS,c=this.randomBytes(K0);if(!ad(c)||c.length!==K0)throw new Error("randomBytes returned invalid byte array");c[0]=c[0]&63|128;const u=s+Pc(c)*this.Point.Fn.ORDER;return this.runCT(t,u,i,r)}fixedWindowCT(t,s,r){const i=gz,c=1<<i,u=mb(i),f=new Array(c);f[0]=this.ZERO;for(let g=1;g<c;g++)f[g]=f[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 S=0;S<i;S++)m=m.double();const y=Number(s>>BigInt(g*i)&u);let b=f[0];for(let S=1;S<c;S++)b=S===y?f[S]:b;m=m.add(b)}return{p:m,f:m}}shouldBlind(t,s){return this.randomBytes===void 0?!1:s===$u?!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),!no(s))throw new Error("invalid scalar");const i=Q0(t);if(i===1||s>=this.Point.Fn.ORDER)return tv(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),yz(s,this.bits);const r=Math.ceil((this.bits+GS)/s)+1;vz(r*2**(s-1),this.Point.Fp.BYTES),o3.set(t,s),this.wnafPrecomputes.delete(t)}hasWindowSize(t){return Q0(t)!==1}}function tv(e,t,s,r=!1){if(nl(e),i3(t,e),Nr(r,"allowOversized"),bz(s,e.Fn,r?e.Fn.ORDER**mz:void 0),t.length!==s.length)throw new Error("arrays of points and scalars must have equal length");const i=t.map(u=>wz(u,4)),c=s.map(u=>Tz(u,4));return Sz(e.ZERO,i,c)}function HS(e,t,s){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return zu(t),t}else return bb(e,{isLE:s})}function l3(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`);Er(s);for(const p of["p","n","h"]){const m=t[p];if(!(no(m)&&m!==Tb))throw new Error(`CURVE.${p} must be positive bigint`)}const i=HS(t.p,s.Fp,r),c=HS(t.n,s.Fn,r),f=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(const p of f)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 u3(e,t){return function(r){const i=e(r);return{secretKey:i,publicKey:t(i)}}}const Wf=BigInt(0),Xf=BigInt(1),Jf=BigInt(2),_z=BigInt(4),qS=BigInt(8);function kz(e,t,s,r){const i=e.sqr(s),c=e.sqr(r),u=e.add(e.mul(t.a,i),c),f=e.add(e.ONE,e.mul(t.d,e.mul(i,c)));return e.eql(u,f)}function Az(e,t={}){Er(t,{},{},"extraOpts");const s=t,r=l3("edwards",e,s,s.FpFnLE),{Fp:i,Fn:c}=r;let u=r.CURVE;const{h:f}=u;if(Xh(i,u.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(Xh(i,u.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");Er(s,{},{uvRatio:"function",randomBytes:"function"});const p=s.randomBytes===void 0?id:s.randomBytes,m=Jf<<BigInt(i.BYTES*8)-Xf;function g(C){if(!i.isOdd)throw new Error("Field does not have .isOdd()");return i.isOdd(C)}const y=s.uvRatio===void 0?(C,W)=>{try{return{isValid:!0,value:i.sqrt(i.div(C,W))}}catch{return{isValid:!1,value:Wf}}}:s.uvRatio;if(!kz(i,u,u.Gx,u.Gy))throw new Error("bad curve params: generator point");const b=i.eql(u.a,i.neg(i.ONE))?C=>i.neg(C):i.eql(u.a,i.ONE)?C=>C:C=>i.mul(u.a,C);function S(C,W,ce=!1){const ae=ce?Xf:Wf;return Wh("coordinate "+C,W,ae,m),W}function A(C){if(!(C instanceof N))throw new Error("EdwardsPoint expected")}class N{static BASE=new N(u.Gx,u.Gy,i.ONE,i.mul(u.Gx,u.Gy));static ZERO=new N(i.ZERO,i.ONE,i.ONE,i.ZERO);static Fp=i;static Fn=c;X;Y;Z;T;constructor(W,ce,ae,Y){this.X=S("x",W),this.Y=S("y",ce),this.Z=S("z",ae,!0),this.T=S("t",Y),Object.freeze(this)}static CURVE(){return u}static fromAffine(W){if(W instanceof N)throw new Error("extended point not allowed");const{x:ce,y:ae}=W||{};return S("x",ce),S("y",ae),new N(ce,ae,i.ONE,i.mul(ce,ae))}static fromBytes(W,ce=!1){const ae=i.BYTES,{a:Y,d:K}=u;W=Yh(jt(W,ae,"point")),Nr(ce,"zip215");const w=Yh(W),O=W[ae-1];w[ae-1]=O&-129;const x=Lu(w),G=ce?m:i.ORDER;Wh("point.y",x,Wf,G);const U=i.sqr(x),H=i.sub(U,i.ONE),$=i.sub(i.mulN(K,U),Y);let{isValid:M,value:k}=y(H,$);if(!M)throw new Error("bad point: invalid y coordinate");const I=g(k),D=(O&128)!==0;if(!ce&&i.is0(k)&&D)throw new Error("bad point: x=0 and x_0=1");return D!==I&&(k=i.neg(k)),N.fromAffine({x:k,y:x})}static fromHex(W,ce=!1){return N.fromBytes(qh(W),ce)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(W=6,ce=!0){return V.setWindowSize(this,W),ce||this.multiply(Jf),this}assertValidity(){const W=this,{a:ce,d:ae}=u;if(W.is0())throw new Error("bad point: ZERO");const{X:Y,Y:K,Z:w,T:O}=W,x=i.sqr(Y),G=i.sqr(K),U=i.sqr(w),H=i.sqr(U),$=i.mul(x,ce),M=i.mul(i.add($,G),U),k=i.add(H,i.mul(ae,i.mul(x,G)));if(!i.eql(M,k))throw new Error("bad point: equation left != right (1)");const I=i.mul(Y,K),D=i.mul(w,O);if(!i.eql(I,D))throw new Error("bad point: equation left != right (2)")}equals(W){A(W);const{X:ce,Y:ae,Z:Y}=this,{X:K,Y:w,Z:O}=W,x=i.mul(ce,O),G=i.mul(K,Y),U=i.mul(ae,O),H=i.mul(w,Y);return i.eql(x,G)&&i.eql(U,H)}is0(){return this.equals(N.ZERO)}negate(){return new N(i.neg(this.X),this.Y,this.Z,i.neg(this.T))}double(){const{X:W,Y:ce,Z:ae}=this,Y=i.sqr(W),K=i.sqr(ce),w=i.mul(i.sqr(ae),Jf),O=b(Y),x=i.addN(W,ce),G=i.sub(i.subN(i.sqr(x),Y),K),U=i.addN(O,K),H=i.subN(U,w),$=i.subN(O,K),M=i.mul(G,H),k=i.mul(U,$),I=i.mul(G,$),D=i.mul(H,U);return new N(M,k,D,I)}add(W){A(W);const{d:ce}=u,{X:ae,Y,Z:K,T:w}=this,{X:O,Y:x,Z:G,T:U}=W,H=i.mul(ae,O),$=i.mul(Y,x),M=i.mul(i.mulN(w,ce),U),k=i.mul(K,G),I=i.sub(i.subN(i.mulN(i.addN(ae,Y),i.addN(O,x)),H),$),D=i.subN(k,M),L=i.addN(k,M),X=i.sub($,b(H)),z=i.mul(I,D),ie=i.mul(L,X),fe=i.mul(I,X),R=i.mul(D,L);return new N(z,ie,R,fe)}subtract(W){return A(W),this.add(W.negate())}multiply(W){if(!c.isValidNot0(W))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:ce,f:ae}=V.mulSecret(this,W,f,j);return j([ce,ae])[0]}multiplyUnsafe(W){if(!c.isValid(W))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return W===Wf?N.ZERO:this.is0()||W===Xf?this:V.mulUnsafe(this,W,j)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return V.mulUnsafe(this,u.n).is0()}toAffine(W){const ce=this;let ae=W;if(ae!=null&&typeof ae!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof ae);const{X:Y,Y:K,Z:w}=ce,O=ce.is0();ae==null&&(ae=O?i.create(qS):i.inv(w));const x=i.mul(Y,ae),G=i.mul(K,ae),U=i.mul(w,ae);if(O)return{x:i.ZERO,y:i.ONE};if(!i.eql(U,i.ONE))throw new Error("invZ was invalid");return{x,y:G}}clearCofactor(){return f===Xf?this:f===Jf?this.double():f===_z?this.double().double():f===qS?this.double().double().double():this.multiplyUnsafe(f)}toBytes(){const{x:W,y:ce}=this.toAffine(),ae=i.toBytes(ce);return ae[ae.length-1]|=g(W)?128:0,ae}toHex(){return db(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const j=C=>r3(N,C),V=new c3(N,p);return V.bits>=6&&N.BASE.precompute(6),Object.freeze(N.prototype),Object.freeze(N),N}function Oz(e,t,s={}){if(nl(e),typeof t!="function")throw new Error('"hash" function param is required');const r=t,i=s;Er(i,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function",toMontgomery:"function",toMontgomerySecret:"function"});const{prehash:c}=i,{BASE:u,Fp:f,Fn:p}=e,m=r.outputLen,g=2*f.BYTES;if(m!==void 0&&(Vc(m,"hash.outputLen"),m!==g))throw new Error(`hash.outputLen must be ${g}, got ${m}`);const y=i.randomBytes===void 0?id:i.randomBytes,b=i.toMontgomery,S=i.toMontgomerySecret,A=i.adjustScalarBytes===void 0?$=>$:i.adjustScalarBytes,N=i.domain===void 0?($,M,k)=>{if(Nr(k,"phflag"),M.length||k)throw new Error("Contexts/pre-hash are not supported");return $}:i.domain;function j($){return p.create(Lu($))}function V($){const M=O.secretKey;jt($,O.secretKey,"secretKey");const k=jt(r($),2*M,"hashedSecretKey"),I=A(k.slice(0,M)),D=k.slice(M,2*M),L=j(I);return{head:I,prefix:D,scalar:L}}function C($){const{head:M,prefix:k,scalar:I}=V($),D=u.multiply(I),L=D.toBytes();return{head:M,prefix:k,scalar:I,point:D,pointBytes:L}}function W($){return C($).pointBytes}function ce($=Uint8Array.of(),...M){const k=wr(...M);return j(r(N(k,jt($,void 0,"context"),!!c)))}function ae($,M,k={}){Er(k,{},{},"options"),$=Yh(jt($,void 0,"message")),c&&($=c($));const{prefix:I,scalar:D,pointBytes:L}=C(M),X=ce(k.context,I,$),z=u.multiply(X).toBytes(),ie=ce(k.context,z,L,$),fe=p.create(X+ie*D);if(!p.isValid(fe))throw new Error("sign failed: invalid s");const R=wr(z,p.toBytes(fe));return jt(R,O.signature,"result")}const Y={zip215:i.zip215};function K($,M,k,I=Y){Er(I);const{context:D}=I,L=I.zip215===void 0?!!Y.zip215:I.zip215,X=O.signature;$=jt($,X,"signature"),M=jt(M,void 0,"message"),k=jt(k,O.publicKey,"publicKey"),L!==void 0&&Nr(L,"zip215"),c&&(M=c(M));const z=X/2,ie=$.subarray(0,z),fe=Lu($.subarray(z,X));let R,J,le;try{R=e.fromBytes(k,L),J=e.fromBytes(ie,L),le=u.multiplyUnsafe(fe)}catch{return!1}if(!L&&R.isSmallOrder())return!1;const pe=ce(D,ie,k,M);return J.add(R.multiplyUnsafe(pe)).subtract(le).clearCofactor().is0()}const w=f.BYTES,O={secretKey:w,publicKey:w,signature:2*w,seed:w};function x($){return $=$===void 0?y(O.seed):$,jt($,O.seed,"seed")}function G($){return ad($)&&$.length===O.secretKey}function U($,M){try{return!!e.fromBytes($,M===void 0?Y.zip215:M)}catch{return!1}}const H={getExtendedPublicKey:C,randomSecretKey:x,isValidSecretKey:G,isValidPublicKey:U,toMontgomery($){if(b===void 0)throw new Error("Montgomery conversion is not supported for this curve");return b(e.fromBytes($))},toMontgomerySecret($){if(S===void 0)throw new Error("Montgomery conversion is not supported for this curve");return S($)}};return Object.freeze(O),Object.freeze(H),Object.freeze({keygen:u3(x,W),getPublicKey:W,sign:ae,verify:K,utils:H,Point:e,lengths:O})}const nv=BigInt(1),ZS=BigInt(2),Nz=BigInt(5),xz=BigInt(8),Eb=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Cz={p:Eb,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:xz,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Iz(e){const t=BigInt(10),s=BigInt(20),r=BigInt(40),i=BigInt(80),c=Eb,f=e*e%c*e%c,p=yr(f,ZS,c)*f%c,m=yr(p,nv,c)*e%c,g=yr(m,Nz,c)*m%c,y=yr(g,t,c)*g%c,b=yr(y,s,c)*y%c,S=yr(b,r,c)*b%c,A=yr(S,i,c)*S%c,N=yr(A,i,c)*S%c,j=yr(N,t,c)*g%c;return{pow_p_5_8:yr(j,ZS,c)*e%c,b2:f}}function d3(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const YS=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function Rz(e,t){const s=Eb,r=Ht(t*t*t,s),i=Ht(r*r*t,s),c=Iz(e*i).pow_p_5_8;let u=Ht(e*r*c,s);const f=Ht(t*u*u,s),p=u,m=Ht(u*YS,s),g=f===e,y=f===Ht(-e,s),b=f===Ht(-e*YS,s);return g&&(u=p),(y||b)&&(u=m),fz(u,s)&&(u=Ht(-u,s)),{isValid:g||y,value:u}}const Sb=Az(Cz,{uvRatio:Rz}),WS=Sb.Fp;function jz(e){const{y:t}=e;return WS.toBytes(WS.div(nv+t,nv-t))}function Mz(e){const t=Sb.Fp.BYTES;return Dn(e,t),d3(rd(e.subarray(0,t))).subarray(0,t)}function Dz(e){return Oz(Sb,rd,Object.assign({adjustScalarBytes:d3,toMontgomery:jz,toMontgomerySecret:Mz,zip215:!0},e))}const ta=Dz({}),ey=32;var Nc,Uz=(Nc=class extends Ip{constructor(t){if(super(),typeof t=="string"?this.data=qe(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==ey)throw new Error(`Invalid public key input. Expected ${ey} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return yi.ED25519}async verify(t,s){let r;if(typeof s=="string"){const i=$A(s);if(i.signatureScheme!=="ED25519")throw new Error("Invalid signature scheme");if(!Bu(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return ta.verify(r,t,this.toRawBytes())}},Nc.SIZE=ey,Nc);class XS{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(t,s){if(Pv(t),Dn(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),$s(i)}update(t){return zc(this),this.iHash.update(t),this}digestInto(t){zc(this),Gv(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:f,canXOF:p}=this;return t=t,t.finished=i,t.destroyed=c,t.blockLen=u,t.outputLen=f,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 Rp=(()=>{const e=((t,s,r)=>new XS(t,s).update(r).digest());return e.create=(t,s)=>new XS(t,s),e})();function Bz(e,t,s,r){Pv(e);const i=Hv({dkLen:32,asyncTick:10},r),{c,dkLen:u,asyncTick:f}=i;if(rs(c,"c"),rs(u,"dkLen"),rs(f,"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=PE(t,"password");try{const m=PE(s,"salt");try{const g=new Uint8Array(u),{iHash:y,oHash:b,outputLen:S}=Rp.create(e,p),A=new Uint8Array(S),N=Lz(y,b,m,A);return{c,dkLen:u,asyncTick:f,DK:g,outputLen:S,eng:N}}finally{typeof s=="string"&&$s(m)}}finally{typeof t=="string"&&$s(p)}}function Lz(e,t,s,r){const i=new Uint8Array(4),c=ih(i),u=e._cloneInto().update(s),f=t._cloneInto(),p=e._cloneInto,m=t._cloneInto;return{u1:(g,y)=>{c.setInt32(0,g,!1),u._cloneInto(f).update(i).digestInto(r),t._cloneInto(f).update(r).digestInto(r),y.set(r.subarray(0,y.length))},rounds:(g,y)=>{for(let b=1;b<g;b++){p.call(e,f).update(r).digestInto(r),m.call(t,f).update(r).digestInto(r);for(let S=0;S<y.length;S++)y[S]^=r[S]}},output:g=>(e.destroy(),t.destroy(),u.destroy(),f.destroy(),$s(r),g)}}function zz(e,t,s,r){const{c:i,dkLen:c,DK:u,outputLen:f,eng:p}=Bz(e,t,s,r);for(let m=1,g=0;g<c;m++,g+=f){const y=u.subarray(g,g+f);p.u1(m,y),p.rounds(i,y)}return p.output(u)}function $z(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 f3(e){if(typeof e!="string")throw new TypeError("invalid mnemonic type: "+typeof e);if(!$z(e))throw new TypeError("expected well-formed Unicode string");return e.normalize("NFKD")}function Vz(e){const t=f3(e),s=t.split(" ");if(![12,15,18,21,24].includes(s.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:s}}const Pz=e=>{if(typeof e!="string")throw new TypeError("invalid passphrase type: "+typeof e);return f3("mnemonic"+e)};function Gz(e,t=""){return zz(rd,Vz(e).nfkd,Pz(t),{c:2048,dkLen:64})}function JS(e){return!!new RegExp("^m\\/44'\\/784'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'+$").test(e)}function Fz(e){return Gz(e,"")}function Hz(e){return kr(Fz(e))}const qz=BigInt(0);class Zz extends Error{constructor(t=""){super(t)}}const sa={Err:Zz,_tlv:{encode:(e,t)=>{const{Err:s}=sa;if(Vc(e,"tag"),e<0||e>255)throw new s("tlv.encode: wrong tag");if(tz(t,"data"),t.length&1)throw new s("tlv.encode: unpadded data");const r=t.length/2,i=Yf(r);if(i.length/2&128)throw new s("tlv.encode: long form length too big");const c=r>127?Yf(i.length/2|128):"";return Yf(e)+c+i+t},decode(e,t){const{Err:s}=sa;t=jt(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 f=t.subarray(r,r+u);if(f.length!==u)throw new s("tlv.decode: wrong value length");return{v:f,l:t.subarray(r+u)}}},_int:{encode(e){const{Err:t}=sa;if(fb(e),e<qz)throw new t("integer: negative integers are not allowed");let s=Yf(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}=sa;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 Pc(e)}},toSig(e,t){const{Err:s,_int:r,_tlv:i}=sa;if(t!==void 0&&(Vc(t,"maxScalarBytes"),t<1))throw new s("invalid signature: maxScalarBytes must be positive");const c=jt(e,void 0,"signature"),{v:u,l:f}=i.decode(48,c);if(f.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}=sa;Er(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)}},ty=(Object.freeze(sa._tlv),Object.freeze(sa._int),Object.freeze(sa));const KS=(e,t)=>(e+(e>=0?t:-t)/h3)/t;function Yz(e,t,s){Wh("scalar",e,ia,s);const[[r,i],[c,u]]=t,f=KS(u*e,s),p=KS(-i*e,s);let m=e-f*r-p*c,g=-f*i-p*u;const y=m<ia,b=g<ia;y&&(m=-m),b&&(g=-g);const S=mb(Math.ceil(pb(s)/2))+Ki;if(m<ia||m>=S||g<ia||g>=S)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:y,k1:m,k2neg:b,k2:g}}function sv(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function ny(e,t){Er(e);const s={};for(let r of Object.keys(t))s[r]=e[r]===void 0?t[r]:e[r];return Nr(s.lowS,"lowS"),Nr(s.prehash,"prehash"),s.format!==void 0&&sv(s.format),s}const ia=BigInt(0),Ki=BigInt(1),h3=BigInt(2),sy=BigInt(3),Wz=BigInt(4);function Xz(e,t={}){const s=l3("weierstrass",e,t),r=s.Fp,i=s.Fn;let c=s.CURVE;const{h:u,n:f}=c;Er(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:S}=t,A=t.randomBytes===void 0?id: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 N=p?{beta:p.beta,basises:p.basises.map(X=>[...X])}:void 0,j=m3(r,i);function V(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function C(X,z,ie){if(z.is0()){if(!m)throw new Error("bad point: ZERO");return Uint8Array.of(0)}const{x:fe,y:R}=z.toAffine(),J=r.toBytes(fe);if(Nr(ie,"isCompressed"),ie){V();const le=!r.isOdd(R);return wr(p3(le),J)}else return wr(Uint8Array.of(4),J,r.toBytes(R))}function W(X){jt(X,void 0,"Point");const{publicKey:z,publicKeyUncompressed:ie}=j,fe=X.length,R=X[0],J=X.subarray(1);if(m&&fe===1&&R===0)return{x:r.ZERO,y:r.ZERO};if(fe===z&&(R===2||R===3)){const le=r.fromBytes(J);if(!r.isValid(le))throw new Error("bad point: is not on curve, wrong x");const pe=w(le);let Te;try{Te=r.sqrt(pe)}catch(be){const _e=be instanceof Error?": "+be.message:"";throw new Error("bad point: is not on curve, sqrt error"+_e)}V();const Oe=r.isOdd(Te);return(R&1)===1!==Oe&&(Te=r.neg(Te)),{x:le,y:Te}}else if(fe===ie&&R===4){const le=r.BYTES,pe=r.fromBytes(J.subarray(0,le)),Te=r.fromBytes(J.subarray(le,le*2));if(!O(pe,Te))throw new Error("bad point: is not on curve");return{x:pe,y:Te}}else throw new Error(`bad point: got length ${fe}, expected compressed=${z} or uncompressed=${ie}`)}const ce=S===void 0?C:S,ae=b===void 0?W:b,Y=r.mul(c.b,sy),K=r.is0(c.a)?X=>r.ZERO:X=>r.mul(c.a,X);function w(X){const z=r.sqr(X),ie=r.mul(z,X);return r.add(r.add(ie,r.mul(X,c.a)),c.b)}function O(X,z){const ie=r.sqr(z),fe=w(X);return r.eql(ie,fe)}if(!O(c.Gx,c.Gy))throw new Error("bad curve params: generator point");const x=r.mul(r.pow(c.a,sy),Wz),G=r.mul(r.sqr(c.b),BigInt(27));if(r.is0(r.add(x,G)))throw new Error("bad curve params: a or b");function U(X,z,ie=!1){if(!r.isValid(z)||ie&&r.is0(z))throw new Error(`bad point coordinate ${X}`);return typeof z=="object"&&z!==null?r.create(z):z}function H(X){if(!(X instanceof I))throw new Error("Weierstrass Point expected")}function $(X){if(!N||!N.basises)throw new Error("no endo");return Yz(X,N.basises,i.ORDER)}function M(X,z,ie,fe){if(!i.isValid(fe))throw new RangeError("invalid scalar: out of range");if(N){const{k1neg:R,k1:J,k2neg:le,k2:pe}=$(fe),Te=new I(r.mul(ie.X,N.beta),ie.Y,ie.Z);X.push(R?ie.negate():ie,le?Te.negate():Te),z.push(J,pe)}else X.push(ie),z.push(fe)}const k=new WeakSet;class I{static BASE=new I(c.Gx,c.Gy,r.ONE);static ZERO=new I(r.ZERO,r.ONE,r.ZERO);static Fp=r;static Fn=i;X;Y;Z;constructor(z,ie,fe){this.X=U("x",z),this.Y=U("y",ie,!0),this.Z=U("z",fe),Object.freeze(this)}static CURVE(){return c}static fromAffine(z){const{x:ie,y:fe}=z||{};if(!z||!r.isValid(ie)||!r.isValid(fe))throw new Error("invalid affine point");if(z instanceof I)throw new Error("projective point not allowed");return r.is0(ie)&&r.is0(fe)?I.ZERO:new I(ie,fe,r.ONE)}static fromBytes(z){const ie=I.fromAffine(ae(jt(z,void 0,"point")));return ie.assertValidity(),ie}static fromHex(z){return I.fromBytes(qh(z))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(z=6,ie=!0){return L.setWindowSize(this,z),ie||this.multiply(sy),this}assertValidity(){const z=this;if(z.is0()){if(m&&r.is0(z.X)&&r.eql(z.Y,r.ONE)&&r.is0(z.Z))return;throw new Error("bad point: ZERO")}if(k.has(z))return;const{x:ie,y:fe}=z.toAffine();if(!r.isValid(ie)||!r.isValid(fe))throw new Error("bad point: x or y not field elements");if(!O(ie,fe))throw new Error("bad point: equation left != right");if(!z.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");k.add(z)}hasEvenY(){const{y:z}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(z)}equals(z){H(z);const{X:ie,Y:fe,Z:R}=this,{X:J,Y:le,Z:pe}=z,Te=r.eql(r.mul(ie,pe),r.mul(J,R)),Oe=r.eql(r.mul(fe,pe),r.mul(le,R));return Te&&Oe}negate(){return new I(this.X,r.neg(this.Y),this.Z)}double(){const{X:z,Y:ie,Z:fe}=this;let R=r.ZERO,J=r.ZERO,le=r.ZERO,pe=r.mul(z,z),Te=r.mul(ie,ie),Oe=r.mul(fe,fe),Ae=r.mul(z,ie);return Ae=r.add(Ae,Ae),le=r.mul(z,fe),le=r.add(le,le),R=K(le),J=r.mul(Y,Oe),J=r.add(R,J),R=r.sub(Te,J),J=r.add(Te,J),J=r.mul(R,J),R=r.mul(Ae,R),le=r.mul(Y,le),Oe=K(Oe),Ae=r.sub(pe,Oe),Ae=K(Ae),Ae=r.add(Ae,le),le=r.add(pe,pe),pe=r.add(le,pe),pe=r.add(pe,Oe),pe=r.mul(pe,Ae),J=r.add(J,pe),Oe=r.mul(ie,fe),Oe=r.add(Oe,Oe),pe=r.mul(Oe,Ae),R=r.sub(R,pe),le=r.mul(Oe,Te),le=r.add(le,le),le=r.add(le,le),new I(R,J,le)}add(z){H(z);const{X:ie,Y:fe,Z:R}=this,{X:J,Y:le,Z:pe}=z;let Te=r.ZERO,Oe=r.ZERO,Ae=r.ZERO,be=r.mul(ie,J),_e=r.mul(fe,le),Pe=r.mul(R,pe),at=r.add(ie,fe),P=r.add(J,le);at=r.mul(at,P),P=r.add(be,_e),at=r.sub(at,P),P=r.add(ie,R);let te=r.add(J,pe);return P=r.mul(P,te),te=r.add(be,Pe),P=r.sub(P,te),te=r.add(fe,R),Te=r.add(le,pe),te=r.mul(te,Te),Te=r.add(_e,Pe),te=r.sub(te,Te),Ae=K(P),Te=r.mul(Y,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=K(Pe),P=r.mul(Y,P),_e=r.add(_e,Pe),Pe=r.sub(be,Pe),Pe=K(Pe),P=r.add(P,Pe),be=r.mul(_e,P),Oe=r.add(Oe,be),be=r.mul(te,P),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 I(Te,Oe,Ae)}subtract(z){return H(z),this.add(z.negate())}is0(){return this.equals(I.ZERO)}multiply(z){if(!i.isValidNot0(z))throw new RangeError("invalid scalar: out of range");const{p:ie,f:fe}=L.mulSecret(this,z,u,D);return D([ie,fe])[0]}multiplyUnsafe(z){const ie=this,fe=z;if(!i.isValid(fe))throw new RangeError("invalid scalar: out of range");if(fe===ia||ie.is0())return I.ZERO;if(fe===Ki)return ie;if(L.hasWindowSize(this))return L.mulUnsafe(ie,fe,D);const R=[],J=[];return M(R,J,ie,fe),tv(I,R,J)}mulAddUnsafe(z,ie,fe){H(ie);const R=[],J=[];return M(R,J,this,z),M(R,J,ie,fe),tv(I,R,J)}toAffine(z){const ie=this;let fe=z;if(fe!=null&&!r.isValid(fe))throw new RangeError('"invertedZ" expected valid field element');const{X:R,Y:J,Z:le}=ie;if(r.eql(le,r.ONE))return{x:R,y:J};const pe=ie.is0();fe==null&&(fe=pe?r.ONE:r.inv(le));const Te=r.mul(R,fe),Oe=r.mul(J,fe),Ae=r.mul(le,fe);if(pe)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===Ki?!0:y?y(I,this):L.mulUnsafe(this,f).is0()}clearCofactor(){return u===Ki?this:g?g(I,this):this.multiplyUnsafe(u)}isSmallOrder(){return u===Ki?this.is0():this.clearCofactor().is0()}toBytes(z=!0){return Nr(z,"isCompressed"),this.assertValidity(),ce(I,this,z)}toHex(z=!0){return db(this.toBytes(z))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const D=X=>r3(I,X),L=new c3(I,A);return L.bits>=6&&I.BASE.precompute(6),Object.freeze(I.prototype),Object.freeze(I),I}function p3(e){return Uint8Array.of(e?2:3)}function m3(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Jz(e,t={}){nl(e);const{Fn:s}=e,r=t.randomBytes===void 0?id:t.randomBytes,i=Object.assign(m3(e.Fp,s),{seed:Math.max(wb(s.ORDER),16)});function c(S){try{const A=s.fromBytes(S);return s.isValidNot0(A)}catch{return!1}}function u(S,A){const{publicKey:N,publicKeyUncompressed:j}=i;try{const V=S.length;return A===!0&&V!==N||A===!1&&V!==j?!1:!e.fromBytes(S).is0()}catch{return!1}}function f(S){return S=S===void 0?r(i.seed):S,s3(jt(S,i.seed,"seed"),s.ORDER)}function p(S,A=!0){return e.BASE.multiply(s.fromBytes(S)).toBytes(A)}function m(S){const{secretKey:A,publicKey:N,publicKeyUncompressed:j}=i,V=s._lengths;if(!ad(S))return;const C=jt(S,void 0,"key").length,W=C===N||C===j,ce=C===A||!!V?.includes(C);if(!(W&&ce))return W}function g(S,A,N=!0){if(m(S)===!0)throw new Error("first arg must be private key");if(m(A)===!1)throw new Error("second arg must be public key");const j=s.fromBytes(S),V=e.fromBytes(A);if(V.is0())throw new Error("invalid public key: point at infinity");return V.multiply(j).toBytes(N)}const y={isValidSecretKey:c,isValidPublicKey:u,randomSecretKey:f},b=u3(f,p);return Object.freeze(y),Object.freeze(i),Object.freeze({getPublicKey:p,getSharedSecret:g,keygen:b,Point:e,utils:y,lengths:i})}function Kz(e,t,s={}){nl(e);const r=t;Pv(r),Er(s,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const i=Object.assign({},s),c=i.randomBytes===void 0?id:i.randomBytes,u=i.hmac===void 0?(X,z)=>Rp(r,X,z):i.hmac,{Fp:f,Fn:p}=e,{ORDER:m,BITS:g}=p,y=wb(m),b=a3(c,y),{keygen:S,getPublicKey:A,getSharedSecret:N,utils:j,lengths:V}=Jz(e,i),C={prehash:!0,lowS:typeof i.lowS=="boolean"?i.lowS:!0,format:"compact",extraEntropy:!1},W=m*h3+Ki<f.ORDER;function ce(X){const z=m>>Ki;return X>z}function ae(X,z){if(!p.isValidNot0(z))throw new Error(`invalid signature ${X}: out of range 1..Point.Fn.ORDER`);return z}function Y(){if(!f.isOdd)throw new Error("Field doesn't support isOdd")}function K(X,z,ie){return Y(),(X===ie?0:2)|Number(f.isOdd(z))}function w(){if(W)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function O(X,z){sv(z);const ie=V.signature,fe=z==="compact"?ie:z==="recovered"?ie+1:void 0;return jt(X,fe)}class x{r;s;recovery;constructor(z,ie,fe){if(this.r=ae("r",z),this.s=ae("s",ie),fe!=null){if(w(),![0,1,2,3].includes(fe))throw new Error("invalid recovery id");this.recovery=fe}Object.freeze(this)}static fromBytes(z,ie=C.format){O(z,ie);let fe;if(ie==="der"){if(z.length>2*p.BYTES+16)throw new ty.Err("invalid signature: DER signature too long");const{r:pe,s:Te}=ty.toSig(jt(z),p.BYTES+1);return new x(pe,Te)}ie==="recovered"&&(fe=z[0],ie="compact",z=z.subarray(1));const R=V.signature/2,J=z.subarray(0,R),le=z.subarray(R,R*2);return new x(p.fromBytes(J),p.fromBytes(le),fe)}static fromHex(z,ie){return this.fromBytes(qh(z),ie)}assertRecovery(){const{recovery:z}=this;if(z==null)throw new Error("invalid recovery id: must be present");return z}addRecoveryBit(z){return new x(this.r,this.s,z)}recoverPublicKey(z){const{r:ie,s:fe}=this,R=this.assertRecovery(),J=R===2||R===3?ie+m:ie;if(!f.isValid(J))throw new Error("invalid recovery id: sig.r+curve.n != R.x");const le=f.toBytes(J),pe=e.fromBytes(wr(p3((R&1)===0),le)),Te=p.inv(J),Oe=U(jt(z,void 0,"msgHash")),Ae=p.create(-Oe*Te),be=p.create(fe*Te),_e=e.BASE.mulAddUnsafe(Ae,pe,be);if(_e.is0())throw new Error("invalid recovery: point at infinify");return _e.assertValidity(),_e}hasHighS(){return ce(this.s)}toBytes(z=C.format){if(sv(z),z==="der")return qh(ty.hexFromSig(this));const{r:ie,s:fe}=this,R=p.toBytes(ie),J=p.toBytes(fe);return z==="recovered"?(w(),wr(Uint8Array.of(this.assertRecovery()),R,J)):wr(R,J)}toHex(z){return db(this.toBytes(z))}}Object.freeze(x.prototype),Object.freeze(x);const G=i.bits2int===void 0?function(z){if(z.length>8192)throw new Error("input is too large");const ie=Pc(z),fe=z.length*8-g;return fe>0?ie>>BigInt(fe):ie}:i.bits2int,U=i.bits2int_modN===void 0?function(z){return p.create(G(z))}:i.bits2int_modN,H=mb(g);function $(X){return Wh("num < 2^"+g,X,ia,H),p.toBytes(X)}function M(X,z){return jt(X,void 0,"message"),z?jt(r(X),void 0,"prehashed message"):X}function k(X,z,ie){const{lowS:fe,prehash:R,extraEntropy:J}=ny(ie,C);X=M(X,R);const le=U(X),pe=p.fromBytes(z);if(!p.isValidNot0(pe))throw new Error("invalid private key");const Te=[$(pe),$(le)];if(J!=null&&J!==!1){const _e=J===!0?c(V.secretKey):J;Te.push(jt(_e,void 0,"extraEntropy"))}const Oe=wr(...Te),Ae=le;function be(_e){const Pe=G(_e);if(!p.isValidNot0(Pe))return;const at=e.BASE.multiply(Pe).toAffine(),P=p.create(at.x);if(P===ia)return;let te;if(b!==void 0){const ue=Pc(s3(b(y),m)),ze=p.inv(p.mul(ue,Pe)),Le=p.mul(ue,Ae),Mt=p.mul(ue,pe);te=p.create(ze*p.create(Le+Mt*P))}else{const ue=cz(Pe,m);te=p.create(ue*p.create(Ae+P*pe))}if(te===ia)return;let de=K(at.x,at.y,P),he=te;return fe&&ce(te)&&(he=p.neg(te),de^=1),new x(P,he,W?void 0:de)}return{seed:Oe,k2sig:be}}function I(X,z,ie={}){const{seed:fe,k2sig:R}=k(X,z,ie);return sz(r.outputLen,p.BYTES,u)(fe,R).toBytes(ie.format)}function D(X,z,ie,fe={}){const{lowS:R,prehash:J,format:le}=ny(fe,C);if(ie=jt(ie,void 0,"publicKey"),z=M(z,J),!ad(X)){const pe=X instanceof x?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+pe)}O(X,le);try{const pe=x.fromBytes(X,le),Te=e.fromBytes(ie);if(Te.is0()||R&&pe.hasHighS())return!1;const{r:Oe,s:Ae}=pe,be=U(z),_e=p.inv(Ae),Pe=p.create(be*_e),at=p.create(Oe*_e),P=e.BASE.mulAddUnsafe(Pe,Te,at);if(P.is0())return!1;const te=P.toAffine();return!(p.create(te.x)!==Oe||le==="recovered"&&pe.recovery!==K(te.x,te.y,Oe))}catch{return!1}}function L(X,z,ie={}){const{prehash:fe}=ny(ie,C);return z=M(z,fe),x.fromBytes(X,"recovered").recoverPublicKey(z).toBytes()}return Object.freeze({keygen:S,getPublicKey:A,getSharedSecret:N,utils:j,lengths:V,Point:e,sign:I,verify:D,recoverPublicKey:L,Signature:x,hash:r})}const Qz={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},e$=Xz(Qz),xu=Kz(e$,PA),ry=33,rv=64;var xc;xc=class extends Ip{constructor(t){if(super(),typeof t=="string"?this.data=qe(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==ry)throw new Error(`Invalid public key input. Expected ${ry} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return yi.Passkey}async verify(t,s){const r=g3(s),i=JSON.parse(r.clientDataJson);if(i.type!=="webauthn.get"||!Bu(t,qe(i.challenge.replace(/-/g,"+").replace(/_/g,"/"))))return!1;const c=r.userSignature.slice(1+rv);if(!Bu(this.toRawBytes(),c))return!1;const u=new Uint8Array([...r.authenticatorData,...PA(new TextEncoder().encode(r.clientDataJson))]),f=r.userSignature.slice(1,rv+1);return xu.verify(f,u,c)}},xc.SIZE=ry;function g3(e){const t=typeof e=="string"?qe(e):e;if(t[0]!==yi.Passkey)throw new Error("Invalid signature scheme");const s=ek.parse(t.slice(1));return{signatureScheme:"Passkey",serializedSignature:st(t),signature:t,authenticatorData:s.authenticatorData,clientDataJson:s.clientDataJson,userSignature:new Uint8Array(s.userSignature),publicKey:new Uint8Array(s.userSignature.slice(1+rv))}}function t$(e){for(let t=0;t<e.length;t++)if(e[t]!==0)return t;return-1}function _b(e,t){return Fv(e.toString(16).padStart(t*2,"0").slice(-t*2))}function y3(e,t){const s=_b(e,t),r=t$(s);return r===-1?new Uint8Array([0]):s.slice(r)}function n$(e){return e==="accounts.google.com"?"https://accounts.google.com":e}function s$(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 r$(e){let t=[];for(let s=0;s<e.length;s++){const r=s$(e.charAt(s));t=t.concat(r)}return t}function a$(e,t){if(e.length<2)throw new Error(`Input (s = ${e}) is not tightly packed because s.length < 2`);let s=r$(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 f=0;f<s.length;f+=8){const p=s.slice(f,f+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 v3(e,t){const[s,r]=i$(a$(e.value,e.indexMod4));if(s!==t)throw new Error(`Invalid field name: found ${s} expected ${t}`);return r}const o$=E.struct("ZkLoginSignature",{inputs:E.struct("ZkLoginSignatureInputs",{proofPoints:E.struct("ZkLoginSignatureInputsProofPoints",{a:E.vector(E.string()),b:E.vector(E.vector(E.string())),c:E.vector(E.string())}),issBase64Details:E.struct("ZkLoginSignatureInputsClaim",{value:E.string(),indexMod4:E.u8()}),headerBase64:E.string(),addressSeed:E.string()}),maxEpoch:E.u64(),userSignature:E.byteVector()});function c$(e){return o$.parse(typeof e=="string"?qe(e):e)}var l$=class ei extends Ip{#e;#t;#r;constructor(t,{client:s}={}){super(),this.#t=s,typeof t=="string"?this.#e=qe(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=gc(this.#e,!1))}get legacyAddress(){return this.#r}static fromBytes(t,{client:s,address:r,legacyAddress:i}={}){let c;if(i===!0?c=new ei(gc(t,!0),{client:s}):i===!1?c=new ei(gc(t,!1),{client:s}):r?(c=new ei(gc(t,!1),{client:s}),c.toSuiAddress()!==r&&(c=new ei(gc(t,!0),{client:s}))):c=new ei(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=v3(r,"iss"),u=av(BigInt(i),c,{legacyAddress:!0});if(u.toSuiAddress()===t)return u;const f=av(BigInt(i),c,{legacyAddress:!1});if(f.toSuiAddress()!==t)throw new Error("Proof does not match address");return f}equals(t){return super.equals(t)}toSuiAddress(){return this.#r?this.#s():super.toSuiAddress()}#s(){const t=gc(this.#e,!0),s=new Uint8Array(t.length+1);return s[0]=this.flag(),s.set(t,1),ye(ed($c(s,{dkLen:32})).slice(0,Qc*2))}toRawBytes(){return this.#e}flag(){return yi.ZkLogin}async verify(t,s){throw Error("does not support")}verifyPersonalMessage(t,s){const r=iv(s);return QS({address:new ei(r.publicKey).toSuiAddress(),bytes:st(t),signature:r.serializedSignature,intentScope:"PersonalMessage",client:this.#t})}verifyTransaction(t,s){const r=iv(s);return QS({address:new ei(r.publicKey).toSuiAddress(),bytes:st(t),signature:r.serializedSignature,intentScope:"TransactionData",client:this.#t})}verifyAddress(t){return t===super.toSuiAddress()||t===this.#s()}};function av(e,t,s){if(s.legacyAddress===void 0)throw new Error("legacyAddress parameter must be specified");const r=s.legacyAddress?y3(e,32):_b(e,32),i=new TextEncoder().encode(n$(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 l$(c,s)}function gc(e,t){const s=e[0]+1,r=BigInt(`0x${kr(e.slice(s))}`),i=t?y3(r,32):_b(r,32),c=new Uint8Array(s+i.length);return c.set(e.slice(0,s),0),c.set(i,s),c}async function QS({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 iv(e){const t=typeof e=="string"?qe(e):e;if(t[0]!==yi.ZkLogin)throw new Error("Invalid signature scheme");const{inputs:s,maxEpoch:r,userSignature:i}=c$(t.slice(1)),{issBase64Details:c,addressSeed:u}=s,f=v3(c,"iss"),p=av(BigInt(u),f,{legacyAddress:!1});return{serializedSignature:st(t),signatureScheme:"ZkLogin",zkLogin:{inputs:s,maxEpoch:r,userSignature:i,iss:f,addressSeed:BigInt(u)},signature:t,publicKey:p.toRawBytes()}}function u$({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([yi[t]]),i.set(e,1),i.set(r,1+e.length),st(i)}function d$(e){const t=qe(e),s=ub[t[0]];switch(s){case"Passkey":return g3(e);case"MultiSig":return{serializedSignature:e,signatureScheme:s,multisig:F.MultiSig.parse(t.slice(1)),bytes:t,signature:void 0};case"ZkLogin":return iv(e);case"ED25519":case"Secp256k1":case"Secp256r1":return $A(e);default:throw new Error("Unsupported signature scheme")}}const Eh=32,b3="suiprivkey";var w3=class{async signWithIntent(e,t){const s=$c(zA(t,e),{dkLen:32});return{signature:u$({signature:await this.sign(s),signatureScheme:this.getKeyScheme(),publicKey:this.getPublicKey()}),bytes:st(e)}}async signTransaction(e){return this.signWithIntent(e,"TransactionData")}async signPersonalMessage(e){const{signature:t}=await this.signWithIntent(E.byteVector().serialize(e).toBytes(),"PersonalMessage");return{bytes:st(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()}},f$=class extends w3{};function h$(e){const{prefix:t,words:s}=Ch.decode(e);if(t!==b3)throw new Error("invalid private key prefix");const r=new Uint8Array(Ch.fromWords(s)),i=r.slice(1);return{scheme:ub[r[0]],secretKey:i}}function p$(e,t){if(e.length!==Eh)throw new Error("Invalid bytes length");const s=yi[t],r=new Uint8Array(e.length+1);return r.set([s]),r.set(e,1),Ch.encode(b3,Ch.toWords(r))}const m$="ed25519 seed",g$=2147483648,y$=new RegExp("^m(\\/[0-9]+')+$"),T3=e=>e.replace("'",""),v$=e=>{const t=Rp.create(rd,new TextEncoder().encode(m$)).update(Ku(e)).digest();return{key:t.slice(0,32),chainCode:t.slice(32)}},b$=({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=Rp.create(rd,t).update(i).digest();return{key:c.slice(0,32),chainCode:c.slice(32)}},w$=e=>y$.test(e)?!e.split("/").slice(1).map(T3).some(isNaN):!1,e_=(e,t,s=g$)=>{if(!w$(e))throw new Error("Invalid derivation path");const{key:r,chainCode:i}=v$(t);return e.split("/").slice(1).map(T3).map(c=>parseInt(c,10)).reduce((c,u)=>b$(c,u+s),{key:r,chainCode:i})},t_="m/44'/784'/0'/0'/0'";var T$=class Eu extends f${constructor(t){if(super(),t)this.keypair={publicKey:t.publicKey,secretKey:t.secretKey.slice(0,32)};else{const s=ta.utils.randomSecretKey();this.keypair={publicKey:ta.getPublicKey(s),secretKey:s}}}getKeyScheme(){return"ED25519"}static generate(){const t=ta.utils.randomSecretKey();return new Eu({publicKey:ta.getPublicKey(t),secretKey:t})}static fromSecretKey(t,s){if(typeof t=="string"){const c=h$(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!==Eh)throw new Error(`Wrong secretKey size. Expected ${Eh} bytes, got ${r}.`);const i={publicKey:ta.getPublicKey(t),secretKey:t};if(!s||!s.skipValidation){const c=new TextEncoder().encode("sui validation"),u=ta.sign(c,t);if(!ta.verify(u,c,i.publicKey))throw new Error("provided secretKey is invalid")}return new Eu(i)}getPublicKey(){return new Uz(this.keypair.publicKey)}getSecretKey(){return p$(this.keypair.secretKey.slice(0,Eh),this.getKeyScheme())}async sign(t){return ta.sign(t,this.keypair.secretKey)}static deriveKeypair(t,s){if(s==null&&(s=t_),!JS(s))throw new Error("Invalid derivation path");const{key:r}=e_(s,Hz(t));return Eu.fromSecretKey(r)}static deriveKeypairFromSeed(t,s){if(s==null&&(s=t_),!JS(s))throw new Error("Invalid derivation path");const r=typeof t=="string"?t:kr(t),{key:i}=e_(s,r);return Eu.fromSecretKey(i)}};const ay=33;var Cc,E3=(Cc=class extends Ip{constructor(t){if(super(),typeof t=="string"?this.data=qe(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==ay)throw new Error(`Invalid public key input. Expected ${ay} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return yi.Secp256r1}async verify(t,s){let r;if(typeof s=="string"){const i=d$(s);if(i.signatureScheme!=="Secp256r1")throw new Error("Invalid signature scheme");if(!Bu(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return xu.verify(r,t,this.toRawBytes())}},Cc.SIZE=ay,Cc),E$=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 f=u.result;f&&(c.push([f.key,f.value]),f.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 S$(e){const t=new Uint8Array(e),s=t.slice(1,33),r=(t.slice(33,65)[31]&1)===0?2:3,i=new Uint8Array(E3.SIZE);return i[0]=r,i.set(s,1),i}var n_=class ov extends w3{#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 ov(s.privateKey,S$(new Uint8Array(r)))}static import(t){return new ov(t.privateKey,t.publicKey)}getKeyScheme(){return"Secp256r1"}constructor(t,s){super(),this.privateKey=t,this.#e=new E3(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=xu.Signature.fromBytes(new Uint8Array(s));return(r.hasHighS()?new xu.Signature(r.r,xu.Point.Fn.neg(r.s)):r).toBytes("compact")}};const _$="dev-wallet-webcrypto",k$="accounts",iy="__account_meta__";var A$=class extends qL{#e;constructor(e){super(),this.id="webcrypto",this.name="WebCrypto Signer",this.#e=new E$(e?.dbName??_$,e?.storeName??k$)}async initialize(){const e=await this.#e.entries(),t=await this.#e.get(iy)??[],s=[];for(const[r,i]of e){if(r===iy)continue;const c=r;try{const u=i,f=n_.import(u),p=t.find(m=>m.address===c);s.push(Hy(f,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 n_.generate(),s=t.getPublicKey().toSuiAddress(),r=Hy(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(iy,e)}},oy={exports:{}},Ge={};var s_;function O$(){if(s_)return Ge;s_=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"),f=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"),S=Symbol.iterator;function A(R){return R===null||typeof R!="object"?null:(R=S&&R[S]||R["@@iterator"],typeof R=="function"?R:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,V={};function C(R,J,le){this.props=R,this.context=J,this.refs=V,this.updater=le||N}C.prototype.isReactComponent={},C.prototype.setState=function(R,J){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,J,"setState")},C.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function W(){}W.prototype=C.prototype;function ce(R,J,le){this.props=R,this.context=J,this.refs=V,this.updater=le||N}var ae=ce.prototype=new W;ae.constructor=ce,j(ae,C.prototype),ae.isPureReactComponent=!0;var Y=Array.isArray;function K(){}var w={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function x(R,J,le){var pe=le.ref;return{$$typeof:e,type:R,key:J,ref:pe!==void 0?pe:null,props:le}}function G(R,J){return x(R.type,J,R.props)}function U(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function H(R){var J={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(le){return J[le]})}var $=/\/+/g;function M(R,J){return typeof R=="object"&&R!==null&&R.key!=null?H(""+R.key):J.toString(36)}function k(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(K,K):(R.status="pending",R.then(function(J){R.status==="pending"&&(R.status="fulfilled",R.value=J)},function(J){R.status==="pending"&&(R.status="rejected",R.reason=J)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function I(R,J,le,pe,Te){var Oe=typeof R;(Oe==="undefined"||Oe==="boolean")&&(R=null);var Ae=!1;if(R===null)Ae=!0;else switch(Oe){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(R.$$typeof){case e:case t:Ae=!0;break;case g:return Ae=R._init,I(Ae(R._payload),J,le,pe,Te)}}if(Ae)return Te=Te(R),Ae=pe===""?"."+M(R,0):pe,Y(Te)?(le="",Ae!=null&&(le=Ae.replace($,"$&/")+"/"),I(Te,J,le,"",function(Pe){return Pe})):Te!=null&&(U(Te)&&(Te=G(Te,le+(Te.key==null||R&&R.key===Te.key?"":(""+Te.key).replace($,"$&/")+"/")+Ae)),J.push(Te)),1;Ae=0;var be=pe===""?".":pe+":";if(Y(R))for(var _e=0;_e<R.length;_e++)pe=R[_e],Oe=be+M(pe,_e),Ae+=I(pe,J,le,Oe,Te);else if(_e=A(R),typeof _e=="function")for(R=_e.call(R),_e=0;!(pe=R.next()).done;)pe=pe.value,Oe=be+M(pe,_e++),Ae+=I(pe,J,le,Oe,Te);else if(Oe==="object"){if(typeof R.then=="function")return I(k(R),J,le,pe,Te);throw J=String(R),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function D(R,J,le){if(R==null)return R;var pe=[],Te=0;return I(R,pe,"","",function(Oe){return J.call(le,Oe,Te++)}),pe}function L(R){if(R._status===-1){var J=R._result,le=J();le.then(function(pe){(R._status===0||R._status===-1)&&(R._status=1,R._result=pe,le.status===void 0&&(le.status="fulfilled",le.value=pe))},function(pe){(R._status===0||R._status===-1)&&(R._status=2,R._result=pe,le.status===void 0&&(le.status="rejected",le.reason=pe))}),R._status===-1&&(R._status=0,R._result=le)}if(R._status===1)return R._result.default;throw R._result}var X=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var J=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)};function z(R){var J=w.T,le={};le.types=J!==null?J.types:null,w.T=le;try{var pe=R(),Te=w.S;Te!==null&&Te(le,pe),typeof pe=="object"&&pe!==null&&typeof pe.then=="function"&&pe.then(K,X)}catch(Oe){X(Oe)}finally{J!==null&&le.types!==null&&(J.types=le.types),w.T=J}}function ie(R){var J=w.T;if(J!==null){var le=J.types;le===null?J.types=[R]:le.indexOf(R)===-1&&le.push(R)}else z(ie.bind(null,R))}var fe={map:D,forEach:function(R,J,le){D(R,function(){J.apply(this,arguments)},le)},count:function(R){var J=0;return D(R,function(){J++}),J},toArray:function(R){return D(R,function(J){return J})||[]},only:function(R){if(!U(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Ge.Activity=y,Ge.Children=fe,Ge.Component=C,Ge.Fragment=s,Ge.Profiler=i,Ge.PureComponent=ce,Ge.StrictMode=r,Ge.Suspense=p,Ge.ViewTransition=b,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(R){return w.H.useMemoCache(R)}},Ge.addTransitionType=ie,Ge.cache=function(R){return function(){return R.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(R,J,le){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var pe=j({},R.props),Te=R.key;if(J!=null)for(Oe in J.key!==void 0&&(Te=""+J.key),J)!O.call(J,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&J.ref===void 0||(pe[Oe]=J[Oe]);var Oe=arguments.length-2;if(Oe===1)pe.children=le;else if(1<Oe){for(var Ae=Array(Oe),be=0;be<Oe;be++)Ae[be]=arguments[be+2];pe.children=Ae}return x(R.type,Te,pe)},Ge.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:c,_context:R},R},Ge.createElement=function(R,J,le){var pe,Te={},Oe=null;if(J!=null)for(pe in J.key!==void 0&&(Oe=""+J.key),J)O.call(J,pe)&&pe!=="key"&&pe!=="__self"&&pe!=="__source"&&(Te[pe]=J[pe]);var Ae=arguments.length-2;if(Ae===1)Te.children=le;else if(1<Ae){for(var be=Array(Ae),_e=0;_e<Ae;_e++)be[_e]=arguments[_e+2];Te.children=be}if(R&&R.defaultProps)for(pe in Ae=R.defaultProps,Ae)Te[pe]===void 0&&(Te[pe]=Ae[pe]);return x(R,Oe,Te)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(R){return{$$typeof:f,render:R}},Ge.isValidElement=U,Ge.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:L}},Ge.memo=function(R,J){return{$$typeof:m,type:R,compare:J===void 0?null:J}},Ge.startTransition=z,Ge.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},Ge.use=function(R){return w.H.use(R)},Ge.useActionState=function(R,J,le){return w.H.useActionState(R,J,le)},Ge.useCallback=function(R,J){return w.H.useCallback(R,J)},Ge.useContext=function(R){return w.H.useContext(R)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(R,J){return w.H.useDeferredValue(R,J)},Ge.useEffect=function(R,J){return w.H.useEffect(R,J)},Ge.useEffectEvent=function(R){return w.H.useEffectEvent(R)},Ge.useId=function(){return w.H.useId()},Ge.useImperativeHandle=function(R,J,le){return w.H.useImperativeHandle(R,J,le)},Ge.useInsertionEffect=function(R,J){return w.H.useInsertionEffect(R,J)},Ge.useLayoutEffect=function(R,J){return w.H.useLayoutEffect(R,J)},Ge.useMemo=function(R,J){return w.H.useMemo(R,J)},Ge.useOptimistic=function(R,J){return w.H.useOptimistic(R,J)},Ge.useReducer=function(R,J,le){return w.H.useReducer(R,J,le)},Ge.useRef=function(R){return w.H.useRef(R)},Ge.useState=function(R){return w.H.useState(R)},Ge.useSyncExternalStore=function(R,J,le){return w.H.useSyncExternalStore(R,J,le)},Ge.useTransition=function(){return w.H.useTransition()},Ge.version="19.3.0",Ge}var r_;function kb(){return r_||(r_=1,oy.exports=O$()),oy.exports}var Ve=kb();const S3=FC(Ve),_3=GC({__proto__:null,default:S3},[Ve]),k3=Ve.createContext(null);function N$({dAppKit:e,children:t}){return T.jsx(k3.Provider,{value:e,children:t})}function bo(e){const t=Ve.useContext(k3);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 cy=0,a_=[];function x$(){return cy+=1,()=>{if(cy-=1,cy===0){let e=a_;a_=[];for(let t of e)t()}}}function Jh(e){let t=x$(),s;try{s=Promise.resolve(e()).finally(t)}catch(r){throw t(),r}return s.t=!0,s}let Js=[],Su=0;const cv=4,Sh=globalThis.nanostoresGlobal||={epoch:0};let C$=()=>{let e,t;for(;Su<Js.length;){t=Su,Su+=cv;try{Js[t](Js[t+1].value,Js[t+2],Js[t+3])}catch(s){e=s}}if(Js.length=Su=0,e)throw e};const Kh=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=Su;c<Js.length;)Js[c]===r?Js.splice(c,cv):c+=cv;let i=t.indexOf(r);~i&&(t.splice(i,1),--s.lc||s.off())}},notify(r,i){Sh.epoch++;let c=!Js.length&&!0;for(let u of t)Js.push(u,s,r,i);c&&C$()},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},I$=e=>e,R$=5,Kf=6,Qf=10;let j$=(e,t,s,r)=>(e.events=e.events||{},e.events[s+Qf]||(e.events[s+Qf]=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+Qf](),delete e.events[s+Qf]))});const M$=1e3;let jp=(e,t)=>j$(e,r=>{let i=t(r);i&&e.events[Kf].push(i)},R$,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[Kf]=[],e.off=()=>{c(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let u of e.events[Kf])u();e.events[Kf]=[]}},M$)},()=>{e.listen=i,e.off=c}}),D$=(e,t,s)=>{Array.isArray(e)||(e=[e]);let r,i,c=()=>{if(i===Sh.epoch)return;i=Sh.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=Sh.epoch)}},u=Kh(),f=u.get;u.get=()=>(c(),f());let p=c;return jp(u,()=>{let m=e.map(g=>g.listen(p));return c(),()=>{for(let g of m)g()}}),u};const ly=(e,t)=>D$(e,t);function i_(e,t){let s=U$(t),r=e;for(let i of s){if(r==null)return;r=r[i]}return r}const o_=/(.*)\[(\d+)\]/;function U$(e){return e.split(".").flatMap(t=>A3(t))}function A3(e){if(o_.test(e)){let[,t,s]=e.match(o_);return[...A3(t),s]}return[e]}function B$(e,t,s){let r=new Set(t);return e.listen((i,c,u)=>{(u===void 0?t.some(f=>c===void 0||i[f]!==c[f]||i_(i,f)!==i_(c,f)):r.has(u)||r.has(u.split(/\.|\[/)[0]))&&s(i,c,u)})}const L$=(e={})=>{let t=Kh(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};let uy=(e,t)=>s=>{e.current!==s&&(e.current=s,t())};function z$(e,{keys:t,deps:s=[e,t],ssr:r}={}){let i=Ve.useRef();i.current=e.get();let c=Ve.useCallback(p=>(uy(i,p)(e.value),t?.length>0?B$(e,t,uy(i,p)):e.listen(uy(i,p))),s),u=()=>i.current,f=u;return r&&"init"in e&&(f=r==="initial"?()=>e.init:r),Ve.useSyncExternalStore(c,u,f)}const O3=new WeakMap;function N3(e,t){O3.set(e,t)}function Mp(e){const t=xr(e),s=t.accounts.find(({address:r})=>r===e.address);if(!s){const r=new td(F5,{address:e.address,walletName:t.name});throw kp(r,Mp),r}return s}function xr(e){const t=O3.get(e);if(!t){const s=new td(G5);throw kp(s,xr),s}return t}function Qh(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 $$(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 c_=new WeakMap;function lv(e,t){let s=c_.get(t);if(s)try{xr(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||Qh(i.chains,t.chains))&&(u(),i.chains=Object.freeze([...t.chains])),(r||Qh(i.features,t.features))&&(u(),i.features=Object.freeze([...t.features])),(r||i.address!==t.address||i.icon!==t.icon||i.label!==t.label||$$(i.publicKey,t.publicKey))&&(u(),i.address=t.address,i.icon=t.icon,i.label=t.label,i.publicKey=t.publicKey),c&&(c_.set(t,i),N3(i,e)),Object.freeze(i)}const l_=new WeakMap;function V$(e){const t=l_.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 f of e.accounts.slice(this._cache.length)){const p=lv(e,f);this._cache.push(p),yield p}},some(f){if(this._cache.some(f))return!0;for(const p of e.accounts.slice(this._cache.length)){const m=lv(e,p);if(this._cache.push(m),f(m))return!0}return!1},get length(){return e.accounts.length}};return(s||r.accounts.length!==e.accounts.length||u.some(f=>!r.accounts.includes(f)))&&(c(),r.accounts=Object.freeze(Array.from(u))),(s||Qh(r.features,Object.keys(e.features)))&&(c(),r.features=Object.freeze(Object.keys(e.features))),(s||Qh(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&&(l_.set(e,r),N3(r,e)),Object.freeze(r)}function P$(e,t){if(e.address!==t.address)return!1;const s=xr(e),r=xr(t);return s===r}function Gc(e,t){const s=xr(t),r=xr(e);return s===r}function od(e,t){const s=xr(e);if(!(t in s.features)){const r=new td(Y5,{featureName:t,supportedChains:[...s.chains],supportedFeatures:Object.keys(s.features),walletName:s.name});throw kp(r,od),r}return s.features[t]}function x3(e,t){if(!e.features.includes(t)){const s=new td(Z5,{address:e.address,featureName:t,supportedChains:[...e.chains],supportedFeatures:[...e.features]});throw kp(s,x3),s}return od(e,t)}new TextEncoder;const G$=new TextDecoder,F$=new TextDecoder("utf-8",{fatal:!0});function H$(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 q$ 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 Fi extends q${static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}const Z$="The input to be decoded is not correctly encoded.";function Y$(e){try{return H$(typeof e=="string"?e:G$.decode(e),!0)}catch(t){throw new TypeError(Z$,{cause:t})}}function W$(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 X$(e){if(typeof e!="string")throw new Fi("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:s}=e.split(".");if(s===5)throw new Fi("Only JWTs using Compact JWS serialization can be decoded");if(s!==3)throw new Fi("Invalid JWT");if(!t)throw new Fi("JWTs must contain a payload");let r;try{r=Y$(t)}catch{throw new Fi("Failed to base64url decode the payload")}let i;try{i=JSON.parse(F$.decode(r))}catch{throw new Fi("Failed to parse the decoded payload as JSON")}if(!W$(i))throw new Fi("Invalid JWT Claims Set");return i}const J$=Ne({address:Be(),publicKey:Be(),label:dn(Be()),features:dn(ct(Be()))}),K$=Ne({exp:Cn(),iat:Cn(),iss:Be(),aud:Be(),payload:Ne({accounts:ct(J$)})});function Q$(e){const t=X$(e);return St(K$,t)}const eV=Ep("type",[Ne({type:nt("connect"),session:Be("`session` is required")}),Ne({type:nt("sign-transaction"),bytes:Be(),signature:Be()}),Ne({type:nt("sign-and-execute-transaction"),bytes:Be(),signature:Be(),digest:Be(),effects:Be()}),Ne({type:nt("sign-personal-message"),bytes:Be(),signature:Be()})]),tV=Ep("type",[Ne({type:nt("reject"),reason:dn(Be("`reason` must be a string"))}),Ne({type:nt("resolve"),data:eV})]),nV=Ne({id:Xt(Be(),hk()),source:nt("web-wallet-channel"),payload:tV,version:nt("1")});function sV(){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 rV=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:f,reject:p}=O4();this.#c=u,this.#n=f,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:sV(),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}=YI(nV,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 aV="https://my.slush.app",ep="slush:session",iV="Slush",oV="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgMjRDMCAxMC43NDUyIDEwLjc0NTIgMCAyNCAwQzM3LjI1NDggMCA0OCAxMC43NDUyIDQ4IDI0QzQ4IDM3LjI1NDggMzcuMjU0OCA0OCAyNCA0OEMxMC43NDUyIDQ4IDAgMzcuMjU0OCAwIDI0WiIgZmlsbD0iIzBDMEExRiIvPgo8cGF0aCBkPSJNMTMuMTM1OCAzMi4xMDg1QzE0LjE3MDEgMzUuOTY4MyAxOC4wMzMxIDM5LjQ2MjQgMjYuMDI1NSAzNy4zMjA4QzMzLjY1MTUgMzUuMjc3NCAzOC40MzA5IDI5LjAwNCAzNy4xOTE2IDI0LjM3ODlDMzYuNzYzNiAyMi43ODE3IDM1LjQ3NDYgMjEuNzAwNiAzMy40ODcyIDIxLjg3NjVMMTUuNzE2NSAyMy4zNTcyQzE0LjU5NzMgMjMuNDQzIDE0LjA4NDIgMjMuMjU5NiAxMy43ODgxIDIyLjU1NDNDMTMuNTAxIDIxLjg4MjMgMTMuNjY0NiAyMS4xNjA5IDE1LjAxNjMgMjAuNDc3N0wyOC41NDAxIDEzLjUzNzRDMjkuNTc2NyAxMy4wMSAzMC4yNjcxIDEyLjc4OTMgMzAuODk4IDEzLjAxMjZDMzEuMjkzNCAxMy4xNTYzIDMxLjU1MzggMTMuNzI4NCAzMS4zMTQ3IDE0LjQzNDRMMzAuNDM3OCAxNy4wMjMyQzI5LjM2MTcgMjAuMjAwMiAzMS42NjUzIDIwLjkzODIgMzIuOTY0MSAyMC41OTAyQzM0LjkyODkgMjAuMDYzNyAzNS4zOTExIDE4LjE5MjMgMzQuNzU4MSAxNS44Mjk5QzMzLjE1MzMgOS44NDA1NCAyNi43OTkgOC45MDQxMSAyMS4wMzc4IDEwLjQ0NzhDMTUuMTc2NyAxMi4wMTgzIDEwLjA5NiAxNi43Njc2IDExLjY0NzQgMjIuNTU3M0MxMi4wMTI5IDIzLjkyMTYgMTMuMjY4NyAyNS4wMTE2IDE0LjcyMzIgMjQuOTc4NUwxNi45NDM4IDI0Ljk3MzFDMTcuNDAwNCAyNC45NjI1IDE3LjIzNiAyNSAxOC4xMTcgMjQuOTI3MUMxOC45OTggMjQuODU0MSAyMS4zNTA5IDI0LjU2NDYgMjEuMzUwOSAyNC41NjQ2TDMyLjg5NjIgMjMuMjU4TDMzLjE5MzcgMjMuMjE0OEMzMy44Njg5IDIzLjA5OTcgMzQuMzc5MiAyMy4yNzUgMzQuODEwNiAyNC4wMTgzQzM1LjQ1NjMgMjUuMTMwNCAzNC40NzEyIDI1Ljk2OTEgMzMuMjkyIDI2Ljk3MzFDMzMuMjYwNSAyNyAzMy4yMjg4IDI3LjAyNyAzMy4xOTcgMjcuMDU0MUwyMy4wNDgyIDM1LjgwMDVDMjEuMzA4NyAzNy4zMDA4IDIwLjA4NjcgMzYuNzM2NyAxOS42NTg4IDM1LjEzOTVMMTguMTQzMSAyOS40ODI5QzE3Ljc2ODcgMjguMDg1NCAxNi40MDQxIDI2Ljk4ODkgMTQuODA1NiAyNy40MTcyQzEyLjgwNzUgMjcuOTUyNiAxMi42NDU1IDMwLjI3ODQgMTMuMTM1OCAzMi4xMDg1WiIgZmlsbD0iI0ZCRkFGRiIvPgo8L3N2Zz4K",dy="com.mystenlabs.suiwallet",cV="https://api.slush.app/api/wallet/metadata",lV={id:"com.mystenlabs.suiwallet.web",walletName:"Slush",description:"Trade and earn on Sui.",icon:oV,enabled:!0},uV=Ne({id:Be("Wallet ID is required"),walletName:Be("Wallet name is required"),icon:Be("Icon must be a valid wallet icon format"),enabled:co("Enabled is required")});function dV(e){localStorage.setItem(ep,e)}function uu(){const e=localStorage.getItem(ep);if(!e)throw new Error("No session found");return e}const u_=["sui:signTransaction","sui:signAndExecuteTransaction","sui:signPersonalMessage","sui:signTransactionBlock"];function d_(e){const{payload:t}=Q$(e);return t.accounts.map(s=>new nd({address:s.address,chains:Uu,features:s.features?u_.filter(r=>s.features?.includes(r)):u_,publicKey:qe(s.publicKey)}))}var fV=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 Uu}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=x4(),this.#s=t||aV,this.#o=e,this.#a=s.walletName,this.#i=s.icon,typeof window<"u"){const r=window,i=c=>{c.storageArea!==localStorage||c.key!==ep&&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:uu()});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:uu()});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:uu()});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:st(e),address:t.address,chain:s??zk,session:uu()});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 dV(t.session),this.#l(d_(t.session)),{accounts:this.accounts}};#d(){try{return d_(uu())}catch{return[]}}#y=async()=>{localStorage.removeItem(ep),this.#l([])};#u(){return new rV({appName:this.#o,hostOrigin:this.#s})}updateMetadata(e){this.#e=e.id,this.#a=e.walletName,this.#i=e.icon}};async function hV(e){const t=await fetch(e);if(!t.ok)throw new Error("Failed to fetch wallet metadata");return St(uV,await t.json())}function pV(e,{origin:t,metadataApiUrl:s=cV}={}){const r=_p();if(r.get().some(m=>m.id===dy))return;const i=new fV({name:e,origin:t,metadata:lV}),c=r.register(i);let u=!1;const f=()=>{u||(u=!0,i.dispose(),p(),c())},p=r.on("register",m=>{m.id===dy&&f()});return r.get().some(m=>m.id===dy)&&f(),hV(s).then(m=>{if(!u){if(!m.enabled){console.log("Slush wallet is not currently enabled."),f();return}i.updateMetadata(m)}}).catch(m=>{console.error("Error fetching metadata",m)}),{wallet:i,unregister:f}}var sl=class extends Error{},Ab=class extends sl{},mV=class extends sl{},Dp=class extends sl{},gV=class extends sl{},Ob=class extends sl{};function rl(e){return`sui:${e}`}function yV(e,t){if(e.length===0)throw new sl("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 vV=[Jv,Ap],bV=[zh,Bk];function C3(e){const t=xr(e);return t.id??t.name}function Nb(e,t){if(!e.wallet||!e.account)throw new Ab("No wallet is connected.");if(t&&!Gc(t,e.wallet))throw new Ob(`No account with address ${t.address} is connected to ${e.wallet.name}.`);return t??e.account}function I3({account:e,featureName:t,chain:s}){if(!e.chains.includes(s)){const r=new td(q5,{chain:s,featureName:t,supportedChains:[...e.chains],supportedFeatures:[...e.features],address:e.address});throw new mV(`The account ${r.context.address} does not support the chain "${r.context.chain}".`,{cause:r})}try{return x3(e,t)}catch(r){throw new Dp(`The account ${e.address} does not support the feature "${t}".`,{cause:r})}}function tp(...e){try{return I3(...e)}catch(t){if(t instanceof Dp)return null;throw t}}function wV({defaultNetwork:e,getClient:t}){const s=L$({status:"disconnected",currentAccount:null}),r=Kh(e),i=Kh([]),c=ly([i,r],(u,f)=>u.filter(p=>{const m=p.chains.some(b=>rl(f)===b),g=vV.every(b=>p.features.includes(b)),y=bV.some(b=>p.features.includes(b));return m&&g&&y}));return{$currentNetwork:r,$registeredWallets:i,$compatibleWallets:c,$baseConnection:s,$currentClient:ly(r,t),$connection:ly([s,c],(u,f)=>{switch(u.status){case"connected":{const p=f.find(m=>Gc(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?f.find(g=>Gc(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 TV({$registeredWallets:e}){jp(e,()=>{const t=_p(),s=new Map,r=()=>{const f=t.get(),p=[];for(const m of f)try{p.push(V$(m))}catch{console.warn(`[dapp-kit] Skipping wallet "${m.name}" because it does not comply with the Wallet Standard.`)}e.set(p)},i=f=>{const p=f.features[Ap].on("change",()=>{r()});s.set(f,p)},c=t.on("register",(...f)=>{f.filter(fy).forEach(i),r()}),u=t.on("unregister",(...f)=>{f.filter(fy).forEach(p=>{const m=s.get(p);m&&(s.delete(p),m())}),r()});return t.get().filter(fy).forEach(i),r(),()=>{c(),u(),s.forEach(f=>f()),s.clear()}})}function fy(e){return Ap in e.features}const EV="mysten-dapp-kit:selected-wallet-and-address";function SV(){return _V()?localStorage:R3()}function R3(){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 j3(e,t,s,r){const i=C3(s).replace(":","_"),c=r.join(","),u=[i,s.address,c].join(":");e.setItem(t,u)}function _V(){try{const e="__storage_test__";return localStorage.setItem(e,"test"),localStorage.removeItem(e),!0}catch{return!1}}function kV({$baseConnection:e},t,{storage:s,storageKey:r}){return async function({wallet:c,account:u,...f}){return await Jh(async()=>{const p=e.get().status==="connected";try{e.setKey("status",p?"reconnecting":"connecting");const{accounts:m,supportedIntents:g}=await M3(c,t,f);if(!p&&m.length===0)throw new gV("No accounts were authorized.");if(u&&!Gc(u,c))throw new Ob(`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}),j3(s,r,y,b),{accounts:m}}catch(m){throw e.setKey("status",p?"connected":"disconnected"),m}})}}async function M3(e,t,s){const{connect:r}=od(e,Jv),i=await r(s),c=xr(e),u=t.map(rl),f=i.supportedIntents??await D3(e);return{accounts:i.accounts.filter(p=>p.chains.some(m=>u.includes(m))).map(lv.bind(null,c)),supportedIntents:f}}async function D3(e){return e.features.includes("sui:getCapabilities")?(await od(e,"sui:getCapabilities")?.getCapabilities())?.supportedIntents??[]:[]}function AV({networks:e,stores:{$baseConnection:t,$compatibleWallets:s},storage:r,storageKey:i,walletsRegistered:c,timeout:u}){jp(s,()=>{let f=!1,p;const m=()=>{f=!0,p?.()},g=y=>Jh(async()=>{if(f)return;const{status:b}=t.get();if(b!=="disconnected"&&b!=="reconnecting"){m();return}const S=await OV({networks:e,storage:r,storageKey:i,wallets:y});f||S&&(t.set({status:"connected",currentAccount:S.account,supportedIntents:S.supportedIntents}),m())});return p=s.subscribe((y,b)=>{y&&(b&&b.length>y.length||g(y))}),Jh(async()=>{const y=!!await r.getItem(i);if(f)return;if(!y){m();return}t.get().status==="disconnected"&&t.set({status:"reconnecting",currentAccount:null,supportedIntents:[]});const b=new Promise(S=>setTimeout(S,u));await Promise.all([c.catch(()=>{}),b]),!f&&(await g(s.get()??[]),!f&&t.get().status==="reconnecting"&&t.set({status:"disconnected",currentAccount:null}))}),m})}async function OV({networks:e,storage:t,storageKey:s,wallets:r}){const i=await t.getItem(s);if(!i)return null;const[c,u,f]=i.split(":");if(!c||!u)return null;const p=r.find(S=>C3(S)===c);if(!p)return null;const m=p.accounts.find(S=>S.address===u);if(m)return{account:m,supportedIntents:(f?f.split(","):null)??await D3(p)};const{accounts:g,supportedIntents:y}=await M3(p,e,{silent:!0}),b=g.find(S=>S.address===u);return b?{account:b,supportedIntents:y}:null}function NV({$compatibleWallets:e,$baseConnection:t}){jp(e,()=>e.listen(async s=>{const r=t.get();if(r.status!=="connected")return;const i=xV(r.currentAccount,s);i?t.setKey("currentAccount",i):t.set({status:"disconnected",currentAccount:null})}))}function xV(e,t){for(const s of t){for(const r of s.accounts)if(P$(e,r))return r;if(Gc(e,s)&&s.accounts[0])return s.accounts[0]}return null}function CV({$currentNetwork:e}){return function(s){e.set(s)}}function IV({$baseConnection:e,$connection:t},{storage:s,storageKey:r}){return async function(...c){return await Jh(async()=>{const{wallet:u}=t.get();if(!u)throw new Ab("No wallet is connected.");try{const{disconnect:f}=od(u,Q5);await f(...c)}catch(f){console.warn("Failed to disconnect the current wallet from the application.",f)}finally{s.removeItem(r),e.set({status:"disconnected",currentAccount:null})}})}}function RV({$baseConnection:e,$connection:t},{storage:s,storageKey:r}){return function({account:c}){const u=t.get();if(!u.wallet)throw new Ab("No wallet is connected.");if(!Gc(c,u.wallet))throw new Ob(`No account with address ${c.address} is connected to ${u.wallet.name}.`);e.setKey("currentAccount",c),j3(s,r,c,u.supportedIntents)}}function jV({$connection:e,$currentNetwork:t}){return async function({account:r,network:i,...c}){const u=Nb(e.get(),r),f=rl(i??t.get());return await I3({account:u,chain:f,featureName:Fy}).signPersonalMessage({...c,account:Mp(u),chain:f})}}function f_(e,t,s,r){const i=l8(r);let c=null;try{c=u8(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:o8(s),balanceChanges:void 0,events:void 0,objectTypes:void 0,bcs:s};return i.success?{$kind:"Transaction",Transaction:u}:{$kind:"FailedTransaction",FailedTransaction:u}}function MV({$connection:e,$currentNetwork:t},s){return async function({transaction:i,account:c,network:u,...f}){const p=e.get(),m=Nb(p,c),g=[...p.supportedIntents],y=Mp(m),b=u??t.get(),S=s(b),A=rl(b),N={toJSON:async()=>typeof i=="string"?i:(i.setSenderIfNotSet(m.address),await i.toJSON({client:S,supportedIntents:g}))},j=tp({account:m,chain:A,featureName:Gy});if(j){const C=await j.signAndExecuteTransaction({...f,account:y,transaction:N,chain:A}),W=qe(C.bytes),ce=qe(C.effects);return f_(C.digest,C.signature,W,ce)}const V=tp({account:m,chain:A,featureName:D5});if(V){const C=Zn.from(await N.toJSON()),{digest:W,rawEffects:ce,rawTransaction:ae}=await V.signAndExecuteTransactionBlock({account:y,chain:A,transactionBlock:C,options:{showRawEffects:!0,showRawInput:!0}}),[{txSignatures:[Y],intentMessage:{value:K}}]=F.SenderSignedData.parse(qe(ae));return f_(W,Y,F.TransactionData.serialize(K).toBytes(),new Uint8Array(ce))}throw new Dp(`The account ${m.address} does not support signing and executing transactions.`)}}function DV({$connection:e,$currentNetwork:t},s){return async function({transaction:i,account:c,network:u,...f}){const p=e.get(),m=Nb(p,c),g=[...p.supportedIntents],y=Mp(m),b=u??t.get(),S=s(b),A=rl(b),N={toJSON:async()=>typeof i=="string"?i:(i.setSenderIfNotSet(m.address),await i.toJSON({client:S,supportedIntents:g}))},j=tp({account:m,chain:A,featureName:zh});if(j)return await j.signTransaction({...f,transaction:N,account:y,chain:A});const V=tp({account:m,chain:A,featureName:Bk});if(V){const C=Zn.from(await N.toJSON()),{transactionBlockBytes:W,signature:ce}=await V.signTransactionBlock({transactionBlock:C,account:y,chain:A});return{bytes:W,signature:ce}}throw new Dp(`The account ${m.address} does not support signing transactions.`)}}function UV(e){return{id:"slush-web-wallet-initializer",async initialize(){const t=await pV(e?.appName||BV(),{origin:e?.origin,metadataApiUrl:e?.metadataApiUrl});if(!t)throw new Error("Registration un-successful.");return{unregister:t.unregister}}}}function BV(){return document.querySelector('meta[name="application-name"]')?.content||document.title}const hy=new Map;async function LV(e,t){hy.forEach(i=>i()),hy.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;hy.set(c.id,u.unregister)}else console.warn(`Skipping wallet initializer: "${i.reason}".`)}function zV(){return{id:"unsafe-burner-initalizer",async initialize({networks:e,getClient:t}){const s=new $V({clients:e.map(t)});return{unregister:_p().register(s)}}}}var $V=class{#e;#t=new T$;#r;constructor({clients:e}){this.#e=e.reduce((t,s)=>{const r=rl(s.network);return t[r]=s,t},{}),this.#r=new nd({address:this.#t.getPublicKey().toSuiAddress(),publicKey:this.#t.getPublicKey().toSuiBytes(),chains:this.chains,features:[zh,Gy,Fy]}),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{[Jv]:{version:"1.0.0",connect:this.#a},[Ap]:{version:"1.0.0",on:this.#s},[Fy]:{version:"1.1.0",signPersonalMessage:this.#i},[zh]:{version:"2.0.0",signTransaction:this.#o},[Gy]:{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 Zn.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=Zn.from(await e.toJSON()),c=await i.build({client:r}),u=await this.#t.signAndExecuteTransaction({transaction:i,client:r}),f=u.Transaction??u.FailedTransaction;return{bytes:st(c),signature:f.signatures[0],digest:f.digest,effects:st(f.effects.bcs)}}};function VV({autoConnect:e=!0,networks:t,createClient:s,defaultNetwork:r=t[0],enableBurnerWallet:i=!1,slushWalletConfig:c,storage:u=SV(),storageKey:f=EV,walletInitializers:p=[],autoConnectTimeout:m=5e3}){const g=yV(t,s),y=wV({defaultNetwork:r,getClient:g.getClient});function b(A){return A?g.getClient(A):y.$currentClient.get()}u||=R3(),TV(y),NV(y);const S=LV([...p,...i?[zV()]:[],...c!==null?[UV(c)]:[]],{networks:t,getClient:b});return e&&AV({networks:t,stores:y,storageKey:f,storage:u,walletsRegistered:S,timeout:m}),{networks:t,getClient:b,signTransaction:DV(y,g.getClient),signAndExecuteTransaction:MV(y,g.getClient),signPersonalMessage:jV(y),connectWallet:kV(y,t,{storage:u,storageKey:f}),disconnectWallet:IV(y,{storage:u,storageKey:f}),switchAccount:RV(y,{storage:u,storageKey:f}),switchNetwork:CV(y),stores:{$wallets:y.$compatibleWallets,$connection:y.$connection,$currentNetwork:I$(y.$currentNetwork),$currentClient:y.$currentClient}}}function PV({dAppKit:e}={}){return z$(bo(e).stores.$connection)}function al({dAppKit:e}={}){return PV({dAppKit:e}).account}const GV=new Set(["children","localName","ref","style","className"]),h_=new WeakMap,p_=(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,f,p)=>{let m=h_.get(u);m===void 0&&h_.set(u,m=new Map);let g=m.get(f);p!==void 0?g===void 0?(m.set(f,g={handleEvent:p}),u.addEventListener(f,g)):g.handleEvent=p:g!==void 0&&(m.delete(f),u.removeEventListener(f,g))})(e,c,s)},U3=({react:e,tagName:t,elementClass:s,events:r,displayName:i})=>{const c=new Set(Object.keys(r??{})),u=e.forwardRef(((f,p)=>{const m=e.useRef(new Map),g=e.useRef(null),y={},b={};for(const[S,A]of Object.entries(f))GV.has(S)?y[S==="className"?"class":S]=A:c.has(S)||S in s.prototype?b[S]=A:y[S]=A;return e.useLayoutEffect((()=>{if(g.current===null)return;const S=new Map;for(const A in b)p_(g.current,A,f[A],m.current.get(A),r),m.current.delete(A),S.set(A,f[A]);for(const[A,N]of m.current)p_(g.current,A,void 0,N,r);m.current=S})),e.useLayoutEffect((()=>{g.current?.removeAttribute("defer-hydration")}),[]),y.suppressHydrationWarning=!0,e.createElement(t,{...y,ref:e.useCallback((S=>{g.current=S,typeof p=="function"?p(S):p!==null&&(p.current=S)}),[p])})}));return u.displayName=i??s.name,u};var m_={},g_;function FV(){return g_||(g_=1,(function(){function e(P){var te=0;return function(){return te<P.length?{done:!1,value:P[te++]}:{done:!0}}}var t=typeof Object.defineProperties=="function"?Object.defineProperty:function(P,te,de){return P==Array.prototype||P==Object.prototype||(P[te]=de.value),P};function s(P){P=[typeof globalThis=="object"&&globalThis,P,typeof window=="object"&&window,typeof self=="object"&&self,typeof Ec=="object"&&Ec];for(var te=0;te<P.length;++te){var de=P[te];if(de&&de.Math==Math)return de}throw Error("Cannot find global object")}var r=s(this);function i(P,te){if(te)e:{var de=r;P=P.split(".");for(var he=0;he<P.length-1;he++){var ue=P[he];if(!(ue in de))break e;de=de[ue]}P=P[P.length-1],he=de[P],te=te(he),te!=he&&te!=null&&t(de,P,{configurable:!0,writable:!0,value:te})}}i("Symbol",function(P){function te(ue){if(this instanceof te)throw new TypeError("Symbol is not a constructor");return new de("jscomp_symbol_"+(ue||"")+"_"+he++,ue)}function de(ue,ze){this.l=ue,t(this,"description",{configurable:!0,writable:!0,value:ze})}if(P)return P;de.prototype.toString=function(){return this.l};var he=0;return te}),i("Symbol.iterator",function(P){if(P)return P;P=Symbol("Symbol.iterator");for(var te="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),de=0;de<te.length;de++){var he=r[te[de]];typeof he=="function"&&typeof he.prototype[P]!="function"&&t(he.prototype,P,{configurable:!0,writable:!0,value:function(){return c(e(this))}})}return P});function c(P){return P={next:P},P[Symbol.iterator]=function(){return this},P}function u(P){var te=typeof Symbol<"u"&&Symbol.iterator&&P[Symbol.iterator];return te?te.call(P):{next:e(P)}}function f(P){if(!(P instanceof Array)){P=u(P);for(var te,de=[];!(te=P.next()).done;)de.push(te.value);P=de}return P}var p=typeof Object.create=="function"?Object.create:function(P){function te(){}return te.prototype=P,new te},m=(function(){function P(){function de(){}return Reflect.construct(de,[],function(){}),new de instanceof de}if(typeof Reflect<"u"&&Reflect.construct){if(P())return Reflect.construct;var te=Reflect.construct;return function(de,he,ue){return de=te(de,he),ue&&Reflect.setPrototypeOf(de,ue.prototype),de}}return function(de,he,ue){return ue===void 0&&(ue=de),ue=p(ue.prototype||Object.prototype),Function.prototype.apply.call(de,ue,he)||ue}})(),g;if(typeof Object.setPrototypeOf=="function")g=Object.setPrototypeOf;else{var y;e:{var b={a:!0},S={};try{S.__proto__=b,y=S.a;break e}catch{}y=!1}g=y?function(P,te){if(P.__proto__=te,P.__proto__!==te)throw new TypeError(P+" is not extensible");return P}:null}var A=g,N=window,j;if(((j=N.CustomElementRegistryPolyfill)==null?void 0:j.formAssociated)===void 0){var V={};N.CustomElementRegistryPolyfill=(V.formAssociated=new Set,V)}var C=window.HTMLElement,W=window.customElements.define,ce=window.customElements.get,ae=window.customElements,Y=new WeakMap,K=new WeakMap,w=new WeakMap,O=new WeakMap;function x(){var P;this.promise=new Promise(function(te){P=te}),this.resolve=P}function G(){this.h=new Map,this.m=new Map,this.j=new Map,this.i=new Map}G.prototype.define=function(P,te){if(P=P.toLowerCase(),this.h.get(P)!==void 0)throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "`+P+'" 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,he=new Set(te.observedAttributes||[]);M(te,he,de);var ue=ce.call(ae,P),ze,Le,Mt=(Le=(ze=ue)==null?void 0:ze.s)!=null?Le:te.formAssociated||N.CustomElementRegistryPolyfill.formAssociated.has(P);if(Mt&&N.CustomElementRegistryPolyfill.formAssociated.add(P),Mt!=te.formAssociated)try{te.formAssociated=Mt}catch{}if(de={tagName:P,g:te,connectedCallback:te.prototype.connectedCallback,disconnectedCallback:te.prototype.disconnectedCallback,adoptedCallback:te.prototype.adoptedCallback,attributeChangedCallback:de,formAssociated:Mt,formAssociatedCallback:te.prototype.formAssociatedCallback,formDisabledCallback:te.prototype.formDisabledCallback,formResetCallback:te.prototype.formResetCallback,formStateRestoreCallback:te.prototype.formStateRestoreCallback,observedAttributes:he},this.h.set(P,de),this.m.set(te,de),ue||(ue=$(P),W.call(ae,P,ue)),this===window.customElements&&(w.set(te,de),de.o=ue),ue=this.i.get(P))for(this.i.delete(P),ue=u(ue),he=ue.next();!he.done;he=ue.next())he=he.value,K.delete(he),X(he,de,!0);return ue=this.j.get(P),ue!==void 0&&(ue.resolve(te),this.j.delete(P)),te},G.prototype.upgrade=function(P){for(var te=[],de=0;de<arguments.length;++de)te[de]=arguments[de];ie.push(this),ae.upgrade.apply(ae,f(te)),ie.pop()},G.prototype.get=function(P){var te;return(te=this.h.get(P))==null?void 0:te.g},G.prototype.whenDefined=function(P){var te=this.h.get(P);return te!==void 0?Promise.resolve(te.g):(te=this.j.get(P),te===void 0&&(te=new x,this.j.set(P,te)),te.promise)};function U(P,te,de,he){var ue=P.i.get(de);ue||P.i.set(de,ue=new Set),he?ue.add(te):ue.delete(te)}var H;window.HTMLElement=function(){var P=H;if(P)return H=void 0,P;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 P=Reflect.construct(C,[],te.o),Object.setPrototypeOf(P,this.constructor.prototype),Y.set(P,te),P},window.HTMLElement.prototype=C.prototype;function $(P){function te(){var de=Reflect.construct(C,[],this.constructor);Object.setPrototypeOf(de,HTMLElement.prototype);e:{var he=de.getRootNode();if(!(he===document||he instanceof ShadowRoot)){if(he=ie[ie.length-1],he instanceof CustomElementRegistry){var ue=he;break e}he=he.getRootNode(),he===document||he instanceof ShadowRoot||(he=((ue=O.get(he))==null?void 0:ue.getRootNode())||document)}ue=he.registry}return ue=ue||window.customElements,(he=ue.h.get(P))?X(de,he):K.set(de,ue),de}return r.Object.defineProperty(te,"formAssociated",{configurable:!0,enumerable:!0,get:function(){return N.CustomElementRegistryPolyfill.formAssociated.has(P)}}),te.prototype.connectedCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];I(this),(ue=Y.get(this))?ue.connectedCallback&&ue.connectedCallback.apply(this,he):U(K.get(this),this,P,!0)},te.prototype.disconnectedCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];(ue=Y.get(this))?ue.disconnectedCallback&&ue.disconnectedCallback.apply(this,he):U(K.get(this),this,P,!1)},te.prototype.adoptedCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];var ze,Le;(ze=Y.get(this))==null||(Le=ze.adoptedCallback)==null||Le.apply(this,he)},te.prototype.formAssociatedCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];if(ue=Y.get(this),ue!=null&&ue.formAssociated){var ze;ue==null||(ze=ue.formAssociatedCallback)==null||ze.apply(this,he)}},te.prototype.formDisabledCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];if(ue=Y.get(this),ue!=null&&ue.formAssociated){var ze;ue==null||(ze=ue.formDisabledCallback)==null||ze.apply(this,he)}},te.prototype.formResetCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];if(ue=Y.get(this),ue!=null&&ue.formAssociated){var ze;ue==null||(ze=ue.formResetCallback)==null||ze.apply(this,he)}},te.prototype.formStateRestoreCallback=function(de){for(var he=[],ue=0;ue<arguments.length;++ue)he[ue]=arguments[ue];if(ue=Y.get(this),ue!=null&&ue.formAssociated){var ze;ue==null||(ze=ue.formStateRestoreCallback)==null||ze.apply(this,he)}},te}window.CustomElementRegistry=G;function M(P,te,de){if(te.size!==0&&de!==void 0){var he=P.prototype.setAttribute;he&&(P.prototype.setAttribute=function(Le,Mt){if(I(this),Le=Le.toLowerCase(),te.has(Le)){var Es=this.getAttribute(Le);he.call(this,Le,Mt),de.call(this,Le,Es,Mt)}else he.call(this,Le,Mt)});var ue=P.prototype.removeAttribute;ue&&(P.prototype.removeAttribute=function(Le){if(I(this),Le=Le.toLowerCase(),te.has(Le)){var Mt=this.getAttribute(Le);ue.call(this,Le),de.call(this,Le,Mt,null)}else ue.call(this,Le)});var ze=P.prototype.toggleAttribute;ze&&(P.prototype.toggleAttribute=function(Le,Mt){if(I(this),Le=Le.toLowerCase(),te.has(Le)){var Es=this.getAttribute(Le);ze.call(this,Le,Mt),Mt=this.getAttribute(Le),Es!==Mt&&de.call(this,Le,Es,Mt)}else ze.call(this,Le,Mt)})}}var k;document.readyState==="loading"&&(k=new Set,document.addEventListener("readystatechange",function(){k.forEach(function(P){return D(P,Y.get(P))})},{once:!0}));function I(P){var te;(te=k)!=null&&te.has(P)&&D(P,Y.get(P))}function D(P,te){var de;(de=k)==null||de.delete(P),te.attributeChangedCallback&&te.observedAttributes.forEach(function(he){P.hasAttribute(he)&&te.attributeChangedCallback.call(P,he,null,P.getAttribute(he))})}function L(P){var te=Object.getPrototypeOf(P);if(te!==window.HTMLElement)return te===C?Object.setPrototypeOf(P,window.HTMLElement):L(te)}function X(P,te,de){de=de===void 0?!1:de,Object.setPrototypeOf(P,te.g.prototype),Y.set(P,te),H=P;try{new te.g}catch{L(te.g),new te.g}te.attributeChangedCallback&&(k===void 0||P.hasAttributes()?D(P,te):k.add(P)),de&&te.connectedCallback&&P.isConnected&&te.connectedCallback.call(P)}var z=Element.prototype.attachShadow;Element.prototype.attachShadow=function(P,te){for(var de=[],he=1;he<arguments.length;++he)de[he-1]=arguments[he];var ue=Object.assign({},P);return he=P.customElements,he=P.registry===void 0?he:P.registry,ue=(delete ue.customElements,delete ue.registry,ue),de=z.call.apply(z,[this,ue].concat(f(de))),he!==void 0&&(de.customElements=de.registry=he),de};var ie=[document];function fe(P,te,de){var he=(de?Object.getPrototypeOf(de):P.prototype)[te];P.prototype[te]=function(ue){for(var ze=[],Le=0;Le<arguments.length;++Le)ze[Le]=arguments[Le];return ie.push(this),ze=he.apply(de||this,ze),ze!==void 0&&O.set(ze,this),ie.pop(),ze}}fe(ShadowRoot,"createElement",document),fe(ShadowRoot,"createElementNS",document),fe(ShadowRoot,"importNode",document),fe(Element,"insertAdjacentHTML");function R(P){var te=Object.getOwnPropertyDescriptor(P.prototype,"innerHTML");Object.defineProperty(P.prototype,"innerHTML",Object.assign({},te,{set:function(de){ie.push(this),te.set.call(this,de),ie.pop()}}))}if(R(Element),R(ShadowRoot),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){var J=new WeakMap,le=HTMLElement.prototype.attachInternals,pe=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(P){for(var te=[],de=0;de<arguments.length;++de)te[de]=arguments[de];return te=le.call.apply(le,[this].concat(f(te))),J.set(te,this),te},pe.forEach(function(P){var te=window.ElementInternals.prototype,de=te[P];te[P]=function(he){for(var ue=[],ze=0;ze<arguments.length;++ze)ue[ze]=arguments[ze];if(ze=J.get(this),Y.get(ze).formAssociated===!0)return de?.call.apply(de,[this].concat(f(ue)));throw new DOMException("Failed to execute "+de+" on 'ElementInternals': The target element is not a form-associated custom element.")}});var Te=function(P){var te=m(Array,[].concat(f(P)),this.constructor);return te.l=P,te},Oe=Te,Ae=Array;if(Oe.prototype=p(Ae.prototype),Oe.prototype.constructor=Oe,A)A(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 P;return((P=this.l.find(function(te){return te.checked===!0}))==null?void 0:P.value)||""}});var Pe=function(P){var te=this,de=new Map;P.forEach(function(he,ue){var ze=he.getAttribute("name"),Le=de.get(ze)||[];te[+ue]=he,Le.push(he),de.set(ze,Le)}),this.length=P.length,de.forEach(function(he,ue){he&&ue!=="length"&&ue!=="item"&&ue!=="namedItem"&&(te[ue]=he.length===1?he[0]:new Te(he))})};Pe.prototype.item=function(P){var te;return(te=this[P])!=null?te:null},Pe.prototype[Symbol.iterator]=function(){throw Error("Method not implemented.")},Pe.prototype.namedItem=function(P){var te;return(te=this[P])!=null?te:null};var at=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){var P=at.get.call(this),te=[];P=u(P);for(var de=P.next();!de.done;de=P.next()){de=de.value;var he=Y.get(de);he&&he.formAssociated!==!0||te.push(de)}return new Pe(te)}})}}).call(typeof globalThis=="object"?globalThis:window)),m_}FV();const _h=globalThis,xb=_h.ShadowRoot&&(_h.ShadyCSS===void 0||_h.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Cb=Symbol(),y_=new WeakMap;let B3=class{constructor(t,s,r){if(this._$cssResult$=!0,r!==Cb)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(xb&&t===void 0){const r=s!==void 0&&s.length===1;r&&(t=y_.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&y_.set(s,t))}return t}toString(){return this.cssText}};const HV=e=>new B3(typeof e=="string"?e:e+"",void 0,Cb),ga=(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 B3(s,e,Cb)},L3=(e,t)=>{if(xb)e.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of t){const r=document.createElement("style"),i=_h.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=s.cssText,e.appendChild(r)}},v_=xb?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(const r of t.cssRules)s+=r.cssText;return HV(s)})(e):e;const{is:qV,defineProperty:ZV,getOwnPropertyDescriptor:YV,getOwnPropertyNames:WV,getOwnPropertySymbols:XV,getPrototypeOf:JV}=Object,Up=globalThis,b_=Up.trustedTypes,KV=b_?b_.emptyScript:"",QV=Up.reactiveElementPolyfillSupport,Cu=(e,t)=>e,np={toAttribute(e,t){switch(t){case Boolean:e=e?KV: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}},Bp=(e,t)=>!qV(e,t),w_={attribute:!0,type:String,converter:np,reflect:!1,useDefault:!1,hasChanged:Bp};Symbol.metadata??=Symbol("metadata"),Up.litPropertyMetadata??=new WeakMap;let wc=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=w_){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&&ZV(this.prototype,t,i)}}static getPropertyDescriptor(t,s,r){const{get:i,set:c}=YV(this.prototype,t)??{get(){return this[s]},set(u){this[s]=u}};return{get:i,set(u){const f=i?.call(this);c?.call(this,u),this.requestUpdate(t,f,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w_}static _$Ei(){if(this.hasOwnProperty(Cu("elementProperties")))return;const t=JV(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Cu("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Cu("properties"))){const s=this.properties,r=[...WV(s),...XV(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(v_(i))}else t!==void 0&&s.push(v_(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 L3(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:np).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:np;this._$Em=i;const f=u.fromAttribute(s,c.type);this[i]=f??this._$Ej?.get(i)??f,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??Bp)(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,f=this[i];u!==!0||this._$AL.has(i)||f===void 0||this.C(i,void 0,c,f)}}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){}};wc.elementStyles=[],wc.shadowRootOptions={mode:"open"},wc[Cu("elementProperties")]=new Map,wc[Cu("finalized")]=new Map,QV?.({ReactiveElement:wc}),(Up.reactiveElementVersions??=[]).push("2.1.2");const Ib=globalThis,T_=e=>e,sp=Ib.trustedTypes,E_=sp?sp.createPolicy("lit-html",{createHTML:e=>e}):void 0,z3="$lit$",ri=`lit$${Math.random().toFixed(9).slice(2)}$`,$3="?"+ri,eP=`<${$3}>`,fo=document,Vu=()=>fo.createComment(""),Pu=e=>e===null||typeof e!="object"&&typeof e!="function",Rb=Array.isArray,tP=e=>Rb(e)||typeof e?.[Symbol.iterator]=="function",py=`[
13
13
  \f\r]`,du=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,S_=/-->/g,__=/>/g,Hi=RegExp(`>|${py}(?:([^\\s"'>=/]+)(${py}*=${py}*(?:[^
14
14
  \f\r"'\`<>=]|("|')|))|$)`,"g"),k_=/'/g,A_=/"/g,V3=/^(?:script|style|textarea|title)$/i,nP=e=>(t,...s)=>({_$litType$:e,strings:t,values:s}),bt=nP(1),ho=Symbol.for("lit-noChange"),ln=Symbol.for("lit-nothing"),O_=new WeakMap,Qi=fo.createTreeWalker(fo,129);function P3(e,t){if(!Rb(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return E_!==void 0?E_.createHTML(t):t}const sP=(e,t)=>{const s=e.length-1,r=[];let i,c=t===2?"<svg>":t===3?"<math>":"",u=du;for(let f=0;f<s;f++){const p=e[f];let m,g,y=-1,b=0;for(;b<p.length&&(u.lastIndex=b,g=u.exec(p),g!==null);)b=u.lastIndex,u===du?g[1]==="!--"?u=S_:g[1]!==void 0?u=__:g[2]!==void 0?(V3.test(g[2])&&(i=RegExp("</"+g[2],"g")),u=Hi):g[3]!==void 0&&(u=Hi):u===Hi?g[0]===">"?(u=i??du,y=-1):g[1]===void 0?y=-2:(y=u.lastIndex-g[2].length,m=g[1],u=g[3]===void 0?Hi:g[3]==='"'?A_:k_):u===A_||u===k_?u=Hi:u===S_||u===__?u=du:(u=Hi,i=void 0);const S=u===Hi&&e[f+1].startsWith("/>")?" ":"";c+=u===du?p+eP:y>=0?(r.push(m),p.slice(0,y)+z3+p.slice(y)+ri+S):p+ri+(y===-2?f:S)}return[P3(e,c+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};let uv=class G3{constructor({strings:t,_$litType$:s},r){let i;this.parts=[];let c=0,u=0;const f=t.length-1,p=this.parts,[m,g]=sP(t,s);if(this.el=G3.createElement(m,r),Qi.currentNode=this.el.content,s===2||s===3){const y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(i=Qi.nextNode())!==null&&p.length<f;){if(i.nodeType===1){if(i.hasAttributes())for(const y of i.getAttributeNames())if(y.endsWith(z3)){const b=g[u++],S=i.getAttribute(y).split(ri),A=/([.?@])?(.*)/.exec(b);p.push({type:1,index:c,name:A[2],strings:S,ctor:A[1]==="."?aP:A[1]==="?"?iP:A[1]==="@"?oP:Lp}),i.removeAttribute(y)}else y.startsWith(ri)&&(p.push({type:6,index:c}),i.removeAttribute(y));if(V3.test(i.tagName)){const y=i.textContent.split(ri),b=y.length-1;if(b>0){i.textContent=sp?sp.emptyScript:"";for(let S=0;S<b;S++)i.append(y[S],Vu()),Qi.nextNode(),p.push({type:2,index:++c});i.append(y[b],Vu())}}}else if(i.nodeType===8)if(i.data===$3)p.push({type:2,index:c});else{let y=-1;for(;(y=i.data.indexOf(ri,y+1))!==-1;)p.push({type:7,index:c}),y+=ri.length-1}c++}}static createElement(t,s){const r=fo.createElement("template");return r.innerHTML=t,r}};function Fc(e,t,s=e,r){if(t===ho)return t;let i=r!==void 0?s._$Co?.[r]:s._$Cl;const c=Pu(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=Fc(e,i._$AS(e,t.values),i,r)),t}class rP{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??fo).importNode(s,!0);Qi.currentNode=i;let c=Qi.nextNode(),u=0,f=0,p=r[0];for(;p!==void 0;){if(u===p.index){let m;p.type===2?m=new cd(c,c.nextSibling,this,t):p.type===1?m=new p.ctor(c,p.name,p.strings,this,t):p.type===6&&(m=new cP(c,this,t)),this._$AV.push(m),p=r[++f]}u!==p?.index&&(c=Qi.nextNode(),u++)}return Qi.currentNode=fo,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 cd{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,r,i){this.type=2,this._$AH=ln,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=Fc(this,t,s),Pu(t)?t===ln||t==null||t===""?(this._$AH!==ln&&this._$AR(),this._$AH=ln):t!==this._$AH&&t!==ho&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):tP(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!==ln&&Pu(this._$AH)?this._$AA.nextSibling.data=t:this.T(fo.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=uv.createElement(P3(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(s);else{const c=new rP(i,this),u=c.u(this.options);c.p(s),this.T(u),this._$AH=c}}_$AC(t){let s=O_.get(t.strings);return s===void 0&&O_.set(t.strings,s=new uv(t)),s}k(t){Rb(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 cd(this.O(Vu()),this.O(Vu()),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=T_(t).nextSibling;T_(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class Lp{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,r,i,c){this.type=1,this._$AH=ln,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=ln}_$AI(t,s=this,r,i){const c=this.strings;let u=!1;if(c===void 0)t=Fc(this,t,s,0),u=!Pu(t)||t!==this._$AH&&t!==ho,u&&(this._$AH=t);else{const f=t;let p,m;for(t=c[0],p=0;p<c.length-1;p++)m=Fc(this,f[r+p],s,p),m===ho&&(m=this._$AH[p]),u||=!Pu(m)||m!==this._$AH[p],m===ln?t=ln:t!==ln&&(t+=(m??"")+c[p+1]),this._$AH[p]=m}u&&!i&&this.j(t)}j(t){t===ln?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}let aP=class extends Lp{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ln?void 0:t}};class iP extends Lp{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ln)}}let oP=class extends Lp{constructor(t,s,r,i,c){super(t,s,r,i,c),this.type=5}_$AI(t,s=this){if((t=Fc(this,t,s,0)??ln)===ho)return;const r=this._$AH,i=t===ln&&r!==ln||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,c=t!==ln&&(r===ln||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 cP{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){Fc(this,t)}}const lP=Ib.litHtmlPolyfillSupport;lP?.(uv,cd),(Ib.litHtmlVersions??=[]).push("3.3.3");const uP=(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 cd(t.insertBefore(Vu(),c),c,void 0,s??{})}return i._$AI(e),i};const jb=globalThis;let qn=class extends wc{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=uP(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ho}};qn._$litElement$=!0,qn.finalized=!0,jb.litElementHydrateSupport?.({LitElement:qn});const dP=jb.litElementPolyfillSupport;dP?.({LitElement:qn});(jb.litElementVersions??=[]).push("4.2.2");const F3=e=>(t,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};const fP={attribute:!0,type:String,converter:np,reflect:!1,hasChanged:Bp},hP=(e=fP,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(f){const p=t.get.call(this);t.set.call(this,f),this.requestUpdate(u,p,e,!0,f)},init(f){return f!==void 0&&this.C(u,void 0,e,f),f}}}if(r==="setter"){const{name:u}=s;return function(f){const p=this[u];t.call(this,f),this.requestUpdate(u,p,e,!0,f)}}throw Error("Unsupported decorator location: "+r)};function hn(e){return(t,s)=>typeof s=="object"?hP(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 Mb(e){return hn({...e,state:!0,attribute:!1})}const pP=(e,t,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(e,t,s),s);function zp(e,t){return(s,r,i)=>{const c=u=>u.renderRoot?.querySelector(e)??null;return pP(s,r,{get(){return c(this)}})}}var my={},fu={},N_;function mP(){if(N_)return fu;N_=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.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 fu.StoreController=e,fu}var hu={},x_;function Db(){if(x_)return hu;x_=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.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 hu.MultiStoreController=e,hu}var pu={},C_;function gP(){if(C_)return pu;C_=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.useStores=void 0;const e=Db();function t(...s){return r=>class extends r{constructor(...i){super(...i),new e.MultiStoreController(this,s)}}}return pu.useStores=t,pu}var mu={},I_;function yP(){if(I_)return mu;I_=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.withStores=void 0;const e=Db(),t=(s,r)=>class extends s{constructor(...c){super(...c),new e.MultiStoreController(this,r)}};return mu.withStores=t,mu}var R_;function vP(){return R_||(R_=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withStores=e.useStores=e.MultiStoreController=e.StoreController=void 0;var t=mP();Object.defineProperty(e,"StoreController",{enumerable:!0,get:function(){return t.StoreController}});var s=Db();Object.defineProperty(e,"MultiStoreController",{enumerable:!0,get:function(){return s.MultiStoreController}});var r=gP();Object.defineProperty(e,"useStores",{enumerable:!0,get:function(){return r.useStores}});var i=yP();Object.defineProperty(e,"withStores",{enumerable:!0,get:function(){return i.withStores}})})(my)),my}var bP=vP();function $p(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,f])=>t.registry.define(u,f))));const c=this.renderOptions.creationScope=this.attachShadow({...i,customElements:t.registry});return L3(c,this.constructor.elementStyles),c}}}const wP={ATTRIBUTE:1},TP=e=>(...t)=>({_$litDirective$:e,values:t});let EP=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 j_=TP(class extends EP{constructor(e){if(super(e),e.type!==wP.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 ho}}),rp=Math.min,so=Math.max,ap=Math.round,eh=Math.floor,ua=e=>({x:e,y:e}),SP={left:"right",right:"left",bottom:"top",top:"bottom"};function _P(e,t,s){return so(e,rp(t,s))}function Vp(e,t){return typeof e=="function"?e(t):e}function Hc(e){return e.split("-")[0]}function Pp(e){return e.split("-")[1]}function H3(e){return e==="x"?"y":"x"}function q3(e){return e==="y"?"height":"width"}function ci(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Z3(e){return H3(ci(e))}function kP(e,t,s){s===void 0&&(s=!1);const r=Pp(e),i=Z3(e),c=q3(i);let u=i==="x"?r===(s?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=ip(u)),[u,ip(u)]}function AP(e){const t=ip(e);return[dv(e),t,dv(t)]}function dv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const M_=["left","right"],D_=["right","left"],OP=["top","bottom"],NP=["bottom","top"];function xP(e,t,s){switch(e){case"top":case"bottom":return s?t?D_:M_:t?M_:D_;case"left":case"right":return t?OP:NP;default:return[]}}function CP(e,t,s,r){const i=Pp(e);let c=xP(Hc(e),s==="start",r);return i&&(c=c.map(u=>u+"-"+i),t&&(c=c.concat(c.map(dv)))),c}function ip(e){const t=Hc(e);return SP[t]+e.slice(t.length)}function IP(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 RP(e){return typeof e!="number"?IP(e):{top:e,right:e,bottom:e,left:e}}function op(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 U_(e,t,s){let{reference:r,floating:i}=e;const c=ci(t),u=Z3(t),f=q3(u),p=Hc(t),m=c==="y",g=r.x+r.width/2-i.width/2,y=r.y+r.height/2-i.height/2,b=r[f]/2-i[f]/2;let S;switch(p){case"top":S={x:g,y:r.y-i.height};break;case"bottom":S={x:g,y:r.y+r.height};break;case"right":S={x:r.x+r.width,y};break;case"left":S={x:r.x-i.width,y};break;default:S={x:r.x,y:r.y}}const A=Pp(t);return A&&(S[u]+=b*(A==="end"?1:-1)*(s&&m?-1:1)),S}async function jP(e,t){var s;t===void 0&&(t={});const{x:r,y:i,platform:c,rects:u,elements:f,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:b=!1,padding:S=0}=Vp(t,e),A=RP(S),j=f[b?y==="floating"?"reference":"floating":y],V=op(await c.getClippingRect({element:(s=await(c.isElement==null?void 0:c.isElement(j)))==null||s?j:j.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:m,rootBoundary:g,strategy:p})),C=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(f.floating)),ce=await(c.isElement==null?void 0:c.isElement(W))&&await(c.getScale==null?void 0:c.getScale(W))||{x:1,y:1},ae=op(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:C,offsetParent:W,strategy:p}):C);return{top:(V.top-ae.top+A.top)/ce.y,bottom:(ae.bottom-V.bottom+A.bottom)/ce.y,left:(V.left-ae.left+A.left)/ce.x,right:(ae.right-V.right+A.right)/ce.x}}const MP=50,DP=async(e,t,s)=>{const{placement:r="bottom",strategy:i="absolute",middleware:c=[],platform:u}=s,f=u.detectOverflow?u:{...u,detectOverflow:jP},p=await(u.isRTL==null?void 0:u.isRTL(t));let m=await u.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y}=U_(m,r,p),b=r,S=0;const A={};for(let N=0;N<c.length;N++){const j=c[N];if(!j)continue;const{name:V,fn:C}=j,{x:W,y:ce,data:ae,reset:Y}=await C({x:g,y,initialPlacement:r,placement:b,strategy:i,middlewareData:A,rects:m,platform:f,elements:{reference:e,floating:t}});g=W??g,y=ce??y,A[V]={...A[V],...ae},Y&&S<MP&&(S++,typeof Y=="object"&&(Y.placement&&(b=Y.placement),Y.rects&&(m=Y.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:i}):Y.rects),{x:g,y}=U_(m,b,p)),N=-1)}return{x:g,y,placement:b,strategy:i,middlewareData:A}},UP=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:f,platform:p,elements:m}=t,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:N=!0,...j}=Vp(e,t);if((s=c.arrow)!=null&&s.alignmentOffset)return{};const V=Hc(i),C=ci(f),W=Hc(f)===f,ce=await(p.isRTL==null?void 0:p.isRTL(m.floating)),ae=b||(W||!N?[ip(f)]:AP(f)),Y=A!=="none";!b&&Y&&ae.push(...CP(f,N,A,ce));const K=[f,...ae],w=await p.detectOverflow(t,j),O=[];let x=((r=c.flip)==null?void 0:r.overflows)||[];if(g&&O.push(w[V]),y){const $=kP(i,u,ce);O.push(w[$[0]],w[$[1]])}if(x=[...x,{placement:i,overflows:O}],!O.every($=>$<=0)){var G,U;const $=(((G=c.flip)==null?void 0:G.index)||0)+1,M=K[$];if(M&&(!(y==="alignment"?C!==ci(M):!1)||x.every(D=>ci(D.placement)===C?D.overflows[0]>0:!0)))return{data:{index:$,overflows:x},reset:{placement:M}};let k=(U=x.filter(I=>I.overflows[0]<=0).sort((I,D)=>I.overflows[1]-D.overflows[1])[0])==null?void 0:U.placement;if(!k)switch(S){case"bestFit":{var H;const I=(H=x.filter(D=>{if(Y){const L=ci(D.placement);return L===C||L==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(L=>L>0).reduce((L,X)=>L+X,0)]).sort((D,L)=>D[1]-L[1])[0])==null?void 0:H[0];I&&(k=I);break}case"initialPlacement":k=f;break}if(i!==k)return{reset:{placement:k}}}return{}}}},BP=new Set(["left","top"]);async function LP(e,t){const{placement:s,platform:r,elements:i}=e,c=await(r.isRTL==null?void 0:r.isRTL(i.floating)),u=Hc(s),f=Pp(s),p=ci(s)==="y",m=BP.has(u)?-1:1,g=c&&p?-1:1,y=Vp(t,e);let{mainAxis:b,crossAxis:S,alignmentAxis:A}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return f&&typeof A=="number"&&(S=f==="end"?A*-1:A),p?{x:S*g,y:b*m}:{x:b*m,y:S*g}}const zP=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:f}=t,p=await LP(t,e);return u===((s=f.offset)==null?void 0:s.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:i+p.x,y:c+p.y,data:{...p,placement:u}}}}},$P=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:f=!1,limiter:p={fn:C=>{let{x:W,y:ce}=C;return{x:W,y:ce}}},...m}=Vp(e,t),g={x:s,y:r},y=await c.detectOverflow(t,m),b=ci(i),S=H3(b);let A=g[S],N=g[b];const j=(C,W)=>_P(W+y[C==="y"?"top":"left"],W,W-y[C==="y"?"bottom":"right"]);u&&(A=j(S,A)),f&&(N=j(b,N));const V=p.fn({...t,[S]:A,[b]:N});return{...V,data:{x:V.x-s,y:V.y-r,enabled:{[S]:u,[b]:f}}}}}};function Gp(){return typeof window<"u"}function il(e){return Y3(e)?(e.nodeName||"").toLowerCase():"#document"}function as(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ya(e){var t;return(t=(Y3(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Y3(e){return Gp()?e instanceof Node||e instanceof as(e).Node:!1}function Cr(e){return Gp()?e instanceof Element||e instanceof as(e).Element:!1}function vi(e){return Gp()?e instanceof HTMLElement||e instanceof as(e).HTMLElement:!1}function B_(e){return!Gp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof as(e).ShadowRoot}function Fp(e){const{overflow:t,overflowX:s,overflowY:r,display:i}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+s)&&i!=="inline"&&i!=="contents"}function VP(e){return/^(table|td|th)$/.test(il(e))}function Hp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const PP=/transform|translate|scale|rotate|perspective|filter/,GP=/paint|layout|strict|content/,qi=e=>!!e&&e!=="none";let gy;function Ub(e){const t=Cr(e)?Ir(e):e;return qi(t.transform)||qi(t.translate)||qi(t.scale)||qi(t.rotate)||qi(t.perspective)||!Bb()&&(qi(t.backdropFilter)||qi(t.filter))||PP.test(t.willChange||"")||GP.test(t.contain||"")}function FP(e){let t=po(e);for(;vi(t)&&!Gu(t);){if(Ub(t))return t;if(Hp(t))return null;t=po(t)}return null}function Bb(){return gy==null&&(gy=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gy}function Gu(e){return/^(html|body|#document)$/.test(il(e))}function Ir(e){return as(e).getComputedStyle(e)}function qp(e){return Cr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function po(e){if(il(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B_(e)&&e.host||ya(e);return B_(t)?t.host:t}function W3(e){const t=po(e);return Gu(t)?(e.ownerDocument||e).body:vi(t)&&Fp(t)?t:W3(t)}function Fu(e,t,s){var r;t===void 0&&(t=[]),s===void 0&&(s=!0);const i=W3(e),c=i===((r=e.ownerDocument)==null?void 0:r.body),u=as(i);if(c){const f=fv(u);return t.concat(u,u.visualViewport||[],Fp(i)?i:[],f&&s?Fu(f):[])}else return t.concat(i,Fu(i,[],s))}function fv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function X3(e){const t=Ir(e);let s=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=vi(e),c=i?e.offsetWidth:s,u=i?e.offsetHeight:r,f=ap(s)!==c||ap(r)!==u;return f&&(s=c,r=u),{width:s,height:r,$:f}}function Lb(e){return Cr(e)?e:e.contextElement}function Oc(e){const t=Lb(e);if(!vi(t))return ua(1);const s=t.getBoundingClientRect(),{width:r,height:i,$:c}=X3(t);let u=(c?ap(s.width):s.width)/r,f=(c?ap(s.height):s.height)/i;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const HP=ua(0);function J3(e){const t=as(e);return!Bb()||!t.visualViewport?HP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qP(e,t,s){return t===void 0&&(t=!1),!!s&&t&&s===as(e)}function mo(e,t,s,r){t===void 0&&(t=!1),s===void 0&&(s=!1);const i=e.getBoundingClientRect(),c=Lb(e);let u=ua(1);t&&(r?Cr(r)&&(u=Oc(r)):u=Oc(e));const f=qP(c,s,r)?J3(c):ua(0);let p=(i.left+f.x)/u.x,m=(i.top+f.y)/u.y,g=i.width/u.x,y=i.height/u.y;if(c&&r){const b=as(c),S=Cr(r)?as(r):r;let A=b,N=fv(A);for(;N&&S!==A;){const j=Oc(N),V=N.getBoundingClientRect(),C=Ir(N),W=V.left+(N.clientLeft+parseFloat(C.paddingLeft))*j.x,ce=V.top+(N.clientTop+parseFloat(C.paddingTop))*j.y;p*=j.x,m*=j.y,g*=j.x,y*=j.y,p+=W,m+=ce,A=as(N),N=fv(A)}}return op({width:g,height:y,x:p,y:m})}function Zp(e,t){const s=qp(e).scrollLeft;return t?t.left+s:mo(ya(e)).left+s}function K3(e,t){const s=e.getBoundingClientRect(),r=s.left+t.scrollLeft-Zp(e,s),i=s.top+t.scrollTop;return{x:r,y:i}}function ZP(e){let{elements:t,rect:s,offsetParent:r,strategy:i}=e;const c=i==="fixed",u=ya(r),f=t?Hp(t.floating):!1;if(r===u||f&&c)return s;let p={scrollLeft:0,scrollTop:0},m=ua(1);const g=ua(0),y=vi(r);if((y||!c)&&((il(r)!=="body"||Fp(u))&&(p=qp(r)),y)){const S=mo(r);m=Oc(r),g.x=S.x+r.clientLeft,g.y=S.y+r.clientTop}const b=u&&!y&&!c?K3(u,p):ua(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 YP(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function WP(e){const t=qp(e),s=e.ownerDocument.body,r=so(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),i=so(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let c=-t.scrollLeft+Zp(e);const u=-t.scrollTop;return Ir(s).direction==="rtl"&&(c+=so(e.clientWidth,s.clientWidth)-r),{width:r,height:i,x:c,y:u}}const XP=25;function JP(e,t,s){s===void 0&&(s="viewport");const r=s==="layoutViewport",i=as(e),c=ya(e),u=i.visualViewport;let f=c.clientWidth,p=c.clientHeight,m=0,g=0;if(u){const b=!Bb()||t==="fixed";r?b||(m=-u.offsetLeft,g=-u.offsetTop):(f=u.width,p=u.height,b&&(m=u.offsetLeft,g=u.offsetTop))}if(Zp(c)<=0){const b=c.ownerDocument,S=b.body,A=getComputedStyle(S),N=b.compatMode==="CSS1Compat"&&parseFloat(A.marginLeft)+parseFloat(A.marginRight)||0,j=Math.abs(c.clientWidth-S.clientWidth-N),V=getComputedStyle(c).scrollbarGutter==="stable both-edges"?j/2:j;V<=XP&&(f-=V)}return{width:f,height:p,x:m,y:g}}function KP(e,t){const s=mo(e,!0,t==="fixed"),r=s.top+e.clientTop,i=s.left+e.clientLeft,c=Oc(e),u=e.clientWidth*c.x,f=e.clientHeight*c.y,p=i*c.x,m=r*c.y;return{width:u,height:f,x:p,y:m}}function L_(e,t,s){let r;if(t==="viewport"||t==="layoutViewport")r=JP(e,s,t);else if(t==="document")r=WP(ya(e));else if(Cr(t))r=KP(t,s);else{const i=J3(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return op(r)}function QP(e,t){const s=t.get(e);if(s)return s;let r=Fu(e,[],!1).filter(f=>Cr(f)&&il(f)!=="body"),i=null;const c=Ir(e).position==="fixed";let u=c?po(e):e;for(;Cr(u)&&!Gu(u);){const f=Ir(u),p=Ub(u),m=i?i.position:c?"fixed":"";!p&&(m==="fixed"||m==="absolute"&&f.position==="static")?r=r.filter(y=>y!==u):i=f,u=po(u)}return t.set(e,r),r}function eG(e){let{element:t,boundary:s,rootBoundary:r,strategy:i}=e;const u=[...s==="clippingAncestors"?Hp(t)?[]:QP(t,this._c):[].concat(s),r],f=L_(t,u[0],i);let p=f.top,m=f.right,g=f.bottom,y=f.left;for(let b=1;b<u.length;b++){const S=L_(t,u[b],i);p=so(S.top,p),m=rp(S.right,m),g=rp(S.bottom,g),y=so(S.left,y)}return{width:m-y,height:g-p,x:y,y:p}}function tG(e){const{width:t,height:s}=X3(e);return{width:t,height:s}}function nG(e,t,s){const r=vi(t),i=ya(t),c=s==="fixed",u=mo(e,!0,c,t);let f={scrollLeft:0,scrollTop:0};const p=ua(0);if((r||!c)&&((il(t)!=="body"||Fp(i))&&(f=qp(t)),r)){const b=mo(t,!0,c,t);p.x=b.x+t.clientLeft,p.y=b.y+t.clientTop}!r&&i&&(p.x=Zp(i));const m=i&&!r&&!c?K3(i,f):ua(0),g=u.left+f.scrollLeft-p.x-m.x,y=u.top+f.scrollTop-p.y-m.y;return{x:g,y,width:u.width,height:u.height}}function yy(e){return Ir(e).position==="static"}function z_(e,t){if(!vi(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return ya(e)===s&&(s=s.ownerDocument.body),s}function Q3(e,t){const s=as(e);if(Hp(e))return s;if(!vi(e)){let i=po(e);for(;i&&!Gu(i);){if(Cr(i)&&!yy(i))return i;i=po(i)}return s}let r=z_(e,t);for(;r&&VP(r)&&yy(r);)r=z_(r,t);return r&&Gu(r)&&yy(r)&&!Ub(r)?s:r||FP(e)||s}const sG=async function(e){const t=this.getOffsetParent||Q3,s=this.getDimensions,r=await s(e.floating);return{reference:nG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rG(e){return Ir(e).direction==="rtl"}const aG={convertOffsetParentRelativeRectToViewportRelativeRect:ZP,getDocumentElement:ya,getClippingRect:eG,getOffsetParent:Q3,getElementRects:sG,getClientRects:YP,getDimensions:tG,getScale:Oc,isElement:Cr,isRTL:rG};function eO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iG(e,t,s){let r=null,i;const c=ya(e);function u(){var g;clearTimeout(i),(g=r)==null||g.disconnect(),r=null}function f(g,y){g===void 0&&(g=!1),y===void 0&&(y=1),u();const b=e.getBoundingClientRect(),{left:S,top:A,width:N,height:j}=b;if(g||t(),!N||!j)return;const V=eh(A),C=eh(c.clientWidth-(S+N)),W=eh(c.clientHeight-(A+j)),ce=eh(S),Y={rootMargin:-V+"px "+-C+"px "+-W+"px "+-ce+"px",threshold:so(0,rp(1,y))||1};let K=!0;function w(O){const x=O[0].intersectionRatio;if(!eO(b,e.getBoundingClientRect()))return f();if(x!==y){if(!K)return f();x?f(!1,x):i=setTimeout(()=>{f(!1,1e-7)},1e3)}K=!1}try{r=new IntersectionObserver(w,{...Y,root:c.ownerDocument})}catch{r=new IntersectionObserver(w,Y)}r.observe(e)}const p=as(e),m=()=>f(s);return p.addEventListener("resize",m),f(!0),()=>{p.removeEventListener("resize",m),u()}}function oG(e,t,s,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=r,m=Lb(e),g=i||c?[...m?Fu(m):[],...t?Fu(t):[]]:[];g.forEach(V=>{i&&V.addEventListener("scroll",s),c&&V.addEventListener("resize",s)});const y=m&&f?iG(m,s,c):null;let b=-1,S=null;u&&(S=new ResizeObserver(V=>{let[C]=V;C&&C.target===m&&S&&t&&(S.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var W;(W=S)==null||W.observe(t)})),s()}),m&&!p&&S.observe(m),t&&S.observe(t));let A,N=p?mo(e):null;p&&j();function j(){const V=mo(e);N&&!eO(N,V)&&s(),N=V,A=requestAnimationFrame(j)}return s(),()=>{var V;g.forEach(C=>{i&&C.removeEventListener("scroll",s),c&&C.removeEventListener("resize",s)}),y?.(),(V=S)==null||V.disconnect(),S=null,p&&cancelAnimationFrame(A)}}const cG=zP,lG=$P,uG=UP,dG=(e,t,s)=>{const r=new Map,i=s??{},c={...aG,...i.platform,_c:r};return DP(e,t,{...i,platform:c})};function hv(e,t,s){return e?t(e):s?.(e)}const fG=Symbol();let tO=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??hG,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===fG)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 hG=(e,t)=>e===t||e.length===t.length&&e.every(((s,r)=>!Bp(s,t[r])));function nO(){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 f=i?new bP.MultiStoreController(this,Object.values(i.stores)):void 0;this[s]=f,u&&!f&&this.requestUpdate(t,c)},configurable:!0,enumerable:!0})}}const pG=ga`
15
15
  * {
@@ -302,7 +302,7 @@ ${String(r)}`);Iy(t);for(let i=0;i<t.callbacks.length;i++){const c=r[i];c instan
302
302
  .wallet=${t}
303
303
  ?autofocus=${s===0}
304
304
  ></wallet-list-item>`)}
305
- </ul>`}},ao.elementDefinitions={"wallet-list-item":zb,"internal-button":To},ao.styles=yG,ao);_t([hn({type:Object})],rO.prototype,"wallets",void 0);var eo,vr,Rc,ai,jc,Mc,$b=(Mc=class extends qn{constructor(){super(...arguments);Gn(this,eo,!1);Gn(this,vr,!1);Gn(this,Rc,O4());Gn(this,ai);Gn(this,jc,!1)}get open(){return Ft(this,eo)}set open(s){s!==Ft(this,eo)&&(Fn(this,eo,s),Ft(this,eo)?(this.setAttribute("open",""),this.show()):(this.removeAttribute("open"),this.close()))}async show(){if(Fn(this,vr,!0),await Ft(this,Rc).promise,await this.updateComplete,this._dialog.open||!Ft(this,vr)){Fn(this,vr,!1);return}if(!this.dispatchEvent(new Event("open",{cancelable:!0}))){this.open=!1,Fn(this,vr,!1);return}this._dialog.showModal(),this.open=!0,this.dispatchEvent(new Event("opened")),Fn(this,vr,!1)}async close(s=Ft(this,ai)){if(Fn(this,vr,!1),!this.isConnected){this.open=!1;return}if(await this.updateComplete,!this._dialog.open||Ft(this,vr)){this.open=!1;return}const r=Ft(this,ai);if(Fn(this,ai,s),!this.dispatchEvent(new Event("close",{cancelable:!0}))){Fn(this,ai,r);return}this._dialog.close(Ft(this,ai)),this.open=!1,this.dispatchEvent(new Event("closed"))}connectedCallback(){super.connectedCallback(),Ft(this,Rc).resolve()}disconnectedCallback(){super.disconnectedCallback(),Fn(this,Rc,Promise.withResolvers())}handleContentClick(){Fn(this,jc,!0)}handleDialogClick(){if(Ft(this,jc)){Fn(this,jc,!1);return}this.dispatchEvent(new Event("cancel",{cancelable:!0}))&&this.close()}},eo=new WeakMap,vr=new WeakMap,Rc=new WeakMap,ai=new WeakMap,jc=new WeakMap,Mc.shadowRootOptions={...qn.shadowRootOptions,delegatesFocus:!0},Mc);_t([hn({type:Boolean})],$b.prototype,"open",null);_t([zp("dialog")],$b.prototype,"_dialog",void 0);const TG=bt`<svg
305
+ </ul>`}},ao.elementDefinitions={"wallet-list-item":zb,"internal-button":To},ao.styles=yG,ao);_t([hn({type:Object})],rO.prototype,"wallets",void 0);var eo,br,Rc,ai,jc,Mc,$b=(Mc=class extends qn{constructor(){super(...arguments);Gn(this,eo,!1);Gn(this,br,!1);Gn(this,Rc,O4());Gn(this,ai);Gn(this,jc,!1)}get open(){return Ft(this,eo)}set open(s){s!==Ft(this,eo)&&(Fn(this,eo,s),Ft(this,eo)?(this.setAttribute("open",""),this.show()):(this.removeAttribute("open"),this.close()))}async show(){if(Fn(this,br,!0),await Ft(this,Rc).promise,await this.updateComplete,this._dialog.open||!Ft(this,br)){Fn(this,br,!1);return}if(!this.dispatchEvent(new Event("open",{cancelable:!0}))){this.open=!1,Fn(this,br,!1);return}this._dialog.showModal(),this.open=!0,this.dispatchEvent(new Event("opened")),Fn(this,br,!1)}async close(s=Ft(this,ai)){if(Fn(this,br,!1),!this.isConnected){this.open=!1;return}if(await this.updateComplete,!this._dialog.open||Ft(this,br)){this.open=!1;return}const r=Ft(this,ai);if(Fn(this,ai,s),!this.dispatchEvent(new Event("close",{cancelable:!0}))){Fn(this,ai,r);return}this._dialog.close(Ft(this,ai)),this.open=!1,this.dispatchEvent(new Event("closed"))}connectedCallback(){super.connectedCallback(),Ft(this,Rc).resolve()}disconnectedCallback(){super.disconnectedCallback(),Fn(this,Rc,Promise.withResolvers())}handleContentClick(){Fn(this,jc,!0)}handleDialogClick(){if(Ft(this,jc)){Fn(this,jc,!1);return}this.dispatchEvent(new Event("cancel",{cancelable:!0}))&&this.close()}},eo=new WeakMap,br=new WeakMap,Rc=new WeakMap,ai=new WeakMap,jc=new WeakMap,Mc.shadowRootOptions={...qn.shadowRootOptions,delegatesFocus:!0},Mc);_t([hn({type:Boolean})],$b.prototype,"open",null);_t([zp("dialog")],$b.prototype,"_dialog",void 0);const TG=bt`<svg
306
306
  width="16"
307
307
  height="16"
308
308
  viewBox="0 0 16 16"
@@ -829,17 +829,17 @@ ${String(r)}`);Iy(t);for(let i=0;i<t.callbacks.length;i++){const c=r[i];c instan
829
829
  .instance=${this.instance}
830
830
  .filterFn=${this.modalOptions?.filterFn}
831
831
  .sortFn=${this.modalOptions?.sortFn}
832
- ></mysten-dapp-kit-connect-modal>`}},wp=new WeakSet,pO=function(){this._modal.show()},di.elementDefinitions={"internal-button":To,"mysten-dapp-kit-connect-modal":pi,"connected-account-menu":ol},di.shadowRootOptions={...qn.shadowRootOptions,delegatesFocus:!0},di.styles=wo,di);_t([hn({type:Object})],qc.prototype,"modalOptions",void 0);_t([nO()],qc.prototype,"instance",void 0);_t([zp("mysten-dapp-kit-connect-modal")],qc.prototype,"_modal",void 0);qc=_t([F3("mysten-dapp-kit-connect-button")],qc);const IG=U3({react:_3,tagName:"mysten-dapp-kit-connect-button",elementClass:qc});function RG({instance:e,...t}){const s=bo(e);return T.jsx(IG,{...t,instance:s})}U3({react:_3,tagName:"mysten-dapp-kit-connect-modal",elementClass:pi});var vy={exports:{}},gu={},by={exports:{}},wy={};var $_;function jG(){return $_||($_=1,(function(e){function t(k,I){var D=k.length;k.push(I);e:for(;0<D;){var L=D-1>>>1,X=k[L];if(0<i(X,I))k[L]=I,k[D]=X,D=L;else break e}}function s(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var I=k[0],D=k.pop();if(D!==I){k[0]=D;e:for(var L=0,X=k.length,z=X>>>1;L<z;){var ie=2*(L+1)-1,fe=k[ie],R=ie+1,J=k[R];if(0>i(fe,D))R<X&&0>i(J,fe)?(k[L]=J,k[R]=D,L=R):(k[L]=fe,k[ie]=D,L=ie);else if(R<X&&0>i(J,D))k[L]=J,k[R]=D,L=R;else break e}}return I}function i(k,I){var D=k.sortIndex-I.sortIndex;return D!==0?D:k.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],m=[],g=1,y=null,b=3,S=!1,A=!1,N=!1,j=!1,V=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function ce(k){for(var I=s(m);I!==null;){if(I.callback===null)r(m);else if(I.startTime<=k)r(m),I.sortIndex=I.expirationTime,t(p,I);else break;I=s(m)}}function ae(k){if(N=!1,ce(k),!A)if(s(p)!==null)A=!0,Y||(Y=!0,U());else{var I=s(m);I!==null&&M(ae,I.startTime-k)}}var Y=!1,K=-1,w=5,O=-1;function x(){return j?!0:!(e.unstable_now()-O<w)}function G(){if(j=!1,Y){var k=e.unstable_now();O=k;var I=!0;try{e:{A=!1,N&&(N=!1,C(K),K=-1),S=!0;var D=b;try{t:{for(ce(k),y=s(p);y!==null&&!(y.expirationTime>k&&x());){var L=y.callback;if(typeof L=="function"){y.callback=null,b=y.priorityLevel;var X=L(y.expirationTime<=k);if(k=e.unstable_now(),typeof X=="function"){y.callback=X,ce(k),I=!0;break t}y===s(p)&&r(p),ce(k)}else r(p);y=s(p)}if(y!==null)I=!0;else{var z=s(m);z!==null&&M(ae,z.startTime-k),I=!1}}break e}finally{y=null,b=D,S=!1}I=void 0}}finally{I?U():Y=!1}}}var U;if(typeof W=="function")U=function(){W(G)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,$=H.port2;H.port1.onmessage=G,U=function(){$.postMessage(null)}}else U=function(){V(G,0)};function M(k,I){K=V(function(){k(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(k){switch(b){case 1:case 2:case 3:var I=3;break;default:I=b}var D=b;b=I;try{return k()}finally{b=D}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(k,I){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var D=b;b=k;try{return I()}finally{b=D}},e.unstable_scheduleCallback=function(k,I,D){var L=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?L+D:L):D=L,k){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=D+X,k={id:g++,callback:I,priorityLevel:k,startTime:D,expirationTime:X,sortIndex:-1},D>L?(k.sortIndex=D,t(m,k),s(p)===null&&k===s(m)&&(N?(C(K),K=-1):N=!0,M(ae,D-L))):(k.sortIndex=X,t(p,k),A||S||(A=!0,Y||(Y=!0,U()))),k},e.unstable_shouldYield=x,e.unstable_wrapCallback=function(k){var I=b;return function(){var D=b;b=I;try{return k.apply(this,arguments)}finally{b=D}}}})(wy)),wy}var V_;function MG(){return V_||(V_=1,by.exports=jG()),by.exports}var Ty={exports:{}},xn={};var P_;function DG(){if(P_)return xn;P_=1;var e=kb();function t(g){var y="https://react.dev/errors/"+g;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)y+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},i=Symbol.for("react.portal"),c=Symbol.for("react.recoverable"),u=Symbol.for("react.optimistic_key");function f(g,y,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:S==null?null:S===u?u:""+S,children:g,containerInfo:y,implementation:b}}var p=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,y){if(g==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,xn.browser=function(g){return{$$typeof:c,_reason:g}},xn.createPortal=function(g,y){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(t(299));return f(g,y,null,b)},xn.flushSync=function(g){var y=p.T,b=r.p;try{if(p.T=null,r.p=2,g)return g()}finally{p.T=y,r.p=b,r.d.f()}},xn.preconnect=function(g,y){typeof g=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,r.d.C(g,y))},xn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},xn.preinit=function(g,y){if(typeof g=="string"&&y&&typeof y.as=="string"){var b=y.as,S=m(b,y.crossOrigin),A=typeof y.integrity=="string"?y.integrity:void 0,N=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;b==="style"?r.d.S(g,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:S,integrity:A,fetchPriority:N}):b==="script"&&r.d.X(g,{crossOrigin:S,integrity:A,fetchPriority:N,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},xn.preinitModule=function(g,y){if(typeof g=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var b=m(y.as,y.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&r.d.M(g)},xn.preload=function(g,y){if(typeof g=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var b=y.as,S=m(b,y.crossOrigin);r.d.L(g,b,{crossOrigin:S,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},xn.preloadModule=function(g,y){if(typeof g=="string")if(y){var b=m(y.as,y.crossOrigin);r.d.m(g,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else r.d.m(g)},xn.requestFormReset=function(g){r.d.r(g)},xn.unstable_batchedUpdates=function(g,y){return g(y)},xn.useFormState=function(g,y,b){return p.H.useFormState(g,y,b)},xn.useFormStatus=function(){return p.H.useHostTransitionStatus()},xn.version="19.3.0",xn}var G_;function UG(){if(G_)return Ty.exports;G_=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(),Ty.exports=DG(),Ty.exports}var F_;function BG(){if(F_)return gu;F_=1;var e=MG(),t=kb(),s=UG();function r(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)a+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){for(var a=n,o=a;o&&!o.alternate;)a=o,(a.flags&4098)!==0&&(n=a.return),o=a.return;for(;a.return;)a=a.return;return a.tag===3?n:null}function u(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function f(n){if(n.tag===31){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function p(n){if(c(n)!==n)throw Error(r(188))}function m(n){var a=n.alternate;if(!a){if(a=c(n),a===null)throw Error(r(188));return a!==n?null:n}for(var o=n,l=a;;){var d=o.return;if(d===null)break;var h=d.alternate;if(h===null){if(l=d.return,l!==null){o=l;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===o)return p(d),n;if(h===l)return p(d),a;h=h.sibling}throw Error(r(188))}if(o.return!==l.return)o=d,l=h;else{for(var v=!1,_=d.child;_;){if(_===o){v=!0,o=d,l=h;break}if(_===l){v=!0,l=d,o=h;break}_=_.sibling}if(!v){for(_=h.child;_;){if(_===o){v=!0,o=h,l=d;break}if(_===l){v=!0,l=h,o=d;break}_=_.sibling}if(!v)throw Error(r(189))}}if(o.alternate!==l)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?n:a}function g(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=g(n),a!==null)return a;n=n.sibling}return null}function y(n,a,o,l,d,h){for(;n!==null;){if((n.tag===5||n.tag===27||n.tag===6)&&o(n,l,d,h)||(n.tag!==22||n.memoizedState===null)&&(a||n.tag!==5&&n.tag!==27)&&y(n.child,a,o,l,d,h))return!0;n=n.sibling}return!1}function b(n){for(n=n.return;n!==null;){if(n.tag===3||n.tag===5||n.tag===27)return n;n=n.return}return null}function S(n){var a=!1;for(n=n.return;n!==null&&(n.tag===4&&(a=!0),!(n.tag===3||n.tag===5||n.tag===27));)n=n.return;return a}function A(n){var a=[null,null],o=b(n);return o===null||N(a,n,o.child,{foundSelf:!1}),a}function N(n,a,o,l){for(;o!==null;){if(o===a)l.foundSelf=!0;else if(o.tag===5||o.tag===27||o.tag===6){if(l.foundSelf)return n[1]=o,!0;n[0]=o}else if((o.tag!==22||o.memoizedState===null)&&N(n,a,o.child,l))return!0;o=o.sibling}return!1}function j(n){switch(n.tag){case 5:case 27:case 6:return n.stateNode;case 3:return n.stateNode.containerInfo;default:throw Error(r(559))}}var V=null,C=null;function W(n,a,o){return n===o?!0:n===a?(V=n,!0):!1}function ce(n,a,o){return n===o?(C=n,!1):n===a?(C!==null&&(V=n),!0):!1}function ae(n){if(n===null)return null;do n=n===null?null:n.return;while(n&&n.tag!==5&&n.tag!==27&&n.tag!==3);return n||null}function Y(n,a,o){for(var l=0,d=n;d;d=o(d))l++;d=0;for(var h=a;h;h=o(h))d++;for(;0<l-d;)n=o(n),l--;for(;0<d-l;)a=o(a),d--;for(;l--;){if(n===a||a!==null&&n===a.alternate)return n;n=o(n),a=o(a)}return null}var K=Object.assign,w=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),M=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),ie=Symbol.for("react.legacy_hidden"),fe=Symbol.for("react.memo_cache_sentinel"),R=Symbol.for("react.view_transition"),J=Symbol.for("react.recoverable"),le=Symbol.iterator;function pe(n){return n===null||typeof n!="object"?null:(n=le&&n[le]||n["@@iterator"],typeof n=="function"?n:null)}var Te=Symbol.for("react.client.reference");function Oe(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Te?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case G:return"Fragment";case H:return"Profiler";case U:return"StrictMode";case I:return"Suspense";case D:return"SuspenseList";case z:return"Activity";case R:return"ViewTransition"}if(typeof n=="object")switch(n.$$typeof){case x:return"Portal";case M:return n.displayName||"Context";case $:return(n._context.displayName||"Context")+".Consumer";case k:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case L:return a=n.displayName||null,a!==null?a:Oe(n.type)||"Memo";case X:a=n._payload,n=n._init;try{return Oe(n(a))}catch{}}return null}var Ae=Array.isArray,be=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pe={pending:!1,data:null,method:null,action:null},at=[],P=-1;function te(n){return{current:n}}function de(n){0>P||(n.current=at[P],at[P]=null,P--)}function he(n,a){P++,at[P]=n.current,n.current=a}var ue=te(null),ze=te(null),Le=te(null),Mt=te(null);function Es(n,a){switch(he(Le,a),he(ze,n),he(ue,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?x2(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=x2(a),n=C2(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}de(ue),he(ue,n)}function va(){de(ue),de(ze),de(Le)}function cl(n){var a=n.memoizedState;a!==null&&(uc._currentValue=a.memoizedState,he(Mt,n)),a=ue.current;var o=C2(a,n.type);a!==o&&(he(ze,n),he(ue,o))}function bi(n){ze.current===n&&(de(ue),de(ze)),Mt.current===n&&(de(Mt),uc._currentValue=Pe)}var Eo,ll;function sr(n){if(Eo===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);Eo=a&&a[1]||"",ll=-1<o.stack.indexOf(`
832
+ ></mysten-dapp-kit-connect-modal>`}},wp=new WeakSet,pO=function(){this._modal.show()},di.elementDefinitions={"internal-button":To,"mysten-dapp-kit-connect-modal":pi,"connected-account-menu":ol},di.shadowRootOptions={...qn.shadowRootOptions,delegatesFocus:!0},di.styles=wo,di);_t([hn({type:Object})],qc.prototype,"modalOptions",void 0);_t([nO()],qc.prototype,"instance",void 0);_t([zp("mysten-dapp-kit-connect-modal")],qc.prototype,"_modal",void 0);qc=_t([F3("mysten-dapp-kit-connect-button")],qc);const IG=U3({react:_3,tagName:"mysten-dapp-kit-connect-button",elementClass:qc});function RG({instance:e,...t}){const s=bo(e);return T.jsx(IG,{...t,instance:s})}U3({react:_3,tagName:"mysten-dapp-kit-connect-modal",elementClass:pi});var vy={exports:{}},gu={},by={exports:{}},wy={};var $_;function jG(){return $_||($_=1,(function(e){function t(k,I){var D=k.length;k.push(I);e:for(;0<D;){var L=D-1>>>1,X=k[L];if(0<i(X,I))k[L]=I,k[D]=X,D=L;else break e}}function s(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var I=k[0],D=k.pop();if(D!==I){k[0]=D;e:for(var L=0,X=k.length,z=X>>>1;L<z;){var ie=2*(L+1)-1,fe=k[ie],R=ie+1,J=k[R];if(0>i(fe,D))R<X&&0>i(J,fe)?(k[L]=J,k[R]=D,L=R):(k[L]=fe,k[ie]=D,L=ie);else if(R<X&&0>i(J,D))k[L]=J,k[R]=D,L=R;else break e}}return I}function i(k,I){var D=k.sortIndex-I.sortIndex;return D!==0?D:k.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],m=[],g=1,y=null,b=3,S=!1,A=!1,N=!1,j=!1,V=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function ce(k){for(var I=s(m);I!==null;){if(I.callback===null)r(m);else if(I.startTime<=k)r(m),I.sortIndex=I.expirationTime,t(p,I);else break;I=s(m)}}function ae(k){if(N=!1,ce(k),!A)if(s(p)!==null)A=!0,Y||(Y=!0,U());else{var I=s(m);I!==null&&M(ae,I.startTime-k)}}var Y=!1,K=-1,w=5,O=-1;function x(){return j?!0:!(e.unstable_now()-O<w)}function G(){if(j=!1,Y){var k=e.unstable_now();O=k;var I=!0;try{e:{A=!1,N&&(N=!1,C(K),K=-1),S=!0;var D=b;try{t:{for(ce(k),y=s(p);y!==null&&!(y.expirationTime>k&&x());){var L=y.callback;if(typeof L=="function"){y.callback=null,b=y.priorityLevel;var X=L(y.expirationTime<=k);if(k=e.unstable_now(),typeof X=="function"){y.callback=X,ce(k),I=!0;break t}y===s(p)&&r(p),ce(k)}else r(p);y=s(p)}if(y!==null)I=!0;else{var z=s(m);z!==null&&M(ae,z.startTime-k),I=!1}}break e}finally{y=null,b=D,S=!1}I=void 0}}finally{I?U():Y=!1}}}var U;if(typeof W=="function")U=function(){W(G)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,$=H.port2;H.port1.onmessage=G,U=function(){$.postMessage(null)}}else U=function(){V(G,0)};function M(k,I){K=V(function(){k(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(k){switch(b){case 1:case 2:case 3:var I=3;break;default:I=b}var D=b;b=I;try{return k()}finally{b=D}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(k,I){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var D=b;b=k;try{return I()}finally{b=D}},e.unstable_scheduleCallback=function(k,I,D){var L=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?L+D:L):D=L,k){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=D+X,k={id:g++,callback:I,priorityLevel:k,startTime:D,expirationTime:X,sortIndex:-1},D>L?(k.sortIndex=D,t(m,k),s(p)===null&&k===s(m)&&(N?(C(K),K=-1):N=!0,M(ae,D-L))):(k.sortIndex=X,t(p,k),A||S||(A=!0,Y||(Y=!0,U()))),k},e.unstable_shouldYield=x,e.unstable_wrapCallback=function(k){var I=b;return function(){var D=b;b=I;try{return k.apply(this,arguments)}finally{b=D}}}})(wy)),wy}var V_;function MG(){return V_||(V_=1,by.exports=jG()),by.exports}var Ty={exports:{}},xn={};var P_;function DG(){if(P_)return xn;P_=1;var e=kb();function t(g){var y="https://react.dev/errors/"+g;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)y+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},i=Symbol.for("react.portal"),c=Symbol.for("react.recoverable"),u=Symbol.for("react.optimistic_key");function f(g,y,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:S==null?null:S===u?u:""+S,children:g,containerInfo:y,implementation:b}}var p=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,y){if(g==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,xn.browser=function(g){return{$$typeof:c,_reason:g}},xn.createPortal=function(g,y){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(t(299));return f(g,y,null,b)},xn.flushSync=function(g){var y=p.T,b=r.p;try{if(p.T=null,r.p=2,g)return g()}finally{p.T=y,r.p=b,r.d.f()}},xn.preconnect=function(g,y){typeof g=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,r.d.C(g,y))},xn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},xn.preinit=function(g,y){if(typeof g=="string"&&y&&typeof y.as=="string"){var b=y.as,S=m(b,y.crossOrigin),A=typeof y.integrity=="string"?y.integrity:void 0,N=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;b==="style"?r.d.S(g,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:S,integrity:A,fetchPriority:N}):b==="script"&&r.d.X(g,{crossOrigin:S,integrity:A,fetchPriority:N,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},xn.preinitModule=function(g,y){if(typeof g=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var b=m(y.as,y.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&r.d.M(g)},xn.preload=function(g,y){if(typeof g=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var b=y.as,S=m(b,y.crossOrigin);r.d.L(g,b,{crossOrigin:S,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},xn.preloadModule=function(g,y){if(typeof g=="string")if(y){var b=m(y.as,y.crossOrigin);r.d.m(g,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else r.d.m(g)},xn.requestFormReset=function(g){r.d.r(g)},xn.unstable_batchedUpdates=function(g,y){return g(y)},xn.useFormState=function(g,y,b){return p.H.useFormState(g,y,b)},xn.useFormStatus=function(){return p.H.useHostTransitionStatus()},xn.version="19.3.0",xn}var G_;function UG(){if(G_)return Ty.exports;G_=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(),Ty.exports=DG(),Ty.exports}var F_;function BG(){if(F_)return gu;F_=1;var e=MG(),t=kb(),s=UG();function r(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)a+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){for(var a=n,o=a;o&&!o.alternate;)a=o,(a.flags&4098)!==0&&(n=a.return),o=a.return;for(;a.return;)a=a.return;return a.tag===3?n:null}function u(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function f(n){if(n.tag===31){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function p(n){if(c(n)!==n)throw Error(r(188))}function m(n){var a=n.alternate;if(!a){if(a=c(n),a===null)throw Error(r(188));return a!==n?null:n}for(var o=n,l=a;;){var d=o.return;if(d===null)break;var h=d.alternate;if(h===null){if(l=d.return,l!==null){o=l;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===o)return p(d),n;if(h===l)return p(d),a;h=h.sibling}throw Error(r(188))}if(o.return!==l.return)o=d,l=h;else{for(var v=!1,_=d.child;_;){if(_===o){v=!0,o=d,l=h;break}if(_===l){v=!0,l=d,o=h;break}_=_.sibling}if(!v){for(_=h.child;_;){if(_===o){v=!0,o=h,l=d;break}if(_===l){v=!0,l=h,o=d;break}_=_.sibling}if(!v)throw Error(r(189))}}if(o.alternate!==l)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?n:a}function g(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=g(n),a!==null)return a;n=n.sibling}return null}function y(n,a,o,l,d,h){for(;n!==null;){if((n.tag===5||n.tag===27||n.tag===6)&&o(n,l,d,h)||(n.tag!==22||n.memoizedState===null)&&(a||n.tag!==5&&n.tag!==27)&&y(n.child,a,o,l,d,h))return!0;n=n.sibling}return!1}function b(n){for(n=n.return;n!==null;){if(n.tag===3||n.tag===5||n.tag===27)return n;n=n.return}return null}function S(n){var a=!1;for(n=n.return;n!==null&&(n.tag===4&&(a=!0),!(n.tag===3||n.tag===5||n.tag===27));)n=n.return;return a}function A(n){var a=[null,null],o=b(n);return o===null||N(a,n,o.child,{foundSelf:!1}),a}function N(n,a,o,l){for(;o!==null;){if(o===a)l.foundSelf=!0;else if(o.tag===5||o.tag===27||o.tag===6){if(l.foundSelf)return n[1]=o,!0;n[0]=o}else if((o.tag!==22||o.memoizedState===null)&&N(n,a,o.child,l))return!0;o=o.sibling}return!1}function j(n){switch(n.tag){case 5:case 27:case 6:return n.stateNode;case 3:return n.stateNode.containerInfo;default:throw Error(r(559))}}var V=null,C=null;function W(n,a,o){return n===o?!0:n===a?(V=n,!0):!1}function ce(n,a,o){return n===o?(C=n,!1):n===a?(C!==null&&(V=n),!0):!1}function ae(n){if(n===null)return null;do n=n===null?null:n.return;while(n&&n.tag!==5&&n.tag!==27&&n.tag!==3);return n||null}function Y(n,a,o){for(var l=0,d=n;d;d=o(d))l++;d=0;for(var h=a;h;h=o(h))d++;for(;0<l-d;)n=o(n),l--;for(;0<d-l;)a=o(a),d--;for(;l--;){if(n===a||a!==null&&n===a.alternate)return n;n=o(n),a=o(a)}return null}var K=Object.assign,w=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),M=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),ie=Symbol.for("react.legacy_hidden"),fe=Symbol.for("react.memo_cache_sentinel"),R=Symbol.for("react.view_transition"),J=Symbol.for("react.recoverable"),le=Symbol.iterator;function pe(n){return n===null||typeof n!="object"?null:(n=le&&n[le]||n["@@iterator"],typeof n=="function"?n:null)}var Te=Symbol.for("react.client.reference");function Oe(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Te?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case G:return"Fragment";case H:return"Profiler";case U:return"StrictMode";case I:return"Suspense";case D:return"SuspenseList";case z:return"Activity";case R:return"ViewTransition"}if(typeof n=="object")switch(n.$$typeof){case x:return"Portal";case M:return n.displayName||"Context";case $:return(n._context.displayName||"Context")+".Consumer";case k:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case L:return a=n.displayName||null,a!==null?a:Oe(n.type)||"Memo";case X:a=n._payload,n=n._init;try{return Oe(n(a))}catch{}}return null}var Ae=Array.isArray,be=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pe={pending:!1,data:null,method:null,action:null},at=[],P=-1;function te(n){return{current:n}}function de(n){0>P||(n.current=at[P],at[P]=null,P--)}function he(n,a){P++,at[P]=n.current,n.current=a}var ue=te(null),ze=te(null),Le=te(null),Mt=te(null);function Es(n,a){switch(he(Le,a),he(ze,n),he(ue,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?x2(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=x2(a),n=C2(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}de(ue),he(ue,n)}function va(){de(ue),de(ze),de(Le)}function cl(n){var a=n.memoizedState;a!==null&&(uc._currentValue=a.memoizedState,he(Mt,n)),a=ue.current;var o=C2(a,n.type);a!==o&&(he(ze,n),he(ue,o))}function bi(n){ze.current===n&&(de(ue),de(ze)),Mt.current===n&&(de(Mt),uc._currentValue=Pe)}var Eo,ll;function rr(n){if(Eo===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);Eo=a&&a[1]||"",ll=-1<o.stack.indexOf(`
833
833
  at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
834
834
  `+Eo+n+ll}var ul=!1;function dl(n,a){if(!n||ul)return"";ul=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(a){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(ke){var Q=ke}Reflect.construct(n,[],ge)}else{try{ge.call()}catch(ke){Q=ke}ge=!1;try{var re=Object.getOwnPropertyDescriptor(n.prototype,"props");Object.defineProperty(n.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ge=!0,new n}finally{ge&&(re!==void 0?Object.defineProperty(n.prototype,"props",re):delete n.prototype.props)}}}else{try{throw Error()}catch(ke){Q=ke}(ge=n())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ke){if(ke&&Q&&typeof ke.stack=="string")return[ke.stack,Q.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),v=h[0],_=h[1];if(v&&_){var B=v.split(`
835
835
  `),ne=_.split(`
836
836
  `);for(d=l=0;l<B.length&&!B[l].includes("DetermineComponentFrameRoot");)l++;for(;d<ne.length&&!ne[d].includes("DetermineComponentFrameRoot");)d++;if(l===B.length||d===ne.length)for(l=B.length-1,d=ne.length-1;1<=l&&0<=d&&B[l]!==ne[d];)d--;for(;1<=l&&0<=d;l--,d--)if(B[l]!==ne[d]){if(l!==1||d!==1)do if(l--,d--,0>d||B[l]!==ne[d]){var oe=`
837
- `+B[l].replace(" at new "," at ");return n.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",n.displayName)),oe}while(1<=l&&0<=d);break}}}finally{ul=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?sr(o):""}function em(n,a){switch(n.tag){case 26:case 27:case 5:return sr(n.type);case 16:return sr("Lazy");case 13:return n.child!==a&&a!==null?sr("Suspense Fallback"):sr("Suspense");case 19:return sr("SuspenseList");case 0:case 15:return dl(n.type,!1);case 11:return dl(n.type.render,!1);case 1:return dl(n.type,!0);case 31:return sr("Activity");case 30:return sr("ViewTransition");default:return""}}function fd(n){try{var a="",o=null;do a+=em(n,o),o=n,n=n.return;while(n);return a}catch(l){return`
837
+ `+B[l].replace(" at new "," at ");return n.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",n.displayName)),oe}while(1<=l&&0<=d);break}}}finally{ul=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?rr(o):""}function em(n,a){switch(n.tag){case 26:case 27:case 5:return rr(n.type);case 16:return rr("Lazy");case 13:return n.child!==a&&a!==null?rr("Suspense Fallback"):rr("Suspense");case 19:return rr("SuspenseList");case 0:case 15:return dl(n.type,!1);case 11:return dl(n.type.render,!1);case 1:return dl(n.type,!0);case 31:return rr("Activity");case 30:return rr("ViewTransition");default:return""}}function fd(n){try{var a="",o=null;do a+=em(n,o),o=n,n=n.return;while(n);return a}catch(l){return`
838
838
  Error generating stack: `+l.message+`
839
- `+l.stack}}var fl=Object.prototype.hasOwnProperty,hl=e.unstable_scheduleCallback,ba=e.unstable_cancelCallback,tm=e.unstable_shouldYield,nm=e.unstable_requestPaint,Ln=e.unstable_now,sm=e.unstable_getCurrentPriorityLevel,hd=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,Ye=e.unstable_NormalPriority,Ot=e.unstable_LowPriority,Ss=e.unstable_IdlePriority,jn=e.log,So=e.unstable_setDisableYieldValue,pl=null,is=null;function wa(n){if(typeof jn=="function"&&So(n),is&&typeof is.setStrictMode=="function")try{is.setStrictMode(pl,n)}catch{}}var os=Math.clz32?Math.clz32:nN,eN=Math.log,tN=Math.LN2;function nN(n){return n>>>=0,n===0?32:31-(eN(n)/tN|0)|0}var pd=256,md=262144,gd=4194304;function wi(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 yd(n,a,o){var l=n.pendingLanes;if(l===0)return 0;var d=0,h=n.suspendedLanes,v=n.pingedLanes;n=n.warmLanes;var _=l&134217727;return _!==0?(l=_&~h,l!==0?d=wi(l):(v&=_,v!==0?d=wi(v):o||(o=_&~n,o!==0&&(d=wi(o))))):(_=l&~h,_!==0?d=wi(_):v!==0?d=wi(v):o||(o=l&~n,o!==0&&(d=wi(o)))),d===0?0:a!==0&&a!==d&&(a&h)===0&&(h=d&-d,o=a&-a,h>=o||h===32&&(o&4194048)!==0)?a:d}function ml(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function t1(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-os(o),d=1<<l;a|=n[l],o&=~d}return a}function sN(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 n1(){var n=gd;return gd<<=1,(gd&62914560)===0&&(gd=4194304),n}function rm(n){for(var a=[],o=0;31>o;o++)a.push(n);return a}function gl(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function rN(n,a,o,l,d,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,B=n.expirationTimes,ne=n.hiddenUpdates;for(o=v&~o;0<o;){var oe=31-os(o),ge=1<<oe;_[oe]=0,B[oe]=-1;var Q=ne[oe];if(Q!==null)for(ne[oe]=null,oe=0;oe<Q.length;oe++){var re=Q[oe];re!==null&&(re.lane&=-536870913)}o&=~ge}l!==0&&s1(n,l,0),h!==0&&d===0&&n.tag!==0&&(n.suspendedLanes|=h&~(v&~a))}function s1(n,a,o){n.pendingLanes|=a,n.suspendedLanes&=~a;var l=31-os(a);n.entangledLanes|=a,n.entanglements[l]=n.entanglements[l]|1073741824|o&261930}function r1(n,a){var o=n.entangledLanes|=a;for(n=n.entanglements;o;){var l=31-os(o),d=1<<l;d&a|n[l]&a&&(n[l]|=a),o&=~d}}function a1(n,a){var o=a&-a;return o=(o&42)!==0?1:am(o),(o&(n.suspendedLanes|a))!==0?0:o}function am(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 im(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function i1(){var n=_e.p;return n!==0?n:(n=window.event,n===void 0?32:hE(n.type))}function o1(n,a){var o=_e.p;try{return _e.p=n,a()}finally{_e.p=o}}var Mr=Math.random().toString(36).slice(2),Sn="__reactFiber$"+Mr,Wn="__reactProps$"+Mr,_o="__reactContainer$"+Mr,c1="__reactEvents$"+Mr,aN="__reactListeners$"+Mr,iN="__reactHandles$"+Mr,l1="__reactResources$"+Mr,yl="__reactMarker$"+Mr,vd="__reactLoad$"+Mr;function bd(n){delete n[Sn],delete n[Wn],delete n[aN],delete n[iN]}function Ti(n){var a;if(a=n[Sn])return a;for(var o=n.parentNode;o;){if(a=o[_o]||o[Sn]){if(o=a.alternate,a.child!==null||o!==null&&o.child!==null)for(n=Z2(n);n!==null;){if(o=n[Sn])return o;n=Z2(n)}return a}n=o,o=n.parentNode}return null}function ko(n){if(n=n[Sn]||n[_o]){var a=n.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return n}return null}function vl(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(r(33))}function Ao(n){var a=n[l1];return a||(a=n[l1]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function pn(n){n[yl]=!0}function u1(n){n[vd]=void 0}var d1=new Set,f1={};function Ei(n,a){Oo(n,a),Oo(n+"Capture",a)}function Oo(n,a){for(f1[n]=a,n=0;n<a.length;n++)d1.add(a[n])}var oN=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]*$"),h1={},p1={};function cN(n){return fl.call(p1,n)?!0:fl.call(h1,n)?!1:oN.test(n)?p1[n]=!0:(h1[n]=!0,!1)}var dt=!1;function m1(){var n=dt;return dt=!1,n}function wd(n,a,o){if(cN(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 Td(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 Dr(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 cs(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function g1(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function lN(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 d=l.get,h=l.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return d.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 om(n){if(!n._valueTracker){var a=g1(n)?"checked":"value";n._valueTracker=lN(n,a,""+n[a])}}function y1(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var o=a.getValue(),l="";return n&&(l=g1(n)?n.checked?"true":"false":n.value),n=l,n!==o?(a.setValue(n),!0):!1}var uN=/[\n"\\]/g;function _s(n){return n.replace(uN,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function cm(n,a,o,l,d,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=""+cs(a)):n.value!==""+cs(a)&&(n.value=""+cs(a)):v!=="submit"&&v!=="reset"||n.removeAttribute("value"),a!=null?v==="number"&&n.value==a?lm(n,cs(n.value)):lm(n,cs(a)):o!=null?lm(n,cs(o)):l!=null&&n.removeAttribute("value"),d==null&&h!=null&&(n.defaultChecked=!!h),d!=null&&(n.checked=d&&typeof d!="function"&&typeof d!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+cs(_):n.removeAttribute("name")}function v1(n,a,o,l,d,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)){om(n);return}o=o!=null?""+cs(o):"",a=a!=null?""+cs(a):o,_||a===n.value||(n.value=a),n.defaultValue=a}l=l??d,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),om(n)}function lm(n,a){n.defaultValue!==""+a&&(n.defaultValue=""+a)}function No(n,a,o,l){if(n=n.options,a){a={};for(var d=0;d<o.length;d++)a["$"+o[d]]=!0;for(o=0;o<n.length;o++)d=a.hasOwnProperty("$"+n[o].value),n[o].selected!==d&&(n[o].selected=d),d&&l&&(n[o].defaultSelected=!0)}else{for(o=""+cs(o),a=null,d=0;d<n.length;d++){if(n[d].value===o){n[d].selected=!0,l&&(n[d].defaultSelected=!0);return}a!==null||n[d].disabled||(a=n[d])}a!==null&&(a.selected=!0)}}function b1(n,a,o){if(a!=null&&(a=""+cs(a),a!==n.value&&(n.value=a),o==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=o!=null?""+cs(o):""}function w1(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=cs(a),n.defaultValue=o,l=n.textContent,l===o&&l!==""&&l!==null&&(n.value=l),om(n)}function xo(n,a){if(a){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=a;return}}n.textContent=a}var dN=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 T1(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||dN.has(a)?a==="float"?n.cssFloat=o:n[a]=(""+o).trim():n[a]=o+"px"}function E1(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 d in a)l=a[d],a.hasOwnProperty(d)&&o[d]!==l&&(T1(n,d,l),dt=!0)}else for(var h in a)a.hasOwnProperty(h)&&T1(n,h,a[h])}function um(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 fN=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"]]),hN=/^[\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 Ed(n){return hN.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function rr(){}var dm=null;function fm(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Co=null,Io=null;function S1(n){var a=ko(n);if(a&&(n=a.stateNode)){var o=n[Wn]||null;e:switch(n=a.stateNode,a.type){case"input":if(cm(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="'+_s(""+a)+'"][type="radio"]'),a=0;a<o.length;a++){var l=o[a];if(l!==n&&l.form===n.form){var d=l[Wn]||null;if(!d)throw Error(r(90));cm(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(a=0;a<o.length;a++)l=o[a],l.form===n.form&&y1(l)}break e;case"textarea":b1(n,o.value,o.defaultValue);break e;case"select":a=o.value,a!=null&&No(n,!!o.multiple,a,!1)}}}var hm=!1;function _1(n,a,o){if(hm)return n(a,o);hm=!0;try{var l=n(a);return l}finally{if(hm=!1,(Co!==null||Io!==null)&&(Sf(),Co&&(a=Co,n=Io,Io=Co=null,S1(a),n)))for(a=0;a<n.length;a++)S1(n[a])}}function bl(n,a){var o=n.stateNode;if(o===null)return null;var l=o[Wn]||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 Ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pm=!1;if(Ur)try{var wl={};Object.defineProperty(wl,"passive",{get:function(){pm=!0}}),window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{pm=!1}var Ta=null,mm=null,Sd=null;function k1(){if(Sd)return Sd;var n,a=mm,o=a.length,l,d="value"in Ta?Ta.value:Ta.textContent,h=d.length;for(n=0;n<o&&a[n]===d[n];n++);var v=o-n;for(l=1;l<=v&&a[o-l]===d[h-l];l++);return Sd=d.slice(n,1<l?1-l:void 0)}function _d(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 kd(){return!0}function A1(){return!1}function zn(n){function a(o,l,d,h,v){this._reactName=o,this._targetInst=d,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)?kd:A1,this.isPropagationStopped=A1,this}return K(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=kd)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=kd)},persist:function(){},isPersistent:kd}),a}var Ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ad=zn(Ea),Tl=K({},Ea,{view:0,detail:0}),pN=zn(Tl),gm,ym,El,Od=K({},Tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bm,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!==El&&(El&&n.type==="mousemove"?(gm=n.screenX-El.screenX,ym=n.screenY-El.screenY):ym=gm=0,El=n),gm)},movementY:function(n){return"movementY"in n?n.movementY:ym}}),O1=zn(Od),mN=K({},Od,{dataTransfer:0}),gN=zn(mN),yN=K({},Tl,{relatedTarget:0}),vm=zn(yN),vN=K({},Ea,{animationName:0,elapsedTime:0,pseudoElement:0}),bN=zn(vN),wN=K({},Ea,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),TN=zn(wN),EN=K({},Ea,{data:0}),N1=zn(EN),SN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_N={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 AN(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=kN[n])?!!a[n]:!1}function bm(){return AN}var ON=K({},Tl,{key:function(n){if(n.key){var a=SN[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=_d(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?_N[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bm,charCode:function(n){return n.type==="keypress"?_d(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?_d(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),NN=zn(ON),xN=K({},Od,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),x1=zn(xN),CN=K({},Ea,{submitter:0}),IN=zn(CN),RN=K({},Tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bm}),jN=zn(RN),MN=K({},Ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),DN=zn(MN),UN=K({},Od,{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}),BN=zn(UN),LN=K({},Ea,{newState:0,oldState:0,source:0}),zN=zn(LN),$N=[9,13,27,32],wm=Ur&&"CompositionEvent"in window,Sl=null;Ur&&"documentMode"in document&&(Sl=document.documentMode);var VN=Ur&&"TextEvent"in window&&!Sl,C1=Ur&&(!wm||Sl&&8<Sl&&11>=Sl),I1=" ",R1=!1;function j1(n,a){switch(n){case"keyup":return $N.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M1(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ro=!1;function PN(n,a){switch(n){case"compositionend":return M1(a);case"keypress":return a.which!==32?null:(R1=!0,I1);case"textInput":return n=a.data,n===I1&&R1?null:n;default:return null}}function GN(n,a){if(Ro)return n==="compositionend"||!wm&&j1(n,a)?(n=k1(),Sd=mm=Ta=null,Ro=!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 C1&&a.locale!=="ko"?null:a.data;default:return null}}var FN={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 D1(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!FN[n.type]:a==="textarea"}function U1(n,a,o,l){Co?Io?Io.push(l):Io=[l]:Co=l,a=xf(a,"onChange"),0<a.length&&(o=new Ad("onChange","change",null,o,l),n.push({event:o,listeners:a}))}var _l=null,kl=null;function HN(n){S2(n,0)}function Nd(n){var a=vl(n);if(y1(a))return n}function B1(n,a){if(n==="change")return a}var L1=!1;if(Ur){var Tm;if(Ur){var Em="oninput"in document;if(!Em){var z1=document.createElement("div");z1.setAttribute("oninput","return;"),Em=typeof z1.oninput=="function"}Tm=Em}else Tm=!1;L1=Tm&&(!document.documentMode||9<document.documentMode)}function $1(){_l&&(_l.detachEvent("onpropertychange",V1),kl=_l=null)}function V1(n){if(n.propertyName==="value"&&Nd(kl)){var a=[];U1(a,kl,n,fm(n)),_1(HN,a)}}function qN(n,a,o){n==="focusin"?($1(),_l=a,kl=o,_l.attachEvent("onpropertychange",V1)):n==="focusout"&&$1()}function ZN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Nd(kl)}function YN(n,a){if(n==="click")return Nd(a)}function WN(n,a){if(n==="input"||n==="change")return Nd(a)}function XN(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var ls=typeof Object.is=="function"?Object.is:XN;function Al(n,a){if(ls(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 d=o[l];if(!fl.call(a,d)||!ls(n[d],a[d]))return!1}return!0}function Sm(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 P1(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function G1(n,a){var o=P1(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=P1(o)}}function F1(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?F1(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function H1(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=Sm(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=Sm(n.document)}return a}function _m(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 JN=Ur&&"documentMode"in document&&11>=document.documentMode,jo=null,km=null,Ol=null,Am=!1;function q1(n,a,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Am||jo==null||jo!==Sm(l)||(l=jo,"selectionStart"in l&&_m(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}),Ol&&Al(Ol,l)||(Ol=l,l=xf(km,"onSelect"),0<l.length&&(a=new Ad("onSelect","select",null,a,o),n.push({event:a,listeners:l}),a.target=jo)))}function Si(n,a){var o={};return o[n.toLowerCase()]=a.toLowerCase(),o["Webkit"+n]="webkit"+a,o["Moz"+n]="moz"+a,o}var Mo={animationend:Si("Animation","AnimationEnd"),animationiteration:Si("Animation","AnimationIteration"),animationstart:Si("Animation","AnimationStart"),transitionrun:Si("Transition","TransitionRun"),transitionstart:Si("Transition","TransitionStart"),transitioncancel:Si("Transition","TransitionCancel"),transitionend:Si("Transition","TransitionEnd")},Om={},Z1={};Ur&&(Z1=document.createElement("div").style,"AnimationEvent"in window||(delete Mo.animationend.animation,delete Mo.animationiteration.animation,delete Mo.animationstart.animation),"TransitionEvent"in window||delete Mo.transitionend.transition);function _i(n){if(Om[n])return Om[n];if(!Mo[n])return n;var a=Mo[n],o;for(o in a)if(a.hasOwnProperty(o)&&o in Z1)return Om[n]=a[o];return n}var Y1=_i("animationend"),W1=_i("animationiteration"),X1=_i("animationstart"),KN=_i("transitionrun"),QN=_i("transitionstart"),ex=_i("transitioncancel"),J1=_i("transitionend"),K1=new Map,Nm="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(" ");Nm.push("scrollEnd");function Vs(n,a){K1.set(n,a),Ei(a,[n])}var tx=0;function Br(n,a){if(n.name!=null&&n.name!=="auto")return n.name;if(a.autoName!==null)return a.autoName;n=Hs.identifierPrefix;var o=tx++;return n="_"+n+"t_"+o.toString(32)+"_",a.autoName=n}function Q1(n){if(n==null||typeof n=="string")return n;var a=null,o=ec;if(o!==null)for(var l=0;l<o.length;l++){var d=n[o[l]];if(d!=null){if(d==="none")return"none";a=a==null?d:a+(" "+d)}}return a??n.default}function Lr(n,a){return n=Q1(n),a=Q1(a),a==null?n==="auto"?null:n:a==="auto"?null:a}var xd=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)},ks=[],Do=0,xm=0;function Cd(){for(var n=Do,a=xm=Do=0;a<n;){var o=ks[a];ks[a++]=null;var l=ks[a];ks[a++]=null;var d=ks[a];ks[a++]=null;var h=ks[a];if(ks[a++]=null,l!==null&&d!==null){var v=l.pending;v===null?d.next=d:(d.next=v.next,v.next=d),l.pending=d}h!==0&&ew(o,d,h)}}function Id(n,a,o,l){ks[Do++]=n,ks[Do++]=a,ks[Do++]=o,ks[Do++]=l,xm|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function Cm(n,a,o,l){return Id(n,a,o,l),Rd(n)}function ki(n,a){return Id(n,null,null,a),Rd(n)}function ew(n,a,o){n.lanes|=o;var l=n.alternate;l!==null&&(l.lanes|=o);for(var d=!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||(d=!0)),n=h,h=h.return;return n.tag===3?(h=n.stateNode,d&&a!==null&&(d=31-os(o),n=h.hiddenUpdates,l=n[d],l===null?n[d]=[a]:l.push(a),a.lane=o|536870912),h):null}function Rd(n){if(50<Wl)throw Wl=0,Ef=null,Error(r(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var Uo={};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 Xn(n,a,o,l){return new nx(n,a,o,l)}function Im(n){return n=n.prototype,!(!n||!n.isReactComponent)}function zr(n,a){var o=n.alternate;return o===null?(o=Xn(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 tw(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 jd(n,a,o,l,d,h){var v=0;if(l=n,typeof l=="function")Im(l)&&(v=1);else if(typeof l=="string")v=CC(n,o,ue.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(l){case z:return n=Xn(31,o,a,d),n.elementType=z,n.lanes=h,n;case G:return Ai(o.children,d,h,a);case U:v=8,d|=24;break;case H:return n=Xn(12,o,a,d|2),n.elementType=H,n.lanes=h,n;case I:return n=Xn(13,o,a,d),n.elementType=I,n.lanes=h,n;case D:return n=Xn(19,o,a,d),n.elementType=D,n.lanes=h,n;case ie:case R:return n=d|32,n=Xn(30,o,a,n),n.elementType=R,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 M:v=10;break e;case $:v=9;break e;case k:v=11;break e;case L:v=14;break e;case X:v=16,l=null;break e}v=29,o=Error(r(130,n===null?"null":typeof n,"")),l=null}return a=Xn(v,o,a,d),a.elementType=n,a.type=l,a.lanes=h,a}function Ai(n,a,o,l){return n=Xn(7,n,l,a),n.lanes=o,n}function Rm(n,a,o){return n=Xn(6,n,null,a),n.lanes=o,n}function nw(n){var a=Xn(18,null,null,0);return a.stateNode=n,a}function jm(n,a,o){return a=Xn(4,n.children!==null?n.children:[],n.key,a),a.lanes=o,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var sw=new WeakMap;function As(n,a){if(typeof n=="object"&&n!==null){var o=sw.get(n);return o!==void 0?o:(a={value:n,source:a,stack:fd(a)},sw.set(n,a),a)}return{value:n,source:a,stack:fd(a)}}var Bo=[],Lo=0,Md=null,Nl=0,Os=[],Ns=0,Sa=null,ar=1,ir="";function $r(n,a){Bo[Lo++]=Nl,Bo[Lo++]=Md,Md=n,Nl=a}function rw(n,a,o){Os[Ns++]=ar,Os[Ns++]=ir,Os[Ns++]=Sa,Sa=n;var l=ar;n=ir;var d=32-os(l)-1;l&=~(1<<d),o+=1;var h=32-os(a)+d;if(30<h){var v=d-d%5;h=(l&(1<<v)-1).toString(32),l>>=v,d-=v,ar=1<<32-os(a)+d|o<<d|l,ir=h+n}else ar=1<<h|o<<d|l,ir=n}function Dd(n){n.return!==null&&($r(n,1),rw(n,1,0))}function Mm(n){for(;n===Md;)Md=Bo[--Lo],Bo[Lo]=null,Nl=Bo[--Lo],Bo[Lo]=null;for(;n===Sa;)Sa=Os[--Ns],Os[Ns]=null,ir=Os[--Ns],Os[Ns]=null,ar=Os[--Ns],Os[Ns]=null}function aw(n,a){Os[Ns++]=ar,Os[Ns++]=ir,Os[Ns++]=Sa,ar=a.id,ir=a.overflow,Sa=n}var mn=null,It=null,Ke=!1,_a=null,xs=!1,Dm=Error(r(519));function ka(n){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xl(As(a,n)),Dm}function iw(n){var a=n.stateNode,o=n.type,l=n.memoizedProps;switch(a[Sn]=n,a[Wn]=l,o){case"dialog":tt("cancel",a),tt("close",a);break;case"iframe":case"object":case"embed":tt("load",a);break;case"video":case"audio":for(o=0;o<Jl.length;o++)tt(Jl[o],a);break;case"source":tt("error",a);break;case"img":case"image":case"link":tt("error",a),tt("load",a);break;case"details":tt("toggle",a);break;case"input":tt("invalid",a),v1(a,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":tt("invalid",a);break;case"textarea":tt("invalid",a),w1(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||O2(a.textContent,o)?(l.popover!=null&&(tt("beforetoggle",a),tt("toggle",a)),l.onScroll!=null&&tt("scroll",a),l.onScrollEnd!=null&&tt("scrollend",a),l.onClick!=null&&(a.onclick=rr),a=!0):a=!1,a||ka(n,!0)}function Ud(n){for(mn=n.return;mn;)switch(mn.tag){case 5:case 31:case 13:xs=!1;return;case 27:case 3:xs=!0;return;default:mn=mn.return}}function zo(n){if(n!==mn)return!1;if(!Ke)return Ud(n),Ke=!0,!1;var a=n.tag,o;if((o=a!==3&&a!==27)&&((o=a===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||d0(n.type,n.memoizedProps)),o=!o),o&&It&&ka(n),Ud(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));It=q2(n)}else if(a===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));It=q2(n)}else a===27?(a=It,Va(n.type)?(n=w0,w0=null,It=n):It=a):It=mn?Is(n.stateNode.nextSibling):null;return!0}function Oi(){It=mn=null,Ke=!1}function Um(){var n=_a;return n!==null&&(Qn===null?Qn=n:Qn.push.apply(Qn,n),_a=null),n}function xl(n){_a===null?_a=[n]:_a.push(n)}var Bm=te(null),Ni=null,Vr=null;function Aa(n,a,o){he(Bm,a._currentValue),a._currentValue=o}function Pr(n){n._currentValue=Bm.current,de(Bm)}function Bd(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 Lm(n,a,o,l){var d=n.child;for(d!==null&&(d.return=n);d!==null;){var h=d.dependencies;if(h!==null){var v=d.child;h=h.firstContext;e:for(;h!==null;){var _=h;h=d;for(var B=0;B<a.length;B++)if(_.context===a[B]){h.lanes|=o,_=h.alternate,_!==null&&(_.lanes|=o),Bd(h.return,o,n),l||(v=null);break e}h=_.next}}else if(d.tag===18){if(v=d.return,v===null)throw Error(r(341));v.lanes|=o,h=v.alternate,h!==null&&(h.lanes|=o),Bd(v,o,n),v=null}else d.tag===13&&d.memoizedState!==null&&d.memoizedState.dehydrated===null?(d.lanes|=o,v=d.alternate,v!==null&&(v.lanes|=o),Bd(d.return,o,n),v=d.child,v=v!==null?v.sibling:null):v=d.child;if(v!==null)v.return=d;else for(v=d;v!==null;){if(v===n){v=null;break}if(d=v.sibling,d!==null){d.return=v.return,v=d;break}v=v.return}d=v}}function xi(n,a,o,l){n=null;for(var d=a,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var v=d.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var _=d.type;ls(d.pendingProps.value,v.value)||(n!==null?n.push(_):n=[_])}}else if(d===Mt.current){if(v=d.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(n!==null?n.push(uc):n=[uc])}d=d.return}return n!==null&&Lm(a,n,o,l),a.flags|=262144,n!==null}function Ld(n){for(n=n.firstContext;n!==null;){if(!ls(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ci(n){Ni=n,Vr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function _n(n){return ow(Ni,n)}function zd(n,a){return Ni===null&&Ci(n),ow(n,a)}function ow(n,a){var o=a._currentValue;if(a={context:a,memoizedValue:o,next:null},Vr===null){if(n===null)throw Error(r(308));Vr=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else Vr=Vr.next=a;return o}var sx=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()})}},rx=e.unstable_scheduleCallback,ax=e.unstable_NormalPriority,Jt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zm(){return{controller:new sx,data:new Map,refCount:0}}function Cl(n){n.refCount--,n.refCount===0&&rx(ax,function(){n.controller.abort()})}function cw(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 Il=null;function ix(n){var a=n.transitionTypes;return n.transitionTypes=null,a}var Rl=null,$m=0,Ii=0,$o=null;function ox(n,a){if(Rl===null){var o=Rl=[];$m=0,Ii=n0(),$o={status:"pending",value:void 0,then:function(l){o.push(l)}}}return $m++,a.then(lw,lw),a}function lw(){if(--$m===0&&(Il=null,Rl!==null)){$o!==null&&($o.status="fulfilled");var n=Rl;Rl=null,Ii=0,$o=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function cx(n,a){var o=[],l={status:"pending",value:null,reason:null,then:function(d){o.push(d)}};return n.then(function(){l.status="fulfilled",l.value=a;for(var d=0;d<o.length;d++)(0,o[d])(a)},function(d){for(l.status="rejected",l.reason=d,d=0;d<o.length;d++)(0,o[d])(void 0)}),l}var uw=be.S;be.S=function(n,a){if(n2=Ln(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&ox(n,a),Il!==null)for(var o=rc;o!==null;)cw(o,Il),o=o.next;if(o=n.types,o!==null){for(var l=rc;l!==null;)cw(l,o),l=l.next;if(Ii!==0){l=Il,l===null&&(l=Il=[]);for(var d=0;d<o.length;d++){var h=o[d];l.indexOf(h)===-1&&l.push(h)}}}uw!==null&&uw(n,a)};var Ri=te(null);function Vm(){var n=Ri.current;return n!==null?n:Nt.pooledCache}function $d(n,a){a===null?he(Ri,Ri.current):he(Ri,a.pool)}function dw(){var n=Vm();return n===null?null:{parent:Jt._currentValue,pool:n}}var Vo=Error(r(460)),Pm=Error(r(474)),Vd=Error(r(542)),Pd={then:function(){}};function fw(n){return n=n.status,n==="fulfilled"||n==="rejected"}function hw(n,a,o){switch(o=n[o],o===void 0?n.push(a):o!==a&&(a.then(rr,rr),a=o),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,mw(n),n===void 0&&!("reason"in a)?Error(r(600)):n;default:if(typeof a.status=="string")a.then(rr,rr);else{if(n=Nt,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=a,n.status="pending",n.then(function(l){if(a.status==="pending"){var d=a;d.status="fulfilled",d.value=l}},function(l){if(a.status==="pending"){var d=a;d.status="rejected",d.reason=l}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,mw(n),n}throw Mi=a,Vo}}function ji(n){try{var a=n._init;return a(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Mi=o,Vo):o}}var Mi=null;function pw(){if(Mi===null)throw Error(r(459));var n=Mi;return Mi=null,n}function mw(n){if(n===Vo||n===Vd)throw Error(r(483))}var Po=null,jl=0;function Gd(n){var a=jl;return jl+=1,Po===null&&(Po=[]),hw(Po,n,a)}function Oa(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function Fd(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 gw(n){function a(ee,q){if(n){var se=ee.deletions;se===null?(ee.deletions=[q],ee.flags|=16):se.push(q)}}function o(ee,q){if(!n)return null;for(;q!==null;)a(ee,q),q=q.sibling;return null}function l(ee){for(var q=new Map;ee!==null;)ee.key===null?q.set(ee.index,ee):q.set(ee.key,ee),ee=ee.sibling;return q}function d(ee,q){return ee=zr(ee,q),ee.index=0,ee.sibling=null,ee}function h(ee,q,se){return ee.index=se,n?(se=ee.alternate,se!==null?(se=se.index,se<q?(ee.flags|=2,q):se):(ee.flags|=134217730,q)):(ee.flags|=1048576,q)}function v(ee){return n&&ee.alternate===null&&(ee.flags|=134217730),ee}function _(ee,q,se,me){return q===null||q.tag!==6?(q=Rm(se,ee.mode,me),q.return=ee,q):(q=d(q,se),q.return=ee,q)}function B(ee,q,se,me){var Ie=se.type;return Ie===G?(ee=oe(ee,q,se.props.children,me,se.key),Oa(ee,se),ee):q!==null&&(q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===X&&ji(Ie)===q.type)?(q=d(q,se.props),Oa(q,se),q.return=ee,q):(q=jd(se.type,se.key,se.props,null,ee.mode,me),Oa(q,se),q.return=ee,q)}function ne(ee,q,se,me){return q===null||q.tag!==4||q.stateNode.containerInfo!==se.containerInfo||q.stateNode.implementation!==se.implementation?(q=jm(se,ee.mode,me),q.return=ee,q):(q=d(q,se.children||[]),q.return=ee,q)}function oe(ee,q,se,me,Ie){return q===null||q.tag!==7?(q=Ai(se,ee.mode,me,Ie),q.return=ee,q):(q=d(q,se),q.return=ee,q)}function ge(ee,q,se){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Rm(""+q,ee.mode,se),q.return=ee,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case O:return se=jd(q.type,q.key,q.props,null,ee.mode,se),Oa(se,q),se.return=ee,se;case x:return q=jm(q,ee.mode,se),q.return=ee,q;case X:return q=ji(q),ge(ee,q,se)}if(Ae(q)||pe(q))return q=Ai(q,ee.mode,se,null),q.return=ee,q;if(typeof q.then=="function")return ge(ee,Gd(q),se);if(q.$$typeof===M)return ge(ee,zd(ee,q),se);Fd(ee,q)}return null}function Q(ee,q,se,me){var Ie=q!==null?q.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Ie!==null?null:_(ee,q,""+se,me);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case O:return se.key===Ie?B(ee,q,se,me):null;case x:return se.key===Ie?ne(ee,q,se,me):null;case X:return se=ji(se),Q(ee,q,se,me)}if(Ae(se)||pe(se))return Ie!==null?null:oe(ee,q,se,me,null);if(typeof se.then=="function")return Q(ee,q,Gd(se),me);if(se.$$typeof===M)return Q(ee,q,zd(ee,se),me);Fd(ee,se)}return null}function re(ee,q,se,me,Ie){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return ee=ee.get(se)||null,_(q,ee,""+me,Ie);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case O:return ee=ee.get(me.key===null?se:me.key)||null,B(q,ee,me,Ie);case x:return ee=ee.get(me.key===null?se:me.key)||null,ne(q,ee,me,Ie);case X:return me=ji(me),re(ee,q,se,me,Ie)}if(Ae(me)||pe(me))return ee=ee.get(se)||null,oe(q,ee,me,Ie,null);if(typeof me.then=="function")return re(ee,q,se,Gd(me),Ie);if(me.$$typeof===M)return re(ee,q,se,zd(q,me),Ie);Fd(q,me)}return null}function ke(ee,q,se,me){for(var Ie=null,ot=null,Ue=q,$e=q=0,en=null;Ue!==null&&$e<se.length;$e++){Ue.index>$e?(en=Ue,Ue=null):en=Ue.sibling;var ut=Q(ee,Ue,se[$e],me);if(ut===null){Ue===null&&(Ue=en);break}n&&Ue&&ut.alternate===null&&a(ee,Ue),q=h(ut,q,$e),ot===null?Ie=ut:ot.sibling=ut,ot=ut,Ue=en}if($e===se.length)return o(ee,Ue),Ke&&$r(ee,$e),Ie;if(Ue===null){for(;$e<se.length;$e++)Ue=ge(ee,se[$e],me),Ue!==null&&(q=h(Ue,q,$e),ot===null?Ie=Ue:ot.sibling=Ue,ot=Ue);return Ke&&$r(ee,$e),Ie}for(Ue=l(Ue);$e<se.length;$e++)en=re(Ue,ee,$e,se[$e],me),en!==null&&(n&&(ut=en.alternate,ut!==null&&Ue.delete(ut.key===null?$e:ut.key)),q=h(en,q,$e),ot===null?Ie=en:ot.sibling=en,ot=en);return n&&Ue.forEach(function(qa){return a(ee,qa)}),Ke&&$r(ee,$e),Ie}function Re(ee,q,se,me){if(se==null)throw Error(r(151));for(var Ie=null,ot=null,Ue=q,$e=q=0,en=null,ut=se.next();Ue!==null&&!ut.done;$e++,ut=se.next()){Ue.index>$e?(en=Ue,Ue=null):en=Ue.sibling;var qa=Q(ee,Ue,ut.value,me);if(qa===null){Ue===null&&(Ue=en);break}n&&Ue&&qa.alternate===null&&a(ee,Ue),q=h(qa,q,$e),ot===null?Ie=qa:ot.sibling=qa,ot=qa,Ue=en}if(ut.done)return o(ee,Ue),Ke&&$r(ee,$e),Ie;if(Ue===null){for(;!ut.done;$e++,ut=se.next())ut=ge(ee,ut.value,me),ut!==null&&(q=h(ut,q,$e),ot===null?Ie=ut:ot.sibling=ut,ot=ut);return Ke&&$r(ee,$e),Ie}for(Ue=l(Ue);!ut.done;$e++,ut=se.next())ut=re(Ue,ee,$e,ut.value,me),ut!==null&&(n&&(en=ut.alternate,en!==null&&Ue.delete(en.key===null?$e:en.key)),q=h(ut,q,$e),ot===null?Ie=ut:ot.sibling=ut,ot=ut);return n&&Ue.forEach(function(PC){return a(ee,PC)}),Ke&&$r(ee,$e),Ie}function Xe(ee,q,se,me){if(typeof se=="object"&&se!==null&&se.type===G&&se.key===null&&se.props.ref===void 0&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case O:e:{for(var Ie=se.key;q!==null;){if(q.key===Ie){if(Ie=se.type,Ie===G){if(q.tag===7){o(ee,q.sibling),me=d(q,se.props.children),Oa(me,se),me.return=ee,ee=me;break e}}else if(q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===X&&ji(Ie)===q.type){o(ee,q.sibling),me=d(q,se.props),Oa(me,se),me.return=ee,ee=me;break e}o(ee,q);break}else a(ee,q);q=q.sibling}se.type===G?(me=Ai(se.props.children,ee.mode,me,se.key),Oa(me,se),me.return=ee,ee=me):(me=jd(se.type,se.key,se.props,null,ee.mode,me),Oa(me,se),me.return=ee,ee=me)}return v(ee);case x:e:{for(Ie=se.key;q!==null;){if(q.key===Ie)if(q.tag===4&&q.stateNode.containerInfo===se.containerInfo&&q.stateNode.implementation===se.implementation){o(ee,q.sibling),me=d(q,se.children||[]),me.return=ee,ee=me;break e}else{o(ee,q);break}else a(ee,q);q=q.sibling}me=jm(se,ee.mode,me),me.return=ee,ee=me}return v(ee);case X:return se=ji(se),Xe(ee,q,se,me)}if(Ae(se))return ke(ee,q,se,me);if(pe(se)){if(Ie=pe(se),typeof Ie!="function")throw Error(r(150));return se=Ie.call(se),Re(ee,q,se,me)}if(typeof se.then=="function")return Xe(ee,q,Gd(se),me);if(se.$$typeof===M)return Xe(ee,q,zd(ee,se),me);Fd(ee,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,q!==null&&q.tag===6?(o(ee,q.sibling),me=d(q,se),me.return=ee,ee=me):(o(ee,q),me=Rm(se,ee.mode,me),me.return=ee,ee=me),v(ee)):o(ee,q)}return function(ee,q,se,me){try{jl=0;var Ie=Xe(ee,q,se,me);return Po=null,Ie}catch(Ue){if(Ue===Vo||Ue===Vd)throw Ue;var ot=Xn(29,Ue,null,ee.mode);return ot.lanes=me,ot.return=ee,ot}}}var Di=gw(!0),yw=gw(!1),Na=!1;function Gm(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fm(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 xa(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ca(n,a,o){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(ht&2)!==0){var d=l.pending;return d===null?a.next=a:(a.next=d.next,d.next=a),l.pending=a,a=Rd(n),ew(n,null,o),a}return Id(n,l,a,o),Rd(n)}function Ml(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,r1(n,o)}}function Hm(n,a){var o=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var d=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?d=h=v:h=h.next=v,o=o.next}while(o!==null);h===null?d=h=a:h=h.next=a}else d=h=a;o={baseState:l.baseState,firstBaseUpdate:d,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 qm=!1;function Dl(){if(qm){var n=$o;if(n!==null)throw n}}function Ul(n,a,o,l){qm=!1;var d=n.updateQueue;Na=!1;var h=d.firstBaseUpdate,v=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var B=_,ne=B.next;B.next=null,v===null?h=ne:v.next=ne,v=B;var oe=n.alternate;oe!==null&&(oe=oe.updateQueue,_=oe.lastBaseUpdate,_!==v&&(_===null?oe.firstBaseUpdate=ne:_.next=ne,oe.lastBaseUpdate=B))}if(h!==null){var ge=d.baseState;v=0,oe=ne=B=null,_=h;do{var Q=_.lane&-536870913,re=Q!==_.lane;if(re?(it&Q)===Q:(l&Q)===Q){Q!==0&&Q===Ii&&(qm=!0),oe!==null&&(oe=oe.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=K({},ge,Q);break e;case 2:Na=!0}}Q=_.callback,Q!==null&&(n.flags|=64,re&&(n.flags|=8192),re=d.callbacks,re===null?d.callbacks=[Q]:re.push(Q))}else re={lane:Q,tag:_.tag,payload:_.payload,callback:_.callback,next:null},oe===null?(ne=oe=re,B=ge):oe=oe.next=re,v|=Q;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;re=_,_=re.next,re.next=null,d.lastBaseUpdate=re,d.shared.pending=null}}while(!0);oe===null&&(B=ge),d.baseState=B,d.firstBaseUpdate=ne,d.lastBaseUpdate=oe,h===null&&(d.shared.lanes=0),Ba|=v,n.lanes=v,n.memoizedState=ge}}function vw(n,a){if(typeof n!="function")throw Error(r(191,n));n.call(a)}function bw(n,a){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)vw(o[n],a)}var Ia=te(null),Hd=te(0);function ww(n,a){n=Zr,he(Hd,n),he(Ia,a),Zr=n|a.baseLanes}function Zm(){he(Hd,Zr),he(Ia,Ia.current)}function Ym(){Zr=Hd.current,de(Ia),de(Hd)}var kn=te(null),Mn=null;function Ra(n){var a=n.alternate;he(An,An.current&1),he(kn,n),Mn===null&&(a===null||Ia.current!==null||a.memoizedState!==null)&&(Mn=n)}function Wm(n){he(An,An.current),he(kn,n),Mn===null&&(Mn=n)}function Tw(n){n.tag===22?(he(An,An.current),he(kn,n),Mn===null&&(Mn=n)):ja()}function ja(){he(An,An.current),he(kn,kn.current)}function us(n){de(kn),Mn===n&&(Mn=null),de(An)}var An=te(0);function Bl(n,a){he(kn,kn.current),he(An,a)}function Xm(n){de(An),de(kn),Mn===n&&(Mn=null)}function qd(n){for(var a=n;a!==null;){if(a.tag===13){var o=a.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||v0(o)||b0(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 Gr=0,We=null,kt=null,Kt=null,Zd=!1,Go=!1,Ui=!1,Yd=0,Ll=0,Fo=null,lx=0;function Pt(){throw Error(r(321))}function Jm(n,a){if(a===null)return!1;for(var o=0;o<a.length&&o<n.length;o++)if(!ls(n[o],a[o]))return!1;return!0}function Km(n,a,o,l,d,h){return Gr=h,We=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,be.H=n===null||n.memoizedState===null?rT:aT,Ui=!1,h=o(l,d),Ui=!1,Go&&(h=Sw(a,o,l,d)),Ew(n),h}function Ew(n){be.H=tf;var a=kt!==null&&kt.next!==null;if(Gr=0,Kt=kt=We=null,Zd=!1,Ll=0,Fo=null,a)throw Error(r(300));n===null||Qt||(n=n.dependencies,n!==null&&Ld(n)&&(Qt=!0))}function Sw(n,a,o,l){We=n;var d=0;do{if(Go&&(Fo=null),Ll=0,Go=!1,25<=d)throw Error(r(301));if(d+=1,Kt=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=yx,h=a(o,l)}while(Go);return h}function ux(){var n=be.H,a=n.useState()[0];return a=typeof a.then=="function"?zl(a):a,n=n.useState()[0],(kt!==null?kt.memoizedState:null)!==n&&(We.flags|=1024),a}function Qm(){var n=Yd!==0;return Yd=0,n}function eg(n,a,o){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~o}function tg(n){if(Zd){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Zd=!1}Gr=0,Kt=kt=We=null,Go=!1,Ll=Yd=0,Fo=null}function $n(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?We.memoizedState=Kt=n:Kt=Kt.next=n,Kt}function Zt(){if(kt===null){var n=We.alternate;n=n!==null?n.memoizedState:null}else n=kt.next;var a=Kt===null?We.memoizedState:Kt.next;if(a!==null)Kt=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},Kt===null?We.memoizedState=Kt=n:Kt=Kt.next=n}return Kt}function Wd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zl(n){var a=Ll;return Ll+=1,Fo===null&&(Fo=[]),n=hw(Fo,n,a),a=We,(Kt===null?a.memoizedState:Kt.next)===null&&(a=a.alternate,be.H=a===null||a.memoizedState===null?rT:aT),n}function Xd(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return zl(n);if(n.$$typeof===J)return;if(n.$$typeof===M)return _n(n)}throw Error(r(438,String(n)))}function ng(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(d){return d.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),o===null&&(o=Wd(),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]=fe;return a.index++,o}function Fr(n,a){return typeof a=="function"?a(n):a}function Jd(n){var a=Zt();return sg(a,kt,n)}function sg(n,a,o){var l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=o;var d=n.baseQueue,h=l.pending;if(h!==null){if(d!==null){var v=d.next;d.next=h.next,h.next=v}a.baseQueue=d=h,l.pending=null}if(h=n.baseState,d===null)n.memoizedState=h;else{a=d.next;var _=v=null,B=null,ne=a,oe=!1;do{var ge=ne.lane&-536870913;if(ge!==ne.lane?(it&ge)===ge:(Gr&ge)===ge){var Q=ne.revertLane;if(Q===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ge===Ii&&(oe=!0);else if((Gr&Q)===Q){ne=ne.next,Q===Ii&&(oe=!0);continue}else ge={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(_=B=ge,v=h):B=B.next=ge,We.lanes|=Q,Ba|=Q;ge=ne.action,Ui&&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},B===null?(_=B=Q,v=h):B=B.next=Q,We.lanes|=ge,Ba|=ge;ne=ne.next}while(ne!==null&&ne!==a);if(B===null?v=h:B.next=_,!ls(h,n.memoizedState)&&(Qt=!0,oe&&(o=$o,o!==null)))throw o;n.memoizedState=h,n.baseState=v,n.baseQueue=B,l.lastRenderedState=h}return d===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function rg(n){var a=Zt(),o=a.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=n;var l=o.dispatch,d=o.pending,h=a.memoizedState;if(d!==null){o.pending=null;var v=d=d.next;do h=n(h,v.action),v=v.next;while(v!==d);ls(h,a.memoizedState)||(Qt=!0),a.memoizedState=h,a.baseQueue===null&&(a.baseState=h),o.lastRenderedState=h}return[h,l]}function _w(n,a,o){var l=We,d=Zt(),h=Ke;if(h){if(o===void 0)throw Error(r(407));o=o()}else o=a();var v=!ls((kt||d).memoizedState,o);if(v&&(d.memoizedState=o,Qt=!0),d=d.queue,og(Ow.bind(null,l,d,n),[n]),n=d.getSnapshot!==a||v||Kt!==null&&(Kt.memoizedState.tag&1)!==0,Ho(n?9:8,{destroy:void 0},Aw.bind(null,l,d,o,a),null),n){if(l.flags|=2048,Nt===null)throw Error(r(349));h||(Gr&127)!==0||kw(l,a,o)}return o}function kw(n,a,o){n.flags|=16384,n={getSnapshot:a,value:o},a=We.updateQueue,a===null?(a=Wd(),We.updateQueue=a,a.stores=[n]):(o=a.stores,o===null?a.stores=[n]:o.push(n))}function Aw(n,a,o,l){a.value=o,a.getSnapshot=l,Nw(a)&&xw(n)}function Ow(n,a,o){return o(function(){Nw(a)&&xw(n)})}function Nw(n){var a=n.getSnapshot;n=n.value;try{var o=a();return!ls(n,o)}catch{return!0}}function xw(n){var a=ki(n,2);a!==null&&es(a,n,2)}function ag(n){var a=$n();if(typeof n=="function"){var o=n;if(n=o(),Ui){wa(!0);try{o()}finally{wa(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:n},a}function Cw(n,a,o,l){return n.baseState=o,sg(n,kt,typeof l=="function"?l:Fr)}function dx(n,a,o,l,d){if(ef(n))throw Error(r(485));if(n=a.action,n!==null){var h={payload:d,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,Iw(a,h)):(h.next=o.next,a.pending=o.next=h)}}function Iw(n,a){var o=a.action,l=a.payload,d=n.state;if(a.isTransition){var h=be.T,v={};v.types=h!==null?h.types:null,be.T=v;try{var _=o(d,l),B=be.S;B!==null&&B(v,_),Rw(n,a,_)}catch(ne){ig(n,a,ne)}finally{h!==null&&v.types!==null&&(h.types=v.types),be.T=h}}else try{h=o(d,l),Rw(n,a,h)}catch(ne){ig(n,a,ne)}}function Rw(n,a,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){jw(n,a,l)},function(l){return ig(n,a,l)}):jw(n,a,o)}function jw(n,a,o){a.status="fulfilled",a.value=o,Mw(a),n.state=o,a=n.pending,a!==null&&(o=a.next,o===a?n.pending=null:(o=o.next,a.next=o,Iw(n,o)))}function ig(n,a,o){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do a.status="rejected",a.reason=o,Mw(a),a=a.next;while(a!==l)}n.action=null}function Mw(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function Dw(n,a){return a}function Uw(n,a){if(Ke){var o=Nt.formState;if(o!==null){e:{var l=We;if(Ke){if(It){t:{for(var d=It,h=xs;d.nodeType!==8;){if(!h){d=null;break t}if(d=Is(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){It=Is(d.nextSibling),l=d.data==="F!";break e}}ka(l)}l=!1}l&&(a=o[0])}}return o=$n(),o.memoizedState=o.baseState=a,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dw,lastRenderedState:a},o.queue=l,o=tT.bind(null,We,l),l.dispatch=o,l=ag(!1),h=fg.bind(null,We,!1,l.queue),l=$n(),d={state:a,dispatch:null,action:n,pending:null},l.queue=d,o=dx.bind(null,We,d,h,o),d.dispatch=o,l.memoizedState=n,[a,o,!1]}function Bw(n){var a=Zt();return Lw(a,kt,n)}function Lw(n,a,o){if(a=sg(n,a,Dw)[0],n=Jd(Fr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var l=zl(a)}catch(v){throw v===Vo?Vd:v}else l=a;a=Zt();var d=a.queue,h=d.dispatch;return o!==a.memoizedState&&(We.flags|=2048,Ho(9,{destroy:void 0},fx.bind(null,d,o),null)),[l,h,n]}function fx(n,a){n.action=a}function zw(n){var a=Zt(),o=kt;if(o!==null)return Lw(a,o,n);Zt(),a=a.memoizedState,o=Zt();var l=o.queue.dispatch;return o.memoizedState=n,[a,l,!1]}function Ho(n,a,o,l){return n={tag:n,create:o,deps:l,inst:a,next:null},a=We.updateQueue,a===null&&(a=Wd(),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 $w(){return Zt().memoizedState}function Kd(n,a,o,l){var d=$n();We.flags|=n,d.memoizedState=Ho(1|a,{destroy:void 0},o,l===void 0?null:l)}function Qd(n,a,o,l){var d=Zt();l=l===void 0?null:l;var h=d.memoizedState.inst;kt!==null&&l!==null&&Jm(l,kt.memoizedState.deps)?d.memoizedState=Ho(a,h,o,l):(We.flags|=n,d.memoizedState=Ho(1|a,h,o,l))}function Vw(n,a){Kd(8390656,8,n,a)}function og(n,a){Qd(2048,8,n,a)}function hx(n){We.flags|=4;var a=We.updateQueue;if(a===null)a=Wd(),We.updateQueue=a,a.events=[n];else{var o=a.events;o===null?a.events=[n]:o.push(n)}}function Pw(n){var a=Zt().memoizedState;return hx({ref:a,nextImpl:n}),function(){if((ht&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Gw(n,a){return Qd(4,2,n,a)}function Fw(n,a){return Qd(4,4,n,a)}function Hw(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 qw(n,a,o){o=o!=null?o.concat([n]):null,Qd(4,4,Hw.bind(null,a,n),o)}function cg(){}function Zw(n,a){var o=Zt();a=a===void 0?null:a;var l=o.memoizedState;return a!==null&&Jm(a,l[1])?l[0]:(o.memoizedState=[n,a],n)}function Yw(n,a){var o=Zt();a=a===void 0?null:a;var l=o.memoizedState;if(a!==null&&Jm(a,l[1]))return l[0];if(l=n(),Ui){wa(!0);try{n()}finally{wa(!1)}}return o.memoizedState=[l,a],l}function lg(n,a,o){return o===void 0||(Gr&1073741824)!==0&&(it&261930)===0?n.memoizedState=a:(n.memoizedState=o,n=r2(),We.lanes|=n,Ba|=n,o)}function Ww(n,a,o,l){return ls(o,a)?o:Ia.current!==null?(n=lg(n,o,l),ls(n,a)||(Qt=!0),n):(Gr&106)===0||(Gr&1073741824)!==0&&(it&261930)===0?(Qt=!0,n.memoizedState=o):(n=r2(),We.lanes|=n,Ba|=n,a)}function Xw(n,a,o,l,d){var h=_e.p;_e.p=h!==0&&8>h?h:8;var v=be.T,_={};_.types=v!==null?v.types:null,be.T=_,fg(n,!1,a,o);try{var B=d(),ne=be.S;if(ne!==null&&ne(_,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var oe=cx(B,l);$l(n,a,oe,ps(n))}else $l(n,a,l,ps(n))}catch(ge){$l(n,a,{then:function(){},status:"rejected",reason:ge},ps())}finally{_e.p=h,v!==null&&_.types!==null&&(v.types=_.types),be.T=v}}function px(){}function ug(n,a,o,l){if(n.tag!==5)throw Error(r(476));var d=Jw(n).queue;Xw(n,d,a,Pe,o===null?px:function(){return Kw(n),o(l)})}function Jw(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:Fr,lastRenderedState:Pe},next:null};var o={};return a.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:o},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function Kw(n){var a=Jw(n);a.next===null&&(a=n.alternate.memoizedState),$l(n,a.next.queue,{},ps())}function dg(){return _n(uc)}function Qw(){return Zt().memoizedState}function eT(){return Zt().memoizedState}function mx(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var o=ps();n=xa(o);var l=Ca(a,n,o);l!==null&&(es(l,a,o),Ml(l,a,o)),a={cache:zm()},n.payload=a;return}a=a.return}}function gx(n,a,o){var l=ps();o={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ef(n)?nT(a,o):(o=Cm(n,a,o,l),o!==null&&(es(o,n,l),sT(o,a,l)))}function tT(n,a,o){var l=ps();$l(n,a,o,l)}function $l(n,a,o,l){var d={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(ef(n))nT(a,d);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(d.hasEagerState=!0,d.eagerState=_,ls(_,v))return Id(n,a,d,0),Nt===null&&Cd(),!1}catch{}if(o=Cm(n,a,d,l),o!==null)return es(o,n,l),sT(o,a,l),!0}return!1}function fg(n,a,o,l){if(l={lane:2,revertLane:n0(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ef(n)){if(a)throw Error(r(479))}else a=Cm(n,o,l,2),a!==null&&es(a,n,2)}function ef(n){var a=n.alternate;return n===We||a!==null&&a===We}function nT(n,a){Go=Zd=!0;var o=n.pending;o===null?a.next=a:(a.next=o.next,o.next=a),n.pending=a}function sT(n,a,o){if((o&4194048)!==0){var l=a.lanes;l&=n.pendingLanes,o|=l,a.lanes=o,r1(n,o)}}var tf={readContext:_n,use:Xd,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt,useEffectEvent:Pt},rT={readContext:_n,use:Xd,useCallback:function(n,a){return $n().memoizedState=[n,a===void 0?null:a],n},useContext:_n,useEffect:Vw,useImperativeHandle:function(n,a,o){o=o!=null?o.concat([n]):null,Kd(4194308,4,Hw.bind(null,a,n),o)},useLayoutEffect:function(n,a){return Kd(4194308,4,n,a)},useInsertionEffect:function(n,a){Kd(4,2,n,a)},useMemo:function(n,a){var o=$n();a=a===void 0?null:a;var l=n();if(Ui){wa(!0);try{n()}finally{wa(!1)}}return o.memoizedState=[l,a],l},useReducer:function(n,a,o){var l=$n();if(o!==void 0){var d=o(a);if(Ui){wa(!0);try{o(a)}finally{wa(!1)}}}else d=a;return l.memoizedState=l.baseState=d,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:d},l.queue=n,n=n.dispatch=gx.bind(null,We,n),[l.memoizedState,n]},useRef:function(n){var a=$n();return n={current:n},a.memoizedState=n},useState:function(n){n=ag(n);var a=n.queue,o=tT.bind(null,We,a);return a.dispatch=o,[n.memoizedState,o]},useDebugValue:cg,useDeferredValue:function(n,a){var o=$n();return lg(o,n,a)},useTransition:function(){var n=ag(!1);return n=Xw.bind(null,We,n.queue,!0,!1),$n().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,o){var l=We,d=$n();if(Ke){if(o===void 0)throw Error(r(407));o=o()}else{if(o=a(),Nt===null)throw Error(r(349));(it&127)!==0||kw(l,a,o)}d.memoizedState=o;var h={value:o,getSnapshot:a};return d.queue=h,Vw(Ow.bind(null,l,h,n),[n]),l.flags|=2048,Ho(9,{destroy:void 0},Aw.bind(null,l,h,o,a),null),o},useId:function(){var n=$n(),a=Nt.identifierPrefix;if(Ke){var o=ir,l=ar;o=(l&~(1<<32-os(l)-1)).toString(32)+o,a="_"+a+"R_"+o,o=Yd++,0<o&&(a+="H"+o.toString(32)),a+="_"}else o=lx++,a="_"+a+"r_"+o.toString(32)+"_";return n.memoizedState=a},useHostTransitionStatus:dg,useFormState:Uw,useActionState:Uw,useOptimistic:function(n){var a=$n();a.memoizedState=a.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=o,a=fg.bind(null,We,!0,o),o.dispatch=a,[n,a]},useMemoCache:ng,useCacheRefresh:function(){return $n().memoizedState=mx.bind(null,We)},useEffectEvent:function(n){var a=$n(),o={impl:n};return a.memoizedState=o,function(){if((ht&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},aT={readContext:_n,use:Xd,useCallback:Zw,useContext:_n,useEffect:og,useImperativeHandle:qw,useInsertionEffect:Gw,useLayoutEffect:Fw,useMemo:Yw,useReducer:Jd,useRef:$w,useState:function(){return Jd(Fr)},useDebugValue:cg,useDeferredValue:function(n,a){var o=Zt();return Ww(o,kt.memoizedState,n,a)},useTransition:function(){var n=Jd(Fr)[0],a=Zt().memoizedState;return[typeof n=="boolean"?n:zl(n),a]},useSyncExternalStore:_w,useId:Qw,useHostTransitionStatus:dg,useFormState:Bw,useActionState:Bw,useOptimistic:function(n,a){var o=Zt();return Cw(o,kt,n,a)},useMemoCache:ng,useCacheRefresh:eT,useEffectEvent:Pw},yx={readContext:_n,use:Xd,useCallback:Zw,useContext:_n,useEffect:og,useImperativeHandle:qw,useInsertionEffect:Gw,useLayoutEffect:Fw,useMemo:Yw,useReducer:rg,useRef:$w,useState:function(){return rg(Fr)},useDebugValue:cg,useDeferredValue:function(n,a){var o=Zt();return kt===null?lg(o,n,a):Ww(o,kt.memoizedState,n,a)},useTransition:function(){var n=rg(Fr)[0],a=Zt().memoizedState;return[typeof n=="boolean"?n:zl(n),a]},useSyncExternalStore:_w,useId:Qw,useHostTransitionStatus:dg,useFormState:zw,useActionState:zw,useOptimistic:function(n,a){var o=Zt();return kt!==null?Cw(o,kt,n,a):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:ng,useCacheRefresh:eT,useEffectEvent:Pw};function hg(n,a,o,l){a=n.memoizedState,o=o(l,a),o=o==null?a:K({},a,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var pg={enqueueSetState:function(n,a,o){n=n._reactInternals;var l=ps(),d=xa(l);d.payload=a,o!=null&&(d.callback=o),a=Ca(n,d,l),a!==null&&(es(a,n,l),Ml(a,n,l))},enqueueReplaceState:function(n,a,o){n=n._reactInternals;var l=ps(),d=xa(l);d.tag=1,d.payload=a,o!=null&&(d.callback=o),a=Ca(n,d,l),a!==null&&(es(a,n,l),Ml(a,n,l))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var o=ps(),l=xa(o);l.tag=2,a!=null&&(l.callback=a),a=Ca(n,l,o),a!==null&&(es(a,n,o),Ml(a,n,o))}};function iT(n,a,o,l,d,h,v){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,h,v):a.prototype&&a.prototype.isPureReactComponent?!Al(o,l)||!Al(d,h):!0}function oT(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&&pg.enqueueReplaceState(a,a.state,null)}function Bi(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=K({},o));for(var d in n)o[d]===void 0&&(o[d]=n[d])}return o}function cT(n){xd(n)}function lT(n){console.error(n)}function uT(n){xd(n)}function nf(n,a){try{var o=n.onUncaughtError;o(a.value,{componentStack:a.stack})}catch(l){setTimeout(function(){throw l})}}function dT(n,a,o){try{var l=n.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function mg(n,a,o){return o=xa(o),o.tag=3,o.payload={element:null},o.callback=function(){nf(n,a)},o}function fT(n){return n=xa(n),n.tag=3,n}function hT(n,a,o,l){var d=o.type.getDerivedStateFromError;if(typeof d=="function"){var h=l.value;n.payload=function(){return d(h)},n.callback=function(){dT(a,o,l)}}var v=o.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(n.callback=function(){dT(a,o,l),typeof d!="function"&&(La===null?La=new Set([this]):La.add(this));var _=l.stack;this.componentDidCatch(l.value,{componentStack:_!==null?_:""})})}function vx(n,a,o,l,d){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(a=o.alternate,a!==null&&xi(a,o,d,!0),o=kn.current,o!==null){switch(o.tag){case 31:case 13:case 19:return Mn===null?_f():o.alternate===null&&Gt===0&&(Gt=3),o.flags&=-257,o.flags|=65536,o.lanes=d,l===Pd?o.flags|=16384:(a=o.updateQueue,a===null?o.updateQueue=new Set([l]):a.add(l),Qg(n,l,d)),!1;case 22:return o.flags|=65536,l===Pd?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)),Qg(n,l,d)),!1}throw Error(r(435,o.tag))}return Qg(n,l,d),_f(),!1}if(Ke)return a=kn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=d,l!==Dm&&(n=Error(r(422),{cause:l}),xl(As(n,o)))):(l!==Dm&&(a=Error(r(423),{cause:l}),xl(As(a,o))),n=n.current.alternate,n.flags|=65536,d&=-d,n.lanes|=d,l=As(l,o),d=mg(n.stateNode,l,d),Hm(n,d),Gt!==4&&(Gt=2)),!1;var h=Error(r(520),{cause:l});if(h=As(h,o),Yl===null?Yl=[h]:Yl.push(h),Gt!==4&&(Gt=2),a===null)return!0;l=As(l,o),o=a;do{switch(o.tag){case 3:return o.flags|=65536,n=d&-d,o.lanes|=n,n=mg(o.stateNode,l,n),Hm(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"&&(La===null||!La.has(h))))return o.flags|=65536,d&=-d,o.lanes|=d,d=fT(d),hT(d,n,o,l),Hm(o,d),!1;break;case 22:if(o.memoizedState!==null)return o.flags|=65536,!1}o=o.return}while(o!==null);return!1}var gg=Error(r(461)),Qt=!1;function sn(n,a,o,l){a.child=n===null?yw(a,null,o,l):Di(a,n.child,o,l)}function pT(n,a,o,l,d){o=o.render;var h=a.ref;if("ref"in l){var v={};for(var _ in l)_!=="ref"&&(v[_]=l[_])}else v=l;return Ci(a),l=Km(n,a,o,v,h,d),_=Qm(),n!==null&&!Qt?(eg(n,a,d),Hr(n,a,d)):(Ke&&_&&Dd(a),a.flags|=1,sn(n,a,l,d),a.child)}function mT(n,a,o,l,d){if(n===null){var h=o.type;return typeof h=="function"&&!Im(h)&&h.defaultProps===void 0&&o.compare===null?(a.tag=15,a.type=h,gT(n,a,h,l,d)):(n=jd(o.type,null,l,a,a.mode,d),n.ref=a.ref,n.return=a,a.child=n)}if(h=n.child,!_g(n,d)){var v=h.memoizedProps;if(o=o.compare,o=o!==null?o:Al,o(v,l)&&n.ref===a.ref)return Hr(n,a,d)}return a.flags|=1,n=zr(h,l),n.ref=a.ref,n.return=a,a.child=n}function gT(n,a,o,l,d){if(n!==null){var h=n.memoizedProps;if(Al(h,l)&&n.ref===a.ref)if(Qt=!1,a.pendingProps=l=h,_g(n,d))(n.flags&131072)!==0&&(Qt=!0);else return a.lanes=n.lanes,Hr(n,a,d)}return yg(n,a,o,l,d)}function yT(n,a,o,l){var d=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,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~h}else l=0,a.child=null;return vT(n,a,h,o,l)}if((o&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&$d(a,h!==null?h.cachePool:null),h!==null?ww(a,h):Zm(),Tw(a);else return l=a.lanes=536870912,vT(n,a,h!==null?h.baseLanes|o:o,o,l)}else h!==null?($d(a,h.cachePool),ww(a,h),ja(),a.memoizedState=null):(n!==null&&$d(a,null),Zm(),ja());return sn(n,a,d,o),a.child}function Vl(n,a){return n!==null&&n.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function vT(n,a,o,l,d){var h=Vm();return h=h===null?null:{parent:Jt._currentValue,pool:h},a.memoizedState={baseLanes:o,cachePool:h},n!==null&&$d(a,null),Zm(),Tw(a),n!==null&&xi(n,a,l,!0),a.childLanes=d,null}function sf(n,a){return a=rf({mode:a.mode,children:a.children},n.mode),a.ref=n.ref,n.child=a,a.return=n,a}function bT(n,a,o){return Di(a,n.child,null,o),n=sf(a,a.pendingProps),n.flags|=2,us(a),a.memoizedState=null,n}function bx(n,a,o){var l=a.pendingProps,d=(a.flags&128)!==0;if(a.flags&=-129,n===null){if(Ke){if(l.mode==="hidden")return n=sf(a,l),a.lanes=536870912,n.memoizedState={baseLanes:0,cachePool:null},Vl(null,n);if(Wm(a),(n=It)?(n=H2(n,xs),n=n!==null&&n.data==="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:Sa!==null?{id:ar,overflow:ir}:null,retryLane:536870912,hydrationErrors:null},o=nw(n),o.return=a,a.child=o,mn=a,It=null)):n=null,n===null)throw ka(a);return a.lanes=536870912,null}return sf(a,l)}var h=n.memoizedState;if(h!==null){var v=h.dehydrated;if(Wm(a),d)if(a.flags&256)a.flags&=-257,a=bT(n,a,o);else if(a.memoizedState!==null)a.child=n.child,a.flags|=128,a=null;else throw Error(r(558));else if(Qt||xi(n,a,o,!1),d=(o&n.childLanes)!==0,Qt||d){if(Ia.current===null){if(l=Nt,l!==null&&(v=a1(l,o),v!==0&&v!==h.retryLane))throw h.retryLane=v,ki(n,v),es(l,n,v),gg;_f()}a=bT(n,a,o)}else n=h.treeContext,It=Is(v.nextSibling),mn=a,Ke=!0,_a=null,xs=!1,n!==null&&aw(a,n),a=sf(a,l),a.flags|=134221824;return a}return n=zr(n.child,{mode:l.mode,children:l.children}),n.ref=a.ref,a.child=n,n.return=a,n}function qo(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 yg(n,a,o,l,d){return Ci(a),o=Km(n,a,o,l,void 0,d),l=Qm(),n!==null&&!Qt?(eg(n,a,d),Hr(n,a,d)):(Ke&&l&&Dd(a),a.flags|=1,sn(n,a,o,d),a.child)}function wT(n,a,o,l,d,h){return Ci(a),a.updateQueue=null,o=Sw(a,l,o,d),Ew(n),l=Qm(),n!==null&&!Qt?(eg(n,a,h),Hr(n,a,h)):(Ke&&l&&Dd(a),a.flags|=1,sn(n,a,o,h),a.child)}function TT(n,a,o,l,d){if(Ci(a),a.stateNode===null){var h=Uo,v=o.contextType;typeof v=="object"&&v!==null&&(h=_n(v)),h=new o(l,h),a.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=pg,a.stateNode=h,h._reactInternals=a,h=a.stateNode,h.props=l,h.state=a.memoizedState,h.refs={},Gm(a),v=o.contextType,h.context=typeof v=="object"&&v!==null?_n(v):Uo,h.state=a.memoizedState,v=o.getDerivedStateFromProps,typeof v=="function"&&(hg(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&&pg.enqueueReplaceState(h,h.state,null),Ul(a,l,h,d),Dl(),h.state=a.memoizedState),typeof h.componentDidMount=="function"&&(a.flags|=4194308),l=!0}else if(n===null){h=a.stateNode;var _=a.memoizedProps,B=Bi(o,_);h.props=B;var ne=h.context,oe=o.contextType;v=Uo,typeof oe=="object"&&oe!==null&&(v=_n(oe));var ge=o.getDerivedStateFromProps;oe=typeof ge=="function"||typeof h.getSnapshotBeforeUpdate=="function",_=a.pendingProps!==_,oe||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_||ne!==v)&&oT(a,h,l,v),Na=!1;var Q=a.memoizedState;h.state=Q,Ul(a,l,h,d),Dl(),ne=a.memoizedState,_||Q!==ne||Na?(typeof ge=="function"&&(hg(a,o,ge,l),ne=a.memoizedState),(B=Na||iT(a,o,B,l,Q,ne,v))?(oe||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=B):(typeof h.componentDidMount=="function"&&(a.flags|=4194308),l=!1)}else{h=a.stateNode,Fm(n,a),v=a.memoizedProps,oe=Bi(o,v),h.props=oe,ge=a.pendingProps,Q=h.context,ne=o.contextType,B=Uo,typeof ne=="object"&&ne!==null&&(B=_n(ne)),_=o.getDerivedStateFromProps,(ne=typeof _=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==ge||Q!==B)&&oT(a,h,l,B),Na=!1,Q=a.memoizedState,h.state=Q,Ul(a,l,h,d),Dl();var re=a.memoizedState;v!==ge||Q!==re||Na||n!==null&&n.dependencies!==null&&Ld(n.dependencies)?(typeof _=="function"&&(hg(a,o,_,l),re=a.memoizedState),(oe=Na||iT(a,o,oe,l,Q,re,B)||n!==null&&n.dependencies!==null&&Ld(n.dependencies))?(ne||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,re,B),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,re,B)),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=re),h.props=l,h.state=re,h.context=B,l=oe):(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,qo(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=Di(a,n.child,null,d),a.child=Di(a,null,o,d)):sn(n,a,o,d),a.memoizedState=h.state,n=a.child):n=Hr(n,a,d),n}function ET(n,a,o,l){return Oi(),a.flags|=256,sn(n,a,o,l),a.child}var vg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bg(n){return{baseLanes:n,cachePool:dw()}}function wg(n,a,o){return n=n!==null?n.childLanes&~o:0,a&&(n|=hs),n}function ST(n,a,o){var l=a.pendingProps,d=!1,h=(a.flags&128)!==0,v;if((v=h)||(v=n!==null&&n.memoizedState===null?!1:(An.current&2)!==0),v&&(d=!0,a.flags&=-129),v=(a.flags&32)!==0,a.flags&=-33,n===null){if(Ke){if(d?Ra(a):ja(),(n=It)?(n=H2(n,xs),n=n!==null&&n.data!=="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:Sa!==null?{id:ar,overflow:ir}:null,retryLane:536870912,hydrationErrors:null},o=nw(n),o.return=a,a.child=o,mn=a,It=null)):n=null,n===null)throw ka(a);return b0(n)?a.lanes=32:a.lanes=536870912,null}return h=l.children,l=l.fallback,d?(ja(),d=a.mode,h=rf({mode:"hidden",children:h},d),l=Ai(l,d,o,null),h.return=a,l.return=a,h.sibling=l,a.child=h,l=a.child,l.memoizedState=bg(o),l.childLanes=wg(n,v,o),a.memoizedState=vg,Vl(null,l)):(Ra(a),Tg(a,h))}var _=n.memoizedState;if(_!==null){var B=_.dehydrated;if(B!==null)return wx(n,a,h,v,l,B,_,o)}return d?(ja(),d=l.fallback,h=a.mode,_=n.child,B=_.sibling,l=zr(_,{mode:"hidden",children:l.children}),l.subtreeFlags=_.subtreeFlags&1206910976,B!==null?d=zr(B,d):(d=Ai(d,h,o,null),d.flags|=2),d.return=a,l.return=a,l.sibling=d,a.child=l,Vl(null,l),l=a.child,d=n.child.memoizedState,d===null?d=bg(o):(h=d.cachePool,h!==null?(_=Jt._currentValue,h=h.parent!==_?{parent:_,pool:_}:h):h=dw(),d={baseLanes:d.baseLanes|o,cachePool:h}),l.memoizedState=d,l.childLanes=wg(n,v,o),a.memoizedState=vg,Vl(n.child,l)):(Ra(a),o=n.child,n=o.sibling,o=zr(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 Tg(n,a){return a=rf({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function rf(n,a){return n=Xn(22,n,null,a),n.lanes=0,n}function af(n,a,o){return Di(a,n.child,null,o),n=Tg(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function wx(n,a,o,l,d,h,v,_){if(o)return a.flags&256?(Ra(a),a.flags&=-257,af(n,a,_)):a.memoizedState!==null?(ja(),a.child=n.child,a.flags|=128,null):(ja(),h=d.fallback,v=a.mode,d=rf({mode:"visible",children:d.children},v),h=Ai(h,v,_,null),h.flags|=2,d.return=a,h.return=a,d.sibling=h,a.child=d,Di(a,n.child,null,_),d=a.child,d.memoizedState=bg(_),d.childLanes=wg(n,l,_),a.memoizedState=vg,Vl(null,d));if(Ra(a),b0(h)){if(l=h.nextSibling&&h.nextSibling.dataset,l)var B=l.dgst;return l=B,l!==""&&(d=Error(r(419)),d.stack="",d.digest=l,xl({value:d,source:null,stack:null})),af(n,a,_)}if(Qt||xi(n,a,_,!1),l=(_&n.childLanes)!==0,Qt||l){if(Ia.current!==null)return af(n,a,_);if(l=Nt,l!==null&&(d=a1(l,_),d!==0&&d!==v.retryLane))throw v.retryLane=d,ki(n,d),es(l,n,d),gg;return v0(h)||_f(),af(n,a,_)}return v0(h)?(a.flags|=192,a.child=n.child,null):(n=v.treeContext,It=Is(h.nextSibling),mn=a,Ke=!0,_a=null,xs=!1,n!==null&&aw(a,n),a=Tg(a,d.children),a.flags|=134221824,a)}function _T(n,a,o){n.lanes|=a;var l=n.alternate;l!==null&&(l.lanes|=a),Bd(n.return,a,o)}function kT(n){for(var a=null;n!==null;){var o=n.alternate;o!==null&&qd(o)===null&&(a=n),n=n.sibling}return a}function of(n,a,o,l,d,h){var v=n.memoizedState;v===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:d,treeForkCount:h}:(v.isBackwards=a,v.rendering=null,v.renderingStartTime=0,v.last=l,v.tail=o,v.tailMode=d,v.treeForkCount=h)}function Eg(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 Sg(n,a,o){var l=a.pendingProps,d=l.revealOrder,h=l.tail;l=l.children;var v=An.current;if(a.flags&128)return Bl(a,v),null;var _=(v&2)!==0;if(_?(v=v&1|2,a.flags|=128):v&=1,Bl(a,v),d==="backwards"&&n!==null?(Eg(n),sn(n,a,l,o),Eg(n)):sn(n,a,l,o),l=Ke?Nl:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&_T(n,o,a);else if(n.tag===19)_T(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(d){case"backwards":o=kT(a.child),o===null?(d=a.child,a.child=null):(d=o.sibling,o.sibling=null,Eg(a)),of(a,!0,d,null,h,l);break;case"unstable_legacy-backwards":for(o=null,d=a.child,a.child=null;d!==null;){if(n=d.alternate,n!==null&&qd(n)===null){a.child=d;break}n=d.sibling,d.sibling=o,o=d,d=n}of(a,!0,o,null,h,l);break;case"together":of(a,!1,null,null,void 0,l);break;case"independent":a.memoizedState=null;break;default:o=kT(a.child),o===null?(d=a.child,a.child=null):(d=o.sibling,o.sibling=null),of(a,!1,d,o,h,l)}return a.child}function AT(n,a,o){var l=a.pendingProps;return Aa(a,a.type,l.value),sn(n,a,l.children,o),a.child}function Hr(n,a,o){if(n!==null&&(a.dependencies=n.dependencies),Ba|=a.lanes,(o&a.childLanes)===0)if(n!==null){if(xi(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=zr(n,n.pendingProps),a.child=o,o.return=a;n.sibling!==null;)n=n.sibling,o=o.sibling=zr(n,n.pendingProps),o.return=a;o.sibling=null}return a.child}function _g(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&Ld(n)))}function Tx(n,a,o){switch(a.tag){case 3:Es(a,a.stateNode.containerInfo),Aa(a,Jt,n.memoizedState.cache),Oi();break;case 27:case 5:cl(a);break;case 4:Es(a,a.stateNode.containerInfo);break;case 10:Aa(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Wm(a),null;break;case 13:var l=a.memoizedState;if(l!==null){if(l.dehydrated!==null)return Ra(a),a.flags|=128,null;l=xi(n,a,o,!1);var d=a.child.childLanes;return l||(o&d)!==0?ST(n,a,o):(Ra(a),n=Hr(n,a,o),n!==null?n.sibling:null)}Ra(a);break;case 19:if(a.flags&128)return Sg(n,a,o);if(d=(n.flags&128)!==0,l=(o&a.childLanes)!==0,l||(xi(n,a,o,!1),l=(o&a.childLanes)!==0),d){if(l)return Sg(n,a,o);a.flags|=128}if(d=a.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Bl(a,An.current),l)break;return null;case 22:return a.lanes=0,yT(n,a,o,a.pendingProps);case 24:Aa(a,Jt,n.memoizedState.cache)}return Hr(n,a,o)}function OT(n,a,o){if(n!==null)if(n.memoizedProps!==a.pendingProps)Qt=!0;else{if(!_g(n,o)&&(a.flags&128)===0)return Qt=!1,Tx(n,a,o);Qt=(n.flags&131072)!==0}else Qt=!1,Ke&&(a.flags&1048576)!==0&&rw(a,Nl,a.index);switch(a.lanes=0,a.tag){case 16:e:{var l=a.pendingProps;if(n=ji(a.elementType),a.type=n,typeof n=="function")Im(n)?(l=Bi(n,l),a.tag=1,a=TT(null,a,n,l,o)):(a.tag=0,a=yg(null,a,n,l,o));else{if(n!=null){var d=n.$$typeof;if(d===k){a.tag=11,a=pT(null,a,n,l,o);break e}else if(d===L){a.tag=14,a=mT(null,a,n,l,o);break e}else if(d===M){a.tag=10,a.type=n,a=AT(null,a,o);break e}}throw a=Oe(n)||n,Error(r(306,a,""))}}return a;case 0:return yg(n,a,a.type,a.pendingProps,o);case 1:return l=a.type,d=Bi(l,a.pendingProps),TT(n,a,l,d,o);case 3:e:{if(Es(a,a.stateNode.containerInfo),n===null)throw Error(r(387));l=a.pendingProps;var h=a.memoizedState;d=h.element,Fm(n,a),Ul(a,l,null,o);var v=a.memoizedState;if(l=v.cache,Aa(a,Jt,l),l!==h.cache&&Lm(a,[Jt],o,!0),Dl(),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=ET(n,a,l,o);break e}else if(l!==d){d=As(Error(r(424)),a),xl(d),a=ET(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,It=Is(n.firstChild),mn=a,Ke=!0,_a=null,xs=!0,o=yw(a,null,l,o),a.child=o;o;)o.flags=o.flags&-3|134221824,o=o.sibling;else{if(Oi(),l===d){a=Hr(n,a,o);break e}sn(n,a,l,o)}a=a.child}return a;case 26:return qo(n,a),n===null?(o=K2(a.type,null,a.pendingProps,null))?a.memoizedState=o:Ke||(a.stateNode=I2(a.type,a.pendingProps,Le.current,a)):a.memoizedState=K2(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return cl(a),n===null&&Ke&&(l=a.stateNode=Y2(a.type,a.pendingProps,Le.current),mn=a,xs=!0,d=It,Va(a.type)?(w0=d,It=Is(l.firstChild)):It=d),sn(n,a,a.pendingProps.children,o),qo(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&Ke&&((d=l=It)&&(l=mC(l,a.type,a.pendingProps,xs),l!==null?(a.stateNode=l,mn=a,It=Is(l.firstChild),xs=!1,d=!0):d=!1),d||ka(a)),cl(a),d=a.type,h=a.pendingProps,v=n!==null?n.memoizedProps:null,l=h.children,d0(d,h)?l=null:v!==null&&d0(d,v)&&(a.flags|=32),a.memoizedState!==null&&(d=Km(n,a,ux,null,null,o),uc._currentValue=d),qo(n,a),sn(n,a,l,o),a.child;case 6:return n===null&&Ke&&((n=o=It)&&(o=gC(o,a.pendingProps,xs),o!==null?(a.stateNode=o,mn=a,It=null,n=!0):n=!1),n||ka(a)),null;case 13:return ST(n,a,o);case 4:return Es(a,a.stateNode.containerInfo),l=a.pendingProps,n===null?a.child=Di(a,null,l,o):sn(n,a,l,o),a.child;case 11:return pT(n,a,a.type,a.pendingProps,o);case 7:return l=a.pendingProps,qo(n,a),sn(n,a,l,o),a.child;case 8:return sn(n,a,a.pendingProps.children,o),a.child;case 12:return sn(n,a,a.pendingProps.children,o),a.child;case 10:return AT(n,a,o);case 9:return d=a.type._context,l=a.pendingProps.children,Ci(a),d=_n(d),l=l(d),a.flags|=1,sn(n,a,l,o),a.child;case 14:return mT(n,a,a.type,a.pendingProps,o);case 15:return gT(n,a,a.type,a.pendingProps,o);case 19:return Sg(n,a,o);case 31:return bx(n,a,o);case 22:return yT(n,a,o,a.pendingProps);case 24:return Ci(a),l=_n(Jt),n===null?(d=Vm(),d===null&&(d=Nt,h=zm(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=o),d=h),a.memoizedState={parent:l,cache:d},Gm(a),Aa(a,Jt,d)):((n.lanes&o)!==0&&(Fm(n,a),Ul(a,null,null,o),Dl()),d=n.memoizedState,h=a.memoizedState,d.parent!==l?(d={parent:l,cache:l},a.memoizedState=d,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=d),Aa(a,Jt,l)):(l=h.cache,Aa(a,Jt,l),l!==d.cache&&Lm(a,[Jt],o,!0))),sn(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:Ke&&Dd(a),n!==null&&n.memoizedProps.name!==l.name?a.flags|=4194816:qo(n,a),sn(n,a,l.children,o),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function qr(n){n.flags|=4}function kg(n,a,o,l,d){var h;if((h=(n.mode&32)!==0)&&(h=o===null?nE(a,l):nE(a,l)&&(l.src!==o.src||l.srcSet!==o.srcSet)),h){if(n.flags|=16777216,(d&335544128)===d)if(n.stateNode.complete)n.flags|=8192;else if(c2())n.flags|=8192;else throw Mi=Pd,Pm}else n.flags&=-16777217}function NT(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!sE(a))if(c2())n.flags|=8192;else throw Mi=Pd,Pm}function cf(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?n1():536870912,n.lanes|=a,Jo|=a)}function Pl(n,a){if(!Ke)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 Rt(n){var a=n.alternate!==null&&n.alternate.child===n.child,o=0,l=0;if(a)for(var d=n.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags&1206910976,l|=d.flags&1206910976,d.return=n,d=d.sibling;else for(d=n.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=n,d=d.sibling;return n.subtreeFlags|=l,n.childLanes=o,a}function Ex(n,a,o){var l=a.pendingProps;switch(Mm(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(a),null;case 1:return Rt(a),null;case 3:return o=a.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),a.memoizedState.cache!==l&&(a.flags|=2048),Pr(Jt),va(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(zo(a)?qr(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Um())),Rt(a),null;case 26:var d=a.type,h=a.memoizedState;return n===null?(qr(a),h!==null?(Rt(a),NT(a,h)):(Rt(a),kg(a,d,null,l,o))):h?h!==n.memoizedState?(qr(a),Rt(a),NT(a,h)):(Rt(a),a.flags&=-16777217):(n=n.memoizedProps,n!==l&&qr(a),Rt(a),kg(a,d,n,l,o)),null;case 27:if(bi(a),o=Le.current,d=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==l&&qr(a);else{if(!l){if(a.stateNode===null)throw Error(r(166));return Rt(a),a.subtreeFlags&=-33554433,null}n=ue.current,zo(a)?iw(a):(n=Y2(d,l,o),a.stateNode=n,qr(a))}return Rt(a),a.subtreeFlags&=-33554433,null;case 5:if(bi(a),d=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==l&&qr(a);else{if(!l){if(a.stateNode===null)throw Error(r(166));return Rt(a),a.subtreeFlags&=-33554433,null}if(h=ue.current,zo(a))iw(a);else{var v=Ql(Le.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",d);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(d,{is:l.is}):v.createElement(d)}}h[Sn]=a,h[Wn]=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(Nn(h,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&qr(a)}}return Rt(a),a.subtreeFlags&=-33554433,kg(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,o),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==l&&qr(a);else{if(typeof l!="string"&&a.stateNode===null)throw Error(r(166));if(n=Le.current,zo(a)){if(n=a.stateNode,o=a.memoizedProps,l=null,d=mn,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}n[Sn]=a,n=!!(n.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||O2(n.nodeValue,o)),n||ka(a,!0)}else n=Ql(n).createTextNode(l),n[Sn]=a,a.stateNode=n}return Rt(a),null;case 31:if(o=a.memoizedState,n===null||n.memoizedState!==null){if(l=zo(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[Sn]=a}else Oi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Rt(a),n=!1}else o=Um(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return a.flags&256?(us(a),a):(us(a),null);if((a.flags&128)!==0)throw Error(r(558))}return Rt(a),null;case 13:if(l=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(d=zo(a),l!==null&&l.dehydrated!==null){if(n===null){if(!d)throw Error(r(318));if(d=a.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));d[Sn]=a}else Oi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Rt(a),d=!1}else d=Um(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=d),d=!0;if(!d)return a.flags&256?(us(a),a):(us(a),null)}return us(a),(a.flags&128)!==0?(a.lanes=o,a):(o=l!==null,n=n!==null&&n.memoizedState!==null,o&&(l=a.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048)),o!==n&&o&&(a.child.flags|=8192),cf(a,a.updateQueue),Rt(a),null);case 4:return va(),n===null&&i0(a.stateNode.containerInfo),a.flags|=67108864,Rt(a),null;case 10:return Pr(a.type),Rt(a),null;case 19:if(Xm(a),l=a.memoizedState,l===null)return Rt(a),null;if(d=(a.flags&128)!==0,h=l.rendering,h===null)if(d)Pl(l,!1);else{if(Gt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(h=qd(n),h!==null){for(a.flags|=128,Pl(l,!1),n=h.updateQueue,a.updateQueue=n,cf(a,n),a.subtreeFlags=0,n=o,o=a.child;o!==null;)tw(o,n),o=o.sibling;return Bl(a,An.current&1|2),Ke&&$r(a,l.treeForkCount),a.child}n=n.sibling}l.tail!==null&&Ln()>wf&&(a.flags|=128,d=!0,Pl(l,!1),a.lanes=4194304)}else{if(!d)if(n=qd(h),n!==null){if(a.flags|=128,d=!0,n=n.updateQueue,a.updateQueue=n,cf(a,n),Pl(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!h.alternate&&!Ke)return Rt(a),null}else 2*Ln()-l.renderingStartTime>wf&&o!==536870912&&(a.flags|=128,d=!0,Pl(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=Ln(),n.sibling=null,h=An.current,h=d?h&1|2:h&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!o||Ke?Bl(a,h):(o=h,he(kn,a),he(An,o),Mn===null&&(Mn=a)),Ke&&$r(a,l.treeForkCount),n}return Rt(a),null;case 22:case 23:return us(a),Ym(),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&&(Rt(a),a.subtreeFlags&6&&(a.flags|=8192)):Rt(a),o=a.updateQueue,o!==null&&cf(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(Ri),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),Pr(Jt),Rt(a),null;case 25:return null;case 30:return a.flags|=33554432,Rt(a),null}throw Error(r(156,a.tag))}function Sx(n,a){switch(Mm(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Pr(Jt),va(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return bi(a),null;case 31:if(a.memoizedState!==null){if(us(a),a.alternate===null)throw Error(r(340));Oi()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(us(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Oi()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return Xm(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 va(),null;case 10:return Pr(a.type),null;case 22:case 23:return us(a),Ym(),n!==null&&de(Ri),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Pr(Jt),null;case 25:return null;default:return null}}function xT(n,a){switch(Mm(a),a.tag){case 3:Pr(Jt),va();break;case 26:case 27:case 5:bi(a);break;case 4:va();break;case 31:a.memoizedState!==null&&us(a);break;case 13:us(a);break;case 19:Xm(a);break;case 10:Pr(a.type);break;case 22:case 23:us(a),Ym(),n!==null&&de(Ri);break;case 24:Pr(Jt)}}function Gl(n,a){try{var o=a.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var d=l.next;o=d;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!==d)}}catch(_){Tt(a,a.return,_)}}function Ma(n,a,o){try{var l=a.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&n)===n){var v=l.inst,_=v.destroy;if(_!==void 0){v.destroy=void 0,d=a;var B=o,ne=_;try{ne()}catch(oe){Tt(d,B,oe)}}}l=l.next}while(l!==h)}}catch(oe){Tt(a,a.return,oe)}}function CT(n){var a=n.updateQueue;if(a!==null){var o=n.stateNode;try{bw(a,o)}catch(l){Tt(n,n.return,l)}}}function IT(n,a,o){o.props=Bi(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(l){Tt(n,a,l)}}function or(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 d=n.stateNode,h=Br(n.memoizedProps,d);(d.ref===null||d.ref.name!==h)&&(d.ref=L2(h)),l=d.ref;break;case 7:if(n.stateNode===null){var v=new ms(n);y(n.child,!1,hC,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 On(n,a){var o=n.ref,l=n.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(d){Tt(n,a,d)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(d){Tt(n,a,d)}else o.current=null}function lf(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++)F2(n.stateNode,a[o])}function RT(n){for(var a=n.return;a!==null&&(Og(a)&&F2(n.stateNode,a.stateNode),!Ag(a));)a=a.return}function Fl(n){for(var a=n.return;a!==null&&(Og(a)&&pC(n.stateNode,a.stateNode),!Ag(a));)a=a.return}function Ag(n){return n.tag===5||n.tag===3||n.tag===27}function Og(n){return n&&n.tag===7&&n.stateNode!==null}function Ng(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(d){Tt(n,n.return,d)}}function xg(n,a,o){try{var l=n.stateNode;Wx(l,n.type,o,a),l[Wn]=a}catch(d){Tt(n,n.return,d)}}function jT(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Va(n.type)||n.tag===4}function Cg(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||jT(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&&Va(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 Ig(n,a,o,l){var d=n.tag;if(d===5||d===6)d=n.stateNode,a?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(d,a):(a=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,a.appendChild(d),o=o._reactRootContainer,o!=null||a.onclick!==null||(a.onclick=rr)),lf(n,l),dt=!0;else if(d!==4&&(d===27&&(lf(n,l),l=null,Va(n.type)&&(o=n.stateNode,a=null)),n=n.child,n!==null))for(Ig(n,a,o,l),n=n.sibling;n!==null;)Ig(n,a,o,l),n=n.sibling}function uf(n,a,o,l){var d=n.tag;if(d===5||d===6)d=n.stateNode,a?o.insertBefore(d,a):o.appendChild(d),lf(n,l),dt=!0;else if(d!==4&&(d===27&&(lf(n,l),l=null,Va(n.type)&&(o=n.stateNode)),n=n.child,n!==null))for(uf(n,a,o,l),n=n.sibling;n!==null;)uf(n,a,o,l),n=n.sibling}function MT(n){var a=n.stateNode,o=n.memoizedProps;try{for(var l=n.type,d=a.attributes;d.length;)a.removeAttributeNode(d[0]);Nn(a,l,o),a[Sn]=n,a[Wn]=o}catch(h){Tt(n,n.return,h)}}var df=!1,ds=null;function DT(n){(n.tag===30||(n.subtreeFlags&33554432)!==0)&&(df=!0)}var cr=null;function UT(){var n=cr;return cr=null,n}var Jn=0;function Zo(n,a,o,l,d){return Jn=0,BT(n.child,a,o,l,d)}function BT(n,a,o,l,d){for(var h=!1;n!==null;){if(n.tag===5){var v=n.stateNode;if(l!==null){var _=p0(v);l.push(_),_.view&&(h=!0)}else h||p0(v).view&&(h=!0);df=!0,U2(v,Jn===0?a:a+"_"+Jn,o),Jn++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&d||BT(n.child,a,o,l,d)&&(h=!0));n=n.sibling}return h}function lr(n,a){for(;n!==null;)n.tag===5?B2(n.stateNode,n.memoizedProps):(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&a||lr(n.child,a)),n=n.sibling}function ff(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if((n.tag!==22||n.memoizedState===null)&&(ff(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=Lr(a.default,a.share),a!=="none"&&(Zo(n,o,a,null,!1)||lr(n.child,!1))}n=n.sibling}}function Rg(n,a){if(n.tag===30){var o=n.stateNode,l=n.memoizedProps,d=Br(l,o),h=Lr(l.default,o.paired?l.share:l.enter);h!=="none"?Zo(n,d,h,null,!1)?(ff(n),o.paired||a||tc(n,l.onEnter)):lr(n.child,!1):ff(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Rg(n,a),n=n.sibling;else ff(n)}function jg(n){if(ds!==null&&ds.size!==0){var a=ds;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 d=a.get(l);if(d!==void 0){var h=Lr(o.default,o.share);if(h!=="none"&&(Zo(n,l,h,null,!1)?(h=n.stateNode,d.paired=h,h.paired=d,tc(n,o.onShare)):lr(n.child,!1)),a.delete(l),a.size===0)break}}}jg(n)}n=n.sibling}}}function Mg(n){if(n.tag===30){var a=n.memoizedProps,o=Br(a,n.stateNode),l=ds!==null?ds.get(o):void 0,d=Lr(a.default,l!==void 0?a.share:a.exit);d!=="none"&&(Zo(n,o,d,null,!1)?l!==void 0?(d=n.stateNode,l.paired=d,d.paired=l,ds.delete(o),tc(n,a.onShare)):tc(n,a.onExit):lr(n.child,!1)),ds!==null&&jg(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Mg(n),n=n.sibling;else ds!==null&&jg(n)}function LT(n){for(n=n.child;n!==null;){if(n.tag===30){var a=n.memoizedProps,o=Br(a,n.stateNode);a=Lr(a.default,a.update),n.flags&=-5,a!=="none"&&Zo(n,o,a,n.memoizedState=[],!1)}else(n.subtreeFlags&33554432)!==0&&LT(n);n=n.sibling}}function Dg(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,lr(n.child,!1))}Dg(n)}n=n.sibling}}function hf(n){if(n.tag===30)n.stateNode.paired=null,lr(n.child,!1),Dg(n);else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)hf(n),n=n.sibling;else Dg(n)}function zT(n){for(n=n.child;n!==null;)n.tag===30?lr(n.child,!1):(n.subtreeFlags&33554432)!==0&&zT(n),n=n.sibling}function Ug(n,a,o,l,d,h,v){for(var _=!1;a!==null;){if(a.tag===5){var B=a.stateNode;if(h!==null&&Jn<h.length){var ne=h[Jn],oe=p0(B);(ne.view||oe.view)&&(_=!0);var ge;if(ge=(n.flags&4)===0)if(oe.clip)ge=!0;else{ge=ne.rect;var Q=oe.rect;ge=ge.y!==Q.y||ge.x!==Q.x||ge.height!==Q.height||ge.width!==Q.width}ge&&(n.flags|=4),oe.abs?oe=!ne.abs:(ne=ne.rect,oe=oe.rect,oe=ne.height!==oe.height||ne.width!==oe.width),oe&&(n.flags|=32)}else n.flags|=32;(n.flags&4)!==0&&U2(B,Jn===0?o:o+"_"+Jn,d),_&&(n.flags&4)!==0||(cr===null&&(cr=[]),cr.push(B,Jn===0?l:l+"_"+Jn,a.memoizedProps)),Jn++}else(a.tag!==22||a.memoizedState===null)&&(a.tag===30&&v?n.flags|=a.flags&32:Ug(n,a.child,o,l,d,h,v)&&(_=!0));a=a.sibling}return _}function $T(n,a){for(n=n.child;n!==null;){if(n.tag===30){var o=n.memoizedProps,l=n.stateNode,d=Br(o,l),h=Lr(o.default,o.update),v;v=n.memoizedState,n.memoizedState=null,l=n;var _=n.child;Jn=0,d=Ug(l,_,d,d,h,v,!1),(n.flags&4)!==0&&d&&tc(n,o.onUpdate)}else(n.subtreeFlags&33554432)!==0&&$T(n);n=n.sibling}}var gn=!1,mt=!1,ur=!1,Bg=!1,VT=typeof WeakSet=="function"?WeakSet:Set,yn=null,dr=!1,Hl=!1,pf=!1,Lg=!1;function _x(n,a,o){if(n=n.containerInfo,l0=dc,n=H1(n),_m(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var h=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var _=0,B=-1,ne=-1,oe=0,ge=0,Q=n,re=null;t:for(;;){for(var ke;Q!==l||h!==0&&Q.nodeType!==3||(B=_+h),Q!==v||d!==0&&Q.nodeType!==3||(ne=_+d),Q.nodeType===3&&(_+=Q.nodeValue.length),(ke=Q.firstChild)!==null;)re=Q,Q=ke;for(;;){if(Q===n)break t;if(re===l&&++oe===h&&(B=_),re===v&&++ge===d&&(ne=_),(ke=Q.nextSibling)!==null)break;Q=re,re=Q.parentNode}Q=ke}l=B===-1||ne===-1?null:{start:B,end:ne}}else l=null}l=l||{start:0,end:0}}else l=null;for(u0={focusedElem:n,selectionRange:l},dc=!1,o=(o&335544064)===o,yn=a,a=o?9270:1024;yn!==null;){if(n=yn,o&&(l=n.deletions,l!==null))for(h=0;h<l.length;h++)o&&Mg(l[h]);if(n.alternate===null&&(n.flags&2)!==0)o&&DT(n),mf(o);else{if(n.tag===22){if(l=n.alternate,n.memoizedState!==null){l!==null&&l.memoizedState===null&&o&&Mg(l),mf(o);continue}else if(l!==null&&l.memoizedState!==null){o&&DT(n),mf(o);continue}}l=n.child,(n.subtreeFlags&a)!==0&&l!==null?(l.return=n,yn=l):(o&&LT(n),mf(o))}}ds=null}function mf(n){for(;yn!==null;){var a=yn,o=n,l=a.alternate,d=a.flags;switch(a.tag){case 0:case 11:case 15:break;case 1:if((d&1024)!==0&&l!==null){o=void 0,d=l.memoizedProps,l=l.memoizedState;var h=a.stateNode;try{var v=Bi(a.type,d);o=h.getSnapshotBeforeUpdate(v,l),h.__reactInternalSnapshotBeforeUpdate=o}catch(_){Tt(a,a.return,_)}}break;case 3:if((d&1024)!==0){if(l=a.stateNode.containerInfo,o=l.nodeType,o===9)y0(l);else if(o===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":y0(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=Br(l.memoizedProps,l.stateNode),d=a.memoizedProps,d=Lr(d.default,d.update),d!=="none"&&Zo(l,o,d,l.memoizedState=[],!0));break;default:if((d&1024)!==0)throw Error(r(163))}if(l=a.sibling,l!==null){l.return=a.return,yn=l;break}yn=a.return}}function PT(n,a,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:fr(n,o),l&4&&Gl(5,o);break;case 1:if(fr(n,o),l&4)if(n=o.stateNode,a===null)try{n.componentDidMount()}catch(v){Tt(o,o.return,v)}else{var d=Bi(o.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(d,a,n.__reactInternalSnapshotBeforeUpdate)}catch(v){Tt(o,o.return,v)}}l&64&&CT(o),l&512&&or(o,o.return);break;case 3:if(fr(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{bw(n,a)}catch(v){Tt(o,o.return,v)}}break;case 27:a===null&&l&4&&MT(o);case 26:case 5:fr(n,o),a===null&&l&4&&Ng(o),l&512&&or(o,o.return);break;case 12:fr(n,o);break;case 31:fr(n,o),l&4&&qT(n,o);break;case 13:fr(n,o),l&4&&ZT(n,o),l&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=Ux.bind(null,o),yC(n,o))));break;case 22:if(l=o.memoizedState!==null||gn,!l){var h=a!==null&&a.memoizedState!==null||mt;a=gn,d=mt,gn=l,(mt=h)&&!d?(l=2,(o.subtreeFlags&8772)!==0&&(l|=1),Fs(n,o,l)):fr(n,o),gn=a,mt=d}break;case 30:fr(n,o),l&512&&or(o,o.return);break;case 7:l&512&&or(o,o.return);default:fr(n,o)}}function zg(n,a){for(n=n.child;n!==null;)GT(n,a),n=n.sibling}function GT(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 d=n.stateNode,h=n.memoizedProps.style,v=h!=null&&h.hasOwnProperty("display")?h.display:null;d.style.display=v==null||typeof v=="boolean"?"":(""+v).trim()}}catch(B){Tt(n,n.return,B)}$g(n,a);break;case 6:try{n.stateNode.nodeValue=a?"":n.memoizedProps,dt=!0}catch(B){Tt(n,n.return,B)}break;case 18:try{var _=n.stateNode;a?D2(_,!0):D2(n.stateNode,!1)}catch(B){Tt(n,n.return,B)}break;case 22:case 23:n.memoizedState===null&&zg(n,a);break;default:zg(n,a)}}function $g(n,a){if(n.subtreeFlags&67108864)for(n=n.child;n!==null;){e:{var o=n,l=a;switch(o.tag){case 4:GT(o,l);break e;case 22:o.memoizedState===null&&$g(o,l);break e;default:$g(o,l)}}n=n.sibling}}function FT(n){var a=n.alternate;a!==null&&(n.alternate=null,FT(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&bd(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,Kn=!1;function Ps(n,a,o){for(o=o.child;o!==null;)HT(n,a,o),o=o.sibling}function HT(n,a,o){if(is&&typeof is.onCommitFiberUnmount=="function")try{is.onCommitFiberUnmount(pl,o)}catch{}switch(o.tag){case 26:mt||On(o,a),Ps(n,a,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&!mt&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:mt||On(o,a),Fl(o);var l=Bt,d=Kn;Va(o.type)&&(Bt=o.stateNode,Kn=!1),Ps(n,a,o),W2(o.stateNode,o.type,o.memoizedProps),Bt=l,Kn=d;break;case 5:mt||On(o,a),Fl(o);case 6:if(o.tag===6&&Fl(o),l=Bt,d=Kn,Bt=null,Ps(n,a,o),Bt=l,Kn=d,Bt!==null)if(Kn)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&&(Kn?(n=Bt,M2(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),fc(n)):M2(Bt,o.stateNode));break;case 4:l=Bt,d=Kn,Bt=o.stateNode.containerInfo,Kn=!0,Ps(n,a,o),Bt=l,Kn=d;break;case 0:case 11:case 14:case 15:Ma(2,o,a),mt||Ma(4,o,a),Ps(n,a,o);break;case 1:mt||(On(o,a),l=o.stateNode,typeof l.componentWillUnmount=="function"&&IT(o,a,l)),Ps(n,a,o);break;case 21:Ps(n,a,o);break;case 22:mt=(l=mt)||o.memoizedState!==null,Ps(n,a,o),mt=l;break;case 30:On(o,a),Ps(n,a,o);break;case 7:mt||On(o,a),Ps(n,a,o);break;default:Ps(n,a,o)}}function qT(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{fc(n)}catch(o){Tt(a,a.return,o)}}}function ZT(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{fc(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 VT),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new VT),a;default:throw Error(r(435,n.tag))}}function gf(n,a){var o=kx(n);a.forEach(function(l){if(!o.has(l)){o.add(l);var d=Bx.bind(null,n,l);l.then(d,d)}})}function Vn(n,a,o){var l=a.deletions;if(l!==null)for(var d=0;d<l.length;d++){var h=l[d],v=n,_=a,B=_;e:for(;B!==null;){switch(B.tag){case 27:if(Va(B.type)){Bt=B.stateNode,Kn=!1;break e}break;case 5:Bt=B.stateNode,Kn=!1;break e;case 3:case 4:Bt=B.stateNode.containerInfo,Kn=!0;break e}B=B.return}if(Bt===null)throw Error(r(160));HT(v,_,h),Bt=null,Kn=!1,v=h.alternate,v!==null&&(v.return=null),h.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)YT(a,n,o),a=a.sibling}var Gs=null;function YT(n,a,o){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(d&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}Vn(a,n,o),Pn(n),d&4&&(Ma(3,n,n.return),Gl(3,n),Ma(5,n,n.return));break;case 1:Vn(a,n,o),Pn(n),d&512&&(mt||l===null||On(l,l.return)),d&64&&gn&&(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=Gs,Vn(a,n,o),Pn(n),d&512&&(mt||l===null||On(l,l.return)),d&4)if(d=l!==null?l.memoizedState:null,o=n.memoizedState,l===null)if(o===null)if(n.stateNode===null)if(gn)n.stateNode=I2(n.type,n.memoizedProps,a.containerInfo,n);else{e:{a=n.type,o=n.memoizedProps,d=h.ownerDocument||h;t:switch(a){case"title":l=d.getElementsByTagName("title")[0],(!l||l[yl]||l[Sn]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=d.createElement(a),d.head.insertBefore(l,d.querySelector("head > title"))),Nn(l,a,o),l[Sn]=n,pn(l),a=l;break e;case"link":if(h=tE("link","href",d).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=d.createElement(a),Nn(l,a,o),d.head.appendChild(l);break;case"meta":if(h=tE("meta","content",d).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=d.createElement(a),Nn(l,a,o),d.head.appendChild(l);break;default:throw Error(r(468,a))}l[Sn]=n,pn(l),a=l}n.stateNode=a}else gn||_0(h,n.type,n.stateNode);else n.stateNode=eE(h,o,n.memoizedProps);else d!==o?(d===null?(a=l.stateNode,a===null||mt||a.parentNode.removeChild(a)):d.count--,o===null?gn||_0(h,n.type,n.stateNode):eE(h,o,n.memoizedProps)):o===null&&n.stateNode!==null&&xg(n,n.memoizedProps,l.memoizedProps);break;case 27:Vn(a,n,o),Pn(n),d&512&&(mt||l===null||On(l,l.return)),l!==null&&d&4&&xg(n,n.memoizedProps,l.memoizedProps);break;case 5:if(h=ur,ur=!1,Vn(a,n,o),ur=h,Pn(n),d&512&&(mt||l===null||On(l,l.return)),n.flags&32){a=n.stateNode;try{xo(a,""),dt=!0}catch(oe){Tt(n,n.return,oe)}}d&4&&n.stateNode!=null&&(a=n.memoizedProps,xg(n,a,l!==null?l.memoizedProps:a)),d&1024&&(Bg=!0);break;case 6:if(Vn(a,n,o),Pn(n),d&4){if(n.stateNode===null)throw Error(r(162));a=n.memoizedProps,o=n.stateNode;try{o.nodeValue=a,dt=!0}catch(oe){Tt(n,n.return,oe)}}break;case 3:if(dt=!1,If=null,h=Gs,Gs=eu(a.containerInfo),Vn(a,n,o),Gs=h,Pn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{fc(a.containerInfo)}catch(oe){Tt(n,n.return,oe)}Bg&&(Bg=!1,WT(n)),dt=!1;break;case 4:d=ur,ur=gn,l=m1(),h=Gs,Gs=eu(n.stateNode.containerInfo),Vn(a,n,o),Pn(n),Gs=h,dt&&Hl&&(pf=!0),dt=l,ur=d;break;case 12:Vn(a,n,o),Pn(n);break;case 31:Vn(a,n,o),Pn(n),d&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,gf(n,a)));break;case 13:Vn(a,n,o),Pn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(bf=Ln()),d&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,gf(n,a)));break;case 22:h=n.memoizedState!==null,v=l!==null&&l.memoizedState!==null;var _=gn,B=mt,ne=ur;gn=_||h,ur=ne||h,mt=B||v,Vn(a,n,o),mt=B,ur=ne,gn=_,Pn(n),d&8192&&(a=n.stateNode,a._visibility=h?a._visibility&-2:a._visibility|1,!h||l===null||v||gn||mt||(a=v||mt,o=gn,l=mt,gn=h||gn,mt=a,Da(n,2),gn=o,mt=l),!h&&ur||zg(n,h)),d&4&&(a=n.updateQueue,a!==null&&(o=a.retryQueue,o!==null&&(a.retryQueue=null,gf(n,o))));break;case 19:Vn(a,n,o),Pn(n),d&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,gf(n,a)));break;case 30:d&512&&(mt||l===null||On(l,l.return)),d=m1(),h=Hl,v=(o&335544064)===o,_=n.memoizedProps,Hl=v&&Lr(_.default,_.update)!=="none",Vn(a,n,o),Pn(n),v&&l!==null&&dt&&(n.flags|=4),Hl=h,dt=d;break;case 21:break;case 7:d&512&&(mt||l===null||On(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=n);default:Vn(a,n,o),Pn(n)}}function Pn(n){var a=n.flags;if(a&2){try{for(var o,l=n.return;l!==null;){if(jT(l)){o=l;break}l=l.return}l=null;for(var d=n.return;d!==null;){if(Og(d)){var h=d.stateNode;l===null?l=[h]:l.push(h)}if(Ag(d))break;d=d.return}var v=l;if(o==null)throw Error(r(160));switch(o.tag){case 27:var _=o.stateNode,B=Cg(n);uf(n,B,_,v);break;case 5:var ne=o.stateNode;o.flags&32&&(xo(ne,""),o.flags&=-33);var oe=Cg(n);uf(n,oe,ne,v);break;case 3:case 4:var ge=o.stateNode.containerInfo,Q=Cg(n);Ig(n,Q,ge,v);break;default:throw Error(r(161))}}catch(re){Tt(n,n.return,re)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function WT(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;WT(a),a.tag===5&&a.flags&1024&&(a=a.stateNode,dc=!0,a.reset(),dc=!1),n=n.sibling}}function Yo(n,a){if(a.subtreeFlags&9270)for(a=a.child;a!==null;)XT(a,n),a=a.sibling;else $T(a)}function XT(n,a){var o=n.alternate;if(o===null)Rg(n,!1);else switch(n.tag){case 3:if(Lg=dr=!1,UT(),Yo(a,n),!dr&&!pf){if(n=cr,n!==null)for(var l=0;l<n.length;l+=3){o=n[l];var d=n[l+1];B2(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("+d+")"})}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"})),Lg=!0}cr=null;break;case 5:Yo(a,n);break;case 4:l=dr,dr=!1,Yo(a,n),dr&&(pf=!0),dr=l;break;case 22:n.memoizedState===null&&(o.memoizedState!==null?Rg(n,!1):Yo(a,n));break;case 30:l=dr,d=UT(),dr=!1,Yo(a,n),dr&&(n.flags|=4);var h=n.memoizedProps,v=n.stateNode;a=Br(h,v),v=Br(o.memoizedProps,v);var _=Lr(h.default,h.update);_==="none"?a=!1:(h=o.memoizedState,o.memoizedState=null,o=n.child,Jn=0,a=Ug(n,o,a,v,_,h,!0),Jn!==(h===null?0:h.length)&&(n.flags|=32)),(n.flags&4)!==0&&a?(tc(n,n.memoizedProps.onUpdate),cr=d):d!==null&&(d.push.apply(d,cr),cr=d),dr=(n.flags&32)!==0?!0:l;break;default:Yo(a,n)}}function fr(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)PT(n,a.alternate,a),a=a.sibling}function Da(n,a){for(n=n.child;n!==null;){var o=n,l=a;switch(o.tag){case 0:case 11:case 14:case 15:Ma(4,o,o.return),Da(o,l);break;case 1:On(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&IT(o,o.return,d),Da(o,l);break;case 27:(l&2)!==0&&W2(o.stateNode,o.type,o.memoizedProps);case 5:On(o,o.return),o.tag!==5&&o.tag!==27||Fl(o),Da(o,l);break;case 6:Fl(o);break;case 26:On(o,o.return),d=o.stateNode,o.memoizedState!==null||d===null||mt||d.parentNode.removeChild(d),Da(o,l);break;case 22:o.memoizedState===null&&Da(o,l);break;case 30:On(o,o.return),Da(o,l);break;case 7:On(o,o.return);default:Da(o,l)}n=n.sibling}}function Fs(n,a,o){for(o=(a.subtreeFlags&8772)!==0?o:o&-2,a=a.child;a!==null;){var l=a.alternate,d=n,h=a,v=h.flags,_=(o&1)!==0;switch(h.tag){case 0:case 11:case 15:Fs(d,h,o),Gl(4,h);break;case 1:if(Fs(d,h,o),l=h,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(oe){Tt(l,l.return,oe)}if(l=h,d=l.updateQueue,d!==null){var B=l.stateNode;try{var ne=d.shared.hiddenCallbacks;if(ne!==null)for(d.shared.hiddenCallbacks=null,d=0;d<ne.length;d++)vw(ne[d],B)}catch(oe){Tt(l,l.return,oe)}}_&&v&64&&CT(h),or(h,h.return);break;case 27:(o&2)!==0&&MT(h);case 5:h.tag!==5&&h.tag!==27||RT(h),Fs(d,h,o),_&&l===null&&v&4&&Ng(h),or(h,h.return);break;case 6:RT(h);break;case 26:B=h.stateNode,h.memoizedState!==null||B===null||gn||_0(eu(B.ownerDocument),h.type,B),Fs(d,h,o),_&&l===null&&v&4&&Ng(h),or(h,h.return);break;case 12:Fs(d,h,o);break;case 31:Fs(d,h,o),_&&v&4&&qT(d,h);break;case 13:Fs(d,h,o),_&&v&4&&ZT(d,h);break;case 22:h.memoizedState===null&&Fs(d,h,o),or(h,h.return);break;case 30:Fs(d,h,o),or(h,h.return);break;case 7:or(h,h.return);default:Fs(d,h,o)}a=a.sibling}}function Vg(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&&Cl(o))}function Pg(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&Cl(n))}function Cs(n,a,o,l){var d=(o&335544064)===o;if(a.subtreeFlags&(d?10262:10256))for(a=a.child;a!==null;)JT(n,a,o,l),a=a.sibling;else d&&zT(a)}function JT(n,a,o,l){var d=(o&335544064)===o;d&&a.alternate===null&&a.return!==null&&a.return.alternate!==null&&hf(a);var h=a.flags;switch(a.tag){case 0:case 11:case 15:Cs(n,a,o,l),h&2048&&Gl(9,a);break;case 1:Cs(n,a,o,l);break;case 3:Cs(n,a,o,l),d&&Lg&&(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&&Cl(h)));break;case 12:if(h&2048){Cs(n,a,o,l),h=a.stateNode;try{var v=a.memoizedProps,_=v.id,B=v.onPostCommit;typeof B=="function"&&B(_,a.alternate===null?"mount":"update",h.passiveEffectDuration,-0)}catch(ne){Tt(a,a.return,ne)}}else Cs(n,a,o,l);break;case 31:Cs(n,a,o,l);break;case 13:Cs(n,a,o,l);break;case 23:break;case 22:v=a.stateNode,_=a.alternate,a.memoizedState!==null?(d&&_!==null&&_.memoizedState===null&&hf(_),v._visibility&2?Cs(n,a,o,l):ql(n,a)):(d&&_!==null&&_.memoizedState!==null&&hf(a),v._visibility&2?Cs(n,a,o,l):(v._visibility|=2,Wo(n,a,o,l,(a.subtreeFlags&10256)!==0||!1))),h&2048&&Vg(_,a);break;case 24:Cs(n,a,o,l),h&2048&&Pg(a.alternate,a);break;case 30:d&&(h=a.alternate,h!==null&&(lr(h.child,!0),lr(a.child,!0))),Cs(n,a,o,l);break;default:Cs(n,a,o,l)}}function Wo(n,a,o,l,d){for(d=d&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var h=n,v=a,_=o,B=l,ne=v.flags;switch(v.tag){case 0:case 11:case 15:Wo(h,v,_,B,d),Gl(8,v);break;case 23:break;case 22:var oe=v.stateNode;v.memoizedState!==null?oe._visibility&2?Wo(h,v,_,B,d):ql(h,v):(oe._visibility|=2,Wo(h,v,_,B,d)),d&&ne&2048&&Vg(v.alternate,v);break;case 24:Wo(h,v,_,B,d),d&&ne&2048&&Pg(v.alternate,v);break;default:Wo(h,v,_,B,d)}a=a.sibling}}function ql(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var o=n,l=a,d=l.flags;switch(l.tag){case 22:ql(o,l),d&2048&&Vg(l.alternate,l);break;case 24:ql(o,l),d&2048&&Pg(l.alternate,l);break;default:ql(o,l)}a=a.sibling}}var Li=8192;function zi(n,a,o){if(n.subtreeFlags&Li)for(n=n.child;n!==null;)KT(n,a,o),n=n.sibling}function KT(n,a,o){switch(n.tag){case 26:zi(n,a,o),n.flags&Li&&(n.memoizedState!==null?IC(o,Gs,n.memoizedState,n.memoizedProps):(n=n.stateNode,(a&335544128)===a&&aE(o,n)));break;case 5:zi(n,a,o),n.flags&Li&&(n=n.stateNode,(a&335544128)===a&&aE(o,n));break;case 3:case 4:var l=Gs;Gs=eu(n.stateNode.containerInfo),zi(n,a,o),Gs=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=Li,Li=16777216,zi(n,a,o),Li=l):zi(n,a,o));break;case 30:if((n.flags&Li)!==0&&(l=n.memoizedProps.name,l!=null&&l!=="auto")){var d=n.stateNode;d.paired=null,ds===null&&(ds=new Map),ds.set(l,d)}zi(n,a,o);break;default:zi(n,a,o)}}function QT(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 Zl(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];yn=l,t2(l,n)}QT(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)e2(n),n=n.sibling}function e2(n){switch(n.tag){case 0:case 11:case 15:Zl(n),n.flags&2048&&Ma(9,n,n.return);break;case 3:Zl(n);break;case 12:Zl(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,yf(n)):Zl(n);break;default:Zl(n)}}function yf(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];yn=l,t2(l,n)}QT(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:Ma(8,a,a.return),yf(a);break;case 22:o=a.stateNode,o._visibility&2&&(o._visibility&=-3,yf(a));break;default:yf(a)}n=n.sibling}}function t2(n,a){for(;yn!==null;){var o=yn;switch(o.tag){case 0:case 11:case 15:Ma(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:Cl(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,yn=l;else e:for(o=n;yn!==null;){l=yn;var d=l.sibling,h=l.return;if(FT(l),l===o){yn=null;break e}if(d!==null){d.return=h,yn=d;break e}yn=h}}}var Ax={getCacheForType:function(n){var a=_n(Jt),o=a.data.get(n);return o===void 0&&(o=n(),a.data.set(n,o)),o},cacheSignal:function(){return _n(Jt).controller.signal}},Ox=typeof WeakMap=="function"?WeakMap:Map,ht=0,Nt=null,et=null,it=0,wt=0,fs=null,Ua=!1,Xo=!1,Gg=!1,Zr=0,Gt=0,Ba=0,$i=0,vf=0,hs=0,Jo=0,Yl=null,Qn=null,Fg=!1,bf=0,n2=0,wf=1/0,Tf=null,La=null,Lt=0,Hs=null,Vi=null,hr=0,Hg=0,qg=null,s2=null,Ko=null,Qo=null,ec=null,Wl=0,Ef=null;function ps(){return(ht&2)!==0&&it!==0?it&-it:be.T!==null?n0():i1()}function r2(){if(hs===0)if((it&536870912)===0||Ke){var n=md;md<<=1,(md&3932160)===0&&(md=262144),hs=n}else hs=536870912;return n=kn.current,n!==null&&(n.flags|=32),hs}function tc(n,a){if(a!=null){var o=n.stateNode,l=o.ref;l===null&&(l=o.ref=L2(Br(n.memoizedProps,o))),Qo===null&&(Qo=[]),Qo.push(a.bind(null,l))}}function es(n,a,o){(n===Nt&&(wt===2||wt===9)||n.cancelPendingCommit!==null)&&(nc(n,0),za(n,it,hs,!1)),gl(n,o),((ht&2)===0||n!==Nt)&&(n===Nt&&((ht&2)===0&&($i|=o),Gt===4&&za(n,it,hs,!1)),pr(n))}function a2(n,a,o){if((ht&6)!==0)throw Error(r(327));var l=!o&&(a&127)===0&&(a&n.expiredLanes)===0||ml(n,a),d=l?Cx(n,a):Yg(n,a,!0),h=l;do{if(d===0){Xo&&!l&&za(n,a,0,!1);break}else{if(o=n.current.alternate,h&&!Nx(o)){d=Yg(n,a,!1),h=!1;continue}if(d===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;d=Yl;var B=_.current.memoizedState.isDehydrated;if(B&&(nc(_,v).flags|=256),v=Yg(_,v,!1),v!==2&&v!==6){if(Gg&&!B){_.errorRecoveryDisabledLanes|=h,$i|=h,d=4;break e}h=Qn,Qn=d,h!==null&&(Qn===null?Qn=h:Qn.push.apply(Qn,h))}d=v}if(h=!1,d!==2)continue}}if(d===1){nc(n,0),za(n,a,0,!0);break}e:{switch(l=n,h=d,h){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a&&(a&62914560)!==a)break;case 6:za(l,a,hs,!Ua);break e;case 2:Qn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(d=bf+300-Ln(),10<d)){if(za(l,a,hs,!Ua),yd(l,0,!0)!==0)break e;hr=a,l.timeoutHandle=h0(i2.bind(null,l,o,Qn,Tf,Fg,a,hs,$i,Jo,Ua,h,"Throttled",-0,0),d);break e}i2(l,o,Qn,Tf,Fg,a,hs,$i,Jo,Ua,h,null,-0,0)}}break}while(!0);pr(n)}function i2(n,a,o,l,d,h,v,_,B,ne,oe,ge,Q,re){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:rr},ds=null,KT(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=su.bind(ke),Re.finished.then(ke,ke))),ke=(h&62914560)===h?bf-Ln():(h&4194048)===h?n2-Ln():0,ke=RC(ge,ke),ke!==null)){hr=h,n.cancelPendingCommit=ke(p2.bind(null,n,a,h,o,l,d,v,_,B,ne,oe,ge,null,Q,re)),za(n,h,v,!ne);return}p2(n,a,h,o,l,d,v,_,B,ne,oe,ge)}function Nx(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 d=o[l],h=d.getSnapshot;d=d.value;try{if(!ls(h(),d))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 za(n,a,o,l){a=t1(n,a),a&=~vf,a&=~$i,n.suspendedLanes|=a,n.pingedLanes&=~a,l&&(n.warmLanes|=a),l=n.expirationTimes;for(var d=a;0<d;){var h=31-os(d),v=1<<h;l[h]=-1,d&=~v}o!==0&&s1(n,o,a)}function Sf(){return(ht&6)===0?(Xl(0),!1):!0}function Zg(){if(et!==null){if(wt===0)var n=et.return;else n=et,Vr=Ni=null,tg(n),Po=null,jl=0,n=et;for(;n!==null;)xT(n.alternate,n),n=n.return;et=null}}function nc(n,a){var o=n.timeoutHandle;return o!==-1&&(n.timeoutHandle=-1,Kx(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),hr=0,Zg(),Nt=n,et=o=zr(n.current,null),it=a,wt=0,fs=null,Ua=!1,Xo=ml(n,a),Gg=!1,Jo=hs=vf=$i=Ba=Gt=0,Qn=Yl=null,Fg=!1,Zr=t1(n,a),Cd(),o}function o2(n,a){We=null,be.H=tf,a===Vo||a===Vd?(a=pw(),wt=3):a===Pm?(a=pw(),wt=4):wt=a===gg?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,fs=a,et===null&&(Gt=1,nf(n,As(a,n.current)))}function c2(){var n=kn.current;return n===null?!0:(it&4194048)===it?Mn===null:(it&62914560)===it||(it&536870912)!==0?n===Mn:!1}function l2(){var n=be.H;return be.H=tf,n===null?tf:n}function u2(){var n=be.A;return be.A=Ax,n}function _f(){Gt=4,Ua||(it&4194048)!==it&&kn.current!==null||(Xo=!0),(Ba&134217727)===0&&($i&134217727)===0||Nt===null||za(Nt,it,hs,!1)}function Yg(n,a,o){var l=ht;ht|=2;var d=l2(),h=u2();(Nt!==n||it!==a)&&(Tf=null,nc(n,a)),a=!1;var v=Gt;e:do try{if(wt!==0&&et!==null){var _=et,B=fs;switch(wt){case 8:Zg(),v=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(a=!0);var ne=wt;if(wt=0,fs=null,sc(n,_,B,ne),o&&Xo){v=0;break e}break;default:ne=wt,wt=0,fs=null,sc(n,_,B,ne)}}xx(),v=Gt;break}catch(oe){o2(n,oe)}while(!0);return a&&n.shellSuspendCounter++,Vr=Ni=null,ht=l,be.H=d,be.A=h,et===null&&(Nt=null,it=0,Cd()),v}function xx(){for(;et!==null;)d2(et)}function Cx(n,a){var o=ht;ht|=2;var l=l2(),d=u2();Nt!==n||it!==a?(Tf=null,wf=Ln()+500,nc(n,a)):Xo=ml(n,a);e:do try{if(wt!==0&&et!==null){a=et;var h=fs;t:switch(wt){case 1:wt=0,fs=null,sc(n,a,h,1);break;case 2:case 9:if(fw(h)){wt=0,fs=null,f2(a);break}a=function(){wt!==2&&wt!==9||Nt!==n||(wt=7),pr(n)},h.then(a,a);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:fw(h)?(wt=0,fs=null,f2(a)):(wt=0,fs=null,sc(n,a,h,7));break;case 5:var v=null;switch(et.tag){case 26:v=et.memoizedState;case 5:case 27:var _=et;if(v?sE(v):_.stateNode.complete){wt=0,fs=null;var B=_.sibling;if(B!==null)et=B;else{var ne=_.return;ne!==null?(et=ne,kf(ne)):et=null}break t}}wt=0,fs=null,sc(n,a,h,5);break;case 6:wt=0,fs=null,sc(n,a,h,6);break;case 8:Zg(),Gt=6;break e;default:throw Error(r(462))}}Ix();break}catch(oe){o2(n,oe)}while(!0);return Vr=Ni=null,be.H=l,be.A=d,ht=o,et!==null?0:(Nt=null,it=0,Cd(),Gt)}function Ix(){for(;et!==null&&!tm();)d2(et)}function d2(n){var a=OT(n.alternate,n,Zr);n.memoizedProps=n.pendingProps,a===null?kf(n):et=a}function f2(n){var a=n,o=a.alternate;switch(a.tag){case 15:case 0:a=wT(o,a,a.pendingProps,a.type,void 0,it);break;case 11:a=wT(o,a,a.pendingProps,a.type.render,a.ref,it);break;case 5:tg(a);var l=a;l===mn&&(Ke?(Ud(l),l.tag===5&&l.stateNode!=null&&(It=l.stateNode)):(Ud(l),Ke=!0));default:xT(o,a),a=et=tw(a,Zr),a=OT(o,a,Zr)}n.memoizedProps=n.pendingProps,a===null?kf(n):et=a}function sc(n,a,o,l){Vr=Ni=null,tg(a),Po=null,jl=0;var d=a.return;try{if(vx(n,d,a,o,it)){Gt=1,nf(n,As(o,n.current)),et=null;return}}catch(h){if(d!==null)throw et=d,h;Gt=1,nf(n,As(o,n.current)),et=null;return}a.flags&32768?(Ke||l===1?n=!0:Xo||(it&536870912)!==0?n=!1:(Ua=n=!0,(l===2||l===9||l===3||l===6)&&(l=kn.current,l!==null&&l.tag===13&&(l.flags|=16384))),h2(a,n)):kf(a)}function kf(n){var a=n;do{if((a.flags&32768)!==0){h2(a,Ua);return}n=a.return;var o=Ex(a.alternate,a,Zr);if(o!==null){et=o;return}if(a=a.sibling,a!==null){et=a;return}et=a=n}while(a!==null);Gt===0&&(Gt=5)}function h2(n,a){do{var o=Sx(n.alternate,n);if(o!==null){o.flags&=32767,et=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!a&&(n=n.sibling,n!==null)){et=n;return}et=n=o}while(n!==null);Gt=6,et=null}function p2(n,a,o,l,d,h,v,_,B,ne,oe,ge){n.cancelPendingCommit=null;do Af();while(Lt!==0);if((ht&6)!==0)throw Error(r(327));if(a!==null){if(a===n.current)throw Error(r(177));n===Nt&&(et=Nt=null,it=0),Vi=a,Hs=n,hr=o,qg=d,s2=l,Rx(n,a,o,v,_,B,ge)}}function Rx(n,a,o,l,d,h,v){var _=a.lanes|a.childLanes;if(Hg=_,_|=xm,rN(n,o,_,l,d,h),Qo=null,(o&335544064)===o?(ec=ix(n),l=10262):(ec=null,l=10256),(a.subtreeFlags&l)!==0||(a.flags&l)!==0?(n.callbackNode=null,n.callbackPriority=0,Lx(Ye,function(){return Kg(),null})):(n.callbackNode=null,n.callbackPriority=0),df=!1,l=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||l){l=be.T,be.T=null,d=_e.p,_e.p=2,h=ht,ht|=4;try{_x(n,a,o)}finally{ht=h,_e.p=d,be.T=l}}Lt=1,df?Ko=rC(v,n.containerInfo,ec,Wg,Xg,Mx,Jg,Kg,jx):(Wg(),Xg(),Jg())}function jx(n){if(Lt!==0){var a=Hs.onRecoverableError;a(n,{componentStack:null})}}function Mx(){Lt===3&&(Lt=0,XT(Vi,Hs),Lt=4)}function Wg(){if(Lt===1){Lt=0;var n=Hs,a=Vi,o=hr,l=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||l){l=be.T,be.T=null;var d=_e.p;_e.p=2;var h=ht;ht|=4;try{Hl=pf=!1,YT(a,n,o),o=u0;var v=H1(n.containerInfo),_=o.focusedElem,B=o.selectionRange;if(v!==_&&_&&_.ownerDocument&&F1(_.ownerDocument.documentElement,_)){if(B!==null&&_m(_)){var ne=B.start,oe=B.end;if(oe===void 0&&(oe=ne),"selectionStart"in _)_.selectionStart=ne,_.selectionEnd=Math.min(oe,_.value.length);else{var ge=_.ownerDocument||document,Q=ge&&ge.defaultView||window;if(Q.getSelection){var re=Q.getSelection(),ke=_.textContent.length,Re=Math.min(B.start,ke),Xe=B.end===void 0?Re:Math.min(B.end,ke);!re.extend&&Re>Xe&&(v=Xe,Xe=Re,Re=v);var ee=G1(_,Re),q=G1(_,Xe);if(ee&&q&&(re.rangeCount!==1||re.anchorNode!==ee.node||re.anchorOffset!==ee.offset||re.focusNode!==q.node||re.focusOffset!==q.offset)){var se=ge.createRange();se.setStart(ee.node,ee.offset),re.removeAllRanges(),Re>Xe?(re.addRange(se),re.extend(q.node,q.offset)):(se.setEnd(q.node,q.offset),re.addRange(se))}}}}for(ge=[],re=_;re=re.parentNode;)re.nodeType===1&&ge.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ge.length;_++){var me=ge[_];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}dc=!!l0,u0=l0=null}finally{ht=h,_e.p=d,be.T=l}}n.current=a,Lt=2}}function Xg(){if(Lt===2){Lt=0;var n=Hs,a=Vi,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 d=ht;ht|=4;try{PT(n,a.alternate,a)}finally{ht=d,_e.p=l,be.T=o}}Lt=3}}function Jg(){if(Lt===4||Lt===3){Lt=0;var n=Ko;Ko=null,nm();var a=Hs,o=Vi,l=hr,d=s2,h=(l&335544064)===l?10262:10256;if((o.subtreeFlags&h)!==0||(o.flags&h)!==0?Lt=5:(Lt=0,Vi=Hs=null,m2(a,a.pendingLanes)),h=a.pendingLanes,h===0&&(La=null),im(l),o=o.stateNode,is&&typeof is.onCommitFiberRoot=="function")try{is.onCommitFiberRoot(pl,o,void 0,(o.current.flags&128)===128)}catch{}if(d!==null){o=be.T,h=_e.p,_e.p=2,be.T=null;try{for(var v=a.onRecoverableError,_=0;_<d.length;_++){var B=d[_];v(B.value,{componentStack:B.stack})}}finally{be.T=o,_e.p=h}}if(d=Qo,v=ec,ec=null,d!==null&&(Qo=null,v===null&&(v=[]),n!==null))for(B=0;B<d.length;B++)o=(0,d[B])(v),o!==void 0&&n.finished.finally(o);(hr&3)!==0&&Af(),pr(a),h=a.pendingLanes,(l&261930)!==0&&(h&42)!==0?a===Ef?Wl++:(Wl=0,Ef=a):(Wl=0,Ef=null),Xl(0)}}function m2(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,Cl(a)))}function Af(){return Ko!==null&&(Ko.skipTransition(),Ko=null),Wg(),Xg(),Jg(),Kg()}function Kg(){if(Lt!==5)return!1;var n=Hs,a=Hg;Hg=0;var o=im(hr),l=be.T,d=_e.p;try{_e.p=32>o?32:o,be.T=null,o=qg,qg=null;var h=Hs,v=hr;if(Lt=0,Vi=Hs=null,hr=0,(ht&6)!==0)throw Error(r(331));var _=ht;if(ht|=4,e2(h.current),JT(h,h.current,v,o),ht=_,Xl(0,!1),is&&typeof is.onPostCommitFiberRoot=="function")try{is.onPostCommitFiberRoot(pl,h)}catch{}return!0}finally{_e.p=d,be.T=l,m2(n,a)}}function g2(n,a,o){a=As(o,a),a=mg(n.stateNode,a,2),n=Ca(n,a,2),n!==null&&(gl(n,2),pr(n))}function Tt(n,a,o){if(n.tag===3)g2(n,n,o);else for(;a!==null;){if(a.tag===3){g2(a,n,o);break}else if(a.tag===1){var l=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(La===null||!La.has(l))){n=As(o,n),o=fT(2),l=Ca(a,o,2),l!==null&&(hT(o,l,a,n),gl(l,2),pr(l));break}}a=a.return}}function Qg(n,a,o){var l=n.pingCache;if(l===null){l=n.pingCache=new Ox;var d=new Set;l.set(a,d)}else d=l.get(a),d===void 0&&(d=new Set,l.set(a,d));d.has(o)||(Gg=!0,d.add(o),n=Dx.bind(null,n,a,o),a.then(n,n))}function Dx(n,a,o){var l=n.pingCache;l!==null&&l.delete(a),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,Nt===n&&(it&o)===o&&((Gt===4||Gt===3&&(it&62914560)===it&&300>Ln()-bf)&&(ht&2)===0?nc(n,0):vf|=o,Jo===it&&(Jo=0)),pr(n)}function y2(n,a){a===0&&(a=n1()),n=ki(n,a),n!==null&&(gl(n,a),pr(n))}function Ux(n){var a=n.memoizedState,o=0;a!==null&&(o=a.retryLane),y2(n,o)}function Bx(n,a){var o=0;switch(n.tag){case 31:case 13:var l=n.stateNode,d=n.memoizedState;d!==null&&(o=d.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),y2(n,o)}function Lx(n,a){return hl(n,a)}var rc=null,ac=null,e0=!1,Of=!1,t0=!1,$a=0;function pr(n){n!==ac&&n.next===null&&(ac===null?rc=ac=n:ac=ac.next=n),Of=!0,e0||(e0=!0,$x())}function Xl(n,a){if(!t0&&Of){t0=!0;do for(var o=!1,l=rc;l!==null;){if(n!==0){var d=l.pendingLanes;if(d===0)var h=0;else{var v=l.suspendedLanes,_=l.pingedLanes;h=(1<<31-os(42|n)+1)-1,h&=d&~(v&~_),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(o=!0,T2(l,h))}else h=it,h=yd(l,l===Nt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||ml(l,h)||(o=!0,T2(l,h));l=l.next}while(o);t0=!1}}function zx(){v2()}function v2(){Of=e0=!1;var n=0;$a!==0&&Jx()&&(n=$a);for(var a=Ln(),o=null,l=rc;l!==null;){var d=l.next,h=b2(l,a);h===0?(l.next=null,o===null?rc=d:o.next=d,d===null&&(ac=o)):(o=l,(n!==0||(h&3)!==0)&&(Of=!0)),l=d}Lt!==0&&Lt!==5||Xl(n),$a!==0&&($a=0)}function b2(n,a){for(var o=n.suspendedLanes,l=n.pingedLanes,d=n.expirationTimes,h=n.pendingLanes&-62914561;0<h;){var v=31-os(h),_=1<<v,B=d[v];B===-1?((_&o)===0||(_&l)!==0)&&(d[v]=sN(_,a)):B<=a&&(n.expiredLanes|=_),h&=~_}if(a=Nt,o=it,o=yd(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&&ba(l),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||ml(n,o)){if(a=o&-o,a===n.callbackPriority)return a;switch(l!==null&&ba(l),im(o)){case 2:case 8:o=Ce;break;case 32:o=Ye;break;case 268435456:o=Ss;break;default:o=Ye}return l=w2.bind(null,n),o=hl(o,l),n.callbackPriority=a,n.callbackNode=o,a}return l!==null&&l!==null&&ba(l),n.callbackPriority=2,n.callbackNode=null,2}function w2(n,a){if(Lt!==0&&Lt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(Af()&&n.callbackNode!==o)return null;var l=it;return l=yd(n,n===Nt?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(a2(n,l,a),b2(n,Ln()),n.callbackNode!=null&&n.callbackNode===o?w2.bind(null,n):null)}function T2(n,a){if(Af())return null;a2(n,a,!0)}function $x(){Qx(function(){(ht&6)!==0?hl(hd,zx):v2()})}function n0(){if($a===0){var n=Ii;n===0&&(n=pd,pd<<=1,(pd&261888)===0&&(pd=256)),$a=n}return $a}function E2(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ed(n)}function Vx(n,a,o,l,d){if(a==="submit"&&o&&o.stateNode===d){var h=E2((d[Wn]||null).action),v=l.submitter;v&&(a=(a=v[Wn]||null)?E2(a.formAction):v.getAttribute("formAction"),a!==null&&(h=a,v=null));var _=new Ad("action","action",null,l,d);n.push({event:_,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if($a!==0){var B=new FormData(d,v);ug(o,{pending:!0,data:B,method:d.method,action:h},null,B)}}else typeof h=="function"&&(_.preventDefault(),B=new FormData(d,v),ug(o,{pending:!0,data:B,method:d.method,action:h},h,B))},currentTarget:d}]})}}for(var s0=0;s0<Nm.length;s0++){var r0=Nm[s0],Px=r0.toLowerCase(),Gx=r0[0].toUpperCase()+r0.slice(1);Vs(Px,"on"+Gx)}Vs(Y1,"onAnimationEnd"),Vs(W1,"onAnimationIteration"),Vs(X1,"onAnimationStart"),Vs("dblclick","onDoubleClick"),Vs("focusin","onFocus"),Vs("focusout","onBlur"),Vs(KN,"onTransitionRun"),Vs(QN,"onTransitionStart"),Vs(ex,"onTransitionCancel"),Vs(J1,"onTransitionEnd"),Oo("onMouseEnter",["mouseout","mouseover"]),Oo("onMouseLeave",["mouseout","mouseover"]),Oo("onPointerEnter",["pointerout","pointerover"]),Oo("onPointerLeave",["pointerout","pointerover"]),Ei("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ei("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ei("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ei("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jl="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(" "),Fx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jl));function S2(n,a){a=(a&4)!==0;for(var o=0;o<n.length;o++){var l=n[o],d=l.event;l=l.listeners;e:{var h=void 0;if(a)for(var v=l.length-1;0<=v;v--){var _=l[v],B=_.instance,ne=_.currentTarget;if(_=_.listener,B!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=ne;try{h(d)}catch(oe){xd(oe)}d.currentTarget=null,h=B}else for(v=0;v<l.length;v++){if(_=l[v],B=_.instance,ne=_.currentTarget,_=_.listener,B!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=ne;try{h(d)}catch(oe){xd(oe)}d.currentTarget=null,h=B}}}}function tt(n,a){var o=a[c1];o===void 0&&(o=a[c1]=new Set);var l=n+"__bubble";o.has(l)||(_2(a,n,2,!1),o.add(l))}function a0(n,a,o){var l=0;a&&(l|=4),_2(o,n,l,a)}var Nf="_reactListening"+Math.random().toString(36).slice(2);function i0(n){if(!n[Nf]){n[Nf]=!0,d1.forEach(function(o){o!=="selectionchange"&&(Fx.has(o)||a0(o,!1,n),a0(o,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[Nf]||(a[Nf]=!0,a0("selectionchange",!1,a))}}function _2(n,a,o,l){switch(hE(a)){case 2:var d=UC;break;case 8:d=BC;break;default:d=A0}o=d.bind(null,a,o,n),d=void 0,!pm||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(d=!0),l?d!==void 0?n.addEventListener(a,o,{capture:!0,passive:d}):n.addEventListener(a,o,!0):d!==void 0?n.addEventListener(a,o,{passive:d}):n.addEventListener(a,o,!1)}function o0(n,a,o,l,d){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(_===d)break;if(v===4)for(v=l.return;v!==null;){var B=v.tag;if((B===3||B===4)&&v.stateNode.containerInfo===d)return;v=v.return}for(;_!==null;){if(v=Ti(_),v===null)return;if(B=v.tag,B===5||B===6||B===26||B===27){l=h=v;continue e}_=_.parentNode}}l=l.return}_1(function(){var ne=h,oe=fm(o),ge=[];e:{var Q=K1.get(n);if(Q!==void 0){var re=Ad,ke=n;switch(n){case"keypress":if(_d(o)===0)break e;case"keydown":case"keyup":re=NN;break;case"focusin":ke="focus",re=vm;break;case"focusout":ke="blur",re=vm;break;case"beforeblur":case"afterblur":re=vm;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":re=O1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=gN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=jN;break;case Y1:case W1:case X1:re=bN;break;case J1:re=DN;break;case"scroll":case"scrollend":re=pN;break;case"wheel":re=BN;break;case"copy":case"cut":case"paste":re=TN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=x1;break;case"submit":re=IN;break;case"toggle":case"beforetoggle":re=zN}var Re=(a&4)!==0,Xe=!Re&&(n==="scroll"||n==="scrollend"),ee=Re?Q!==null?Q+"Capture":null:Q;Re=[];for(var q=ne,se;q!==null;){var me=q;if(se=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||se===null||ee===null||(me=bl(q,ee),me!=null&&Re.push(Kl(q,me,se))),Xe)break;q=q.return}0<Re.length&&(Q=new re(Q,ke,null,o,oe),ge.push({event:Q,listeners:Re}))}}if((a&7)===0){e:{if(re=n==="mouseover"||n==="pointerover",Q=n==="mouseout"||n==="pointerout",re&&o!==dm&&(ke=o.relatedTarget||o.fromElement)&&(Ti(ke)||ke[_o]))break e;(Q||re)&&(ke=oe.window===oe?oe:(re=oe.ownerDocument)?re.defaultView||re.parentWindow:window,Q?(re=o.relatedTarget||o.toElement,Q=ne,re=re?Ti(re):null,re!==null&&(Xe=c(re),Re=re.tag,re!==Xe||Re!==5&&Re!==27&&Re!==6)&&(re=null)):(Q=null,re=ne),Q!==re&&(Re=O1,me="onMouseLeave",ee="onMouseEnter",q="mouse",(n==="pointerout"||n==="pointerover")&&(Re=x1,me="onPointerLeave",ee="onPointerEnter",q="pointer"),Xe=Q==null?ke:vl(Q),se=re==null?ke:vl(re),ke=new Re(me,q+"leave",Q,o,oe),ke.target=Xe,ke.relatedTarget=se,me=null,Ti(oe)===ne&&(Re=new Re(ee,q+"enter",re,o,oe),Re.target=se,Re.relatedTarget=Xe,me=Re),Xe=me,Re=Q&&re?Y(Q,re,Hx):null,Q!==null&&k2(ge,ke,Q,Re,!1),re!==null&&Xe!==null&&k2(ge,Xe,re,Re,!0)))}e:{if(Q=ne?vl(ne):window,re=Q.nodeName&&Q.nodeName.toLowerCase(),re==="select"||re==="input"&&Q.type==="file")var Ie=B1;else if(D1(Q))if(L1)Ie=WN;else{Ie=ZN;var ot=qN}else re=Q.nodeName,!re||re.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?ne&&um(ne.elementType)&&(Ie=B1):Ie=YN;if(Ie&&(Ie=Ie(n,ne))){U1(ge,Ie,o,oe);break e}ot&&ot(n,Q,ne)}switch(ot=ne?vl(ne):window,n){case"focusin":(D1(ot)||ot.contentEditable==="true")&&(jo=ot,km=ne,Ol=null);break;case"focusout":Ol=km=jo=null;break;case"mousedown":Am=!0;break;case"contextmenu":case"mouseup":case"dragend":Am=!1,q1(ge,o,oe);break;case"selectionchange":if(JN)break;case"keydown":case"keyup":q1(ge,o,oe)}var Ue;if(wm)e:{switch(n){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Ro?j1(n,o)&&($e="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&($e="onCompositionStart");$e&&(C1&&o.locale!=="ko"&&(Ro||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Ro&&(Ue=k1()):(Ta=oe,mm="value"in Ta?Ta.value:Ta.textContent,Ro=!0)),ot=xf(ne,$e),0<ot.length&&($e=new N1($e,n,null,o,oe),ge.push({event:$e,listeners:ot}),Ue?$e.data=Ue:(Ue=M1(o),Ue!==null&&($e.data=Ue)))),(Ue=VN?PN(n,o):GN(n,o))&&($e=xf(ne,"onBeforeInput"),0<$e.length&&(ot=new N1("onBeforeInput","beforeinput",null,o,oe),ge.push({event:ot,listeners:$e}),ot.data=Ue)),Vx(ge,n,ne,o,oe)}S2(ge,a)})}function Kl(n,a,o){return{instance:n,listener:a,currentTarget:o}}function xf(n,a){for(var o=a+"Capture",l=[];n!==null;){var d=n,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=bl(n,o),d!=null&&l.unshift(Kl(n,d,h)),d=bl(n,a),d!=null&&l.push(Kl(n,d,h))),n.tag===3)return l;n=n.return}return[]}function Hx(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function k2(n,a,o,l,d){for(var h=a._reactName,v=[];o!==null&&o!==l;){var _=o,B=_.alternate,ne=_.stateNode;if(_=_.tag,B!==null&&B===l)break;_!==5&&_!==26&&_!==27||ne===null||(B=ne,d?(ne=bl(o,h),ne!=null&&v.unshift(Kl(o,ne,B))):d||(ne=bl(o,h),ne!=null&&v.push(Kl(o,ne,B)))),o=o.return}v.length!==0&&n.push({event:a,listeners:v})}var qx=/\r\n?/g,Zx=/\u0000|\uFFFD/g;function A2(n){return(typeof n=="string"?n:""+n).replace(qx,`
840
- `).replace(Zx,"")}function O2(n,a){return a=A2(a),A2(n)===a}function Et(n,a,o,l,d,h){switch(o){case"children":if(typeof l=="string")a==="body"||a==="textarea"&&l===""||xo(n,l);else if(typeof l=="number"||typeof l=="bigint")a!=="body"&&xo(n,""+l);else return;break;case"className":Td(n,"class",l);break;case"tabIndex":Td(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Td(n,o,l);break;case"style":E1(n,l,h);return;case"data":if(a!=="object"){Td(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=Ed(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"&&Et(n,a,"name",d.name,d,null),Et(n,a,"formEncType",d.formEncType,d,null),Et(n,a,"formMethod",d.formMethod,d,null),Et(n,a,"formTarget",d.formTarget,d,null)):(Et(n,a,"encType",d.encType,d,null),Et(n,a,"method",d.method,d,null),Et(n,a,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(o);break}l=Ed(l),n.setAttribute(o,l);break;case"onClick":l!=null&&(n.onclick=rr);return;case"onScroll":l!=null&&tt("scroll",n);return;case"onScrollEnd":l!=null&&tt("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(d.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=Ed(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":tt("beforetoggle",n),tt("toggle",n),wd(n,"popover",l);break;case"xlinkActuate":Dr(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Dr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Dr(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Dr(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Dr(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Dr(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Dr(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Dr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Dr(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":wd(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=fN.get(o)||o,wd(n,o,l);else return}dt=!0}function c0(n,a,o,l,d,h){switch(o){case"style":E1(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(d.children!=null)throw Error(r(60));h?.__html!==o&&(n.innerHTML=o)}}break;case"children":if(typeof l=="string")xo(n,l);else if(typeof l=="number"||typeof l=="bigint")xo(n,""+l);else return;break;case"onScroll":l!=null&&tt("scroll",n);return;case"onScrollEnd":l!=null&&tt("scrollend",n);return;case"onClick":l!=null&&(n.onclick=rr);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!f1.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(d=o.endsWith("Capture"),h=o.slice(2,d?o.length-7:void 0),a=n[Wn]||null,a=a!=null?a[o]:null,typeof a=="function"&&n.removeEventListener(h,a,d),typeof l=="function")){typeof a!="function"&&a!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(h,l,d);break e}dt=!0,o in n?n[o]=l:l===!0?n.setAttribute(o,""):wd(n,o,l)}return}dt=!0}function Nn(n,a,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",n),tt("load",n);var l=!1,d=!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":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Et(n,a,h,v,o,null)}}d&&Et(n,a,"srcSet",o.srcSet,o,null),l&&Et(n,a,"src",o.src,o,null);return;case"input":tt("invalid",n);var _=h=v=d=null,B=null,ne=null;for(l in o)if(o.hasOwnProperty(l)){var oe=o[l];if(oe!=null)switch(l){case"name":d=oe;break;case"type":v=oe;break;case"checked":B=oe;break;case"defaultChecked":ne=oe;break;case"value":h=oe;break;case"defaultValue":_=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,a));break;default:Et(n,a,l,oe,o,null)}}v1(n,h,_,B,ne,v,d,!1);return;case"select":tt("invalid",n),l=v=h=null;for(d in o)if(o.hasOwnProperty(d)&&(_=o[d],_!=null))switch(d){case"value":h=_;break;case"defaultValue":v=_;break;case"multiple":l=_;default:Et(n,a,d,_,o,null)}a=h,o=v,n.multiple=!!l,a!=null?No(n,!!l,a,!1):o!=null&&No(n,!!l,o,!0);return;case"textarea":tt("invalid",n),h=d=l=null;for(v in o)if(o.hasOwnProperty(v)&&(_=o[v],_!=null))switch(v){case"value":l=_;break;case"defaultValue":d=_;break;case"children":h=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:Et(n,a,v,_,o,null)}w1(n,l,d,h);return;case"option":for(B in o)o.hasOwnProperty(B)&&(l=o[B],l!=null)&&(B==="selected"?n.selected=l&&typeof l!="function"&&typeof l!="symbol":Et(n,a,B,l,o,null));return;case"dialog":tt("beforetoggle",n),tt("toggle",n),tt("cancel",n),tt("close",n);break;case"iframe":case"object":tt("load",n);break;case"video":case"audio":for(l=0;l<Jl.length;l++)tt(Jl[l],n);break;case"image":tt("error",n),tt("load",n);break;case"details":tt("toggle",n);break;case"embed":case"source":case"link":tt("error",n),tt("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:Et(n,a,ne,l,o,null)}return;default:if(um(a)){for(oe in o)o.hasOwnProperty(oe)&&(l=o[oe],l!==void 0&&c0(n,a,oe,l,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(l=o[_],l!=null&&Et(n,a,_,l,o,null))}var Yx={};function Wx(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 d=null,h=null,v=null,_=null,B=null,ne=null,oe=null;for(re in o){var ge=o[re];if(o.hasOwnProperty(re)&&ge!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":B=ge;default:l.hasOwnProperty(re)||Et(n,a,re,null,l,ge)}}for(var Q in l){var re=l[Q];if(ge=o[Q],l.hasOwnProperty(Q)&&(re!=null||ge!=null))switch(Q){case"type":re!==ge&&(dt=!0),h=re;break;case"name":re!==ge&&(dt=!0),d=re;break;case"checked":re!==ge&&(dt=!0),ne=re;break;case"defaultChecked":re!==ge&&(dt=!0),oe=re;break;case"value":re!==ge&&(dt=!0),v=re;break;case"defaultValue":re!==ge&&(dt=!0),_=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,a));break;default:re!==ge&&Et(n,a,Q,re,l,ge)}}cm(n,v,_,B,ne,oe,h,d);return;case"select":re=v=_=Q=null;for(h in o)if(B=o[h],o.hasOwnProperty(h)&&B!=null)switch(h){case"value":break;case"multiple":re=B;default:l.hasOwnProperty(h)||Et(n,a,h,null,l,B)}for(d in l)if(h=l[d],B=o[d],l.hasOwnProperty(d)&&(h!=null||B!=null))switch(d){case"value":h!==B&&(dt=!0),Q=h;break;case"defaultValue":h!==B&&(dt=!0),_=h;break;case"multiple":h!==B&&(dt=!0),v=h;default:h!==B&&Et(n,a,d,h,l,B)}a=_,o=v,l=re,Q!=null?No(n,!!o,Q,!1):!!l!=!!o&&(a!=null?No(n,!!o,a,!0):No(n,!!o,o?[]:"",!1));return;case"textarea":re=Q=null;for(_ in o)if(d=o[_],o.hasOwnProperty(_)&&d!=null&&!l.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Et(n,a,_,null,l,d)}for(v in l)if(d=l[v],h=o[v],l.hasOwnProperty(v)&&(d!=null||h!=null))switch(v){case"value":d!==h&&(dt=!0),Q=d;break;case"defaultValue":d!==h&&(dt=!0),re=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(r(91));break;default:d!==h&&Et(n,a,v,d,l,h)}b1(n,Q,re);return;case"option":for(var ke in o)Q=o[ke],o.hasOwnProperty(ke)&&Q!=null&&!l.hasOwnProperty(ke)&&(ke==="selected"?n.selected=!1:Et(n,a,ke,null,l,Q));for(B in l)Q=l[B],re=o[B],l.hasOwnProperty(B)&&Q!==re&&(Q!=null||re!=null)&&(B==="selected"?(Q!==re&&(dt=!0),n.selected=Q&&typeof Q!="function"&&typeof Q!="symbol"):Et(n,a,B,Q,l,re));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)&&Et(n,a,Re,null,l,Q);for(ne in l)if(Q=l[ne],re=o[ne],l.hasOwnProperty(ne)&&Q!==re&&(Q!=null||re!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,a));break;default:Et(n,a,ne,Q,l,re)}return;default:if(um(a)){for(var Xe in o)Q=o[Xe],o.hasOwnProperty(Xe)&&Q!==void 0&&!l.hasOwnProperty(Xe)&&c0(n,a,Xe,void 0,l,Q);for(oe in l)Q=l[oe],re=o[oe],!l.hasOwnProperty(oe)||Q===re||Q===void 0&&re===void 0||c0(n,a,oe,Q,l,re);return}}for(var ee in o)Q=o[ee],o.hasOwnProperty(ee)&&Q!=null&&!l.hasOwnProperty(ee)&&Et(n,a,ee,null,l,Q);for(ge in l)Q=l[ge],re=o[ge],!l.hasOwnProperty(ge)||Q===re||Q==null&&re==null||Et(n,a,ge,Q,l,re)}function N2(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xx(){if(typeof performance.getEntriesByType=="function"){for(var n=0,a=0,o=performance.getEntriesByType("resource"),l=0;l<o.length;l++){var d=o[l],h=d.transferSize,v=d.initiatorType,_=d.duration;if(h&&_&&N2(v)){for(v=0,_=d.responseEnd,l+=1;l<o.length;l++){var B=o[l],ne=B.startTime;if(ne>_)break;var oe=B.transferSize,ge=B.initiatorType;oe&&N2(ge)&&(B=B.responseEnd,v+=oe*(B<_?1:(_-ne)/(B-ne)))}if(--l,a+=8*(h+v)/(d.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 l0=null,u0=null;function Ql(n){return n.nodeType===9?n:n.ownerDocument}function x2(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 C2(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 I2(n,a,o,l){return o=Ql(o).createElement(n),o[Sn]=l,o[Wn]=a,Nn(o,n,a),pn(o),o}function d0(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 f0=null;function Jx(){var n=window.event;return n&&n.type==="popstate"?n===f0?!1:(f0=n,!0):(f0=null,!1)}var h0=typeof setTimeout=="function"?setTimeout:void 0,Kx=typeof clearTimeout=="function"?clearTimeout:void 0,R2=typeof Promise=="function"?Promise:void 0,j2=typeof requestAnimationFrame=="function"?requestAnimationFrame:h0,Qx=typeof queueMicrotask=="function"?queueMicrotask:typeof R2<"u"?function(n){return R2.resolve(null).then(n).catch(eC)}:h0;function eC(n){setTimeout(function(){throw n})}function Va(n){return n==="head"}function M2(n,a){var o=a,l=0;do{var d=o.nextSibling;if(n.removeChild(o),d&&d.nodeType===8)if(o=d.data,o==="/$"||o==="/&"){if(l===0){n.removeChild(d),fc(a);return}l--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")l++;else if(o==="html")T0(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,T0(o);for(var h=o.firstChild;h;){var v=h.nextSibling,_=h.nodeName;h[yl]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&h.rel.toLowerCase()==="stylesheet"||o.removeChild(h),h=v}}else o==="body"&&T0(n.ownerDocument.body);o=d}while(o);fc(a)}function D2(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 U2(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 d=l=0;d<a.length;d++){var h=a[d];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 B2(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 tC(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 p0(n){var a=n.getBoundingClientRect(),o=getComputedStyle(n);return tC(a,o,n)}function nC(n){return n.documentElement.clientHeight}function sC(n){this.addEventListener("load",n),this.addEventListener("error",n)}function rC(n,a,o,l,d,h,v,_,B){var ne=a.nodeType===9?a:a.ownerDocument;try{var oe=ne.startViewTransition({update:function(){var Q=ne.defaultView,re=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,q=0;q<Xe.length;q++){var se=Xe[q];if(!se.complete){var me=se.getBoundingClientRect();if(0<me.bottom&&0<me.right&&me.top<Q.innerHeight&&me.left<Q.innerWidth){if(ee+=rE(se),ee>Rf){Re.length=ke;break}se=new Promise(sC.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(d,d),(re?Promise.allSettled([re.finished,Q]):Q).then(h,h);if(d(),re)return re.finished.then(h,h);h()},types:o});ne.__reactViewTransition=oe;var ge=[];return oe.ready.then(function(){for(var Q=ne.documentElement.getAnimations({subtree:!0}),re=0;re<Q.length;re++){var ke=Q[re],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,q=!0,se=0;se<ke.length;se++){var me=ke[se],Ie=me.width;if(Xe===void 0)Xe=Ie;else if(Xe!==Ie){q=!1;break}if(Ie=me.height,ee===void 0)ee=Ie;else if(ee!==Ie){q=!1;break}delete me.width,delete me.height,me.transform==="none"&&delete me.transform}q&&Xe!==void 0&&ee!==void 0&&(Re.setKeyframes(ke),q=getComputedStyle(Re.target,Re.pseudoElement),q.width!==Xe||q.height!==ee)&&(q=ke[0],q.width=Xe,q.height=ee,q=ke[ke.length-1],q.width=Xe,q.height=ee,Re.setKeyframes(ke))}}v()},function(Q){ne.__reactViewTransition===oe&&(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&&B(Q)}finally{l(),d(),v()}}),oe.finished.finally(function(){for(var Q=0;Q<ge.length;Q++)ge[Q].cancel();ne.__reactViewTransition===oe&&(ne.__reactViewTransition=null),_()}),oe}catch{return l(),d(),v(),null}}function Pi(n,a){this._scope=document.documentElement,this._selector="::view-transition-"+n+"("+a+")"}Pi.prototype.animate=function(n,a){return a=typeof a=="number"?{duration:a}:K({},a),a.pseudoElement=this._selector,this._scope.animate(n,a)},Pi.prototype.getAnimations=function(){for(var n=this._scope,a=this._selector,o=n.getAnimations({subtree:!0}),l=[],d=0;d<o.length;d++){var h=o[d].effect;h!==null&&h.target===n&&h.pseudoElement===a&&l.push(o[d])}return l},Pi.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function L2(n){return{name:n,group:new Pi("group",n),imagePair:new Pi("image-pair",n),old:new Pi("old",n),new:new Pi("new",n)}}function ms(n){this._fragmentFiber=n,this._observers=this._eventListeners=null}ms.prototype.addEventListener=function(n,a,o){var l=null,d=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($2(h,n,a,o)===-1){var v=this,_=a;o!=null&&typeof o!="boolean"&&o.once===!0&&(_=function(B){v.removeEventListener(n,a,o),typeof a=="function"?a.call(this,B):a.handleEvent(B)}),l!==null&&(d=v.removeEventListener.bind(v,n,a,o),l.addEventListener("abort",d,{once:!0}),d=l.removeEventListener.bind(l,"abort",d)),l=ic(o),h.push({type:n,listener:a,optionsOrUseCapture:o,attachedListener:_,cleanup:d}),y(this._fragmentFiber.child,!1,aC,n,_,l)}this._eventListeners=h}};function aC(n,a,o,l){return j(n).addEventListener(a,o,l),!1}ms.prototype.removeEventListener=function(n,a,o){var l=this._eventListeners;if(l!==null&&(a=$2(l,n,a,o),a!==-1)){var d=l[a];o=d.attachedListener;var h=d.cleanup;d=ic(d.optionsOrUseCapture),y(this._fragmentFiber.child,!1,iC,n,o,d),l.splice(a,1),h!==null&&h()}};function iC(n,a,o,l){return j(n).removeEventListener(a,o,l),!1}function ic(n){return n!=null&&typeof n!="boolean"&&(n.once===!0||n.signal instanceof AbortSignal)?{capture:n.capture,passive:n.passive}:n}function z2(n){return n==null?"c=0":typeof n=="boolean"?"c="+(n?"1":"0"):"c="+(n.capture?"1":"0")}function $2(n,a,o,l){if(n.length===0)return-1;l=z2(l);for(var d=0;d<n.length;d++){var h=n[d];if(h.type===a&&h.listener===o&&z2(h.optionsOrUseCapture)===l)return d}return-1}ms.prototype.dispatchEvent=function(n){var a=b(this._fragmentFiber);if(a===null)return!0;a=j(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 d=0;d<o.length;d++){var h=o[d];l.addEventListener(h.type,h.attachedListener,ic(h.optionsOrUseCapture))}if(a.appendChild(l),n=l.dispatchEvent(n),o)for(d=0;d<o.length;d++)h=o[d],l.removeEventListener(h.type,h.attachedListener,ic(h.optionsOrUseCapture));return a.removeChild(l),n}return a.dispatchEvent(n)},ms.prototype.focus=function(n){y(this._fragmentFiber.child,!0,V2,n,void 0,void 0)};function V2(n,a){return n.tag===6?!1:(n=j(n),vC(n,a))}ms.prototype.focusLast=function(n){var a=[];y(this._fragmentFiber.child,!0,m0,a,void 0,void 0);for(var o=a.length-1;0<=o&&!V2(a[o],n);o--);};function m0(n,a){return a.push(n),!1}ms.prototype.blur=function(){var n=b(this._fragmentFiber);n!==null&&(n=j(n),n=Ql(n).activeElement,n!==null&&y(this._fragmentFiber.child,!1,oC,n,void 0,void 0))};function oC(n,a){return n.tag===6?!1:(n=j(n),n===a||n.contains(a)?(a.blur(),!0):!1)}ms.prototype.observeUsing=function(n){this._observers===null&&(this._observers=new Set),this._observers.add(n),y(this._fragmentFiber.child,!1,cC,n,void 0,void 0)};function cC(n,a){return n.tag===6||(n=j(n),a.observe(n)),!1}ms.prototype.unobserveUsing=function(n){var a=this._observers;if(a!==null&&a.has(n)){a.delete(n),y(this._fragmentFiber.child,!1,lC,n,void 0,void 0);for(var o=a=0;o<qs.length;o++){var l=qs[o];l.fragmentInstance===this&&l.observer===n?n.unobserve(l.instance):qs[a++]=l}qs.length=a}};function lC(n,a){return n.tag===6||(n=j(n),a.unobserve(n)),!1}var qs=[],g0=!1;function uC(n,a,o){qs.push({fragmentInstance:n,observer:a,instance:o}),g0||(g0=!0,bC(function(){g0=!1;var l=qs;qs=[];for(var d=0;d<l.length;d++){var h=l[d];h.observer.unobserve(h.instance)}}))}ms.prototype.getClientRects=function(){var n=[];return y(this._fragmentFiber.child,!1,dC,n,void 0,void 0),n};function dC(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=j(n),a.push.apply(a,n.getClientRects());return!1}ms.prototype.getRootNode=function(n){var a=b(this._fragmentFiber);return a===null?this:j(a).getRootNode(n)},ms.prototype.compareDocumentPosition=function(n){var a=b(this._fragmentFiber);if(a===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var o=[];y(this._fragmentFiber.child,!1,m0,o,void 0,void 0);var l=j(a);if(o.length===0){if(o=l,S(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 d=l=o.compareDocumentPosition(n);return o===n?d=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(o=A(a)[1],o===null?d=Node.DOCUMENT_POSITION_PRECEDING:(n=j(o).compareDocumentPosition(n),d=n===0||n&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),d|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}a=j(o[0]),d=j(o[o.length-1]);var h=S(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(d)&Node.DOCUMENT_POSITION_CONTAINED_BY;var v=a.compareDocumentPosition(n),_=d.compareDocumentPosition(n),B=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&&d===n||B||_?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&a===n||!h&&d===n?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:v,a&Node.DOCUMENT_POSITION_DISCONNECTED||a&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||fC(a,this._fragmentFiber,o[0],o[o.length-1],n)?a:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function fC(n,a,o,l,d){var h=Ti(d);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=d.ownerDocument,d===h||d===h.documentElement||d===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=Y(o,h,ae),a===null?a=!1:(y(a,!0,W,h,o),h=V,V=null,a=h!==null)),a):n&Node.DOCUMENT_POSITION_FOLLOWING?((a=!!h)&&!(a=h===l)&&(a=Y(l,h,ae),a===null?a=!1:(y(a,!0,ce,h,l),h=V,C=V=null,a=h!==null)),a):!1}function P2(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)}ms.prototype.scrollIntoView=function(n){if(typeof n=="object")throw Error(r(566));var a=[];y(this._fragmentFiber.child,!1,m0,a,void 0,void 0);var o=n!==!1;if(a.length===0){var l=A(this._fragmentFiber);if(l=o?l[1]||l[0]||b(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){n=j(l),P2(n,o);return}if(l=j(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 d=a[l];d.tag===6?(d=j(d),P2(d,o)):j(d).scrollIntoView(n),l+=o?-1:1}};function hC(n,a){return n=j(n),G2(n,a),!1}function G2(n,a){n.reactFragments==null&&(n.reactFragments=new Set),n.reactFragments.add(a)}function F2(n,a){var o=a._eventListeners;if(o!==null)for(var l=0;l<o.length;l++){var d=o[l];n.addEventListener(d.type,d.attachedListener,ic(d.optionsOrUseCapture))}n.nodeType!==3&&(o=a._observers,o!==null&&o.forEach(function(h){for(var v=0,_=0;_<qs.length;_++){var B=qs[_];(B.fragmentInstance!==a||B.observer!==h||B.instance!==n)&&(qs[v++]=B)}qs.length=v,h.observe(n)}),G2(n,a))}function pC(n,a){var o=a._eventListeners;if(o!==null)for(var l=0;l<o.length;l++){var d=o[l];n.removeEventListener(d.type,d.attachedListener,ic(d.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 y0(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":y0(o),bd(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function mC(n,a,o,l){for(;n.nodeType===1;){var d=o;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[yl])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!==d.rel||n.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||n.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||n.getAttribute("title")!==(d.title==null?null:d.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(h=n.getAttribute("src"),(h!==(d.src==null?null:d.src)||n.getAttribute("type")!==(d.type==null?null:d.type)||n.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&n.getAttribute("name")===h)return n}else return n;if(n=Is(n.nextSibling),n===null)break}return null}function gC(n,a,o){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Is(n.nextSibling),n===null))return null;return n}function H2(n,a){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Is(n.nextSibling),n===null))return null;return n}function v0(n){return n.data==="$?"||n.data==="$~"}function b0(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function yC(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 Is(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 w0=null;function q2(n){n=n.nextSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(a===0)return Is(n.nextSibling);a--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||a++}n=n.nextSibling}return null}function Z2(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 vC(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 bC(n){j2(function(){j2(function(a){return n(a)})})}function Y2(n,a,o){switch(a=Ql(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 W2(n,a,o){for(var l in o){var d=o[l];o.hasOwnProperty(l)&&d!=null&&Et(n,a,l,null,Yx,d)}o.dangerouslySetInnerHTML!=null&&(n.textContent=""),n.onclick===rr&&(n.onclick=null),bd(n)}function T0(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);bd(n)}var Rs=new Map,X2=new Set;function eu(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 Yr=_e.d;_e.d={f:wC,r:TC,D:EC,C:SC,L:_C,m:kC,X:OC,S:AC,M:NC};function wC(){var n=Yr.f(),a=Sf();return n||a}function TC(n){var a=ko(n);a!==null&&a.tag===5&&a.type==="form"?Kw(a):Yr.r(n)}var oc=typeof document>"u"?null:document;function J2(n,a,o){var l=oc;if(l&&typeof a=="string"&&a){var d=_s(a);d='link[rel="'+n+'"][href="'+d+'"]',typeof o=="string"&&(d+='[crossorigin="'+o+'"]'),X2.has(d)||(X2.add(d),n={rel:n,crossOrigin:o,href:a},l.querySelector(d)===null&&(a=l.createElement("link"),Nn(a,"link",n),pn(a),l.head.appendChild(a)))}}function EC(n){Yr.D(n),J2("dns-prefetch",n,null)}function SC(n,a){Yr.C(n,a),J2("preconnect",n,a)}function _C(n,a,o){Yr.L(n,a,o);var l=oc;if(l&&n&&a){var d='link[rel="preload"][as="'+_s(a)+'"]';a==="image"&&o&&o.imageSrcSet?(d+='[imagesrcset="'+_s(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(d+='[imagesizes="'+_s(o.imageSizes)+'"]')):d+='[href="'+_s(n)+'"]';var h=d;switch(a){case"style":h=cc(n);break;case"script":h=lc(n)}if(!(Rs.has(h)||(n=K({rel:"preload",href:a==="image"&&o&&o.imageSrcSet?void 0:n,as:a},o),Rs.set(h,n),l.querySelector(d)!==null||a==="style"&&l.querySelector(tu(h))||a==="script"&&l.querySelector(nu(h))))){var v=l.createElement("link");Nn(v,"link",n),a==="style"&&(v[vd]=!0,v.onload=v.onerror=function(){u1(v)}),pn(v),l.head.appendChild(v)}}}function kC(n,a){Yr.m(n,a);var o=oc;if(o&&n){var l=a&&typeof a.as=="string"?a.as:"script",d='link[rel="modulepreload"][as="'+_s(l)+'"][href="'+_s(n)+'"]',h=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=lc(n)}if(!Rs.has(h)&&(n=K({rel:"modulepreload",href:n},a),Rs.set(h,n),o.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(nu(h)))return}l=o.createElement("link"),Nn(l,"link",n),pn(l),o.head.appendChild(l)}}}function AC(n,a,o){Yr.S(n,a,o);var l=oc;if(l&&n){var d=Ao(l).hoistableStyles,h=cc(n);a=a||"default";var v=d.get(h);if(!v){var _={loading:0,preload:null};if(v=l.querySelector(tu(h)))_.loading=5;else{n=K({rel:"stylesheet",href:n,"data-precedence":a},o),(o=Rs.get(h))&&E0(n,o);var B=v=l.createElement("link");pn(B),Nn(B,"link",n),B._p=new Promise(function(ne,oe){B.onload=ne,B.onerror=oe}),B.addEventListener("load",function(){_.loading|=1}),B.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Cf(v,a,l)}v={type:"stylesheet",instance:v,count:1,state:_},d.set(h,v)}}}function OC(n,a){Yr.X(n,a);var o=oc;if(o&&n){var l=Ao(o).hoistableScripts,d=lc(n),h=l.get(d);h||(h=o.querySelector(nu(d)),h||(n=K({src:n,async:!0},a),(a=Rs.get(d))&&S0(n,a),h=o.createElement("script"),pn(h),Nn(h,"link",n),o.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function NC(n,a){Yr.M(n,a);var o=oc;if(o&&n){var l=Ao(o).hoistableScripts,d=lc(n),h=l.get(d);h||(h=o.querySelector(nu(d)),h||(n=K({src:n,async:!0,type:"module"},a),(a=Rs.get(d))&&S0(n,a),h=o.createElement("script"),pn(h),Nn(h,"link",n),o.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function K2(n,a,o,l){var d=(d=Le.current)?eu(d):null;if(!d)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(o=cc(o.href),a=Ao(d).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=cc(o.href);var h=Ao(d).hoistableStyles,v=h.get(n);if(v||(d=d.ownerDocument||d,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(n,v),(h=d.querySelector(tu(n)))?h._p||(v.instance=h,v.state.loading=5):(h=Rs.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},Rs.set(n,h)),xC(d,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=lc(o),a=Ao(d).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 cc(n){return'href="'+_s(n)+'"'}function tu(n){return'link[rel="stylesheet"]['+n+"]"}function Q2(n){return K({},n,{"data-precedence":n.precedence,precedence:null})}function xC(n,a,o,l){if(a=n.querySelector('link[rel="preload"][as="style"]['+a+"]")){if(a[vd]!==!0){l.loading=1;return}}else a=n.createElement("link"),a[vd]=!0,a.onload=a.onerror=u1.bind(null,a),Nn(a,"link",o),pn(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 lc(n){return'[src="'+_s(n)+'"]'}function nu(n){return"script[async]"+n}function eE(n,a,o){if(a.count++,a.instance===null)switch(a.type){case"style":var l=n.querySelector('style[data-href~="'+_s(o.href)+'"]');if(l)return a.instance=l,pn(l),l;var d=K({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),pn(l),Nn(l,"style",d),Cf(l,o.precedence,n),a.instance=l;case"stylesheet":d=cc(o.href);var h=n.querySelector(tu(d));if(h)return a.state.loading|=4,a.instance=h,pn(h),h;l=Q2(o),(d=Rs.get(d))&&E0(l,d),h=(n.ownerDocument||n).createElement("link"),pn(h);var v=h;return v._p=new Promise(function(_,B){v.onload=_,v.onerror=B}),Nn(h,"link",l),a.state.loading|=4,Cf(h,o.precedence,n),a.instance=h;case"script":return h=lc(o.src),(d=n.querySelector(nu(h)))?(a.instance=d,pn(d),d):(l=o,(d=Rs.get(h))&&(l=K({},o),S0(l,d)),n=n.ownerDocument||n,d=n.createElement("script"),pn(d),Nn(d,"link",l),n.head.appendChild(d),a.instance=d);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,Cf(l,o.precedence,n));return a.instance}function Cf(n,a,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,h=d,v=0;v<l.length;v++){var _=l[v];if(_.dataset.precedence===a)h=_;else if(h!==d)break}h?h.parentNode.insertBefore(n,h.nextSibling):(a=o.nodeType===9?o.head:o,a.insertBefore(n,a.firstChild))}function E0(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function S0(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var If=null;function tE(n,a,o){if(If===null){var l=new Map,d=If=new Map;d.set(o,l)}else d=If,l=d.get(o),l||(l=new Map,d.set(o,l));if(l.has(n))return l;for(l.set(n,null),o=o.getElementsByTagName(n),d=0;d<o.length;d++){var h=o[d];if(!(h[yl]||h[Sn]||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 _0(n,a,o){n=n.ownerDocument||n,n.head.insertBefore(o,a==="title"?n.querySelector("head > title"):null)}function CC(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 nE(n,a){return n==="img"&&a.src!=null&&a.src!==""&&a.onLoad==null&&a.loading!=="lazy"}function sE(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function rE(n){return(n.width||100)*(n.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function aE(n,a){typeof a.decode=="function"&&(n.imgCount++,a.complete||(n.imgBytes+=rE(a),n.suspenseyImages.push(a)),n=jC.bind(n),a.decode().then(n,n))}function IC(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 d=cc(l.href),h=a.querySelector(tu(d));if(h){a=h._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=su.bind(n),a.then(n,n)),o.state.loading|=4,o.instance=h,pn(h);return}h=a.ownerDocument||a,l=Q2(l),(d=Rs.get(d))&&E0(l,d),h=h.createElement("link"),pn(h);var v=h;v._p=new Promise(function(_,B){v.onload=_,v.onerror=B}),Nn(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=su.bind(n),a.addEventListener("load",o),a.addEventListener("error",o))}}var Rf=0;function RC(n,a){return n.stylesheets&&n.count===0&&Mf(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var l=setTimeout(function(){if(n.stylesheets&&Mf(n,n.stylesheets),n.unsuspend){var h=n.unsuspend;n.unsuspend=null,h()}},6e4+a);0<n.imgBytes&&Rf===0&&(Rf=62500*Xx());var d=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Mf(n,n.stylesheets),n.unsuspend)){var h=n.unsuspend;n.unsuspend=null,h()}},(n.imgBytes>Rf?50:800)+a);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function iE(n){if(n.count===0&&(n.imgCount===0||!n.waitingForImages)){if(n.stylesheets)Mf(n,n.stylesheets);else if(n.unsuspend){var a=n.unsuspend;n.unsuspend=null,a()}}}function su(){this.count--,iE(this)}function jC(){this.imgCount--,iE(this)}var jf=null;function Mf(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,jf=new Map,a.forEach(MC,n),jf=null,su.call(n))}function MC(n,a){if(!(a.state.loading&4)){var o=jf.get(n);if(o)var l=o.get(null);else{o=new Map,jf.set(n,o);for(var d=n.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var v=d[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(o.set(v.dataset.precedence,v),l=v)}l&&o.set(null,l)}d=a.instance,v=d.getAttribute("data-precedence"),h=o.get(v)||l,h===l&&o.set(null,d),o.set(v,d),this.count++,l=su.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),h?h.parentNode.insertBefore(d,h.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(d,n.firstChild)),a.state.loading|=4}}var uc={$$typeof:M,Provider:null,Consumer:null,_currentValue:Pe,_currentValue2:Pe,_threadCount:0};function DC(n,a,o,l,d,h,v,_,B){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=rm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rm(0),this.hiddenUpdates=rm(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.transitionTypes=null,this.incompleteTransitions=new Map}function oE(n,a,o,l,d,h,v,_,B,ne,oe,ge){return n=new DC(n,a,o,v,B,ne,oe,ge,_),a=1,h===!0&&(a|=24),h=Xn(3,null,null,a),n.current=h,h.stateNode=n,a=zm(),a.refCount++,n.pooledCache=a,a.refCount++,h.memoizedState={element:l,isDehydrated:o,cache:a},Gm(h),n}function cE(n){return n?(n=Uo,n):Uo}function lE(n,a,o,l,d,h){d=cE(d),l.context===null?l.context=d:l.pendingContext=d,l=xa(a),l.payload={element:o},h=h===void 0?null:h,h!==null&&(l.callback=h),o=Ca(n,l,a),o!==null&&(es(o,n,a),Ml(o,n,a))}function uE(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<a?o:a}}function k0(n,a){uE(n,a),(n=n.alternate)&&uE(n,a)}function dE(n){if(n.tag===13||n.tag===31){var a=ki(n,67108864);a!==null&&es(a,n,67108864),k0(n,67108864)}}function fE(n){if(n.tag===13||n.tag===31){var a=ps();a=am(a);var o=ki(n,a);o!==null&&es(o,n,a),k0(n,a)}}var dc=!0;function UC(n,a,o,l){var d=be.T;be.T=null;var h=_e.p;try{_e.p=2,A0(n,a,o,l)}finally{_e.p=h,be.T=d}}function BC(n,a,o,l){var d=be.T;be.T=null;var h=_e.p;try{_e.p=8,A0(n,a,o,l)}finally{_e.p=h,be.T=d}}function A0(n,a,o,l){if(dc){var d=O0(l);if(d===null)o0(n,a,l,Df,o),pE(n,l);else if(zC(d,n,a,o,l))l.stopPropagation();else if(pE(n,l),a&4&&-1<LC.indexOf(n)){for(;d!==null;){var h=ko(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=wi(h.pendingLanes);if(v!==0){var _=h;for(_.pendingLanes|=2,_.entangledLanes|=2;v;){var B=1<<31-os(v);_.entanglements[1]|=B,v&=~B}pr(h),(ht&6)===0&&(wf=Ln()+500,Xl(0))}}break;case 31:case 13:_=ki(h,2),_!==null&&es(_,h,2),Sf(),k0(h,2)}if(h=O0(l),h===null&&o0(n,a,l,Df,o),h===d)break;d=h}d!==null&&l.stopPropagation()}else o0(n,a,l,null,o)}}function O0(n){return n=fm(n),N0(n)}var Df=null;function N0(n){if(Df=null,n=Ti(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=f(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 Df=n,null}function hE(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(sm()){case hd:return 2;case Ce:return 8;case Ye:case Ot:return 32;case Ss:return 268435456;default:return 32}default:return 32}}var x0=!1,Pa=null,Ga=null,Fa=null,ru=new Map,au=new Map,Ha=[],LC="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 pE(n,a){switch(n){case"focusin":case"focusout":Pa=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":ru.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":au.delete(a.pointerId)}}function iu(n,a,o,l,d,h){return n===null||n.nativeEvent!==h?(n={blockedOn:a,domEventName:o,eventSystemFlags:l,nativeEvent:h,targetContainers:[d]},a!==null&&(a=ko(a),a!==null&&dE(a)),n):(n.eventSystemFlags|=l,a=n.targetContainers,d!==null&&a.indexOf(d)===-1&&a.push(d),n)}function zC(n,a,o,l,d){switch(a){case"focusin":return Pa=iu(Pa,n,a,o,l,d),!0;case"dragenter":return Ga=iu(Ga,n,a,o,l,d),!0;case"mouseover":return Fa=iu(Fa,n,a,o,l,d),!0;case"pointerover":var h=d.pointerId;return ru.set(h,iu(ru.get(h)||null,n,a,o,l,d)),!0;case"gotpointercapture":return h=d.pointerId,au.set(h,iu(au.get(h)||null,n,a,o,l,d)),!0}return!1}function mE(n){var a=Ti(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,o1(n.priority,function(){fE(o)});return}}else if(a===31){if(a=f(o),a!==null){n.blockedOn=a,o1(n.priority,function(){fE(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 Uf(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var o=O0(n.nativeEvent);if(o===null){o=n.nativeEvent;var l=new o.constructor(o.type,o);dm=l,o.target.dispatchEvent(l),dm=null}else return a=ko(o),a!==null&&dE(a),n.blockedOn=o,!1;a.shift()}return!0}function gE(n,a,o){Uf(n)&&o.delete(a)}function $C(){x0=!1,Pa!==null&&Uf(Pa)&&(Pa=null),Ga!==null&&Uf(Ga)&&(Ga=null),Fa!==null&&Uf(Fa)&&(Fa=null),ru.forEach(gE),au.forEach(gE)}function Bf(n,a){n.blockedOn===a&&(n.blockedOn=null,x0||(x0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,$C)))}var Lf=null;function yE(n){Lf!==n&&(Lf=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lf===n&&(Lf=null);for(var a=0;a<n.length;a+=3){var o=n[a],l=n[a+1],d=n[a+2];if(typeof l!="function"){if(N0(l||o)===null)continue;break}var h=ko(o);h!==null&&(n.splice(a,3),a-=3,ug(h,{pending:!0,data:d,method:o.method,action:l},l,d))}}))}function fc(n){function a(B){return Bf(B,n)}Pa!==null&&Bf(Pa,n),Ga!==null&&Bf(Ga,n),Fa!==null&&Bf(Fa,n),ru.forEach(a),au.forEach(a);for(var o=0;o<Ha.length;o++){var l=Ha[o];l.blockedOn===n&&(l.blockedOn=null)}for(;0<Ha.length&&(o=Ha[0],o.blockedOn===null);)mE(o),o.blockedOn===null&&Ha.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var d=o[l],h=o[l+1],v=d[Wn]||null;if(typeof h=="function")v||yE(o);else if(v){var _=null;if(h&&h.hasAttribute("formAction")){if(d=h,v=h[Wn]||null)_=v.formAction;else if(N0(d)!==null)continue}else _=v.action;typeof _=="function"?o[l+1]=_:(o.splice(l,3),l-=3),yE(o)}}}function vE(){function n(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return d=v})},focusReset:"manual",scroll:"manual"})}function a(){d!==null&&(d(),d=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,d=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),d!==null&&(d(),d=null)}}}function C0(n){this._internalRoot=n}zf.prototype.render=C0.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(r(409));var o=a.current,l=ps();lE(o,l,n,a,null,null)},zf.prototype.unmount=C0.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;lE(n.current,2,null,n,null,null),Sf(),a[_o]=null}};function zf(n){this._internalRoot=n}zf.prototype.unstable_scheduleHydration=function(n){if(n){var a=i1();n={blockedOn:null,target:n,priority:a};for(var o=0;o<Ha.length&&a!==0&&a<Ha[o].priority;o++);Ha.splice(o,0,n),o===0&&mE(n)}};var bE=t.version;if(bE!=="19.3.0")throw Error(r(527,bE,"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 VC={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:be,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$f.isDisabled&&$f.supportsFiber)try{pl=$f.inject(VC),is=$f}catch{}}return gu.createRoot=function(n,a){if(!i(n))throw Error(r(299));var o=!1,l="",d=cT,h=lT,v=uT;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(l=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError)),a=oE(n,1,!1,null,null,o,l,null,d,h,v,vE),n[_o]=a.current,i0(n),new C0(a)},gu.hydrateRoot=function(n,a,o){if(!i(n))throw Error(r(299));var l=!1,d="",h=cT,v=lT,_=uT,B=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(d=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&&(B=o.formState)),a=oE(n,1,!0,a,o??null,l,d,B,h,v,_,vE),a.context=cE(null),o=a.current,l=ps(),l=am(l),d=xa(l),d.callback=null,Ca(o,d,l),o=l,a.current.lanes=o,gl(a,o),pr(a),n[_o]=a.current,i0(n),new zf(a)},gu.version="19.3.0",gu}var H_;function LG(){if(H_)return vy.exports;H_=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(),vy.exports=BG(),vy.exports}var q_=LG(),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(f=>typeof i[i[f]]!="number"),u={};for(const f of c)u[f]=i[f];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 Z_;(function(e){e.mergeShapes=(t,s)=>({...t,...s})})(Z_||(Z_={}));const je=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),si=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}},Ee=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 pa 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 f=r,p=0;for(;p<u.path.length;){const m=u.path[p];p===u.path.length-1?(f[m]=f[m]||{_errors:[]},f[m]._errors.push(s(u))):f[m]=f[m]||{_errors:[]},f=f[m],p++}}};return i(this),r}static assert(t){if(!(t instanceof pa))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()}}pa.create=e=>new pa(e);const yv=(e,t)=>{let s;switch(e.code){case Ee.invalid_type:e.received===je.undefined?s="Required":s=`Expected ${e.expected}, received ${e.received}`;break;case Ee.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,ft.jsonStringifyReplacer)}`;break;case Ee.unrecognized_keys:s=`Unrecognized key(s) in object: ${ft.joinValues(e.keys,", ")}`;break;case Ee.invalid_union:s="Invalid input";break;case Ee.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${ft.joinValues(e.options)}`;break;case Ee.invalid_enum_value:s=`Invalid enum value. Expected ${ft.joinValues(e.options)}, received '${e.received}'`;break;case Ee.invalid_arguments:s="Invalid function arguments";break;case Ee.invalid_return_type:s="Invalid function return type";break;case Ee.invalid_date:s="Invalid date";break;case Ee.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 Ee.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 Ee.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 Ee.custom:s="Invalid input";break;case Ee.invalid_intersection_types:s="Intersection results could not be merged";break;case Ee.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case Ee.not_finite:s="Number must be finite";break;default:s=t.defaultError,ft.assertNever(e)}return{message:s}};let zG=yv;function $G(){return zG}const VG=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 f="";const p=r.filter(m=>!!m).slice().reverse();for(const m of p)f=m(u,{data:t,defaultError:f}).message;return{...i,path:c,message:f}};function xe(e,t){const s=$G(),r=VG({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===yv?void 0:yv].filter(i=>!!i)});e.common.issues.push(r)}class Yn{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 He;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 Yn.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 He;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 He=Object.freeze({status:"aborted"}),_u=e=>({status:"dirty",value:e}),$s=e=>({status:"valid",value:e}),Y_=e=>e.status==="aborted",W_=e=>e.status==="dirty",Zc=e=>e.status==="valid",cp=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 Rr{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 X_=(e,t)=>{if(Zc(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 pa(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,f)=>{const{message:p}=e;return u.code==="invalid_enum_value"?{message:p??f.defaultError}:typeof f.data>"u"?{message:p??r??f.defaultError}:u.code!=="invalid_type"?{message:f.defaultError}:{message:p??s??f.defaultError}},description:i}}class lt{get description(){return this._def.description}_getType(t){return si(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Yn,ctx:{common:t.parent.common,data:t.data,parsedType:si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const s=this._parse(t);if(cp(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:si(t)},i=this._parseSync({data:t,path:r.path,parent:r});return X_(r,i)}"~validate"(t){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:s});return Zc(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=>Zc(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:si(t)},i=this._parse({data:t,path:r.path,parent:r}),c=await(cp(i)?i:Promise.resolve(i));return X_(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),f=()=>c.addIssue({code:Ee.custom,...r(i)});return typeof Promise<"u"&&u instanceof Promise?u.then(p=>p?!0:(f(),!1)):u?!0:(f(),!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 Xc({schema:this,typeName:Fe.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 li.create(this,this._def)}nullable(){return Jc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Er.create(this)}promise(){return hp.create(this,this._def)}or(t){return up.create([this,t],this._def)}and(t){return dp.create(this,t,this._def)}transform(t){return new Xc({...Je(this._def),schema:this,typeName:Fe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const s=typeof t=="function"?t:()=>t;return new Ev({...Je(this._def),innerType:this,defaultValue:s,typeName:Fe.ZodDefault})}brand(){return new uF({typeName:Fe.ZodBranded,type:this,...Je(this._def)})}catch(t){const s=typeof t=="function"?t:()=>t;return new Sv({...Je(this._def),innerType:this,catchValue:s,typeName:Fe.ZodCatch})}describe(t){const s=this.constructor;return new s({...this._def,description:t})}pipe(t){return Vb.create(this,t)}readonly(){return _v.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const PG=/^c[^\s-]{8,}$/i,GG=/^[0-9a-z]+$/,FG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,HG=/^[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,qG=/^[a-z0-9_-]{21}$/i,ZG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,YG=/^[-+]?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)?)??$/,WG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,XG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ey;const JG=/^(?:(?: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])$/,KG=/^(?:(?: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])$/,QG=/^(([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]))$/,eF=/^(([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])$/,tF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nF=/^([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])))",sF=new RegExp(`^${mO}$`);function gO(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 rF(e){return new RegExp(`^${gO(e)}$`)}function aF(e){let t=`${mO}T${gO(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 iF(e,t){return!!((t==="v4"||!t)&&JG.test(e)||(t==="v6"||!t)&&QG.test(e))}function oF(e,t){if(!ZG.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 cF(e,t){return!!((t==="v4"||!t)&&KG.test(e)||(t==="v6"||!t)&&eF.test(e))}class la 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:Ee.invalid_type,expected:je.string,received:c.parsedType}),He}const r=new Yn;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:Ee.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:Ee.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,f=t.data.length<c.value;(u||f)&&(i=this._getOrReturnCtx(t,i),u?xe(i,{code:Ee.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):f&&xe(i,{code:Ee.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),r.dirty())}else if(c.kind==="email")WG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"email",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="emoji")Ey||(Ey=new RegExp(XG,"u")),Ey.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"emoji",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="uuid")HG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"uuid",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="nanoid")qG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"nanoid",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid")PG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cuid",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid2")GG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cuid2",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="ulid")FG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"ulid",code:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.invalid_string,validation:{endsWith:c.value},message:c.message}),r.dirty()):c.kind==="datetime"?aF(c).test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:"datetime",message:c.message}),r.dirty()):c.kind==="date"?sF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:"date",message:c.message}),r.dirty()):c.kind==="time"?rF(c).test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:"time",message:c.message}),r.dirty()):c.kind==="duration"?YG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"duration",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="ip"?iF(t.data,c.version)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"ip",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="jwt"?oF(t.data,c.alg)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"jwt",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="cidr"?cF(t.data,c.version)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cidr",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="base64"?tF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"base64",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="base64url"?nF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"base64url",code:Ee.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:Ee.invalid_string,...Me.errToObj(r)})}_addCheck(t){return new la({...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 la({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new la({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new la({...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}}la.create=e=>new la({checks:[],typeName:Fe.ZodString,coerce:e?.coerce??!1,...Je(e)});function lF(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 Yc 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:Ee.invalid_type,expected:je.number,received:c.parsedType}),He}let r;const i=new Yn;for(const c of this._def.checks)c.kind==="int"?ft.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.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:Ee.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:Ee.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),i.dirty()):c.kind==="multipleOf"?lF(t.data,c.value)!==0&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.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:Ee.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 Yc({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:Me.toString(i)}]})}_addCheck(t){return new Yc({...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)}}Yc.create=e=>new Yc({checks:[],typeName:Fe.ZodNumber,coerce:e?.coerce||!1,...Je(e)});class Hu 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 Yn;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:Ee.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:Ee.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:Ee.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:Ee.invalid_type,expected:je.bigint,received:s.parsedType}),He}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 Hu({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:Me.toString(i)}]})}_addCheck(t){return new Hu({...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}}Hu.create=e=>new Hu({checks:[],typeName:Fe.ZodBigInt,coerce:e?.coerce??!1,...Je(e)});class vv 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:Ee.invalid_type,expected:je.boolean,received:r.parsedType}),He}return $s(t.data)}}vv.create=e=>new vv({typeName:Fe.ZodBoolean,coerce:e?.coerce||!1,...Je(e)});class lp 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:Ee.invalid_type,expected:je.date,received:c.parsedType}),He}if(Number.isNaN(t.data.getTime())){const c=this._getOrReturnCtx(t);return xe(c,{code:Ee.invalid_date}),He}const r=new Yn;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:Ee.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:Ee.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 lp({...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}}lp.create=e=>new lp({checks:[],coerce:e?.coerce||!1,typeName:Fe.ZodDate,...Je(e)});class J_ extends lt{_parse(t){if(this._getType(t)!==je.symbol){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.symbol,received:r.parsedType}),He}return $s(t.data)}}J_.create=e=>new J_({typeName:Fe.ZodSymbol,...Je(e)});class K_ extends lt{_parse(t){if(this._getType(t)!==je.undefined){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.undefined,received:r.parsedType}),He}return $s(t.data)}}K_.create=e=>new K_({typeName:Fe.ZodUndefined,...Je(e)});class Q_ extends lt{_parse(t){if(this._getType(t)!==je.null){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.null,received:r.parsedType}),He}return $s(t.data)}}Q_.create=e=>new Q_({typeName:Fe.ZodNull,...Je(e)});class e4 extends lt{constructor(){super(...arguments),this._any=!0}_parse(t){return $s(t.data)}}e4.create=e=>new e4({typeName:Fe.ZodAny,...Je(e)});class t4 extends lt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return $s(t.data)}}t4.create=e=>new t4({typeName:Fe.ZodUnknown,...Je(e)});class mi extends lt{_parse(t){const s=this._getOrReturnCtx(t);return xe(s,{code:Ee.invalid_type,expected:je.never,received:s.parsedType}),He}}mi.create=e=>new mi({typeName:Fe.ZodNever,...Je(e)});class n4 extends lt{_parse(t){if(this._getType(t)!==je.undefined){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.void,received:r.parsedType}),He}return $s(t.data)}}n4.create=e=>new n4({typeName:Fe.ZodVoid,...Je(e)});class Er extends lt{_parse(t){const{ctx:s,status:r}=this._processInputParams(t),i=this._def;if(s.parsedType!==je.array)return xe(s,{code:Ee.invalid_type,expected:je.array,received:s.parsedType}),He;if(i.exactLength!==null){const u=s.data.length>i.exactLength.value,f=s.data.length<i.exactLength.value;(u||f)&&(xe(s,{code:u?Ee.too_big:Ee.too_small,minimum:f?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:Ee.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:Ee.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,f)=>i.type._parseAsync(new Rr(s,u,s.path,f)))).then(u=>Yn.mergeArray(r,u));const c=[...s.data].map((u,f)=>i.type._parseSync(new Rr(s,u,s.path,f)));return Yn.mergeArray(r,c)}get element(){return this._def.type}min(t,s){return new Er({...this._def,minLength:{value:t,message:Me.toString(s)}})}max(t,s){return new Er({...this._def,maxLength:{value:t,message:Me.toString(s)}})}length(t,s){return new Er({...this._def,exactLength:{value:t,message:Me.toString(s)}})}nonempty(t){return this.min(1,t)}}Er.create=(e,t)=>new Er({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Fe.ZodArray,...Je(t)});function Tc(e){if(e instanceof tn){const t={};for(const s in e.shape){const r=e.shape[s];t[s]=li.create(Tc(r))}return new tn({...e._def,shape:()=>t})}else return e instanceof Er?new Er({...e._def,type:Tc(e.element)}):e instanceof li?li.create(Tc(e.unwrap())):e instanceof Jc?Jc.create(Tc(e.unwrap())):e instanceof go?go.create(e.items.map(t=>Tc(t))):e}class tn 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:Ee.invalid_type,expected:je.object,received:m.parsedType}),He}const{status:r,ctx:i}=this._processInputParams(t),{shape:c,keys:u}=this._getCached(),f=[];if(!(this._def.catchall instanceof mi&&this._def.unknownKeys==="strip"))for(const m in i.data)u.includes(m)||f.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 Rr(i,y,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof mi){const m=this._def.unknownKeys;if(m==="passthrough")for(const g of f)p.push({key:{status:"valid",value:g},value:{status:"valid",value:i.data[g]}});else if(m==="strict")f.length>0&&(xe(i,{code:Ee.unrecognized_keys,keys:f}),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 f){const y=i.data[g];p.push({key:{status:"valid",value:g},value:m._parse(new Rr(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=>Yn.mergeObjectSync(r,m)):Yn.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(t){return Me.errToObj,new tn({...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 tn({...this._def,unknownKeys:"strip"})}passthrough(){return new tn({...this._def,unknownKeys:"passthrough"})}extend(t){return new tn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new tn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Fe.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new tn({...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 tn({...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 tn({...this._def,shape:()=>s})}deepPartial(){return Tc(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 tn({...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 li;)c=c._def.innerType;s[r]=c}return new tn({...this._def,shape:()=>s})}keyof(){return yO(ft.objectKeys(this.shape))}}tn.create=(e,t)=>new tn({shape:()=>e,unknownKeys:"strip",catchall:mi.create(),typeName:Fe.ZodObject,...Je(t)});tn.strictCreate=(e,t)=>new tn({shape:()=>e,unknownKeys:"strict",catchall:mi.create(),typeName:Fe.ZodObject,...Je(t)});tn.lazycreate=(e,t)=>new tn({shape:e,unknownKeys:"strip",catchall:mi.create(),typeName:Fe.ZodObject,...Je(t)});class up extends lt{_parse(t){const{ctx:s}=this._processInputParams(t),r=this._def.options;function i(c){for(const f of c)if(f.result.status==="valid")return f.result;for(const f of c)if(f.result.status==="dirty")return s.common.issues.push(...f.ctx.common.issues),f.result;const u=c.map(f=>new pa(f.ctx.common.issues));return xe(s,{code:Ee.invalid_union,unionErrors:u}),He}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 f=u.map(p=>new pa(p));return xe(s,{code:Ee.invalid_union,unionErrors:f}),He}}get options(){return this._def.options}}up.create=(e,t)=>new up({options:e,typeName:Fe.ZodUnion,...Je(t)});function bv(e,t){const s=si(e),r=si(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(f=>i.indexOf(f)!==-1),u={...e,...t};for(const f of c){const p=bv(e[f],t[f]);if(!p.valid)return{valid:!1};u[f]=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],f=t[c],p=bv(u,f);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 dp extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t),i=(c,u)=>{if(Y_(c)||Y_(u))return He;const f=bv(c.value,u.value);return f.valid?((W_(c)||W_(u))&&s.dirty(),{status:s.value,value:f.data}):(xe(r,{code:Ee.invalid_intersection_types}),He)};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}))}}dp.create=(e,t,s)=>new dp({left:e,right:t,typeName:Fe.ZodIntersection,...Je(s)});class go extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.array)return xe(r,{code:Ee.invalid_type,expected:je.array,received:r.parsedType}),He;if(r.data.length<this._def.items.length)return xe(r,{code:Ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),He;!this._def.rest&&r.data.length>this._def.items.length&&(xe(r,{code:Ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const c=[...r.data].map((u,f)=>{const p=this._def.items[f]||this._def.rest;return p?p._parse(new Rr(r,u,r.path,f)):null}).filter(u=>!!u);return r.common.async?Promise.all(c).then(u=>Yn.mergeArray(s,u)):Yn.mergeArray(s,c)}get items(){return this._def.items}rest(t){return new go({...this._def,rest:t})}}go.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new go({items:e,typeName:Fe.ZodTuple,rest:null,...Je(t)})};class fp 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:Ee.invalid_type,expected:je.object,received:r.parsedType}),He;const i=[],c=this._def.keyType,u=this._def.valueType;for(const f in r.data)i.push({key:c._parse(new Rr(r,f,r.path,f)),value:u._parse(new Rr(r,r.data[f],r.path,f)),alwaysSet:f in r.data});return r.common.async?Yn.mergeObjectAsync(s,i):Yn.mergeObjectSync(s,i)}get element(){return this._def.valueType}static create(t,s,r){return s instanceof lt?new fp({keyType:t,valueType:s,typeName:Fe.ZodRecord,...Je(r)}):new fp({keyType:la.create(),valueType:t,typeName:Fe.ZodRecord,...Je(s)})}}class s4 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:Ee.invalid_type,expected:je.map,received:r.parsedType}),He;const i=this._def.keyType,c=this._def.valueType,u=[...r.data.entries()].map(([f,p],m)=>({key:i._parse(new Rr(r,f,r.path,[m,"key"])),value:c._parse(new Rr(r,p,r.path,[m,"value"]))}));if(r.common.async){const f=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 He;(m.status==="dirty"||g.status==="dirty")&&s.dirty(),f.set(m.value,g.value)}return{status:s.value,value:f}})}else{const f=new Map;for(const p of u){const m=p.key,g=p.value;if(m.status==="aborted"||g.status==="aborted")return He;(m.status==="dirty"||g.status==="dirty")&&s.dirty(),f.set(m.value,g.value)}return{status:s.value,value:f}}}}s4.create=(e,t,s)=>new s4({valueType:t,keyType:e,typeName:Fe.ZodMap,...Je(s)});class qu extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.set)return xe(r,{code:Ee.invalid_type,expected:je.set,received:r.parsedType}),He;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(xe(r,{code:Ee.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:Ee.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 He;g.status==="dirty"&&s.dirty(),m.add(g.value)}return{status:s.value,value:m}}const f=[...r.data.values()].map((p,m)=>c._parse(new Rr(r,p,r.path,m)));return r.common.async?Promise.all(f).then(p=>u(p)):u(f)}min(t,s){return new qu({...this._def,minSize:{value:t,message:Me.toString(s)}})}max(t,s){return new qu({...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)}}qu.create=(e,t)=>new qu({valueType:e,minSize:null,maxSize:null,typeName:Fe.ZodSet,...Je(t)});class wv 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})}}wv.create=(e,t)=>new wv({getter:e,typeName:Fe.ZodLazy,...Je(t)});class Tv extends lt{_parse(t){if(t.data!==this._def.value){const s=this._getOrReturnCtx(t);return xe(s,{received:s.data,code:Ee.invalid_literal,expected:this._def.value}),He}return{status:"valid",value:t.data}}get value(){return this._def.value}}Tv.create=(e,t)=>new Tv({value:e,typeName:Fe.ZodLiteral,...Je(t)});function yO(e,t){return new Wc({values:e,typeName:Fe.ZodEnum,...Je(t)})}class Wc 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:Ee.invalid_type}),He}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:Ee.invalid_enum_value,options:r}),He}return $s(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 Wc.create(t,{...this._def,...s})}exclude(t,s=this._def){return Wc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...s})}}Wc.create=yO;class r4 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:Ee.invalid_type}),He}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:Ee.invalid_enum_value,options:i}),He}return $s(t.data)}get enum(){return this._def.values}}r4.create=(e,t)=>new r4({values:e,typeName:Fe.ZodNativeEnum,...Je(t)});class hp 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:Ee.invalid_type,expected:je.promise,received:s.parsedType}),He;const r=s.parsedType===je.promise?s.data:Promise.resolve(s.data);return $s(r.then(i=>this._def.type.parseAsync(i,{path:s.path,errorMap:s.common.contextualErrorMap})))}}hp.create=(e,t)=>new hp({type:e,typeName:Fe.ZodPromise,...Je(t)});class Xc extends lt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Fe.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 f=>{if(s.value==="aborted")return He;const p=await this._def.schema._parseAsync({data:f,path:r.path,parent:r});return p.status==="aborted"?He:p.status==="dirty"||s.value==="dirty"?_u(p.value):p});{if(s.value==="aborted")return He;const f=this._def.schema._parseSync({data:u,path:r.path,parent:r});return f.status==="aborted"?He:f.status==="dirty"||s.value==="dirty"?_u(f.value):f}}if(i.type==="refinement"){const u=f=>{const p=i.refinement(f,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 f};if(r.common.async===!1){const f=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return f.status==="aborted"?He:(f.status==="dirty"&&s.dirty(),u(f.value),{status:s.value,value:f.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(f=>f.status==="aborted"?He:(f.status==="dirty"&&s.dirty(),u(f.value).then(()=>({status:s.value,value:f.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(!Zc(u))return He;const f=i.transform(u.value,c);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:f}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>Zc(u)?Promise.resolve(i.transform(u.value,c)).then(f=>({status:s.value,value:f})):He);ft.assertNever(i)}}Xc.create=(e,t,s)=>new Xc({schema:e,typeName:Fe.ZodEffects,effect:t,...Je(s)});Xc.createWithPreprocess=(e,t,s)=>new Xc({schema:t,effect:{type:"preprocess",transform:e},typeName:Fe.ZodEffects,...Je(s)});class li extends lt{_parse(t){return this._getType(t)===je.undefined?$s(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}li.create=(e,t)=>new li({innerType:e,typeName:Fe.ZodOptional,...Je(t)});class Jc extends lt{_parse(t){return this._getType(t)===je.null?$s(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Jc.create=(e,t)=>new Jc({innerType:e,typeName:Fe.ZodNullable,...Je(t)});class Ev 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}}Ev.create=(e,t)=>new Ev({innerType:e,typeName:Fe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Je(t)});class Sv 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 cp(i)?i.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new pa(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new pa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Sv.create=(e,t)=>new Sv({innerType:e,typeName:Fe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Je(t)});class a4 extends lt{_parse(t){if(this._getType(t)!==je.nan){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.nan,received:r.parsedType}),He}return{status:"valid",value:t.data}}}a4.create=e=>new a4({typeName:Fe.ZodNaN,...Je(e)});class uF 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 Vb 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"?He:c.status==="dirty"?(s.dirty(),_u(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"?He: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 Vb({in:t,out:s,typeName:Fe.ZodPipeline})}}class _v extends lt{_parse(t){const s=this._def.innerType._parse(t),r=i=>(Zc(i)&&(i.value=Object.freeze(i.value)),i);return cp(s)?s.then(i=>r(i)):r(s)}unwrap(){return this._def.innerType}}_v.create=(e,t)=>new _v({innerType:e,typeName:Fe.ZodReadonly,...Je(t)});var Fe;(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"})(Fe||(Fe={}));const Sr=la.create,ud=Yc.create,vO=vv.create;mi.create;const ui=Er.create,on=tn.create;up.create;dp.create;go.create;const Pb=fp.create,dF=wv.create,fF=Tv.create,bO=Wc.create;hp.create;li.create;Jc.create;const Ut=De("0x2::sui::SUI"),pp=864e5,hF=10n**27n,pt=Sr().refine(da,"Invalid Sui address").transform(e=>ye(e)),tr=Sr().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)),wO=Sr().regex(/^(0|[1-9][0-9]*)$/).refine(e=>BigInt(e)<=18446744073709551615n,"Amount exceeds u64"),vs=wO.refine(e=>BigInt(e)>0n,"Must be positive"),TO="agent gas",Vt=(e,t)=>De(e)===De(t),pF=Sr().regex(/^[a-z0-9_-]{1,32}$/),Wp=e=>BigInt(e.perX)<=BigInt(e.daily),mF=on({coin:tr,recipients:ui(on({name:pF,address:pt}).strict()).min(1),perTransfer:vs,daily:vs}).strict().refine(e=>Wp({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"),gF=bO(["deepbook","cetus"]),yF=on({coinIn:tr,coinOut:tr,pools:ui(pt).min(1),perTrade:vs,daily:vs,minPrice:vs}).strict().refine(e=>Wp({perX:e.perTrade,daily:e.daily})&&!Vt(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"),vF=on({coin:tr,allowBorrow:vO(),perAction:vs,daily:vs,minHealthFactor:ud().min(1).max(100).nullable()}).strict().refine(e=>Wp({perX:e.perAction,daily:e.daily}),"Per-action limit must not exceed the daily limit"),bF=on({validators:ui(pt),perStake:vs,daily:vs}).strict().refine(e=>Wp({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"),Ah=e=>new Set(e).size===e.length,wF=on({transfers:ui(mF).default([]),swaps:ui(yF).default([]),lending:ui(vF).default([]),staking:bF.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=>Ah(e.transfers.map(t=>t.coin))&&Ah(e.swaps.map(t=>`${t.coinIn}>${t.coinOut}`))&&Ah(e.lending.map(t=>t.coin)),"One transfer rule per coin, one swap rule per direction, one lending rule per coin");function TF(e){const t=[...e.transfers.map(s=>s.coin),...e.swaps.map(s=>s.coinIn),...e.lending.map(s=>s.coin),...e.staking?[Ut]:[]];return[...new Set(t.map(s=>De(s)))]}const EF=on({type:tr,symbol:Sr().min(1).max(16),decimals:ud().int().min(0).max(18),unlisted:vO().optional()}).strict(),SF=on({venue:gF,poolId:pt,coinA:tr,coinB:tr}).strict(),_F=ud().int().min(0).max(255),kF=on({network:bO(["localnet","testnet","devnet","mainnet"]),grpcUrl:Sr().url(),chainIdentifier:Sr().min(1),packageId:pt,publishedAt:pt,configId:pt,siteUrl:Sr().url().optional(),coins:ui(EF).min(1),pools:ui(SF),demoFaucet:on({packageId:pt,faucetId:pt,coin:tr}).strict().optional(),protocols:on({deepbook:on({packageId:pt,publishedAt:pt}).strict(),cetus:on({packageId:pt,publishedAt:pt,configId:pt}).strict(),navi:on({packageId:pt,publishedAt:pt,oraclePackageId:pt,storageId:pt,oracleId:pt,incentiveV2Id:pt,incentiveV3Id:pt,reserves:Pb(tr,on({poolId:pt,assetId:_F}).strict())}).strict()}).strict()}).strict().refine(e=>Vt(e.coins[0].type,Ut),"The first coin must be SUI, the gas coin").refine(e=>Ah(e.coins.map(t=>t.type)),"Each coin once").refine(e=>e.pools.every(t=>e.coins.some(s=>Vt(s.type,t.coinA))&&e.coins.some(s=>Vt(s.type,t.coinB)))&&Object.keys(e.protocols.navi.reserves).every(t=>e.coins.some(s=>Vt(s.type,t)))&&(!e.demoFaucet||e.coins.some(t=>Vt(t.type,e.demoFaucet.coin))),"Pools, reserves and the demo faucet may only name listed coins");function Kc(e,t){const s=e.coins.find(r=>Vt(r.type,t));if(!s)throw new Error(`${t} is not a coin this deployment lists`);return s}const AF=on({v:fF(1),sessionAddress:pt,setup:dF(()=>RF),passId:pt.optional()}).strict(),OF=e=>AF.parse(JSON.parse(new TextDecoder().decode(qe(e.replaceAll("-","+").replaceAll("_","/"))))),NF=ud().int().positive().max(30*pp),xF=vs,CF=ud().int().positive(),IF=Sr().regex(/^[\x20-\x7e]{1,64}$/),RF=on({name:IF,policy:wF,ttlMs:NF,expiresMs:CF,allowances:Pb(tr,vs),gasAmount:xF,gasCap:vs,gasDaily:vs}).strict().refine(e=>BigInt(e.gasDaily)<=BigInt(e.gasCap),"Daily gas limit must not exceed the gas lifetime cap").refine(e=>{const t=new Set(Object.keys(e.allowances).map(r=>De(r))),s=TF(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(Ut))},"A daily limit must not exceed the lifetime cap of its coin");on({passId:pt,receiptId:pt,allowances:Pb(tr,on({allowance:pt,revokeCap:pt}).strict()),gasAllowance:pt,gasRevokeCap:pt,owner:pt,authorizationDigest:Sr().min(1)}).strict();function jF(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 wO.parse((BigInt(s)*10n**BigInt(t)+BigInt(r.padEnd(t,"0"))).toString())}function dd(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 i4(e){const[t,,s]=De(e).split("::");return`${t.slice(0,6)}…${t.slice(-4)}::${s}`}function _r(e,t){const s=e.coins.find(r=>Vt(r.type,t));return s?s.unlisted?`${s.symbol} (${i4(t)})`:s.symbol:i4(t)}function bn(e,t,s){const r=e.coins.find(i=>Vt(i.type,t));return r?`${dd(s,r.decimals)} ${_r(e,t)}`:`${s} base units of ${t}`}function mp(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(Ut),{coins:[...t],pools:[...s]}}function MF(e,t,s,r){const i=Kc(e,s).decimals+9-Kc(e,t).decimals;return i>=0?dd(r,i):(BigInt(r)*10n**BigInt(-i)).toString()}const o4=e=>/^(USD|AUSD$|FDUSD$|BUCK$)/i.test(e);function Gb(e,t,s){const r=o4(Kc(e,t).symbol),i=o4(Kc(e,s).symbol);return r&&!i?{base:s,quote:t,limit:"max"}:{base:t,quote:s,limit:"min"}}function DF(e,t,s,r){if(Gb(e,t,s).limit==="min")return MF(e,t,s,r);const i=BigInt(r),c=10n**BigInt(Kc(e,s).decimals)*10n**9n;return dd(((c*2n+i)/(i*2n)).toString(),Kc(e,t).decimals)}const UF=e=>e===null?"0":(BigInt(jF(e.toFixed(2),2))*hF/100n).toString();function gp(e){const t={};for(const[s,r]of Object.entries(e.allowances))t[De(s)]=(t[De(s)]??0n)+BigInt(r);return t[Ut]=(t[Ut]??0n)+BigInt(e.gasCap),Object.fromEntries(Object.entries(t).map(([s,r])=>[s,r.toString()]))}function BF(e,t){const s=r=>BigInt(t[De(r)]??"0");return Object.fromEntries(Object.entries(gp(e)).map(([r,i])=>[r,(BigInt(i)>s(r)?BigInt(i)-s(r):0n).toString()]))}function LF(e){return(BigInt(gp(e)[Ut])+BigInt(e.gasAmount)+zF).toString()}const zF=50000000n,Rn=F.Address,kv=F.struct("Bag",{id:Rn,size:F.u64()}),$F=F.struct("Control",{controller:Rn,name:F.string(),owner:F.Address,agent:F.Address,agent_expires_ms:F.u64(),policies:F.struct("Policies",{bag:kv}),positions:kv}),VF=F.struct("Pass",{id:Rn,control:$F}),Xp=F.struct("Meter",{day:F.u64(),used:F.u64()}),PF=F.struct("TransferPolicy",{recipients:kv,per_transfer:F.u64(),daily:F.u64(),meter:Xp}),GF=F.struct("SwapPolicy",{venues:F.vector(Rn),per_trade:F.u64(),daily:F.u64(),min_price:F.u64(),meter:Xp}),FF=F.struct("LendingPolicy",{pool:Rn,asset:F.u8(),allow_borrow:F.bool(),per_action:F.u64(),daily:F.u64(),min_health_factor:F.u256(),meter:Xp}),HF=F.struct("StakingPolicy",{validators:F.vector(F.Address),per_stake:F.u64(),daily:F.u64(),meter:Xp}),EO=F.struct("AccountCap",{id:Rn,owner:F.Address}),qF=e=>ye(EO.parse(e).owner),ZF=F.struct("StakedSui",{id:Rn,pool_id:Rn,stake_activation_epoch:F.u64(),principal:F.u64()}),YF=De("0x3::staking_pool::StakedSui"),WF=F.enum("RateLimit",{Windowed:F.struct("Windowed",{limit:F.u256(),spent:F.u256(),anchor_ms:F.option(F.u64()),index:F.u64(),window:F.enum("Window",{PeriodicMs:F.u64(),CalendarMonths:F.u8()})})}),XF=F.struct("Allowance",{id:Rn,settings:F.struct("Settings",{funder:F.Address,spender:F.option(F.Address),app:F.option(F.struct("TypeName",{name:F.string()})),lifetime_cap:F.option(F.u256()),start_timestamp_ms:F.option(F.u64()),expiration_timestamp_ms:F.option(F.u64()),rate_limit:F.option(WF),name:F.string()}),current_spend:F.u256()}),JF=F.struct("AllowanceCap",{id:Rn,allowance:Rn}),KF=F.struct("Clock",{id:Rn,timestamp_ms:F.u64()}),QF=F.struct("Created",{pass:Rn,receipt:Rn,name:F.string(),owner:F.Address,agent:F.Address,agent_expires_ms:F.u64()}),eH=F.struct("Issued",{pass:Rn,coin_type:F.struct("TypeName",{name:F.string()}),lifetime_cap:F.option(F.u256()),expires_ms:F.option(F.u64())}),tH=F.struct("Receipt",{id:Rn,pass:Rn,name:F.string()}),SO=e=>`${e.packageId}::pass::PASS`,Fb=e=>`${e.packageId}::pass::Created`;function Hb(e){const t=QF.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 _O(e,t,s){const r=[];let i=null;do{const c=await e.listOwnedObjects({owner:s,type:nH(t),cursor:i,include:{content:!0}});for(const u of c.objects){const f=tH.parse(u.content);r.push({id:ye(f.id),pass:ye(f.pass),name:f.name})}i=c.hasNextPage?c.cursor:null}while(i);return r}const nH=e=>`${e.packageId}::pass::Receipt`,sH=e=>`0x2::allowance::Allowance<0x2::balance::Balance<${e}>>`,kO=e=>De(`0x${e}`);async function rH(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(f=>f.eventType===u);return{sender:ye(i.transaction.sender),passes:c(Fb(t)).map(u=>Hb(u.bcs)),issued:c(`${t.packageId}::pass::Issued`).map(u=>{const f=eH.parse(u.bcs);return{passId:ye(f.pass),coinType:kO(f.coin_type.name),lifetimeCap:f.lifetime_cap,expiresMs:f.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 c4=[500,1e3,2e3,4e3],aH=e=>e instanceof gt&&e.code==="RESOURCE_EXHAUSTED";class iH extends Qv{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(f){if(!aH(f)||c>=c4.length)throw f;for(const p of[u.headers,u.status,u.trailers])p.catch(()=>{});await new Promise(p=>setTimeout(p,c4[c]))}}})();return new Kk(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 $t(e){return new lb({network:e.network,transport:new iH({baseUrl:e.grpcUrl})})}async function AO(e){const{object:t}=await e.getObject({objectId:"0x6",include:{content:!0}});return Number(KF.parse(t.content).timestamp_ms)}function nh(e,t){const s=Math.floor(t/pp);return{usedToday:s>Number(e.day)?"0":e.used,resetsAtMs:(s+1)*pp}}async function Av(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 oH(e,t,s,r){const i={transfers:[],swaps:[],lending:[],staking:[]};for(const u of await Av(e,s)){const f=ws(u.valueType);if(ye(f.address)!==t.packageId)continue;const p=f.typeParams.map(m=>De(m));if(f.module==="transfer_policy"){const m=PF.parse(u.value.bcs),g=(await Av(e,ye(m.recipients.id))).map(y=>({name:F.string().parse(y.name.bcs),address:ye(F.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:nh(m.meter,r)})}else if(f.module==="swap_policy"){const m=GF.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:nh(m.meter,r)})}else if(f.module==="lending_policy"){const m=FF.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:nh(m.meter,r)})}else if(f.module==="staking_policy"){const m=HF.parse(u.value.bcs);i.staking.push({validators:m.validators.map(g=>ye(g)),perStake:m.per_stake,daily:m.daily,usage:nh(m.meter,r)})}}const c=(u,f)=>u.coinType.localeCompare(f.coinType);return i.transfers.sort(c),i.lending.sort(c),i.swaps.sort((u,f)=>(u.coinIn+u.coinOut).localeCompare(f.coinIn+f.coinOut)),i}async function Jp(e,t,s){const[{object:r},i]=await Promise.all([e.getObject({objectId:s,include:{content:!0}}),AO(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}=VF.parse(r.content),[u,f]=await Promise.all([oH(e,t,ye(c.policies.bag.id),i),Av(e,ye(c.positions.id))]),p=f.find(g=>De(g.valueType)===De(`${t.protocols.navi.packageId}::account::AccountCap`)),m=f.filter(g=>De(g.valueType)===YF).map(g=>{const y=ZF.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(EO.parse(p.value.bcs).owner):null,stakes:m,chainTimeMs:i}}async function cH(e,t,s){const r=await lH(e,t,s);return Object.fromEntries(Object.entries(r).map(([i,c])=>[i,c.addressBalance]))}async function lH(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 uH(e){const t=ws(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 qb(e,t,s){let r;try{({object:r}=await e.getObject({objectId:t,include:{content:!0}}))}catch(m){if(m instanceof lh&&(m.reason==="deleted"||m.reason==="notFound"))return null;throw m}if(De(r.type)!==De(sH(s))||r.owner.$kind!=="Shared")throw new Error("Unexpected allowance type or ownership");const i=await AO(e),c=XF.parse(r.content),u=c.settings,f=u.rate_limit?.Windowed;let p=null;if(f){const m=f.window.PeriodicMs??null;let g=f.spent;f.anchor_ms!==null&&m!==null&&Math.floor((i-Number(f.anchor_ms))/Number(m))>Number(f.index)&&(g="0"),p={limit:f.limit,spent:f.spent,spentNow:g,anchorMs:f.anchor_ms,index:f.index,periodMs:m,months:f.window.CalendarMonths??null}}return{id:ye(c.id),coinType:s,funder:ye(u.funder),spender:u.spender?ye(u.spender):null,app:u.app?kO(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 dH(e,t){const{object:s}=await e.getObject({objectId:t,include:{content:!0}});return ye(JF.parse(s.content).allowance)}async function fH(e,t,s){const r=De(SO(t)),i=ye(s.owner),c=ye(s.agent),u=[];let f=null;do{const g=await e.listOwnedObjects({owner:i,cursor:f,limit:50});for(const y of g.objects){const b=ws(y.type);ye(b.address)===ye("0x2")&&b.module==="allowance"&&b.name==="AllowanceCap"&&u.push(y.objectId)}f=g.hasNextPage?g.cursor:null}while(f&&u.length<1e3);const p={};let m=null;return await Promise.all(u.map(async g=>{const y=await dH(e,g).catch(()=>null);if(!y)return;const{object:b}=await e.getObject({objectId:y}).catch(()=>({object:null})),S=b?uH(b.type):null;if(!S)return;const A=await qb(e,y,S);!A||A.funder!==i||A.spender!==c||(A.app===r?p[S]={allowance:y,revokeCap:g}:A.app===null&&A.name===TO&&S===Ut&&(m={allowance:y,revokeCap:g}))})),{allowances:p,gas:m}}async function OO(e,t){const s=await Promise.all(Object.entries(t.allowances).map(async([r,i])=>[r,await qb(e,i.allowance,r)]));return Object.fromEntries(s)}async function Zb(e,t,s){const r=[...t.coins],i=[...t.pools],c=[["deepbook",t.protocols.deepbook.packageId],["cetus",t.protocols.cetus.packageId]];for(const f of s.pools){if(i.some(A=>ye(A.poolId)===ye(f)))continue;const{object:p}=await e.getObject({objectId:f}),m=ws(p.type),g=c.find(([,A])=>ye(m.address)===ye(A))?.[0],[y,b]=m.typeParams;if(!g||m.module!=="pool"||m.name!=="Pool"||!y||!b)throw new Error(`${f} is not a DeepBook or Cetus pool on this network`);const S=A=>De(typeof A=="string"?A:NO(A));i.push({venue:g,poolId:ye(f),coinA:S(y),coinB:S(b)})}const u=new Set(s.coins.map(f=>De(f)));for(const f of i)u.add(f.coinA),u.add(f.coinB);for(const f of u){if(r.some(m=>Vt(m.type,f)))continue;const{coinMetadata:p}=await e.getCoinMetadata({coinType:f});if(!p)throw new Error(`${f} has no coin metadata on this network`);r.push({type:f,symbol:p.symbol.slice(0,16)||"COIN",decimals:p.decimals,unlisted:!0})}return{...t,coins:r,pools:i}}function NO(e){const t=e.typeParams.map(s=>typeof s=="string"?s:NO(s));return`${e.address}::${e.module}::${e.name}${t.length?`<${t.join(",")}>`:""}`}function hH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/tx/${encodeURIComponent(t)}`}function pH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/object/${t}`}function mH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/account/${t}`}const gH=e=>(Number(BigInt(e)/10n**25n)/100).toFixed(2);function xO(e,t,s=null){const r=(f,p)=>bn(e,f,p),i=f=>e.coins.find(p=>Vt(p.type,f))?.symbol??f,c=f=>{const p=e.pools.find(m=>m.poolId===f);return p?p.venue==="deepbook"?"DeepBook":"Cetus":f},u=[{label:"Allowed actions",value:[t.transfers.length&&"Transfers",t.swaps.length&&"Swaps",t.lending.length&&(t.lending.some(f=>f.allowBorrow)?"Lending and borrowing":"Lending"),t.staking&&"Staking"].filter(Boolean).join(" + ")}];for(const f of t.transfers){const p=s?.transfers.find(m=>Vt(m.coinType,f.coin));u.push({starts:!0,label:`Pay ${i(f.coin)} to`,value:(p?.recipients??f.recipients).map(m=>`${m.name} → ${m.address}`).join(`
839
+ `+l.stack}}var fl=Object.prototype.hasOwnProperty,hl=e.unstable_scheduleCallback,ba=e.unstable_cancelCallback,tm=e.unstable_shouldYield,nm=e.unstable_requestPaint,Ln=e.unstable_now,sm=e.unstable_getCurrentPriorityLevel,hd=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,Ye=e.unstable_NormalPriority,Ot=e.unstable_LowPriority,Ss=e.unstable_IdlePriority,jn=e.log,So=e.unstable_setDisableYieldValue,pl=null,is=null;function wa(n){if(typeof jn=="function"&&So(n),is&&typeof is.setStrictMode=="function")try{is.setStrictMode(pl,n)}catch{}}var os=Math.clz32?Math.clz32:nN,eN=Math.log,tN=Math.LN2;function nN(n){return n>>>=0,n===0?32:31-(eN(n)/tN|0)|0}var pd=256,md=262144,gd=4194304;function wi(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 yd(n,a,o){var l=n.pendingLanes;if(l===0)return 0;var d=0,h=n.suspendedLanes,v=n.pingedLanes;n=n.warmLanes;var _=l&134217727;return _!==0?(l=_&~h,l!==0?d=wi(l):(v&=_,v!==0?d=wi(v):o||(o=_&~n,o!==0&&(d=wi(o))))):(_=l&~h,_!==0?d=wi(_):v!==0?d=wi(v):o||(o=l&~n,o!==0&&(d=wi(o)))),d===0?0:a!==0&&a!==d&&(a&h)===0&&(h=d&-d,o=a&-a,h>=o||h===32&&(o&4194048)!==0)?a:d}function ml(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function t1(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-os(o),d=1<<l;a|=n[l],o&=~d}return a}function sN(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 n1(){var n=gd;return gd<<=1,(gd&62914560)===0&&(gd=4194304),n}function rm(n){for(var a=[],o=0;31>o;o++)a.push(n);return a}function gl(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function rN(n,a,o,l,d,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,B=n.expirationTimes,ne=n.hiddenUpdates;for(o=v&~o;0<o;){var oe=31-os(o),ge=1<<oe;_[oe]=0,B[oe]=-1;var Q=ne[oe];if(Q!==null)for(ne[oe]=null,oe=0;oe<Q.length;oe++){var re=Q[oe];re!==null&&(re.lane&=-536870913)}o&=~ge}l!==0&&s1(n,l,0),h!==0&&d===0&&n.tag!==0&&(n.suspendedLanes|=h&~(v&~a))}function s1(n,a,o){n.pendingLanes|=a,n.suspendedLanes&=~a;var l=31-os(a);n.entangledLanes|=a,n.entanglements[l]=n.entanglements[l]|1073741824|o&261930}function r1(n,a){var o=n.entangledLanes|=a;for(n=n.entanglements;o;){var l=31-os(o),d=1<<l;d&a|n[l]&a&&(n[l]|=a),o&=~d}}function a1(n,a){var o=a&-a;return o=(o&42)!==0?1:am(o),(o&(n.suspendedLanes|a))!==0?0:o}function am(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 im(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function i1(){var n=_e.p;return n!==0?n:(n=window.event,n===void 0?32:hE(n.type))}function o1(n,a){var o=_e.p;try{return _e.p=n,a()}finally{_e.p=o}}var Mr=Math.random().toString(36).slice(2),Sn="__reactFiber$"+Mr,Wn="__reactProps$"+Mr,_o="__reactContainer$"+Mr,c1="__reactEvents$"+Mr,aN="__reactListeners$"+Mr,iN="__reactHandles$"+Mr,l1="__reactResources$"+Mr,yl="__reactMarker$"+Mr,vd="__reactLoad$"+Mr;function bd(n){delete n[Sn],delete n[Wn],delete n[aN],delete n[iN]}function Ti(n){var a;if(a=n[Sn])return a;for(var o=n.parentNode;o;){if(a=o[_o]||o[Sn]){if(o=a.alternate,a.child!==null||o!==null&&o.child!==null)for(n=Z2(n);n!==null;){if(o=n[Sn])return o;n=Z2(n)}return a}n=o,o=n.parentNode}return null}function ko(n){if(n=n[Sn]||n[_o]){var a=n.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return n}return null}function vl(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(r(33))}function Ao(n){var a=n[l1];return a||(a=n[l1]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function pn(n){n[yl]=!0}function u1(n){n[vd]=void 0}var d1=new Set,f1={};function Ei(n,a){Oo(n,a),Oo(n+"Capture",a)}function Oo(n,a){for(f1[n]=a,n=0;n<a.length;n++)d1.add(a[n])}var oN=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]*$"),h1={},p1={};function cN(n){return fl.call(p1,n)?!0:fl.call(h1,n)?!1:oN.test(n)?p1[n]=!0:(h1[n]=!0,!1)}var dt=!1;function m1(){var n=dt;return dt=!1,n}function wd(n,a,o){if(cN(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 Td(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 Dr(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 cs(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function g1(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function lN(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 d=l.get,h=l.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return d.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 om(n){if(!n._valueTracker){var a=g1(n)?"checked":"value";n._valueTracker=lN(n,a,""+n[a])}}function y1(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var o=a.getValue(),l="";return n&&(l=g1(n)?n.checked?"true":"false":n.value),n=l,n!==o?(a.setValue(n),!0):!1}var uN=/[\n"\\]/g;function _s(n){return n.replace(uN,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function cm(n,a,o,l,d,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=""+cs(a)):n.value!==""+cs(a)&&(n.value=""+cs(a)):v!=="submit"&&v!=="reset"||n.removeAttribute("value"),a!=null?v==="number"&&n.value==a?lm(n,cs(n.value)):lm(n,cs(a)):o!=null?lm(n,cs(o)):l!=null&&n.removeAttribute("value"),d==null&&h!=null&&(n.defaultChecked=!!h),d!=null&&(n.checked=d&&typeof d!="function"&&typeof d!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+cs(_):n.removeAttribute("name")}function v1(n,a,o,l,d,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)){om(n);return}o=o!=null?""+cs(o):"",a=a!=null?""+cs(a):o,_||a===n.value||(n.value=a),n.defaultValue=a}l=l??d,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),om(n)}function lm(n,a){n.defaultValue!==""+a&&(n.defaultValue=""+a)}function No(n,a,o,l){if(n=n.options,a){a={};for(var d=0;d<o.length;d++)a["$"+o[d]]=!0;for(o=0;o<n.length;o++)d=a.hasOwnProperty("$"+n[o].value),n[o].selected!==d&&(n[o].selected=d),d&&l&&(n[o].defaultSelected=!0)}else{for(o=""+cs(o),a=null,d=0;d<n.length;d++){if(n[d].value===o){n[d].selected=!0,l&&(n[d].defaultSelected=!0);return}a!==null||n[d].disabled||(a=n[d])}a!==null&&(a.selected=!0)}}function b1(n,a,o){if(a!=null&&(a=""+cs(a),a!==n.value&&(n.value=a),o==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=o!=null?""+cs(o):""}function w1(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=cs(a),n.defaultValue=o,l=n.textContent,l===o&&l!==""&&l!==null&&(n.value=l),om(n)}function xo(n,a){if(a){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=a;return}}n.textContent=a}var dN=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 T1(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||dN.has(a)?a==="float"?n.cssFloat=o:n[a]=(""+o).trim():n[a]=o+"px"}function E1(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 d in a)l=a[d],a.hasOwnProperty(d)&&o[d]!==l&&(T1(n,d,l),dt=!0)}else for(var h in a)a.hasOwnProperty(h)&&T1(n,h,a[h])}function um(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 fN=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"]]),hN=/^[\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 Ed(n){return hN.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ar(){}var dm=null;function fm(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Co=null,Io=null;function S1(n){var a=ko(n);if(a&&(n=a.stateNode)){var o=n[Wn]||null;e:switch(n=a.stateNode,a.type){case"input":if(cm(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="'+_s(""+a)+'"][type="radio"]'),a=0;a<o.length;a++){var l=o[a];if(l!==n&&l.form===n.form){var d=l[Wn]||null;if(!d)throw Error(r(90));cm(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(a=0;a<o.length;a++)l=o[a],l.form===n.form&&y1(l)}break e;case"textarea":b1(n,o.value,o.defaultValue);break e;case"select":a=o.value,a!=null&&No(n,!!o.multiple,a,!1)}}}var hm=!1;function _1(n,a,o){if(hm)return n(a,o);hm=!0;try{var l=n(a);return l}finally{if(hm=!1,(Co!==null||Io!==null)&&(Sf(),Co&&(a=Co,n=Io,Io=Co=null,S1(a),n)))for(a=0;a<n.length;a++)S1(n[a])}}function bl(n,a){var o=n.stateNode;if(o===null)return null;var l=o[Wn]||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 Ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pm=!1;if(Ur)try{var wl={};Object.defineProperty(wl,"passive",{get:function(){pm=!0}}),window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{pm=!1}var Ta=null,mm=null,Sd=null;function k1(){if(Sd)return Sd;var n,a=mm,o=a.length,l,d="value"in Ta?Ta.value:Ta.textContent,h=d.length;for(n=0;n<o&&a[n]===d[n];n++);var v=o-n;for(l=1;l<=v&&a[o-l]===d[h-l];l++);return Sd=d.slice(n,1<l?1-l:void 0)}function _d(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 kd(){return!0}function A1(){return!1}function zn(n){function a(o,l,d,h,v){this._reactName=o,this._targetInst=d,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)?kd:A1,this.isPropagationStopped=A1,this}return K(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=kd)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=kd)},persist:function(){},isPersistent:kd}),a}var Ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ad=zn(Ea),Tl=K({},Ea,{view:0,detail:0}),pN=zn(Tl),gm,ym,El,Od=K({},Tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bm,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!==El&&(El&&n.type==="mousemove"?(gm=n.screenX-El.screenX,ym=n.screenY-El.screenY):ym=gm=0,El=n),gm)},movementY:function(n){return"movementY"in n?n.movementY:ym}}),O1=zn(Od),mN=K({},Od,{dataTransfer:0}),gN=zn(mN),yN=K({},Tl,{relatedTarget:0}),vm=zn(yN),vN=K({},Ea,{animationName:0,elapsedTime:0,pseudoElement:0}),bN=zn(vN),wN=K({},Ea,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),TN=zn(wN),EN=K({},Ea,{data:0}),N1=zn(EN),SN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_N={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 AN(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=kN[n])?!!a[n]:!1}function bm(){return AN}var ON=K({},Tl,{key:function(n){if(n.key){var a=SN[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=_d(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?_N[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bm,charCode:function(n){return n.type==="keypress"?_d(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?_d(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),NN=zn(ON),xN=K({},Od,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),x1=zn(xN),CN=K({},Ea,{submitter:0}),IN=zn(CN),RN=K({},Tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bm}),jN=zn(RN),MN=K({},Ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),DN=zn(MN),UN=K({},Od,{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}),BN=zn(UN),LN=K({},Ea,{newState:0,oldState:0,source:0}),zN=zn(LN),$N=[9,13,27,32],wm=Ur&&"CompositionEvent"in window,Sl=null;Ur&&"documentMode"in document&&(Sl=document.documentMode);var VN=Ur&&"TextEvent"in window&&!Sl,C1=Ur&&(!wm||Sl&&8<Sl&&11>=Sl),I1=" ",R1=!1;function j1(n,a){switch(n){case"keyup":return $N.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M1(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ro=!1;function PN(n,a){switch(n){case"compositionend":return M1(a);case"keypress":return a.which!==32?null:(R1=!0,I1);case"textInput":return n=a.data,n===I1&&R1?null:n;default:return null}}function GN(n,a){if(Ro)return n==="compositionend"||!wm&&j1(n,a)?(n=k1(),Sd=mm=Ta=null,Ro=!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 C1&&a.locale!=="ko"?null:a.data;default:return null}}var FN={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 D1(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!FN[n.type]:a==="textarea"}function U1(n,a,o,l){Co?Io?Io.push(l):Io=[l]:Co=l,a=xf(a,"onChange"),0<a.length&&(o=new Ad("onChange","change",null,o,l),n.push({event:o,listeners:a}))}var _l=null,kl=null;function HN(n){S2(n,0)}function Nd(n){var a=vl(n);if(y1(a))return n}function B1(n,a){if(n==="change")return a}var L1=!1;if(Ur){var Tm;if(Ur){var Em="oninput"in document;if(!Em){var z1=document.createElement("div");z1.setAttribute("oninput","return;"),Em=typeof z1.oninput=="function"}Tm=Em}else Tm=!1;L1=Tm&&(!document.documentMode||9<document.documentMode)}function $1(){_l&&(_l.detachEvent("onpropertychange",V1),kl=_l=null)}function V1(n){if(n.propertyName==="value"&&Nd(kl)){var a=[];U1(a,kl,n,fm(n)),_1(HN,a)}}function qN(n,a,o){n==="focusin"?($1(),_l=a,kl=o,_l.attachEvent("onpropertychange",V1)):n==="focusout"&&$1()}function ZN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Nd(kl)}function YN(n,a){if(n==="click")return Nd(a)}function WN(n,a){if(n==="input"||n==="change")return Nd(a)}function XN(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var ls=typeof Object.is=="function"?Object.is:XN;function Al(n,a){if(ls(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 d=o[l];if(!fl.call(a,d)||!ls(n[d],a[d]))return!1}return!0}function Sm(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 P1(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function G1(n,a){var o=P1(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=P1(o)}}function F1(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?F1(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function H1(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=Sm(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=Sm(n.document)}return a}function _m(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 JN=Ur&&"documentMode"in document&&11>=document.documentMode,jo=null,km=null,Ol=null,Am=!1;function q1(n,a,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Am||jo==null||jo!==Sm(l)||(l=jo,"selectionStart"in l&&_m(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}),Ol&&Al(Ol,l)||(Ol=l,l=xf(km,"onSelect"),0<l.length&&(a=new Ad("onSelect","select",null,a,o),n.push({event:a,listeners:l}),a.target=jo)))}function Si(n,a){var o={};return o[n.toLowerCase()]=a.toLowerCase(),o["Webkit"+n]="webkit"+a,o["Moz"+n]="moz"+a,o}var Mo={animationend:Si("Animation","AnimationEnd"),animationiteration:Si("Animation","AnimationIteration"),animationstart:Si("Animation","AnimationStart"),transitionrun:Si("Transition","TransitionRun"),transitionstart:Si("Transition","TransitionStart"),transitioncancel:Si("Transition","TransitionCancel"),transitionend:Si("Transition","TransitionEnd")},Om={},Z1={};Ur&&(Z1=document.createElement("div").style,"AnimationEvent"in window||(delete Mo.animationend.animation,delete Mo.animationiteration.animation,delete Mo.animationstart.animation),"TransitionEvent"in window||delete Mo.transitionend.transition);function _i(n){if(Om[n])return Om[n];if(!Mo[n])return n;var a=Mo[n],o;for(o in a)if(a.hasOwnProperty(o)&&o in Z1)return Om[n]=a[o];return n}var Y1=_i("animationend"),W1=_i("animationiteration"),X1=_i("animationstart"),KN=_i("transitionrun"),QN=_i("transitionstart"),ex=_i("transitioncancel"),J1=_i("transitionend"),K1=new Map,Nm="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(" ");Nm.push("scrollEnd");function Ps(n,a){K1.set(n,a),Ei(a,[n])}var tx=0;function Br(n,a){if(n.name!=null&&n.name!=="auto")return n.name;if(a.autoName!==null)return a.autoName;n=qs.identifierPrefix;var o=tx++;return n="_"+n+"t_"+o.toString(32)+"_",a.autoName=n}function Q1(n){if(n==null||typeof n=="string")return n;var a=null,o=ec;if(o!==null)for(var l=0;l<o.length;l++){var d=n[o[l]];if(d!=null){if(d==="none")return"none";a=a==null?d:a+(" "+d)}}return a??n.default}function Lr(n,a){return n=Q1(n),a=Q1(a),a==null?n==="auto"?null:n:a==="auto"?null:a}var xd=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)},ks=[],Do=0,xm=0;function Cd(){for(var n=Do,a=xm=Do=0;a<n;){var o=ks[a];ks[a++]=null;var l=ks[a];ks[a++]=null;var d=ks[a];ks[a++]=null;var h=ks[a];if(ks[a++]=null,l!==null&&d!==null){var v=l.pending;v===null?d.next=d:(d.next=v.next,v.next=d),l.pending=d}h!==0&&ew(o,d,h)}}function Id(n,a,o,l){ks[Do++]=n,ks[Do++]=a,ks[Do++]=o,ks[Do++]=l,xm|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function Cm(n,a,o,l){return Id(n,a,o,l),Rd(n)}function ki(n,a){return Id(n,null,null,a),Rd(n)}function ew(n,a,o){n.lanes|=o;var l=n.alternate;l!==null&&(l.lanes|=o);for(var d=!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||(d=!0)),n=h,h=h.return;return n.tag===3?(h=n.stateNode,d&&a!==null&&(d=31-os(o),n=h.hiddenUpdates,l=n[d],l===null?n[d]=[a]:l.push(a),a.lane=o|536870912),h):null}function Rd(n){if(50<Wl)throw Wl=0,Ef=null,Error(r(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var Uo={};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 Xn(n,a,o,l){return new nx(n,a,o,l)}function Im(n){return n=n.prototype,!(!n||!n.isReactComponent)}function zr(n,a){var o=n.alternate;return o===null?(o=Xn(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 tw(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 jd(n,a,o,l,d,h){var v=0;if(l=n,typeof l=="function")Im(l)&&(v=1);else if(typeof l=="string")v=CC(n,o,ue.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(l){case z:return n=Xn(31,o,a,d),n.elementType=z,n.lanes=h,n;case G:return Ai(o.children,d,h,a);case U:v=8,d|=24;break;case H:return n=Xn(12,o,a,d|2),n.elementType=H,n.lanes=h,n;case I:return n=Xn(13,o,a,d),n.elementType=I,n.lanes=h,n;case D:return n=Xn(19,o,a,d),n.elementType=D,n.lanes=h,n;case ie:case R:return n=d|32,n=Xn(30,o,a,n),n.elementType=R,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 M:v=10;break e;case $:v=9;break e;case k:v=11;break e;case L:v=14;break e;case X:v=16,l=null;break e}v=29,o=Error(r(130,n===null?"null":typeof n,"")),l=null}return a=Xn(v,o,a,d),a.elementType=n,a.type=l,a.lanes=h,a}function Ai(n,a,o,l){return n=Xn(7,n,l,a),n.lanes=o,n}function Rm(n,a,o){return n=Xn(6,n,null,a),n.lanes=o,n}function nw(n){var a=Xn(18,null,null,0);return a.stateNode=n,a}function jm(n,a,o){return a=Xn(4,n.children!==null?n.children:[],n.key,a),a.lanes=o,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var sw=new WeakMap;function As(n,a){if(typeof n=="object"&&n!==null){var o=sw.get(n);return o!==void 0?o:(a={value:n,source:a,stack:fd(a)},sw.set(n,a),a)}return{value:n,source:a,stack:fd(a)}}var Bo=[],Lo=0,Md=null,Nl=0,Os=[],Ns=0,Sa=null,ir=1,or="";function $r(n,a){Bo[Lo++]=Nl,Bo[Lo++]=Md,Md=n,Nl=a}function rw(n,a,o){Os[Ns++]=ir,Os[Ns++]=or,Os[Ns++]=Sa,Sa=n;var l=ir;n=or;var d=32-os(l)-1;l&=~(1<<d),o+=1;var h=32-os(a)+d;if(30<h){var v=d-d%5;h=(l&(1<<v)-1).toString(32),l>>=v,d-=v,ir=1<<32-os(a)+d|o<<d|l,or=h+n}else ir=1<<h|o<<d|l,or=n}function Dd(n){n.return!==null&&($r(n,1),rw(n,1,0))}function Mm(n){for(;n===Md;)Md=Bo[--Lo],Bo[Lo]=null,Nl=Bo[--Lo],Bo[Lo]=null;for(;n===Sa;)Sa=Os[--Ns],Os[Ns]=null,or=Os[--Ns],Os[Ns]=null,ir=Os[--Ns],Os[Ns]=null}function aw(n,a){Os[Ns++]=ir,Os[Ns++]=or,Os[Ns++]=Sa,ir=a.id,or=a.overflow,Sa=n}var mn=null,It=null,Ke=!1,_a=null,xs=!1,Dm=Error(r(519));function ka(n){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xl(As(a,n)),Dm}function iw(n){var a=n.stateNode,o=n.type,l=n.memoizedProps;switch(a[Sn]=n,a[Wn]=l,o){case"dialog":tt("cancel",a),tt("close",a);break;case"iframe":case"object":case"embed":tt("load",a);break;case"video":case"audio":for(o=0;o<Jl.length;o++)tt(Jl[o],a);break;case"source":tt("error",a);break;case"img":case"image":case"link":tt("error",a),tt("load",a);break;case"details":tt("toggle",a);break;case"input":tt("invalid",a),v1(a,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":tt("invalid",a);break;case"textarea":tt("invalid",a),w1(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||O2(a.textContent,o)?(l.popover!=null&&(tt("beforetoggle",a),tt("toggle",a)),l.onScroll!=null&&tt("scroll",a),l.onScrollEnd!=null&&tt("scrollend",a),l.onClick!=null&&(a.onclick=ar),a=!0):a=!1,a||ka(n,!0)}function Ud(n){for(mn=n.return;mn;)switch(mn.tag){case 5:case 31:case 13:xs=!1;return;case 27:case 3:xs=!0;return;default:mn=mn.return}}function zo(n){if(n!==mn)return!1;if(!Ke)return Ud(n),Ke=!0,!1;var a=n.tag,o;if((o=a!==3&&a!==27)&&((o=a===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||d0(n.type,n.memoizedProps)),o=!o),o&&It&&ka(n),Ud(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));It=q2(n)}else if(a===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));It=q2(n)}else a===27?(a=It,Va(n.type)?(n=w0,w0=null,It=n):It=a):It=mn?Is(n.stateNode.nextSibling):null;return!0}function Oi(){It=mn=null,Ke=!1}function Um(){var n=_a;return n!==null&&(Qn===null?Qn=n:Qn.push.apply(Qn,n),_a=null),n}function xl(n){_a===null?_a=[n]:_a.push(n)}var Bm=te(null),Ni=null,Vr=null;function Aa(n,a,o){he(Bm,a._currentValue),a._currentValue=o}function Pr(n){n._currentValue=Bm.current,de(Bm)}function Bd(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 Lm(n,a,o,l){var d=n.child;for(d!==null&&(d.return=n);d!==null;){var h=d.dependencies;if(h!==null){var v=d.child;h=h.firstContext;e:for(;h!==null;){var _=h;h=d;for(var B=0;B<a.length;B++)if(_.context===a[B]){h.lanes|=o,_=h.alternate,_!==null&&(_.lanes|=o),Bd(h.return,o,n),l||(v=null);break e}h=_.next}}else if(d.tag===18){if(v=d.return,v===null)throw Error(r(341));v.lanes|=o,h=v.alternate,h!==null&&(h.lanes|=o),Bd(v,o,n),v=null}else d.tag===13&&d.memoizedState!==null&&d.memoizedState.dehydrated===null?(d.lanes|=o,v=d.alternate,v!==null&&(v.lanes|=o),Bd(d.return,o,n),v=d.child,v=v!==null?v.sibling:null):v=d.child;if(v!==null)v.return=d;else for(v=d;v!==null;){if(v===n){v=null;break}if(d=v.sibling,d!==null){d.return=v.return,v=d;break}v=v.return}d=v}}function xi(n,a,o,l){n=null;for(var d=a,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var v=d.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var _=d.type;ls(d.pendingProps.value,v.value)||(n!==null?n.push(_):n=[_])}}else if(d===Mt.current){if(v=d.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(n!==null?n.push(uc):n=[uc])}d=d.return}return n!==null&&Lm(a,n,o,l),a.flags|=262144,n!==null}function Ld(n){for(n=n.firstContext;n!==null;){if(!ls(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ci(n){Ni=n,Vr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function _n(n){return ow(Ni,n)}function zd(n,a){return Ni===null&&Ci(n),ow(n,a)}function ow(n,a){var o=a._currentValue;if(a={context:a,memoizedValue:o,next:null},Vr===null){if(n===null)throw Error(r(308));Vr=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else Vr=Vr.next=a;return o}var sx=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()})}},rx=e.unstable_scheduleCallback,ax=e.unstable_NormalPriority,Jt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zm(){return{controller:new sx,data:new Map,refCount:0}}function Cl(n){n.refCount--,n.refCount===0&&rx(ax,function(){n.controller.abort()})}function cw(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 Il=null;function ix(n){var a=n.transitionTypes;return n.transitionTypes=null,a}var Rl=null,$m=0,Ii=0,$o=null;function ox(n,a){if(Rl===null){var o=Rl=[];$m=0,Ii=n0(),$o={status:"pending",value:void 0,then:function(l){o.push(l)}}}return $m++,a.then(lw,lw),a}function lw(){if(--$m===0&&(Il=null,Rl!==null)){$o!==null&&($o.status="fulfilled");var n=Rl;Rl=null,Ii=0,$o=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function cx(n,a){var o=[],l={status:"pending",value:null,reason:null,then:function(d){o.push(d)}};return n.then(function(){l.status="fulfilled",l.value=a;for(var d=0;d<o.length;d++)(0,o[d])(a)},function(d){for(l.status="rejected",l.reason=d,d=0;d<o.length;d++)(0,o[d])(void 0)}),l}var uw=be.S;be.S=function(n,a){if(n2=Ln(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&ox(n,a),Il!==null)for(var o=rc;o!==null;)cw(o,Il),o=o.next;if(o=n.types,o!==null){for(var l=rc;l!==null;)cw(l,o),l=l.next;if(Ii!==0){l=Il,l===null&&(l=Il=[]);for(var d=0;d<o.length;d++){var h=o[d];l.indexOf(h)===-1&&l.push(h)}}}uw!==null&&uw(n,a)};var Ri=te(null);function Vm(){var n=Ri.current;return n!==null?n:Nt.pooledCache}function $d(n,a){a===null?he(Ri,Ri.current):he(Ri,a.pool)}function dw(){var n=Vm();return n===null?null:{parent:Jt._currentValue,pool:n}}var Vo=Error(r(460)),Pm=Error(r(474)),Vd=Error(r(542)),Pd={then:function(){}};function fw(n){return n=n.status,n==="fulfilled"||n==="rejected"}function hw(n,a,o){switch(o=n[o],o===void 0?n.push(a):o!==a&&(a.then(ar,ar),a=o),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,mw(n),n===void 0&&!("reason"in a)?Error(r(600)):n;default:if(typeof a.status=="string")a.then(ar,ar);else{if(n=Nt,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=a,n.status="pending",n.then(function(l){if(a.status==="pending"){var d=a;d.status="fulfilled",d.value=l}},function(l){if(a.status==="pending"){var d=a;d.status="rejected",d.reason=l}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,mw(n),n}throw Mi=a,Vo}}function ji(n){try{var a=n._init;return a(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Mi=o,Vo):o}}var Mi=null;function pw(){if(Mi===null)throw Error(r(459));var n=Mi;return Mi=null,n}function mw(n){if(n===Vo||n===Vd)throw Error(r(483))}var Po=null,jl=0;function Gd(n){var a=jl;return jl+=1,Po===null&&(Po=[]),hw(Po,n,a)}function Oa(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function Fd(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 gw(n){function a(ee,q){if(n){var se=ee.deletions;se===null?(ee.deletions=[q],ee.flags|=16):se.push(q)}}function o(ee,q){if(!n)return null;for(;q!==null;)a(ee,q),q=q.sibling;return null}function l(ee){for(var q=new Map;ee!==null;)ee.key===null?q.set(ee.index,ee):q.set(ee.key,ee),ee=ee.sibling;return q}function d(ee,q){return ee=zr(ee,q),ee.index=0,ee.sibling=null,ee}function h(ee,q,se){return ee.index=se,n?(se=ee.alternate,se!==null?(se=se.index,se<q?(ee.flags|=2,q):se):(ee.flags|=134217730,q)):(ee.flags|=1048576,q)}function v(ee){return n&&ee.alternate===null&&(ee.flags|=134217730),ee}function _(ee,q,se,me){return q===null||q.tag!==6?(q=Rm(se,ee.mode,me),q.return=ee,q):(q=d(q,se),q.return=ee,q)}function B(ee,q,se,me){var Ie=se.type;return Ie===G?(ee=oe(ee,q,se.props.children,me,se.key),Oa(ee,se),ee):q!==null&&(q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===X&&ji(Ie)===q.type)?(q=d(q,se.props),Oa(q,se),q.return=ee,q):(q=jd(se.type,se.key,se.props,null,ee.mode,me),Oa(q,se),q.return=ee,q)}function ne(ee,q,se,me){return q===null||q.tag!==4||q.stateNode.containerInfo!==se.containerInfo||q.stateNode.implementation!==se.implementation?(q=jm(se,ee.mode,me),q.return=ee,q):(q=d(q,se.children||[]),q.return=ee,q)}function oe(ee,q,se,me,Ie){return q===null||q.tag!==7?(q=Ai(se,ee.mode,me,Ie),q.return=ee,q):(q=d(q,se),q.return=ee,q)}function ge(ee,q,se){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Rm(""+q,ee.mode,se),q.return=ee,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case O:return se=jd(q.type,q.key,q.props,null,ee.mode,se),Oa(se,q),se.return=ee,se;case x:return q=jm(q,ee.mode,se),q.return=ee,q;case X:return q=ji(q),ge(ee,q,se)}if(Ae(q)||pe(q))return q=Ai(q,ee.mode,se,null),q.return=ee,q;if(typeof q.then=="function")return ge(ee,Gd(q),se);if(q.$$typeof===M)return ge(ee,zd(ee,q),se);Fd(ee,q)}return null}function Q(ee,q,se,me){var Ie=q!==null?q.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Ie!==null?null:_(ee,q,""+se,me);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case O:return se.key===Ie?B(ee,q,se,me):null;case x:return se.key===Ie?ne(ee,q,se,me):null;case X:return se=ji(se),Q(ee,q,se,me)}if(Ae(se)||pe(se))return Ie!==null?null:oe(ee,q,se,me,null);if(typeof se.then=="function")return Q(ee,q,Gd(se),me);if(se.$$typeof===M)return Q(ee,q,zd(ee,se),me);Fd(ee,se)}return null}function re(ee,q,se,me,Ie){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return ee=ee.get(se)||null,_(q,ee,""+me,Ie);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case O:return ee=ee.get(me.key===null?se:me.key)||null,B(q,ee,me,Ie);case x:return ee=ee.get(me.key===null?se:me.key)||null,ne(q,ee,me,Ie);case X:return me=ji(me),re(ee,q,se,me,Ie)}if(Ae(me)||pe(me))return ee=ee.get(se)||null,oe(q,ee,me,Ie,null);if(typeof me.then=="function")return re(ee,q,se,Gd(me),Ie);if(me.$$typeof===M)return re(ee,q,se,zd(q,me),Ie);Fd(q,me)}return null}function ke(ee,q,se,me){for(var Ie=null,ot=null,Ue=q,$e=q=0,en=null;Ue!==null&&$e<se.length;$e++){Ue.index>$e?(en=Ue,Ue=null):en=Ue.sibling;var ut=Q(ee,Ue,se[$e],me);if(ut===null){Ue===null&&(Ue=en);break}n&&Ue&&ut.alternate===null&&a(ee,Ue),q=h(ut,q,$e),ot===null?Ie=ut:ot.sibling=ut,ot=ut,Ue=en}if($e===se.length)return o(ee,Ue),Ke&&$r(ee,$e),Ie;if(Ue===null){for(;$e<se.length;$e++)Ue=ge(ee,se[$e],me),Ue!==null&&(q=h(Ue,q,$e),ot===null?Ie=Ue:ot.sibling=Ue,ot=Ue);return Ke&&$r(ee,$e),Ie}for(Ue=l(Ue);$e<se.length;$e++)en=re(Ue,ee,$e,se[$e],me),en!==null&&(n&&(ut=en.alternate,ut!==null&&Ue.delete(ut.key===null?$e:ut.key)),q=h(en,q,$e),ot===null?Ie=en:ot.sibling=en,ot=en);return n&&Ue.forEach(function(qa){return a(ee,qa)}),Ke&&$r(ee,$e),Ie}function Re(ee,q,se,me){if(se==null)throw Error(r(151));for(var Ie=null,ot=null,Ue=q,$e=q=0,en=null,ut=se.next();Ue!==null&&!ut.done;$e++,ut=se.next()){Ue.index>$e?(en=Ue,Ue=null):en=Ue.sibling;var qa=Q(ee,Ue,ut.value,me);if(qa===null){Ue===null&&(Ue=en);break}n&&Ue&&qa.alternate===null&&a(ee,Ue),q=h(qa,q,$e),ot===null?Ie=qa:ot.sibling=qa,ot=qa,Ue=en}if(ut.done)return o(ee,Ue),Ke&&$r(ee,$e),Ie;if(Ue===null){for(;!ut.done;$e++,ut=se.next())ut=ge(ee,ut.value,me),ut!==null&&(q=h(ut,q,$e),ot===null?Ie=ut:ot.sibling=ut,ot=ut);return Ke&&$r(ee,$e),Ie}for(Ue=l(Ue);!ut.done;$e++,ut=se.next())ut=re(Ue,ee,$e,ut.value,me),ut!==null&&(n&&(en=ut.alternate,en!==null&&Ue.delete(en.key===null?$e:en.key)),q=h(ut,q,$e),ot===null?Ie=ut:ot.sibling=ut,ot=ut);return n&&Ue.forEach(function(PC){return a(ee,PC)}),Ke&&$r(ee,$e),Ie}function Xe(ee,q,se,me){if(typeof se=="object"&&se!==null&&se.type===G&&se.key===null&&se.props.ref===void 0&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case O:e:{for(var Ie=se.key;q!==null;){if(q.key===Ie){if(Ie=se.type,Ie===G){if(q.tag===7){o(ee,q.sibling),me=d(q,se.props.children),Oa(me,se),me.return=ee,ee=me;break e}}else if(q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===X&&ji(Ie)===q.type){o(ee,q.sibling),me=d(q,se.props),Oa(me,se),me.return=ee,ee=me;break e}o(ee,q);break}else a(ee,q);q=q.sibling}se.type===G?(me=Ai(se.props.children,ee.mode,me,se.key),Oa(me,se),me.return=ee,ee=me):(me=jd(se.type,se.key,se.props,null,ee.mode,me),Oa(me,se),me.return=ee,ee=me)}return v(ee);case x:e:{for(Ie=se.key;q!==null;){if(q.key===Ie)if(q.tag===4&&q.stateNode.containerInfo===se.containerInfo&&q.stateNode.implementation===se.implementation){o(ee,q.sibling),me=d(q,se.children||[]),me.return=ee,ee=me;break e}else{o(ee,q);break}else a(ee,q);q=q.sibling}me=jm(se,ee.mode,me),me.return=ee,ee=me}return v(ee);case X:return se=ji(se),Xe(ee,q,se,me)}if(Ae(se))return ke(ee,q,se,me);if(pe(se)){if(Ie=pe(se),typeof Ie!="function")throw Error(r(150));return se=Ie.call(se),Re(ee,q,se,me)}if(typeof se.then=="function")return Xe(ee,q,Gd(se),me);if(se.$$typeof===M)return Xe(ee,q,zd(ee,se),me);Fd(ee,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,q!==null&&q.tag===6?(o(ee,q.sibling),me=d(q,se),me.return=ee,ee=me):(o(ee,q),me=Rm(se,ee.mode,me),me.return=ee,ee=me),v(ee)):o(ee,q)}return function(ee,q,se,me){try{jl=0;var Ie=Xe(ee,q,se,me);return Po=null,Ie}catch(Ue){if(Ue===Vo||Ue===Vd)throw Ue;var ot=Xn(29,Ue,null,ee.mode);return ot.lanes=me,ot.return=ee,ot}}}var Di=gw(!0),yw=gw(!1),Na=!1;function Gm(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fm(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 xa(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ca(n,a,o){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(ht&2)!==0){var d=l.pending;return d===null?a.next=a:(a.next=d.next,d.next=a),l.pending=a,a=Rd(n),ew(n,null,o),a}return Id(n,l,a,o),Rd(n)}function Ml(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,r1(n,o)}}function Hm(n,a){var o=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var d=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?d=h=v:h=h.next=v,o=o.next}while(o!==null);h===null?d=h=a:h=h.next=a}else d=h=a;o={baseState:l.baseState,firstBaseUpdate:d,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 qm=!1;function Dl(){if(qm){var n=$o;if(n!==null)throw n}}function Ul(n,a,o,l){qm=!1;var d=n.updateQueue;Na=!1;var h=d.firstBaseUpdate,v=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var B=_,ne=B.next;B.next=null,v===null?h=ne:v.next=ne,v=B;var oe=n.alternate;oe!==null&&(oe=oe.updateQueue,_=oe.lastBaseUpdate,_!==v&&(_===null?oe.firstBaseUpdate=ne:_.next=ne,oe.lastBaseUpdate=B))}if(h!==null){var ge=d.baseState;v=0,oe=ne=B=null,_=h;do{var Q=_.lane&-536870913,re=Q!==_.lane;if(re?(it&Q)===Q:(l&Q)===Q){Q!==0&&Q===Ii&&(qm=!0),oe!==null&&(oe=oe.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=K({},ge,Q);break e;case 2:Na=!0}}Q=_.callback,Q!==null&&(n.flags|=64,re&&(n.flags|=8192),re=d.callbacks,re===null?d.callbacks=[Q]:re.push(Q))}else re={lane:Q,tag:_.tag,payload:_.payload,callback:_.callback,next:null},oe===null?(ne=oe=re,B=ge):oe=oe.next=re,v|=Q;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;re=_,_=re.next,re.next=null,d.lastBaseUpdate=re,d.shared.pending=null}}while(!0);oe===null&&(B=ge),d.baseState=B,d.firstBaseUpdate=ne,d.lastBaseUpdate=oe,h===null&&(d.shared.lanes=0),Ba|=v,n.lanes=v,n.memoizedState=ge}}function vw(n,a){if(typeof n!="function")throw Error(r(191,n));n.call(a)}function bw(n,a){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)vw(o[n],a)}var Ia=te(null),Hd=te(0);function ww(n,a){n=Zr,he(Hd,n),he(Ia,a),Zr=n|a.baseLanes}function Zm(){he(Hd,Zr),he(Ia,Ia.current)}function Ym(){Zr=Hd.current,de(Ia),de(Hd)}var kn=te(null),Mn=null;function Ra(n){var a=n.alternate;he(An,An.current&1),he(kn,n),Mn===null&&(a===null||Ia.current!==null||a.memoizedState!==null)&&(Mn=n)}function Wm(n){he(An,An.current),he(kn,n),Mn===null&&(Mn=n)}function Tw(n){n.tag===22?(he(An,An.current),he(kn,n),Mn===null&&(Mn=n)):ja()}function ja(){he(An,An.current),he(kn,kn.current)}function us(n){de(kn),Mn===n&&(Mn=null),de(An)}var An=te(0);function Bl(n,a){he(kn,kn.current),he(An,a)}function Xm(n){de(An),de(kn),Mn===n&&(Mn=null)}function qd(n){for(var a=n;a!==null;){if(a.tag===13){var o=a.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||v0(o)||b0(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 Gr=0,We=null,kt=null,Kt=null,Zd=!1,Go=!1,Ui=!1,Yd=0,Ll=0,Fo=null,lx=0;function Pt(){throw Error(r(321))}function Jm(n,a){if(a===null)return!1;for(var o=0;o<a.length&&o<n.length;o++)if(!ls(n[o],a[o]))return!1;return!0}function Km(n,a,o,l,d,h){return Gr=h,We=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,be.H=n===null||n.memoizedState===null?rT:aT,Ui=!1,h=o(l,d),Ui=!1,Go&&(h=Sw(a,o,l,d)),Ew(n),h}function Ew(n){be.H=tf;var a=kt!==null&&kt.next!==null;if(Gr=0,Kt=kt=We=null,Zd=!1,Ll=0,Fo=null,a)throw Error(r(300));n===null||Qt||(n=n.dependencies,n!==null&&Ld(n)&&(Qt=!0))}function Sw(n,a,o,l){We=n;var d=0;do{if(Go&&(Fo=null),Ll=0,Go=!1,25<=d)throw Error(r(301));if(d+=1,Kt=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=yx,h=a(o,l)}while(Go);return h}function ux(){var n=be.H,a=n.useState()[0];return a=typeof a.then=="function"?zl(a):a,n=n.useState()[0],(kt!==null?kt.memoizedState:null)!==n&&(We.flags|=1024),a}function Qm(){var n=Yd!==0;return Yd=0,n}function eg(n,a,o){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~o}function tg(n){if(Zd){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Zd=!1}Gr=0,Kt=kt=We=null,Go=!1,Ll=Yd=0,Fo=null}function $n(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?We.memoizedState=Kt=n:Kt=Kt.next=n,Kt}function Zt(){if(kt===null){var n=We.alternate;n=n!==null?n.memoizedState:null}else n=kt.next;var a=Kt===null?We.memoizedState:Kt.next;if(a!==null)Kt=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},Kt===null?We.memoizedState=Kt=n:Kt=Kt.next=n}return Kt}function Wd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zl(n){var a=Ll;return Ll+=1,Fo===null&&(Fo=[]),n=hw(Fo,n,a),a=We,(Kt===null?a.memoizedState:Kt.next)===null&&(a=a.alternate,be.H=a===null||a.memoizedState===null?rT:aT),n}function Xd(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return zl(n);if(n.$$typeof===J)return;if(n.$$typeof===M)return _n(n)}throw Error(r(438,String(n)))}function ng(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(d){return d.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),o===null&&(o=Wd(),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]=fe;return a.index++,o}function Fr(n,a){return typeof a=="function"?a(n):a}function Jd(n){var a=Zt();return sg(a,kt,n)}function sg(n,a,o){var l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=o;var d=n.baseQueue,h=l.pending;if(h!==null){if(d!==null){var v=d.next;d.next=h.next,h.next=v}a.baseQueue=d=h,l.pending=null}if(h=n.baseState,d===null)n.memoizedState=h;else{a=d.next;var _=v=null,B=null,ne=a,oe=!1;do{var ge=ne.lane&-536870913;if(ge!==ne.lane?(it&ge)===ge:(Gr&ge)===ge){var Q=ne.revertLane;if(Q===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ge===Ii&&(oe=!0);else if((Gr&Q)===Q){ne=ne.next,Q===Ii&&(oe=!0);continue}else ge={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(_=B=ge,v=h):B=B.next=ge,We.lanes|=Q,Ba|=Q;ge=ne.action,Ui&&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},B===null?(_=B=Q,v=h):B=B.next=Q,We.lanes|=ge,Ba|=ge;ne=ne.next}while(ne!==null&&ne!==a);if(B===null?v=h:B.next=_,!ls(h,n.memoizedState)&&(Qt=!0,oe&&(o=$o,o!==null)))throw o;n.memoizedState=h,n.baseState=v,n.baseQueue=B,l.lastRenderedState=h}return d===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function rg(n){var a=Zt(),o=a.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=n;var l=o.dispatch,d=o.pending,h=a.memoizedState;if(d!==null){o.pending=null;var v=d=d.next;do h=n(h,v.action),v=v.next;while(v!==d);ls(h,a.memoizedState)||(Qt=!0),a.memoizedState=h,a.baseQueue===null&&(a.baseState=h),o.lastRenderedState=h}return[h,l]}function _w(n,a,o){var l=We,d=Zt(),h=Ke;if(h){if(o===void 0)throw Error(r(407));o=o()}else o=a();var v=!ls((kt||d).memoizedState,o);if(v&&(d.memoizedState=o,Qt=!0),d=d.queue,og(Ow.bind(null,l,d,n),[n]),n=d.getSnapshot!==a||v||Kt!==null&&(Kt.memoizedState.tag&1)!==0,Ho(n?9:8,{destroy:void 0},Aw.bind(null,l,d,o,a),null),n){if(l.flags|=2048,Nt===null)throw Error(r(349));h||(Gr&127)!==0||kw(l,a,o)}return o}function kw(n,a,o){n.flags|=16384,n={getSnapshot:a,value:o},a=We.updateQueue,a===null?(a=Wd(),We.updateQueue=a,a.stores=[n]):(o=a.stores,o===null?a.stores=[n]:o.push(n))}function Aw(n,a,o,l){a.value=o,a.getSnapshot=l,Nw(a)&&xw(n)}function Ow(n,a,o){return o(function(){Nw(a)&&xw(n)})}function Nw(n){var a=n.getSnapshot;n=n.value;try{var o=a();return!ls(n,o)}catch{return!0}}function xw(n){var a=ki(n,2);a!==null&&es(a,n,2)}function ag(n){var a=$n();if(typeof n=="function"){var o=n;if(n=o(),Ui){wa(!0);try{o()}finally{wa(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:n},a}function Cw(n,a,o,l){return n.baseState=o,sg(n,kt,typeof l=="function"?l:Fr)}function dx(n,a,o,l,d){if(ef(n))throw Error(r(485));if(n=a.action,n!==null){var h={payload:d,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,Iw(a,h)):(h.next=o.next,a.pending=o.next=h)}}function Iw(n,a){var o=a.action,l=a.payload,d=n.state;if(a.isTransition){var h=be.T,v={};v.types=h!==null?h.types:null,be.T=v;try{var _=o(d,l),B=be.S;B!==null&&B(v,_),Rw(n,a,_)}catch(ne){ig(n,a,ne)}finally{h!==null&&v.types!==null&&(h.types=v.types),be.T=h}}else try{h=o(d,l),Rw(n,a,h)}catch(ne){ig(n,a,ne)}}function Rw(n,a,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){jw(n,a,l)},function(l){return ig(n,a,l)}):jw(n,a,o)}function jw(n,a,o){a.status="fulfilled",a.value=o,Mw(a),n.state=o,a=n.pending,a!==null&&(o=a.next,o===a?n.pending=null:(o=o.next,a.next=o,Iw(n,o)))}function ig(n,a,o){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do a.status="rejected",a.reason=o,Mw(a),a=a.next;while(a!==l)}n.action=null}function Mw(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function Dw(n,a){return a}function Uw(n,a){if(Ke){var o=Nt.formState;if(o!==null){e:{var l=We;if(Ke){if(It){t:{for(var d=It,h=xs;d.nodeType!==8;){if(!h){d=null;break t}if(d=Is(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){It=Is(d.nextSibling),l=d.data==="F!";break e}}ka(l)}l=!1}l&&(a=o[0])}}return o=$n(),o.memoizedState=o.baseState=a,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dw,lastRenderedState:a},o.queue=l,o=tT.bind(null,We,l),l.dispatch=o,l=ag(!1),h=fg.bind(null,We,!1,l.queue),l=$n(),d={state:a,dispatch:null,action:n,pending:null},l.queue=d,o=dx.bind(null,We,d,h,o),d.dispatch=o,l.memoizedState=n,[a,o,!1]}function Bw(n){var a=Zt();return Lw(a,kt,n)}function Lw(n,a,o){if(a=sg(n,a,Dw)[0],n=Jd(Fr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var l=zl(a)}catch(v){throw v===Vo?Vd:v}else l=a;a=Zt();var d=a.queue,h=d.dispatch;return o!==a.memoizedState&&(We.flags|=2048,Ho(9,{destroy:void 0},fx.bind(null,d,o),null)),[l,h,n]}function fx(n,a){n.action=a}function zw(n){var a=Zt(),o=kt;if(o!==null)return Lw(a,o,n);Zt(),a=a.memoizedState,o=Zt();var l=o.queue.dispatch;return o.memoizedState=n,[a,l,!1]}function Ho(n,a,o,l){return n={tag:n,create:o,deps:l,inst:a,next:null},a=We.updateQueue,a===null&&(a=Wd(),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 $w(){return Zt().memoizedState}function Kd(n,a,o,l){var d=$n();We.flags|=n,d.memoizedState=Ho(1|a,{destroy:void 0},o,l===void 0?null:l)}function Qd(n,a,o,l){var d=Zt();l=l===void 0?null:l;var h=d.memoizedState.inst;kt!==null&&l!==null&&Jm(l,kt.memoizedState.deps)?d.memoizedState=Ho(a,h,o,l):(We.flags|=n,d.memoizedState=Ho(1|a,h,o,l))}function Vw(n,a){Kd(8390656,8,n,a)}function og(n,a){Qd(2048,8,n,a)}function hx(n){We.flags|=4;var a=We.updateQueue;if(a===null)a=Wd(),We.updateQueue=a,a.events=[n];else{var o=a.events;o===null?a.events=[n]:o.push(n)}}function Pw(n){var a=Zt().memoizedState;return hx({ref:a,nextImpl:n}),function(){if((ht&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Gw(n,a){return Qd(4,2,n,a)}function Fw(n,a){return Qd(4,4,n,a)}function Hw(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 qw(n,a,o){o=o!=null?o.concat([n]):null,Qd(4,4,Hw.bind(null,a,n),o)}function cg(){}function Zw(n,a){var o=Zt();a=a===void 0?null:a;var l=o.memoizedState;return a!==null&&Jm(a,l[1])?l[0]:(o.memoizedState=[n,a],n)}function Yw(n,a){var o=Zt();a=a===void 0?null:a;var l=o.memoizedState;if(a!==null&&Jm(a,l[1]))return l[0];if(l=n(),Ui){wa(!0);try{n()}finally{wa(!1)}}return o.memoizedState=[l,a],l}function lg(n,a,o){return o===void 0||(Gr&1073741824)!==0&&(it&261930)===0?n.memoizedState=a:(n.memoizedState=o,n=r2(),We.lanes|=n,Ba|=n,o)}function Ww(n,a,o,l){return ls(o,a)?o:Ia.current!==null?(n=lg(n,o,l),ls(n,a)||(Qt=!0),n):(Gr&106)===0||(Gr&1073741824)!==0&&(it&261930)===0?(Qt=!0,n.memoizedState=o):(n=r2(),We.lanes|=n,Ba|=n,a)}function Xw(n,a,o,l,d){var h=_e.p;_e.p=h!==0&&8>h?h:8;var v=be.T,_={};_.types=v!==null?v.types:null,be.T=_,fg(n,!1,a,o);try{var B=d(),ne=be.S;if(ne!==null&&ne(_,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var oe=cx(B,l);$l(n,a,oe,ps(n))}else $l(n,a,l,ps(n))}catch(ge){$l(n,a,{then:function(){},status:"rejected",reason:ge},ps())}finally{_e.p=h,v!==null&&_.types!==null&&(v.types=_.types),be.T=v}}function px(){}function ug(n,a,o,l){if(n.tag!==5)throw Error(r(476));var d=Jw(n).queue;Xw(n,d,a,Pe,o===null?px:function(){return Kw(n),o(l)})}function Jw(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:Fr,lastRenderedState:Pe},next:null};var o={};return a.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:o},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function Kw(n){var a=Jw(n);a.next===null&&(a=n.alternate.memoizedState),$l(n,a.next.queue,{},ps())}function dg(){return _n(uc)}function Qw(){return Zt().memoizedState}function eT(){return Zt().memoizedState}function mx(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var o=ps();n=xa(o);var l=Ca(a,n,o);l!==null&&(es(l,a,o),Ml(l,a,o)),a={cache:zm()},n.payload=a;return}a=a.return}}function gx(n,a,o){var l=ps();o={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ef(n)?nT(a,o):(o=Cm(n,a,o,l),o!==null&&(es(o,n,l),sT(o,a,l)))}function tT(n,a,o){var l=ps();$l(n,a,o,l)}function $l(n,a,o,l){var d={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(ef(n))nT(a,d);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(d.hasEagerState=!0,d.eagerState=_,ls(_,v))return Id(n,a,d,0),Nt===null&&Cd(),!1}catch{}if(o=Cm(n,a,d,l),o!==null)return es(o,n,l),sT(o,a,l),!0}return!1}function fg(n,a,o,l){if(l={lane:2,revertLane:n0(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ef(n)){if(a)throw Error(r(479))}else a=Cm(n,o,l,2),a!==null&&es(a,n,2)}function ef(n){var a=n.alternate;return n===We||a!==null&&a===We}function nT(n,a){Go=Zd=!0;var o=n.pending;o===null?a.next=a:(a.next=o.next,o.next=a),n.pending=a}function sT(n,a,o){if((o&4194048)!==0){var l=a.lanes;l&=n.pendingLanes,o|=l,a.lanes=o,r1(n,o)}}var tf={readContext:_n,use:Xd,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt,useEffectEvent:Pt},rT={readContext:_n,use:Xd,useCallback:function(n,a){return $n().memoizedState=[n,a===void 0?null:a],n},useContext:_n,useEffect:Vw,useImperativeHandle:function(n,a,o){o=o!=null?o.concat([n]):null,Kd(4194308,4,Hw.bind(null,a,n),o)},useLayoutEffect:function(n,a){return Kd(4194308,4,n,a)},useInsertionEffect:function(n,a){Kd(4,2,n,a)},useMemo:function(n,a){var o=$n();a=a===void 0?null:a;var l=n();if(Ui){wa(!0);try{n()}finally{wa(!1)}}return o.memoizedState=[l,a],l},useReducer:function(n,a,o){var l=$n();if(o!==void 0){var d=o(a);if(Ui){wa(!0);try{o(a)}finally{wa(!1)}}}else d=a;return l.memoizedState=l.baseState=d,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:d},l.queue=n,n=n.dispatch=gx.bind(null,We,n),[l.memoizedState,n]},useRef:function(n){var a=$n();return n={current:n},a.memoizedState=n},useState:function(n){n=ag(n);var a=n.queue,o=tT.bind(null,We,a);return a.dispatch=o,[n.memoizedState,o]},useDebugValue:cg,useDeferredValue:function(n,a){var o=$n();return lg(o,n,a)},useTransition:function(){var n=ag(!1);return n=Xw.bind(null,We,n.queue,!0,!1),$n().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,o){var l=We,d=$n();if(Ke){if(o===void 0)throw Error(r(407));o=o()}else{if(o=a(),Nt===null)throw Error(r(349));(it&127)!==0||kw(l,a,o)}d.memoizedState=o;var h={value:o,getSnapshot:a};return d.queue=h,Vw(Ow.bind(null,l,h,n),[n]),l.flags|=2048,Ho(9,{destroy:void 0},Aw.bind(null,l,h,o,a),null),o},useId:function(){var n=$n(),a=Nt.identifierPrefix;if(Ke){var o=or,l=ir;o=(l&~(1<<32-os(l)-1)).toString(32)+o,a="_"+a+"R_"+o,o=Yd++,0<o&&(a+="H"+o.toString(32)),a+="_"}else o=lx++,a="_"+a+"r_"+o.toString(32)+"_";return n.memoizedState=a},useHostTransitionStatus:dg,useFormState:Uw,useActionState:Uw,useOptimistic:function(n){var a=$n();a.memoizedState=a.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=o,a=fg.bind(null,We,!0,o),o.dispatch=a,[n,a]},useMemoCache:ng,useCacheRefresh:function(){return $n().memoizedState=mx.bind(null,We)},useEffectEvent:function(n){var a=$n(),o={impl:n};return a.memoizedState=o,function(){if((ht&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},aT={readContext:_n,use:Xd,useCallback:Zw,useContext:_n,useEffect:og,useImperativeHandle:qw,useInsertionEffect:Gw,useLayoutEffect:Fw,useMemo:Yw,useReducer:Jd,useRef:$w,useState:function(){return Jd(Fr)},useDebugValue:cg,useDeferredValue:function(n,a){var o=Zt();return Ww(o,kt.memoizedState,n,a)},useTransition:function(){var n=Jd(Fr)[0],a=Zt().memoizedState;return[typeof n=="boolean"?n:zl(n),a]},useSyncExternalStore:_w,useId:Qw,useHostTransitionStatus:dg,useFormState:Bw,useActionState:Bw,useOptimistic:function(n,a){var o=Zt();return Cw(o,kt,n,a)},useMemoCache:ng,useCacheRefresh:eT,useEffectEvent:Pw},yx={readContext:_n,use:Xd,useCallback:Zw,useContext:_n,useEffect:og,useImperativeHandle:qw,useInsertionEffect:Gw,useLayoutEffect:Fw,useMemo:Yw,useReducer:rg,useRef:$w,useState:function(){return rg(Fr)},useDebugValue:cg,useDeferredValue:function(n,a){var o=Zt();return kt===null?lg(o,n,a):Ww(o,kt.memoizedState,n,a)},useTransition:function(){var n=rg(Fr)[0],a=Zt().memoizedState;return[typeof n=="boolean"?n:zl(n),a]},useSyncExternalStore:_w,useId:Qw,useHostTransitionStatus:dg,useFormState:zw,useActionState:zw,useOptimistic:function(n,a){var o=Zt();return kt!==null?Cw(o,kt,n,a):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:ng,useCacheRefresh:eT,useEffectEvent:Pw};function hg(n,a,o,l){a=n.memoizedState,o=o(l,a),o=o==null?a:K({},a,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var pg={enqueueSetState:function(n,a,o){n=n._reactInternals;var l=ps(),d=xa(l);d.payload=a,o!=null&&(d.callback=o),a=Ca(n,d,l),a!==null&&(es(a,n,l),Ml(a,n,l))},enqueueReplaceState:function(n,a,o){n=n._reactInternals;var l=ps(),d=xa(l);d.tag=1,d.payload=a,o!=null&&(d.callback=o),a=Ca(n,d,l),a!==null&&(es(a,n,l),Ml(a,n,l))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var o=ps(),l=xa(o);l.tag=2,a!=null&&(l.callback=a),a=Ca(n,l,o),a!==null&&(es(a,n,o),Ml(a,n,o))}};function iT(n,a,o,l,d,h,v){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,h,v):a.prototype&&a.prototype.isPureReactComponent?!Al(o,l)||!Al(d,h):!0}function oT(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&&pg.enqueueReplaceState(a,a.state,null)}function Bi(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=K({},o));for(var d in n)o[d]===void 0&&(o[d]=n[d])}return o}function cT(n){xd(n)}function lT(n){console.error(n)}function uT(n){xd(n)}function nf(n,a){try{var o=n.onUncaughtError;o(a.value,{componentStack:a.stack})}catch(l){setTimeout(function(){throw l})}}function dT(n,a,o){try{var l=n.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function mg(n,a,o){return o=xa(o),o.tag=3,o.payload={element:null},o.callback=function(){nf(n,a)},o}function fT(n){return n=xa(n),n.tag=3,n}function hT(n,a,o,l){var d=o.type.getDerivedStateFromError;if(typeof d=="function"){var h=l.value;n.payload=function(){return d(h)},n.callback=function(){dT(a,o,l)}}var v=o.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(n.callback=function(){dT(a,o,l),typeof d!="function"&&(La===null?La=new Set([this]):La.add(this));var _=l.stack;this.componentDidCatch(l.value,{componentStack:_!==null?_:""})})}function vx(n,a,o,l,d){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(a=o.alternate,a!==null&&xi(a,o,d,!0),o=kn.current,o!==null){switch(o.tag){case 31:case 13:case 19:return Mn===null?_f():o.alternate===null&&Gt===0&&(Gt=3),o.flags&=-257,o.flags|=65536,o.lanes=d,l===Pd?o.flags|=16384:(a=o.updateQueue,a===null?o.updateQueue=new Set([l]):a.add(l),Qg(n,l,d)),!1;case 22:return o.flags|=65536,l===Pd?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)),Qg(n,l,d)),!1}throw Error(r(435,o.tag))}return Qg(n,l,d),_f(),!1}if(Ke)return a=kn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=d,l!==Dm&&(n=Error(r(422),{cause:l}),xl(As(n,o)))):(l!==Dm&&(a=Error(r(423),{cause:l}),xl(As(a,o))),n=n.current.alternate,n.flags|=65536,d&=-d,n.lanes|=d,l=As(l,o),d=mg(n.stateNode,l,d),Hm(n,d),Gt!==4&&(Gt=2)),!1;var h=Error(r(520),{cause:l});if(h=As(h,o),Yl===null?Yl=[h]:Yl.push(h),Gt!==4&&(Gt=2),a===null)return!0;l=As(l,o),o=a;do{switch(o.tag){case 3:return o.flags|=65536,n=d&-d,o.lanes|=n,n=mg(o.stateNode,l,n),Hm(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"&&(La===null||!La.has(h))))return o.flags|=65536,d&=-d,o.lanes|=d,d=fT(d),hT(d,n,o,l),Hm(o,d),!1;break;case 22:if(o.memoizedState!==null)return o.flags|=65536,!1}o=o.return}while(o!==null);return!1}var gg=Error(r(461)),Qt=!1;function sn(n,a,o,l){a.child=n===null?yw(a,null,o,l):Di(a,n.child,o,l)}function pT(n,a,o,l,d){o=o.render;var h=a.ref;if("ref"in l){var v={};for(var _ in l)_!=="ref"&&(v[_]=l[_])}else v=l;return Ci(a),l=Km(n,a,o,v,h,d),_=Qm(),n!==null&&!Qt?(eg(n,a,d),Hr(n,a,d)):(Ke&&_&&Dd(a),a.flags|=1,sn(n,a,l,d),a.child)}function mT(n,a,o,l,d){if(n===null){var h=o.type;return typeof h=="function"&&!Im(h)&&h.defaultProps===void 0&&o.compare===null?(a.tag=15,a.type=h,gT(n,a,h,l,d)):(n=jd(o.type,null,l,a,a.mode,d),n.ref=a.ref,n.return=a,a.child=n)}if(h=n.child,!_g(n,d)){var v=h.memoizedProps;if(o=o.compare,o=o!==null?o:Al,o(v,l)&&n.ref===a.ref)return Hr(n,a,d)}return a.flags|=1,n=zr(h,l),n.ref=a.ref,n.return=a,a.child=n}function gT(n,a,o,l,d){if(n!==null){var h=n.memoizedProps;if(Al(h,l)&&n.ref===a.ref)if(Qt=!1,a.pendingProps=l=h,_g(n,d))(n.flags&131072)!==0&&(Qt=!0);else return a.lanes=n.lanes,Hr(n,a,d)}return yg(n,a,o,l,d)}function yT(n,a,o,l){var d=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,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~h}else l=0,a.child=null;return vT(n,a,h,o,l)}if((o&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&$d(a,h!==null?h.cachePool:null),h!==null?ww(a,h):Zm(),Tw(a);else return l=a.lanes=536870912,vT(n,a,h!==null?h.baseLanes|o:o,o,l)}else h!==null?($d(a,h.cachePool),ww(a,h),ja(),a.memoizedState=null):(n!==null&&$d(a,null),Zm(),ja());return sn(n,a,d,o),a.child}function Vl(n,a){return n!==null&&n.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function vT(n,a,o,l,d){var h=Vm();return h=h===null?null:{parent:Jt._currentValue,pool:h},a.memoizedState={baseLanes:o,cachePool:h},n!==null&&$d(a,null),Zm(),Tw(a),n!==null&&xi(n,a,l,!0),a.childLanes=d,null}function sf(n,a){return a=rf({mode:a.mode,children:a.children},n.mode),a.ref=n.ref,n.child=a,a.return=n,a}function bT(n,a,o){return Di(a,n.child,null,o),n=sf(a,a.pendingProps),n.flags|=2,us(a),a.memoizedState=null,n}function bx(n,a,o){var l=a.pendingProps,d=(a.flags&128)!==0;if(a.flags&=-129,n===null){if(Ke){if(l.mode==="hidden")return n=sf(a,l),a.lanes=536870912,n.memoizedState={baseLanes:0,cachePool:null},Vl(null,n);if(Wm(a),(n=It)?(n=H2(n,xs),n=n!==null&&n.data==="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:Sa!==null?{id:ir,overflow:or}:null,retryLane:536870912,hydrationErrors:null},o=nw(n),o.return=a,a.child=o,mn=a,It=null)):n=null,n===null)throw ka(a);return a.lanes=536870912,null}return sf(a,l)}var h=n.memoizedState;if(h!==null){var v=h.dehydrated;if(Wm(a),d)if(a.flags&256)a.flags&=-257,a=bT(n,a,o);else if(a.memoizedState!==null)a.child=n.child,a.flags|=128,a=null;else throw Error(r(558));else if(Qt||xi(n,a,o,!1),d=(o&n.childLanes)!==0,Qt||d){if(Ia.current===null){if(l=Nt,l!==null&&(v=a1(l,o),v!==0&&v!==h.retryLane))throw h.retryLane=v,ki(n,v),es(l,n,v),gg;_f()}a=bT(n,a,o)}else n=h.treeContext,It=Is(v.nextSibling),mn=a,Ke=!0,_a=null,xs=!1,n!==null&&aw(a,n),a=sf(a,l),a.flags|=134221824;return a}return n=zr(n.child,{mode:l.mode,children:l.children}),n.ref=a.ref,a.child=n,n.return=a,n}function qo(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 yg(n,a,o,l,d){return Ci(a),o=Km(n,a,o,l,void 0,d),l=Qm(),n!==null&&!Qt?(eg(n,a,d),Hr(n,a,d)):(Ke&&l&&Dd(a),a.flags|=1,sn(n,a,o,d),a.child)}function wT(n,a,o,l,d,h){return Ci(a),a.updateQueue=null,o=Sw(a,l,o,d),Ew(n),l=Qm(),n!==null&&!Qt?(eg(n,a,h),Hr(n,a,h)):(Ke&&l&&Dd(a),a.flags|=1,sn(n,a,o,h),a.child)}function TT(n,a,o,l,d){if(Ci(a),a.stateNode===null){var h=Uo,v=o.contextType;typeof v=="object"&&v!==null&&(h=_n(v)),h=new o(l,h),a.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=pg,a.stateNode=h,h._reactInternals=a,h=a.stateNode,h.props=l,h.state=a.memoizedState,h.refs={},Gm(a),v=o.contextType,h.context=typeof v=="object"&&v!==null?_n(v):Uo,h.state=a.memoizedState,v=o.getDerivedStateFromProps,typeof v=="function"&&(hg(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&&pg.enqueueReplaceState(h,h.state,null),Ul(a,l,h,d),Dl(),h.state=a.memoizedState),typeof h.componentDidMount=="function"&&(a.flags|=4194308),l=!0}else if(n===null){h=a.stateNode;var _=a.memoizedProps,B=Bi(o,_);h.props=B;var ne=h.context,oe=o.contextType;v=Uo,typeof oe=="object"&&oe!==null&&(v=_n(oe));var ge=o.getDerivedStateFromProps;oe=typeof ge=="function"||typeof h.getSnapshotBeforeUpdate=="function",_=a.pendingProps!==_,oe||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_||ne!==v)&&oT(a,h,l,v),Na=!1;var Q=a.memoizedState;h.state=Q,Ul(a,l,h,d),Dl(),ne=a.memoizedState,_||Q!==ne||Na?(typeof ge=="function"&&(hg(a,o,ge,l),ne=a.memoizedState),(B=Na||iT(a,o,B,l,Q,ne,v))?(oe||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=B):(typeof h.componentDidMount=="function"&&(a.flags|=4194308),l=!1)}else{h=a.stateNode,Fm(n,a),v=a.memoizedProps,oe=Bi(o,v),h.props=oe,ge=a.pendingProps,Q=h.context,ne=o.contextType,B=Uo,typeof ne=="object"&&ne!==null&&(B=_n(ne)),_=o.getDerivedStateFromProps,(ne=typeof _=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==ge||Q!==B)&&oT(a,h,l,B),Na=!1,Q=a.memoizedState,h.state=Q,Ul(a,l,h,d),Dl();var re=a.memoizedState;v!==ge||Q!==re||Na||n!==null&&n.dependencies!==null&&Ld(n.dependencies)?(typeof _=="function"&&(hg(a,o,_,l),re=a.memoizedState),(oe=Na||iT(a,o,oe,l,Q,re,B)||n!==null&&n.dependencies!==null&&Ld(n.dependencies))?(ne||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,re,B),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,re,B)),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=re),h.props=l,h.state=re,h.context=B,l=oe):(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,qo(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=Di(a,n.child,null,d),a.child=Di(a,null,o,d)):sn(n,a,o,d),a.memoizedState=h.state,n=a.child):n=Hr(n,a,d),n}function ET(n,a,o,l){return Oi(),a.flags|=256,sn(n,a,o,l),a.child}var vg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bg(n){return{baseLanes:n,cachePool:dw()}}function wg(n,a,o){return n=n!==null?n.childLanes&~o:0,a&&(n|=hs),n}function ST(n,a,o){var l=a.pendingProps,d=!1,h=(a.flags&128)!==0,v;if((v=h)||(v=n!==null&&n.memoizedState===null?!1:(An.current&2)!==0),v&&(d=!0,a.flags&=-129),v=(a.flags&32)!==0,a.flags&=-33,n===null){if(Ke){if(d?Ra(a):ja(),(n=It)?(n=H2(n,xs),n=n!==null&&n.data!=="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:Sa!==null?{id:ir,overflow:or}:null,retryLane:536870912,hydrationErrors:null},o=nw(n),o.return=a,a.child=o,mn=a,It=null)):n=null,n===null)throw ka(a);return b0(n)?a.lanes=32:a.lanes=536870912,null}return h=l.children,l=l.fallback,d?(ja(),d=a.mode,h=rf({mode:"hidden",children:h},d),l=Ai(l,d,o,null),h.return=a,l.return=a,h.sibling=l,a.child=h,l=a.child,l.memoizedState=bg(o),l.childLanes=wg(n,v,o),a.memoizedState=vg,Vl(null,l)):(Ra(a),Tg(a,h))}var _=n.memoizedState;if(_!==null){var B=_.dehydrated;if(B!==null)return wx(n,a,h,v,l,B,_,o)}return d?(ja(),d=l.fallback,h=a.mode,_=n.child,B=_.sibling,l=zr(_,{mode:"hidden",children:l.children}),l.subtreeFlags=_.subtreeFlags&1206910976,B!==null?d=zr(B,d):(d=Ai(d,h,o,null),d.flags|=2),d.return=a,l.return=a,l.sibling=d,a.child=l,Vl(null,l),l=a.child,d=n.child.memoizedState,d===null?d=bg(o):(h=d.cachePool,h!==null?(_=Jt._currentValue,h=h.parent!==_?{parent:_,pool:_}:h):h=dw(),d={baseLanes:d.baseLanes|o,cachePool:h}),l.memoizedState=d,l.childLanes=wg(n,v,o),a.memoizedState=vg,Vl(n.child,l)):(Ra(a),o=n.child,n=o.sibling,o=zr(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 Tg(n,a){return a=rf({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function rf(n,a){return n=Xn(22,n,null,a),n.lanes=0,n}function af(n,a,o){return Di(a,n.child,null,o),n=Tg(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function wx(n,a,o,l,d,h,v,_){if(o)return a.flags&256?(Ra(a),a.flags&=-257,af(n,a,_)):a.memoizedState!==null?(ja(),a.child=n.child,a.flags|=128,null):(ja(),h=d.fallback,v=a.mode,d=rf({mode:"visible",children:d.children},v),h=Ai(h,v,_,null),h.flags|=2,d.return=a,h.return=a,d.sibling=h,a.child=d,Di(a,n.child,null,_),d=a.child,d.memoizedState=bg(_),d.childLanes=wg(n,l,_),a.memoizedState=vg,Vl(null,d));if(Ra(a),b0(h)){if(l=h.nextSibling&&h.nextSibling.dataset,l)var B=l.dgst;return l=B,l!==""&&(d=Error(r(419)),d.stack="",d.digest=l,xl({value:d,source:null,stack:null})),af(n,a,_)}if(Qt||xi(n,a,_,!1),l=(_&n.childLanes)!==0,Qt||l){if(Ia.current!==null)return af(n,a,_);if(l=Nt,l!==null&&(d=a1(l,_),d!==0&&d!==v.retryLane))throw v.retryLane=d,ki(n,d),es(l,n,d),gg;return v0(h)||_f(),af(n,a,_)}return v0(h)?(a.flags|=192,a.child=n.child,null):(n=v.treeContext,It=Is(h.nextSibling),mn=a,Ke=!0,_a=null,xs=!1,n!==null&&aw(a,n),a=Tg(a,d.children),a.flags|=134221824,a)}function _T(n,a,o){n.lanes|=a;var l=n.alternate;l!==null&&(l.lanes|=a),Bd(n.return,a,o)}function kT(n){for(var a=null;n!==null;){var o=n.alternate;o!==null&&qd(o)===null&&(a=n),n=n.sibling}return a}function of(n,a,o,l,d,h){var v=n.memoizedState;v===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:d,treeForkCount:h}:(v.isBackwards=a,v.rendering=null,v.renderingStartTime=0,v.last=l,v.tail=o,v.tailMode=d,v.treeForkCount=h)}function Eg(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 Sg(n,a,o){var l=a.pendingProps,d=l.revealOrder,h=l.tail;l=l.children;var v=An.current;if(a.flags&128)return Bl(a,v),null;var _=(v&2)!==0;if(_?(v=v&1|2,a.flags|=128):v&=1,Bl(a,v),d==="backwards"&&n!==null?(Eg(n),sn(n,a,l,o),Eg(n)):sn(n,a,l,o),l=Ke?Nl:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&_T(n,o,a);else if(n.tag===19)_T(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(d){case"backwards":o=kT(a.child),o===null?(d=a.child,a.child=null):(d=o.sibling,o.sibling=null,Eg(a)),of(a,!0,d,null,h,l);break;case"unstable_legacy-backwards":for(o=null,d=a.child,a.child=null;d!==null;){if(n=d.alternate,n!==null&&qd(n)===null){a.child=d;break}n=d.sibling,d.sibling=o,o=d,d=n}of(a,!0,o,null,h,l);break;case"together":of(a,!1,null,null,void 0,l);break;case"independent":a.memoizedState=null;break;default:o=kT(a.child),o===null?(d=a.child,a.child=null):(d=o.sibling,o.sibling=null),of(a,!1,d,o,h,l)}return a.child}function AT(n,a,o){var l=a.pendingProps;return Aa(a,a.type,l.value),sn(n,a,l.children,o),a.child}function Hr(n,a,o){if(n!==null&&(a.dependencies=n.dependencies),Ba|=a.lanes,(o&a.childLanes)===0)if(n!==null){if(xi(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=zr(n,n.pendingProps),a.child=o,o.return=a;n.sibling!==null;)n=n.sibling,o=o.sibling=zr(n,n.pendingProps),o.return=a;o.sibling=null}return a.child}function _g(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&Ld(n)))}function Tx(n,a,o){switch(a.tag){case 3:Es(a,a.stateNode.containerInfo),Aa(a,Jt,n.memoizedState.cache),Oi();break;case 27:case 5:cl(a);break;case 4:Es(a,a.stateNode.containerInfo);break;case 10:Aa(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Wm(a),null;break;case 13:var l=a.memoizedState;if(l!==null){if(l.dehydrated!==null)return Ra(a),a.flags|=128,null;l=xi(n,a,o,!1);var d=a.child.childLanes;return l||(o&d)!==0?ST(n,a,o):(Ra(a),n=Hr(n,a,o),n!==null?n.sibling:null)}Ra(a);break;case 19:if(a.flags&128)return Sg(n,a,o);if(d=(n.flags&128)!==0,l=(o&a.childLanes)!==0,l||(xi(n,a,o,!1),l=(o&a.childLanes)!==0),d){if(l)return Sg(n,a,o);a.flags|=128}if(d=a.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Bl(a,An.current),l)break;return null;case 22:return a.lanes=0,yT(n,a,o,a.pendingProps);case 24:Aa(a,Jt,n.memoizedState.cache)}return Hr(n,a,o)}function OT(n,a,o){if(n!==null)if(n.memoizedProps!==a.pendingProps)Qt=!0;else{if(!_g(n,o)&&(a.flags&128)===0)return Qt=!1,Tx(n,a,o);Qt=(n.flags&131072)!==0}else Qt=!1,Ke&&(a.flags&1048576)!==0&&rw(a,Nl,a.index);switch(a.lanes=0,a.tag){case 16:e:{var l=a.pendingProps;if(n=ji(a.elementType),a.type=n,typeof n=="function")Im(n)?(l=Bi(n,l),a.tag=1,a=TT(null,a,n,l,o)):(a.tag=0,a=yg(null,a,n,l,o));else{if(n!=null){var d=n.$$typeof;if(d===k){a.tag=11,a=pT(null,a,n,l,o);break e}else if(d===L){a.tag=14,a=mT(null,a,n,l,o);break e}else if(d===M){a.tag=10,a.type=n,a=AT(null,a,o);break e}}throw a=Oe(n)||n,Error(r(306,a,""))}}return a;case 0:return yg(n,a,a.type,a.pendingProps,o);case 1:return l=a.type,d=Bi(l,a.pendingProps),TT(n,a,l,d,o);case 3:e:{if(Es(a,a.stateNode.containerInfo),n===null)throw Error(r(387));l=a.pendingProps;var h=a.memoizedState;d=h.element,Fm(n,a),Ul(a,l,null,o);var v=a.memoizedState;if(l=v.cache,Aa(a,Jt,l),l!==h.cache&&Lm(a,[Jt],o,!0),Dl(),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=ET(n,a,l,o);break e}else if(l!==d){d=As(Error(r(424)),a),xl(d),a=ET(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,It=Is(n.firstChild),mn=a,Ke=!0,_a=null,xs=!0,o=yw(a,null,l,o),a.child=o;o;)o.flags=o.flags&-3|134221824,o=o.sibling;else{if(Oi(),l===d){a=Hr(n,a,o);break e}sn(n,a,l,o)}a=a.child}return a;case 26:return qo(n,a),n===null?(o=K2(a.type,null,a.pendingProps,null))?a.memoizedState=o:Ke||(a.stateNode=I2(a.type,a.pendingProps,Le.current,a)):a.memoizedState=K2(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return cl(a),n===null&&Ke&&(l=a.stateNode=Y2(a.type,a.pendingProps,Le.current),mn=a,xs=!0,d=It,Va(a.type)?(w0=d,It=Is(l.firstChild)):It=d),sn(n,a,a.pendingProps.children,o),qo(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&Ke&&((d=l=It)&&(l=mC(l,a.type,a.pendingProps,xs),l!==null?(a.stateNode=l,mn=a,It=Is(l.firstChild),xs=!1,d=!0):d=!1),d||ka(a)),cl(a),d=a.type,h=a.pendingProps,v=n!==null?n.memoizedProps:null,l=h.children,d0(d,h)?l=null:v!==null&&d0(d,v)&&(a.flags|=32),a.memoizedState!==null&&(d=Km(n,a,ux,null,null,o),uc._currentValue=d),qo(n,a),sn(n,a,l,o),a.child;case 6:return n===null&&Ke&&((n=o=It)&&(o=gC(o,a.pendingProps,xs),o!==null?(a.stateNode=o,mn=a,It=null,n=!0):n=!1),n||ka(a)),null;case 13:return ST(n,a,o);case 4:return Es(a,a.stateNode.containerInfo),l=a.pendingProps,n===null?a.child=Di(a,null,l,o):sn(n,a,l,o),a.child;case 11:return pT(n,a,a.type,a.pendingProps,o);case 7:return l=a.pendingProps,qo(n,a),sn(n,a,l,o),a.child;case 8:return sn(n,a,a.pendingProps.children,o),a.child;case 12:return sn(n,a,a.pendingProps.children,o),a.child;case 10:return AT(n,a,o);case 9:return d=a.type._context,l=a.pendingProps.children,Ci(a),d=_n(d),l=l(d),a.flags|=1,sn(n,a,l,o),a.child;case 14:return mT(n,a,a.type,a.pendingProps,o);case 15:return gT(n,a,a.type,a.pendingProps,o);case 19:return Sg(n,a,o);case 31:return bx(n,a,o);case 22:return yT(n,a,o,a.pendingProps);case 24:return Ci(a),l=_n(Jt),n===null?(d=Vm(),d===null&&(d=Nt,h=zm(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=o),d=h),a.memoizedState={parent:l,cache:d},Gm(a),Aa(a,Jt,d)):((n.lanes&o)!==0&&(Fm(n,a),Ul(a,null,null,o),Dl()),d=n.memoizedState,h=a.memoizedState,d.parent!==l?(d={parent:l,cache:l},a.memoizedState=d,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=d),Aa(a,Jt,l)):(l=h.cache,Aa(a,Jt,l),l!==d.cache&&Lm(a,[Jt],o,!0))),sn(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:Ke&&Dd(a),n!==null&&n.memoizedProps.name!==l.name?a.flags|=4194816:qo(n,a),sn(n,a,l.children,o),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function qr(n){n.flags|=4}function kg(n,a,o,l,d){var h;if((h=(n.mode&32)!==0)&&(h=o===null?nE(a,l):nE(a,l)&&(l.src!==o.src||l.srcSet!==o.srcSet)),h){if(n.flags|=16777216,(d&335544128)===d)if(n.stateNode.complete)n.flags|=8192;else if(c2())n.flags|=8192;else throw Mi=Pd,Pm}else n.flags&=-16777217}function NT(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!sE(a))if(c2())n.flags|=8192;else throw Mi=Pd,Pm}function cf(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?n1():536870912,n.lanes|=a,Jo|=a)}function Pl(n,a){if(!Ke)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 Rt(n){var a=n.alternate!==null&&n.alternate.child===n.child,o=0,l=0;if(a)for(var d=n.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags&1206910976,l|=d.flags&1206910976,d.return=n,d=d.sibling;else for(d=n.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=n,d=d.sibling;return n.subtreeFlags|=l,n.childLanes=o,a}function Ex(n,a,o){var l=a.pendingProps;switch(Mm(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(a),null;case 1:return Rt(a),null;case 3:return o=a.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),a.memoizedState.cache!==l&&(a.flags|=2048),Pr(Jt),va(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(zo(a)?qr(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Um())),Rt(a),null;case 26:var d=a.type,h=a.memoizedState;return n===null?(qr(a),h!==null?(Rt(a),NT(a,h)):(Rt(a),kg(a,d,null,l,o))):h?h!==n.memoizedState?(qr(a),Rt(a),NT(a,h)):(Rt(a),a.flags&=-16777217):(n=n.memoizedProps,n!==l&&qr(a),Rt(a),kg(a,d,n,l,o)),null;case 27:if(bi(a),o=Le.current,d=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==l&&qr(a);else{if(!l){if(a.stateNode===null)throw Error(r(166));return Rt(a),a.subtreeFlags&=-33554433,null}n=ue.current,zo(a)?iw(a):(n=Y2(d,l,o),a.stateNode=n,qr(a))}return Rt(a),a.subtreeFlags&=-33554433,null;case 5:if(bi(a),d=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==l&&qr(a);else{if(!l){if(a.stateNode===null)throw Error(r(166));return Rt(a),a.subtreeFlags&=-33554433,null}if(h=ue.current,zo(a))iw(a);else{var v=Ql(Le.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",d);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(d,{is:l.is}):v.createElement(d)}}h[Sn]=a,h[Wn]=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(Nn(h,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&qr(a)}}return Rt(a),a.subtreeFlags&=-33554433,kg(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,o),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==l&&qr(a);else{if(typeof l!="string"&&a.stateNode===null)throw Error(r(166));if(n=Le.current,zo(a)){if(n=a.stateNode,o=a.memoizedProps,l=null,d=mn,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}n[Sn]=a,n=!!(n.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||O2(n.nodeValue,o)),n||ka(a,!0)}else n=Ql(n).createTextNode(l),n[Sn]=a,a.stateNode=n}return Rt(a),null;case 31:if(o=a.memoizedState,n===null||n.memoizedState!==null){if(l=zo(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[Sn]=a}else Oi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Rt(a),n=!1}else o=Um(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return a.flags&256?(us(a),a):(us(a),null);if((a.flags&128)!==0)throw Error(r(558))}return Rt(a),null;case 13:if(l=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(d=zo(a),l!==null&&l.dehydrated!==null){if(n===null){if(!d)throw Error(r(318));if(d=a.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));d[Sn]=a}else Oi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Rt(a),d=!1}else d=Um(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=d),d=!0;if(!d)return a.flags&256?(us(a),a):(us(a),null)}return us(a),(a.flags&128)!==0?(a.lanes=o,a):(o=l!==null,n=n!==null&&n.memoizedState!==null,o&&(l=a.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048)),o!==n&&o&&(a.child.flags|=8192),cf(a,a.updateQueue),Rt(a),null);case 4:return va(),n===null&&i0(a.stateNode.containerInfo),a.flags|=67108864,Rt(a),null;case 10:return Pr(a.type),Rt(a),null;case 19:if(Xm(a),l=a.memoizedState,l===null)return Rt(a),null;if(d=(a.flags&128)!==0,h=l.rendering,h===null)if(d)Pl(l,!1);else{if(Gt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(h=qd(n),h!==null){for(a.flags|=128,Pl(l,!1),n=h.updateQueue,a.updateQueue=n,cf(a,n),a.subtreeFlags=0,n=o,o=a.child;o!==null;)tw(o,n),o=o.sibling;return Bl(a,An.current&1|2),Ke&&$r(a,l.treeForkCount),a.child}n=n.sibling}l.tail!==null&&Ln()>wf&&(a.flags|=128,d=!0,Pl(l,!1),a.lanes=4194304)}else{if(!d)if(n=qd(h),n!==null){if(a.flags|=128,d=!0,n=n.updateQueue,a.updateQueue=n,cf(a,n),Pl(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!h.alternate&&!Ke)return Rt(a),null}else 2*Ln()-l.renderingStartTime>wf&&o!==536870912&&(a.flags|=128,d=!0,Pl(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=Ln(),n.sibling=null,h=An.current,h=d?h&1|2:h&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!o||Ke?Bl(a,h):(o=h,he(kn,a),he(An,o),Mn===null&&(Mn=a)),Ke&&$r(a,l.treeForkCount),n}return Rt(a),null;case 22:case 23:return us(a),Ym(),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&&(Rt(a),a.subtreeFlags&6&&(a.flags|=8192)):Rt(a),o=a.updateQueue,o!==null&&cf(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(Ri),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),Pr(Jt),Rt(a),null;case 25:return null;case 30:return a.flags|=33554432,Rt(a),null}throw Error(r(156,a.tag))}function Sx(n,a){switch(Mm(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Pr(Jt),va(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return bi(a),null;case 31:if(a.memoizedState!==null){if(us(a),a.alternate===null)throw Error(r(340));Oi()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(us(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Oi()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return Xm(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 va(),null;case 10:return Pr(a.type),null;case 22:case 23:return us(a),Ym(),n!==null&&de(Ri),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Pr(Jt),null;case 25:return null;default:return null}}function xT(n,a){switch(Mm(a),a.tag){case 3:Pr(Jt),va();break;case 26:case 27:case 5:bi(a);break;case 4:va();break;case 31:a.memoizedState!==null&&us(a);break;case 13:us(a);break;case 19:Xm(a);break;case 10:Pr(a.type);break;case 22:case 23:us(a),Ym(),n!==null&&de(Ri);break;case 24:Pr(Jt)}}function Gl(n,a){try{var o=a.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var d=l.next;o=d;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!==d)}}catch(_){Tt(a,a.return,_)}}function Ma(n,a,o){try{var l=a.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&n)===n){var v=l.inst,_=v.destroy;if(_!==void 0){v.destroy=void 0,d=a;var B=o,ne=_;try{ne()}catch(oe){Tt(d,B,oe)}}}l=l.next}while(l!==h)}}catch(oe){Tt(a,a.return,oe)}}function CT(n){var a=n.updateQueue;if(a!==null){var o=n.stateNode;try{bw(a,o)}catch(l){Tt(n,n.return,l)}}}function IT(n,a,o){o.props=Bi(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(l){Tt(n,a,l)}}function cr(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 d=n.stateNode,h=Br(n.memoizedProps,d);(d.ref===null||d.ref.name!==h)&&(d.ref=L2(h)),l=d.ref;break;case 7:if(n.stateNode===null){var v=new ms(n);y(n.child,!1,hC,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 On(n,a){var o=n.ref,l=n.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(d){Tt(n,a,d)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(d){Tt(n,a,d)}else o.current=null}function lf(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++)F2(n.stateNode,a[o])}function RT(n){for(var a=n.return;a!==null&&(Og(a)&&F2(n.stateNode,a.stateNode),!Ag(a));)a=a.return}function Fl(n){for(var a=n.return;a!==null&&(Og(a)&&pC(n.stateNode,a.stateNode),!Ag(a));)a=a.return}function Ag(n){return n.tag===5||n.tag===3||n.tag===27}function Og(n){return n&&n.tag===7&&n.stateNode!==null}function Ng(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(d){Tt(n,n.return,d)}}function xg(n,a,o){try{var l=n.stateNode;Wx(l,n.type,o,a),l[Wn]=a}catch(d){Tt(n,n.return,d)}}function jT(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Va(n.type)||n.tag===4}function Cg(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||jT(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&&Va(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 Ig(n,a,o,l){var d=n.tag;if(d===5||d===6)d=n.stateNode,a?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(d,a):(a=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,a.appendChild(d),o=o._reactRootContainer,o!=null||a.onclick!==null||(a.onclick=ar)),lf(n,l),dt=!0;else if(d!==4&&(d===27&&(lf(n,l),l=null,Va(n.type)&&(o=n.stateNode,a=null)),n=n.child,n!==null))for(Ig(n,a,o,l),n=n.sibling;n!==null;)Ig(n,a,o,l),n=n.sibling}function uf(n,a,o,l){var d=n.tag;if(d===5||d===6)d=n.stateNode,a?o.insertBefore(d,a):o.appendChild(d),lf(n,l),dt=!0;else if(d!==4&&(d===27&&(lf(n,l),l=null,Va(n.type)&&(o=n.stateNode)),n=n.child,n!==null))for(uf(n,a,o,l),n=n.sibling;n!==null;)uf(n,a,o,l),n=n.sibling}function MT(n){var a=n.stateNode,o=n.memoizedProps;try{for(var l=n.type,d=a.attributes;d.length;)a.removeAttributeNode(d[0]);Nn(a,l,o),a[Sn]=n,a[Wn]=o}catch(h){Tt(n,n.return,h)}}var df=!1,ds=null;function DT(n){(n.tag===30||(n.subtreeFlags&33554432)!==0)&&(df=!0)}var lr=null;function UT(){var n=lr;return lr=null,n}var Jn=0;function Zo(n,a,o,l,d){return Jn=0,BT(n.child,a,o,l,d)}function BT(n,a,o,l,d){for(var h=!1;n!==null;){if(n.tag===5){var v=n.stateNode;if(l!==null){var _=p0(v);l.push(_),_.view&&(h=!0)}else h||p0(v).view&&(h=!0);df=!0,U2(v,Jn===0?a:a+"_"+Jn,o),Jn++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&d||BT(n.child,a,o,l,d)&&(h=!0));n=n.sibling}return h}function ur(n,a){for(;n!==null;)n.tag===5?B2(n.stateNode,n.memoizedProps):(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&a||ur(n.child,a)),n=n.sibling}function ff(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if((n.tag!==22||n.memoizedState===null)&&(ff(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=Lr(a.default,a.share),a!=="none"&&(Zo(n,o,a,null,!1)||ur(n.child,!1))}n=n.sibling}}function Rg(n,a){if(n.tag===30){var o=n.stateNode,l=n.memoizedProps,d=Br(l,o),h=Lr(l.default,o.paired?l.share:l.enter);h!=="none"?Zo(n,d,h,null,!1)?(ff(n),o.paired||a||tc(n,l.onEnter)):ur(n.child,!1):ff(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Rg(n,a),n=n.sibling;else ff(n)}function jg(n){if(ds!==null&&ds.size!==0){var a=ds;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 d=a.get(l);if(d!==void 0){var h=Lr(o.default,o.share);if(h!=="none"&&(Zo(n,l,h,null,!1)?(h=n.stateNode,d.paired=h,h.paired=d,tc(n,o.onShare)):ur(n.child,!1)),a.delete(l),a.size===0)break}}}jg(n)}n=n.sibling}}}function Mg(n){if(n.tag===30){var a=n.memoizedProps,o=Br(a,n.stateNode),l=ds!==null?ds.get(o):void 0,d=Lr(a.default,l!==void 0?a.share:a.exit);d!=="none"&&(Zo(n,o,d,null,!1)?l!==void 0?(d=n.stateNode,l.paired=d,d.paired=l,ds.delete(o),tc(n,a.onShare)):tc(n,a.onExit):ur(n.child,!1)),ds!==null&&jg(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Mg(n),n=n.sibling;else ds!==null&&jg(n)}function LT(n){for(n=n.child;n!==null;){if(n.tag===30){var a=n.memoizedProps,o=Br(a,n.stateNode);a=Lr(a.default,a.update),n.flags&=-5,a!=="none"&&Zo(n,o,a,n.memoizedState=[],!1)}else(n.subtreeFlags&33554432)!==0&&LT(n);n=n.sibling}}function Dg(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,ur(n.child,!1))}Dg(n)}n=n.sibling}}function hf(n){if(n.tag===30)n.stateNode.paired=null,ur(n.child,!1),Dg(n);else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)hf(n),n=n.sibling;else Dg(n)}function zT(n){for(n=n.child;n!==null;)n.tag===30?ur(n.child,!1):(n.subtreeFlags&33554432)!==0&&zT(n),n=n.sibling}function Ug(n,a,o,l,d,h,v){for(var _=!1;a!==null;){if(a.tag===5){var B=a.stateNode;if(h!==null&&Jn<h.length){var ne=h[Jn],oe=p0(B);(ne.view||oe.view)&&(_=!0);var ge;if(ge=(n.flags&4)===0)if(oe.clip)ge=!0;else{ge=ne.rect;var Q=oe.rect;ge=ge.y!==Q.y||ge.x!==Q.x||ge.height!==Q.height||ge.width!==Q.width}ge&&(n.flags|=4),oe.abs?oe=!ne.abs:(ne=ne.rect,oe=oe.rect,oe=ne.height!==oe.height||ne.width!==oe.width),oe&&(n.flags|=32)}else n.flags|=32;(n.flags&4)!==0&&U2(B,Jn===0?o:o+"_"+Jn,d),_&&(n.flags&4)!==0||(lr===null&&(lr=[]),lr.push(B,Jn===0?l:l+"_"+Jn,a.memoizedProps)),Jn++}else(a.tag!==22||a.memoizedState===null)&&(a.tag===30&&v?n.flags|=a.flags&32:Ug(n,a.child,o,l,d,h,v)&&(_=!0));a=a.sibling}return _}function $T(n,a){for(n=n.child;n!==null;){if(n.tag===30){var o=n.memoizedProps,l=n.stateNode,d=Br(o,l),h=Lr(o.default,o.update),v;v=n.memoizedState,n.memoizedState=null,l=n;var _=n.child;Jn=0,d=Ug(l,_,d,d,h,v,!1),(n.flags&4)!==0&&d&&tc(n,o.onUpdate)}else(n.subtreeFlags&33554432)!==0&&$T(n);n=n.sibling}}var gn=!1,mt=!1,dr=!1,Bg=!1,VT=typeof WeakSet=="function"?WeakSet:Set,yn=null,fr=!1,Hl=!1,pf=!1,Lg=!1;function _x(n,a,o){if(n=n.containerInfo,l0=dc,n=H1(n),_m(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var h=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var _=0,B=-1,ne=-1,oe=0,ge=0,Q=n,re=null;t:for(;;){for(var ke;Q!==l||h!==0&&Q.nodeType!==3||(B=_+h),Q!==v||d!==0&&Q.nodeType!==3||(ne=_+d),Q.nodeType===3&&(_+=Q.nodeValue.length),(ke=Q.firstChild)!==null;)re=Q,Q=ke;for(;;){if(Q===n)break t;if(re===l&&++oe===h&&(B=_),re===v&&++ge===d&&(ne=_),(ke=Q.nextSibling)!==null)break;Q=re,re=Q.parentNode}Q=ke}l=B===-1||ne===-1?null:{start:B,end:ne}}else l=null}l=l||{start:0,end:0}}else l=null;for(u0={focusedElem:n,selectionRange:l},dc=!1,o=(o&335544064)===o,yn=a,a=o?9270:1024;yn!==null;){if(n=yn,o&&(l=n.deletions,l!==null))for(h=0;h<l.length;h++)o&&Mg(l[h]);if(n.alternate===null&&(n.flags&2)!==0)o&&DT(n),mf(o);else{if(n.tag===22){if(l=n.alternate,n.memoizedState!==null){l!==null&&l.memoizedState===null&&o&&Mg(l),mf(o);continue}else if(l!==null&&l.memoizedState!==null){o&&DT(n),mf(o);continue}}l=n.child,(n.subtreeFlags&a)!==0&&l!==null?(l.return=n,yn=l):(o&&LT(n),mf(o))}}ds=null}function mf(n){for(;yn!==null;){var a=yn,o=n,l=a.alternate,d=a.flags;switch(a.tag){case 0:case 11:case 15:break;case 1:if((d&1024)!==0&&l!==null){o=void 0,d=l.memoizedProps,l=l.memoizedState;var h=a.stateNode;try{var v=Bi(a.type,d);o=h.getSnapshotBeforeUpdate(v,l),h.__reactInternalSnapshotBeforeUpdate=o}catch(_){Tt(a,a.return,_)}}break;case 3:if((d&1024)!==0){if(l=a.stateNode.containerInfo,o=l.nodeType,o===9)y0(l);else if(o===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":y0(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=Br(l.memoizedProps,l.stateNode),d=a.memoizedProps,d=Lr(d.default,d.update),d!=="none"&&Zo(l,o,d,l.memoizedState=[],!0));break;default:if((d&1024)!==0)throw Error(r(163))}if(l=a.sibling,l!==null){l.return=a.return,yn=l;break}yn=a.return}}function PT(n,a,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:hr(n,o),l&4&&Gl(5,o);break;case 1:if(hr(n,o),l&4)if(n=o.stateNode,a===null)try{n.componentDidMount()}catch(v){Tt(o,o.return,v)}else{var d=Bi(o.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(d,a,n.__reactInternalSnapshotBeforeUpdate)}catch(v){Tt(o,o.return,v)}}l&64&&CT(o),l&512&&cr(o,o.return);break;case 3:if(hr(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{bw(n,a)}catch(v){Tt(o,o.return,v)}}break;case 27:a===null&&l&4&&MT(o);case 26:case 5:hr(n,o),a===null&&l&4&&Ng(o),l&512&&cr(o,o.return);break;case 12:hr(n,o);break;case 31:hr(n,o),l&4&&qT(n,o);break;case 13:hr(n,o),l&4&&ZT(n,o),l&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=Ux.bind(null,o),yC(n,o))));break;case 22:if(l=o.memoizedState!==null||gn,!l){var h=a!==null&&a.memoizedState!==null||mt;a=gn,d=mt,gn=l,(mt=h)&&!d?(l=2,(o.subtreeFlags&8772)!==0&&(l|=1),Hs(n,o,l)):hr(n,o),gn=a,mt=d}break;case 30:hr(n,o),l&512&&cr(o,o.return);break;case 7:l&512&&cr(o,o.return);default:hr(n,o)}}function zg(n,a){for(n=n.child;n!==null;)GT(n,a),n=n.sibling}function GT(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 d=n.stateNode,h=n.memoizedProps.style,v=h!=null&&h.hasOwnProperty("display")?h.display:null;d.style.display=v==null||typeof v=="boolean"?"":(""+v).trim()}}catch(B){Tt(n,n.return,B)}$g(n,a);break;case 6:try{n.stateNode.nodeValue=a?"":n.memoizedProps,dt=!0}catch(B){Tt(n,n.return,B)}break;case 18:try{var _=n.stateNode;a?D2(_,!0):D2(n.stateNode,!1)}catch(B){Tt(n,n.return,B)}break;case 22:case 23:n.memoizedState===null&&zg(n,a);break;default:zg(n,a)}}function $g(n,a){if(n.subtreeFlags&67108864)for(n=n.child;n!==null;){e:{var o=n,l=a;switch(o.tag){case 4:GT(o,l);break e;case 22:o.memoizedState===null&&$g(o,l);break e;default:$g(o,l)}}n=n.sibling}}function FT(n){var a=n.alternate;a!==null&&(n.alternate=null,FT(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&bd(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,Kn=!1;function Gs(n,a,o){for(o=o.child;o!==null;)HT(n,a,o),o=o.sibling}function HT(n,a,o){if(is&&typeof is.onCommitFiberUnmount=="function")try{is.onCommitFiberUnmount(pl,o)}catch{}switch(o.tag){case 26:mt||On(o,a),Gs(n,a,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&!mt&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:mt||On(o,a),Fl(o);var l=Bt,d=Kn;Va(o.type)&&(Bt=o.stateNode,Kn=!1),Gs(n,a,o),W2(o.stateNode,o.type,o.memoizedProps),Bt=l,Kn=d;break;case 5:mt||On(o,a),Fl(o);case 6:if(o.tag===6&&Fl(o),l=Bt,d=Kn,Bt=null,Gs(n,a,o),Bt=l,Kn=d,Bt!==null)if(Kn)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&&(Kn?(n=Bt,M2(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),fc(n)):M2(Bt,o.stateNode));break;case 4:l=Bt,d=Kn,Bt=o.stateNode.containerInfo,Kn=!0,Gs(n,a,o),Bt=l,Kn=d;break;case 0:case 11:case 14:case 15:Ma(2,o,a),mt||Ma(4,o,a),Gs(n,a,o);break;case 1:mt||(On(o,a),l=o.stateNode,typeof l.componentWillUnmount=="function"&&IT(o,a,l)),Gs(n,a,o);break;case 21:Gs(n,a,o);break;case 22:mt=(l=mt)||o.memoizedState!==null,Gs(n,a,o),mt=l;break;case 30:On(o,a),Gs(n,a,o);break;case 7:mt||On(o,a),Gs(n,a,o);break;default:Gs(n,a,o)}}function qT(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{fc(n)}catch(o){Tt(a,a.return,o)}}}function ZT(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{fc(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 VT),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new VT),a;default:throw Error(r(435,n.tag))}}function gf(n,a){var o=kx(n);a.forEach(function(l){if(!o.has(l)){o.add(l);var d=Bx.bind(null,n,l);l.then(d,d)}})}function Vn(n,a,o){var l=a.deletions;if(l!==null)for(var d=0;d<l.length;d++){var h=l[d],v=n,_=a,B=_;e:for(;B!==null;){switch(B.tag){case 27:if(Va(B.type)){Bt=B.stateNode,Kn=!1;break e}break;case 5:Bt=B.stateNode,Kn=!1;break e;case 3:case 4:Bt=B.stateNode.containerInfo,Kn=!0;break e}B=B.return}if(Bt===null)throw Error(r(160));HT(v,_,h),Bt=null,Kn=!1,v=h.alternate,v!==null&&(v.return=null),h.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)YT(a,n,o),a=a.sibling}var Fs=null;function YT(n,a,o){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(d&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}Vn(a,n,o),Pn(n),d&4&&(Ma(3,n,n.return),Gl(3,n),Ma(5,n,n.return));break;case 1:Vn(a,n,o),Pn(n),d&512&&(mt||l===null||On(l,l.return)),d&64&&gn&&(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=Fs,Vn(a,n,o),Pn(n),d&512&&(mt||l===null||On(l,l.return)),d&4)if(d=l!==null?l.memoizedState:null,o=n.memoizedState,l===null)if(o===null)if(n.stateNode===null)if(gn)n.stateNode=I2(n.type,n.memoizedProps,a.containerInfo,n);else{e:{a=n.type,o=n.memoizedProps,d=h.ownerDocument||h;t:switch(a){case"title":l=d.getElementsByTagName("title")[0],(!l||l[yl]||l[Sn]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=d.createElement(a),d.head.insertBefore(l,d.querySelector("head > title"))),Nn(l,a,o),l[Sn]=n,pn(l),a=l;break e;case"link":if(h=tE("link","href",d).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=d.createElement(a),Nn(l,a,o),d.head.appendChild(l);break;case"meta":if(h=tE("meta","content",d).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=d.createElement(a),Nn(l,a,o),d.head.appendChild(l);break;default:throw Error(r(468,a))}l[Sn]=n,pn(l),a=l}n.stateNode=a}else gn||_0(h,n.type,n.stateNode);else n.stateNode=eE(h,o,n.memoizedProps);else d!==o?(d===null?(a=l.stateNode,a===null||mt||a.parentNode.removeChild(a)):d.count--,o===null?gn||_0(h,n.type,n.stateNode):eE(h,o,n.memoizedProps)):o===null&&n.stateNode!==null&&xg(n,n.memoizedProps,l.memoizedProps);break;case 27:Vn(a,n,o),Pn(n),d&512&&(mt||l===null||On(l,l.return)),l!==null&&d&4&&xg(n,n.memoizedProps,l.memoizedProps);break;case 5:if(h=dr,dr=!1,Vn(a,n,o),dr=h,Pn(n),d&512&&(mt||l===null||On(l,l.return)),n.flags&32){a=n.stateNode;try{xo(a,""),dt=!0}catch(oe){Tt(n,n.return,oe)}}d&4&&n.stateNode!=null&&(a=n.memoizedProps,xg(n,a,l!==null?l.memoizedProps:a)),d&1024&&(Bg=!0);break;case 6:if(Vn(a,n,o),Pn(n),d&4){if(n.stateNode===null)throw Error(r(162));a=n.memoizedProps,o=n.stateNode;try{o.nodeValue=a,dt=!0}catch(oe){Tt(n,n.return,oe)}}break;case 3:if(dt=!1,If=null,h=Fs,Fs=eu(a.containerInfo),Vn(a,n,o),Fs=h,Pn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{fc(a.containerInfo)}catch(oe){Tt(n,n.return,oe)}Bg&&(Bg=!1,WT(n)),dt=!1;break;case 4:d=dr,dr=gn,l=m1(),h=Fs,Fs=eu(n.stateNode.containerInfo),Vn(a,n,o),Pn(n),Fs=h,dt&&Hl&&(pf=!0),dt=l,dr=d;break;case 12:Vn(a,n,o),Pn(n);break;case 31:Vn(a,n,o),Pn(n),d&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,gf(n,a)));break;case 13:Vn(a,n,o),Pn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(bf=Ln()),d&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,gf(n,a)));break;case 22:h=n.memoizedState!==null,v=l!==null&&l.memoizedState!==null;var _=gn,B=mt,ne=dr;gn=_||h,dr=ne||h,mt=B||v,Vn(a,n,o),mt=B,dr=ne,gn=_,Pn(n),d&8192&&(a=n.stateNode,a._visibility=h?a._visibility&-2:a._visibility|1,!h||l===null||v||gn||mt||(a=v||mt,o=gn,l=mt,gn=h||gn,mt=a,Da(n,2),gn=o,mt=l),!h&&dr||zg(n,h)),d&4&&(a=n.updateQueue,a!==null&&(o=a.retryQueue,o!==null&&(a.retryQueue=null,gf(n,o))));break;case 19:Vn(a,n,o),Pn(n),d&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,gf(n,a)));break;case 30:d&512&&(mt||l===null||On(l,l.return)),d=m1(),h=Hl,v=(o&335544064)===o,_=n.memoizedProps,Hl=v&&Lr(_.default,_.update)!=="none",Vn(a,n,o),Pn(n),v&&l!==null&&dt&&(n.flags|=4),Hl=h,dt=d;break;case 21:break;case 7:d&512&&(mt||l===null||On(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=n);default:Vn(a,n,o),Pn(n)}}function Pn(n){var a=n.flags;if(a&2){try{for(var o,l=n.return;l!==null;){if(jT(l)){o=l;break}l=l.return}l=null;for(var d=n.return;d!==null;){if(Og(d)){var h=d.stateNode;l===null?l=[h]:l.push(h)}if(Ag(d))break;d=d.return}var v=l;if(o==null)throw Error(r(160));switch(o.tag){case 27:var _=o.stateNode,B=Cg(n);uf(n,B,_,v);break;case 5:var ne=o.stateNode;o.flags&32&&(xo(ne,""),o.flags&=-33);var oe=Cg(n);uf(n,oe,ne,v);break;case 3:case 4:var ge=o.stateNode.containerInfo,Q=Cg(n);Ig(n,Q,ge,v);break;default:throw Error(r(161))}}catch(re){Tt(n,n.return,re)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function WT(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;WT(a),a.tag===5&&a.flags&1024&&(a=a.stateNode,dc=!0,a.reset(),dc=!1),n=n.sibling}}function Yo(n,a){if(a.subtreeFlags&9270)for(a=a.child;a!==null;)XT(a,n),a=a.sibling;else $T(a)}function XT(n,a){var o=n.alternate;if(o===null)Rg(n,!1);else switch(n.tag){case 3:if(Lg=fr=!1,UT(),Yo(a,n),!fr&&!pf){if(n=lr,n!==null)for(var l=0;l<n.length;l+=3){o=n[l];var d=n[l+1];B2(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("+d+")"})}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"})),Lg=!0}lr=null;break;case 5:Yo(a,n);break;case 4:l=fr,fr=!1,Yo(a,n),fr&&(pf=!0),fr=l;break;case 22:n.memoizedState===null&&(o.memoizedState!==null?Rg(n,!1):Yo(a,n));break;case 30:l=fr,d=UT(),fr=!1,Yo(a,n),fr&&(n.flags|=4);var h=n.memoizedProps,v=n.stateNode;a=Br(h,v),v=Br(o.memoizedProps,v);var _=Lr(h.default,h.update);_==="none"?a=!1:(h=o.memoizedState,o.memoizedState=null,o=n.child,Jn=0,a=Ug(n,o,a,v,_,h,!0),Jn!==(h===null?0:h.length)&&(n.flags|=32)),(n.flags&4)!==0&&a?(tc(n,n.memoizedProps.onUpdate),lr=d):d!==null&&(d.push.apply(d,lr),lr=d),fr=(n.flags&32)!==0?!0:l;break;default:Yo(a,n)}}function hr(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)PT(n,a.alternate,a),a=a.sibling}function Da(n,a){for(n=n.child;n!==null;){var o=n,l=a;switch(o.tag){case 0:case 11:case 14:case 15:Ma(4,o,o.return),Da(o,l);break;case 1:On(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&IT(o,o.return,d),Da(o,l);break;case 27:(l&2)!==0&&W2(o.stateNode,o.type,o.memoizedProps);case 5:On(o,o.return),o.tag!==5&&o.tag!==27||Fl(o),Da(o,l);break;case 6:Fl(o);break;case 26:On(o,o.return),d=o.stateNode,o.memoizedState!==null||d===null||mt||d.parentNode.removeChild(d),Da(o,l);break;case 22:o.memoizedState===null&&Da(o,l);break;case 30:On(o,o.return),Da(o,l);break;case 7:On(o,o.return);default:Da(o,l)}n=n.sibling}}function Hs(n,a,o){for(o=(a.subtreeFlags&8772)!==0?o:o&-2,a=a.child;a!==null;){var l=a.alternate,d=n,h=a,v=h.flags,_=(o&1)!==0;switch(h.tag){case 0:case 11:case 15:Hs(d,h,o),Gl(4,h);break;case 1:if(Hs(d,h,o),l=h,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(oe){Tt(l,l.return,oe)}if(l=h,d=l.updateQueue,d!==null){var B=l.stateNode;try{var ne=d.shared.hiddenCallbacks;if(ne!==null)for(d.shared.hiddenCallbacks=null,d=0;d<ne.length;d++)vw(ne[d],B)}catch(oe){Tt(l,l.return,oe)}}_&&v&64&&CT(h),cr(h,h.return);break;case 27:(o&2)!==0&&MT(h);case 5:h.tag!==5&&h.tag!==27||RT(h),Hs(d,h,o),_&&l===null&&v&4&&Ng(h),cr(h,h.return);break;case 6:RT(h);break;case 26:B=h.stateNode,h.memoizedState!==null||B===null||gn||_0(eu(B.ownerDocument),h.type,B),Hs(d,h,o),_&&l===null&&v&4&&Ng(h),cr(h,h.return);break;case 12:Hs(d,h,o);break;case 31:Hs(d,h,o),_&&v&4&&qT(d,h);break;case 13:Hs(d,h,o),_&&v&4&&ZT(d,h);break;case 22:h.memoizedState===null&&Hs(d,h,o),cr(h,h.return);break;case 30:Hs(d,h,o),cr(h,h.return);break;case 7:cr(h,h.return);default:Hs(d,h,o)}a=a.sibling}}function Vg(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&&Cl(o))}function Pg(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&Cl(n))}function Cs(n,a,o,l){var d=(o&335544064)===o;if(a.subtreeFlags&(d?10262:10256))for(a=a.child;a!==null;)JT(n,a,o,l),a=a.sibling;else d&&zT(a)}function JT(n,a,o,l){var d=(o&335544064)===o;d&&a.alternate===null&&a.return!==null&&a.return.alternate!==null&&hf(a);var h=a.flags;switch(a.tag){case 0:case 11:case 15:Cs(n,a,o,l),h&2048&&Gl(9,a);break;case 1:Cs(n,a,o,l);break;case 3:Cs(n,a,o,l),d&&Lg&&(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&&Cl(h)));break;case 12:if(h&2048){Cs(n,a,o,l),h=a.stateNode;try{var v=a.memoizedProps,_=v.id,B=v.onPostCommit;typeof B=="function"&&B(_,a.alternate===null?"mount":"update",h.passiveEffectDuration,-0)}catch(ne){Tt(a,a.return,ne)}}else Cs(n,a,o,l);break;case 31:Cs(n,a,o,l);break;case 13:Cs(n,a,o,l);break;case 23:break;case 22:v=a.stateNode,_=a.alternate,a.memoizedState!==null?(d&&_!==null&&_.memoizedState===null&&hf(_),v._visibility&2?Cs(n,a,o,l):ql(n,a)):(d&&_!==null&&_.memoizedState!==null&&hf(a),v._visibility&2?Cs(n,a,o,l):(v._visibility|=2,Wo(n,a,o,l,(a.subtreeFlags&10256)!==0||!1))),h&2048&&Vg(_,a);break;case 24:Cs(n,a,o,l),h&2048&&Pg(a.alternate,a);break;case 30:d&&(h=a.alternate,h!==null&&(ur(h.child,!0),ur(a.child,!0))),Cs(n,a,o,l);break;default:Cs(n,a,o,l)}}function Wo(n,a,o,l,d){for(d=d&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var h=n,v=a,_=o,B=l,ne=v.flags;switch(v.tag){case 0:case 11:case 15:Wo(h,v,_,B,d),Gl(8,v);break;case 23:break;case 22:var oe=v.stateNode;v.memoizedState!==null?oe._visibility&2?Wo(h,v,_,B,d):ql(h,v):(oe._visibility|=2,Wo(h,v,_,B,d)),d&&ne&2048&&Vg(v.alternate,v);break;case 24:Wo(h,v,_,B,d),d&&ne&2048&&Pg(v.alternate,v);break;default:Wo(h,v,_,B,d)}a=a.sibling}}function ql(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var o=n,l=a,d=l.flags;switch(l.tag){case 22:ql(o,l),d&2048&&Vg(l.alternate,l);break;case 24:ql(o,l),d&2048&&Pg(l.alternate,l);break;default:ql(o,l)}a=a.sibling}}var Li=8192;function zi(n,a,o){if(n.subtreeFlags&Li)for(n=n.child;n!==null;)KT(n,a,o),n=n.sibling}function KT(n,a,o){switch(n.tag){case 26:zi(n,a,o),n.flags&Li&&(n.memoizedState!==null?IC(o,Fs,n.memoizedState,n.memoizedProps):(n=n.stateNode,(a&335544128)===a&&aE(o,n)));break;case 5:zi(n,a,o),n.flags&Li&&(n=n.stateNode,(a&335544128)===a&&aE(o,n));break;case 3:case 4:var l=Fs;Fs=eu(n.stateNode.containerInfo),zi(n,a,o),Fs=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=Li,Li=16777216,zi(n,a,o),Li=l):zi(n,a,o));break;case 30:if((n.flags&Li)!==0&&(l=n.memoizedProps.name,l!=null&&l!=="auto")){var d=n.stateNode;d.paired=null,ds===null&&(ds=new Map),ds.set(l,d)}zi(n,a,o);break;default:zi(n,a,o)}}function QT(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 Zl(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];yn=l,t2(l,n)}QT(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)e2(n),n=n.sibling}function e2(n){switch(n.tag){case 0:case 11:case 15:Zl(n),n.flags&2048&&Ma(9,n,n.return);break;case 3:Zl(n);break;case 12:Zl(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,yf(n)):Zl(n);break;default:Zl(n)}}function yf(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];yn=l,t2(l,n)}QT(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:Ma(8,a,a.return),yf(a);break;case 22:o=a.stateNode,o._visibility&2&&(o._visibility&=-3,yf(a));break;default:yf(a)}n=n.sibling}}function t2(n,a){for(;yn!==null;){var o=yn;switch(o.tag){case 0:case 11:case 15:Ma(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:Cl(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,yn=l;else e:for(o=n;yn!==null;){l=yn;var d=l.sibling,h=l.return;if(FT(l),l===o){yn=null;break e}if(d!==null){d.return=h,yn=d;break e}yn=h}}}var Ax={getCacheForType:function(n){var a=_n(Jt),o=a.data.get(n);return o===void 0&&(o=n(),a.data.set(n,o)),o},cacheSignal:function(){return _n(Jt).controller.signal}},Ox=typeof WeakMap=="function"?WeakMap:Map,ht=0,Nt=null,et=null,it=0,wt=0,fs=null,Ua=!1,Xo=!1,Gg=!1,Zr=0,Gt=0,Ba=0,$i=0,vf=0,hs=0,Jo=0,Yl=null,Qn=null,Fg=!1,bf=0,n2=0,wf=1/0,Tf=null,La=null,Lt=0,qs=null,Vi=null,pr=0,Hg=0,qg=null,s2=null,Ko=null,Qo=null,ec=null,Wl=0,Ef=null;function ps(){return(ht&2)!==0&&it!==0?it&-it:be.T!==null?n0():i1()}function r2(){if(hs===0)if((it&536870912)===0||Ke){var n=md;md<<=1,(md&3932160)===0&&(md=262144),hs=n}else hs=536870912;return n=kn.current,n!==null&&(n.flags|=32),hs}function tc(n,a){if(a!=null){var o=n.stateNode,l=o.ref;l===null&&(l=o.ref=L2(Br(n.memoizedProps,o))),Qo===null&&(Qo=[]),Qo.push(a.bind(null,l))}}function es(n,a,o){(n===Nt&&(wt===2||wt===9)||n.cancelPendingCommit!==null)&&(nc(n,0),za(n,it,hs,!1)),gl(n,o),((ht&2)===0||n!==Nt)&&(n===Nt&&((ht&2)===0&&($i|=o),Gt===4&&za(n,it,hs,!1)),mr(n))}function a2(n,a,o){if((ht&6)!==0)throw Error(r(327));var l=!o&&(a&127)===0&&(a&n.expiredLanes)===0||ml(n,a),d=l?Cx(n,a):Yg(n,a,!0),h=l;do{if(d===0){Xo&&!l&&za(n,a,0,!1);break}else{if(o=n.current.alternate,h&&!Nx(o)){d=Yg(n,a,!1),h=!1;continue}if(d===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;d=Yl;var B=_.current.memoizedState.isDehydrated;if(B&&(nc(_,v).flags|=256),v=Yg(_,v,!1),v!==2&&v!==6){if(Gg&&!B){_.errorRecoveryDisabledLanes|=h,$i|=h,d=4;break e}h=Qn,Qn=d,h!==null&&(Qn===null?Qn=h:Qn.push.apply(Qn,h))}d=v}if(h=!1,d!==2)continue}}if(d===1){nc(n,0),za(n,a,0,!0);break}e:{switch(l=n,h=d,h){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a&&(a&62914560)!==a)break;case 6:za(l,a,hs,!Ua);break e;case 2:Qn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(d=bf+300-Ln(),10<d)){if(za(l,a,hs,!Ua),yd(l,0,!0)!==0)break e;pr=a,l.timeoutHandle=h0(i2.bind(null,l,o,Qn,Tf,Fg,a,hs,$i,Jo,Ua,h,"Throttled",-0,0),d);break e}i2(l,o,Qn,Tf,Fg,a,hs,$i,Jo,Ua,h,null,-0,0)}}break}while(!0);mr(n)}function i2(n,a,o,l,d,h,v,_,B,ne,oe,ge,Q,re){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:ar},ds=null,KT(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=su.bind(ke),Re.finished.then(ke,ke))),ke=(h&62914560)===h?bf-Ln():(h&4194048)===h?n2-Ln():0,ke=RC(ge,ke),ke!==null)){pr=h,n.cancelPendingCommit=ke(p2.bind(null,n,a,h,o,l,d,v,_,B,ne,oe,ge,null,Q,re)),za(n,h,v,!ne);return}p2(n,a,h,o,l,d,v,_,B,ne,oe,ge)}function Nx(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 d=o[l],h=d.getSnapshot;d=d.value;try{if(!ls(h(),d))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 za(n,a,o,l){a=t1(n,a),a&=~vf,a&=~$i,n.suspendedLanes|=a,n.pingedLanes&=~a,l&&(n.warmLanes|=a),l=n.expirationTimes;for(var d=a;0<d;){var h=31-os(d),v=1<<h;l[h]=-1,d&=~v}o!==0&&s1(n,o,a)}function Sf(){return(ht&6)===0?(Xl(0),!1):!0}function Zg(){if(et!==null){if(wt===0)var n=et.return;else n=et,Vr=Ni=null,tg(n),Po=null,jl=0,n=et;for(;n!==null;)xT(n.alternate,n),n=n.return;et=null}}function nc(n,a){var o=n.timeoutHandle;return o!==-1&&(n.timeoutHandle=-1,Kx(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),pr=0,Zg(),Nt=n,et=o=zr(n.current,null),it=a,wt=0,fs=null,Ua=!1,Xo=ml(n,a),Gg=!1,Jo=hs=vf=$i=Ba=Gt=0,Qn=Yl=null,Fg=!1,Zr=t1(n,a),Cd(),o}function o2(n,a){We=null,be.H=tf,a===Vo||a===Vd?(a=pw(),wt=3):a===Pm?(a=pw(),wt=4):wt=a===gg?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,fs=a,et===null&&(Gt=1,nf(n,As(a,n.current)))}function c2(){var n=kn.current;return n===null?!0:(it&4194048)===it?Mn===null:(it&62914560)===it||(it&536870912)!==0?n===Mn:!1}function l2(){var n=be.H;return be.H=tf,n===null?tf:n}function u2(){var n=be.A;return be.A=Ax,n}function _f(){Gt=4,Ua||(it&4194048)!==it&&kn.current!==null||(Xo=!0),(Ba&134217727)===0&&($i&134217727)===0||Nt===null||za(Nt,it,hs,!1)}function Yg(n,a,o){var l=ht;ht|=2;var d=l2(),h=u2();(Nt!==n||it!==a)&&(Tf=null,nc(n,a)),a=!1;var v=Gt;e:do try{if(wt!==0&&et!==null){var _=et,B=fs;switch(wt){case 8:Zg(),v=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(a=!0);var ne=wt;if(wt=0,fs=null,sc(n,_,B,ne),o&&Xo){v=0;break e}break;default:ne=wt,wt=0,fs=null,sc(n,_,B,ne)}}xx(),v=Gt;break}catch(oe){o2(n,oe)}while(!0);return a&&n.shellSuspendCounter++,Vr=Ni=null,ht=l,be.H=d,be.A=h,et===null&&(Nt=null,it=0,Cd()),v}function xx(){for(;et!==null;)d2(et)}function Cx(n,a){var o=ht;ht|=2;var l=l2(),d=u2();Nt!==n||it!==a?(Tf=null,wf=Ln()+500,nc(n,a)):Xo=ml(n,a);e:do try{if(wt!==0&&et!==null){a=et;var h=fs;t:switch(wt){case 1:wt=0,fs=null,sc(n,a,h,1);break;case 2:case 9:if(fw(h)){wt=0,fs=null,f2(a);break}a=function(){wt!==2&&wt!==9||Nt!==n||(wt=7),mr(n)},h.then(a,a);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:fw(h)?(wt=0,fs=null,f2(a)):(wt=0,fs=null,sc(n,a,h,7));break;case 5:var v=null;switch(et.tag){case 26:v=et.memoizedState;case 5:case 27:var _=et;if(v?sE(v):_.stateNode.complete){wt=0,fs=null;var B=_.sibling;if(B!==null)et=B;else{var ne=_.return;ne!==null?(et=ne,kf(ne)):et=null}break t}}wt=0,fs=null,sc(n,a,h,5);break;case 6:wt=0,fs=null,sc(n,a,h,6);break;case 8:Zg(),Gt=6;break e;default:throw Error(r(462))}}Ix();break}catch(oe){o2(n,oe)}while(!0);return Vr=Ni=null,be.H=l,be.A=d,ht=o,et!==null?0:(Nt=null,it=0,Cd(),Gt)}function Ix(){for(;et!==null&&!tm();)d2(et)}function d2(n){var a=OT(n.alternate,n,Zr);n.memoizedProps=n.pendingProps,a===null?kf(n):et=a}function f2(n){var a=n,o=a.alternate;switch(a.tag){case 15:case 0:a=wT(o,a,a.pendingProps,a.type,void 0,it);break;case 11:a=wT(o,a,a.pendingProps,a.type.render,a.ref,it);break;case 5:tg(a);var l=a;l===mn&&(Ke?(Ud(l),l.tag===5&&l.stateNode!=null&&(It=l.stateNode)):(Ud(l),Ke=!0));default:xT(o,a),a=et=tw(a,Zr),a=OT(o,a,Zr)}n.memoizedProps=n.pendingProps,a===null?kf(n):et=a}function sc(n,a,o,l){Vr=Ni=null,tg(a),Po=null,jl=0;var d=a.return;try{if(vx(n,d,a,o,it)){Gt=1,nf(n,As(o,n.current)),et=null;return}}catch(h){if(d!==null)throw et=d,h;Gt=1,nf(n,As(o,n.current)),et=null;return}a.flags&32768?(Ke||l===1?n=!0:Xo||(it&536870912)!==0?n=!1:(Ua=n=!0,(l===2||l===9||l===3||l===6)&&(l=kn.current,l!==null&&l.tag===13&&(l.flags|=16384))),h2(a,n)):kf(a)}function kf(n){var a=n;do{if((a.flags&32768)!==0){h2(a,Ua);return}n=a.return;var o=Ex(a.alternate,a,Zr);if(o!==null){et=o;return}if(a=a.sibling,a!==null){et=a;return}et=a=n}while(a!==null);Gt===0&&(Gt=5)}function h2(n,a){do{var o=Sx(n.alternate,n);if(o!==null){o.flags&=32767,et=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!a&&(n=n.sibling,n!==null)){et=n;return}et=n=o}while(n!==null);Gt=6,et=null}function p2(n,a,o,l,d,h,v,_,B,ne,oe,ge){n.cancelPendingCommit=null;do Af();while(Lt!==0);if((ht&6)!==0)throw Error(r(327));if(a!==null){if(a===n.current)throw Error(r(177));n===Nt&&(et=Nt=null,it=0),Vi=a,qs=n,pr=o,qg=d,s2=l,Rx(n,a,o,v,_,B,ge)}}function Rx(n,a,o,l,d,h,v){var _=a.lanes|a.childLanes;if(Hg=_,_|=xm,rN(n,o,_,l,d,h),Qo=null,(o&335544064)===o?(ec=ix(n),l=10262):(ec=null,l=10256),(a.subtreeFlags&l)!==0||(a.flags&l)!==0?(n.callbackNode=null,n.callbackPriority=0,Lx(Ye,function(){return Kg(),null})):(n.callbackNode=null,n.callbackPriority=0),df=!1,l=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||l){l=be.T,be.T=null,d=_e.p,_e.p=2,h=ht,ht|=4;try{_x(n,a,o)}finally{ht=h,_e.p=d,be.T=l}}Lt=1,df?Ko=rC(v,n.containerInfo,ec,Wg,Xg,Mx,Jg,Kg,jx):(Wg(),Xg(),Jg())}function jx(n){if(Lt!==0){var a=qs.onRecoverableError;a(n,{componentStack:null})}}function Mx(){Lt===3&&(Lt=0,XT(Vi,qs),Lt=4)}function Wg(){if(Lt===1){Lt=0;var n=qs,a=Vi,o=pr,l=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||l){l=be.T,be.T=null;var d=_e.p;_e.p=2;var h=ht;ht|=4;try{Hl=pf=!1,YT(a,n,o),o=u0;var v=H1(n.containerInfo),_=o.focusedElem,B=o.selectionRange;if(v!==_&&_&&_.ownerDocument&&F1(_.ownerDocument.documentElement,_)){if(B!==null&&_m(_)){var ne=B.start,oe=B.end;if(oe===void 0&&(oe=ne),"selectionStart"in _)_.selectionStart=ne,_.selectionEnd=Math.min(oe,_.value.length);else{var ge=_.ownerDocument||document,Q=ge&&ge.defaultView||window;if(Q.getSelection){var re=Q.getSelection(),ke=_.textContent.length,Re=Math.min(B.start,ke),Xe=B.end===void 0?Re:Math.min(B.end,ke);!re.extend&&Re>Xe&&(v=Xe,Xe=Re,Re=v);var ee=G1(_,Re),q=G1(_,Xe);if(ee&&q&&(re.rangeCount!==1||re.anchorNode!==ee.node||re.anchorOffset!==ee.offset||re.focusNode!==q.node||re.focusOffset!==q.offset)){var se=ge.createRange();se.setStart(ee.node,ee.offset),re.removeAllRanges(),Re>Xe?(re.addRange(se),re.extend(q.node,q.offset)):(se.setEnd(q.node,q.offset),re.addRange(se))}}}}for(ge=[],re=_;re=re.parentNode;)re.nodeType===1&&ge.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ge.length;_++){var me=ge[_];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}dc=!!l0,u0=l0=null}finally{ht=h,_e.p=d,be.T=l}}n.current=a,Lt=2}}function Xg(){if(Lt===2){Lt=0;var n=qs,a=Vi,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 d=ht;ht|=4;try{PT(n,a.alternate,a)}finally{ht=d,_e.p=l,be.T=o}}Lt=3}}function Jg(){if(Lt===4||Lt===3){Lt=0;var n=Ko;Ko=null,nm();var a=qs,o=Vi,l=pr,d=s2,h=(l&335544064)===l?10262:10256;if((o.subtreeFlags&h)!==0||(o.flags&h)!==0?Lt=5:(Lt=0,Vi=qs=null,m2(a,a.pendingLanes)),h=a.pendingLanes,h===0&&(La=null),im(l),o=o.stateNode,is&&typeof is.onCommitFiberRoot=="function")try{is.onCommitFiberRoot(pl,o,void 0,(o.current.flags&128)===128)}catch{}if(d!==null){o=be.T,h=_e.p,_e.p=2,be.T=null;try{for(var v=a.onRecoverableError,_=0;_<d.length;_++){var B=d[_];v(B.value,{componentStack:B.stack})}}finally{be.T=o,_e.p=h}}if(d=Qo,v=ec,ec=null,d!==null&&(Qo=null,v===null&&(v=[]),n!==null))for(B=0;B<d.length;B++)o=(0,d[B])(v),o!==void 0&&n.finished.finally(o);(pr&3)!==0&&Af(),mr(a),h=a.pendingLanes,(l&261930)!==0&&(h&42)!==0?a===Ef?Wl++:(Wl=0,Ef=a):(Wl=0,Ef=null),Xl(0)}}function m2(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,Cl(a)))}function Af(){return Ko!==null&&(Ko.skipTransition(),Ko=null),Wg(),Xg(),Jg(),Kg()}function Kg(){if(Lt!==5)return!1;var n=qs,a=Hg;Hg=0;var o=im(pr),l=be.T,d=_e.p;try{_e.p=32>o?32:o,be.T=null,o=qg,qg=null;var h=qs,v=pr;if(Lt=0,Vi=qs=null,pr=0,(ht&6)!==0)throw Error(r(331));var _=ht;if(ht|=4,e2(h.current),JT(h,h.current,v,o),ht=_,Xl(0,!1),is&&typeof is.onPostCommitFiberRoot=="function")try{is.onPostCommitFiberRoot(pl,h)}catch{}return!0}finally{_e.p=d,be.T=l,m2(n,a)}}function g2(n,a,o){a=As(o,a),a=mg(n.stateNode,a,2),n=Ca(n,a,2),n!==null&&(gl(n,2),mr(n))}function Tt(n,a,o){if(n.tag===3)g2(n,n,o);else for(;a!==null;){if(a.tag===3){g2(a,n,o);break}else if(a.tag===1){var l=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(La===null||!La.has(l))){n=As(o,n),o=fT(2),l=Ca(a,o,2),l!==null&&(hT(o,l,a,n),gl(l,2),mr(l));break}}a=a.return}}function Qg(n,a,o){var l=n.pingCache;if(l===null){l=n.pingCache=new Ox;var d=new Set;l.set(a,d)}else d=l.get(a),d===void 0&&(d=new Set,l.set(a,d));d.has(o)||(Gg=!0,d.add(o),n=Dx.bind(null,n,a,o),a.then(n,n))}function Dx(n,a,o){var l=n.pingCache;l!==null&&l.delete(a),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,Nt===n&&(it&o)===o&&((Gt===4||Gt===3&&(it&62914560)===it&&300>Ln()-bf)&&(ht&2)===0?nc(n,0):vf|=o,Jo===it&&(Jo=0)),mr(n)}function y2(n,a){a===0&&(a=n1()),n=ki(n,a),n!==null&&(gl(n,a),mr(n))}function Ux(n){var a=n.memoizedState,o=0;a!==null&&(o=a.retryLane),y2(n,o)}function Bx(n,a){var o=0;switch(n.tag){case 31:case 13:var l=n.stateNode,d=n.memoizedState;d!==null&&(o=d.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),y2(n,o)}function Lx(n,a){return hl(n,a)}var rc=null,ac=null,e0=!1,Of=!1,t0=!1,$a=0;function mr(n){n!==ac&&n.next===null&&(ac===null?rc=ac=n:ac=ac.next=n),Of=!0,e0||(e0=!0,$x())}function Xl(n,a){if(!t0&&Of){t0=!0;do for(var o=!1,l=rc;l!==null;){if(n!==0){var d=l.pendingLanes;if(d===0)var h=0;else{var v=l.suspendedLanes,_=l.pingedLanes;h=(1<<31-os(42|n)+1)-1,h&=d&~(v&~_),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(o=!0,T2(l,h))}else h=it,h=yd(l,l===Nt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||ml(l,h)||(o=!0,T2(l,h));l=l.next}while(o);t0=!1}}function zx(){v2()}function v2(){Of=e0=!1;var n=0;$a!==0&&Jx()&&(n=$a);for(var a=Ln(),o=null,l=rc;l!==null;){var d=l.next,h=b2(l,a);h===0?(l.next=null,o===null?rc=d:o.next=d,d===null&&(ac=o)):(o=l,(n!==0||(h&3)!==0)&&(Of=!0)),l=d}Lt!==0&&Lt!==5||Xl(n),$a!==0&&($a=0)}function b2(n,a){for(var o=n.suspendedLanes,l=n.pingedLanes,d=n.expirationTimes,h=n.pendingLanes&-62914561;0<h;){var v=31-os(h),_=1<<v,B=d[v];B===-1?((_&o)===0||(_&l)!==0)&&(d[v]=sN(_,a)):B<=a&&(n.expiredLanes|=_),h&=~_}if(a=Nt,o=it,o=yd(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&&ba(l),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||ml(n,o)){if(a=o&-o,a===n.callbackPriority)return a;switch(l!==null&&ba(l),im(o)){case 2:case 8:o=Ce;break;case 32:o=Ye;break;case 268435456:o=Ss;break;default:o=Ye}return l=w2.bind(null,n),o=hl(o,l),n.callbackPriority=a,n.callbackNode=o,a}return l!==null&&l!==null&&ba(l),n.callbackPriority=2,n.callbackNode=null,2}function w2(n,a){if(Lt!==0&&Lt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(Af()&&n.callbackNode!==o)return null;var l=it;return l=yd(n,n===Nt?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(a2(n,l,a),b2(n,Ln()),n.callbackNode!=null&&n.callbackNode===o?w2.bind(null,n):null)}function T2(n,a){if(Af())return null;a2(n,a,!0)}function $x(){Qx(function(){(ht&6)!==0?hl(hd,zx):v2()})}function n0(){if($a===0){var n=Ii;n===0&&(n=pd,pd<<=1,(pd&261888)===0&&(pd=256)),$a=n}return $a}function E2(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ed(n)}function Vx(n,a,o,l,d){if(a==="submit"&&o&&o.stateNode===d){var h=E2((d[Wn]||null).action),v=l.submitter;v&&(a=(a=v[Wn]||null)?E2(a.formAction):v.getAttribute("formAction"),a!==null&&(h=a,v=null));var _=new Ad("action","action",null,l,d);n.push({event:_,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if($a!==0){var B=new FormData(d,v);ug(o,{pending:!0,data:B,method:d.method,action:h},null,B)}}else typeof h=="function"&&(_.preventDefault(),B=new FormData(d,v),ug(o,{pending:!0,data:B,method:d.method,action:h},h,B))},currentTarget:d}]})}}for(var s0=0;s0<Nm.length;s0++){var r0=Nm[s0],Px=r0.toLowerCase(),Gx=r0[0].toUpperCase()+r0.slice(1);Ps(Px,"on"+Gx)}Ps(Y1,"onAnimationEnd"),Ps(W1,"onAnimationIteration"),Ps(X1,"onAnimationStart"),Ps("dblclick","onDoubleClick"),Ps("focusin","onFocus"),Ps("focusout","onBlur"),Ps(KN,"onTransitionRun"),Ps(QN,"onTransitionStart"),Ps(ex,"onTransitionCancel"),Ps(J1,"onTransitionEnd"),Oo("onMouseEnter",["mouseout","mouseover"]),Oo("onMouseLeave",["mouseout","mouseover"]),Oo("onPointerEnter",["pointerout","pointerover"]),Oo("onPointerLeave",["pointerout","pointerover"]),Ei("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ei("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ei("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ei("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jl="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(" "),Fx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jl));function S2(n,a){a=(a&4)!==0;for(var o=0;o<n.length;o++){var l=n[o],d=l.event;l=l.listeners;e:{var h=void 0;if(a)for(var v=l.length-1;0<=v;v--){var _=l[v],B=_.instance,ne=_.currentTarget;if(_=_.listener,B!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=ne;try{h(d)}catch(oe){xd(oe)}d.currentTarget=null,h=B}else for(v=0;v<l.length;v++){if(_=l[v],B=_.instance,ne=_.currentTarget,_=_.listener,B!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=ne;try{h(d)}catch(oe){xd(oe)}d.currentTarget=null,h=B}}}}function tt(n,a){var o=a[c1];o===void 0&&(o=a[c1]=new Set);var l=n+"__bubble";o.has(l)||(_2(a,n,2,!1),o.add(l))}function a0(n,a,o){var l=0;a&&(l|=4),_2(o,n,l,a)}var Nf="_reactListening"+Math.random().toString(36).slice(2);function i0(n){if(!n[Nf]){n[Nf]=!0,d1.forEach(function(o){o!=="selectionchange"&&(Fx.has(o)||a0(o,!1,n),a0(o,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[Nf]||(a[Nf]=!0,a0("selectionchange",!1,a))}}function _2(n,a,o,l){switch(hE(a)){case 2:var d=UC;break;case 8:d=BC;break;default:d=A0}o=d.bind(null,a,o,n),d=void 0,!pm||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(d=!0),l?d!==void 0?n.addEventListener(a,o,{capture:!0,passive:d}):n.addEventListener(a,o,!0):d!==void 0?n.addEventListener(a,o,{passive:d}):n.addEventListener(a,o,!1)}function o0(n,a,o,l,d){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(_===d)break;if(v===4)for(v=l.return;v!==null;){var B=v.tag;if((B===3||B===4)&&v.stateNode.containerInfo===d)return;v=v.return}for(;_!==null;){if(v=Ti(_),v===null)return;if(B=v.tag,B===5||B===6||B===26||B===27){l=h=v;continue e}_=_.parentNode}}l=l.return}_1(function(){var ne=h,oe=fm(o),ge=[];e:{var Q=K1.get(n);if(Q!==void 0){var re=Ad,ke=n;switch(n){case"keypress":if(_d(o)===0)break e;case"keydown":case"keyup":re=NN;break;case"focusin":ke="focus",re=vm;break;case"focusout":ke="blur",re=vm;break;case"beforeblur":case"afterblur":re=vm;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":re=O1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=gN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=jN;break;case Y1:case W1:case X1:re=bN;break;case J1:re=DN;break;case"scroll":case"scrollend":re=pN;break;case"wheel":re=BN;break;case"copy":case"cut":case"paste":re=TN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=x1;break;case"submit":re=IN;break;case"toggle":case"beforetoggle":re=zN}var Re=(a&4)!==0,Xe=!Re&&(n==="scroll"||n==="scrollend"),ee=Re?Q!==null?Q+"Capture":null:Q;Re=[];for(var q=ne,se;q!==null;){var me=q;if(se=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||se===null||ee===null||(me=bl(q,ee),me!=null&&Re.push(Kl(q,me,se))),Xe)break;q=q.return}0<Re.length&&(Q=new re(Q,ke,null,o,oe),ge.push({event:Q,listeners:Re}))}}if((a&7)===0){e:{if(re=n==="mouseover"||n==="pointerover",Q=n==="mouseout"||n==="pointerout",re&&o!==dm&&(ke=o.relatedTarget||o.fromElement)&&(Ti(ke)||ke[_o]))break e;(Q||re)&&(ke=oe.window===oe?oe:(re=oe.ownerDocument)?re.defaultView||re.parentWindow:window,Q?(re=o.relatedTarget||o.toElement,Q=ne,re=re?Ti(re):null,re!==null&&(Xe=c(re),Re=re.tag,re!==Xe||Re!==5&&Re!==27&&Re!==6)&&(re=null)):(Q=null,re=ne),Q!==re&&(Re=O1,me="onMouseLeave",ee="onMouseEnter",q="mouse",(n==="pointerout"||n==="pointerover")&&(Re=x1,me="onPointerLeave",ee="onPointerEnter",q="pointer"),Xe=Q==null?ke:vl(Q),se=re==null?ke:vl(re),ke=new Re(me,q+"leave",Q,o,oe),ke.target=Xe,ke.relatedTarget=se,me=null,Ti(oe)===ne&&(Re=new Re(ee,q+"enter",re,o,oe),Re.target=se,Re.relatedTarget=Xe,me=Re),Xe=me,Re=Q&&re?Y(Q,re,Hx):null,Q!==null&&k2(ge,ke,Q,Re,!1),re!==null&&Xe!==null&&k2(ge,Xe,re,Re,!0)))}e:{if(Q=ne?vl(ne):window,re=Q.nodeName&&Q.nodeName.toLowerCase(),re==="select"||re==="input"&&Q.type==="file")var Ie=B1;else if(D1(Q))if(L1)Ie=WN;else{Ie=ZN;var ot=qN}else re=Q.nodeName,!re||re.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?ne&&um(ne.elementType)&&(Ie=B1):Ie=YN;if(Ie&&(Ie=Ie(n,ne))){U1(ge,Ie,o,oe);break e}ot&&ot(n,Q,ne)}switch(ot=ne?vl(ne):window,n){case"focusin":(D1(ot)||ot.contentEditable==="true")&&(jo=ot,km=ne,Ol=null);break;case"focusout":Ol=km=jo=null;break;case"mousedown":Am=!0;break;case"contextmenu":case"mouseup":case"dragend":Am=!1,q1(ge,o,oe);break;case"selectionchange":if(JN)break;case"keydown":case"keyup":q1(ge,o,oe)}var Ue;if(wm)e:{switch(n){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Ro?j1(n,o)&&($e="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&($e="onCompositionStart");$e&&(C1&&o.locale!=="ko"&&(Ro||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Ro&&(Ue=k1()):(Ta=oe,mm="value"in Ta?Ta.value:Ta.textContent,Ro=!0)),ot=xf(ne,$e),0<ot.length&&($e=new N1($e,n,null,o,oe),ge.push({event:$e,listeners:ot}),Ue?$e.data=Ue:(Ue=M1(o),Ue!==null&&($e.data=Ue)))),(Ue=VN?PN(n,o):GN(n,o))&&($e=xf(ne,"onBeforeInput"),0<$e.length&&(ot=new N1("onBeforeInput","beforeinput",null,o,oe),ge.push({event:ot,listeners:$e}),ot.data=Ue)),Vx(ge,n,ne,o,oe)}S2(ge,a)})}function Kl(n,a,o){return{instance:n,listener:a,currentTarget:o}}function xf(n,a){for(var o=a+"Capture",l=[];n!==null;){var d=n,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=bl(n,o),d!=null&&l.unshift(Kl(n,d,h)),d=bl(n,a),d!=null&&l.push(Kl(n,d,h))),n.tag===3)return l;n=n.return}return[]}function Hx(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function k2(n,a,o,l,d){for(var h=a._reactName,v=[];o!==null&&o!==l;){var _=o,B=_.alternate,ne=_.stateNode;if(_=_.tag,B!==null&&B===l)break;_!==5&&_!==26&&_!==27||ne===null||(B=ne,d?(ne=bl(o,h),ne!=null&&v.unshift(Kl(o,ne,B))):d||(ne=bl(o,h),ne!=null&&v.push(Kl(o,ne,B)))),o=o.return}v.length!==0&&n.push({event:a,listeners:v})}var qx=/\r\n?/g,Zx=/\u0000|\uFFFD/g;function A2(n){return(typeof n=="string"?n:""+n).replace(qx,`
840
+ `).replace(Zx,"")}function O2(n,a){return a=A2(a),A2(n)===a}function Et(n,a,o,l,d,h){switch(o){case"children":if(typeof l=="string")a==="body"||a==="textarea"&&l===""||xo(n,l);else if(typeof l=="number"||typeof l=="bigint")a!=="body"&&xo(n,""+l);else return;break;case"className":Td(n,"class",l);break;case"tabIndex":Td(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Td(n,o,l);break;case"style":E1(n,l,h);return;case"data":if(a!=="object"){Td(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=Ed(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"&&Et(n,a,"name",d.name,d,null),Et(n,a,"formEncType",d.formEncType,d,null),Et(n,a,"formMethod",d.formMethod,d,null),Et(n,a,"formTarget",d.formTarget,d,null)):(Et(n,a,"encType",d.encType,d,null),Et(n,a,"method",d.method,d,null),Et(n,a,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(o);break}l=Ed(l),n.setAttribute(o,l);break;case"onClick":l!=null&&(n.onclick=ar);return;case"onScroll":l!=null&&tt("scroll",n);return;case"onScrollEnd":l!=null&&tt("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(d.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=Ed(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":tt("beforetoggle",n),tt("toggle",n),wd(n,"popover",l);break;case"xlinkActuate":Dr(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Dr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Dr(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Dr(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Dr(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Dr(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Dr(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Dr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Dr(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":wd(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=fN.get(o)||o,wd(n,o,l);else return}dt=!0}function c0(n,a,o,l,d,h){switch(o){case"style":E1(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(d.children!=null)throw Error(r(60));h?.__html!==o&&(n.innerHTML=o)}}break;case"children":if(typeof l=="string")xo(n,l);else if(typeof l=="number"||typeof l=="bigint")xo(n,""+l);else return;break;case"onScroll":l!=null&&tt("scroll",n);return;case"onScrollEnd":l!=null&&tt("scrollend",n);return;case"onClick":l!=null&&(n.onclick=ar);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!f1.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(d=o.endsWith("Capture"),h=o.slice(2,d?o.length-7:void 0),a=n[Wn]||null,a=a!=null?a[o]:null,typeof a=="function"&&n.removeEventListener(h,a,d),typeof l=="function")){typeof a!="function"&&a!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(h,l,d);break e}dt=!0,o in n?n[o]=l:l===!0?n.setAttribute(o,""):wd(n,o,l)}return}dt=!0}function Nn(n,a,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",n),tt("load",n);var l=!1,d=!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":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Et(n,a,h,v,o,null)}}d&&Et(n,a,"srcSet",o.srcSet,o,null),l&&Et(n,a,"src",o.src,o,null);return;case"input":tt("invalid",n);var _=h=v=d=null,B=null,ne=null;for(l in o)if(o.hasOwnProperty(l)){var oe=o[l];if(oe!=null)switch(l){case"name":d=oe;break;case"type":v=oe;break;case"checked":B=oe;break;case"defaultChecked":ne=oe;break;case"value":h=oe;break;case"defaultValue":_=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,a));break;default:Et(n,a,l,oe,o,null)}}v1(n,h,_,B,ne,v,d,!1);return;case"select":tt("invalid",n),l=v=h=null;for(d in o)if(o.hasOwnProperty(d)&&(_=o[d],_!=null))switch(d){case"value":h=_;break;case"defaultValue":v=_;break;case"multiple":l=_;default:Et(n,a,d,_,o,null)}a=h,o=v,n.multiple=!!l,a!=null?No(n,!!l,a,!1):o!=null&&No(n,!!l,o,!0);return;case"textarea":tt("invalid",n),h=d=l=null;for(v in o)if(o.hasOwnProperty(v)&&(_=o[v],_!=null))switch(v){case"value":l=_;break;case"defaultValue":d=_;break;case"children":h=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:Et(n,a,v,_,o,null)}w1(n,l,d,h);return;case"option":for(B in o)o.hasOwnProperty(B)&&(l=o[B],l!=null)&&(B==="selected"?n.selected=l&&typeof l!="function"&&typeof l!="symbol":Et(n,a,B,l,o,null));return;case"dialog":tt("beforetoggle",n),tt("toggle",n),tt("cancel",n),tt("close",n);break;case"iframe":case"object":tt("load",n);break;case"video":case"audio":for(l=0;l<Jl.length;l++)tt(Jl[l],n);break;case"image":tt("error",n),tt("load",n);break;case"details":tt("toggle",n);break;case"embed":case"source":case"link":tt("error",n),tt("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:Et(n,a,ne,l,o,null)}return;default:if(um(a)){for(oe in o)o.hasOwnProperty(oe)&&(l=o[oe],l!==void 0&&c0(n,a,oe,l,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(l=o[_],l!=null&&Et(n,a,_,l,o,null))}var Yx={};function Wx(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 d=null,h=null,v=null,_=null,B=null,ne=null,oe=null;for(re in o){var ge=o[re];if(o.hasOwnProperty(re)&&ge!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":B=ge;default:l.hasOwnProperty(re)||Et(n,a,re,null,l,ge)}}for(var Q in l){var re=l[Q];if(ge=o[Q],l.hasOwnProperty(Q)&&(re!=null||ge!=null))switch(Q){case"type":re!==ge&&(dt=!0),h=re;break;case"name":re!==ge&&(dt=!0),d=re;break;case"checked":re!==ge&&(dt=!0),ne=re;break;case"defaultChecked":re!==ge&&(dt=!0),oe=re;break;case"value":re!==ge&&(dt=!0),v=re;break;case"defaultValue":re!==ge&&(dt=!0),_=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,a));break;default:re!==ge&&Et(n,a,Q,re,l,ge)}}cm(n,v,_,B,ne,oe,h,d);return;case"select":re=v=_=Q=null;for(h in o)if(B=o[h],o.hasOwnProperty(h)&&B!=null)switch(h){case"value":break;case"multiple":re=B;default:l.hasOwnProperty(h)||Et(n,a,h,null,l,B)}for(d in l)if(h=l[d],B=o[d],l.hasOwnProperty(d)&&(h!=null||B!=null))switch(d){case"value":h!==B&&(dt=!0),Q=h;break;case"defaultValue":h!==B&&(dt=!0),_=h;break;case"multiple":h!==B&&(dt=!0),v=h;default:h!==B&&Et(n,a,d,h,l,B)}a=_,o=v,l=re,Q!=null?No(n,!!o,Q,!1):!!l!=!!o&&(a!=null?No(n,!!o,a,!0):No(n,!!o,o?[]:"",!1));return;case"textarea":re=Q=null;for(_ in o)if(d=o[_],o.hasOwnProperty(_)&&d!=null&&!l.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Et(n,a,_,null,l,d)}for(v in l)if(d=l[v],h=o[v],l.hasOwnProperty(v)&&(d!=null||h!=null))switch(v){case"value":d!==h&&(dt=!0),Q=d;break;case"defaultValue":d!==h&&(dt=!0),re=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(r(91));break;default:d!==h&&Et(n,a,v,d,l,h)}b1(n,Q,re);return;case"option":for(var ke in o)Q=o[ke],o.hasOwnProperty(ke)&&Q!=null&&!l.hasOwnProperty(ke)&&(ke==="selected"?n.selected=!1:Et(n,a,ke,null,l,Q));for(B in l)Q=l[B],re=o[B],l.hasOwnProperty(B)&&Q!==re&&(Q!=null||re!=null)&&(B==="selected"?(Q!==re&&(dt=!0),n.selected=Q&&typeof Q!="function"&&typeof Q!="symbol"):Et(n,a,B,Q,l,re));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)&&Et(n,a,Re,null,l,Q);for(ne in l)if(Q=l[ne],re=o[ne],l.hasOwnProperty(ne)&&Q!==re&&(Q!=null||re!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,a));break;default:Et(n,a,ne,Q,l,re)}return;default:if(um(a)){for(var Xe in o)Q=o[Xe],o.hasOwnProperty(Xe)&&Q!==void 0&&!l.hasOwnProperty(Xe)&&c0(n,a,Xe,void 0,l,Q);for(oe in l)Q=l[oe],re=o[oe],!l.hasOwnProperty(oe)||Q===re||Q===void 0&&re===void 0||c0(n,a,oe,Q,l,re);return}}for(var ee in o)Q=o[ee],o.hasOwnProperty(ee)&&Q!=null&&!l.hasOwnProperty(ee)&&Et(n,a,ee,null,l,Q);for(ge in l)Q=l[ge],re=o[ge],!l.hasOwnProperty(ge)||Q===re||Q==null&&re==null||Et(n,a,ge,Q,l,re)}function N2(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xx(){if(typeof performance.getEntriesByType=="function"){for(var n=0,a=0,o=performance.getEntriesByType("resource"),l=0;l<o.length;l++){var d=o[l],h=d.transferSize,v=d.initiatorType,_=d.duration;if(h&&_&&N2(v)){for(v=0,_=d.responseEnd,l+=1;l<o.length;l++){var B=o[l],ne=B.startTime;if(ne>_)break;var oe=B.transferSize,ge=B.initiatorType;oe&&N2(ge)&&(B=B.responseEnd,v+=oe*(B<_?1:(_-ne)/(B-ne)))}if(--l,a+=8*(h+v)/(d.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 l0=null,u0=null;function Ql(n){return n.nodeType===9?n:n.ownerDocument}function x2(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 C2(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 I2(n,a,o,l){return o=Ql(o).createElement(n),o[Sn]=l,o[Wn]=a,Nn(o,n,a),pn(o),o}function d0(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 f0=null;function Jx(){var n=window.event;return n&&n.type==="popstate"?n===f0?!1:(f0=n,!0):(f0=null,!1)}var h0=typeof setTimeout=="function"?setTimeout:void 0,Kx=typeof clearTimeout=="function"?clearTimeout:void 0,R2=typeof Promise=="function"?Promise:void 0,j2=typeof requestAnimationFrame=="function"?requestAnimationFrame:h0,Qx=typeof queueMicrotask=="function"?queueMicrotask:typeof R2<"u"?function(n){return R2.resolve(null).then(n).catch(eC)}:h0;function eC(n){setTimeout(function(){throw n})}function Va(n){return n==="head"}function M2(n,a){var o=a,l=0;do{var d=o.nextSibling;if(n.removeChild(o),d&&d.nodeType===8)if(o=d.data,o==="/$"||o==="/&"){if(l===0){n.removeChild(d),fc(a);return}l--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")l++;else if(o==="html")T0(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,T0(o);for(var h=o.firstChild;h;){var v=h.nextSibling,_=h.nodeName;h[yl]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&h.rel.toLowerCase()==="stylesheet"||o.removeChild(h),h=v}}else o==="body"&&T0(n.ownerDocument.body);o=d}while(o);fc(a)}function D2(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 U2(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 d=l=0;d<a.length;d++){var h=a[d];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 B2(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 tC(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 p0(n){var a=n.getBoundingClientRect(),o=getComputedStyle(n);return tC(a,o,n)}function nC(n){return n.documentElement.clientHeight}function sC(n){this.addEventListener("load",n),this.addEventListener("error",n)}function rC(n,a,o,l,d,h,v,_,B){var ne=a.nodeType===9?a:a.ownerDocument;try{var oe=ne.startViewTransition({update:function(){var Q=ne.defaultView,re=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,q=0;q<Xe.length;q++){var se=Xe[q];if(!se.complete){var me=se.getBoundingClientRect();if(0<me.bottom&&0<me.right&&me.top<Q.innerHeight&&me.left<Q.innerWidth){if(ee+=rE(se),ee>Rf){Re.length=ke;break}se=new Promise(sC.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(d,d),(re?Promise.allSettled([re.finished,Q]):Q).then(h,h);if(d(),re)return re.finished.then(h,h);h()},types:o});ne.__reactViewTransition=oe;var ge=[];return oe.ready.then(function(){for(var Q=ne.documentElement.getAnimations({subtree:!0}),re=0;re<Q.length;re++){var ke=Q[re],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,q=!0,se=0;se<ke.length;se++){var me=ke[se],Ie=me.width;if(Xe===void 0)Xe=Ie;else if(Xe!==Ie){q=!1;break}if(Ie=me.height,ee===void 0)ee=Ie;else if(ee!==Ie){q=!1;break}delete me.width,delete me.height,me.transform==="none"&&delete me.transform}q&&Xe!==void 0&&ee!==void 0&&(Re.setKeyframes(ke),q=getComputedStyle(Re.target,Re.pseudoElement),q.width!==Xe||q.height!==ee)&&(q=ke[0],q.width=Xe,q.height=ee,q=ke[ke.length-1],q.width=Xe,q.height=ee,Re.setKeyframes(ke))}}v()},function(Q){ne.__reactViewTransition===oe&&(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&&B(Q)}finally{l(),d(),v()}}),oe.finished.finally(function(){for(var Q=0;Q<ge.length;Q++)ge[Q].cancel();ne.__reactViewTransition===oe&&(ne.__reactViewTransition=null),_()}),oe}catch{return l(),d(),v(),null}}function Pi(n,a){this._scope=document.documentElement,this._selector="::view-transition-"+n+"("+a+")"}Pi.prototype.animate=function(n,a){return a=typeof a=="number"?{duration:a}:K({},a),a.pseudoElement=this._selector,this._scope.animate(n,a)},Pi.prototype.getAnimations=function(){for(var n=this._scope,a=this._selector,o=n.getAnimations({subtree:!0}),l=[],d=0;d<o.length;d++){var h=o[d].effect;h!==null&&h.target===n&&h.pseudoElement===a&&l.push(o[d])}return l},Pi.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function L2(n){return{name:n,group:new Pi("group",n),imagePair:new Pi("image-pair",n),old:new Pi("old",n),new:new Pi("new",n)}}function ms(n){this._fragmentFiber=n,this._observers=this._eventListeners=null}ms.prototype.addEventListener=function(n,a,o){var l=null,d=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($2(h,n,a,o)===-1){var v=this,_=a;o!=null&&typeof o!="boolean"&&o.once===!0&&(_=function(B){v.removeEventListener(n,a,o),typeof a=="function"?a.call(this,B):a.handleEvent(B)}),l!==null&&(d=v.removeEventListener.bind(v,n,a,o),l.addEventListener("abort",d,{once:!0}),d=l.removeEventListener.bind(l,"abort",d)),l=ic(o),h.push({type:n,listener:a,optionsOrUseCapture:o,attachedListener:_,cleanup:d}),y(this._fragmentFiber.child,!1,aC,n,_,l)}this._eventListeners=h}};function aC(n,a,o,l){return j(n).addEventListener(a,o,l),!1}ms.prototype.removeEventListener=function(n,a,o){var l=this._eventListeners;if(l!==null&&(a=$2(l,n,a,o),a!==-1)){var d=l[a];o=d.attachedListener;var h=d.cleanup;d=ic(d.optionsOrUseCapture),y(this._fragmentFiber.child,!1,iC,n,o,d),l.splice(a,1),h!==null&&h()}};function iC(n,a,o,l){return j(n).removeEventListener(a,o,l),!1}function ic(n){return n!=null&&typeof n!="boolean"&&(n.once===!0||n.signal instanceof AbortSignal)?{capture:n.capture,passive:n.passive}:n}function z2(n){return n==null?"c=0":typeof n=="boolean"?"c="+(n?"1":"0"):"c="+(n.capture?"1":"0")}function $2(n,a,o,l){if(n.length===0)return-1;l=z2(l);for(var d=0;d<n.length;d++){var h=n[d];if(h.type===a&&h.listener===o&&z2(h.optionsOrUseCapture)===l)return d}return-1}ms.prototype.dispatchEvent=function(n){var a=b(this._fragmentFiber);if(a===null)return!0;a=j(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 d=0;d<o.length;d++){var h=o[d];l.addEventListener(h.type,h.attachedListener,ic(h.optionsOrUseCapture))}if(a.appendChild(l),n=l.dispatchEvent(n),o)for(d=0;d<o.length;d++)h=o[d],l.removeEventListener(h.type,h.attachedListener,ic(h.optionsOrUseCapture));return a.removeChild(l),n}return a.dispatchEvent(n)},ms.prototype.focus=function(n){y(this._fragmentFiber.child,!0,V2,n,void 0,void 0)};function V2(n,a){return n.tag===6?!1:(n=j(n),vC(n,a))}ms.prototype.focusLast=function(n){var a=[];y(this._fragmentFiber.child,!0,m0,a,void 0,void 0);for(var o=a.length-1;0<=o&&!V2(a[o],n);o--);};function m0(n,a){return a.push(n),!1}ms.prototype.blur=function(){var n=b(this._fragmentFiber);n!==null&&(n=j(n),n=Ql(n).activeElement,n!==null&&y(this._fragmentFiber.child,!1,oC,n,void 0,void 0))};function oC(n,a){return n.tag===6?!1:(n=j(n),n===a||n.contains(a)?(a.blur(),!0):!1)}ms.prototype.observeUsing=function(n){this._observers===null&&(this._observers=new Set),this._observers.add(n),y(this._fragmentFiber.child,!1,cC,n,void 0,void 0)};function cC(n,a){return n.tag===6||(n=j(n),a.observe(n)),!1}ms.prototype.unobserveUsing=function(n){var a=this._observers;if(a!==null&&a.has(n)){a.delete(n),y(this._fragmentFiber.child,!1,lC,n,void 0,void 0);for(var o=a=0;o<Zs.length;o++){var l=Zs[o];l.fragmentInstance===this&&l.observer===n?n.unobserve(l.instance):Zs[a++]=l}Zs.length=a}};function lC(n,a){return n.tag===6||(n=j(n),a.unobserve(n)),!1}var Zs=[],g0=!1;function uC(n,a,o){Zs.push({fragmentInstance:n,observer:a,instance:o}),g0||(g0=!0,bC(function(){g0=!1;var l=Zs;Zs=[];for(var d=0;d<l.length;d++){var h=l[d];h.observer.unobserve(h.instance)}}))}ms.prototype.getClientRects=function(){var n=[];return y(this._fragmentFiber.child,!1,dC,n,void 0,void 0),n};function dC(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=j(n),a.push.apply(a,n.getClientRects());return!1}ms.prototype.getRootNode=function(n){var a=b(this._fragmentFiber);return a===null?this:j(a).getRootNode(n)},ms.prototype.compareDocumentPosition=function(n){var a=b(this._fragmentFiber);if(a===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var o=[];y(this._fragmentFiber.child,!1,m0,o,void 0,void 0);var l=j(a);if(o.length===0){if(o=l,S(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 d=l=o.compareDocumentPosition(n);return o===n?d=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(o=A(a)[1],o===null?d=Node.DOCUMENT_POSITION_PRECEDING:(n=j(o).compareDocumentPosition(n),d=n===0||n&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),d|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}a=j(o[0]),d=j(o[o.length-1]);var h=S(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(d)&Node.DOCUMENT_POSITION_CONTAINED_BY;var v=a.compareDocumentPosition(n),_=d.compareDocumentPosition(n),B=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&&d===n||B||_?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&a===n||!h&&d===n?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:v,a&Node.DOCUMENT_POSITION_DISCONNECTED||a&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||fC(a,this._fragmentFiber,o[0],o[o.length-1],n)?a:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function fC(n,a,o,l,d){var h=Ti(d);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=d.ownerDocument,d===h||d===h.documentElement||d===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=Y(o,h,ae),a===null?a=!1:(y(a,!0,W,h,o),h=V,V=null,a=h!==null)),a):n&Node.DOCUMENT_POSITION_FOLLOWING?((a=!!h)&&!(a=h===l)&&(a=Y(l,h,ae),a===null?a=!1:(y(a,!0,ce,h,l),h=V,C=V=null,a=h!==null)),a):!1}function P2(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)}ms.prototype.scrollIntoView=function(n){if(typeof n=="object")throw Error(r(566));var a=[];y(this._fragmentFiber.child,!1,m0,a,void 0,void 0);var o=n!==!1;if(a.length===0){var l=A(this._fragmentFiber);if(l=o?l[1]||l[0]||b(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){n=j(l),P2(n,o);return}if(l=j(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 d=a[l];d.tag===6?(d=j(d),P2(d,o)):j(d).scrollIntoView(n),l+=o?-1:1}};function hC(n,a){return n=j(n),G2(n,a),!1}function G2(n,a){n.reactFragments==null&&(n.reactFragments=new Set),n.reactFragments.add(a)}function F2(n,a){var o=a._eventListeners;if(o!==null)for(var l=0;l<o.length;l++){var d=o[l];n.addEventListener(d.type,d.attachedListener,ic(d.optionsOrUseCapture))}n.nodeType!==3&&(o=a._observers,o!==null&&o.forEach(function(h){for(var v=0,_=0;_<Zs.length;_++){var B=Zs[_];(B.fragmentInstance!==a||B.observer!==h||B.instance!==n)&&(Zs[v++]=B)}Zs.length=v,h.observe(n)}),G2(n,a))}function pC(n,a){var o=a._eventListeners;if(o!==null)for(var l=0;l<o.length;l++){var d=o[l];n.removeEventListener(d.type,d.attachedListener,ic(d.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 y0(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":y0(o),bd(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function mC(n,a,o,l){for(;n.nodeType===1;){var d=o;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[yl])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!==d.rel||n.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||n.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||n.getAttribute("title")!==(d.title==null?null:d.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(h=n.getAttribute("src"),(h!==(d.src==null?null:d.src)||n.getAttribute("type")!==(d.type==null?null:d.type)||n.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&n.getAttribute("name")===h)return n}else return n;if(n=Is(n.nextSibling),n===null)break}return null}function gC(n,a,o){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Is(n.nextSibling),n===null))return null;return n}function H2(n,a){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Is(n.nextSibling),n===null))return null;return n}function v0(n){return n.data==="$?"||n.data==="$~"}function b0(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function yC(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 Is(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 w0=null;function q2(n){n=n.nextSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(a===0)return Is(n.nextSibling);a--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||a++}n=n.nextSibling}return null}function Z2(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 vC(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 bC(n){j2(function(){j2(function(a){return n(a)})})}function Y2(n,a,o){switch(a=Ql(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 W2(n,a,o){for(var l in o){var d=o[l];o.hasOwnProperty(l)&&d!=null&&Et(n,a,l,null,Yx,d)}o.dangerouslySetInnerHTML!=null&&(n.textContent=""),n.onclick===ar&&(n.onclick=null),bd(n)}function T0(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);bd(n)}var Rs=new Map,X2=new Set;function eu(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 Yr=_e.d;_e.d={f:wC,r:TC,D:EC,C:SC,L:_C,m:kC,X:OC,S:AC,M:NC};function wC(){var n=Yr.f(),a=Sf();return n||a}function TC(n){var a=ko(n);a!==null&&a.tag===5&&a.type==="form"?Kw(a):Yr.r(n)}var oc=typeof document>"u"?null:document;function J2(n,a,o){var l=oc;if(l&&typeof a=="string"&&a){var d=_s(a);d='link[rel="'+n+'"][href="'+d+'"]',typeof o=="string"&&(d+='[crossorigin="'+o+'"]'),X2.has(d)||(X2.add(d),n={rel:n,crossOrigin:o,href:a},l.querySelector(d)===null&&(a=l.createElement("link"),Nn(a,"link",n),pn(a),l.head.appendChild(a)))}}function EC(n){Yr.D(n),J2("dns-prefetch",n,null)}function SC(n,a){Yr.C(n,a),J2("preconnect",n,a)}function _C(n,a,o){Yr.L(n,a,o);var l=oc;if(l&&n&&a){var d='link[rel="preload"][as="'+_s(a)+'"]';a==="image"&&o&&o.imageSrcSet?(d+='[imagesrcset="'+_s(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(d+='[imagesizes="'+_s(o.imageSizes)+'"]')):d+='[href="'+_s(n)+'"]';var h=d;switch(a){case"style":h=cc(n);break;case"script":h=lc(n)}if(!(Rs.has(h)||(n=K({rel:"preload",href:a==="image"&&o&&o.imageSrcSet?void 0:n,as:a},o),Rs.set(h,n),l.querySelector(d)!==null||a==="style"&&l.querySelector(tu(h))||a==="script"&&l.querySelector(nu(h))))){var v=l.createElement("link");Nn(v,"link",n),a==="style"&&(v[vd]=!0,v.onload=v.onerror=function(){u1(v)}),pn(v),l.head.appendChild(v)}}}function kC(n,a){Yr.m(n,a);var o=oc;if(o&&n){var l=a&&typeof a.as=="string"?a.as:"script",d='link[rel="modulepreload"][as="'+_s(l)+'"][href="'+_s(n)+'"]',h=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=lc(n)}if(!Rs.has(h)&&(n=K({rel:"modulepreload",href:n},a),Rs.set(h,n),o.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(nu(h)))return}l=o.createElement("link"),Nn(l,"link",n),pn(l),o.head.appendChild(l)}}}function AC(n,a,o){Yr.S(n,a,o);var l=oc;if(l&&n){var d=Ao(l).hoistableStyles,h=cc(n);a=a||"default";var v=d.get(h);if(!v){var _={loading:0,preload:null};if(v=l.querySelector(tu(h)))_.loading=5;else{n=K({rel:"stylesheet",href:n,"data-precedence":a},o),(o=Rs.get(h))&&E0(n,o);var B=v=l.createElement("link");pn(B),Nn(B,"link",n),B._p=new Promise(function(ne,oe){B.onload=ne,B.onerror=oe}),B.addEventListener("load",function(){_.loading|=1}),B.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Cf(v,a,l)}v={type:"stylesheet",instance:v,count:1,state:_},d.set(h,v)}}}function OC(n,a){Yr.X(n,a);var o=oc;if(o&&n){var l=Ao(o).hoistableScripts,d=lc(n),h=l.get(d);h||(h=o.querySelector(nu(d)),h||(n=K({src:n,async:!0},a),(a=Rs.get(d))&&S0(n,a),h=o.createElement("script"),pn(h),Nn(h,"link",n),o.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function NC(n,a){Yr.M(n,a);var o=oc;if(o&&n){var l=Ao(o).hoistableScripts,d=lc(n),h=l.get(d);h||(h=o.querySelector(nu(d)),h||(n=K({src:n,async:!0,type:"module"},a),(a=Rs.get(d))&&S0(n,a),h=o.createElement("script"),pn(h),Nn(h,"link",n),o.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function K2(n,a,o,l){var d=(d=Le.current)?eu(d):null;if(!d)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(o=cc(o.href),a=Ao(d).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=cc(o.href);var h=Ao(d).hoistableStyles,v=h.get(n);if(v||(d=d.ownerDocument||d,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(n,v),(h=d.querySelector(tu(n)))?h._p||(v.instance=h,v.state.loading=5):(h=Rs.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},Rs.set(n,h)),xC(d,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=lc(o),a=Ao(d).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 cc(n){return'href="'+_s(n)+'"'}function tu(n){return'link[rel="stylesheet"]['+n+"]"}function Q2(n){return K({},n,{"data-precedence":n.precedence,precedence:null})}function xC(n,a,o,l){if(a=n.querySelector('link[rel="preload"][as="style"]['+a+"]")){if(a[vd]!==!0){l.loading=1;return}}else a=n.createElement("link"),a[vd]=!0,a.onload=a.onerror=u1.bind(null,a),Nn(a,"link",o),pn(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 lc(n){return'[src="'+_s(n)+'"]'}function nu(n){return"script[async]"+n}function eE(n,a,o){if(a.count++,a.instance===null)switch(a.type){case"style":var l=n.querySelector('style[data-href~="'+_s(o.href)+'"]');if(l)return a.instance=l,pn(l),l;var d=K({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),pn(l),Nn(l,"style",d),Cf(l,o.precedence,n),a.instance=l;case"stylesheet":d=cc(o.href);var h=n.querySelector(tu(d));if(h)return a.state.loading|=4,a.instance=h,pn(h),h;l=Q2(o),(d=Rs.get(d))&&E0(l,d),h=(n.ownerDocument||n).createElement("link"),pn(h);var v=h;return v._p=new Promise(function(_,B){v.onload=_,v.onerror=B}),Nn(h,"link",l),a.state.loading|=4,Cf(h,o.precedence,n),a.instance=h;case"script":return h=lc(o.src),(d=n.querySelector(nu(h)))?(a.instance=d,pn(d),d):(l=o,(d=Rs.get(h))&&(l=K({},o),S0(l,d)),n=n.ownerDocument||n,d=n.createElement("script"),pn(d),Nn(d,"link",l),n.head.appendChild(d),a.instance=d);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,Cf(l,o.precedence,n));return a.instance}function Cf(n,a,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,h=d,v=0;v<l.length;v++){var _=l[v];if(_.dataset.precedence===a)h=_;else if(h!==d)break}h?h.parentNode.insertBefore(n,h.nextSibling):(a=o.nodeType===9?o.head:o,a.insertBefore(n,a.firstChild))}function E0(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function S0(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var If=null;function tE(n,a,o){if(If===null){var l=new Map,d=If=new Map;d.set(o,l)}else d=If,l=d.get(o),l||(l=new Map,d.set(o,l));if(l.has(n))return l;for(l.set(n,null),o=o.getElementsByTagName(n),d=0;d<o.length;d++){var h=o[d];if(!(h[yl]||h[Sn]||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 _0(n,a,o){n=n.ownerDocument||n,n.head.insertBefore(o,a==="title"?n.querySelector("head > title"):null)}function CC(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 nE(n,a){return n==="img"&&a.src!=null&&a.src!==""&&a.onLoad==null&&a.loading!=="lazy"}function sE(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function rE(n){return(n.width||100)*(n.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function aE(n,a){typeof a.decode=="function"&&(n.imgCount++,a.complete||(n.imgBytes+=rE(a),n.suspenseyImages.push(a)),n=jC.bind(n),a.decode().then(n,n))}function IC(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 d=cc(l.href),h=a.querySelector(tu(d));if(h){a=h._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=su.bind(n),a.then(n,n)),o.state.loading|=4,o.instance=h,pn(h);return}h=a.ownerDocument||a,l=Q2(l),(d=Rs.get(d))&&E0(l,d),h=h.createElement("link"),pn(h);var v=h;v._p=new Promise(function(_,B){v.onload=_,v.onerror=B}),Nn(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=su.bind(n),a.addEventListener("load",o),a.addEventListener("error",o))}}var Rf=0;function RC(n,a){return n.stylesheets&&n.count===0&&Mf(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var l=setTimeout(function(){if(n.stylesheets&&Mf(n,n.stylesheets),n.unsuspend){var h=n.unsuspend;n.unsuspend=null,h()}},6e4+a);0<n.imgBytes&&Rf===0&&(Rf=62500*Xx());var d=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Mf(n,n.stylesheets),n.unsuspend)){var h=n.unsuspend;n.unsuspend=null,h()}},(n.imgBytes>Rf?50:800)+a);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function iE(n){if(n.count===0&&(n.imgCount===0||!n.waitingForImages)){if(n.stylesheets)Mf(n,n.stylesheets);else if(n.unsuspend){var a=n.unsuspend;n.unsuspend=null,a()}}}function su(){this.count--,iE(this)}function jC(){this.imgCount--,iE(this)}var jf=null;function Mf(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,jf=new Map,a.forEach(MC,n),jf=null,su.call(n))}function MC(n,a){if(!(a.state.loading&4)){var o=jf.get(n);if(o)var l=o.get(null);else{o=new Map,jf.set(n,o);for(var d=n.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var v=d[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(o.set(v.dataset.precedence,v),l=v)}l&&o.set(null,l)}d=a.instance,v=d.getAttribute("data-precedence"),h=o.get(v)||l,h===l&&o.set(null,d),o.set(v,d),this.count++,l=su.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),h?h.parentNode.insertBefore(d,h.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(d,n.firstChild)),a.state.loading|=4}}var uc={$$typeof:M,Provider:null,Consumer:null,_currentValue:Pe,_currentValue2:Pe,_threadCount:0};function DC(n,a,o,l,d,h,v,_,B){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=rm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rm(0),this.hiddenUpdates=rm(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.transitionTypes=null,this.incompleteTransitions=new Map}function oE(n,a,o,l,d,h,v,_,B,ne,oe,ge){return n=new DC(n,a,o,v,B,ne,oe,ge,_),a=1,h===!0&&(a|=24),h=Xn(3,null,null,a),n.current=h,h.stateNode=n,a=zm(),a.refCount++,n.pooledCache=a,a.refCount++,h.memoizedState={element:l,isDehydrated:o,cache:a},Gm(h),n}function cE(n){return n?(n=Uo,n):Uo}function lE(n,a,o,l,d,h){d=cE(d),l.context===null?l.context=d:l.pendingContext=d,l=xa(a),l.payload={element:o},h=h===void 0?null:h,h!==null&&(l.callback=h),o=Ca(n,l,a),o!==null&&(es(o,n,a),Ml(o,n,a))}function uE(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<a?o:a}}function k0(n,a){uE(n,a),(n=n.alternate)&&uE(n,a)}function dE(n){if(n.tag===13||n.tag===31){var a=ki(n,67108864);a!==null&&es(a,n,67108864),k0(n,67108864)}}function fE(n){if(n.tag===13||n.tag===31){var a=ps();a=am(a);var o=ki(n,a);o!==null&&es(o,n,a),k0(n,a)}}var dc=!0;function UC(n,a,o,l){var d=be.T;be.T=null;var h=_e.p;try{_e.p=2,A0(n,a,o,l)}finally{_e.p=h,be.T=d}}function BC(n,a,o,l){var d=be.T;be.T=null;var h=_e.p;try{_e.p=8,A0(n,a,o,l)}finally{_e.p=h,be.T=d}}function A0(n,a,o,l){if(dc){var d=O0(l);if(d===null)o0(n,a,l,Df,o),pE(n,l);else if(zC(d,n,a,o,l))l.stopPropagation();else if(pE(n,l),a&4&&-1<LC.indexOf(n)){for(;d!==null;){var h=ko(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=wi(h.pendingLanes);if(v!==0){var _=h;for(_.pendingLanes|=2,_.entangledLanes|=2;v;){var B=1<<31-os(v);_.entanglements[1]|=B,v&=~B}mr(h),(ht&6)===0&&(wf=Ln()+500,Xl(0))}}break;case 31:case 13:_=ki(h,2),_!==null&&es(_,h,2),Sf(),k0(h,2)}if(h=O0(l),h===null&&o0(n,a,l,Df,o),h===d)break;d=h}d!==null&&l.stopPropagation()}else o0(n,a,l,null,o)}}function O0(n){return n=fm(n),N0(n)}var Df=null;function N0(n){if(Df=null,n=Ti(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=f(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 Df=n,null}function hE(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(sm()){case hd:return 2;case Ce:return 8;case Ye:case Ot:return 32;case Ss:return 268435456;default:return 32}default:return 32}}var x0=!1,Pa=null,Ga=null,Fa=null,ru=new Map,au=new Map,Ha=[],LC="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 pE(n,a){switch(n){case"focusin":case"focusout":Pa=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":ru.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":au.delete(a.pointerId)}}function iu(n,a,o,l,d,h){return n===null||n.nativeEvent!==h?(n={blockedOn:a,domEventName:o,eventSystemFlags:l,nativeEvent:h,targetContainers:[d]},a!==null&&(a=ko(a),a!==null&&dE(a)),n):(n.eventSystemFlags|=l,a=n.targetContainers,d!==null&&a.indexOf(d)===-1&&a.push(d),n)}function zC(n,a,o,l,d){switch(a){case"focusin":return Pa=iu(Pa,n,a,o,l,d),!0;case"dragenter":return Ga=iu(Ga,n,a,o,l,d),!0;case"mouseover":return Fa=iu(Fa,n,a,o,l,d),!0;case"pointerover":var h=d.pointerId;return ru.set(h,iu(ru.get(h)||null,n,a,o,l,d)),!0;case"gotpointercapture":return h=d.pointerId,au.set(h,iu(au.get(h)||null,n,a,o,l,d)),!0}return!1}function mE(n){var a=Ti(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,o1(n.priority,function(){fE(o)});return}}else if(a===31){if(a=f(o),a!==null){n.blockedOn=a,o1(n.priority,function(){fE(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 Uf(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var o=O0(n.nativeEvent);if(o===null){o=n.nativeEvent;var l=new o.constructor(o.type,o);dm=l,o.target.dispatchEvent(l),dm=null}else return a=ko(o),a!==null&&dE(a),n.blockedOn=o,!1;a.shift()}return!0}function gE(n,a,o){Uf(n)&&o.delete(a)}function $C(){x0=!1,Pa!==null&&Uf(Pa)&&(Pa=null),Ga!==null&&Uf(Ga)&&(Ga=null),Fa!==null&&Uf(Fa)&&(Fa=null),ru.forEach(gE),au.forEach(gE)}function Bf(n,a){n.blockedOn===a&&(n.blockedOn=null,x0||(x0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,$C)))}var Lf=null;function yE(n){Lf!==n&&(Lf=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lf===n&&(Lf=null);for(var a=0;a<n.length;a+=3){var o=n[a],l=n[a+1],d=n[a+2];if(typeof l!="function"){if(N0(l||o)===null)continue;break}var h=ko(o);h!==null&&(n.splice(a,3),a-=3,ug(h,{pending:!0,data:d,method:o.method,action:l},l,d))}}))}function fc(n){function a(B){return Bf(B,n)}Pa!==null&&Bf(Pa,n),Ga!==null&&Bf(Ga,n),Fa!==null&&Bf(Fa,n),ru.forEach(a),au.forEach(a);for(var o=0;o<Ha.length;o++){var l=Ha[o];l.blockedOn===n&&(l.blockedOn=null)}for(;0<Ha.length&&(o=Ha[0],o.blockedOn===null);)mE(o),o.blockedOn===null&&Ha.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var d=o[l],h=o[l+1],v=d[Wn]||null;if(typeof h=="function")v||yE(o);else if(v){var _=null;if(h&&h.hasAttribute("formAction")){if(d=h,v=h[Wn]||null)_=v.formAction;else if(N0(d)!==null)continue}else _=v.action;typeof _=="function"?o[l+1]=_:(o.splice(l,3),l-=3),yE(o)}}}function vE(){function n(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return d=v})},focusReset:"manual",scroll:"manual"})}function a(){d!==null&&(d(),d=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,d=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),d!==null&&(d(),d=null)}}}function C0(n){this._internalRoot=n}zf.prototype.render=C0.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(r(409));var o=a.current,l=ps();lE(o,l,n,a,null,null)},zf.prototype.unmount=C0.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;lE(n.current,2,null,n,null,null),Sf(),a[_o]=null}};function zf(n){this._internalRoot=n}zf.prototype.unstable_scheduleHydration=function(n){if(n){var a=i1();n={blockedOn:null,target:n,priority:a};for(var o=0;o<Ha.length&&a!==0&&a<Ha[o].priority;o++);Ha.splice(o,0,n),o===0&&mE(n)}};var bE=t.version;if(bE!=="19.3.0")throw Error(r(527,bE,"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 VC={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:be,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$f.isDisabled&&$f.supportsFiber)try{pl=$f.inject(VC),is=$f}catch{}}return gu.createRoot=function(n,a){if(!i(n))throw Error(r(299));var o=!1,l="",d=cT,h=lT,v=uT;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(l=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError)),a=oE(n,1,!1,null,null,o,l,null,d,h,v,vE),n[_o]=a.current,i0(n),new C0(a)},gu.hydrateRoot=function(n,a,o){if(!i(n))throw Error(r(299));var l=!1,d="",h=cT,v=lT,_=uT,B=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(d=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&&(B=o.formState)),a=oE(n,1,!0,a,o??null,l,d,B,h,v,_,vE),a.context=cE(null),o=a.current,l=ps(),l=am(l),d=xa(l),d.callback=null,Ca(o,d,l),o=l,a.current.lanes=o,gl(a,o),mr(a),n[_o]=a.current,i0(n),new zf(a)},gu.version="19.3.0",gu}var H_;function LG(){if(H_)return vy.exports;H_=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(),vy.exports=BG(),vy.exports}var q_=LG(),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(f=>typeof i[i[f]]!="number"),u={};for(const f of c)u[f]=i[f];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 Z_;(function(e){e.mergeShapes=(t,s)=>({...t,...s})})(Z_||(Z_={}));const je=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),si=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}},Ee=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 pa 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 f=r,p=0;for(;p<u.path.length;){const m=u.path[p];p===u.path.length-1?(f[m]=f[m]||{_errors:[]},f[m]._errors.push(s(u))):f[m]=f[m]||{_errors:[]},f=f[m],p++}}};return i(this),r}static assert(t){if(!(t instanceof pa))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()}}pa.create=e=>new pa(e);const yv=(e,t)=>{let s;switch(e.code){case Ee.invalid_type:e.received===je.undefined?s="Required":s=`Expected ${e.expected}, received ${e.received}`;break;case Ee.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,ft.jsonStringifyReplacer)}`;break;case Ee.unrecognized_keys:s=`Unrecognized key(s) in object: ${ft.joinValues(e.keys,", ")}`;break;case Ee.invalid_union:s="Invalid input";break;case Ee.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${ft.joinValues(e.options)}`;break;case Ee.invalid_enum_value:s=`Invalid enum value. Expected ${ft.joinValues(e.options)}, received '${e.received}'`;break;case Ee.invalid_arguments:s="Invalid function arguments";break;case Ee.invalid_return_type:s="Invalid function return type";break;case Ee.invalid_date:s="Invalid date";break;case Ee.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 Ee.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 Ee.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 Ee.custom:s="Invalid input";break;case Ee.invalid_intersection_types:s="Intersection results could not be merged";break;case Ee.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case Ee.not_finite:s="Number must be finite";break;default:s=t.defaultError,ft.assertNever(e)}return{message:s}};let zG=yv;function $G(){return zG}const VG=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 f="";const p=r.filter(m=>!!m).slice().reverse();for(const m of p)f=m(u,{data:t,defaultError:f}).message;return{...i,path:c,message:f}};function xe(e,t){const s=$G(),r=VG({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===yv?void 0:yv].filter(i=>!!i)});e.common.issues.push(r)}class Yn{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 He;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 Yn.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 He;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 He=Object.freeze({status:"aborted"}),_u=e=>({status:"dirty",value:e}),Vs=e=>({status:"valid",value:e}),Y_=e=>e.status==="aborted",W_=e=>e.status==="dirty",Zc=e=>e.status==="valid",cp=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 Rr{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 X_=(e,t)=>{if(Zc(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 pa(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,f)=>{const{message:p}=e;return u.code==="invalid_enum_value"?{message:p??f.defaultError}:typeof f.data>"u"?{message:p??r??f.defaultError}:u.code!=="invalid_type"?{message:f.defaultError}:{message:p??s??f.defaultError}},description:i}}class lt{get description(){return this._def.description}_getType(t){return si(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Yn,ctx:{common:t.parent.common,data:t.data,parsedType:si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const s=this._parse(t);if(cp(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:si(t)},i=this._parseSync({data:t,path:r.path,parent:r});return X_(r,i)}"~validate"(t){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:s});return Zc(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=>Zc(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:si(t)},i=this._parse({data:t,path:r.path,parent:r}),c=await(cp(i)?i:Promise.resolve(i));return X_(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),f=()=>c.addIssue({code:Ee.custom,...r(i)});return typeof Promise<"u"&&u instanceof Promise?u.then(p=>p?!0:(f(),!1)):u?!0:(f(),!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 Xc({schema:this,typeName:Fe.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 li.create(this,this._def)}nullable(){return Jc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Sr.create(this)}promise(){return hp.create(this,this._def)}or(t){return up.create([this,t],this._def)}and(t){return dp.create(this,t,this._def)}transform(t){return new Xc({...Je(this._def),schema:this,typeName:Fe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const s=typeof t=="function"?t:()=>t;return new Ev({...Je(this._def),innerType:this,defaultValue:s,typeName:Fe.ZodDefault})}brand(){return new uF({typeName:Fe.ZodBranded,type:this,...Je(this._def)})}catch(t){const s=typeof t=="function"?t:()=>t;return new Sv({...Je(this._def),innerType:this,catchValue:s,typeName:Fe.ZodCatch})}describe(t){const s=this.constructor;return new s({...this._def,description:t})}pipe(t){return Vb.create(this,t)}readonly(){return _v.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const PG=/^c[^\s-]{8,}$/i,GG=/^[0-9a-z]+$/,FG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,HG=/^[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,qG=/^[a-z0-9_-]{21}$/i,ZG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,YG=/^[-+]?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)?)??$/,WG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,XG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ey;const JG=/^(?:(?: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])$/,KG=/^(?:(?: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])$/,QG=/^(([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]))$/,eF=/^(([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])$/,tF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nF=/^([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])))",sF=new RegExp(`^${mO}$`);function gO(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 rF(e){return new RegExp(`^${gO(e)}$`)}function aF(e){let t=`${mO}T${gO(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 iF(e,t){return!!((t==="v4"||!t)&&JG.test(e)||(t==="v6"||!t)&&QG.test(e))}function oF(e,t){if(!ZG.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 cF(e,t){return!!((t==="v4"||!t)&&KG.test(e)||(t==="v6"||!t)&&eF.test(e))}class la 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:Ee.invalid_type,expected:je.string,received:c.parsedType}),He}const r=new Yn;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:Ee.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:Ee.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,f=t.data.length<c.value;(u||f)&&(i=this._getOrReturnCtx(t,i),u?xe(i,{code:Ee.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):f&&xe(i,{code:Ee.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),r.dirty())}else if(c.kind==="email")WG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"email",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="emoji")Ey||(Ey=new RegExp(XG,"u")),Ey.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"emoji",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="uuid")HG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"uuid",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="nanoid")qG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"nanoid",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid")PG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cuid",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid2")GG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cuid2",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="ulid")FG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"ulid",code:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.invalid_string,validation:{endsWith:c.value},message:c.message}),r.dirty()):c.kind==="datetime"?aF(c).test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:"datetime",message:c.message}),r.dirty()):c.kind==="date"?sF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:"date",message:c.message}),r.dirty()):c.kind==="time"?rF(c).test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:"time",message:c.message}),r.dirty()):c.kind==="duration"?YG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"duration",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="ip"?iF(t.data,c.version)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"ip",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="jwt"?oF(t.data,c.alg)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"jwt",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="cidr"?cF(t.data,c.version)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cidr",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="base64"?tF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"base64",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="base64url"?nF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"base64url",code:Ee.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:Ee.invalid_string,...Me.errToObj(r)})}_addCheck(t){return new la({...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 la({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new la({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new la({...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}}la.create=e=>new la({checks:[],typeName:Fe.ZodString,coerce:e?.coerce??!1,...Je(e)});function lF(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 Yc 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:Ee.invalid_type,expected:je.number,received:c.parsedType}),He}let r;const i=new Yn;for(const c of this._def.checks)c.kind==="int"?ft.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.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:Ee.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:Ee.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),i.dirty()):c.kind==="multipleOf"?lF(t.data,c.value)!==0&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.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:Ee.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 Yc({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:Me.toString(i)}]})}_addCheck(t){return new Yc({...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)}}Yc.create=e=>new Yc({checks:[],typeName:Fe.ZodNumber,coerce:e?.coerce||!1,...Je(e)});class Hu 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 Yn;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:Ee.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:Ee.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:Ee.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:Ee.invalid_type,expected:je.bigint,received:s.parsedType}),He}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 Hu({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:Me.toString(i)}]})}_addCheck(t){return new Hu({...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}}Hu.create=e=>new Hu({checks:[],typeName:Fe.ZodBigInt,coerce:e?.coerce??!1,...Je(e)});class vv 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:Ee.invalid_type,expected:je.boolean,received:r.parsedType}),He}return Vs(t.data)}}vv.create=e=>new vv({typeName:Fe.ZodBoolean,coerce:e?.coerce||!1,...Je(e)});class lp 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:Ee.invalid_type,expected:je.date,received:c.parsedType}),He}if(Number.isNaN(t.data.getTime())){const c=this._getOrReturnCtx(t);return xe(c,{code:Ee.invalid_date}),He}const r=new Yn;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:Ee.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:Ee.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 lp({...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}}lp.create=e=>new lp({checks:[],coerce:e?.coerce||!1,typeName:Fe.ZodDate,...Je(e)});class J_ extends lt{_parse(t){if(this._getType(t)!==je.symbol){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.symbol,received:r.parsedType}),He}return Vs(t.data)}}J_.create=e=>new J_({typeName:Fe.ZodSymbol,...Je(e)});class K_ extends lt{_parse(t){if(this._getType(t)!==je.undefined){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.undefined,received:r.parsedType}),He}return Vs(t.data)}}K_.create=e=>new K_({typeName:Fe.ZodUndefined,...Je(e)});class Q_ extends lt{_parse(t){if(this._getType(t)!==je.null){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.null,received:r.parsedType}),He}return Vs(t.data)}}Q_.create=e=>new Q_({typeName:Fe.ZodNull,...Je(e)});class e4 extends lt{constructor(){super(...arguments),this._any=!0}_parse(t){return Vs(t.data)}}e4.create=e=>new e4({typeName:Fe.ZodAny,...Je(e)});class t4 extends lt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vs(t.data)}}t4.create=e=>new t4({typeName:Fe.ZodUnknown,...Je(e)});class mi extends lt{_parse(t){const s=this._getOrReturnCtx(t);return xe(s,{code:Ee.invalid_type,expected:je.never,received:s.parsedType}),He}}mi.create=e=>new mi({typeName:Fe.ZodNever,...Je(e)});class n4 extends lt{_parse(t){if(this._getType(t)!==je.undefined){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.void,received:r.parsedType}),He}return Vs(t.data)}}n4.create=e=>new n4({typeName:Fe.ZodVoid,...Je(e)});class Sr extends lt{_parse(t){const{ctx:s,status:r}=this._processInputParams(t),i=this._def;if(s.parsedType!==je.array)return xe(s,{code:Ee.invalid_type,expected:je.array,received:s.parsedType}),He;if(i.exactLength!==null){const u=s.data.length>i.exactLength.value,f=s.data.length<i.exactLength.value;(u||f)&&(xe(s,{code:u?Ee.too_big:Ee.too_small,minimum:f?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:Ee.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:Ee.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,f)=>i.type._parseAsync(new Rr(s,u,s.path,f)))).then(u=>Yn.mergeArray(r,u));const c=[...s.data].map((u,f)=>i.type._parseSync(new Rr(s,u,s.path,f)));return Yn.mergeArray(r,c)}get element(){return this._def.type}min(t,s){return new Sr({...this._def,minLength:{value:t,message:Me.toString(s)}})}max(t,s){return new Sr({...this._def,maxLength:{value:t,message:Me.toString(s)}})}length(t,s){return new Sr({...this._def,exactLength:{value:t,message:Me.toString(s)}})}nonempty(t){return this.min(1,t)}}Sr.create=(e,t)=>new Sr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Fe.ZodArray,...Je(t)});function Tc(e){if(e instanceof tn){const t={};for(const s in e.shape){const r=e.shape[s];t[s]=li.create(Tc(r))}return new tn({...e._def,shape:()=>t})}else return e instanceof Sr?new Sr({...e._def,type:Tc(e.element)}):e instanceof li?li.create(Tc(e.unwrap())):e instanceof Jc?Jc.create(Tc(e.unwrap())):e instanceof go?go.create(e.items.map(t=>Tc(t))):e}class tn 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:Ee.invalid_type,expected:je.object,received:m.parsedType}),He}const{status:r,ctx:i}=this._processInputParams(t),{shape:c,keys:u}=this._getCached(),f=[];if(!(this._def.catchall instanceof mi&&this._def.unknownKeys==="strip"))for(const m in i.data)u.includes(m)||f.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 Rr(i,y,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof mi){const m=this._def.unknownKeys;if(m==="passthrough")for(const g of f)p.push({key:{status:"valid",value:g},value:{status:"valid",value:i.data[g]}});else if(m==="strict")f.length>0&&(xe(i,{code:Ee.unrecognized_keys,keys:f}),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 f){const y=i.data[g];p.push({key:{status:"valid",value:g},value:m._parse(new Rr(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=>Yn.mergeObjectSync(r,m)):Yn.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(t){return Me.errToObj,new tn({...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 tn({...this._def,unknownKeys:"strip"})}passthrough(){return new tn({...this._def,unknownKeys:"passthrough"})}extend(t){return new tn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new tn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Fe.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new tn({...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 tn({...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 tn({...this._def,shape:()=>s})}deepPartial(){return Tc(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 tn({...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 li;)c=c._def.innerType;s[r]=c}return new tn({...this._def,shape:()=>s})}keyof(){return yO(ft.objectKeys(this.shape))}}tn.create=(e,t)=>new tn({shape:()=>e,unknownKeys:"strip",catchall:mi.create(),typeName:Fe.ZodObject,...Je(t)});tn.strictCreate=(e,t)=>new tn({shape:()=>e,unknownKeys:"strict",catchall:mi.create(),typeName:Fe.ZodObject,...Je(t)});tn.lazycreate=(e,t)=>new tn({shape:e,unknownKeys:"strip",catchall:mi.create(),typeName:Fe.ZodObject,...Je(t)});class up extends lt{_parse(t){const{ctx:s}=this._processInputParams(t),r=this._def.options;function i(c){for(const f of c)if(f.result.status==="valid")return f.result;for(const f of c)if(f.result.status==="dirty")return s.common.issues.push(...f.ctx.common.issues),f.result;const u=c.map(f=>new pa(f.ctx.common.issues));return xe(s,{code:Ee.invalid_union,unionErrors:u}),He}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 f=u.map(p=>new pa(p));return xe(s,{code:Ee.invalid_union,unionErrors:f}),He}}get options(){return this._def.options}}up.create=(e,t)=>new up({options:e,typeName:Fe.ZodUnion,...Je(t)});function bv(e,t){const s=si(e),r=si(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(f=>i.indexOf(f)!==-1),u={...e,...t};for(const f of c){const p=bv(e[f],t[f]);if(!p.valid)return{valid:!1};u[f]=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],f=t[c],p=bv(u,f);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 dp extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t),i=(c,u)=>{if(Y_(c)||Y_(u))return He;const f=bv(c.value,u.value);return f.valid?((W_(c)||W_(u))&&s.dirty(),{status:s.value,value:f.data}):(xe(r,{code:Ee.invalid_intersection_types}),He)};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}))}}dp.create=(e,t,s)=>new dp({left:e,right:t,typeName:Fe.ZodIntersection,...Je(s)});class go extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.array)return xe(r,{code:Ee.invalid_type,expected:je.array,received:r.parsedType}),He;if(r.data.length<this._def.items.length)return xe(r,{code:Ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),He;!this._def.rest&&r.data.length>this._def.items.length&&(xe(r,{code:Ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const c=[...r.data].map((u,f)=>{const p=this._def.items[f]||this._def.rest;return p?p._parse(new Rr(r,u,r.path,f)):null}).filter(u=>!!u);return r.common.async?Promise.all(c).then(u=>Yn.mergeArray(s,u)):Yn.mergeArray(s,c)}get items(){return this._def.items}rest(t){return new go({...this._def,rest:t})}}go.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new go({items:e,typeName:Fe.ZodTuple,rest:null,...Je(t)})};class fp 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:Ee.invalid_type,expected:je.object,received:r.parsedType}),He;const i=[],c=this._def.keyType,u=this._def.valueType;for(const f in r.data)i.push({key:c._parse(new Rr(r,f,r.path,f)),value:u._parse(new Rr(r,r.data[f],r.path,f)),alwaysSet:f in r.data});return r.common.async?Yn.mergeObjectAsync(s,i):Yn.mergeObjectSync(s,i)}get element(){return this._def.valueType}static create(t,s,r){return s instanceof lt?new fp({keyType:t,valueType:s,typeName:Fe.ZodRecord,...Je(r)}):new fp({keyType:la.create(),valueType:t,typeName:Fe.ZodRecord,...Je(s)})}}class s4 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:Ee.invalid_type,expected:je.map,received:r.parsedType}),He;const i=this._def.keyType,c=this._def.valueType,u=[...r.data.entries()].map(([f,p],m)=>({key:i._parse(new Rr(r,f,r.path,[m,"key"])),value:c._parse(new Rr(r,p,r.path,[m,"value"]))}));if(r.common.async){const f=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 He;(m.status==="dirty"||g.status==="dirty")&&s.dirty(),f.set(m.value,g.value)}return{status:s.value,value:f}})}else{const f=new Map;for(const p of u){const m=p.key,g=p.value;if(m.status==="aborted"||g.status==="aborted")return He;(m.status==="dirty"||g.status==="dirty")&&s.dirty(),f.set(m.value,g.value)}return{status:s.value,value:f}}}}s4.create=(e,t,s)=>new s4({valueType:t,keyType:e,typeName:Fe.ZodMap,...Je(s)});class qu extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.set)return xe(r,{code:Ee.invalid_type,expected:je.set,received:r.parsedType}),He;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(xe(r,{code:Ee.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:Ee.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 He;g.status==="dirty"&&s.dirty(),m.add(g.value)}return{status:s.value,value:m}}const f=[...r.data.values()].map((p,m)=>c._parse(new Rr(r,p,r.path,m)));return r.common.async?Promise.all(f).then(p=>u(p)):u(f)}min(t,s){return new qu({...this._def,minSize:{value:t,message:Me.toString(s)}})}max(t,s){return new qu({...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)}}qu.create=(e,t)=>new qu({valueType:e,minSize:null,maxSize:null,typeName:Fe.ZodSet,...Je(t)});class wv 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})}}wv.create=(e,t)=>new wv({getter:e,typeName:Fe.ZodLazy,...Je(t)});class Tv extends lt{_parse(t){if(t.data!==this._def.value){const s=this._getOrReturnCtx(t);return xe(s,{received:s.data,code:Ee.invalid_literal,expected:this._def.value}),He}return{status:"valid",value:t.data}}get value(){return this._def.value}}Tv.create=(e,t)=>new Tv({value:e,typeName:Fe.ZodLiteral,...Je(t)});function yO(e,t){return new Wc({values:e,typeName:Fe.ZodEnum,...Je(t)})}class Wc 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:Ee.invalid_type}),He}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:Ee.invalid_enum_value,options:r}),He}return Vs(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 Wc.create(t,{...this._def,...s})}exclude(t,s=this._def){return Wc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...s})}}Wc.create=yO;class r4 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:Ee.invalid_type}),He}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:Ee.invalid_enum_value,options:i}),He}return Vs(t.data)}get enum(){return this._def.values}}r4.create=(e,t)=>new r4({values:e,typeName:Fe.ZodNativeEnum,...Je(t)});class hp 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:Ee.invalid_type,expected:je.promise,received:s.parsedType}),He;const r=s.parsedType===je.promise?s.data:Promise.resolve(s.data);return Vs(r.then(i=>this._def.type.parseAsync(i,{path:s.path,errorMap:s.common.contextualErrorMap})))}}hp.create=(e,t)=>new hp({type:e,typeName:Fe.ZodPromise,...Je(t)});class Xc extends lt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Fe.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 f=>{if(s.value==="aborted")return He;const p=await this._def.schema._parseAsync({data:f,path:r.path,parent:r});return p.status==="aborted"?He:p.status==="dirty"||s.value==="dirty"?_u(p.value):p});{if(s.value==="aborted")return He;const f=this._def.schema._parseSync({data:u,path:r.path,parent:r});return f.status==="aborted"?He:f.status==="dirty"||s.value==="dirty"?_u(f.value):f}}if(i.type==="refinement"){const u=f=>{const p=i.refinement(f,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 f};if(r.common.async===!1){const f=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return f.status==="aborted"?He:(f.status==="dirty"&&s.dirty(),u(f.value),{status:s.value,value:f.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(f=>f.status==="aborted"?He:(f.status==="dirty"&&s.dirty(),u(f.value).then(()=>({status:s.value,value:f.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(!Zc(u))return He;const f=i.transform(u.value,c);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:f}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>Zc(u)?Promise.resolve(i.transform(u.value,c)).then(f=>({status:s.value,value:f})):He);ft.assertNever(i)}}Xc.create=(e,t,s)=>new Xc({schema:e,typeName:Fe.ZodEffects,effect:t,...Je(s)});Xc.createWithPreprocess=(e,t,s)=>new Xc({schema:t,effect:{type:"preprocess",transform:e},typeName:Fe.ZodEffects,...Je(s)});class li extends lt{_parse(t){return this._getType(t)===je.undefined?Vs(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}li.create=(e,t)=>new li({innerType:e,typeName:Fe.ZodOptional,...Je(t)});class Jc extends lt{_parse(t){return this._getType(t)===je.null?Vs(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Jc.create=(e,t)=>new Jc({innerType:e,typeName:Fe.ZodNullable,...Je(t)});class Ev 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}}Ev.create=(e,t)=>new Ev({innerType:e,typeName:Fe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Je(t)});class Sv 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 cp(i)?i.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new pa(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new pa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Sv.create=(e,t)=>new Sv({innerType:e,typeName:Fe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Je(t)});class a4 extends lt{_parse(t){if(this._getType(t)!==je.nan){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.nan,received:r.parsedType}),He}return{status:"valid",value:t.data}}}a4.create=e=>new a4({typeName:Fe.ZodNaN,...Je(e)});class uF 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 Vb 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"?He:c.status==="dirty"?(s.dirty(),_u(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"?He: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 Vb({in:t,out:s,typeName:Fe.ZodPipeline})}}class _v extends lt{_parse(t){const s=this._def.innerType._parse(t),r=i=>(Zc(i)&&(i.value=Object.freeze(i.value)),i);return cp(s)?s.then(i=>r(i)):r(s)}unwrap(){return this._def.innerType}}_v.create=(e,t)=>new _v({innerType:e,typeName:Fe.ZodReadonly,...Je(t)});var Fe;(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"})(Fe||(Fe={}));const zs=la.create,ud=Yc.create,vO=vv.create;mi.create;const ui=Sr.create,on=tn.create;up.create;dp.create;go.create;const Pb=fp.create,dF=wv.create,fF=Tv.create,bO=Wc.create;hp.create;li.create;Jc.create;const Ut=De("0x2::sui::SUI"),pp=864e5,hF=10n**27n,pt=zs().refine(da,"Invalid Sui address").transform(e=>ye(e)),nr=zs().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)),wO=zs().regex(/^(0|[1-9][0-9]*)$/).refine(e=>BigInt(e)<=18446744073709551615n,"Amount exceeds u64"),vs=wO.refine(e=>BigInt(e)>0n,"Must be positive"),TO="agent gas",Vt=(e,t)=>De(e)===De(t),pF=zs().regex(/^[a-z0-9_-]{1,32}$/),Wp=e=>BigInt(e.perX)<=BigInt(e.daily),mF=on({coin:nr,recipients:ui(on({name:pF,address:pt}).strict()).min(1),perTransfer:vs,daily:vs}).strict().refine(e=>Wp({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"),gF=bO(["deepbook","cetus"]),yF=on({coinIn:nr,coinOut:nr,pools:ui(pt).min(1),perTrade:vs,daily:vs,minPrice:vs}).strict().refine(e=>Wp({perX:e.perTrade,daily:e.daily})&&!Vt(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"),vF=on({coin:nr,allowBorrow:vO(),perAction:vs,daily:vs,minHealthFactor:ud().min(1).max(100).nullable()}).strict().refine(e=>Wp({perX:e.perAction,daily:e.daily}),"Per-action limit must not exceed the daily limit"),bF=on({validators:ui(pt),perStake:vs,daily:vs}).strict().refine(e=>Wp({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"),Ah=e=>new Set(e).size===e.length,wF=on({transfers:ui(mF).default([]),swaps:ui(yF).default([]),lending:ui(vF).default([]),staking:bF.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=>Ah(e.transfers.map(t=>t.coin))&&Ah(e.swaps.map(t=>`${t.coinIn}>${t.coinOut}`))&&Ah(e.lending.map(t=>t.coin)),"One transfer rule per coin, one swap rule per direction, one lending rule per coin");function TF(e){const t=[...e.transfers.map(s=>s.coin),...e.swaps.map(s=>s.coinIn),...e.lending.map(s=>s.coin),...e.staking?[Ut]:[]];return[...new Set(t.map(s=>De(s)))]}const EF=on({type:nr,symbol:zs().min(1).max(16),decimals:ud().int().min(0).max(18),unlisted:vO().optional()}).strict(),SF=on({venue:gF,poolId:pt,coinA:nr,coinB:nr}).strict(),_F=ud().int().min(0).max(255),kF=on({network:bO(["localnet","testnet","devnet","mainnet"]),grpcUrl:zs().url(),chainIdentifier:zs().min(1),packageId:pt,publishedAt:pt,configId:pt,siteUrl:zs().url().optional(),coins:ui(EF).min(1),pools:ui(SF),demoFaucet:on({packageId:pt,faucetId:pt,coin:nr}).strict().optional(),protocols:on({deepbook:on({packageId:pt,publishedAt:pt,indexerUrl:zs().url().optional()}).strict(),cetus:on({packageId:pt,publishedAt:pt,configId:pt,apiUrl:zs().url().optional()}).strict(),navi:on({packageId:pt,publishedAt:pt,oraclePackageId:pt,storageId:pt,oracleId:pt,incentiveV2Id:pt,incentiveV3Id:pt,reserves:Pb(nr,on({poolId:pt,assetId:_F}).strict())}).strict()}).strict()}).strict().refine(e=>Vt(e.coins[0].type,Ut),"The first coin must be SUI, the gas coin").refine(e=>Ah(e.coins.map(t=>t.type)),"Each coin once").refine(e=>e.pools.every(t=>e.coins.some(s=>Vt(s.type,t.coinA))&&e.coins.some(s=>Vt(s.type,t.coinB)))&&Object.keys(e.protocols.navi.reserves).every(t=>e.coins.some(s=>Vt(s.type,t)))&&(!e.demoFaucet||e.coins.some(t=>Vt(t.type,e.demoFaucet.coin))),"Pools, reserves and the demo faucet may only name listed coins");function Kc(e,t){const s=e.coins.find(r=>Vt(r.type,t));if(!s)throw new Error(`${t} is not a coin this deployment lists`);return s}const AF=on({v:fF(1),sessionAddress:pt,setup:dF(()=>RF),passId:pt.optional()}).strict(),OF=e=>AF.parse(JSON.parse(new TextDecoder().decode(qe(e.replaceAll("-","+").replaceAll("_","/"))))),NF=ud().int().positive().max(30*pp),xF=vs,CF=ud().int().positive(),IF=zs().regex(/^[\x20-\x7e]{1,64}$/),RF=on({name:IF,policy:wF,ttlMs:NF,expiresMs:CF,allowances:Pb(nr,vs),gasAmount:xF,gasCap:vs,gasDaily:vs}).strict().refine(e=>BigInt(e.gasDaily)<=BigInt(e.gasCap),"Daily gas limit must not exceed the gas lifetime cap").refine(e=>{const t=new Set(Object.keys(e.allowances).map(r=>De(r))),s=TF(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(Ut))},"A daily limit must not exceed the lifetime cap of its coin");on({passId:pt,receiptId:pt,allowances:Pb(nr,on({allowance:pt,revokeCap:pt}).strict()),gasAllowance:pt,gasRevokeCap:pt,owner:pt,authorizationDigest:zs().min(1)}).strict();function jF(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 wO.parse((BigInt(s)*10n**BigInt(t)+BigInt(r.padEnd(t,"0"))).toString())}function dd(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 i4(e){const[t,,s]=De(e).split("::");return`${t.slice(0,6)}…${t.slice(-4)}::${s}`}function _r(e,t){const s=e.coins.find(r=>Vt(r.type,t));return s?s.unlisted?`${s.symbol} (${i4(t)})`:s.symbol:i4(t)}function bn(e,t,s){const r=e.coins.find(i=>Vt(i.type,t));return r?`${dd(s,r.decimals)} ${_r(e,t)}`:`${s} base units of ${t}`}function mp(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(Ut),{coins:[...t],pools:[...s]}}function MF(e,t,s,r){const i=Kc(e,s).decimals+9-Kc(e,t).decimals;return i>=0?dd(r,i):(BigInt(r)*10n**BigInt(-i)).toString()}const o4=e=>/^(USD|AUSD$|FDUSD$|BUCK$)/i.test(e);function Gb(e,t,s){const r=o4(Kc(e,t).symbol),i=o4(Kc(e,s).symbol);return r&&!i?{base:s,quote:t,limit:"max"}:{base:t,quote:s,limit:"min"}}function DF(e,t,s,r){if(Gb(e,t,s).limit==="min")return MF(e,t,s,r);const i=BigInt(r),c=10n**BigInt(Kc(e,s).decimals)*10n**9n;return dd(((c*2n+i)/(i*2n)).toString(),Kc(e,t).decimals)}const UF=e=>e===null?"0":(BigInt(jF(e.toFixed(2),2))*hF/100n).toString();function gp(e){const t={};for(const[s,r]of Object.entries(e.allowances))t[De(s)]=(t[De(s)]??0n)+BigInt(r);return t[Ut]=(t[Ut]??0n)+BigInt(e.gasCap),Object.fromEntries(Object.entries(t).map(([s,r])=>[s,r.toString()]))}function BF(e,t){const s=r=>BigInt(t[De(r)]??"0");return Object.fromEntries(Object.entries(gp(e)).map(([r,i])=>[r,(BigInt(i)>s(r)?BigInt(i)-s(r):0n).toString()]))}function LF(e){return(BigInt(gp(e)[Ut])+BigInt(e.gasAmount)+zF).toString()}const zF=50000000n,Rn=F.Address,kv=F.struct("Bag",{id:Rn,size:F.u64()}),$F=F.struct("Control",{controller:Rn,name:F.string(),owner:F.Address,agent:F.Address,agent_expires_ms:F.u64(),policies:F.struct("Policies",{bag:kv}),positions:kv}),VF=F.struct("Pass",{id:Rn,control:$F}),Xp=F.struct("Meter",{day:F.u64(),used:F.u64()}),PF=F.struct("TransferPolicy",{recipients:kv,per_transfer:F.u64(),daily:F.u64(),meter:Xp}),GF=F.struct("SwapPolicy",{venues:F.vector(Rn),per_trade:F.u64(),daily:F.u64(),min_price:F.u64(),meter:Xp}),FF=F.struct("LendingPolicy",{pool:Rn,asset:F.u8(),allow_borrow:F.bool(),per_action:F.u64(),daily:F.u64(),min_health_factor:F.u256(),meter:Xp}),HF=F.struct("StakingPolicy",{validators:F.vector(F.Address),per_stake:F.u64(),daily:F.u64(),meter:Xp}),EO=F.struct("AccountCap",{id:Rn,owner:F.Address}),qF=e=>ye(EO.parse(e).owner),ZF=F.struct("StakedSui",{id:Rn,pool_id:Rn,stake_activation_epoch:F.u64(),principal:F.u64()}),YF=De("0x3::staking_pool::StakedSui"),WF=F.enum("RateLimit",{Windowed:F.struct("Windowed",{limit:F.u256(),spent:F.u256(),anchor_ms:F.option(F.u64()),index:F.u64(),window:F.enum("Window",{PeriodicMs:F.u64(),CalendarMonths:F.u8()})})}),XF=F.struct("Allowance",{id:Rn,settings:F.struct("Settings",{funder:F.Address,spender:F.option(F.Address),app:F.option(F.struct("TypeName",{name:F.string()})),lifetime_cap:F.option(F.u256()),start_timestamp_ms:F.option(F.u64()),expiration_timestamp_ms:F.option(F.u64()),rate_limit:F.option(WF),name:F.string()}),current_spend:F.u256()}),JF=F.struct("AllowanceCap",{id:Rn,allowance:Rn}),KF=F.struct("Clock",{id:Rn,timestamp_ms:F.u64()}),QF=F.struct("Created",{pass:Rn,receipt:Rn,name:F.string(),owner:F.Address,agent:F.Address,agent_expires_ms:F.u64()}),eH=F.struct("Issued",{pass:Rn,coin_type:F.struct("TypeName",{name:F.string()}),lifetime_cap:F.option(F.u256()),expires_ms:F.option(F.u64())}),tH=F.struct("Receipt",{id:Rn,pass:Rn,name:F.string()}),SO=e=>`${e.packageId}::pass::PASS`,Fb=e=>`${e.packageId}::pass::Created`;function Hb(e){const t=QF.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 _O(e,t,s){const r=[];let i=null;do{const c=await e.listOwnedObjects({owner:s,type:nH(t),cursor:i,include:{content:!0}});for(const u of c.objects){const f=tH.parse(u.content);r.push({id:ye(f.id),pass:ye(f.pass),name:f.name})}i=c.hasNextPage?c.cursor:null}while(i);return r}const nH=e=>`${e.packageId}::pass::Receipt`,sH=e=>`0x2::allowance::Allowance<0x2::balance::Balance<${e}>>`,kO=e=>De(`0x${e}`);async function rH(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(f=>f.eventType===u);return{sender:ye(i.transaction.sender),passes:c(Fb(t)).map(u=>Hb(u.bcs)),issued:c(`${t.packageId}::pass::Issued`).map(u=>{const f=eH.parse(u.bcs);return{passId:ye(f.pass),coinType:kO(f.coin_type.name),lifetimeCap:f.lifetime_cap,expiresMs:f.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 c4=[500,1e3,2e3,4e3],aH=e=>e instanceof gt&&e.code==="RESOURCE_EXHAUSTED";class iH extends Qv{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(f){if(!aH(f)||c>=c4.length)throw f;for(const p of[u.headers,u.status,u.trailers])p.catch(()=>{});await new Promise(p=>setTimeout(p,c4[c]))}}})();return new Kk(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 $t(e){return new lb({network:e.network,transport:new iH({baseUrl:e.grpcUrl})})}async function AO(e){const{object:t}=await e.getObject({objectId:"0x6",include:{content:!0}});return Number(KF.parse(t.content).timestamp_ms)}function nh(e,t){const s=Math.floor(t/pp);return{usedToday:s>Number(e.day)?"0":e.used,resetsAtMs:(s+1)*pp}}async function Av(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 oH(e,t,s,r){const i={transfers:[],swaps:[],lending:[],staking:[]};for(const u of await Av(e,s)){const f=ws(u.valueType);if(ye(f.address)!==t.packageId)continue;const p=f.typeParams.map(m=>De(m));if(f.module==="transfer_policy"){const m=PF.parse(u.value.bcs),g=(await Av(e,ye(m.recipients.id))).map(y=>({name:F.string().parse(y.name.bcs),address:ye(F.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:nh(m.meter,r)})}else if(f.module==="swap_policy"){const m=GF.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:nh(m.meter,r)})}else if(f.module==="lending_policy"){const m=FF.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:nh(m.meter,r)})}else if(f.module==="staking_policy"){const m=HF.parse(u.value.bcs);i.staking.push({validators:m.validators.map(g=>ye(g)),perStake:m.per_stake,daily:m.daily,usage:nh(m.meter,r)})}}const c=(u,f)=>u.coinType.localeCompare(f.coinType);return i.transfers.sort(c),i.lending.sort(c),i.swaps.sort((u,f)=>(u.coinIn+u.coinOut).localeCompare(f.coinIn+f.coinOut)),i}async function Jp(e,t,s){const[{object:r},i]=await Promise.all([e.getObject({objectId:s,include:{content:!0}}),AO(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}=VF.parse(r.content),[u,f]=await Promise.all([oH(e,t,ye(c.policies.bag.id),i),Av(e,ye(c.positions.id))]),p=f.find(g=>De(g.valueType)===De(`${t.protocols.navi.packageId}::account::AccountCap`)),m=f.filter(g=>De(g.valueType)===YF).map(g=>{const y=ZF.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(EO.parse(p.value.bcs).owner):null,stakes:m,chainTimeMs:i}}async function cH(e,t,s){const r=await lH(e,t,s);return Object.fromEntries(Object.entries(r).map(([i,c])=>[i,c.addressBalance]))}async function lH(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 uH(e){const t=ws(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 qb(e,t,s){let r;try{({object:r}=await e.getObject({objectId:t,include:{content:!0}}))}catch(m){if(m instanceof lh&&(m.reason==="deleted"||m.reason==="notFound"))return null;throw m}if(De(r.type)!==De(sH(s))||r.owner.$kind!=="Shared")throw new Error("Unexpected allowance type or ownership");const i=await AO(e),c=XF.parse(r.content),u=c.settings,f=u.rate_limit?.Windowed;let p=null;if(f){const m=f.window.PeriodicMs??null;let g=f.spent;f.anchor_ms!==null&&m!==null&&Math.floor((i-Number(f.anchor_ms))/Number(m))>Number(f.index)&&(g="0"),p={limit:f.limit,spent:f.spent,spentNow:g,anchorMs:f.anchor_ms,index:f.index,periodMs:m,months:f.window.CalendarMonths??null}}return{id:ye(c.id),coinType:s,funder:ye(u.funder),spender:u.spender?ye(u.spender):null,app:u.app?kO(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 dH(e,t){const{object:s}=await e.getObject({objectId:t,include:{content:!0}});return ye(JF.parse(s.content).allowance)}async function fH(e,t,s){const r=De(SO(t)),i=ye(s.owner),c=ye(s.agent),u=[];let f=null;do{const g=await e.listOwnedObjects({owner:i,cursor:f,limit:50});for(const y of g.objects){const b=ws(y.type);ye(b.address)===ye("0x2")&&b.module==="allowance"&&b.name==="AllowanceCap"&&u.push(y.objectId)}f=g.hasNextPage?g.cursor:null}while(f&&u.length<1e3);const p={};let m=null;return await Promise.all(u.map(async g=>{const y=await dH(e,g).catch(()=>null);if(!y)return;const{object:b}=await e.getObject({objectId:y}).catch(()=>({object:null})),S=b?uH(b.type):null;if(!S)return;const A=await qb(e,y,S);!A||A.funder!==i||A.spender!==c||(A.app===r?p[S]={allowance:y,revokeCap:g}:A.app===null&&A.name===TO&&S===Ut&&(m={allowance:y,revokeCap:g}))})),{allowances:p,gas:m}}async function OO(e,t){const s=await Promise.all(Object.entries(t.allowances).map(async([r,i])=>[r,await qb(e,i.allowance,r)]));return Object.fromEntries(s)}async function Zb(e,t,s){const r=[...t.coins],i=[...t.pools],c=[["deepbook",t.protocols.deepbook.packageId],["cetus",t.protocols.cetus.packageId]];for(const f of s.pools){if(i.some(A=>ye(A.poolId)===ye(f)))continue;const{object:p}=await e.getObject({objectId:f}),m=ws(p.type),g=c.find(([,A])=>ye(m.address)===ye(A))?.[0],[y,b]=m.typeParams;if(!g||m.module!=="pool"||m.name!=="Pool"||!y||!b)throw new Error(`${f} is not a DeepBook or Cetus pool on this network`);const S=A=>De(typeof A=="string"?A:NO(A));i.push({venue:g,poolId:ye(f),coinA:S(y),coinB:S(b)})}const u=new Set(s.coins.map(f=>De(f)));for(const f of i)u.add(f.coinA),u.add(f.coinB);for(const f of u){if(r.some(m=>Vt(m.type,f)))continue;const{coinMetadata:p}=await e.getCoinMetadata({coinType:f});if(!p)throw new Error(`${f} has no coin metadata on this network`);r.push({type:f,symbol:p.symbol.slice(0,16)||"COIN",decimals:p.decimals,unlisted:!0})}return{...t,coins:r,pools:i}}function NO(e){const t=e.typeParams.map(s=>typeof s=="string"?s:NO(s));return`${e.address}::${e.module}::${e.name}${t.length?`<${t.join(",")}>`:""}`}function hH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/tx/${encodeURIComponent(t)}`}function pH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/object/${t}`}function mH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/account/${t}`}const gH=e=>(Number(BigInt(e)/10n**25n)/100).toFixed(2);function xO(e,t,s=null){const r=(f,p)=>bn(e,f,p),i=f=>e.coins.find(p=>Vt(p.type,f))?.symbol??f,c=f=>{const p=e.pools.find(m=>m.poolId===f);return p?p.venue==="deepbook"?"DeepBook":"Cetus":f},u=[{label:"Allowed actions",value:[t.transfers.length&&"Transfers",t.swaps.length&&"Swaps",t.lending.length&&(t.lending.some(f=>f.allowBorrow)?"Lending and borrowing":"Lending"),t.staking&&"Staking"].filter(Boolean).join(" + ")}];for(const f of t.transfers){const p=s?.transfers.find(m=>Vt(m.coinType,f.coin));u.push({starts:!0,label:`Pay ${i(f.coin)} to`,value:(p?.recipients??f.recipients).map(m=>`${m.name} → ${m.address}`).join(`
841
841
  `)},{label:`Max ${i(f.coin)} per transfer / per UTC day`,value:`${r(f.coin,p?.perTransfer??f.perTransfer)} / ${r(f.coin,p?.daily??f.daily)}`})}for(const f of t.swaps){const p=s?.swaps.find(y=>Vt(y.coinIn,f.coinIn)&&Vt(y.coinOut,f.coinOut)),m=p?.minPrice??f.minPrice,g=Gb(e,f.coinIn,f.coinOut);u.push({starts:!0,label:g.limit==="max"?`Buy ${i(f.coinOut)} with ${i(f.coinIn)} on`:`Sell ${i(f.coinIn)} for ${i(f.coinOut)} on`,value:(p?.venues??f.pools).map(c).join(", ")},{label:`Max ${i(f.coinIn)} ${g.limit==="max"?"spent":"sold"} per trade / per UTC day`,value:`${r(f.coinIn,p?.perTrade??f.perTrade)} / ${r(f.coinIn,p?.daily??f.daily)}`},{label:g.limit==="max"?"Highest price paid":"Lowest price accepted",value:`${DF(e,f.coinIn,f.coinOut,m)} ${i(g.quote)} per ${i(g.base)}`})}for(const f of t.lending){const p=s?.lending.find(g=>Vt(g.coinType,f.coin));u.push({starts:!0,label:`Max NAVI ${f.allowBorrow?"borrowing":"collateral"} in ${i(f.coin)} per action / per UTC day`,value:`${r(f.coin,p?.perAction??f.perAction)} / ${r(f.coin,p?.daily??f.daily)}`});const m=p?gH(p.minHealthFactor):f.minHealthFactor?.toFixed(2);m&&m!=="0.00"&&u.push({label:`Health factor kept above (${i(f.coin)})`,value:m})}if(t.staking){const f=s?.staking[0],p=f?.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(Ut,f?.perStake??t.staking.perStake)} / ${r(Ut,f?.daily??t.staking.daily)}`})}return u}const yH=new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"short",timeZone:"UTC"});function Ov(e,t){return[...xO(e,t.policy),{starts:!0,label:"Authorization ends",value:`${yH.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])=>bn(e,s,r)).join(", ")},{label:"Max gas allowance, lifetime / per UTC day",value:`${bn(e,Ut,t.gasCap)} / ${bn(e,Ut,t.gasDaily)}`},{label:"Agent gas stipend (outside the rules)",value:bn(e,Ut,t.gasAmount)}]}const vH=new Set(["deposit_object","withdraw_object","navi_open","destroy","issue","rotate_allowance","add_policy","remove_policy","set_agent","revoke_agent"]);function CO(e,t,s,r){const{inputs:i,commands:c}=r.transaction,u=(ae,Y)=>ae?bn(e,bH(ae),Y):`${Y} base units of an unknown coin`,f=ae=>ae&&typeof ae=="object"&&"Input"in ae?i[ae.Input]:void 0,p=(ae,Y)=>{const K=f(ae);if(!K||!("Pure"in K)||!K.Pure)return null;try{const w=qe(K.Pure.bytes);return Y==="u64"?F.u64().parse(w):Y==="address"?ye(F.Address.parse(w)):F.string().parse(w)}catch{return null}},m=ae=>{const Y=f(ae);if(!Y||!("Object"in Y)||!Y.Object)return null;const K=Y.Object,w="SharedObject"in K?K.SharedObject?.objectId:"ImmOrOwnedObject"in K?K.ImmOrOwnedObject?.objectId:void 0;return w?ye(w):null},g=ae=>{const Y=f(ae);return!Y||!("FundsWithdrawal"in Y)||!Y.FundsWithdrawal?null:Y.FundsWithdrawal.reservation?.MaxAmountU64??null},y=ae=>{const Y=g(ae.arguments[1]);return Y===null?"SUI":u(Ut,Y)},b=ae=>{const Y=e.pools.find(K=>K.poolId===ae);return Y?Y.venue==="deepbook"?"DeepBook":"Cetus":"a pool you did not list"},S=ae=>[e.packageId,e.publishedAt].some(Y=>ye(Y)===ye(ae)),A=c.flatMap(ae=>"MoveCall"in ae&&ae.MoveCall?[ae.MoveCall]:[]),N=A.find(ae=>S(ae.package)&&ae.module==="pass")??A.find(ae=>S(ae.package))??A[0];let j="Custom transaction",V=null;if(N&&S(N.package)){const[ae,Y]=N.typeArguments,K=N.arguments,w=(O,x=ae)=>{const G=p(K[O],"u64")??g(K[O]);return G===null?"an amount":u(x,G)};switch(N.function){case"transfer":V=p(K[K.length-2],"string"),j=`Pay ${w(3)} to ${V?`"${V}"`:"a recipient"}`;break;case"deepbook_base_to_quote":j=`Sell ${w(3)} on ${b(m(K[4]))}, accepting at least ${w(5,Y)}`;break;case"deepbook_quote_to_base":j=`Sell ${w(3,Y)} on ${b(m(K[4]))}, accepting at least ${w(5)}`;break;case"cetus_a_to_b":j=`Sell ${w(3)} on ${b(m(K[5]))}, accepting at least ${w(6,Y)}`;break;case"cetus_b_to_a":j=`Sell ${w(3,Y)} on ${b(m(K[5]))}, accepting at least ${w(6)}`;break;case"navi_supply":j=`Supply ${w(3)} to NAVI`;break;case"navi_repay":j=`Repay ${w(3)} to NAVI`;break;case"navi_withdraw":j=`Withdraw ${w(7)} from NAVI`;break;case"navi_borrow":j=`Borrow ${w(7)} from NAVI`;break;case"stake":{const O=p(K[5],"address");j=`Stake ${w(3,Ut)} with ${O?`validator ${Sy(O)}`:"a validator"}`;break}case"unstake":{const O=p(K[3],"address");j=`Unstake ${O?Sy(O):"a stake"} back to your balance`;break}default:j=vH.has(N.function)?`Call the owner-only ${N.module}::${N.function}`:`Call ${N.module}::${N.function}`}}else N&&ye(N.package)===ye("0x2")&&N.module==="allowance"&&N.function==="balance_spend"?j=`Top up the agent's gas with ${y(N)}`:N&&(j=`Call ${N.module}::${N.function}`);const C=new Map(s.map(ae=>[ye(ae.address),ae.name])),W=ye(t),ce=r.status.success?r.balanceChanges.filter(ae=>BigInt(ae.amount)>0n&&ye(ae.address)!==W).map(ae=>`${u(ae.coinType,ae.amount)} → ${C.get(ye(ae.address))??Sy(ae.address)}`):[];return{digest:r.digest,timestampMs:r.timestampMs,success:r.status.success,what:j,why:r.status.success?null:wH(e,r.status.error,V),moved:ce}}const Sy=e=>`${e.slice(0,8)}…${e.slice(-6)}`,bH=e=>e.replace(/^0x0*([0-9a-f]+)::/i,(t,s)=>`${ye(s)}::`);function wH(e,t,s){const r=t.MoveAbort;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"),f={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 allowance's daily window"},validator_set:{10:"Below the 1 SUI minimum stake",0:"Not an active validator"}};if(u===ye("0x2")||u===ye("0x3")){const g=f[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:"This entry was retired by a package upgrade; use the current SDK"},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 IO(e,t,s,r=null){const i=await e.listEvents({filter:{eventType:Fb(t)},order:"descending",limit:s,...r?{before:r}:{}});return{summaries:await Promise.all(i.events.map(async u=>{const f=await e.getTransaction({digest:u.transactionDigest}).catch(()=>null),p=f?.Transaction??f?.FailedTransaction;return{...Hb(u.bcs),digest:u.transactionDigest,timestampMs:p?.timestampMs??null}})),hasNextPage:i.hasNextPage,endCursor:i.endCursor}}async function TH(e,t,s){const r=ye(s);let i=null;for(let c=0;c<10;c++){const u=await e.listEvents({filter:{eventType:Fb(t)},order:"descending",limit:50,...i?{before:i}:{}});for(const f of u.events){const p=Hb(f.bcs);if(p.agent===r)return{...p,digest:f.transactionDigest}}if(!u.hasNextPage||!u.endCursor)return null;i=u.endCursor}return null}async function RO(e,t,s=50){return(await IO(e,t,s)).summaries}async function Kp(e,t,s){const r=ye(s);let i=null;for(let c=0;c<40;c++){const{summaries:u,hasNextPage:f,endCursor:p}=await IO(e,t,50,i),m=u.find(g=>g.id===r);if(m)return m;if(!f||!p)return null;i=p}return null}async function Yb(e,t,s){const r=await Jp(e,t,s.id),{allowances:i,gas:c}=await fH(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 jO={transaction:!0,balanceChanges:!0};async function EH(e,t,s,r,i=30){return(await e.listTransactions({filter:{sender:s},order:"descending",limit:i,include:jO})).transactions.map(u=>CO(t,s,r,u.Transaction??u.FailedTransaction))}async function SH(e,t,s=40){return(await e.listTransactions({filter:{function:`${t.publishedAt}::pass`},order:"descending",limit:s,include:jO})).transactions.map(i=>{const c=i.Transaction??i.FailedTransaction,u=ye(c.transaction?.sender??"0x0");return{...CO(t,u,[],c),sender:u}})}const l4=F.bytes(32).transform({input:e=>Ku(e),output:e=>kr(e)});F.struct("IncentiveAPYInfo",{asset_id:F.u8(),apy:F.u256(),coin_types:F.vector(F.string())});const _H=F.struct("IncentivePoolInfo",{pool_id:l4,funds:l4,phase:F.u64(),start_at:F.u64(),end_at:F.u64(),closed_at:F.u64(),total_supply:F.u64(),asset_id:F.u8(),option:F.u8(),factor:F.u256(),distributed:F.u64(),available:F.u256(),total:F.u256()});F.struct("IncentivePoolInfoByPhase",{phase:F.u64(),pools:F.vector(_H)});F.struct("OracleInfo",{oracle_id:F.u8(),price:F.u256(),decimals:F.u8(),valid:F.bool()});F.struct("FlashLoanAssetConfig",{id:F.string(),asset_id:F.u8(),coin_type:F.string(),pool_id:F.string(),rate_to_supplier:F.u64(),rate_to_treasury:F.u64(),max:F.u64(),min:F.u64()});F.struct("ReserveDataInfo",{id:F.u8(),oracle_id:F.u8(),coin_type:F.string(),supply_cap:F.u256(),borrow_cap:F.u256(),supply_rate:F.u256(),borrow_rate:F.u256(),supply_index:F.u256(),borrow_index:F.u256(),total_supply:F.u256(),total_borrow:F.u256(),last_update_at:F.u64(),ltv:F.u256(),treasury_factor:F.u256(),treasury_balance:F.u256(),base_rate:F.u256(),multiplier:F.u256(),jump_rate_multiplier:F.u256(),reserve_factor:F.u256(),optimal_utilization:F.u256(),liquidation_ratio:F.u256(),liquidation_bonus:F.u256(),liquidation_threshold:F.u256()});F.struct("UserStateInfo",{asset_id:F.u8(),borrow_balance:F.u256(),supply_balance:F.u256()});var _y,u4;function kH(){if(u4)return _y;u4=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",f="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",S="\\ufe0e\\ufe0f",A=p+m+g+y,N="['’]",j="["+r+"]",V="["+A+"]",C="["+i+c+"]",W="\\d+",ce="["+u+"]",ae="["+f+"]",Y="[^"+r+A+W+u+f+b+"]",K="\\ud83c[\\udffb-\\udfff]",w="(?:"+C+"|"+K+")",O="[^"+r+"]",x="(?:\\ud83c[\\udde6-\\uddff]){2}",G="[\\ud800-\\udbff][\\udc00-\\udfff]",U="["+b+"]",H="\\u200d",$="(?:"+ae+"|"+Y+")",M="(?:"+U+"|"+Y+")",k="(?:"+N+"(?:d|ll|m|re|s|t|ve))?",I="(?:"+N+"(?:D|LL|M|RE|S|T|VE))?",D=w+"?",L="["+S+"]?",X="(?:"+H+"(?:"+[O,x,G].join("|")+")"+L+D+")*",z=L+D+X,ie="(?:"+[ce,x,G].join("|")+")"+z,fe="(?:"+[O+C+"?",C,x,G,j].join("|")+")",R=RegExp(N,"g"),J=RegExp(C,"g"),le=RegExp(K+"(?="+K+")|"+fe+z,"g"),pe=RegExp([U+"?"+ae+"+"+k+"(?="+[V,U,"$"].join("|")+")",M+"+"+I+"(?="+[V,U+$,"$"].join("|")+")",U+"?"+$+"+"+k,U+"+"+I,W,ie].join("|"),"g"),Te=RegExp("["+H+r+i+c+S+"]"),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 Ec=="object"&&Ec&&Ec.Object===Object&&Ec,_e=typeof self=="object"&&self&&self.Object===Object&&self,Pe=be||_e||Function("return this")();function at(Ce,Ye,Ot,Ss){for(var jn=-1,So=Ce?Ce.length:0;++jn<So;)Ot=Ye(Ot,Ce[jn],jn,Ce);return Ot}function P(Ce){return Ce.split("")}function te(Ce){return Ce.match(t)||[]}function de(Ce){return function(Ye){return Ce?.[Ye]}}var he=de(Ae);function ue(Ce){return Te.test(Ce)}function ze(Ce){return Oe.test(Ce)}function Le(Ce){return ue(Ce)?Mt(Ce):P(Ce)}function Mt(Ce){return Ce.match(le)||[]}function Es(Ce){return Ce.match(pe)||[]}var va=Object.prototype,cl=va.toString,bi=Pe.Symbol,Eo=bi?bi.prototype:void 0,ll=Eo?Eo.toString:void 0;function sr(Ce,Ye,Ot){var Ss=-1,jn=Ce.length;Ye<0&&(Ye=-Ye>jn?0:jn+Ye),Ot=Ot>jn?jn:Ot,Ot<0&&(Ot+=jn),jn=Ye>Ot?0:Ot-Ye>>>0,Ye>>>=0;for(var So=Array(jn);++Ss<jn;)So[Ss]=Ce[Ss+Ye];return So}function ul(Ce){if(typeof Ce=="string")return Ce;if(hl(Ce))return ll?ll.call(Ce):"";var Ye=Ce+"";return Ye=="0"&&1/Ce==-1/0?"-0":Ye}function dl(Ce,Ye,Ot){var Ss=Ce.length;return Ot=Ot===void 0?Ss:Ot,!Ye&&Ot>=Ss?Ce:sr(Ce,Ye,Ot)}function em(Ce){return function(Ye){Ye=ba(Ye);var Ot=ue(Ye)?Le(Ye):void 0,Ss=Ot?Ot[0]:Ye.charAt(0),jn=Ot?dl(Ot,1).join(""):Ye.slice(1);return Ss[Ce]()+jn}}function fd(Ce){return function(Ye){return at(hd(Ln(Ye).replace(R,"")),Ce,"")}}function fl(Ce){return!!Ce&&typeof Ce=="object"}function hl(Ce){return typeof Ce=="symbol"||fl(Ce)&&cl.call(Ce)==e}function ba(Ce){return Ce==null?"":ul(Ce)}var tm=fd(function(Ce,Ye,Ot){return Ye=Ye.toLowerCase(),Ce+(Ot?nm(Ye):Ye)});function nm(Ce){return sm(ba(Ce).toLowerCase())}function Ln(Ce){return Ce=ba(Ce),Ce&&Ce.replace(s,he).replace(J,"")}var sm=em("toUpperCase");function hd(Ce,Ye,Ot){return Ce=ba(Ce),Ye=Ye,Ye===void 0?ze(Ce)?Es(Ce):te(Ce):Ce.match(Ye)||[]}return _y=tm,_y}kH();var AH=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ky=Math.ceil,Ms=Math.floor,ns="[BigNumber Error] ",d4=ns+"Number primitive has more than 15 significant digits: ",Zs=1e14,Ze=14,Ay=9007199254740991,Oy=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ka=1e7,vn=1e9;function MO(e){var t,s,r,i=C.prototype={constructor:C,toString:null,valueOf:null},c=new C(1),u=20,f=4,p=-7,m=21,g=-1e7,y=1e7,b=!1,S=1,A=0,N={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},j="0123456789abcdefghijklmnopqrstuvwxyz",V=!0;function C(w,O){var x,G,U,H,$,M,k,I,D=this;if(!(D instanceof C))return new C(w,O);if(O==null){if(w&&w._isBigNumber===!0){D.s=w.s,!w.c||w.e>y?D.c=D.e=null:w.e<g?D.c=[D.e=0]:(D.e=w.e,D.c=w.c.slice());return}if((M=typeof w=="number")&&w*0==0){if(D.s=1/w<0?(w=-w,-1):1,w===~~w){for(H=0,$=w;$>=10;$/=10,H++);H>y?D.c=D.e=null:(D.e=H,D.c=[w]);return}I=String(w)}else{if(!AH.test(I=String(w)))return r(D,I,M);D.s=I.charCodeAt(0)==45?(I=I.slice(1),-1):1}(H=I.indexOf("."))>-1&&(I=I.replace(".","")),($=I.search(/e/i))>0?(H<0&&(H=$),H+=+I.slice($+1),I=I.substring(0,$)):H<0&&(H=I.length)}else{if(zt(O,2,j.length,"Base"),O==10&&V)return D=new C(w),Y(D,u+D.e+1,f);if(I=String(w),M=typeof w=="number"){if(w*0!=0)return r(D,I,M,O);if(D.s=1/w<0?(I=I.slice(1),-1):1,C.DEBUG&&I.replace(/^0\.0*|\./,"").length>15)throw Error(d4+w)}else D.s=I.charCodeAt(0)===45?(I=I.slice(1),-1):1;for(x=j.slice(0,O),H=$=0,k=I.length;$<k;$++)if(x.indexOf(G=I.charAt($))<0){if(G=="."){if($>H){H=k;continue}}else if(!U&&(I==I.toUpperCase()&&(I=I.toLowerCase())||I==I.toLowerCase()&&(I=I.toUpperCase()))){U=!0,$=-1,H=0;continue}return r(D,String(w),M,O)}M=!1,I=s(I,O,10,D.s),(H=I.indexOf("."))>-1?I=I.replace(".",""):H=I.length}for($=0;I.charCodeAt($)===48;$++);for(k=I.length;I.charCodeAt(--k)===48;);if(I=I.slice($,++k)){if(k-=$,M&&C.DEBUG&&k>15&&(w>Ay||w!==Ms(w)))throw Error(d4+D.s*w);if((H=H-$-1)>y)D.c=D.e=null;else if(H<g)D.c=[D.e=0];else{if(D.e=H,D.c=[],$=(H+1)%Ze,H<0&&($+=Ze),$<k){for($&&D.c.push(+I.slice(0,$)),k-=Ze;$<k;)D.c.push(+I.slice($,$+=Ze));$=Ze-(I=I.slice($)).length}else $-=k;for(;$--;I+="0");D.c.push(+I)}}else D.c=[D.e=0]}C.clone=MO,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(w){var O,x;if(w!=null)if(typeof w=="object"){if(w.hasOwnProperty(O="DECIMAL_PLACES")&&(x=w[O],zt(x,0,vn,O),u=x),w.hasOwnProperty(O="ROUNDING_MODE")&&(x=w[O],zt(x,0,8,O),f=x),w.hasOwnProperty(O="EXPONENTIAL_AT")&&(x=w[O],x&&x.pop?(zt(x[0],-vn,0,O),zt(x[1],0,vn,O),p=x[0],m=x[1]):(zt(x,-vn,vn,O),p=-(m=x<0?-x:x))),w.hasOwnProperty(O="RANGE"))if(x=w[O],x&&x.pop)zt(x[0],-vn,-1,O),zt(x[1],1,vn,O),g=x[0],y=x[1];else if(zt(x,-vn,vn,O),x)g=-(y=x<0?-x:x);else throw Error(ns+O+" cannot be zero: "+x);if(w.hasOwnProperty(O="CRYPTO"))if(x=w[O],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))b=x;else throw b=!x,Error(ns+"crypto unavailable");else b=x;else throw Error(ns+O+" not true or false: "+x);if(w.hasOwnProperty(O="MODULO_MODE")&&(x=w[O],zt(x,0,9,O),S=x),w.hasOwnProperty(O="POW_PRECISION")&&(x=w[O],zt(x,0,vn,O),A=x),w.hasOwnProperty(O="FORMAT"))if(x=w[O],typeof x=="object")N=x;else throw Error(ns+O+" not an object: "+x);if(w.hasOwnProperty(O="ALPHABET"))if(x=w[O],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))V=x.slice(0,10)=="0123456789",j=x;else throw Error(ns+O+" invalid: "+x)}else throw Error(ns+"Object expected: "+w);return{DECIMAL_PLACES:u,ROUNDING_MODE:f,EXPONENTIAL_AT:[p,m],RANGE:[g,y],CRYPTO:b,MODULO_MODE:S,POW_PRECISION:A,FORMAT:N,ALPHABET:j}},C.isBigNumber=function(w){if(!w||w._isBigNumber!==!0)return!1;if(!C.DEBUG)return!0;var O,x,G=w.c,U=w.e,H=w.s;e:if({}.toString.call(G)=="[object Array]"){if((H===1||H===-1)&&U>=-vn&&U<=vn&&U===Ms(U)){if(G[0]===0){if(U===0&&G.length===1)return!0;break e}if(O=(U+1)%Ze,O<1&&(O+=Ze),String(G[0]).length==O){for(O=0;O<G.length;O++)if(x=G[O],x<0||x>=Zs||x!==Ms(x))break e;if(x!==0)return!0}}}else if(G===null&&U===null&&(H===null||H===1||H===-1))return!0;throw Error(ns+"Invalid BigNumber: "+w)},C.maximum=C.max=function(){return ce(arguments,-1)},C.minimum=C.min=function(){return ce(arguments,1)},C.random=(function(){var w=9007199254740992,O=Math.random()*w&2097151?function(){return Ms(Math.random()*w)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var G,U,H,$,M,k=0,I=[],D=new C(c);if(x==null?x=u:zt(x,0,vn),$=ky(x/Ze),b)if(crypto.getRandomValues){for(G=crypto.getRandomValues(new Uint32Array($*=2));k<$;)M=G[k]*131072+(G[k+1]>>>11),M>=9e15?(U=crypto.getRandomValues(new Uint32Array(2)),G[k]=U[0],G[k+1]=U[1]):(I.push(M%1e14),k+=2);k=$/2}else if(crypto.randomBytes){for(G=crypto.randomBytes($*=7);k<$;)M=(G[k]&31)*281474976710656+G[k+1]*1099511627776+G[k+2]*4294967296+G[k+3]*16777216+(G[k+4]<<16)+(G[k+5]<<8)+G[k+6],M>=9e15?crypto.randomBytes(7).copy(G,k):(I.push(M%1e14),k+=7);k=$/7}else throw b=!1,Error(ns+"crypto unavailable");if(!b)for(;k<$;)M=O(),M<9e15&&(I[k++]=M%1e14);for($=I[--k],x%=Ze,$&&x&&(M=Oy[Ze-x],I[k]=Ms($/M)*M);I[k]===0;I.pop(),k--);if(k<0)I=[H=0];else{for(H=-1;I[0]===0;I.splice(0,1),H-=Ze);for(k=1,M=I[0];M>=10;M/=10,k++);k<Ze&&(H-=Ze-k)}return D.e=H,D.c=I,D}})(),C.sum=function(){for(var w=1,O=arguments,x=new C(O[0]);w<O.length;)x=x.plus(O[w++]);return x},s=(function(){var w="0123456789";function O(x,G,U,H){for(var $,M=[0],k,I=0,D=x.length;I<D;){for(k=M.length;k--;M[k]*=G);for(M[0]+=H.indexOf(x.charAt(I++)),$=0;$<M.length;$++)M[$]>U-1&&(M[$+1]==null&&(M[$+1]=0),M[$+1]+=M[$]/U|0,M[$]%=U)}return M.reverse()}return function(x,G,U,H,$){var M,k,I,D,L,X,z,ie,fe=x.indexOf("."),R=u,J=f;for(fe>=0&&(D=A,A=0,x=x.replace(".",""),ie=new C(G),X=ie.pow(x.length-fe),A=D,ie.c=O(Qr(js(X.c),X.e,"0"),10,U,w),ie.e=ie.c.length),z=O(x,G,U,$?(M=j,w):(M=w,j)),I=D=z.length;z[--D]==0;z.pop());if(!z[0])return M.charAt(0);if(fe<0?--I:(X.c=z,X.e=I,X.s=H,X=t(X,ie,R,J,U),z=X.c,L=X.r,I=X.e),k=I+R+1,fe=z[k],D=U/2,L=L||k<0||z[k+1]!=null,L=J<4?(fe!=null||L)&&(J==0||J==(X.s<0?3:2)):fe>D||fe==D&&(J==4||L||J==6&&z[k-1]&1||J==(X.s<0?8:7)),k<1||!z[0])x=L?Qr(M.charAt(1),-R,M.charAt(0)):M.charAt(0);else{if(z.length=k,L)for(--U;++z[--k]>U;)z[k]=0,k||(++I,z=[1].concat(z));for(D=z.length;!z[--D];);for(fe=0,x="";fe<=D;x+=M.charAt(z[fe++]));x=Qr(x,I,M.charAt(0))}return x}})(),t=(function(){function w(G,U,H){var $,M,k,I,D=0,L=G.length,X=U%Ka,z=U/Ka|0;for(G=G.slice();L--;)k=G[L]%Ka,I=G[L]/Ka|0,$=z*k+I*X,M=X*k+$%Ka*Ka+D,D=(M/H|0)+($/Ka|0)+z*I,G[L]=M%H;return D&&(G=[D].concat(G)),G}function O(G,U,H,$){var M,k;if(H!=$)k=H>$?1:-1;else for(M=k=0;M<H;M++)if(G[M]!=U[M]){k=G[M]>U[M]?1:-1;break}return k}function x(G,U,H,$){for(var M=0;H--;)G[H]-=M,M=G[H]<U[H]?1:0,G[H]=M*$+G[H]-U[H];for(;!G[0]&&G.length>1;G.splice(0,1));}return function(G,U,H,$,M){var k,I,D,L,X,z,ie,fe,R,J,le,pe,Te,Oe,Ae,be,_e,Pe=G.s==U.s?1:-1,at=G.c,P=U.c;if(!at||!at[0]||!P||!P[0])return new C(!G.s||!U.s||(at?P&&at[0]==P[0]:!P)?NaN:at&&at[0]==0||!P?Pe*0:Pe/0);for(fe=new C(Pe),R=fe.c=[],I=G.e-U.e,Pe=H+I+1,M||(M=Zs,I=Ds(G.e/Ze)-Ds(U.e/Ze),Pe=Pe/Ze|0),D=0;P[D]==(at[D]||0);D++);if(P[D]>(at[D]||0)&&I--,Pe<0)R.push(1),L=!0;else{for(Oe=at.length,be=P.length,D=0,Pe+=2,X=Ms(M/(P[0]+1)),X>1&&(P=w(P,X,M),at=w(at,X,M),be=P.length,Oe=at.length),Te=be,J=at.slice(0,be),le=J.length;le<be;J[le++]=0);_e=P.slice(),_e=[0].concat(_e),Ae=P[0],P[1]>=M/2&&Ae++;do{if(X=0,k=O(P,J,be,le),k<0){if(pe=J[0],be!=le&&(pe=pe*M+(J[1]||0)),X=Ms(pe/Ae),X>1)for(X>=M&&(X=M-1),z=w(P,X,M),ie=z.length,le=J.length;O(z,J,ie,le)==1;)X--,x(z,be<ie?_e:P,ie,M),ie=z.length,k=1;else X==0&&(k=X=1),z=P.slice(),ie=z.length;if(ie<le&&(z=[0].concat(z)),x(J,z,le,M),le=J.length,k==-1)for(;O(P,J,be,le)<1;)X++,x(J,be<le?_e:P,le,M),le=J.length}else k===0&&(X++,J=[0]);R[D++]=X,J[0]?J[le++]=at[Te]||0:(J=[at[Te]],le=1)}while((Te++<Oe||J[0]!=null)&&Pe--);L=J[0]!=null,R[0]||R.splice(0,1)}if(M==Zs){for(D=1,Pe=R[0];Pe>=10;Pe/=10,D++);Y(fe,H+(fe.e=D+I*Ze-1)+1,$,L)}else fe.e=I,fe.r=+L;return fe}})();function W(w,O,x,G){var U,H,$,M,k;if(x==null?x=f:zt(x,0,8),!w.c)return w.toString();if(U=w.c[0],$=w.e,O==null)k=js(w.c),k=G==1||G==2&&($<=p||$>=m)?rh(k,$):Qr(k,$,"0");else if(w=Y(new C(w),O,x),H=w.e,k=js(w.c),M=k.length,G==1||G==2&&(O<=H||H<=p)){for(;M<O;k+="0",M++);k=rh(k,H)}else if(O-=$,k=Qr(k,H,"0"),H+1>M){if(--O>0)for(k+=".";O--;k+="0");}else if(O+=H-M,O>0)for(H+1==M&&(k+=".");O--;k+="0");return w.s<0&&U?"-"+k:k}function ce(w,O){for(var x,G,U=1,H=new C(w[0]);U<w.length;U++)G=new C(w[U]),(!G.s||(x=Zi(H,G))===O||x===0&&H.s===O)&&(H=G);return H}function ae(w,O,x){for(var G=1,U=O.length;!O[--U];O.pop());for(U=O[0];U>=10;U/=10,G++);return(x=G+x*Ze-1)>y?w.c=w.e=null:x<g?w.c=[w.e=0]:(w.e=x,w.c=O),w}r=(function(){var w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,O=/^([^.]+)\.$/,x=/^\.([^.]+)$/,G=/^-?(Infinity|NaN)$/,U=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(H,$,M,k){var I,D=M?$:$.replace(U,"");if(G.test(D))H.s=isNaN(D)?null:D<0?-1:1;else{if(!M&&(D=D.replace(w,function(L,X,z){return I=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!k||k==I?X:L}),k&&(I=k,D=D.replace(O,"$1").replace(x,"0.$1")),$!=D))return new C(D,I);if(C.DEBUG)throw Error(ns+"Not a"+(k?" base "+k:"")+" number: "+$);H.s=null}H.c=H.e=null}})();function Y(w,O,x,G){var U,H,$,M,k,I,D,L=w.c,X=Oy;if(L){e:{for(U=1,M=L[0];M>=10;M/=10,U++);if(H=O-U,H<0)H+=Ze,$=O,k=L[I=0],D=Ms(k/X[U-$-1]%10);else if(I=ky((H+1)/Ze),I>=L.length)if(G){for(;L.length<=I;L.push(0));k=D=0,U=1,H%=Ze,$=H-Ze+1}else break e;else{for(k=M=L[I],U=1;M>=10;M/=10,U++);H%=Ze,$=H-Ze+U,D=$<0?0:Ms(k/X[U-$-1]%10)}if(G=G||O<0||L[I+1]!=null||($<0?k:k%X[U-$-1]),G=x<4?(D||G)&&(x==0||x==(w.s<0?3:2)):D>5||D==5&&(x==4||G||x==6&&(H>0?$>0?k/X[U-$]:0:L[I-1])%10&1||x==(w.s<0?8:7)),O<1||!L[0])return L.length=0,G?(O-=w.e+1,L[0]=X[(Ze-O%Ze)%Ze],w.e=-O||0):L[0]=w.e=0,w;if(H==0?(L.length=I,M=1,I--):(L.length=I+1,M=X[Ze-H],L[I]=$>0?Ms(k/X[U-$]%X[$])*M:0),G)for(;;)if(I==0){for(H=1,$=L[0];$>=10;$/=10,H++);for($=L[0]+=M,M=1;$>=10;$/=10,M++);H!=M&&(w.e++,L[0]==Zs&&(L[0]=1));break}else{if(L[I]+=M,L[I]!=Zs)break;L[I--]=0,M=1}for(H=L.length;L[--H]===0;L.pop());}w.e>y?w.c=w.e=null:w.e<g&&(w.c=[w.e=0])}return w}function K(w){var O,x=w.e;return x===null?w.toString():(O=js(w.c),O=x<=p||x>=m?rh(O,x):Qr(O,x,"0"),w.s<0?"-"+O:O)}return i.absoluteValue=i.abs=function(){var w=new C(this);return w.s<0&&(w.s=1),w},i.comparedTo=function(w,O){return Zi(this,new C(w,O))},i.decimalPlaces=i.dp=function(w,O){var x,G,U,H=this;if(w!=null)return zt(w,0,vn),O==null?O=f:zt(O,0,8),Y(new C(H),w+H.e+1,O);if(!(x=H.c))return null;if(G=((U=x.length-1)-Ds(this.e/Ze))*Ze,U=x[U])for(;U%10==0;U/=10,G--);return G<0&&(G=0),G},i.dividedBy=i.div=function(w,O){return t(this,new C(w,O),u,f)},i.dividedToIntegerBy=i.idiv=function(w,O){return t(this,new C(w,O),0,1)},i.exponentiatedBy=i.pow=function(w,O){var x,G,U,H,$,M,k,I,D,L=this;if(w=new C(w),w.c&&!w.isInteger())throw Error(ns+"Exponent not an integer: "+K(w));if(O!=null&&(O=new C(O)),M=w.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!w.c||!w.c[0])return D=new C(Math.pow(+K(L),M?w.s*(2-sh(w)):+K(w))),O?D.mod(O):D;if(k=w.s<0,O){if(O.c?!O.c[0]:!O.s)return new C(NaN);G=!k&&L.isInteger()&&O.isInteger(),G&&(L=L.mod(O))}else{if(w.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||M&&L.c[1]>=24e7:L.c[0]<8e13||M&&L.c[0]<=9999975e7)))return H=L.s<0&&sh(w)?-0:0,L.e>-1&&(H=1/H),new C(k?1/H:H);A&&(H=ky(A/Ze+2))}for(M?(x=new C(.5),k&&(w.s=1),I=sh(w)):(U=Math.abs(+K(w)),I=U%2),D=new C(c);;){if(I){if(D=D.times(L),!D.c)break;H?D.c.length>H&&(D.c.length=H):G&&(D=D.mod(O))}if(U){if(U=Ms(U/2),U===0)break;I=U%2}else if(w=w.times(x),Y(w,w.e+1,1),w.e>14)I=sh(w);else{if(U=+K(w),U===0)break;I=U%2}L=L.times(L),H?L.c&&L.c.length>H&&(L.c.length=H):G&&(L=L.mod(O))}return G?D:(k&&(D=c.div(D)),O?D.mod(O):H?Y(D,A,f,$):D)},i.integerValue=function(w){var O=new C(this);return w==null?w=f:zt(w,0,8),Y(O,O.e+1,w)},i.isEqualTo=i.eq=function(w,O){return Zi(this,new C(w,O))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(w,O){return Zi(this,new C(w,O))>0},i.isGreaterThanOrEqualTo=i.gte=function(w,O){return(O=Zi(this,new C(w,O)))===1||O===0},i.isInteger=function(){return!!this.c&&Ds(this.e/Ze)>this.c.length-2},i.isLessThan=i.lt=function(w,O){return Zi(this,new C(w,O))<0},i.isLessThanOrEqualTo=i.lte=function(w,O){return(O=Zi(this,new C(w,O)))===-1||O===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,O){var x,G,U,H,$=this,M=$.s;if(w=new C(w,O),O=w.s,!M||!O)return new C(NaN);if(M!=O)return w.s=-O,$.plus(w);var k=$.e/Ze,I=w.e/Ze,D=$.c,L=w.c;if(!k||!I){if(!D||!L)return D?(w.s=-O,w):new C(L?$:NaN);if(!D[0]||!L[0])return L[0]?(w.s=-O,w):new C(D[0]?$:f==3?-0:0)}if(k=Ds(k),I=Ds(I),D=D.slice(),M=k-I){for((H=M<0)?(M=-M,U=D):(I=k,U=L),U.reverse(),O=M;O--;U.push(0));U.reverse()}else for(G=(H=(M=D.length)<(O=L.length))?M:O,M=O=0;O<G;O++)if(D[O]!=L[O]){H=D[O]<L[O];break}if(H&&(U=D,D=L,L=U,w.s=-w.s),O=(G=L.length)-(x=D.length),O>0)for(;O--;D[x++]=0);for(O=Zs-1;G>M;){if(D[--G]<L[G]){for(x=G;x&&!D[--x];D[x]=O);--D[x],D[G]+=Zs}D[G]-=L[G]}for(;D[0]==0;D.splice(0,1),--I);return D[0]?ae(w,D,I):(w.s=f==3?-1:1,w.c=[w.e=0],w)},i.modulo=i.mod=function(w,O){var x,G,U=this;return w=new C(w,O),!U.c||!w.s||w.c&&!w.c[0]?new C(NaN):!w.c||U.c&&!U.c[0]?new C(U):(S==9?(G=w.s,w.s=1,x=t(U,w,0,3),w.s=G,x.s*=G):x=t(U,w,0,S),w=U.minus(x.times(w)),!w.c[0]&&S==1&&(w.s=U.s),w)},i.multipliedBy=i.times=function(w,O){var x,G,U,H,$,M,k,I,D,L,X,z,ie,fe,R,J=this,le=J.c,pe=(w=new C(w,O)).c;if(!le||!pe||!le[0]||!pe[0])return!J.s||!w.s||le&&!le[0]&&!pe||pe&&!pe[0]&&!le?w.c=w.e=w.s=null:(w.s*=J.s,!le||!pe?w.c=w.e=null:(w.c=[0],w.e=0)),w;for(G=Ds(J.e/Ze)+Ds(w.e/Ze),w.s*=J.s,k=le.length,L=pe.length,k<L&&(ie=le,le=pe,pe=ie,U=k,k=L,L=U),U=k+L,ie=[];U--;ie.push(0));for(fe=Zs,R=Ka,U=L;--U>=0;){for(x=0,X=pe[U]%R,z=pe[U]/R|0,$=k,H=U+$;H>U;)I=le[--$]%R,D=le[$]/R|0,M=z*I+D*X,I=X*I+M%R*R+ie[H]+x,x=(I/fe|0)+(M/R|0)+z*D,ie[H--]=I%fe;ie[H]=x}return x?++G:ie.splice(0,1),ae(w,ie,G)},i.negated=function(){var w=new C(this);return w.s=-w.s||null,w},i.plus=function(w,O){var x,G=this,U=G.s;if(w=new C(w,O),O=w.s,!U||!O)return new C(NaN);if(U!=O)return w.s=-O,G.minus(w);var H=G.e/Ze,$=w.e/Ze,M=G.c,k=w.c;if(!H||!$){if(!M||!k)return new C(U/0);if(!M[0]||!k[0])return k[0]?w:new C(M[0]?G:U*0)}if(H=Ds(H),$=Ds($),M=M.slice(),U=H-$){for(U>0?($=H,x=k):(U=-U,x=M),x.reverse();U--;x.push(0));x.reverse()}for(U=M.length,O=k.length,U-O<0&&(x=k,k=M,M=x,O=U),U=0;O;)U=(M[--O]=M[O]+k[O]+U)/Zs|0,M[O]=Zs===M[O]?0:M[O]%Zs;return U&&(M=[U].concat(M),++$),ae(w,M,$)},i.precision=i.sd=function(w,O){var x,G,U,H=this;if(w!=null&&w!==!!w)return zt(w,1,vn),O==null?O=f:zt(O,0,8),Y(new C(H),w,O);if(!(x=H.c))return null;if(U=x.length-1,G=U*Ze+1,U=x[U]){for(;U%10==0;U/=10,G--);for(U=x[0];U>=10;U/=10,G++);}return w&&H.e+1>G&&(G=H.e+1),G},i.shiftedBy=function(w){return zt(w,-Ay,Ay),this.times("1e"+w)},i.squareRoot=i.sqrt=function(){var w,O,x,G,U,H=this,$=H.c,M=H.s,k=H.e,I=u+4,D=new C("0.5");if(M!==1||!$||!$[0])return new C(!M||M<0&&(!$||$[0])?NaN:$?H:1/0);if(M=Math.sqrt(+K(H)),M==0||M==1/0?(O=js($),(O.length+k)%2==0&&(O+="0"),M=Math.sqrt(+O),k=Ds((k+1)/2)-(k<0||k%2),M==1/0?O="5e"+k:(O=M.toExponential(),O=O.slice(0,O.indexOf("e")+1)+k),x=new C(O)):x=new C(M+""),x.c[0]){for(k=x.e,M=k+I,M<3&&(M=0);;)if(U=x,x=D.times(U.plus(t(H,U,I,1))),js(U.c).slice(0,M)===(O=js(x.c)).slice(0,M))if(x.e<k&&--M,O=O.slice(M-3,M+1),O=="9999"||!G&&O=="4999"){if(!G&&(Y(U,U.e+u+2,0),U.times(U).eq(H))){x=U;break}I+=4,M+=4,G=1}else{(!+O||!+O.slice(1)&&O.charAt(0)=="5")&&(Y(x,x.e+u+2,1),w=!x.times(x).eq(H));break}}return Y(x,x.e+u+1,f,w)},i.toExponential=function(w,O){return w!=null&&(zt(w,0,vn),w++),W(this,w,O,1)},i.toFixed=function(w,O){return w!=null&&(zt(w,0,vn),w=w+this.e+1),W(this,w,O)},i.toFormat=function(w,O,x){var G,U=this;if(x==null)w!=null&&O&&typeof O=="object"?(x=O,O=null):w&&typeof w=="object"?(x=w,w=O=null):x=N;else if(typeof x!="object")throw Error(ns+"Argument not an object: "+x);if(G=U.toFixed(w,O),U.c){var H,$=G.split("."),M=+x.groupSize,k=+x.secondaryGroupSize,I=x.groupSeparator||"",D=$[0],L=$[1],X=U.s<0,z=X?D.slice(1):D,ie=z.length;if(k&&(H=M,M=k,k=H,ie-=H),M>0&&ie>0){for(H=ie%M||M,D=z.substr(0,H);H<ie;H+=M)D+=I+z.substr(H,M);k>0&&(D+=I+z.slice(H)),X&&(D="-"+D)}G=L?D+(x.decimalSeparator||"")+((k=+x.fractionGroupSize)?L.replace(new RegExp("\\d{"+k+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):L):D}return(x.prefix||"")+G+(x.suffix||"")},i.toFraction=function(w){var O,x,G,U,H,$,M,k,I,D,L,X,z=this,ie=z.c;if(w!=null&&(M=new C(w),!M.isInteger()&&(M.c||M.s!==1)||M.lt(c)))throw Error(ns+"Argument "+(M.isInteger()?"out of range: ":"not an integer: ")+K(M));if(!ie)return new C(z);for(O=new C(c),I=x=new C(c),G=k=new C(c),X=js(ie),H=O.e=X.length-z.e-1,O.c[0]=Oy[($=H%Ze)<0?Ze+$:$],w=!w||M.comparedTo(O)>0?H>0?O:I:M,$=y,y=1/0,M=new C(X),k.c[0]=0;D=t(M,O,0,1),U=x.plus(D.times(G)),U.comparedTo(w)!=1;)x=G,G=U,I=k.plus(D.times(U=I)),k=U,O=M.minus(D.times(U=O)),M=U;return U=t(w.minus(x),G,0,1),k=k.plus(U.times(I)),x=x.plus(U.times(G)),k.s=I.s=z.s,H=H*2,L=t(I,G,H,f).minus(z).abs().comparedTo(t(k,x,H,f).minus(z).abs())<1?[I,G]:[k,x],y=$,L},i.toNumber=function(){return+K(this)},i.toPrecision=function(w,O){return w!=null&&zt(w,1,vn),W(this,w,O,2)},i.toString=function(w){var O,x=this,G=x.s,U=x.e;return U===null?G?(O="Infinity",G<0&&(O="-"+O)):O="NaN":(w==null?O=U<=p||U>=m?rh(js(x.c),U):Qr(js(x.c),U,"0"):w===10&&V?(x=Y(new C(x),u+U+1,f),O=Qr(js(x.c),x.e,"0")):(zt(w,2,j.length,"Base"),O=s(Qr(js(x.c),U,"0"),10,w,G,!0)),G<0&&x.c[0]&&(O="-"+O)),O},i.valueOf=i.toJSON=function(){return K(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&C.set(e),C}function Ds(e){var t=e|0;return e>0||e===t?t:t-1}function js(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 Zi(e,t){var s,r,i=e.c,c=t.c,u=e.s,f=t.s,p=e.e,m=t.e;if(!u||!f)return null;if(s=i&&!i[0],r=c&&!c[0],s||r)return s?r?0:-f:u;if(u!=f)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(f=(p=i.length)<(m=c.length)?p:m,u=0;u<f;u++)if(i[u]!=c[u])return i[u]>c[u]^s?1:-1;return p==m?0:p>m^s?1:-1}function zt(e,t,s,r){if(e<t||e>s||e!==Ms(e))throw Error(ns+(r||"Argument")+(typeof e=="number"?e<t||e>s?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function sh(e){var t=e.c.length-1;return Ds(e.e/Ze)==t&&e.c[t]%2!=0}function rh(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Qr(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}MO();const OH="2.0.12",DO={version:OH},NH=DO.version,xH=()=>{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"},CH=()=>{let e="";return typeof process<"u"&&process.versions&&process.versions.node&&(e=`lending/${NH} (${xH()})`),e},f4=CH(),IH="https://fullnode.mainnet.sui.io:443";let Ny;function RH(){return Ny||(Ny=new lb({network:"mainnet",transport:new Qv({baseUrl:IH})})),Ny}function jH(e,t="mainnet"){return RH()}const MH=16*1024;function Wb(e){return e.replace(/^0x/i,"")}function h4(e){const t=Wb(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 DH(e,t){return(e[t]<<8)+e[t+1]}function p4(e){return F.vector(F.U8).serialize(Array.from(e),{maxSize:MH})}function m4(e,t){return{type:e,bcs:t}}function UH(e){return F.vector(F.U8).serialize(Array.from(new TextEncoder().encode(e))).toBytes()}function BH(e){return F.struct("PriceIdentifier",{bytes:F.vector(F.U8)}).serialize({bytes:Array.from(e)}).toBytes()}function LH(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 zH(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]=LH(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 $H(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}class UO{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($H)}async get(t,s,r){const i=new AbortController,c=setTimeout(()=>i.abort(),this.timeout),u=new URL(`${this.endpoint}${t}`);for(const[f,p]of Object.entries(r??{}))u.searchParams.set(f,p);for(const f of s)u.searchParams.append("ids[]",Wb(f));try{const f=await fetch(u,{signal:i.signal});if(!f.ok)throw new Error(`Hermes request failed: ${f.status} ${f.statusText}`);return await f.json()}finally{clearTimeout(c)}}}class VH{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),f=await this.getBaseUpdateFee(),p=t.splitCoins(i?.feeCoin??t.gas,r.map(()=>t.pure.u64(f)));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(p4(i)),s.object(oh)]});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(p4(s[0])),c,t.object(oh)]});return u}async executePriceFeedUpdates(t,s,r,i,c){const u=[];for(const[f,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[f],t.object(oh)]})}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=Wb(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:f}=await u.getDynamicField({parentId:r,name:m4(c,BH(h4(s)))}),p=f?.value?.bcs;this.priceFeedObjectIdCache.set(s,p&&p.length===32?F.Address.parse(Uint8Array.from(p)):void 0)}else{const f=await this.getDynamicMoveObjectJson(r,{type:c,value:{bytes:Array.from(h4(s))}});f?.fields?this.priceFeedObjectIdCache.set(s,f.fields.value):this.priceFeedObjectIdCache.set(s,void 0)}}return this.priceFeedObjectIdCache.get(s)}async getPriceTableInfo(){if(!this.priceTableInfo){const t=this.getCoreProvider()?m4("vector<u8>",UH("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:zH(s.type)}}return this.priceTableInfo}extractVaaBytesFromAccumulatorMessage(t){const s=7+t[6]+1,r=DH(t,s),i=s+2;return t.subarray(i,i+r)}}const PH="https://open-api.naviprotocol.io/api";let GH={},FH=0;function HH(e){return e.replace(/\/+$/,"")}function g4(){return FH}function BO(e){const t=e?.services?.naviOpenApi??GH.services?.naviOpenApi;return{baseUrl:HH(t?.baseUrl??PH),headers:t?.headers}}function qH(e,t){const s=BO(t),r=e.startsWith("/")?e:`/${e}`;return`${s.baseUrl}${r}`}function ZH(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 YH(e,t){return{...ZH(e),...t?.headers??{}}}const LO=jH();function WH(e){return{json:!!e?.showContent,display:!!e?.showDisplay,previousTransaction:!!e?.showPreviousTransaction,objectBcs:!!e?.showBcs}}function XH(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 JH(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:WH(t.options)});return r.map(XH)}function zO(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:f,cacheTime:p,...m}=r;m.__naviSdkServiceConfigVersion=g4(),t.push(m),s=!0}else t.push(r)}),s||t.push({__naviSdkServiceConfigVersion:g4()}),JSON.stringify(t)}function KH(e){const t={};return(...s)=>{const r=zO(s);return t[r]||(t[r]=e(...s).finally(()=>{delete t[r]})),t[r]}}function QH(e){let t={};return(...s)=>{const r=s[s.length-1],i=zO(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 UO("https://hermes.pyth.network",{timeout:2e4});const eq=f4?{"User-Agent":f4}:{},tq="main",nq={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"}},sq=e=>{const t=Object.values(nq).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},Xb=QH(KH(async e=>{const t=sq(e?.market||tq),s=BO(e),r=qH(`/navi/config?env=${e?.env||"prod"}&sdk=${DO.version}&market=${t.key}`,e);return(await fetch(r,{headers:YH(eq,s)}).then(i=>i.json())).data})),Jb=1e3*60*5,y4=new Map,rq=e=>{const t=e??"https://hermes.pyth.network";let s=y4.get(t);return s||(s=new UO(t,{timeout:1e4}),y4.set(t,s)),s};async function aq(e,t){const s=[],r=t?.client??LO,i=e.map(u=>u.priceInfoObject),c=await JH(r,{ids:Array.from(new Set(i)),options:{showContent:!0}});for(const u of c){const f=u.data;if(!f||!f.content||f.content.dataType!=="moveObject"){console.warn(`fetched object ${f?.objectId} datatype should be moveObject`);continue}const p=e.find(N=>N.priceInfoObject==f.objectId);if(!p){console.warn(`unable to find pyth info from array, priceInfoObject: ${f.objectId}`);continue}const m=f.content.fields?.price_info?.price_feed?.price,g=m?.price;if(!g){console.warn(`unexpected pyth price struct, priceInfoObject: ${f.objectId}`);continue}const{magnitude:y,negative:b}=g,S=m.conf,A=m.timestamp;s.push({priceFeedId:p.priceFeedId,priceInfoObject:p.priceInfoObject,price:b?"-"+y:y,conf:S,publishTime:Number(A),expiration:p.expiration})}return s}async function iq(e,t){try{const s=[],r=await aq(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 oq(e,t,s){const r=s?.client??LO,i=await Xb({...s,cacheTime:Jb});try{const c=await rq(i.oracle.hermesEndpoint).getPriceFeedsUpdateData(t);return await new VH(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 cq(e,t,s){const r=await Xb({...s,cacheTime:Jb});if(s?.updatePythPriceFeeds){const i=t.filter(u=>!!u.pythPriceFeedId&&!!u.pythPriceInfoObject).map(u=>({priceFeedId:u.pythPriceFeedId,priceInfoObject:u.pythPriceInfoObject,expiration:30})),c=await iq(i,s);c.length>0&&await oq(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 lq(e){return(await Xb({...e,cacheTime:Jb})).oracle.feeds}const uq="0x6",dq="0x5";async function Kb(e,t){if(t.network!=="mainnet")return;const s=Object.keys(t.protocols.navi.reserves),r=(await lq({env:"prod"})).filter(i=>s.some(c=>Vt(c,i.coinType)));await cq(e,r,{env:"prod",client:$t(t),updatePythPriceFeeds:!0})}async function yp(e,t,s){const r=t.protocols.navi,i=Object.entries(r.reserves),c=new Zn;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}}),f=u.$kind==="Transaction"?u.Transaction:u.FailedTransaction;if(!f?.status.success)throw new Error(f?.status.error?.message??"Could not read the NAVI position");const p=g=>{const y=u.commandResults?.[g]?.returnValues?.[0]?.bcs;return y?F.u256().parse(y):"0"},m={collateral:{},debt:{}};return i.forEach(([g],y)=>{const b=p(2*y),S=p(2*y+1);b!=="0"&&(m.collateral[De(g)]=b),S!=="0"&&(m.debt[De(g)]=S)}),m}function Qb(e,t,s,r,i){const c=t.protocols.navi,u=[];for(const[f,p]of Object.entries(c.reserves)){const m=r.collateral[De(f)];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:[f],arguments:[e.object(uq),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(dq)]});u.push(e.moveCall({target:"0x2::coin::from_balance",typeArguments:[f],arguments:[y]}))}u.length&&e.transferObjects(u,i)}const Zu=e=>!!e&&Object.keys(e.collateral).length>0&&Object.keys(e.debt).length===0;async function fq(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 f of u.objects){const p=ws(f.type);`${ye(p.address)}::${p.module}::${p.name}`===r&&f.content&&i.push({capId:f.objectId,user:qF(f.content)})}c=u.hasNextPage?u.cursor:null}while(c&&i.length<200);return i}const $O="0x2::allowance::RateLimit",e1="0x6",VO="0x3::staking_pool::StakedSui",Qp=e=>`0x2::balance::Balance<${e}>`;function PO(e,t,s,r,i){const c=t.publishedAt,u=t.packageId,f=e.object(e1),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),f]});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),f]}));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(UF(g.minHealthFactor)),f]}))}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),f]}))}function hq(e,t,s){e.moveCall({target:"0x2::balance::send_funds",typeArguments:[Ut],arguments:[e.balance({balance:t}),e.pure.address(s)]})}function pq(e,t,s,r,i){for(const[c,u]of Object.entries(s)){if(BigInt(u)<=0n)continue;const f=t.demoFaucet&&Vt(t.demoFaucet.coin,c)?t.demoFaucet:null;let p;if(f)p=e.moveCall({target:`${f.packageId}::usdc::mint`,arguments:[e.object(f.faucetId),e.pure.u64(u)]});else if(Vt(c,Ut))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 mq(e,t){const s=e.moveCall({target:"0x2::allowance::periodic_rate_limit",arguments:[e.pure.u64(pp),e.pure.u256(t)]});return e.moveCall({target:"0x1::option::some",typeArguments:[$O],arguments:[s]})}function GO(e,t,s){e.moveCall({target:"0x2::allowance::new",typeArguments:[Qp(Ut)],arguments:[e.pure.string(TO),e.pure.address(s),e.pure.option("u256",t.gasCap),e.pure.option("u64",null),e.pure.option("u64",t.expiresMs),mq(e,t.gasDaily)]})}function gq(e,t,s,r,i,c={}){const u=new Zn;u.setSender(s);const f=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(e1)]}),p=(m,g)=>FO(u,e,f,t,r,m,g);for(const[m,g]of Object.entries(t.allowances))p(m,g);return GO(u,t,r),PO(u,e,f,t.policy,!0),u.moveCall({target:`${e.publishedAt}::pass::share`,arguments:[f]}),pq(u,e,i,c,s),hq(u,t.gasAmount,r),u}function FO(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:[Qp(c),SO(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:[$O]})]})]})}function Oh(e,t,s,r){e.moveCall({target:"0x2::allowance::revoke",typeArguments:[Qp(t)],arguments:[e.object(s),e.object(r)]})}function HO(e,t,s,r){const i=t.publishedAt,c=t.packageId,u=f=>e.moveCall({target:`${i}::pass::remove_policy`,typeArguments:[f],arguments:[s]});for(const f of r.transfers)e.moveCall({target:`${i}::transfer_policy::destroy`,typeArguments:[f.coinType],arguments:[u(`${c}::transfer_policy::TransferPolicy<${f.coinType}>`)]});for(const f of r.swaps)u(`${c}::swap_policy::SwapPolicy<${f.coinIn},${f.coinOut}>`);for(const f of r.lending)u(`${c}::lending_policy::LendingPolicy<${f.coinType}>`);r.staking.length&&u(`${c}::staking_policy::StakingPolicy`)}function yq(e,t,s,r){const i=new Zn;i.setSender(r);const{active:c,control:u}=t,f=i.object(c.passId),p=u.agent;String(s.expiresMs)!==u.agentExpiresMs&&i.moveCall({target:`${e.publishedAt}::pass::set_agent`,arguments:[f,i.object(e.configId),i.pure.address(p),i.pure.u64(s.expiresMs),i.object(e1)]}),HO(i,e,f,u.policies),PO(i,e,f,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),S=c.allowances[b];S&&m(t.allowances[b]??null,y,null)||(S&&Oh(i,b,S.revokeCap,S.allowance),FO(i,e,f,s,p,b,y))}for(const[g,y]of Object.entries(c.allowances))!(De(g)in s.allowances)&&!Object.keys(s.allowances).some(b=>Vt(b,g))&&Oh(i,g,y.revokeCap,y.allowance);return m(t.gas,s.gasCap,s.gasDaily)||(Oh(i,Ut,c.gasRevokeCap,c.gasAllowance),GO(i,s,p)),i}function vq(e,t,s){const r=new Zn;r.setSender(s),r.moveCall({target:`${e.publishedAt}::pass::revoke_agent`,arguments:[r.object(t.passId)]});for(const[i,c,u]of qO(t))r.moveCall({target:"0x2::allowance::revoke",typeArguments:[Qp(i)],arguments:[r.object(c),r.object(u)]});return r}function qO(e){return[...Object.entries(e.allowances).map(([t,s])=>[t,s.revokeCap,s.allowance]),[Ut,e.gasRevokeCap,e.gasAllowance]]}function ZO(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 bq(e,t,s,r=null){const i=new Zn;i.setSender(s),Zu(r)&&await Kb(i,e);const c=ZO(i,e,i.object(t.passId));return Zu(r)&&Qb(i,e,c,r,s),i.transferObjects([c],s),i}function wq(e,t,s,r,i,c=null){return YO(e,[{pass:t,active:s,control:r,position:c}],i)}async function YO(e,t,s){const r=new Zn;r.setSender(s),t.some(i=>i.control.naviPosition&&Zu(i.position))&&await Kb(r,e);for(const i of t)Tq(r,e,i,s);return r}function Tq(e,t,{pass:s,active:r,control:i,position:c},u){const f=t.publishedAt,p=t.packageId,m=e.object(s.passId);if(i.revoked||e.moveCall({target:`${f}::pass::revoke_agent`,arguments:[m]}),r)for(const[y,b,S]of qO(r))Oh(e,y,b,S);HO(e,t,m,i.policies);const g=[];if(i.naviPosition){const y=ZO(e,t,m);Zu(c)&&Qb(e,t,y,c,u),g.push(y)}for(const y of i.stakes){const b=e.moveCall({target:`${f}::staking::stake_key`,arguments:[e.pure.id(y.id)]});g.push(e.moveCall({target:`${f}::pass::withdraw_object`,typeArguments:[`${p}::staking::StakeKey`,VO],arguments:[m,b]}))}g.length&&e.transferObjects(g,u),e.moveCall({target:`${f}::pass::destroy`,arguments:[m]}),e.moveCall({target:`${f}::pass::burn_receipt`,arguments:[e.object(s.receiptId)]})}function Eq(e,t,s,r){const i=new Zn;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`,VO],arguments:[i.object(t.passId),c]});return i.transferObjects([u],s),i}const In=e=>`${e.slice(0,8)}…${e.slice(-6)}`,Yu=e=>`${dd(e,9)} SUI`,Sq=new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}),_q=e=>`${Sq.format(Number(e))} UTC`,WO=(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`},XO=new URLSearchParams(location.search),kq=XO.has("embed"),v4=XO.has("expose-wallet");function Aq(){const[e,t]=Ve.useState(location.hash);Ve.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 na({d:e,kind:t,id:s,children:r}){const i=t==="tx"?hH(e,s):t==="object"?pH(e,s):mH(e,s),c=r??In(s);return i?T.jsx("a",{href:i,target:"_blank",rel:"noreferrer",title:s,children:c}):T.jsx("span",{title:s,children:c})}function JO({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:[WO(i.timestampMs,s)," · ",T.jsx(na,{d:e,kind:"tx",id:i.digest}),r&&i.sender&&T.jsxs(T.Fragment,{children:[" ","· agent ",T.jsx(na,{d:e,kind:"address",id:i.sender})]})]})]})]},i.digest))})}function KO({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 ",In(r.id)]}),T.jsxs("p",{children:["Owner ",In(r.owner)]}),T.jsxs("p",{children:["Agent ",In(r.agent)]}),T.jsxs("p",{children:["Created ",WO(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(Ut,f?.perStake??t.staking.perStake)} / ${r(Ut,f?.daily??t.staking.daily)}`})}return u}const yH=new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"short",timeZone:"UTC"});function Ov(e,t){return[...xO(e,t.policy),{starts:!0,label:"Authorization ends",value:`${yH.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])=>bn(e,s,r)).join(", ")},{label:"Max gas allowance, lifetime / per UTC day",value:`${bn(e,Ut,t.gasCap)} / ${bn(e,Ut,t.gasDaily)}`},{label:"Agent gas stipend (outside the rules)",value:bn(e,Ut,t.gasAmount)}]}const vH=new Set(["deposit_object","withdraw_object","navi_open","destroy","issue","rotate_allowance","add_policy","remove_policy","set_agent","revoke_agent"]);function CO(e,t,s,r){const{inputs:i,commands:c}=r.transaction,u=(ae,Y)=>ae?bn(e,bH(ae),Y):`${Y} base units of an unknown coin`,f=ae=>ae&&typeof ae=="object"&&"Input"in ae?i[ae.Input]:void 0,p=(ae,Y)=>{const K=f(ae);if(!K||!("Pure"in K)||!K.Pure)return null;try{const w=qe(K.Pure.bytes);return Y==="u64"?F.u64().parse(w):Y==="address"?ye(F.Address.parse(w)):F.string().parse(w)}catch{return null}},m=ae=>{const Y=f(ae);if(!Y||!("Object"in Y)||!Y.Object)return null;const K=Y.Object,w="SharedObject"in K?K.SharedObject?.objectId:"ImmOrOwnedObject"in K?K.ImmOrOwnedObject?.objectId:void 0;return w?ye(w):null},g=ae=>{const Y=f(ae);return!Y||!("FundsWithdrawal"in Y)||!Y.FundsWithdrawal?null:Y.FundsWithdrawal.reservation?.MaxAmountU64??null},y=ae=>{const Y=g(ae.arguments[1]);return Y===null?"SUI":u(Ut,Y)},b=ae=>{const Y=e.pools.find(K=>K.poolId===ae);return Y?Y.venue==="deepbook"?"DeepBook":"Cetus":"a pool you did not list"},S=ae=>[e.packageId,e.publishedAt].some(Y=>ye(Y)===ye(ae)),A=c.flatMap(ae=>"MoveCall"in ae&&ae.MoveCall?[ae.MoveCall]:[]),N=A.find(ae=>S(ae.package)&&ae.module==="pass")??A.find(ae=>S(ae.package))??A[0];let j="Custom transaction",V=null;if(N&&S(N.package)){const[ae,Y]=N.typeArguments,K=N.arguments,w=(O,x=ae)=>{const G=p(K[O],"u64")??g(K[O]);return G===null?"an amount":u(x,G)};switch(N.function){case"transfer":V=p(K[K.length-2],"string"),j=`Pay ${w(3)} to ${V?`"${V}"`:"a recipient"}`;break;case"deepbook_base_to_quote":j=`Sell ${w(3)} on ${b(m(K[4]))}, accepting at least ${w(5,Y)}`;break;case"deepbook_quote_to_base":j=`Sell ${w(3,Y)} on ${b(m(K[4]))}, accepting at least ${w(5)}`;break;case"cetus_a_to_b":j=`Sell ${w(3)} on ${b(m(K[5]))}, accepting at least ${w(6,Y)}`;break;case"cetus_b_to_a":j=`Sell ${w(3,Y)} on ${b(m(K[5]))}, accepting at least ${w(6)}`;break;case"navi_supply":j=`Supply ${w(3)} to NAVI`;break;case"navi_repay":j=`Repay ${w(3)} to NAVI`;break;case"navi_withdraw":j=`Withdraw ${w(7)} from NAVI`;break;case"navi_borrow":j=`Borrow ${w(7)} from NAVI`;break;case"stake":{const O=p(K[5],"address");j=`Stake ${w(3,Ut)} with ${O?`validator ${Sy(O)}`:"a validator"}`;break}case"unstake":{const O=p(K[3],"address");j=`Unstake ${O?Sy(O):"a stake"} back to your balance`;break}default:j=vH.has(N.function)?`Call the owner-only ${N.module}::${N.function}`:`Call ${N.module}::${N.function}`}}else N&&ye(N.package)===ye("0x2")&&N.module==="allowance"&&N.function==="balance_spend"?j=`Top up the agent's gas with ${y(N)}`:N&&(j=`Call ${N.module}::${N.function}`);const C=new Map(s.map(ae=>[ye(ae.address),ae.name])),W=ye(t),ce=r.status.success?r.balanceChanges.filter(ae=>BigInt(ae.amount)>0n&&ye(ae.address)!==W).map(ae=>`${u(ae.coinType,ae.amount)} → ${C.get(ye(ae.address))??Sy(ae.address)}`):[];return{digest:r.digest,timestampMs:r.timestampMs,success:r.status.success,what:j,why:r.status.success?null:wH(e,r.status.error,V),moved:ce}}const Sy=e=>`${e.slice(0,8)}…${e.slice(-6)}`,bH=e=>e.replace(/^0x0*([0-9a-f]+)::/i,(t,s)=>`${ye(s)}::`);function wH(e,t,s){const r=t.MoveAbort;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"),f={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 allowance's daily window"},validator_set:{10:"Below the 1 SUI minimum stake",0:"Not an active validator"}};if(u===ye("0x2")||u===ye("0x3")){const g=f[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:"This entry was retired by a package upgrade; use the current SDK"},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 IO(e,t,s,r=null){const i=await e.listEvents({filter:{eventType:Fb(t)},order:"descending",limit:s,...r?{before:r}:{}});return{summaries:await Promise.all(i.events.map(async u=>{const f=await e.getTransaction({digest:u.transactionDigest}).catch(()=>null),p=f?.Transaction??f?.FailedTransaction;return{...Hb(u.bcs),digest:u.transactionDigest,timestampMs:p?.timestampMs??null}})),hasNextPage:i.hasNextPage,endCursor:i.endCursor}}async function TH(e,t,s){const r=ye(s);let i=null;for(let c=0;c<10;c++){const u=await e.listEvents({filter:{eventType:Fb(t)},order:"descending",limit:50,...i?{before:i}:{}});for(const f of u.events){const p=Hb(f.bcs);if(p.agent===r)return{...p,digest:f.transactionDigest}}if(!u.hasNextPage||!u.endCursor)return null;i=u.endCursor}return null}async function RO(e,t,s=50){return(await IO(e,t,s)).summaries}async function Kp(e,t,s){const r=ye(s);let i=null;for(let c=0;c<40;c++){const{summaries:u,hasNextPage:f,endCursor:p}=await IO(e,t,50,i),m=u.find(g=>g.id===r);if(m)return m;if(!f||!p)return null;i=p}return null}async function Yb(e,t,s){const r=await Jp(e,t,s.id),{allowances:i,gas:c}=await fH(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 jO={transaction:!0,balanceChanges:!0};async function EH(e,t,s,r,i=30){return(await e.listTransactions({filter:{sender:s},order:"descending",limit:i,include:jO})).transactions.map(u=>CO(t,s,r,u.Transaction??u.FailedTransaction))}async function SH(e,t,s=40){return(await e.listTransactions({filter:{function:`${t.publishedAt}::pass`},order:"descending",limit:s,include:jO})).transactions.map(i=>{const c=i.Transaction??i.FailedTransaction,u=ye(c.transaction?.sender??"0x0");return{...CO(t,u,[],c),sender:u}})}const l4=F.bytes(32).transform({input:e=>Ku(e),output:e=>kr(e)});F.struct("IncentiveAPYInfo",{asset_id:F.u8(),apy:F.u256(),coin_types:F.vector(F.string())});const _H=F.struct("IncentivePoolInfo",{pool_id:l4,funds:l4,phase:F.u64(),start_at:F.u64(),end_at:F.u64(),closed_at:F.u64(),total_supply:F.u64(),asset_id:F.u8(),option:F.u8(),factor:F.u256(),distributed:F.u64(),available:F.u256(),total:F.u256()});F.struct("IncentivePoolInfoByPhase",{phase:F.u64(),pools:F.vector(_H)});F.struct("OracleInfo",{oracle_id:F.u8(),price:F.u256(),decimals:F.u8(),valid:F.bool()});F.struct("FlashLoanAssetConfig",{id:F.string(),asset_id:F.u8(),coin_type:F.string(),pool_id:F.string(),rate_to_supplier:F.u64(),rate_to_treasury:F.u64(),max:F.u64(),min:F.u64()});F.struct("ReserveDataInfo",{id:F.u8(),oracle_id:F.u8(),coin_type:F.string(),supply_cap:F.u256(),borrow_cap:F.u256(),supply_rate:F.u256(),borrow_rate:F.u256(),supply_index:F.u256(),borrow_index:F.u256(),total_supply:F.u256(),total_borrow:F.u256(),last_update_at:F.u64(),ltv:F.u256(),treasury_factor:F.u256(),treasury_balance:F.u256(),base_rate:F.u256(),multiplier:F.u256(),jump_rate_multiplier:F.u256(),reserve_factor:F.u256(),optimal_utilization:F.u256(),liquidation_ratio:F.u256(),liquidation_bonus:F.u256(),liquidation_threshold:F.u256()});F.struct("UserStateInfo",{asset_id:F.u8(),borrow_balance:F.u256(),supply_balance:F.u256()});var _y,u4;function kH(){if(u4)return _y;u4=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",f="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",S="\\ufe0e\\ufe0f",A=p+m+g+y,N="['’]",j="["+r+"]",V="["+A+"]",C="["+i+c+"]",W="\\d+",ce="["+u+"]",ae="["+f+"]",Y="[^"+r+A+W+u+f+b+"]",K="\\ud83c[\\udffb-\\udfff]",w="(?:"+C+"|"+K+")",O="[^"+r+"]",x="(?:\\ud83c[\\udde6-\\uddff]){2}",G="[\\ud800-\\udbff][\\udc00-\\udfff]",U="["+b+"]",H="\\u200d",$="(?:"+ae+"|"+Y+")",M="(?:"+U+"|"+Y+")",k="(?:"+N+"(?:d|ll|m|re|s|t|ve))?",I="(?:"+N+"(?:D|LL|M|RE|S|T|VE))?",D=w+"?",L="["+S+"]?",X="(?:"+H+"(?:"+[O,x,G].join("|")+")"+L+D+")*",z=L+D+X,ie="(?:"+[ce,x,G].join("|")+")"+z,fe="(?:"+[O+C+"?",C,x,G,j].join("|")+")",R=RegExp(N,"g"),J=RegExp(C,"g"),le=RegExp(K+"(?="+K+")|"+fe+z,"g"),pe=RegExp([U+"?"+ae+"+"+k+"(?="+[V,U,"$"].join("|")+")",M+"+"+I+"(?="+[V,U+$,"$"].join("|")+")",U+"?"+$+"+"+k,U+"+"+I,W,ie].join("|"),"g"),Te=RegExp("["+H+r+i+c+S+"]"),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 Ec=="object"&&Ec&&Ec.Object===Object&&Ec,_e=typeof self=="object"&&self&&self.Object===Object&&self,Pe=be||_e||Function("return this")();function at(Ce,Ye,Ot,Ss){for(var jn=-1,So=Ce?Ce.length:0;++jn<So;)Ot=Ye(Ot,Ce[jn],jn,Ce);return Ot}function P(Ce){return Ce.split("")}function te(Ce){return Ce.match(t)||[]}function de(Ce){return function(Ye){return Ce?.[Ye]}}var he=de(Ae);function ue(Ce){return Te.test(Ce)}function ze(Ce){return Oe.test(Ce)}function Le(Ce){return ue(Ce)?Mt(Ce):P(Ce)}function Mt(Ce){return Ce.match(le)||[]}function Es(Ce){return Ce.match(pe)||[]}var va=Object.prototype,cl=va.toString,bi=Pe.Symbol,Eo=bi?bi.prototype:void 0,ll=Eo?Eo.toString:void 0;function rr(Ce,Ye,Ot){var Ss=-1,jn=Ce.length;Ye<0&&(Ye=-Ye>jn?0:jn+Ye),Ot=Ot>jn?jn:Ot,Ot<0&&(Ot+=jn),jn=Ye>Ot?0:Ot-Ye>>>0,Ye>>>=0;for(var So=Array(jn);++Ss<jn;)So[Ss]=Ce[Ss+Ye];return So}function ul(Ce){if(typeof Ce=="string")return Ce;if(hl(Ce))return ll?ll.call(Ce):"";var Ye=Ce+"";return Ye=="0"&&1/Ce==-1/0?"-0":Ye}function dl(Ce,Ye,Ot){var Ss=Ce.length;return Ot=Ot===void 0?Ss:Ot,!Ye&&Ot>=Ss?Ce:rr(Ce,Ye,Ot)}function em(Ce){return function(Ye){Ye=ba(Ye);var Ot=ue(Ye)?Le(Ye):void 0,Ss=Ot?Ot[0]:Ye.charAt(0),jn=Ot?dl(Ot,1).join(""):Ye.slice(1);return Ss[Ce]()+jn}}function fd(Ce){return function(Ye){return at(hd(Ln(Ye).replace(R,"")),Ce,"")}}function fl(Ce){return!!Ce&&typeof Ce=="object"}function hl(Ce){return typeof Ce=="symbol"||fl(Ce)&&cl.call(Ce)==e}function ba(Ce){return Ce==null?"":ul(Ce)}var tm=fd(function(Ce,Ye,Ot){return Ye=Ye.toLowerCase(),Ce+(Ot?nm(Ye):Ye)});function nm(Ce){return sm(ba(Ce).toLowerCase())}function Ln(Ce){return Ce=ba(Ce),Ce&&Ce.replace(s,he).replace(J,"")}var sm=em("toUpperCase");function hd(Ce,Ye,Ot){return Ce=ba(Ce),Ye=Ye,Ye===void 0?ze(Ce)?Es(Ce):te(Ce):Ce.match(Ye)||[]}return _y=tm,_y}kH();var AH=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ky=Math.ceil,Ms=Math.floor,ns="[BigNumber Error] ",d4=ns+"Number primitive has more than 15 significant digits: ",Ys=1e14,Ze=14,Ay=9007199254740991,Oy=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ka=1e7,vn=1e9;function MO(e){var t,s,r,i=C.prototype={constructor:C,toString:null,valueOf:null},c=new C(1),u=20,f=4,p=-7,m=21,g=-1e7,y=1e7,b=!1,S=1,A=0,N={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},j="0123456789abcdefghijklmnopqrstuvwxyz",V=!0;function C(w,O){var x,G,U,H,$,M,k,I,D=this;if(!(D instanceof C))return new C(w,O);if(O==null){if(w&&w._isBigNumber===!0){D.s=w.s,!w.c||w.e>y?D.c=D.e=null:w.e<g?D.c=[D.e=0]:(D.e=w.e,D.c=w.c.slice());return}if((M=typeof w=="number")&&w*0==0){if(D.s=1/w<0?(w=-w,-1):1,w===~~w){for(H=0,$=w;$>=10;$/=10,H++);H>y?D.c=D.e=null:(D.e=H,D.c=[w]);return}I=String(w)}else{if(!AH.test(I=String(w)))return r(D,I,M);D.s=I.charCodeAt(0)==45?(I=I.slice(1),-1):1}(H=I.indexOf("."))>-1&&(I=I.replace(".","")),($=I.search(/e/i))>0?(H<0&&(H=$),H+=+I.slice($+1),I=I.substring(0,$)):H<0&&(H=I.length)}else{if(zt(O,2,j.length,"Base"),O==10&&V)return D=new C(w),Y(D,u+D.e+1,f);if(I=String(w),M=typeof w=="number"){if(w*0!=0)return r(D,I,M,O);if(D.s=1/w<0?(I=I.slice(1),-1):1,C.DEBUG&&I.replace(/^0\.0*|\./,"").length>15)throw Error(d4+w)}else D.s=I.charCodeAt(0)===45?(I=I.slice(1),-1):1;for(x=j.slice(0,O),H=$=0,k=I.length;$<k;$++)if(x.indexOf(G=I.charAt($))<0){if(G=="."){if($>H){H=k;continue}}else if(!U&&(I==I.toUpperCase()&&(I=I.toLowerCase())||I==I.toLowerCase()&&(I=I.toUpperCase()))){U=!0,$=-1,H=0;continue}return r(D,String(w),M,O)}M=!1,I=s(I,O,10,D.s),(H=I.indexOf("."))>-1?I=I.replace(".",""):H=I.length}for($=0;I.charCodeAt($)===48;$++);for(k=I.length;I.charCodeAt(--k)===48;);if(I=I.slice($,++k)){if(k-=$,M&&C.DEBUG&&k>15&&(w>Ay||w!==Ms(w)))throw Error(d4+D.s*w);if((H=H-$-1)>y)D.c=D.e=null;else if(H<g)D.c=[D.e=0];else{if(D.e=H,D.c=[],$=(H+1)%Ze,H<0&&($+=Ze),$<k){for($&&D.c.push(+I.slice(0,$)),k-=Ze;$<k;)D.c.push(+I.slice($,$+=Ze));$=Ze-(I=I.slice($)).length}else $-=k;for(;$--;I+="0");D.c.push(+I)}}else D.c=[D.e=0]}C.clone=MO,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(w){var O,x;if(w!=null)if(typeof w=="object"){if(w.hasOwnProperty(O="DECIMAL_PLACES")&&(x=w[O],zt(x,0,vn,O),u=x),w.hasOwnProperty(O="ROUNDING_MODE")&&(x=w[O],zt(x,0,8,O),f=x),w.hasOwnProperty(O="EXPONENTIAL_AT")&&(x=w[O],x&&x.pop?(zt(x[0],-vn,0,O),zt(x[1],0,vn,O),p=x[0],m=x[1]):(zt(x,-vn,vn,O),p=-(m=x<0?-x:x))),w.hasOwnProperty(O="RANGE"))if(x=w[O],x&&x.pop)zt(x[0],-vn,-1,O),zt(x[1],1,vn,O),g=x[0],y=x[1];else if(zt(x,-vn,vn,O),x)g=-(y=x<0?-x:x);else throw Error(ns+O+" cannot be zero: "+x);if(w.hasOwnProperty(O="CRYPTO"))if(x=w[O],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))b=x;else throw b=!x,Error(ns+"crypto unavailable");else b=x;else throw Error(ns+O+" not true or false: "+x);if(w.hasOwnProperty(O="MODULO_MODE")&&(x=w[O],zt(x,0,9,O),S=x),w.hasOwnProperty(O="POW_PRECISION")&&(x=w[O],zt(x,0,vn,O),A=x),w.hasOwnProperty(O="FORMAT"))if(x=w[O],typeof x=="object")N=x;else throw Error(ns+O+" not an object: "+x);if(w.hasOwnProperty(O="ALPHABET"))if(x=w[O],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))V=x.slice(0,10)=="0123456789",j=x;else throw Error(ns+O+" invalid: "+x)}else throw Error(ns+"Object expected: "+w);return{DECIMAL_PLACES:u,ROUNDING_MODE:f,EXPONENTIAL_AT:[p,m],RANGE:[g,y],CRYPTO:b,MODULO_MODE:S,POW_PRECISION:A,FORMAT:N,ALPHABET:j}},C.isBigNumber=function(w){if(!w||w._isBigNumber!==!0)return!1;if(!C.DEBUG)return!0;var O,x,G=w.c,U=w.e,H=w.s;e:if({}.toString.call(G)=="[object Array]"){if((H===1||H===-1)&&U>=-vn&&U<=vn&&U===Ms(U)){if(G[0]===0){if(U===0&&G.length===1)return!0;break e}if(O=(U+1)%Ze,O<1&&(O+=Ze),String(G[0]).length==O){for(O=0;O<G.length;O++)if(x=G[O],x<0||x>=Ys||x!==Ms(x))break e;if(x!==0)return!0}}}else if(G===null&&U===null&&(H===null||H===1||H===-1))return!0;throw Error(ns+"Invalid BigNumber: "+w)},C.maximum=C.max=function(){return ce(arguments,-1)},C.minimum=C.min=function(){return ce(arguments,1)},C.random=(function(){var w=9007199254740992,O=Math.random()*w&2097151?function(){return Ms(Math.random()*w)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var G,U,H,$,M,k=0,I=[],D=new C(c);if(x==null?x=u:zt(x,0,vn),$=ky(x/Ze),b)if(crypto.getRandomValues){for(G=crypto.getRandomValues(new Uint32Array($*=2));k<$;)M=G[k]*131072+(G[k+1]>>>11),M>=9e15?(U=crypto.getRandomValues(new Uint32Array(2)),G[k]=U[0],G[k+1]=U[1]):(I.push(M%1e14),k+=2);k=$/2}else if(crypto.randomBytes){for(G=crypto.randomBytes($*=7);k<$;)M=(G[k]&31)*281474976710656+G[k+1]*1099511627776+G[k+2]*4294967296+G[k+3]*16777216+(G[k+4]<<16)+(G[k+5]<<8)+G[k+6],M>=9e15?crypto.randomBytes(7).copy(G,k):(I.push(M%1e14),k+=7);k=$/7}else throw b=!1,Error(ns+"crypto unavailable");if(!b)for(;k<$;)M=O(),M<9e15&&(I[k++]=M%1e14);for($=I[--k],x%=Ze,$&&x&&(M=Oy[Ze-x],I[k]=Ms($/M)*M);I[k]===0;I.pop(),k--);if(k<0)I=[H=0];else{for(H=-1;I[0]===0;I.splice(0,1),H-=Ze);for(k=1,M=I[0];M>=10;M/=10,k++);k<Ze&&(H-=Ze-k)}return D.e=H,D.c=I,D}})(),C.sum=function(){for(var w=1,O=arguments,x=new C(O[0]);w<O.length;)x=x.plus(O[w++]);return x},s=(function(){var w="0123456789";function O(x,G,U,H){for(var $,M=[0],k,I=0,D=x.length;I<D;){for(k=M.length;k--;M[k]*=G);for(M[0]+=H.indexOf(x.charAt(I++)),$=0;$<M.length;$++)M[$]>U-1&&(M[$+1]==null&&(M[$+1]=0),M[$+1]+=M[$]/U|0,M[$]%=U)}return M.reverse()}return function(x,G,U,H,$){var M,k,I,D,L,X,z,ie,fe=x.indexOf("."),R=u,J=f;for(fe>=0&&(D=A,A=0,x=x.replace(".",""),ie=new C(G),X=ie.pow(x.length-fe),A=D,ie.c=O(Qr(js(X.c),X.e,"0"),10,U,w),ie.e=ie.c.length),z=O(x,G,U,$?(M=j,w):(M=w,j)),I=D=z.length;z[--D]==0;z.pop());if(!z[0])return M.charAt(0);if(fe<0?--I:(X.c=z,X.e=I,X.s=H,X=t(X,ie,R,J,U),z=X.c,L=X.r,I=X.e),k=I+R+1,fe=z[k],D=U/2,L=L||k<0||z[k+1]!=null,L=J<4?(fe!=null||L)&&(J==0||J==(X.s<0?3:2)):fe>D||fe==D&&(J==4||L||J==6&&z[k-1]&1||J==(X.s<0?8:7)),k<1||!z[0])x=L?Qr(M.charAt(1),-R,M.charAt(0)):M.charAt(0);else{if(z.length=k,L)for(--U;++z[--k]>U;)z[k]=0,k||(++I,z=[1].concat(z));for(D=z.length;!z[--D];);for(fe=0,x="";fe<=D;x+=M.charAt(z[fe++]));x=Qr(x,I,M.charAt(0))}return x}})(),t=(function(){function w(G,U,H){var $,M,k,I,D=0,L=G.length,X=U%Ka,z=U/Ka|0;for(G=G.slice();L--;)k=G[L]%Ka,I=G[L]/Ka|0,$=z*k+I*X,M=X*k+$%Ka*Ka+D,D=(M/H|0)+($/Ka|0)+z*I,G[L]=M%H;return D&&(G=[D].concat(G)),G}function O(G,U,H,$){var M,k;if(H!=$)k=H>$?1:-1;else for(M=k=0;M<H;M++)if(G[M]!=U[M]){k=G[M]>U[M]?1:-1;break}return k}function x(G,U,H,$){for(var M=0;H--;)G[H]-=M,M=G[H]<U[H]?1:0,G[H]=M*$+G[H]-U[H];for(;!G[0]&&G.length>1;G.splice(0,1));}return function(G,U,H,$,M){var k,I,D,L,X,z,ie,fe,R,J,le,pe,Te,Oe,Ae,be,_e,Pe=G.s==U.s?1:-1,at=G.c,P=U.c;if(!at||!at[0]||!P||!P[0])return new C(!G.s||!U.s||(at?P&&at[0]==P[0]:!P)?NaN:at&&at[0]==0||!P?Pe*0:Pe/0);for(fe=new C(Pe),R=fe.c=[],I=G.e-U.e,Pe=H+I+1,M||(M=Ys,I=Ds(G.e/Ze)-Ds(U.e/Ze),Pe=Pe/Ze|0),D=0;P[D]==(at[D]||0);D++);if(P[D]>(at[D]||0)&&I--,Pe<0)R.push(1),L=!0;else{for(Oe=at.length,be=P.length,D=0,Pe+=2,X=Ms(M/(P[0]+1)),X>1&&(P=w(P,X,M),at=w(at,X,M),be=P.length,Oe=at.length),Te=be,J=at.slice(0,be),le=J.length;le<be;J[le++]=0);_e=P.slice(),_e=[0].concat(_e),Ae=P[0],P[1]>=M/2&&Ae++;do{if(X=0,k=O(P,J,be,le),k<0){if(pe=J[0],be!=le&&(pe=pe*M+(J[1]||0)),X=Ms(pe/Ae),X>1)for(X>=M&&(X=M-1),z=w(P,X,M),ie=z.length,le=J.length;O(z,J,ie,le)==1;)X--,x(z,be<ie?_e:P,ie,M),ie=z.length,k=1;else X==0&&(k=X=1),z=P.slice(),ie=z.length;if(ie<le&&(z=[0].concat(z)),x(J,z,le,M),le=J.length,k==-1)for(;O(P,J,be,le)<1;)X++,x(J,be<le?_e:P,le,M),le=J.length}else k===0&&(X++,J=[0]);R[D++]=X,J[0]?J[le++]=at[Te]||0:(J=[at[Te]],le=1)}while((Te++<Oe||J[0]!=null)&&Pe--);L=J[0]!=null,R[0]||R.splice(0,1)}if(M==Ys){for(D=1,Pe=R[0];Pe>=10;Pe/=10,D++);Y(fe,H+(fe.e=D+I*Ze-1)+1,$,L)}else fe.e=I,fe.r=+L;return fe}})();function W(w,O,x,G){var U,H,$,M,k;if(x==null?x=f:zt(x,0,8),!w.c)return w.toString();if(U=w.c[0],$=w.e,O==null)k=js(w.c),k=G==1||G==2&&($<=p||$>=m)?rh(k,$):Qr(k,$,"0");else if(w=Y(new C(w),O,x),H=w.e,k=js(w.c),M=k.length,G==1||G==2&&(O<=H||H<=p)){for(;M<O;k+="0",M++);k=rh(k,H)}else if(O-=$,k=Qr(k,H,"0"),H+1>M){if(--O>0)for(k+=".";O--;k+="0");}else if(O+=H-M,O>0)for(H+1==M&&(k+=".");O--;k+="0");return w.s<0&&U?"-"+k:k}function ce(w,O){for(var x,G,U=1,H=new C(w[0]);U<w.length;U++)G=new C(w[U]),(!G.s||(x=Zi(H,G))===O||x===0&&H.s===O)&&(H=G);return H}function ae(w,O,x){for(var G=1,U=O.length;!O[--U];O.pop());for(U=O[0];U>=10;U/=10,G++);return(x=G+x*Ze-1)>y?w.c=w.e=null:x<g?w.c=[w.e=0]:(w.e=x,w.c=O),w}r=(function(){var w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,O=/^([^.]+)\.$/,x=/^\.([^.]+)$/,G=/^-?(Infinity|NaN)$/,U=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(H,$,M,k){var I,D=M?$:$.replace(U,"");if(G.test(D))H.s=isNaN(D)?null:D<0?-1:1;else{if(!M&&(D=D.replace(w,function(L,X,z){return I=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!k||k==I?X:L}),k&&(I=k,D=D.replace(O,"$1").replace(x,"0.$1")),$!=D))return new C(D,I);if(C.DEBUG)throw Error(ns+"Not a"+(k?" base "+k:"")+" number: "+$);H.s=null}H.c=H.e=null}})();function Y(w,O,x,G){var U,H,$,M,k,I,D,L=w.c,X=Oy;if(L){e:{for(U=1,M=L[0];M>=10;M/=10,U++);if(H=O-U,H<0)H+=Ze,$=O,k=L[I=0],D=Ms(k/X[U-$-1]%10);else if(I=ky((H+1)/Ze),I>=L.length)if(G){for(;L.length<=I;L.push(0));k=D=0,U=1,H%=Ze,$=H-Ze+1}else break e;else{for(k=M=L[I],U=1;M>=10;M/=10,U++);H%=Ze,$=H-Ze+U,D=$<0?0:Ms(k/X[U-$-1]%10)}if(G=G||O<0||L[I+1]!=null||($<0?k:k%X[U-$-1]),G=x<4?(D||G)&&(x==0||x==(w.s<0?3:2)):D>5||D==5&&(x==4||G||x==6&&(H>0?$>0?k/X[U-$]:0:L[I-1])%10&1||x==(w.s<0?8:7)),O<1||!L[0])return L.length=0,G?(O-=w.e+1,L[0]=X[(Ze-O%Ze)%Ze],w.e=-O||0):L[0]=w.e=0,w;if(H==0?(L.length=I,M=1,I--):(L.length=I+1,M=X[Ze-H],L[I]=$>0?Ms(k/X[U-$]%X[$])*M:0),G)for(;;)if(I==0){for(H=1,$=L[0];$>=10;$/=10,H++);for($=L[0]+=M,M=1;$>=10;$/=10,M++);H!=M&&(w.e++,L[0]==Ys&&(L[0]=1));break}else{if(L[I]+=M,L[I]!=Ys)break;L[I--]=0,M=1}for(H=L.length;L[--H]===0;L.pop());}w.e>y?w.c=w.e=null:w.e<g&&(w.c=[w.e=0])}return w}function K(w){var O,x=w.e;return x===null?w.toString():(O=js(w.c),O=x<=p||x>=m?rh(O,x):Qr(O,x,"0"),w.s<0?"-"+O:O)}return i.absoluteValue=i.abs=function(){var w=new C(this);return w.s<0&&(w.s=1),w},i.comparedTo=function(w,O){return Zi(this,new C(w,O))},i.decimalPlaces=i.dp=function(w,O){var x,G,U,H=this;if(w!=null)return zt(w,0,vn),O==null?O=f:zt(O,0,8),Y(new C(H),w+H.e+1,O);if(!(x=H.c))return null;if(G=((U=x.length-1)-Ds(this.e/Ze))*Ze,U=x[U])for(;U%10==0;U/=10,G--);return G<0&&(G=0),G},i.dividedBy=i.div=function(w,O){return t(this,new C(w,O),u,f)},i.dividedToIntegerBy=i.idiv=function(w,O){return t(this,new C(w,O),0,1)},i.exponentiatedBy=i.pow=function(w,O){var x,G,U,H,$,M,k,I,D,L=this;if(w=new C(w),w.c&&!w.isInteger())throw Error(ns+"Exponent not an integer: "+K(w));if(O!=null&&(O=new C(O)),M=w.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!w.c||!w.c[0])return D=new C(Math.pow(+K(L),M?w.s*(2-sh(w)):+K(w))),O?D.mod(O):D;if(k=w.s<0,O){if(O.c?!O.c[0]:!O.s)return new C(NaN);G=!k&&L.isInteger()&&O.isInteger(),G&&(L=L.mod(O))}else{if(w.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||M&&L.c[1]>=24e7:L.c[0]<8e13||M&&L.c[0]<=9999975e7)))return H=L.s<0&&sh(w)?-0:0,L.e>-1&&(H=1/H),new C(k?1/H:H);A&&(H=ky(A/Ze+2))}for(M?(x=new C(.5),k&&(w.s=1),I=sh(w)):(U=Math.abs(+K(w)),I=U%2),D=new C(c);;){if(I){if(D=D.times(L),!D.c)break;H?D.c.length>H&&(D.c.length=H):G&&(D=D.mod(O))}if(U){if(U=Ms(U/2),U===0)break;I=U%2}else if(w=w.times(x),Y(w,w.e+1,1),w.e>14)I=sh(w);else{if(U=+K(w),U===0)break;I=U%2}L=L.times(L),H?L.c&&L.c.length>H&&(L.c.length=H):G&&(L=L.mod(O))}return G?D:(k&&(D=c.div(D)),O?D.mod(O):H?Y(D,A,f,$):D)},i.integerValue=function(w){var O=new C(this);return w==null?w=f:zt(w,0,8),Y(O,O.e+1,w)},i.isEqualTo=i.eq=function(w,O){return Zi(this,new C(w,O))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(w,O){return Zi(this,new C(w,O))>0},i.isGreaterThanOrEqualTo=i.gte=function(w,O){return(O=Zi(this,new C(w,O)))===1||O===0},i.isInteger=function(){return!!this.c&&Ds(this.e/Ze)>this.c.length-2},i.isLessThan=i.lt=function(w,O){return Zi(this,new C(w,O))<0},i.isLessThanOrEqualTo=i.lte=function(w,O){return(O=Zi(this,new C(w,O)))===-1||O===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,O){var x,G,U,H,$=this,M=$.s;if(w=new C(w,O),O=w.s,!M||!O)return new C(NaN);if(M!=O)return w.s=-O,$.plus(w);var k=$.e/Ze,I=w.e/Ze,D=$.c,L=w.c;if(!k||!I){if(!D||!L)return D?(w.s=-O,w):new C(L?$:NaN);if(!D[0]||!L[0])return L[0]?(w.s=-O,w):new C(D[0]?$:f==3?-0:0)}if(k=Ds(k),I=Ds(I),D=D.slice(),M=k-I){for((H=M<0)?(M=-M,U=D):(I=k,U=L),U.reverse(),O=M;O--;U.push(0));U.reverse()}else for(G=(H=(M=D.length)<(O=L.length))?M:O,M=O=0;O<G;O++)if(D[O]!=L[O]){H=D[O]<L[O];break}if(H&&(U=D,D=L,L=U,w.s=-w.s),O=(G=L.length)-(x=D.length),O>0)for(;O--;D[x++]=0);for(O=Ys-1;G>M;){if(D[--G]<L[G]){for(x=G;x&&!D[--x];D[x]=O);--D[x],D[G]+=Ys}D[G]-=L[G]}for(;D[0]==0;D.splice(0,1),--I);return D[0]?ae(w,D,I):(w.s=f==3?-1:1,w.c=[w.e=0],w)},i.modulo=i.mod=function(w,O){var x,G,U=this;return w=new C(w,O),!U.c||!w.s||w.c&&!w.c[0]?new C(NaN):!w.c||U.c&&!U.c[0]?new C(U):(S==9?(G=w.s,w.s=1,x=t(U,w,0,3),w.s=G,x.s*=G):x=t(U,w,0,S),w=U.minus(x.times(w)),!w.c[0]&&S==1&&(w.s=U.s),w)},i.multipliedBy=i.times=function(w,O){var x,G,U,H,$,M,k,I,D,L,X,z,ie,fe,R,J=this,le=J.c,pe=(w=new C(w,O)).c;if(!le||!pe||!le[0]||!pe[0])return!J.s||!w.s||le&&!le[0]&&!pe||pe&&!pe[0]&&!le?w.c=w.e=w.s=null:(w.s*=J.s,!le||!pe?w.c=w.e=null:(w.c=[0],w.e=0)),w;for(G=Ds(J.e/Ze)+Ds(w.e/Ze),w.s*=J.s,k=le.length,L=pe.length,k<L&&(ie=le,le=pe,pe=ie,U=k,k=L,L=U),U=k+L,ie=[];U--;ie.push(0));for(fe=Ys,R=Ka,U=L;--U>=0;){for(x=0,X=pe[U]%R,z=pe[U]/R|0,$=k,H=U+$;H>U;)I=le[--$]%R,D=le[$]/R|0,M=z*I+D*X,I=X*I+M%R*R+ie[H]+x,x=(I/fe|0)+(M/R|0)+z*D,ie[H--]=I%fe;ie[H]=x}return x?++G:ie.splice(0,1),ae(w,ie,G)},i.negated=function(){var w=new C(this);return w.s=-w.s||null,w},i.plus=function(w,O){var x,G=this,U=G.s;if(w=new C(w,O),O=w.s,!U||!O)return new C(NaN);if(U!=O)return w.s=-O,G.minus(w);var H=G.e/Ze,$=w.e/Ze,M=G.c,k=w.c;if(!H||!$){if(!M||!k)return new C(U/0);if(!M[0]||!k[0])return k[0]?w:new C(M[0]?G:U*0)}if(H=Ds(H),$=Ds($),M=M.slice(),U=H-$){for(U>0?($=H,x=k):(U=-U,x=M),x.reverse();U--;x.push(0));x.reverse()}for(U=M.length,O=k.length,U-O<0&&(x=k,k=M,M=x,O=U),U=0;O;)U=(M[--O]=M[O]+k[O]+U)/Ys|0,M[O]=Ys===M[O]?0:M[O]%Ys;return U&&(M=[U].concat(M),++$),ae(w,M,$)},i.precision=i.sd=function(w,O){var x,G,U,H=this;if(w!=null&&w!==!!w)return zt(w,1,vn),O==null?O=f:zt(O,0,8),Y(new C(H),w,O);if(!(x=H.c))return null;if(U=x.length-1,G=U*Ze+1,U=x[U]){for(;U%10==0;U/=10,G--);for(U=x[0];U>=10;U/=10,G++);}return w&&H.e+1>G&&(G=H.e+1),G},i.shiftedBy=function(w){return zt(w,-Ay,Ay),this.times("1e"+w)},i.squareRoot=i.sqrt=function(){var w,O,x,G,U,H=this,$=H.c,M=H.s,k=H.e,I=u+4,D=new C("0.5");if(M!==1||!$||!$[0])return new C(!M||M<0&&(!$||$[0])?NaN:$?H:1/0);if(M=Math.sqrt(+K(H)),M==0||M==1/0?(O=js($),(O.length+k)%2==0&&(O+="0"),M=Math.sqrt(+O),k=Ds((k+1)/2)-(k<0||k%2),M==1/0?O="5e"+k:(O=M.toExponential(),O=O.slice(0,O.indexOf("e")+1)+k),x=new C(O)):x=new C(M+""),x.c[0]){for(k=x.e,M=k+I,M<3&&(M=0);;)if(U=x,x=D.times(U.plus(t(H,U,I,1))),js(U.c).slice(0,M)===(O=js(x.c)).slice(0,M))if(x.e<k&&--M,O=O.slice(M-3,M+1),O=="9999"||!G&&O=="4999"){if(!G&&(Y(U,U.e+u+2,0),U.times(U).eq(H))){x=U;break}I+=4,M+=4,G=1}else{(!+O||!+O.slice(1)&&O.charAt(0)=="5")&&(Y(x,x.e+u+2,1),w=!x.times(x).eq(H));break}}return Y(x,x.e+u+1,f,w)},i.toExponential=function(w,O){return w!=null&&(zt(w,0,vn),w++),W(this,w,O,1)},i.toFixed=function(w,O){return w!=null&&(zt(w,0,vn),w=w+this.e+1),W(this,w,O)},i.toFormat=function(w,O,x){var G,U=this;if(x==null)w!=null&&O&&typeof O=="object"?(x=O,O=null):w&&typeof w=="object"?(x=w,w=O=null):x=N;else if(typeof x!="object")throw Error(ns+"Argument not an object: "+x);if(G=U.toFixed(w,O),U.c){var H,$=G.split("."),M=+x.groupSize,k=+x.secondaryGroupSize,I=x.groupSeparator||"",D=$[0],L=$[1],X=U.s<0,z=X?D.slice(1):D,ie=z.length;if(k&&(H=M,M=k,k=H,ie-=H),M>0&&ie>0){for(H=ie%M||M,D=z.substr(0,H);H<ie;H+=M)D+=I+z.substr(H,M);k>0&&(D+=I+z.slice(H)),X&&(D="-"+D)}G=L?D+(x.decimalSeparator||"")+((k=+x.fractionGroupSize)?L.replace(new RegExp("\\d{"+k+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):L):D}return(x.prefix||"")+G+(x.suffix||"")},i.toFraction=function(w){var O,x,G,U,H,$,M,k,I,D,L,X,z=this,ie=z.c;if(w!=null&&(M=new C(w),!M.isInteger()&&(M.c||M.s!==1)||M.lt(c)))throw Error(ns+"Argument "+(M.isInteger()?"out of range: ":"not an integer: ")+K(M));if(!ie)return new C(z);for(O=new C(c),I=x=new C(c),G=k=new C(c),X=js(ie),H=O.e=X.length-z.e-1,O.c[0]=Oy[($=H%Ze)<0?Ze+$:$],w=!w||M.comparedTo(O)>0?H>0?O:I:M,$=y,y=1/0,M=new C(X),k.c[0]=0;D=t(M,O,0,1),U=x.plus(D.times(G)),U.comparedTo(w)!=1;)x=G,G=U,I=k.plus(D.times(U=I)),k=U,O=M.minus(D.times(U=O)),M=U;return U=t(w.minus(x),G,0,1),k=k.plus(U.times(I)),x=x.plus(U.times(G)),k.s=I.s=z.s,H=H*2,L=t(I,G,H,f).minus(z).abs().comparedTo(t(k,x,H,f).minus(z).abs())<1?[I,G]:[k,x],y=$,L},i.toNumber=function(){return+K(this)},i.toPrecision=function(w,O){return w!=null&&zt(w,1,vn),W(this,w,O,2)},i.toString=function(w){var O,x=this,G=x.s,U=x.e;return U===null?G?(O="Infinity",G<0&&(O="-"+O)):O="NaN":(w==null?O=U<=p||U>=m?rh(js(x.c),U):Qr(js(x.c),U,"0"):w===10&&V?(x=Y(new C(x),u+U+1,f),O=Qr(js(x.c),x.e,"0")):(zt(w,2,j.length,"Base"),O=s(Qr(js(x.c),U,"0"),10,w,G,!0)),G<0&&x.c[0]&&(O="-"+O)),O},i.valueOf=i.toJSON=function(){return K(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&C.set(e),C}function Ds(e){var t=e|0;return e>0||e===t?t:t-1}function js(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 Zi(e,t){var s,r,i=e.c,c=t.c,u=e.s,f=t.s,p=e.e,m=t.e;if(!u||!f)return null;if(s=i&&!i[0],r=c&&!c[0],s||r)return s?r?0:-f:u;if(u!=f)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(f=(p=i.length)<(m=c.length)?p:m,u=0;u<f;u++)if(i[u]!=c[u])return i[u]>c[u]^s?1:-1;return p==m?0:p>m^s?1:-1}function zt(e,t,s,r){if(e<t||e>s||e!==Ms(e))throw Error(ns+(r||"Argument")+(typeof e=="number"?e<t||e>s?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function sh(e){var t=e.c.length-1;return Ds(e.e/Ze)==t&&e.c[t]%2!=0}function rh(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Qr(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}MO();const OH="2.0.12",DO={version:OH},NH=DO.version,xH=()=>{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"},CH=()=>{let e="";return typeof process<"u"&&process.versions&&process.versions.node&&(e=`lending/${NH} (${xH()})`),e},f4=CH(),IH="https://fullnode.mainnet.sui.io:443";let Ny;function RH(){return Ny||(Ny=new lb({network:"mainnet",transport:new Qv({baseUrl:IH})})),Ny}function jH(e,t="mainnet"){return RH()}const MH=16*1024;function Wb(e){return e.replace(/^0x/i,"")}function h4(e){const t=Wb(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 DH(e,t){return(e[t]<<8)+e[t+1]}function p4(e){return F.vector(F.U8).serialize(Array.from(e),{maxSize:MH})}function m4(e,t){return{type:e,bcs:t}}function UH(e){return F.vector(F.U8).serialize(Array.from(new TextEncoder().encode(e))).toBytes()}function BH(e){return F.struct("PriceIdentifier",{bytes:F.vector(F.U8)}).serialize({bytes:Array.from(e)}).toBytes()}function LH(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 zH(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]=LH(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 $H(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}class UO{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($H)}async get(t,s,r){const i=new AbortController,c=setTimeout(()=>i.abort(),this.timeout),u=new URL(`${this.endpoint}${t}`);for(const[f,p]of Object.entries(r??{}))u.searchParams.set(f,p);for(const f of s)u.searchParams.append("ids[]",Wb(f));try{const f=await fetch(u,{signal:i.signal});if(!f.ok)throw new Error(`Hermes request failed: ${f.status} ${f.statusText}`);return await f.json()}finally{clearTimeout(c)}}}class VH{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),f=await this.getBaseUpdateFee(),p=t.splitCoins(i?.feeCoin??t.gas,r.map(()=>t.pure.u64(f)));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(p4(i)),s.object(oh)]});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(p4(s[0])),c,t.object(oh)]});return u}async executePriceFeedUpdates(t,s,r,i,c){const u=[];for(const[f,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[f],t.object(oh)]})}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=Wb(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:f}=await u.getDynamicField({parentId:r,name:m4(c,BH(h4(s)))}),p=f?.value?.bcs;this.priceFeedObjectIdCache.set(s,p&&p.length===32?F.Address.parse(Uint8Array.from(p)):void 0)}else{const f=await this.getDynamicMoveObjectJson(r,{type:c,value:{bytes:Array.from(h4(s))}});f?.fields?this.priceFeedObjectIdCache.set(s,f.fields.value):this.priceFeedObjectIdCache.set(s,void 0)}}return this.priceFeedObjectIdCache.get(s)}async getPriceTableInfo(){if(!this.priceTableInfo){const t=this.getCoreProvider()?m4("vector<u8>",UH("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:zH(s.type)}}return this.priceTableInfo}extractVaaBytesFromAccumulatorMessage(t){const s=7+t[6]+1,r=DH(t,s),i=s+2;return t.subarray(i,i+r)}}const PH="https://open-api.naviprotocol.io/api";let GH={},FH=0;function HH(e){return e.replace(/\/+$/,"")}function g4(){return FH}function BO(e){const t=e?.services?.naviOpenApi??GH.services?.naviOpenApi;return{baseUrl:HH(t?.baseUrl??PH),headers:t?.headers}}function qH(e,t){const s=BO(t),r=e.startsWith("/")?e:`/${e}`;return`${s.baseUrl}${r}`}function ZH(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 YH(e,t){return{...ZH(e),...t?.headers??{}}}const LO=jH();function WH(e){return{json:!!e?.showContent,display:!!e?.showDisplay,previousTransaction:!!e?.showPreviousTransaction,objectBcs:!!e?.showBcs}}function XH(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 JH(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:WH(t.options)});return r.map(XH)}function zO(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:f,cacheTime:p,...m}=r;m.__naviSdkServiceConfigVersion=g4(),t.push(m),s=!0}else t.push(r)}),s||t.push({__naviSdkServiceConfigVersion:g4()}),JSON.stringify(t)}function KH(e){const t={};return(...s)=>{const r=zO(s);return t[r]||(t[r]=e(...s).finally(()=>{delete t[r]})),t[r]}}function QH(e){let t={};return(...s)=>{const r=s[s.length-1],i=zO(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 UO("https://hermes.pyth.network",{timeout:2e4});const eq=f4?{"User-Agent":f4}:{},tq="main",nq={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"}},sq=e=>{const t=Object.values(nq).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},Xb=QH(KH(async e=>{const t=sq(e?.market||tq),s=BO(e),r=qH(`/navi/config?env=${e?.env||"prod"}&sdk=${DO.version}&market=${t.key}`,e);return(await fetch(r,{headers:YH(eq,s)}).then(i=>i.json())).data})),Jb=1e3*60*5,y4=new Map,rq=e=>{const t=e??"https://hermes.pyth.network";let s=y4.get(t);return s||(s=new UO(t,{timeout:1e4}),y4.set(t,s)),s};async function aq(e,t){const s=[],r=t?.client??LO,i=e.map(u=>u.priceInfoObject),c=await JH(r,{ids:Array.from(new Set(i)),options:{showContent:!0}});for(const u of c){const f=u.data;if(!f||!f.content||f.content.dataType!=="moveObject"){console.warn(`fetched object ${f?.objectId} datatype should be moveObject`);continue}const p=e.find(N=>N.priceInfoObject==f.objectId);if(!p){console.warn(`unable to find pyth info from array, priceInfoObject: ${f.objectId}`);continue}const m=f.content.fields?.price_info?.price_feed?.price,g=m?.price;if(!g){console.warn(`unexpected pyth price struct, priceInfoObject: ${f.objectId}`);continue}const{magnitude:y,negative:b}=g,S=m.conf,A=m.timestamp;s.push({priceFeedId:p.priceFeedId,priceInfoObject:p.priceInfoObject,price:b?"-"+y:y,conf:S,publishTime:Number(A),expiration:p.expiration})}return s}async function iq(e,t){try{const s=[],r=await aq(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 oq(e,t,s){const r=s?.client??LO,i=await Xb({...s,cacheTime:Jb});try{const c=await rq(i.oracle.hermesEndpoint).getPriceFeedsUpdateData(t);return await new VH(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 cq(e,t,s){const r=await Xb({...s,cacheTime:Jb});if(s?.updatePythPriceFeeds){const i=t.filter(u=>!!u.pythPriceFeedId&&!!u.pythPriceInfoObject).map(u=>({priceFeedId:u.pythPriceFeedId,priceInfoObject:u.pythPriceInfoObject,expiration:30})),c=await iq(i,s);c.length>0&&await oq(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 lq(e){return(await Xb({...e,cacheTime:Jb})).oracle.feeds}const uq="0x6",dq="0x5";async function Kb(e,t){if(t.network!=="mainnet")return;const s=Object.keys(t.protocols.navi.reserves),r=(await lq({env:"prod"})).filter(i=>s.some(c=>Vt(c,i.coinType)));await cq(e,r,{env:"prod",client:$t(t),updatePythPriceFeeds:!0})}async function yp(e,t,s){const r=t.protocols.navi,i=Object.entries(r.reserves),c=new Zn;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}}),f=u.$kind==="Transaction"?u.Transaction:u.FailedTransaction;if(!f?.status.success)throw new Error(f?.status.error?.message??"Could not read the NAVI position");const p=g=>{const y=u.commandResults?.[g]?.returnValues?.[0]?.bcs;return y?F.u256().parse(y):"0"},m={collateral:{},debt:{}};return i.forEach(([g],y)=>{const b=p(2*y),S=p(2*y+1);b!=="0"&&(m.collateral[De(g)]=b),S!=="0"&&(m.debt[De(g)]=S)}),m}function Qb(e,t,s,r,i){const c=t.protocols.navi,u=[];for(const[f,p]of Object.entries(c.reserves)){const m=r.collateral[De(f)];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:[f],arguments:[e.object(uq),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(dq)]});u.push(e.moveCall({target:"0x2::coin::from_balance",typeArguments:[f],arguments:[y]}))}u.length&&e.transferObjects(u,i)}const Zu=e=>!!e&&Object.keys(e.collateral).length>0&&Object.keys(e.debt).length===0;async function fq(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 f of u.objects){const p=ws(f.type);`${ye(p.address)}::${p.module}::${p.name}`===r&&f.content&&i.push({capId:f.objectId,user:qF(f.content)})}c=u.hasNextPage?u.cursor:null}while(c&&i.length<200);return i}const $O="0x2::allowance::RateLimit",e1="0x6",VO="0x3::staking_pool::StakedSui",Qp=e=>`0x2::balance::Balance<${e}>`;function PO(e,t,s,r,i){const c=t.publishedAt,u=t.packageId,f=e.object(e1),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),f]});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),f]}));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(UF(g.minHealthFactor)),f]}))}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),f]}))}function hq(e,t,s){e.moveCall({target:"0x2::balance::send_funds",typeArguments:[Ut],arguments:[e.balance({balance:t}),e.pure.address(s)]})}function pq(e,t,s,r,i){for(const[c,u]of Object.entries(s)){if(BigInt(u)<=0n)continue;const f=t.demoFaucet&&Vt(t.demoFaucet.coin,c)?t.demoFaucet:null;let p;if(f)p=e.moveCall({target:`${f.packageId}::usdc::mint`,arguments:[e.object(f.faucetId),e.pure.u64(u)]});else if(Vt(c,Ut))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 mq(e,t){const s=e.moveCall({target:"0x2::allowance::periodic_rate_limit",arguments:[e.pure.u64(pp),e.pure.u256(t)]});return e.moveCall({target:"0x1::option::some",typeArguments:[$O],arguments:[s]})}function GO(e,t,s){e.moveCall({target:"0x2::allowance::new",typeArguments:[Qp(Ut)],arguments:[e.pure.string(TO),e.pure.address(s),e.pure.option("u256",t.gasCap),e.pure.option("u64",null),e.pure.option("u64",t.expiresMs),mq(e,t.gasDaily)]})}function gq(e,t,s,r,i,c={}){const u=new Zn;u.setSender(s);const f=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(e1)]}),p=(m,g)=>FO(u,e,f,t,r,m,g);for(const[m,g]of Object.entries(t.allowances))p(m,g);return GO(u,t,r),PO(u,e,f,t.policy,!0),u.moveCall({target:`${e.publishedAt}::pass::share`,arguments:[f]}),pq(u,e,i,c,s),hq(u,t.gasAmount,r),u}function FO(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:[Qp(c),SO(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:[$O]})]})]})}function Oh(e,t,s,r){e.moveCall({target:"0x2::allowance::revoke",typeArguments:[Qp(t)],arguments:[e.object(s),e.object(r)]})}function HO(e,t,s,r){const i=t.publishedAt,c=t.packageId,u=f=>e.moveCall({target:`${i}::pass::remove_policy`,typeArguments:[f],arguments:[s]});for(const f of r.transfers)e.moveCall({target:`${i}::transfer_policy::destroy`,typeArguments:[f.coinType],arguments:[u(`${c}::transfer_policy::TransferPolicy<${f.coinType}>`)]});for(const f of r.swaps)u(`${c}::swap_policy::SwapPolicy<${f.coinIn},${f.coinOut}>`);for(const f of r.lending)u(`${c}::lending_policy::LendingPolicy<${f.coinType}>`);r.staking.length&&u(`${c}::staking_policy::StakingPolicy`)}function yq(e,t,s,r){const i=new Zn;i.setSender(r);const{active:c,control:u}=t,f=i.object(c.passId),p=u.agent;String(s.expiresMs)!==u.agentExpiresMs&&i.moveCall({target:`${e.publishedAt}::pass::set_agent`,arguments:[f,i.object(e.configId),i.pure.address(p),i.pure.u64(s.expiresMs),i.object(e1)]}),HO(i,e,f,u.policies),PO(i,e,f,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),S=c.allowances[b];S&&m(t.allowances[b]??null,y,null)||(S&&Oh(i,b,S.revokeCap,S.allowance),FO(i,e,f,s,p,b,y))}for(const[g,y]of Object.entries(c.allowances))!(De(g)in s.allowances)&&!Object.keys(s.allowances).some(b=>Vt(b,g))&&Oh(i,g,y.revokeCap,y.allowance);return m(t.gas,s.gasCap,s.gasDaily)||(Oh(i,Ut,c.gasRevokeCap,c.gasAllowance),GO(i,s,p)),i}function vq(e,t,s){const r=new Zn;r.setSender(s),r.moveCall({target:`${e.publishedAt}::pass::revoke_agent`,arguments:[r.object(t.passId)]});for(const[i,c,u]of qO(t))r.moveCall({target:"0x2::allowance::revoke",typeArguments:[Qp(i)],arguments:[r.object(c),r.object(u)]});return r}function qO(e){return[...Object.entries(e.allowances).map(([t,s])=>[t,s.revokeCap,s.allowance]),[Ut,e.gasRevokeCap,e.gasAllowance]]}function ZO(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 bq(e,t,s,r=null){const i=new Zn;i.setSender(s),Zu(r)&&await Kb(i,e);const c=ZO(i,e,i.object(t.passId));return Zu(r)&&Qb(i,e,c,r,s),i.transferObjects([c],s),i}function wq(e,t,s,r,i,c=null){return YO(e,[{pass:t,active:s,control:r,position:c}],i)}async function YO(e,t,s){const r=new Zn;r.setSender(s),t.some(i=>i.control.naviPosition&&Zu(i.position))&&await Kb(r,e);for(const i of t)Tq(r,e,i,s);return r}function Tq(e,t,{pass:s,active:r,control:i,position:c},u){const f=t.publishedAt,p=t.packageId,m=e.object(s.passId);if(i.revoked||e.moveCall({target:`${f}::pass::revoke_agent`,arguments:[m]}),r)for(const[y,b,S]of qO(r))Oh(e,y,b,S);HO(e,t,m,i.policies);const g=[];if(i.naviPosition){const y=ZO(e,t,m);Zu(c)&&Qb(e,t,y,c,u),g.push(y)}for(const y of i.stakes){const b=e.moveCall({target:`${f}::staking::stake_key`,arguments:[e.pure.id(y.id)]});g.push(e.moveCall({target:`${f}::pass::withdraw_object`,typeArguments:[`${p}::staking::StakeKey`,VO],arguments:[m,b]}))}g.length&&e.transferObjects(g,u),e.moveCall({target:`${f}::pass::destroy`,arguments:[m]}),e.moveCall({target:`${f}::pass::burn_receipt`,arguments:[e.object(s.receiptId)]})}function Eq(e,t,s,r){const i=new Zn;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`,VO],arguments:[i.object(t.passId),c]});return i.transferObjects([u],s),i}const In=e=>`${e.slice(0,8)}…${e.slice(-6)}`,Yu=e=>`${dd(e,9)} SUI`,Sq=new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}),_q=e=>`${Sq.format(Number(e))} UTC`,WO=(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`},XO=new URLSearchParams(location.search),kq=XO.has("embed"),v4=XO.has("expose-wallet");function Aq(){const[e,t]=Ve.useState(location.hash);Ve.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 na({d:e,kind:t,id:s,children:r}){const i=t==="tx"?hH(e,s):t==="object"?pH(e,s):mH(e,s),c=r??In(s);return i?T.jsx("a",{href:i,target:"_blank",rel:"noreferrer",title:s,children:c}):T.jsx("span",{title:s,children:c})}function JO({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:[WO(i.timestampMs,s)," · ",T.jsx(na,{d:e,kind:"tx",id:i.digest}),r&&i.sender&&T.jsxs(T.Fragment,{children:[" ","· agent ",T.jsx(na,{d:e,kind:"address",id:i.sender})]})]})]})]},i.digest))})}function KO({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 ",In(r.id)]}),T.jsxs("p",{children:["Owner ",In(r.owner)]}),T.jsxs("p",{children:["Agent ",In(r.agent)]}),T.jsxs("p",{children:["Created ",WO(r.timestampMs,s)]})]},r.id))})}const b4=`npm install -g @mysten-incubation/sui-agent-pass
843
843
  agent-pass connect`,Oq="Set up a pass that spends up to 0.5 USDC a day buying SUI, max price 1 USDC, for a week.";function Nq({d:e}){const[t,s]=Ve.useState(!1),r=()=>{navigator.clipboard?.writeText(b4).then(()=>{s(!0),setTimeout(()=>s(!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:"command",role:"group","aria-label":"Install command",children:[T.jsx("code",{children:b4.split(`
844
844
  `).map(i=>T.jsxs("span",{children:[T.jsx("i",{children:"$"})," ",i]},i))}),T.jsx("button",{type:"button",onClick:r,children:t?"Copied":"Copy"})]}),T.jsxs("ol",{className:"three",children:[T.jsxs("li",{children:[T.jsx("span",{className:"n",children:"01"}),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("li",{children:[T.jsx("span",{className:"n",children:"02"}),T.jsx("h3",{children:"Ask your agent"}),T.jsxs("p",{children:['"',Oq,'"']})]}),T.jsxs("li",{children:[T.jsx("span",{className:"n",children:"03"}),T.jsx("h3",{children:"Sign once"}),T.jsx("p",{children:"The agent opens the review page here. 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 xq({d:e}){const t=e.coins.map(i=>i.symbol).join(", "),s=e.pools.map(i=>`${_r(e,i.coinA)}/${_r(e,i.coinB)} on ${i.venue==="deepbook"?"DeepBook":"Cetus"}`).join(", "),r=Object.keys(e.protocols.navi.reserves).map(i=>_r(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 daily and lifetime limits, so it can pay fees. A stolen agent key could drain that gas allowance at its daily rate, and nothing else. Keep it small; the default is a fifth of the gas cap per day."})]}),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 Cq({d:e}){const t=al(),[s,r]=Ve.useState(""),[i,c]=Ve.useState(null),[u,f]=Ve.useState(null),[p,m]=Ve.useState(""),g=Date.now();Ve.useEffect(()=>{RO($t(e),e,24).then(c).catch(b=>m(b.message))},[e.packageId]),Ve.useEffect(()=>{if(!t)return void f(null);_O($t(e),e,t.address).then(f).catch(b=>m(b.message))},[t?.address,e.packageId]);const y=()=>{const b=s.trim();if(!da(b))return m("Enter a pass id or an owner address");m(""),Kp($t(e),e,b).then(S=>{location.hash=S?`#/pass/${S.id}`:`#/owner/${ye(b)}`})};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:b=>r(b.target.value),onKeyDown:b=>b.key==="Enter"&&y()}),T.jsx("button",{className:"primary",style:{width:"auto",marginTop:0},onClick:y,children:"Open"})]}),p&&T.jsx("div",{role:"alert",className:"message error",children:p}),t&&T.jsxs("section",{className:"panel",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Your passes"}),T.jsxs("span",{className:"badge",children:["Receipts in ",In(t.address)]})]}),u===null?T.jsx("p",{className:"empty",children:"Reading your wallet…"}):u.length===0?T.jsx("p",{className:"empty",children:"No pass receipts in this wallet."}):T.jsx("div",{className:"grid",children:u.map(b=>T.jsxs("a",{className:"card",href:`#/pass/${b.pass}`,children:[T.jsx("h3",{children:b.name}),T.jsxs("p",{children:["Pass ",In(b.pass)]}),T.jsxs("p",{children:["Receipt ",In(b.id)]})]},b.id))})]}),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:"#/booth",children:"Booth view →"})]}),i===null?T.jsx("p",{className:"empty",children:"Reading the chain…"}):T.jsx(KO,{d:e,passes:i,now:g})]})]})}function Iq({d:e,owner:t}){const s=bo(),r=al(),[i,c]=Ve.useState(null),[u,f]=Ve.useState(""),[p,m]=Ve.useState(""),g=!!r&&ye(r.address)===ye(t);async function y(){const A=$t(e),N=await fq(A,e,t);c(await Promise.all(N.map(async j=>({...j,position:await yp(A,e,j.user)}))))}Ve.useEffect(()=>{c(null),y().catch(A=>f(A.message))},[t]);async function b(A){if(r){m(A.capId),f("");try{const N=$t(e),j=new Zn;j.setSender(r.address),await Kb(j,e),Qb(j,e,j.object(A.capId),A.position,r.address);const V=await s.signTransaction({transaction:j}),C=await N.executeTransaction({transaction:qe(V.bytes),signatures:[V.signature]});if(C.$kind==="FailedTransaction")throw new Error(`Chain refused: ${C.FailedTransaction.status.error?.message}`);await N.waitForTransaction({result:C}),await y()}catch(N){f(N.message)}finally{m("")}}}const S=i?.filter(A=>Object.keys(A.position.collateral).length||Object.keys(A.position.debt).length);return S?.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}),S.map(A=>T.jsxs("div",{className:"rule",children:[T.jsxs("span",{children:["Account ",T.jsx("span",{className:"mono",children:In(A.capId)})]}),T.jsxs("strong",{children:[Object.entries(A.position.collateral).map(([N,j])=>bn(e,N,j)).join(" · ")||"nothing supplied",Object.keys(A.position.debt).length?` · owes ${Object.entries(A.position.debt).map(([N,j])=>bn(e,N,j)).join(" · ")}`:"",g&&Zu(A.position)&&T.jsx("button",{className:"inline",disabled:!!p,onClick:()=>{b(A)},children:p===A.capId?"Confirming…":"Withdraw to my wallet"}),Object.keys(A.position.debt).length>0&&T.jsx("span",{className:"fine",children:" (repay the debt before withdrawing)"})]})]},A.capId))]}):null}function Rq({d:e,owner:t}){const s=bo(),r=al(),[i,c]=Ve.useState(null),[u,f]=Ve.useState(""),[p,m]=Ve.useState(""),[g,y]=Ve.useState(!1),[b,S]=Ve.useState(new Set),A=!!r&&ye(r.address)===ye(t);function N(){return _O($t(e),e,t).then(C=>{c(C),S(new Set)}).catch(C=>f(C.message))}Ve.useEffect(()=>{N()},[t]);async function j(){if(!(!r||!i)){y(!0),f(""),m("");try{const C=$t(e),W=await Promise.all(i.filter(Y=>b.has(Y.pass)).map(async Y=>{const K=await Kp(C,e,Y.pass);if(!K)throw new Error(`No pass ${In(Y.pass)} was created on this package`);const[w,O]=await Promise.all([Jp(C,e,Y.pass),Yb(C,e,K)]),x=w.naviPosition?await yp(C,e,w.naviPosition):null;return{pass:{passId:Y.pass,receiptId:Y.id},active:O,control:w,position:x}})),ce=await s.signTransaction({transaction:await YO(e,W,r.address)}),ae=await C.executeTransaction({transaction:qe(ce.bytes),signatures:[ce.signature]});if(ae.$kind==="FailedTransaction")throw new Error(`Chain refused: ${ae.FailedTransaction.status.error?.message}`);await C.waitForTransaction({result:ae}),m(`${W.length} ${W.length===1?"pass":"passes"} closed in one transaction; the storage deposits came back with the gas.`),await N()}catch(C){f(C.message)}finally{y(!1)}}}const V=C=>S(W=>{const ce=new Set(W);return ce.has(C)?ce.delete(C):ce.add(C),ce});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:[A&&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:()=>S(b.size===i.length?new Set:new Set(i.map(C=>C.pass))),children:b.size===i.length?"Clear":"Select all"})]}),T.jsx("div",{className:"grid",children:i.map(C=>T.jsxs("div",{className:"card",children:[A&&T.jsxs("label",{className:"pick",children:[T.jsx("input",{type:"checkbox",checked:b.has(C.pass),disabled:g,onChange:()=>V(C.pass)})," ","Close"]}),T.jsxs("a",{href:`#/pass/${C.pass}`,children:[T.jsx("h3",{children:C.name}),T.jsxs("p",{children:["Pass ",In(C.pass)]})]})]},C.id))}),A&&T.jsx("button",{className:"primary",disabled:g||b.size===0,onClick:()=>{j()},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(Iq,{d:e,owner:t})]})}function QO({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 jq({d:e,passId:t,ready:s}){const r=bo(),i=al(),[c,u]=Ve.useState(null),[f,p]=Ve.useState(!1),[m,g]=Ve.useState(""),[y,b]=Ve.useState(""),[S,A]=Ve.useState(!1),N=Date.now();async function j(k=!1){const I=$t(e),D=k||!c?await Kp(I,e,t):c.summary;if(!D)return void p(!0);const L=await Jp(I,e,D.id),X=k||!c?await Zb(I,e,mp(Nv(e,L))):c.dx,z=k||!c?await Yb(I,X,D):c.active,[ie,fe,R]=await Promise.all([z?OO(I,z):null,cH(I,X,D.owner),EH(I,X,L.agent,L.policies.transfers[0]?.recipients??[])]);u({summary:D,control:L,active:z,allowances:ie,balances:fe,attempts:R,dx:X})}Ve.useEffect(()=>{u(null),p(!1),j(!0).catch(I=>g(I.message));const k=setInterval(()=>{j().catch(()=>{})},5e3);return()=>clearInterval(k)},[t]);async function V(k,I,D){if(i){A(!0),g(""),b("");try{const L=await r.signTransaction({transaction:await k()}),X=$t(e),z=await X.executeTransaction({transaction:qe(L.bytes),signatures:[L.signature]});if(z.$kind==="FailedTransaction")throw new Error(`Chain refused: ${z.FailedTransaction.status.error?.message}`);if(await X.waitForTransaction({result:z}),b(I),D)return D();await j(!0)}catch(L){g(L.message)}finally{A(!1)}}}if(f)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 ",In(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 ",In(t)]}),m?T.jsx("div",{className:"message error",children:m}):T.jsx("p",{className:"empty",children:"Reading the chain…"})]});const{summary:C,control:W,active:ce,allowances:ae,balances:Y,attempts:K,dx:w}=c,O=W.revoked||!ce,x=!O&&Number(W.agentExpiresMs)<=W.chainTimeMs,G=!!i&&ye(i.address)===W.owner,U=k=>_r(w,k),H=k=>k?(BigInt(k.lifetimeCap??"0")-BigInt(k.currentSpend)).toString():null,$=ae?Object.entries(ae).map(([k,I])=>[k,H(I)]):[],M=[...W.policies.transfers.map(k=>({label:`${U(k.coinType)} paid today`,value:bn(w,k.coinType,k.usage.usedToday)})),...W.policies.swaps.map(k=>({label:`${U(k.coinIn)} sold for ${U(k.coinOut)} today`,value:bn(w,k.coinIn,k.usage.usedToday)})),...W.policies.lending.map(k=>({label:`${U(k.coinType)} ${k.allowBorrow?"lent, borrowed or repaid":"supplied or withdrawn"} today`,value:bn(w,k.coinType,k.usage.usedToday)})),...W.policies.staking.map(k=>({label:"SUI staked today",value:Yu(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 ",In(W.owner)]})," › ",C.name]}),T.jsxs("section",{className:"hero",style:{padding:"28px 0 20px"},children:[T.jsx("h1",{style:{fontSize:44},children:C.name}),T.jsxs("p",{className:"intro",children:["Pass"," ",T.jsx(na,{d:e,kind:"object",id:C.id,children:C.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(JO,{d:e,attempts:K,now:N})]}),T.jsxs("section",{className:"panel rules",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Policies"}),T.jsx("span",{className:`badge ${O||x?"muted":""}`,children:O?"Revoked":x?"Expired":"Authorized"})]}),T.jsx(QO,{rows:xO(w,Nv(w,W),W.policies)}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Agent term ends"}),T.jsx("strong",{children:W.revoked?"Revoked":_q(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:[dd(Y[k.type]??"0",k.decimals)," ",T.jsx("span",{children:_r(w,k.type)})]},k.type)),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Key may still withdraw"}),T.jsx("strong",{children:$.length&&$.every(([,k])=>k!==null)?$.map(([k,I])=>bn(w,k,I)).join(" · "):"Nothing; allowances deleted"})]}),M.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(na,{d:e,kind:"address",id:W.naviPosition}),G&&T.jsx("button",{className:"inline",disabled:S,onClick:()=>{V(async()=>bq(w,{passId:C.id},i.address,await yp($t(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(na,{d:e,kind:"object",id:k.id})]}),T.jsxs("strong",{children:[Yu(k.principal),G&&T.jsx("button",{className:"inline",disabled:S,onClick:()=>{V(()=>Eq(e,{passId:C.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."}),G&&!O&&!x&&ce&&T.jsxs("div",{className:"owner-actions",children:[T.jsx("button",{className:"revoke",disabled:S,onClick:()=>{V(()=>vq(e,ce,i.address),"Stopped on chain. This key can no longer withdraw from your balance; the rules stay, so a new key can take over later.")},children:"Stop the agent now"}),T.jsx("p",{className:"fine",children:"Instant and small: the key is cut off and the allowances deleted. The rules and today's usage stay, so a new key can take over later without a new pass."})]}),G&&T.jsxs("div",{className:"owner-actions",children:[T.jsx("button",{className:"revoke",disabled:S,onClick:()=>{V(async()=>wq(w,{passId:C.id,receiptId:C.receiptId},ce,W,i.address,W.naviPosition?await yp($t(e),w,W.naviPosition):null),"Pass closed; its storage deposits came back with the gas.",()=>{location.hash=`#/owner/${W.owner}`})},children:O?"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(na,{d:e,kind:"address",id:W.owner,children:W.owner})}),T.jsx("dt",{children:"Agent"}),T.jsx("dd",{children:T.jsx(na,{d:e,kind:"address",id:W.agent,children:W.agent})}),T.jsx("dt",{children:"Receipt"}),T.jsx("dd",{children:T.jsx(na,{d:e,kind:"object",id:C.receiptId,children:C.receiptId})}),T.jsx("dt",{children:"Authorization"}),T.jsx("dd",{children:T.jsx(na,{d:e,kind:"tx",id:C.digest,children:C.digest})}),ce&&T.jsxs(T.Fragment,{children:[Object.entries(ce.allowances).map(([k,I])=>T.jsxs(S3.Fragment,{children:[T.jsxs("dt",{children:[U(k)," allowance"]}),T.jsx("dd",{children:I.allowance})]},k)),T.jsx("dt",{children:"Gas allowance"}),T.jsx("dd",{children:ce.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:['"',Mq(w,W),'"']})]})]})}function Mq(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 ${bn(e,r.coinType,r.perTransfer)} to ${r.recipients[0]?.name??"the recipient in my rules"}`:i?Gb(e,i.coinIn,i.coinOut).limit==="max"?`Buy ${_r(e,i.coinOut)} with ${bn(e,i.coinIn,i.perTrade)}`:`Sell ${bn(e,i.coinIn,i.perTrade)} for ${_r(e,i.coinOut)}`:c?`Supply ${bn(e,c.coinType,c.perAction)} to NAVI`:u?`Stake ${Yu(u.perStake)}`:"Make the first action my rules allow"}, then show me the transaction and what you may still do today.`}function Nv(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 Dq({d:e}){const[t,s]=Ve.useState([]),[r,i]=Ve.useState([]),[c,u]=Ve.useState(""),f=Date.now();Ve.useEffect(()=>{const m=$t(e),g=()=>{Promise.all([RO(m,e,12),SH(m,e,40)]).then(([b,S])=>{s(b),i(S),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(JO,{d:e,attempts:r,now:f,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(KO,{d:e,passes:t,now:f})]})]})]})}function Uq({d:e,proposal:t}){const s=bo(),r=al(),[i,c]=Ve.useState(null),[u,f]=Ve.useState(""),[p,m]=Ve.useState(!1),g=t.setup;async function y(){const N=$t(e),j=await Kp(N,e,t.passId);if(!j)throw new Error(`No pass ${In(t.passId)} was created on this package`);const V=await Jp(N,e,j.id);if(V.agent!==ye(t.sessionAddress))throw new Error("This proposal names a different agent key than the pass has");const C=Nv(e,V),W=mp(g.policy),ce=mp(C),ae=await Zb(N,e,{coins:[...W.coins,...ce.coins],pools:[...W.pools,...ce.pools]}),Y=await Yb(N,ae,j);if(!Y)throw new Error("This pass has no live allowances; it was stopped or closed");const[K,w]=await Promise.all([OO(N,Y),qb(N,Y.gasAllowance,Ut)]),O={name:V.name,policy:C,ttlMs:g.ttlMs,expiresMs:Number(V.agentExpiresMs),allowances:Object.fromEntries(Object.entries(K).map(([H,$])=>[H,$?.lifetimeCap??"0"])),gasAmount:g.gasAmount,gasCap:w?.lifetimeCap??"0",gasDaily:w?.rateLimit?.limit??"0"},x=Ov(ae,O),G=Ov(ae,g),U=H=>H.filter($=>!/^Authorization ends|^Gas to the agent/.test($.label)).map($=>`${$.label}=${$.value}`).sort().join(`