"use strict";var a=Object.defineProperty;var p=(e,t,i)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var s=(e,t,i)=>p(e,typeof t!="symbol"?t+"":t,i);const o=require("./address-RcMobNYE.js"),h="0x1::aptos_coin::AptosCoin",r="::",c="Aptos",u=e=>/^(0x)?[0-9a-fA-F]+::\w+::\w+$/.test(e),A=e=>e.split(r)[0];function f(e){return e.length%2!==0||e.length<66?(e=e.startsWith("0x")?e.slice(2):e,"0x"+e.padStart(64,"0")):e}const n=class n{constructor(t){s(this,"type","Native");s(this,"address");s(this,"module");if(n.instanceof(t))this.address=t.address,this.module=t.module;else if(o.UniversalAddress.instanceof(t))this.address=t.toUint8Array();else if(typeof t=="string"){if(u(t)){const i=t.split(r);this.module=i.slice(1).join(r),t=i[0]}if(t=f(t),!o.hex.valid(t))throw new Error("Invalid Aptos address: "+t);this.address=o.hex.decode(t)}else this.address=t}unwrap(){const t=o.hex.encode(this.address).replace(/^0+/,""),i=this.module?r+this.module:"";return`0x${t}${i}`}toString(){return this.unwrap()}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){return new o.UniversalAddress(this.toUint8Array())}static instanceof(t){return t.constructor.platform===n.platform}equals(t){return n.instanceof(t)?t.unwrap()===this.unwrap():this.toUniversalAddress().equals(t)}};s(n,"byteSize",32),s(n,"platform",c);let l=n;o.registerNative(c,l);exports.APTOS_COIN=h;exports.APTOS_SEPARATOR=r;exports.AptosAddress=l;exports._platform=c;exports.coalesceModuleAddress=A;exports.isValidAptosType=u;
